diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 00000000..09a63d3e --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,4 @@ +{ +"typescript.validate.enable": false, +"javascript.validate.enable": false +} \ No newline at end of file diff --git a/packages/controlled-vocabulary/package.json b/packages/controlled-vocabulary/package.json index 1ac3016e..2927c196 100644 --- a/packages/controlled-vocabulary/package.json +++ b/packages/controlled-vocabulary/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/controlled-vocabulary", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "A package of components to allow user to configure dropdown elements. Use with the \"controlled_vocabulary\" gem.", "license": "MIT", "main": "./build/index.js", @@ -12,8 +12,8 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/semantic-components": "^1.1.3", - "@performant-software/shared-components": "^1.1.3", + "@performant-software/semantic-components": "^1.1.4-beta.10", + "@performant-software/shared-components": "^1.1.4-beta.10", "i18next": "^21.9.2", "semantic-ui-react": "^2.1.2", "underscore": "^1.13.2" diff --git a/packages/geospatial/package.json b/packages/geospatial/package.json index e37e47ea..5421a3b6 100644 --- a/packages/geospatial/package.json +++ b/packages/geospatial/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/geospatial", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "TODO: ADD", "license": "MIT", "main": "./build/index.js", diff --git a/packages/semantic-ui/package.json b/packages/semantic-ui/package.json index d4fa3d8a..e03bf8f1 100644 --- a/packages/semantic-ui/package.json +++ b/packages/semantic-ui/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/semantic-components", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "A package of shared components based on the Semantic UI Framework.", "license": "MIT", "main": "./build/index.js", @@ -12,7 +12,7 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/shared-components": "^1.1.3", + "@performant-software/shared-components": "^1.1.4-beta.10", "@react-google-maps/api": "^2.8.1", "axios": "^0.26.1", "i18next": "^19.4.4", diff --git a/packages/semantic-ui/src/components/AnnotationLayer.css b/packages/semantic-ui/src/components/AnnotationLayer.css new file mode 100644 index 00000000..db3f1bce --- /dev/null +++ b/packages/semantic-ui/src/components/AnnotationLayer.css @@ -0,0 +1,329 @@ +/* Copyright 2014 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +:root { + --react-pdf-annotation-layer: 1; + --annotation-unfocused-field-background: url("data:image/svg+xml;charset=UTF-8,"); + --input-focus-border-color: Highlight; + --input-focus-outline: 1px solid Canvas; + --input-unfocused-border-color: transparent; + --input-disabled-border-color: transparent; + --input-hover-border-color: black; + --link-outline: none; +} + +@media screen and (forced-colors: active) { + :root { + --input-focus-border-color: CanvasText; + --input-unfocused-border-color: ActiveText; + --input-disabled-border-color: GrayText; + --input-hover-border-color: Highlight; + --link-outline: 1.5px solid LinkText; + } + .annotationLayer .textWidgetAnnotation :is(input, textarea):required, + .annotationLayer .choiceWidgetAnnotation select:required, + .annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required { + outline: 1.5px solid selectedItem; + } + + .annotationLayer .linkAnnotation:hover { + backdrop-filter: invert(100%); + } +} + +.annotationLayer { + position: absolute; + top: 0; + left: 0; + pointer-events: none; + transform-origin: 0 0; + z-index: 3; +} + +.annotationLayer[data-main-rotation='90'] .norotate { + transform: rotate(270deg) translateX(-100%); +} +.annotationLayer[data-main-rotation='180'] .norotate { + transform: rotate(180deg) translate(-100%, -100%); +} +.annotationLayer[data-main-rotation='270'] .norotate { + transform: rotate(90deg) translateY(-100%); +} + +.annotationLayer canvas { + position: absolute; + width: 100%; + height: 100%; +} + +.annotationLayer section { + position: absolute; + text-align: initial; + pointer-events: auto; + box-sizing: border-box; + margin: 0; + transform-origin: 0 0; +} + +.annotationLayer .linkAnnotation { + outline: var(--link-outline); +} + +.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a { + position: absolute; + font-size: 1em; + top: 0; + left: 0; + width: 100%; + height: 100%; +} + +.annotationLayer :is(.linkAnnotation, .buttonWidgetAnnotation.pushButton) > a:hover { + opacity: 0.2; + background: rgba(255, 255, 0, 1); + box-shadow: 0 2px 10px rgba(255, 255, 0, 1); +} + +.annotationLayer .textAnnotation img { + position: absolute; + cursor: pointer; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea), +.annotationLayer .choiceWidgetAnnotation select, +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { + background-image: var(--annotation-unfocused-field-background); + border: 2px solid var(--input-unfocused-border-color); + box-sizing: border-box; + font: calc(9px * var(--scale-factor)) sans-serif; + height: 100%; + margin: 0; + vertical-align: top; + width: 100%; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):required, +.annotationLayer .choiceWidgetAnnotation select:required, +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:required { + outline: 1.5px solid red; +} + +.annotationLayer .choiceWidgetAnnotation select option { + padding: 0; +} + +.annotationLayer .buttonWidgetAnnotation.radioButton input { + border-radius: 50%; +} + +.annotationLayer .textWidgetAnnotation textarea { + resize: none; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea)[disabled], +.annotationLayer .choiceWidgetAnnotation select[disabled], +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input[disabled] { + background: none; + border: 2px solid var(--input-disabled-border-color); + cursor: not-allowed; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):hover, +.annotationLayer .choiceWidgetAnnotation select:hover, +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input:hover { + border: 2px solid var(--input-hover-border-color); +} +.annotationLayer .textWidgetAnnotation :is(input, textarea):hover, +.annotationLayer .choiceWidgetAnnotation select:hover, +.annotationLayer .buttonWidgetAnnotation.checkBox input:hover { + border-radius: 2px; +} + +.annotationLayer .textWidgetAnnotation :is(input, textarea):focus, +.annotationLayer .choiceWidgetAnnotation select:focus { + background: none; + border: 2px solid var(--input-focus-border-color); + border-radius: 2px; + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) :focus { + background-image: none; + background-color: transparent; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox :focus { + border: 2px solid var(--input-focus-border-color); + border-radius: 2px; + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation.radioButton :focus { + border: 2px solid var(--input-focus-border-color); + outline: var(--input-focus-outline); +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before, +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after, +.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before { + background-color: CanvasText; + content: ''; + display: block; + position: absolute; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before, +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after { + height: 80%; + left: 45%; + width: 1px; +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::before { + transform: rotate(45deg); +} + +.annotationLayer .buttonWidgetAnnotation.checkBox input:checked::after { + transform: rotate(-45deg); +} + +.annotationLayer .buttonWidgetAnnotation.radioButton input:checked::before { + border-radius: 50%; + height: 50%; + left: 30%; + top: 20%; + width: 50%; +} + +.annotationLayer .textWidgetAnnotation input.comb { + font-family: monospace; + padding-left: 2px; + padding-right: 0; +} + +.annotationLayer .textWidgetAnnotation input.comb:focus { + /* + * Letter spacing is placed on the right side of each character. Hence, the + * letter spacing of the last character may be placed outside the visible + * area, causing horizontal scrolling. We avoid this by extending the width + * when the element has focus and revert this when it loses focus. + */ + width: 103%; +} + +.annotationLayer .buttonWidgetAnnotation:is(.checkBox, .radioButton) input { + appearance: none; +} + +.annotationLayer .popupTriggerArea { + height: 100%; + width: 100%; +} + +.annotationLayer .fileAttachmentAnnotation .popupTriggerArea { + position: absolute; +} + +.annotationLayer .popupWrapper { + position: absolute; + font-size: calc(9px * var(--scale-factor)); + width: 100%; + min-width: calc(180px * var(--scale-factor)); + pointer-events: none; +} + +.annotationLayer .popup { + position: absolute; + max-width: calc(180px * var(--scale-factor)); + background-color: rgba(255, 255, 153, 1); + box-shadow: 0 calc(2px * var(--scale-factor)) calc(5px * var(--scale-factor)) + rgba(136, 136, 136, 1); + border-radius: calc(2px * var(--scale-factor)); + padding: calc(6px * var(--scale-factor)); + margin-left: calc(5px * var(--scale-factor)); + cursor: pointer; + font: message-box; + white-space: normal; + word-wrap: break-word; + pointer-events: auto; +} + +.annotationLayer .popup > * { + font-size: calc(9px * var(--scale-factor)); +} + +.annotationLayer .popup h1 { + display: inline-block; +} + +.annotationLayer .popupDate { + display: inline-block; + margin-left: calc(5px * var(--scale-factor)); +} + +.annotationLayer .popupContent { + border-top: 1px solid rgba(51, 51, 51, 1); + margin-top: calc(2px * var(--scale-factor)); + padding-top: calc(2px * var(--scale-factor)); +} + +.annotationLayer .richText > * { + white-space: pre-wrap; + font-size: calc(9px * var(--scale-factor)); +} + +.annotationLayer .highlightAnnotation, +.annotationLayer .underlineAnnotation, +.annotationLayer .squigglyAnnotation, +.annotationLayer .strikeoutAnnotation, +.annotationLayer .freeTextAnnotation, +.annotationLayer .lineAnnotation svg line, +.annotationLayer .squareAnnotation svg rect, +.annotationLayer .circleAnnotation svg ellipse, +.annotationLayer .polylineAnnotation svg polyline, +.annotationLayer .polygonAnnotation svg polygon, +.annotationLayer .caretAnnotation, +.annotationLayer .inkAnnotation svg polyline, +.annotationLayer .stampAnnotation, +.annotationLayer .fileAttachmentAnnotation { + cursor: pointer; +} + +.annotationLayer section svg { + position: absolute; + width: 100%; + height: 100%; + top: 0; + left: 0; +} + +.annotationLayer .annotationTextContent { + position: absolute; + width: 100%; + height: 100%; + opacity: 0; + color: transparent; + user-select: none; + pointer-events: none; +} + +.annotationLayer .annotationTextContent span { + width: 100%; + display: inline-block; +} diff --git a/packages/semantic-ui/src/components/FacetSlider.css b/packages/semantic-ui/src/components/FacetSlider.css index 4392ed0d..7ba49032 100644 --- a/packages/semantic-ui/src/components/FacetSlider.css +++ b/packages/semantic-ui/src/components/FacetSlider.css @@ -1,3 +1,5 @@ +@import 'rc-slider/assets/index.css'; + .facet-slider > .ui.grid { margin-top: 0em; } diff --git a/packages/semantic-ui/src/components/FacetSlider.js b/packages/semantic-ui/src/components/FacetSlider.js index ce7c3c53..57fac68e 100644 --- a/packages/semantic-ui/src/components/FacetSlider.js +++ b/packages/semantic-ui/src/components/FacetSlider.js @@ -10,7 +10,7 @@ import React, { import { Grid } from 'semantic-ui-react'; import Facet, { type Props as FacetProps } from './Facet'; import { type RangeSliderProps } from '../types/InstantSearch'; -import 'rc-slider/assets/index.css'; + import './FacetSlider.css'; type Props = FacetProps & RangeSliderProps; @@ -25,7 +25,7 @@ const FacetSlider = forwardRef(({ useRangeSlider, ...props }: Props, ref: HTMLEl refine, } = useRangeSlider(props); - const [valueView, setValueView] = useState>([range.min, range.max]); + const [valueView, setValueView] = useState < Array < number >> ([range.min, range.max]); /** * Sets the visibility variable based on the range min and max. @@ -72,12 +72,12 @@ const FacetSlider = forwardRef(({ useRangeSlider, ...props }: Props, ref: HTMLEl columns={2} > - { valueView[0] } + {valueView[0]} - { valueView[1] } + {valueView[1]} diff --git a/packages/semantic-ui/src/components/LazyDocument.css b/packages/semantic-ui/src/components/LazyDocument.css index c03027ad..f6ff476b 100644 --- a/packages/semantic-ui/src/components/LazyDocument.css +++ b/packages/semantic-ui/src/components/LazyDocument.css @@ -1,3 +1,6 @@ +@import 'react-pdf/dist/esm/Page/AnnotationLayer.css'; +@import 'react-pdf/dist/esm/Page/TextLayer.css'; + .lazy-document.ui.segment { display: inline-block !important; max-width: 100%; diff --git a/packages/semantic-ui/src/components/LazyDocument.js b/packages/semantic-ui/src/components/LazyDocument.js index 85bb5ab3..853d74af 100644 --- a/packages/semantic-ui/src/components/LazyDocument.js +++ b/packages/semantic-ui/src/components/LazyDocument.js @@ -14,9 +14,8 @@ import { import DownloadButton from './DownloadButton'; import LazyLoader from './LazyLoader'; -import 'react-pdf/dist/esm/Page/AnnotationLayer.css'; -import 'react-pdf/dist/esm/Page/TextLayer.css'; import './LazyDocument.css'; +import ViewPDFButton from './ViewPDFButton'; type Props = { children?: Node, @@ -26,6 +25,8 @@ type Props = { image?: any, pdf?: boolean, preview?: ?string, + view?: Boolean, + viewUrl?: String, size?: string, src?: string }; @@ -87,13 +88,13 @@ const LazyDocument = (props: Props) => { onMouseEnter={() => setDimmer(true)} onMouseLeave={() => setDimmer(false)} > - { !loaded && ( + {!loaded && ( )} - { !error && props.preview && ( + {!error && props.preview && ( { size={props.size} /> )} - { !error && loaded && !props.preview && props.src && props.pdf && ( + {!error && loaded && !props.preview && props.src && props.pdf && ( { )} - { (error || (!props.preview && !(props.src && props.pdf))) && ( + {!error && loaded && props.view && props.viewUrl && props.pdf && dimmer && ( + +
+ +
+
+ )} + {(error || (!props.preview && !(props.src && props.pdf))) && ( { /> )} - { (props.download || props.src || props.children) && props.dimmable && ( + {(props.download || props.src || props.children) && props.dimmable && (
- { props.download && ( + {props.download && ( )} - { props.children } + {props.children}
)} diff --git a/packages/semantic-ui/src/components/TextLayer.css b/packages/semantic-ui/src/components/TextLayer.css new file mode 100644 index 00000000..592ec1c4 --- /dev/null +++ b/packages/semantic-ui/src/components/TextLayer.css @@ -0,0 +1,110 @@ +/* Copyright 2014 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +:root { + --react-pdf-text-layer: 1; + --highlight-bg-color: rgba(180, 0, 170, 1); + --highlight-selected-bg-color: rgba(0, 100, 0, 1); +} + +@media screen and (forced-colors: active) { + :root { + --highlight-bg-color: Highlight; + --highlight-selected-bg-color: ButtonText; + } +} + +[data-main-rotation='90'] { + transform: rotate(90deg) translateY(-100%); +} +[data-main-rotation='180'] { + transform: rotate(180deg) translate(-100%, -100%); +} +[data-main-rotation='270'] { + transform: rotate(270deg) translateX(-100%); +} + +.textLayer { + position: absolute; + text-align: initial; + inset: 0; + overflow: hidden; + line-height: 1; + text-size-adjust: none; + forced-color-adjust: none; + transform-origin: 0 0; + z-index: 2; +} + +.textLayer :is(span, br) { + color: transparent; + position: absolute; + white-space: pre; + cursor: text; + margin: 0; + transform-origin: 0 0; +} + +/* Only necessary in Google Chrome, see issue 14205, and most unfortunately + * the problem doesn't show up in "text" reference tests. */ +.textLayer span.markedContent { + top: 0; + height: 0; +} + +.textLayer .highlight { + margin: -1px; + padding: 1px; + background-color: var(--highlight-bg-color); + border-radius: 4px; +} + +.textLayer .highlight.appended { + position: initial; +} + +.textLayer .highlight.begin { + border-radius: 4px 0 0 4px; +} + +.textLayer .highlight.end { + border-radius: 0 4px 4px 0; +} + +.textLayer .highlight.middle { + border-radius: 0; +} + +.textLayer .highlight.selected { + background-color: var(--highlight-selected-bg-color); +} + +/* Avoids https://github.com/mozilla/pdf.js/issues/13840 in Chrome */ +.textLayer br::selection { + background: transparent; +} + +.textLayer .endOfContent { + display: block; + position: absolute; + inset: 100% 0 0; + z-index: -1; + cursor: default; + user-select: none; +} + +.textLayer .endOfContent.active { + top: 0; +} diff --git a/packages/semantic-ui/src/components/ViewPDFButton.js b/packages/semantic-ui/src/components/ViewPDFButton.js new file mode 100644 index 00000000..db1a750e --- /dev/null +++ b/packages/semantic-ui/src/components/ViewPDFButton.js @@ -0,0 +1,68 @@ +// @flow + +import React, { useMemo } from 'react'; +import { Icon, Button } from 'semantic-ui-react'; +import i18n from '../i18n/i18n'; + +type Props = { + basic?: boolean, + className?: string, + color?: string, + compact?: boolean, + primary?: boolean, + size?: string, + secondary?: boolean, + url: string, +}; + +const ViewPDFButton = (props: Props) => { + /** + * Sets the appropriate class names based on the formatting props. + * + * @type {string} + */ + const className = useMemo(() => { + const classNames = ['ui', 'button']; + + if (props.basic) { + classNames.push('basic'); + } + + if (props.className) { + classNames.push(...props.className.split(' ')); + } + + if (props.color) { + classNames.push(props.color); + } + + if (props.compact) { + classNames.push('compact'); + } + + if (props.primary) { + classNames.push('primary'); + } + + if (props.secondary) { + classNames.push('secondary'); + } + + if (props.size) { + classNames.push(props.size); + } + + return classNames.join(' '); + }, [props.basic, props.color]); + + return ( + + ); +}; + +export default ViewPDFButton; diff --git a/packages/semantic-ui/src/components/rc-slider.css b/packages/semantic-ui/src/components/rc-slider.css new file mode 100644 index 00000000..3d521941 --- /dev/null +++ b/packages/semantic-ui/src/components/rc-slider.css @@ -0,0 +1,267 @@ +.rc-slider { + position: relative; + width: 100%; + height: 14px; + padding: 5px 0; + border-radius: 6px; + touch-action: none; + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.rc-slider * { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.rc-slider-rail { + position: absolute; + width: 100%; + height: 4px; + background-color: #e9e9e9; + border-radius: 6px; +} +.rc-slider-track { + position: absolute; + height: 4px; + background-color: #abe2fb; + border-radius: 6px; +} +.rc-slider-track-draggable { + z-index: 1; + box-sizing: content-box; + background-clip: content-box; + border-top: 5px solid rgba(0, 0, 0, 0); + border-bottom: 5px solid rgba(0, 0, 0, 0); + transform: translateY(-5px); +} +.rc-slider-handle { + position: absolute; + width: 14px; + height: 14px; + margin-top: -5px; + background-color: #fff; + border: solid 2px #96dbfa; + border-radius: 50%; + cursor: pointer; + cursor: -webkit-grab; + cursor: grab; + opacity: 0.8; + touch-action: pan-x; +} +.rc-slider-handle-dragging.rc-slider-handle-dragging.rc-slider-handle-dragging { + border-color: #57c5f7; + box-shadow: 0 0 0 5px #96dbfa; +} +.rc-slider-handle:focus { + outline: none; + box-shadow: none; +} +.rc-slider-handle:focus-visible { + border-color: #2db7f5; + box-shadow: 0 0 0 3px #96dbfa; +} +.rc-slider-handle-click-focused:focus { + border-color: #96dbfa; + box-shadow: unset; +} +.rc-slider-handle:hover { + border-color: #57c5f7; +} +.rc-slider-handle:active { + border-color: #57c5f7; + box-shadow: 0 0 5px #57c5f7; + cursor: -webkit-grabbing; + cursor: grabbing; +} +.rc-slider-mark { + position: absolute; + top: 18px; + left: 0; + width: 100%; + font-size: 12px; +} +.rc-slider-mark-text { + position: absolute; + display: inline-block; + color: #999; + text-align: center; + vertical-align: middle; + cursor: pointer; +} +.rc-slider-mark-text-active { + color: #666; +} +.rc-slider-step { + position: absolute; + width: 100%; + height: 4px; + background: transparent; +} +.rc-slider-dot { + position: absolute; + bottom: -2px; + width: 8px; + height: 8px; + vertical-align: middle; + background-color: #fff; + border: 2px solid #e9e9e9; + border-radius: 50%; + cursor: pointer; +} +.rc-slider-dot-active { + border-color: #96dbfa; +} +.rc-slider-dot-reverse { + margin-right: -4px; +} +.rc-slider-disabled { + background-color: #e9e9e9; +} +.rc-slider-disabled .rc-slider-track { + background-color: #ccc; +} +.rc-slider-disabled .rc-slider-handle, +.rc-slider-disabled .rc-slider-dot { + background-color: #fff; + border-color: #ccc; + box-shadow: none; + cursor: not-allowed; +} +.rc-slider-disabled .rc-slider-mark-text, +.rc-slider-disabled .rc-slider-dot { + cursor: not-allowed !important; +} +.rc-slider-vertical { + width: 14px; + height: 100%; + padding: 0 5px; +} +.rc-slider-vertical .rc-slider-rail { + width: 4px; + height: 100%; +} +.rc-slider-vertical .rc-slider-track { + bottom: 0; + left: 5px; + width: 4px; +} +.rc-slider-vertical .rc-slider-track-draggable { + border-top: 0; + border-bottom: 0; + border-right: 5px solid rgba(0, 0, 0, 0); + border-left: 5px solid rgba(0, 0, 0, 0); + transform: translateX(-5px); +} +.rc-slider-vertical .rc-slider-handle { + margin-top: 0; + margin-left: -5px; + touch-action: pan-y; +} +.rc-slider-vertical .rc-slider-mark { + top: 0; + left: 18px; + height: 100%; +} +.rc-slider-vertical .rc-slider-step { + width: 4px; + height: 100%; +} +.rc-slider-vertical .rc-slider-dot { + margin-left: -2px; +} +.rc-slider-tooltip-zoom-down-enter, +.rc-slider-tooltip-zoom-down-appear { + display: block !important; + animation-duration: 0.3s; + animation-fill-mode: both; + animation-play-state: paused; +} +.rc-slider-tooltip-zoom-down-leave { + display: block !important; + animation-duration: 0.3s; + animation-fill-mode: both; + animation-play-state: paused; +} +.rc-slider-tooltip-zoom-down-enter.rc-slider-tooltip-zoom-down-enter-active, +.rc-slider-tooltip-zoom-down-appear.rc-slider-tooltip-zoom-down-appear-active { + animation-name: rcSliderTooltipZoomDownIn; + animation-play-state: running; +} +.rc-slider-tooltip-zoom-down-leave.rc-slider-tooltip-zoom-down-leave-active { + animation-name: rcSliderTooltipZoomDownOut; + animation-play-state: running; +} +.rc-slider-tooltip-zoom-down-enter, +.rc-slider-tooltip-zoom-down-appear { + transform: scale(0, 0); + animation-timing-function: cubic-bezier(0.23, 1, 0.32, 1); +} +.rc-slider-tooltip-zoom-down-leave { + animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06); +} +@keyframes rcSliderTooltipZoomDownIn { + 0% { + transform: scale(0, 0); + transform-origin: 50% 100%; + opacity: 0; + } + 100% { + transform: scale(1, 1); + transform-origin: 50% 100%; + } +} +@keyframes rcSliderTooltipZoomDownOut { + 0% { + transform: scale(1, 1); + transform-origin: 50% 100%; + } + 100% { + transform: scale(0, 0); + transform-origin: 50% 100%; + opacity: 0; + } +} +.rc-slider-tooltip { + position: absolute; + top: -9999px; + left: -9999px; + visibility: visible; + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.rc-slider-tooltip * { + box-sizing: border-box; + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); +} +.rc-slider-tooltip-hidden { + display: none; +} +.rc-slider-tooltip-placement-top { + padding: 4px 0 8px 0; +} +.rc-slider-tooltip-inner { + min-width: 24px; + height: 24px; + padding: 6px 2px; + color: #fff; + font-size: 12px; + line-height: 1; + text-align: center; + text-decoration: none; + background-color: #6c6c6c; + border-radius: 6px; + box-shadow: 0 0 4px #d9d9d9; +} +.rc-slider-tooltip-arrow { + position: absolute; + width: 0; + height: 0; + border-color: transparent; + border-style: solid; +} +.rc-slider-tooltip-placement-top .rc-slider-tooltip-arrow { + bottom: 4px; + left: 50%; + margin-left: -4px; + border-width: 4px 4px 0; + border-top-color: #6c6c6c; +} diff --git a/packages/semantic-ui/src/i18n/en.json b/packages/semantic-ui/src/i18n/en.json index b4ee3791..bb944a16 100644 --- a/packages/semantic-ui/src/i18n/en.json +++ b/packages/semantic-ui/src/i18n/en.json @@ -57,7 +57,8 @@ "save": "Save", "search": "Search", "show": "Show", - "upload": "Upload" + "upload": "Upload", + "pdf": "View PDF" }, "errors": { "save": "There was an error saving the record.", @@ -331,4 +332,4 @@ }, "title": "XML" } -} +} \ No newline at end of file diff --git a/packages/semantic-ui/src/index.js b/packages/semantic-ui/src/index.js index 612641d6..1486dc5b 100644 --- a/packages/semantic-ui/src/index.js +++ b/packages/semantic-ui/src/index.js @@ -99,6 +99,7 @@ export { default as Toaster } from './components/Toaster'; export { default as VideoFrameSelector } from './components/VideoFrameSelector'; export { default as VideoPlayer } from './components/VideoPlayer'; export { default as VideoPlayerButton } from './components/VideoPlayerButton'; +export { default as ViewPDFButton } from './components/ViewPDFButton'; export { default as ViewXML } from './components/ViewXML'; // Context diff --git a/packages/semantic-ui/webpack.config.js b/packages/semantic-ui/webpack.config.js index a3c6b1e1..01914b8a 100644 --- a/packages/semantic-ui/webpack.config.js +++ b/packages/semantic-ui/webpack.config.js @@ -10,6 +10,18 @@ module.exports = configure(__dirname, { './react-calendar/dist/Calendar.css$': path.resolve( __dirname, '../../node_modules/react-calendar/dist/Calendar.css' + ), + './rc-slider/assets/index.css$': path.resolve( + __dirname, + '../../node_modules/rc-slider/assets/index.css' + ), + './react-pdf/dist/esm/Page/AnnotationLayer.css$': path.resolve( + __dirname, + '../../node_modules/react-pdf/dist/esm/Page/AnnotationLayer.css' + ), + './react-pdf/dist/esm/Page/TextLayer.css$': path.resolve( + __dirname, + '../../node_modules/react-pdf/dist/esm/Page/TextLayer.css' ) } }, diff --git a/packages/shared/package.json b/packages/shared/package.json index 222c7b6f..b56b9a16 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/shared-components", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "A package of shared, framework agnostic, components.", "license": "MIT", "main": "./build/index.js", diff --git a/packages/storybook/src/assets/test.pdf b/packages/storybook/src/assets/test.pdf new file mode 100644 index 00000000..34f8324f Binary files /dev/null and b/packages/storybook/src/assets/test.pdf differ diff --git a/packages/storybook/src/semantic-ui/LazyDocument.stories.js b/packages/storybook/src/semantic-ui/LazyDocument.stories.js index d6d3ac9e..0dcf5190 100644 --- a/packages/storybook/src/semantic-ui/LazyDocument.stories.js +++ b/packages/storybook/src/semantic-ui/LazyDocument.stories.js @@ -7,6 +7,7 @@ import FileInputButton from '../../../semantic-ui/src/components/FileInputButton import image from '../assets/test-image.jpg'; import LazyDocument from '../../../semantic-ui/src/components/LazyDocument'; import portraitImage from '../assets/portrait-test-image.jpg'; +import pdf from '../assets/test.pdf'; export default { title: 'Components/Semantic UI/LazyDocument' @@ -85,6 +86,16 @@ export const CardContent = () => ( ); +export const ViewContent = () => ( + +); + + export const ListContent = () => ( diff --git a/packages/user-defined-fields/package.json b/packages/user-defined-fields/package.json index 46b6a08b..9325b8e5 100644 --- a/packages/user-defined-fields/package.json +++ b/packages/user-defined-fields/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/user-defined-fields", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "A package of components used for allowing end users to define fields on models. Use with the \"user_defined_fields\" gem.", "license": "MIT", "main": "./build/index.js", @@ -9,8 +9,8 @@ "build": "webpack --mode production && flow-copy-source -v src types" }, "dependencies": { - "@performant-software/semantic-components": "^1.1.3", - "@performant-software/shared-components": "^1.1.3", + "@performant-software/semantic-components": "^1.1.4-beta.10", + "@performant-software/shared-components": "^1.1.4-beta.10", "i18next": "^21.9.1", "semantic-ui-react": "^2.1.2", "underscore": "^1.13.2" diff --git a/packages/visualize/package.json b/packages/visualize/package.json index 8327c66a..5a75c51b 100644 --- a/packages/visualize/package.json +++ b/packages/visualize/package.json @@ -1,6 +1,6 @@ { "name": "@performant-software/visualize", - "version": "1.1.3", + "version": "1.1.4-beta.10", "description": "A package of components used for data visualization", "license": "MIT", "main": "./build/index.js", diff --git a/react-components.json b/react-components.json index 51141891..ebc6d052 100644 --- a/react-components.json +++ b/react-components.json @@ -7,5 +7,5 @@ "packages/user-defined-fields", "packages/visualize" ], - "version": "1.1.3" -} + "version": "1.1.4-beta.10" +} \ No newline at end of file