@x15ventures/x15-ui-library 3.18.0 → 3.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/THIRD_PARTY_LICENSES.md +11182 -0
- package/dist/cjs/autoGenerated/libraryThemes.js +12 -12
- package/dist/cjs/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/cjs/autoGenerated/libraryThemes.json +12 -12
- package/dist/cjs/components/design/banners/pageBanner/PageBanner.js +27 -12
- package/dist/cjs/components/design/banners/pageBanner/PageBanner.js.map +1 -1
- package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js +22 -15
- package/dist/cjs/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
- package/dist/cjs/components/design/dialog/dialog.css +4 -0
- package/dist/cjs/components/design/logos/LogoLink.js +2 -1
- package/dist/cjs/components/design/logos/LogoLink.js.map +1 -1
- package/dist/cjs/components/design/logos/VentureLogo.js +2 -1
- package/dist/cjs/components/design/logos/VentureLogo.js.map +1 -1
- package/dist/cjs/components/design/revealMore/RevealMoreBelow.js +2 -2
- package/dist/cjs/components/design/revealMore/RevealMoreBelow.js.map +1 -1
- package/dist/cjs/components/design/skeleton/Skeleton.js +15 -5
- package/dist/cjs/components/design/skeleton/Skeleton.js.map +1 -1
- package/dist/cjs/components/design/themeLoader/ThemeLoader.js +1 -1
- package/dist/cjs/components/design/themeLoader/ThemeLoader.js.map +1 -1
- package/dist/cjs/components/form/buttons/SimpleButton.js +3 -1
- package/dist/cjs/components/form/buttons/SimpleButton.js.map +1 -1
- package/dist/cjs/components/form/buttons/button.interface.js.map +1 -1
- package/dist/cjs/components/form/buttons/userPicButton/UserPicButton.js +5 -3
- package/dist/cjs/components/form/buttons/userPicButton/UserPicButton.js.map +1 -1
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +64 -19
- package/dist/cjs/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
- package/dist/cjs/components/navigation/link/Link.js +2 -1
- package/dist/cjs/components/navigation/link/Link.js.map +1 -1
- package/dist/cjs/components/testing/devToolbar/DevToolbar.js +5 -3
- package/dist/cjs/components/testing/devToolbar/DevToolbar.js.map +1 -1
- package/dist/cjs/constants/fileUploadTypes.js +9 -4
- package/dist/cjs/constants/fileUploadTypes.js.map +1 -1
- package/dist/cjs/helpers/dateHelpers.js +34 -23
- package/dist/cjs/helpers/dateHelpers.js.map +1 -1
- package/dist/cjs/helpers/fileHelpers.js +58 -0
- package/dist/cjs/helpers/fileHelpers.js.map +1 -0
- package/dist/cjs/helpers/index.js +44 -0
- package/dist/cjs/helpers/index.js.map +1 -1
- package/dist/cjs/helpers/interactionsHelper.js +8 -1
- package/dist/cjs/helpers/interactionsHelper.js.map +1 -1
- package/dist/cjs/helpers/objectHelpers.js +23 -9
- package/dist/cjs/helpers/objectHelpers.js.map +1 -1
- package/dist/cjs/helpers/stringHelpers.js +61 -5
- package/dist/cjs/helpers/stringHelpers.js.map +1 -1
- package/dist/cjs/helpers/urlHelpers.js +48 -0
- package/dist/cjs/helpers/urlHelpers.js.map +1 -0
- package/dist/cjs/index.js +191 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/package.json +3 -305
- package/dist/cjs/styles/index.css +18 -0
- package/dist/cjs/styles/variables/cssVars/_designVariables.css +18 -0
- package/dist/cjs/widgets/documentComments/DocumentComments.js +305 -0
- package/dist/cjs/widgets/documentComments/DocumentComments.js.map +1 -0
- package/dist/cjs/widgets/documentComments/_documentCommentsVariables.css +0 -0
- package/dist/cjs/widgets/documentComments/documentComments.css +107 -0
- package/dist/cjs/widgets/documentComments/documentComments.interfaces.js +6 -0
- package/dist/cjs/widgets/documentComments/documentComments.interfaces.js.map +1 -0
- package/dist/cjs/widgets/documentComments/index.js +19 -0
- package/dist/cjs/widgets/documentComments/index.js.map +1 -0
- package/dist/cjs/widgets/documentComparer/DocumentComparer.js +309 -0
- package/dist/cjs/widgets/documentComparer/DocumentComparer.js.map +1 -0
- package/dist/cjs/widgets/documentComparer/_documentComparerVariables.css +0 -0
- package/dist/cjs/widgets/documentComparer/documentComparer.css +117 -0
- package/dist/cjs/widgets/documentComparer/documentComparer.interfaces.js +6 -0
- package/dist/cjs/widgets/documentComparer/documentComparer.interfaces.js.map +1 -0
- package/dist/cjs/widgets/documentComparer/index.js +19 -0
- package/dist/cjs/widgets/documentComparer/index.js.map +1 -0
- package/dist/cjs/widgets/documentEditor/DocumentEditor.js +142 -0
- package/dist/cjs/widgets/documentEditor/DocumentEditor.js.map +1 -0
- package/dist/cjs/widgets/documentEditor/_documentEditorVariables.css +0 -0
- package/dist/cjs/widgets/documentEditor/documentEditor.css +33 -0
- package/dist/cjs/widgets/documentEditor/documentEditor.interfaces.js +6 -0
- package/dist/cjs/widgets/documentEditor/documentEditor.interfaces.js.map +1 -0
- package/dist/cjs/widgets/documentEditor/index.js +19 -0
- package/dist/cjs/widgets/documentEditor/index.js.map +1 -0
- package/dist/cjs/widgets/documentViewer/DocumentViewer.js +206 -0
- package/dist/cjs/widgets/documentViewer/DocumentViewer.js.map +1 -0
- package/dist/cjs/widgets/documentViewer/_documentViewerVariables.css +0 -0
- package/dist/cjs/widgets/documentViewer/documentViewer.css +82 -0
- package/dist/cjs/widgets/documentViewer/documentViewer.interfaces.js +6 -0
- package/dist/cjs/widgets/documentViewer/documentViewer.interfaces.js.map +1 -0
- package/dist/cjs/widgets/documentViewer/index.js +19 -0
- package/dist/cjs/widgets/documentViewer/index.js.map +1 -0
- package/dist/cjs/widgets/index.js +126 -0
- package/dist/cjs/widgets/index.js.map +1 -1
- package/dist/cjs/widgets/shared/documents/ToggleGroup.js +32 -0
- package/dist/cjs/widgets/shared/documents/ToggleGroup.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/_documentVariables.css +0 -0
- package/dist/cjs/widgets/shared/documents/annotations/AnnotationLayer.js +279 -0
- package/dist/cjs/widgets/shared/documents/annotations/AnnotationLayer.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/annotations/_annotationLayerVariables.css +0 -0
- package/dist/cjs/widgets/shared/documents/annotations/annotationLayer.css +65 -0
- package/dist/cjs/widgets/shared/documents/annotations/annotations.interfaces.js +21 -0
- package/dist/cjs/widgets/shared/documents/annotations/annotations.interfaces.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/annotations/highlightRegistry.js +67 -0
- package/dist/cjs/widgets/shared/documents/annotations/highlightRegistry.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/annotations/index.js +39 -0
- package/dist/cjs/widgets/shared/documents/annotations/index.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/annotations/textIndex.js +112 -0
- package/dist/cjs/widgets/shared/documents/annotations/textIndex.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/annotations/textQuoteAnchor.js +160 -0
- package/dist/cjs/widgets/shared/documents/annotations/textQuoteAnchor.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/documentHelpers.js +186 -0
- package/dist/cjs/widgets/shared/documents/documentHelpers.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/documents.interfaces.js +6 -0
- package/dist/cjs/widgets/shared/documents/documents.interfaces.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/DocumentDiff.js +73 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/DocumentDiff.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/_documentDiffVariables.css +0 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.js +114 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/documentDiff.css +69 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.js +6 -0
- package/dist/cjs/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/lazyEngines.js +19 -0
- package/dist/cjs/widgets/shared/documents/engines/lazyEngines.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.js +200 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/_markdownEditorEngineVariables.css +0 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.css +50 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.js +6 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.js +179 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.js +278 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.js +208 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.js +85 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/_markdownRendererVariables.css +0 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/markdownRenderer.css +78 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/index.js +64 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/index.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.js +6 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.js +71 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.js +192 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.js +86 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.js +38 -0
- package/dist/cjs/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/WordRenderer.js +49 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/WordRenderer.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/renderWordDocument.js +214 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/renderWordDocument.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.js +112 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/wordXml.js +68 -0
- package/dist/cjs/widgets/shared/documents/engines/wordRenderer/wordXml.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/index.js +50 -0
- package/dist/cjs/widgets/shared/documents/index.js.map +1 -0
- package/dist/cjs/widgets/shared/documents/toggleGroup.css +8 -0
- package/dist/cjs/widgets/shared/documents/useDocumentContent.js +222 -0
- package/dist/cjs/widgets/shared/documents/useDocumentContent.js.map +1 -0
- package/dist/components/design/banners/pageBanner/PageBanner.d.ts.map +1 -1
- package/dist/components/design/card/cardHeader/CardHeaderItem.d.ts.map +1 -1
- package/dist/components/design/logos/LogoLink.d.ts.map +1 -1
- package/dist/components/design/logos/VentureLogo.d.ts.map +1 -1
- package/dist/components/design/skeleton/Skeleton.d.ts +1 -1
- package/dist/components/design/skeleton/Skeleton.d.ts.map +1 -1
- package/dist/components/design/themeLoader/ThemeLoader.d.ts.map +1 -1
- package/dist/components/form/buttons/SimpleButton.d.ts.map +1 -1
- package/dist/components/form/buttons/button.interface.d.ts +1 -0
- package/dist/components/form/buttons/button.interface.d.ts.map +1 -1
- package/dist/components/form/buttons/userPicButton/UserPicButton.d.ts.map +1 -1
- package/dist/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.d.ts.map +1 -1
- package/dist/components/navigation/link/Link.d.ts.map +1 -1
- package/dist/components/testing/devToolbar/DevToolbar.d.ts.map +1 -1
- package/dist/constants/fileUploadTypes.d.ts.map +1 -1
- package/dist/esm/autoGenerated/libraryThemes.js +12 -12
- package/dist/esm/autoGenerated/libraryThemes.js.map +1 -1
- package/dist/esm/autoGenerated/libraryThemes.json +12 -12
- package/dist/esm/components/design/banners/pageBanner/PageBanner.js +27 -12
- package/dist/esm/components/design/banners/pageBanner/PageBanner.js.map +1 -1
- package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js +22 -15
- package/dist/esm/components/design/card/cardHeader/CardHeaderItem.js.map +1 -1
- package/dist/esm/components/design/dialog/dialog.css +4 -0
- package/dist/esm/components/design/logos/LogoLink.js +2 -1
- package/dist/esm/components/design/logos/LogoLink.js.map +1 -1
- package/dist/esm/components/design/logos/VentureLogo.js +2 -1
- package/dist/esm/components/design/logos/VentureLogo.js.map +1 -1
- package/dist/esm/components/design/revealMore/RevealMoreBelow.js +1 -1
- package/dist/esm/components/design/revealMore/RevealMoreBelow.js.map +1 -1
- package/dist/esm/components/design/skeleton/Skeleton.js +15 -5
- package/dist/esm/components/design/skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/design/themeLoader/ThemeLoader.js +1 -1
- package/dist/esm/components/design/themeLoader/ThemeLoader.js.map +1 -1
- package/dist/esm/components/form/buttons/SimpleButton.js +3 -1
- package/dist/esm/components/form/buttons/SimpleButton.js.map +1 -1
- package/dist/esm/components/form/buttons/button.interface.js.map +1 -1
- package/dist/esm/components/form/buttons/userPicButton/UserPicButton.js +5 -3
- package/dist/esm/components/form/buttons/userPicButton/UserPicButton.js.map +1 -1
- package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js +65 -19
- package/dist/esm/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.js.map +1 -1
- package/dist/esm/components/navigation/link/Link.js +2 -1
- package/dist/esm/components/navigation/link/Link.js.map +1 -1
- package/dist/esm/components/testing/devToolbar/DevToolbar.js +5 -3
- package/dist/esm/components/testing/devToolbar/DevToolbar.js.map +1 -1
- package/dist/esm/constants/fileUploadTypes.js +9 -4
- package/dist/esm/constants/fileUploadTypes.js.map +1 -1
- package/dist/esm/helpers/dateHelpers.js +34 -23
- package/dist/esm/helpers/dateHelpers.js.map +1 -1
- package/dist/esm/helpers/fileHelpers.js +48 -0
- package/dist/esm/helpers/fileHelpers.js.map +1 -0
- package/dist/esm/helpers/index.js +2 -0
- package/dist/esm/helpers/index.js.map +1 -1
- package/dist/esm/helpers/interactionsHelper.js +5 -0
- package/dist/esm/helpers/interactionsHelper.js.map +1 -1
- package/dist/esm/helpers/objectHelpers.js +23 -9
- package/dist/esm/helpers/objectHelpers.js.map +1 -1
- package/dist/esm/helpers/stringHelpers.js +61 -5
- package/dist/esm/helpers/stringHelpers.js.map +1 -1
- package/dist/esm/helpers/urlHelpers.js +40 -0
- package/dist/esm/helpers/urlHelpers.js.map +1 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +2 -304
- package/dist/esm/styles/index.css +18 -0
- package/dist/esm/styles/variables/cssVars/_designVariables.css +18 -0
- package/dist/esm/widgets/documentComments/DocumentComments.js +298 -0
- package/dist/esm/widgets/documentComments/DocumentComments.js.map +1 -0
- package/dist/esm/widgets/documentComments/_documentCommentsVariables.css +0 -0
- package/dist/esm/widgets/documentComments/documentComments.css +107 -0
- package/dist/esm/widgets/documentComments/documentComments.interfaces.js +2 -0
- package/dist/esm/widgets/documentComments/documentComments.interfaces.js.map +1 -0
- package/dist/esm/widgets/documentComments/index.js +2 -0
- package/dist/esm/widgets/documentComments/index.js.map +1 -0
- package/dist/esm/widgets/documentComparer/DocumentComparer.js +301 -0
- package/dist/esm/widgets/documentComparer/DocumentComparer.js.map +1 -0
- package/dist/esm/widgets/documentComparer/_documentComparerVariables.css +0 -0
- package/dist/esm/widgets/documentComparer/documentComparer.css +117 -0
- package/dist/esm/widgets/documentComparer/documentComparer.interfaces.js +2 -0
- package/dist/esm/widgets/documentComparer/documentComparer.interfaces.js.map +1 -0
- package/dist/esm/widgets/documentComparer/index.js +2 -0
- package/dist/esm/widgets/documentComparer/index.js.map +1 -0
- package/dist/esm/widgets/documentEditor/DocumentEditor.js +135 -0
- package/dist/esm/widgets/documentEditor/DocumentEditor.js.map +1 -0
- package/dist/esm/widgets/documentEditor/_documentEditorVariables.css +0 -0
- package/dist/esm/widgets/documentEditor/documentEditor.css +33 -0
- package/dist/esm/widgets/documentEditor/documentEditor.interfaces.js +2 -0
- package/dist/esm/widgets/documentEditor/documentEditor.interfaces.js.map +1 -0
- package/dist/esm/widgets/documentEditor/index.js +2 -0
- package/dist/esm/widgets/documentEditor/index.js.map +1 -0
- package/dist/esm/widgets/documentViewer/DocumentViewer.js +198 -0
- package/dist/esm/widgets/documentViewer/DocumentViewer.js.map +1 -0
- package/dist/esm/widgets/documentViewer/_documentViewerVariables.css +0 -0
- package/dist/esm/widgets/documentViewer/documentViewer.css +82 -0
- package/dist/esm/widgets/documentViewer/documentViewer.interfaces.js +2 -0
- package/dist/esm/widgets/documentViewer/documentViewer.interfaces.js.map +1 -0
- package/dist/esm/widgets/documentViewer/index.js +2 -0
- package/dist/esm/widgets/documentViewer/index.js.map +1 -0
- package/dist/esm/widgets/index.js +6 -0
- package/dist/esm/widgets/index.js.map +1 -1
- package/dist/esm/widgets/shared/documents/ToggleGroup.js +24 -0
- package/dist/esm/widgets/shared/documents/ToggleGroup.js.map +1 -0
- package/dist/esm/widgets/shared/documents/_documentVariables.css +0 -0
- package/dist/esm/widgets/shared/documents/annotations/AnnotationLayer.js +273 -0
- package/dist/esm/widgets/shared/documents/annotations/AnnotationLayer.js.map +1 -0
- package/dist/esm/widgets/shared/documents/annotations/_annotationLayerVariables.css +0 -0
- package/dist/esm/widgets/shared/documents/annotations/annotationLayer.css +65 -0
- package/dist/esm/widgets/shared/documents/annotations/annotations.interfaces.js +14 -0
- package/dist/esm/widgets/shared/documents/annotations/annotations.interfaces.js.map +1 -0
- package/dist/esm/widgets/shared/documents/annotations/highlightRegistry.js +58 -0
- package/dist/esm/widgets/shared/documents/annotations/highlightRegistry.js.map +1 -0
- package/dist/esm/widgets/shared/documents/annotations/index.js +4 -0
- package/dist/esm/widgets/shared/documents/annotations/index.js.map +1 -0
- package/dist/esm/widgets/shared/documents/annotations/textIndex.js +103 -0
- package/dist/esm/widgets/shared/documents/annotations/textIndex.js.map +1 -0
- package/dist/esm/widgets/shared/documents/annotations/textQuoteAnchor.js +150 -0
- package/dist/esm/widgets/shared/documents/annotations/textQuoteAnchor.js.map +1 -0
- package/dist/esm/widgets/shared/documents/documentHelpers.js +168 -0
- package/dist/esm/widgets/shared/documents/documentHelpers.js.map +1 -0
- package/dist/esm/widgets/shared/documents/documents.interfaces.js +2 -0
- package/dist/esm/widgets/shared/documents/documents.interfaces.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/DocumentDiff.js +65 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/DocumentDiff.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/_documentDiffVariables.css +0 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.js +102 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/documentDiff.css +69 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.js +2 -0
- package/dist/esm/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/lazyEngines.js +13 -0
- package/dist/esm/widgets/shared/documents/engines/lazyEngines.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.js +191 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/_markdownEditorEngineVariables.css +0 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.css +50 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.js +2 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.js +170 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.js +270 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.js +198 -0
- package/dist/esm/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.js +76 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/_markdownRendererVariables.css +0 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/markdownRenderer.css +78 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/index.js +5 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/index.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.js +2 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.js +64 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.js +182 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.js +78 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.js +30 -0
- package/dist/esm/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/WordRenderer.js +41 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/WordRenderer.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/renderWordDocument.js +207 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/renderWordDocument.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.js +105 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.js.map +1 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/wordXml.js +57 -0
- package/dist/esm/widgets/shared/documents/engines/wordRenderer/wordXml.js.map +1 -0
- package/dist/esm/widgets/shared/documents/index.js +3 -0
- package/dist/esm/widgets/shared/documents/index.js.map +1 -0
- package/dist/esm/widgets/shared/documents/toggleGroup.css +8 -0
- package/dist/esm/widgets/shared/documents/useDocumentContent.js +215 -0
- package/dist/esm/widgets/shared/documents/useDocumentContent.js.map +1 -0
- package/dist/helpers/dateHelpers.d.ts.map +1 -1
- package/dist/helpers/fileHelpers.d.ts +5 -0
- package/dist/helpers/fileHelpers.d.ts.map +1 -0
- package/dist/helpers/index.d.ts +3 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/interactionsHelper.d.ts +2 -0
- package/dist/helpers/interactionsHelper.d.ts.map +1 -1
- package/dist/helpers/objectHelpers.d.ts.map +1 -1
- package/dist/helpers/stringHelpers.d.ts.map +1 -1
- package/dist/helpers/urlHelpers.d.ts +3 -0
- package/dist/helpers/urlHelpers.d.ts.map +1 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/package.json +42 -28
- package/dist/widgets/documentComments/DocumentComments.d.ts +7 -0
- package/dist/widgets/documentComments/DocumentComments.d.ts.map +1 -0
- package/dist/widgets/documentComments/documentComments.interfaces.d.ts +57 -0
- package/dist/widgets/documentComments/documentComments.interfaces.d.ts.map +1 -0
- package/dist/widgets/documentComments/index.d.ts +3 -0
- package/dist/widgets/documentComments/index.d.ts.map +1 -0
- package/dist/widgets/documentComparer/DocumentComparer.d.ts +7 -0
- package/dist/widgets/documentComparer/DocumentComparer.d.ts.map +1 -0
- package/dist/widgets/documentComparer/documentComparer.interfaces.d.ts +78 -0
- package/dist/widgets/documentComparer/documentComparer.interfaces.d.ts.map +1 -0
- package/dist/widgets/documentComparer/index.d.ts +3 -0
- package/dist/widgets/documentComparer/index.d.ts.map +1 -0
- package/dist/widgets/documentEditor/DocumentEditor.d.ts +7 -0
- package/dist/widgets/documentEditor/DocumentEditor.d.ts.map +1 -0
- package/dist/widgets/documentEditor/documentEditor.interfaces.d.ts +40 -0
- package/dist/widgets/documentEditor/documentEditor.interfaces.d.ts.map +1 -0
- package/dist/widgets/documentEditor/index.d.ts +3 -0
- package/dist/widgets/documentEditor/index.d.ts.map +1 -0
- package/dist/widgets/documentViewer/DocumentViewer.d.ts +7 -0
- package/dist/widgets/documentViewer/DocumentViewer.d.ts.map +1 -0
- package/dist/widgets/documentViewer/documentViewer.interfaces.d.ts +47 -0
- package/dist/widgets/documentViewer/documentViewer.interfaces.d.ts.map +1 -0
- package/dist/widgets/documentViewer/index.d.ts +3 -0
- package/dist/widgets/documentViewer/index.d.ts.map +1 -0
- package/dist/widgets/index.d.ts +12 -0
- package/dist/widgets/index.d.ts.map +1 -1
- package/dist/widgets/shared/documents/ToggleGroup.d.ts +15 -0
- package/dist/widgets/shared/documents/ToggleGroup.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/AnnotationLayer.d.ts +27 -0
- package/dist/widgets/shared/documents/annotations/AnnotationLayer.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/annotations.interfaces.d.ts +43 -0
- package/dist/widgets/shared/documents/annotations/annotations.interfaces.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/highlightRegistry.d.ts +12 -0
- package/dist/widgets/shared/documents/annotations/highlightRegistry.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/index.d.ts +6 -0
- package/dist/widgets/shared/documents/annotations/index.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/textIndex.d.ts +16 -0
- package/dist/widgets/shared/documents/annotations/textIndex.d.ts.map +1 -0
- package/dist/widgets/shared/documents/annotations/textQuoteAnchor.d.ts +15 -0
- package/dist/widgets/shared/documents/annotations/textQuoteAnchor.d.ts.map +1 -0
- package/dist/widgets/shared/documents/documentHelpers.d.ts +14 -0
- package/dist/widgets/shared/documents/documentHelpers.d.ts.map +1 -0
- package/dist/widgets/shared/documents/documents.interfaces.d.ts +20 -0
- package/dist/widgets/shared/documents/documents.interfaces.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/documentDiff/DocumentDiff.d.ts +6 -0
- package/dist/widgets/shared/documents/engines/documentDiff/DocumentDiff.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.d.ts +25 -0
- package/dist/widgets/shared/documents/engines/documentDiff/buildDocumentDiff.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.d.ts +17 -0
- package/dist/widgets/shared/documents/engines/documentDiff/documentDiff.interfaces.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/lazyEngines.d.ts +5 -0
- package/dist/widgets/shared/documents/engines/lazyEngines.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.d.ts +8 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/MarkdownEditorEngine.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.d.ts +23 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/markdownEditorEngine.interfaces.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.d.ts +12 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/markdownTextIndex.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.d.ts +8 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/sanitizeForMdx.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.d.ts +32 -0
- package/dist/widgets/shared/documents/engines/markdownEditor/sourceAnnotations.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.d.ts +12 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/MarkdownRenderer.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/index.d.ts +7 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/index.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.d.ts +16 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/markdownNode.interfaces.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.d.ts +3 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/rehypeTableCleanup.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.d.ts +6 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/remarkPlugins.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.d.ts +3 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/remarkSafeTables.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.d.ts +8 -0
- package/dist/widgets/shared/documents/engines/markdownRenderer/plugins/tableHelpers.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/WordRenderer.d.ts +11 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/WordRenderer.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/renderWordDocument.d.ts +7 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/renderWordDocument.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.d.ts +3 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/wordPreviewNumbering.d.ts.map +1 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/wordXml.d.ts +21 -0
- package/dist/widgets/shared/documents/engines/wordRenderer/wordXml.d.ts.map +1 -0
- package/dist/widgets/shared/documents/index.d.ts +5 -0
- package/dist/widgets/shared/documents/index.d.ts.map +1 -0
- package/dist/widgets/shared/documents/useDocumentContent.d.ts +11 -0
- package/dist/widgets/shared/documents/useDocumentContent.d.ts.map +1 -0
- package/package.json +42 -28
- package/readme.md +49 -2
- package/dist/components/design/dialog/Dialog.test.d.ts +0 -5
- package/dist/components/design/dialog/Dialog.test.d.ts.map +0 -1
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.test.d.ts +0 -5
- package/dist/components/design/progressIndicators/circularProgressIndicator/CircularProgressIndicator.test.d.ts.map +0 -1
- package/dist/components/design/tooltip/Tooltip.test.d.ts +0 -2
- package/dist/components/design/tooltip/Tooltip.test.d.ts.map +0 -1
- package/dist/components/form/buttons/SimpleButton.test.d.ts +0 -5
- package/dist/components/form/buttons/SimpleButton.test.d.ts.map +0 -1
- package/dist/components/form/formFields/formFieldWrapper/FormField.test.d.ts +0 -5
- package/dist/components/form/formFields/formFieldWrapper/FormField.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/inputs/checkbox/InputCheckbox.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/inputs/checkbox/checkboxSwitch/CheckboxSwitch.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/inputs/file/dragAndDrop/DragAndDropFileUpload.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/inputs/file/fileAttachmentList/FileAttachmentsList.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/inputs/text/InputText.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/inputs/text/InputText.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/nestedFormContext.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/select/Select.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/select/Select.test.d.ts.map +0 -1
- package/dist/components/form/formFields/subComponents/textarea/Textarea.test.d.ts +0 -5
- package/dist/components/form/formFields/subComponents/textarea/Textarea.test.d.ts.map +0 -1
- package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts +0 -5
- package/dist/components/form/hookFormWrapper/HookFormWrapper.test.d.ts.map +0 -1
- package/dist/components/form/validation/ValidationMessages.test.d.ts +0 -5
- package/dist/components/form/validation/ValidationMessages.test.d.ts.map +0 -1
- package/dist/components/navigation/bubbleNavigator/bubbleNavigatorUtilities.test.d.ts +0 -2
- package/dist/components/navigation/bubbleNavigator/bubbleNavigatorUtilities.test.d.ts.map +0 -1
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts +0 -5
- package/dist/components/navigation/menu/menuItemContent/MenuItemIcon.test.d.ts.map +0 -1
- package/dist/helpers/ageHelpers.test.d.ts +0 -2
- package/dist/helpers/ageHelpers.test.d.ts.map +0 -1
- package/dist/helpers/dateHelpers.test.d.ts +0 -2
- package/dist/helpers/dateHelpers.test.d.ts.map +0 -1
- package/dist/helpers/formatters.test.d.ts +0 -5
- package/dist/helpers/formatters.test.d.ts.map +0 -1
- package/dist/helpers/iconHelpers.test.d.ts +0 -5
- package/dist/helpers/iconHelpers.test.d.ts.map +0 -1
- package/dist/helpers/numberHelpers.test.d.ts +0 -5
- package/dist/helpers/numberHelpers.test.d.ts.map +0 -1
- package/dist/helpers/objectHelpers.test.d.ts +0 -2
- package/dist/helpers/objectHelpers.test.d.ts.map +0 -1
- package/dist/helpers/stringHelpers.test.d.ts +0 -2
- package/dist/helpers/stringHelpers.test.d.ts.map +0 -1
- package/dist/hooks/InteractiveHostFocus.test.d.ts +0 -5
- package/dist/hooks/InteractiveHostFocus.test.d.ts.map +0 -1
- package/dist/widgets/processLauncher/ProcessLauncher.test.d.ts +0 -5
- package/dist/widgets/processLauncher/ProcessLauncher.test.d.ts.map +0 -1
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { renderIcon } from '../../../../helpers/iconHelpers';
|
|
5
|
+
import { getSafeLinkHref } from '../../../../helpers/urlHelpers';
|
|
5
6
|
import { LogoLink } from '../../logos/LogoLink';
|
|
6
7
|
import { OwnerDetailsPopup } from '../../ownerDetailsPopup/OwnerDetailsPopup';
|
|
7
8
|
import { SimpleButton } from '../../../form/buttons/SimpleButton';
|
|
@@ -15,19 +16,25 @@ export const CardHeaderItem = ({
|
|
|
15
16
|
hideTitle = false,
|
|
16
17
|
url,
|
|
17
18
|
actionButton
|
|
18
|
-
}) =>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
}) => {
|
|
20
|
+
const safeUrl = url ? getSafeLinkHref(url) : undefined;
|
|
21
|
+
const headerContent = /*#__PURE__*/React.createElement(React.Fragment, null, renderIcon(icon), logo && /*#__PURE__*/React.createElement(LogoLink, logo), graphic && /*#__PURE__*/React.createElement("img", {
|
|
22
|
+
src: graphic.imageUrl,
|
|
23
|
+
className: "logoImage",
|
|
24
|
+
alt: `${graphic.label}`
|
|
25
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
26
|
+
className: hideTitle ? 'sr-only' : 'cardHeaderItemTitle'
|
|
27
|
+
}, content || title));
|
|
28
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
29
|
+
className: "cardHeaderItem",
|
|
30
|
+
title: title
|
|
31
|
+
}, safeUrl ? /*#__PURE__*/React.createElement("a", {
|
|
32
|
+
className: "cardHeaderItemLink",
|
|
33
|
+
href: safeUrl
|
|
34
|
+
}, headerContent) : url ? /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
className: "cardHeaderItemLink"
|
|
36
|
+
}, headerContent) : content, owner && /*#__PURE__*/React.createElement(OwnerDetailsPopup, {
|
|
37
|
+
owner: owner
|
|
38
|
+
}), actionButton && /*#__PURE__*/React.createElement(SimpleButton, actionButton));
|
|
39
|
+
};
|
|
33
40
|
//# sourceMappingURL=CardHeaderItem.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CardHeaderItem.js","names":["React","renderIcon","LogoLink","OwnerDetailsPopup","SimpleButton","CardHeaderItem","icon","logo","graphic","owner","title","content","hideTitle","url","actionButton","
|
|
1
|
+
{"version":3,"file":"CardHeaderItem.js","names":["React","renderIcon","getSafeLinkHref","LogoLink","OwnerDetailsPopup","SimpleButton","CardHeaderItem","icon","logo","graphic","owner","title","content","hideTitle","url","actionButton","safeUrl","undefined","headerContent","createElement","Fragment","src","imageUrl","className","alt","label","href"],"sources":["../../../../../../src/components/design/card/cardHeader/CardHeaderItem.tsx"],"sourcesContent":["'use client';\n\nimport React, { ReactElement, ReactNode } from 'react';\nimport { IconSource, renderIcon } from '../../../../helpers/iconHelpers';\nimport { getSafeLinkHref } from '../../../../helpers/urlHelpers';\nimport { LogoLink, LogoLinkProps } from '../../logos/LogoLink';\nimport { OwnerDetailsPopup } from '../../ownerDetailsPopup/OwnerDetailsPopup';\nimport { ButtonProps } from '../../../form/buttons/button.interface';\nimport { SimpleButton } from '../../../form/buttons/SimpleButton';\n\nexport interface CardHeaderItemProps {\n icon?: IconSource;\n logo?: LogoLinkProps;\n graphic?: {\n imageUrl: string;\n label: string;\n },\n owner?: {\n name: string;\n email?: string;\n phone?: string;\n },\n title?: string;\n content?: ReactNode | ReactElement;\n hideTitle?: boolean;\n url?: string;\n actionButton?: ButtonProps;\n}\n\nexport const CardHeaderItem: React.FC<CardHeaderItemProps> = (\n {\n icon,\n logo,\n graphic,\n owner,\n title,\n content,\n hideTitle = false,\n url,\n actionButton\n }\n) => {\n const safeUrl = url ? getSafeLinkHref(url) : undefined;\n const headerContent = (\n <>\n { renderIcon(icon) }\n\n { logo && <LogoLink { ...logo } /> }\n\n { graphic && <img src={ graphic.imageUrl } className=\"logoImage\" alt={ `${ graphic.label }` } /> }\n\n <span className={ hideTitle ? 'sr-only' : 'cardHeaderItemTitle' }>{ content || title }</span>\n </>\n );\n\n return (\n <div className=\"cardHeaderItem\" title={ title }>\n { safeUrl\n ? <a className=\"cardHeaderItemLink\" href={ safeUrl }>{ headerContent }</a>\n : url\n ? <span className=\"cardHeaderItemLink\">{ headerContent }</span>\n : content\n }\n\n { owner && <OwnerDetailsPopup owner={ owner } /> }\n\n { actionButton && <SimpleButton { ...actionButton } /> }\n </div>\n );\n};\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAmC,OAAO;AACtD,SAAqBC,UAAU,QAAQ,iCAAiC;AACxE,SAASC,eAAe,QAAQ,gCAAgC;AAChE,SAASC,QAAQ,QAAuB,sBAAsB;AAC9D,SAASC,iBAAiB,QAAQ,2CAA2C;AAE7E,SAASC,YAAY,QAAQ,oCAAoC;AAqBjE,OAAO,MAAMC,cAA6C,GAAGA,CAC3D;EACEC,IAAI;EACJC,IAAI;EACJC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,SAAS,GAAG,KAAK;EACjBC,GAAG;EACHC;AACF,CAAC,KACE;EACH,MAAMC,OAAO,GAAGF,GAAG,GAAGZ,eAAe,CAACY,GAAG,CAAC,GAAGG,SAAS;EACtD,MAAMC,aAAa,gBACjBlB,KAAA,CAAAmB,aAAA,CAAAnB,KAAA,CAAAoB,QAAA,QACInB,UAAU,CAACM,IAAI,CAAC,EAEhBC,IAAI,iBAAIR,KAAA,CAAAmB,aAAA,CAAChB,QAAQ,EAAMK,IAAQ,CAAC,EAEhCC,OAAO,iBAAIT,KAAA,CAAAmB,aAAA;IAAKE,GAAG,EAAGZ,OAAO,CAACa,QAAU;IAACC,SAAS,EAAC,WAAW;IAACC,GAAG,EAAG,GAAIf,OAAO,CAACgB,KAAK;EAAK,CAAE,CAAC,eAEhGzB,KAAA,CAAAmB,aAAA;IAAMI,SAAS,EAAGV,SAAS,GAAG,SAAS,GAAG;EAAuB,GAAGD,OAAO,IAAID,KAAa,CAC5F,CACH;EAED,oBACEX,KAAA,CAAAmB,aAAA;IAAKI,SAAS,EAAC,gBAAgB;IAACZ,KAAK,EAAGA;EAAO,GAC3CK,OAAO,gBACLhB,KAAA,CAAAmB,aAAA;IAAGI,SAAS,EAAC,oBAAoB;IAACG,IAAI,EAAGV;EAAS,GAAGE,aAAkB,CAAC,GACxEJ,GAAG,gBACDd,KAAA,CAAAmB,aAAA;IAAMI,SAAS,EAAC;EAAoB,GAAGL,aAAqB,CAAC,GAC7DN,OAAO,EAGXF,KAAK,iBAAIV,KAAA,CAAAmB,aAAA,CAACf,iBAAiB;IAACM,KAAK,EAAGA;EAAO,CAAE,CAAC,EAE9CK,YAAY,iBAAIf,KAAA,CAAAmB,aAAA,CAACd,YAAY,EAAMU,YAAgB,CAClD,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -41,6 +41,7 @@
|
|
|
41
41
|
height: 30px;
|
|
42
42
|
font-size: 10px;
|
|
43
43
|
display: flex;
|
|
44
|
+
flex-shrink: 0;
|
|
44
45
|
align-items: center;
|
|
45
46
|
justify-content: center;
|
|
46
47
|
border: var(--dialogCloseButtonBorder, none);
|
|
@@ -65,6 +66,9 @@
|
|
|
65
66
|
flex-direction: row;
|
|
66
67
|
justify-content: space-between;
|
|
67
68
|
}
|
|
69
|
+
.dialog .dialogHeader .dialogHeaderTextWrapper {
|
|
70
|
+
min-width: 0;
|
|
71
|
+
}
|
|
68
72
|
.dialog .dialogHeader .dialogHeaderText,
|
|
69
73
|
.dialog .dialogHeader .headerBar {
|
|
70
74
|
text-overflow: ellipsis;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
|
+
import { getSafeLinkHref } from '../../../helpers/urlHelpers';
|
|
4
5
|
export const LogoLink = ({
|
|
5
6
|
imageUrl,
|
|
6
7
|
svg,
|
|
@@ -10,7 +11,7 @@ export const LogoLink = ({
|
|
|
10
11
|
url,
|
|
11
12
|
hideLabel = true
|
|
12
13
|
}) => /*#__PURE__*/React.createElement("a", {
|
|
13
|
-
href: url,
|
|
14
|
+
href: getSafeLinkHref(url),
|
|
14
15
|
title: label,
|
|
15
16
|
target: "_blank",
|
|
16
17
|
className: `logoLink logoLink_${size} ${customCssClass || ''}`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogoLink.js","names":["React","LogoLink","imageUrl","svg","size","customCssClass","label","url","hideLabel","createElement","href","title","target","className","rel","src","alt"],"sources":["../../../../../src/components/design/logos/LogoLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { ReactElement, ReactNode } from 'react';\n\nexport interface LogoLinkProps {\n imageUrl?: string;\n svg?: ReactElement | ReactNode;\n size?: 'xs' | 's' | 'm'\n customCssClass?: string;\n label: string;\n url: string;\n hideLabel?: boolean;\n}\n\nexport const LogoLink: React.FC<LogoLinkProps> = (\n {\n imageUrl,\n svg,\n size = 's',\n customCssClass,\n label,\n url,\n hideLabel = true\n }\n) => (\n <a href={ url } title={ label } target=\"_blank\" className={ `logoLink logoLink_${ size } ${ customCssClass || '' }` } rel=\"noreferrer\">\n {\n imageUrl && (\n <img src={ imageUrl }\n className=\"logoImage\"\n alt={ `${ label } logo` }\n />\n )\n }\n {\n svg && <span className=\"logoSvg\">{ svg }</span>\n }\n <span className={ hideLabel ? 'sr-only' : 'logoLabel' }>\n { label }\n </span>\n </a>\n);\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAmC,OAAO;
|
|
1
|
+
{"version":3,"file":"LogoLink.js","names":["React","getSafeLinkHref","LogoLink","imageUrl","svg","size","customCssClass","label","url","hideLabel","createElement","href","title","target","className","rel","src","alt"],"sources":["../../../../../src/components/design/logos/LogoLink.tsx"],"sourcesContent":["'use client';\n\nimport React, { ReactElement, ReactNode } from 'react';\nimport { getSafeLinkHref } from '../../../helpers/urlHelpers';\n\nexport interface LogoLinkProps {\n imageUrl?: string;\n svg?: ReactElement | ReactNode;\n size?: 'xs' | 's' | 'm'\n customCssClass?: string;\n label: string;\n url: string;\n hideLabel?: boolean;\n}\n\nexport const LogoLink: React.FC<LogoLinkProps> = (\n {\n imageUrl,\n svg,\n size = 's',\n customCssClass,\n label,\n url,\n hideLabel = true\n }\n) => (\n <a href={ getSafeLinkHref(url) } title={ label } target=\"_blank\" className={ `logoLink logoLink_${ size } ${ customCssClass || '' }` } rel=\"noreferrer\">\n {\n imageUrl && (\n <img src={ imageUrl }\n className=\"logoImage\"\n alt={ `${ label } logo` }\n />\n )\n }\n {\n svg && <span className=\"logoSvg\">{ svg }</span>\n }\n <span className={ hideLabel ? 'sr-only' : 'logoLabel' }>\n { label }\n </span>\n </a>\n);\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAmC,OAAO;AACtD,SAASC,eAAe,QAAQ,6BAA6B;AAY7D,OAAO,MAAMC,QAAiC,GAAGA,CAC/C;EACEC,QAAQ;EACRC,GAAG;EACHC,IAAI,GAAG,GAAG;EACVC,cAAc;EACdC,KAAK;EACLC,GAAG;EACHC,SAAS,GAAG;AACd,CAAC,kBAEDT,KAAA,CAAAU,aAAA;EAAGC,IAAI,EAAGV,eAAe,CAACO,GAAG,CAAG;EAACI,KAAK,EAAGL,KAAO;EAACM,MAAM,EAAC,QAAQ;EAACC,SAAS,EAAG,qBAAsBT,IAAI,IAAMC,cAAc,IAAI,EAAE,EAAK;EAACS,GAAG,EAAC;AAAY,GAEnJZ,QAAQ,iBACNH,KAAA,CAAAU,aAAA;EAAKM,GAAG,EAAGb,QAAU;EACnBW,SAAS,EAAC,WAAW;EACrBG,GAAG,EAAG,GAAIV,KAAK;AAAU,CAC1B,CACF,EAGDH,GAAG,iBAAIJ,KAAA,CAAAU,aAAA;EAAMI,SAAS,EAAC;AAAS,GAAGV,GAAW,CAAC,eAEjDJ,KAAA,CAAAU,aAAA;EAAMI,SAAS,EAAGL,SAAS,GAAG,SAAS,GAAG;AAAa,GACnDF,KACE,CACL,CACJ","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { VENTURES } from '../../../constants/ventures';
|
|
5
|
+
import { getSafeLinkHref } from '../../../helpers/urlHelpers';
|
|
5
6
|
import './ventureLogos.css';
|
|
6
7
|
export const VentureLogo = ({
|
|
7
8
|
ventureKey = 'x15Ventures',
|
|
@@ -25,7 +26,7 @@ export const VentureLogo = ({
|
|
|
25
26
|
} = logoDefinition;
|
|
26
27
|
const cssClass = `ventureLogo ventureLogo_${size} ${ventureKey}Logo ${customCssClass || ''}`;
|
|
27
28
|
return /*#__PURE__*/React.createElement("a", {
|
|
28
|
-
href: url,
|
|
29
|
+
href: getSafeLinkHref(url),
|
|
29
30
|
title: name,
|
|
30
31
|
target: "_blank",
|
|
31
32
|
className: cssClass,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VentureLogo.js","names":["React","VENTURES","VentureLogo","ventureKey","ventureDefinition","size","customCssClass","logoDefinition","x15Ventures","logo","icon","full","name","sites","public","publicSiteName","url","cssClass","createElement","href","title","target","className","rel"],"sources":["../../../../../src/components/design/logos/VentureLogo.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { VENTURES, VentureDefinition } from '../../../constants/ventures';\n\nimport './ventureLogos.scss';\n\nexport interface VentureLogoProps {\n ventureDefinition?: VentureDefinition;\n ventureKey: string;\n size?: 'icon' | 'full';\n customCssClass?: string;\n}\n\nexport const VentureLogo: React.FC<VentureLogoProps> = (\n {\n ventureKey = 'x15Ventures',\n ventureDefinition,\n size = 'full',\n customCssClass\n }\n) => {\n const logoDefinition = ventureDefinition || VENTURES[ ventureKey ] || VENTURES.x15Ventures;\n\n const { logo: { icon, full }, name, sites: { public: { name: publicSiteName, url } } } = logoDefinition;\n\n const cssClass = `ventureLogo ventureLogo_${ size } ${ ventureKey }Logo ${ customCssClass || '' }`;\n\n return (\n <a href={ url } title={ name } target=\"_blank\" className={ cssClass } rel=\"noreferrer\">\n {\n size === 'icon'\n ? icon\n : full\n }\n\n <span className=\"sr-only\">\n Visit { publicSiteName }\n </span>\n </a>\n );\n};\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAA2B,6BAA6B;
|
|
1
|
+
{"version":3,"file":"VentureLogo.js","names":["React","VENTURES","getSafeLinkHref","VentureLogo","ventureKey","ventureDefinition","size","customCssClass","logoDefinition","x15Ventures","logo","icon","full","name","sites","public","publicSiteName","url","cssClass","createElement","href","title","target","className","rel"],"sources":["../../../../../src/components/design/logos/VentureLogo.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { VENTURES, VentureDefinition } from '../../../constants/ventures';\nimport { getSafeLinkHref } from '../../../helpers/urlHelpers';\n\nimport './ventureLogos.scss';\n\nexport interface VentureLogoProps {\n ventureDefinition?: VentureDefinition;\n ventureKey: string;\n size?: 'icon' | 'full';\n customCssClass?: string;\n}\n\nexport const VentureLogo: React.FC<VentureLogoProps> = (\n {\n ventureKey = 'x15Ventures',\n ventureDefinition,\n size = 'full',\n customCssClass\n }\n) => {\n const logoDefinition = ventureDefinition || VENTURES[ ventureKey ] || VENTURES.x15Ventures;\n\n const { logo: { icon, full }, name, sites: { public: { name: publicSiteName, url } } } = logoDefinition;\n\n const cssClass = `ventureLogo ventureLogo_${ size } ${ ventureKey }Logo ${ customCssClass || '' }`;\n\n return (\n <a href={ getSafeLinkHref(url) } title={ name } target=\"_blank\" className={ cssClass } rel=\"noreferrer\">\n {\n size === 'icon'\n ? icon\n : full\n }\n\n <span className=\"sr-only\">\n Visit { publicSiteName }\n </span>\n </a>\n );\n};\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,QAAQ,QAA2B,6BAA6B;AACzE,SAASC,eAAe,QAAQ,6BAA6B;AAE7D,OAAO,qBAAqB;AAS5B,OAAO,MAAMC,WAAuC,GAAGA,CACrD;EACEC,UAAU,GAAG,aAAa;EAC1BC,iBAAiB;EACjBC,IAAI,GAAG,MAAM;EACbC;AACF,CAAC,KACE;EACH,MAAMC,cAAc,GAAGH,iBAAiB,IAAIJ,QAAQ,CAAEG,UAAU,CAAE,IAAIH,QAAQ,CAACQ,WAAW;EAE1F,MAAM;IAAEC,IAAI,EAAE;MAAEC,IAAI;MAAEC;IAAK,CAAC;IAAEC,IAAI;IAAEC,KAAK,EAAE;MAAEC,MAAM,EAAE;QAAEF,IAAI,EAAEG,cAAc;QAAEC;MAAI;IAAE;EAAE,CAAC,GAAGT,cAAc;EAEvG,MAAMU,QAAQ,GAAG,2BAA4BZ,IAAI,IAAMF,UAAU,QAAUG,cAAc,IAAI,EAAE,EAAG;EAElG,oBACEP,KAAA,CAAAmB,aAAA;IAAGC,IAAI,EAAGlB,eAAe,CAACe,GAAG,CAAG;IAACI,KAAK,EAAGR,IAAM;IAACS,MAAM,EAAC,QAAQ;IAACC,SAAS,EAAGL,QAAU;IAACM,GAAG,EAAC;EAAY,GAEnGlB,IAAI,KAAK,MAAM,GACXK,IAAI,GACJC,IAAI,eAGVZ,KAAA,CAAAmB,aAAA;IAAMI,SAAS,EAAC;EAAS,GAAC,QAClB,EAAEP,cACJ,CACL,CAAC;AAER,CAAC","ignoreList":[]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import React, { useRef, useEffect } from 'react';
|
|
4
|
-
import { SimpleButton } from '
|
|
4
|
+
import { SimpleButton } from '../../form/buttons/SimpleButton';
|
|
5
5
|
import { useRevealMoreLogic } from './hooks/useRevealMoreLogic';
|
|
6
6
|
import { useCustomButton } from './hooks/useCustomButton';
|
|
7
7
|
export const RevealMoreBelow = props => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RevealMoreBelow.js","names":["React","useRef","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreBelow","props","children","lineClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","contentRef","isCustomButton","el","current","scrollHeight","clientHeight","elementStyle","overflow","display","WebkitBoxOrient","WebkitLineClamp","createElement","className","ref","style","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"],"sources":["../../../../../src/components/design/revealMore/RevealMoreBelow.tsx"],"sourcesContent":["'use client';\n\nimport React, { useRef, useEffect } from 'react';\nimport { SimpleButton } from '
|
|
1
|
+
{"version":3,"file":"RevealMoreBelow.js","names":["React","useRef","useEffect","SimpleButton","useRevealMoreLogic","useCustomButton","RevealMoreBelow","props","children","lineClamp","customCssClass","isExpanded","isOverflowing","setIsOverflowing","toggleExpand","renderCustomButton","contentRef","isCustomButton","el","current","scrollHeight","clientHeight","elementStyle","overflow","display","WebkitBoxOrient","WebkitLineClamp","createElement","className","ref","style","revealLessButton","revealMoreButton","onClickHandler","revealLessLabelOnClickHandler","revealMoreLabelOnClickHandler","id","cssClass","label","revealLessLabel","revealMoreLabel","leftIcon","icon","onRevealLess","onRevealMore"],"sources":["../../../../../src/components/design/revealMore/RevealMoreBelow.tsx"],"sourcesContent":["'use client';\n\nimport React, { useRef, useEffect } from 'react';\nimport { SimpleButton } from '../../form/buttons/SimpleButton';\nimport { RevealMoreBelowProps, ManagedButtonProps } from './types/revealMoreTypes';\nimport { useRevealMoreLogic } from './hooks/useRevealMoreLogic';\nimport { useCustomButton } from './hooks/useCustomButton';\n\nexport const RevealMoreBelow: React.FC<RevealMoreBelowProps> = (props) => {\n const {\n children,\n lineClamp = 2,\n customCssClass\n } = props;\n\n const { isExpanded, isOverflowing, setIsOverflowing, toggleExpand } = useRevealMoreLogic();\n const { renderCustomButton } = useCustomButton(toggleExpand);\n const contentRef = useRef<HTMLDivElement>(null);\n\n const isCustomButton = 'revealMoreButton' in props && 'revealLessButton' in props;\n\n useEffect(() => {\n const el = contentRef.current;\n if (el) {\n setIsOverflowing(el.scrollHeight > el.clientHeight);\n }\n }, [children, lineClamp]);\n\n const elementStyle: React.CSSProperties = {\n overflow: 'hidden',\n display: '-webkit-box',\n WebkitBoxOrient: 'vertical',\n WebkitLineClamp: lineClamp,\n };\n\n return (\n <div className={ `revealMore revealMore_below ${ customCssClass || '' }` }>\n <div\n ref={ contentRef }\n className={ 'revealMore_content' }\n style={ isExpanded ? { ...elementStyle, WebkitLineClamp: 'none' } : elementStyle }\n >\n { children }\n </div>\n { isOverflowing && (\n isCustomButton ? (\n renderCustomButton(\n isExpanded ? props.revealLessButton : props.revealMoreButton\n )\n ) : (\n <SimpleButton\n onClickHandler={ () => {\n toggleExpand();\n if (isExpanded) {\n (props as ManagedButtonProps).revealLessLabelOnClickHandler?.();\n } else {\n (props as ManagedButtonProps).revealMoreLabelOnClickHandler?.();\n }\n } }\n id='revealMore_button-below'\n cssClass=\"button compact\"\n label={\n isExpanded \n ? (props as ManagedButtonProps).revealLessLabel || 'Reveal Less' \n : (props as ManagedButtonProps).revealMoreLabel || 'Reveal More'\n }\n leftIcon={\n isExpanded\n ? (props as ManagedButtonProps).icon?.onRevealLess\n : (props as ManagedButtonProps).icon?.onRevealMore\n }\n aria-hidden = { props.revealLessLabelOnClickHandler || props.revealMoreLabelOnClickHandler ? false : true }\n />\n )\n ) }\n </div>\n );\n};"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,MAAM,EAAEC,SAAS,QAAQ,OAAO;AAChD,SAASC,YAAY,QAAQ,iCAAiC;AAE9D,SAASC,kBAAkB,QAAQ,4BAA4B;AAC/D,SAASC,eAAe,QAAQ,yBAAyB;AAEzD,OAAO,MAAMC,eAA+C,GAAIC,KAAK,IAAK;EACxE,MAAM;IACJC,QAAQ;IACRC,SAAS,GAAG,CAAC;IACbC;EACF,CAAC,GAAGH,KAAK;EAET,MAAM;IAAEI,UAAU;IAAEC,aAAa;IAAEC,gBAAgB;IAAEC;EAAa,CAAC,GAAGV,kBAAkB,CAAC,CAAC;EAC1F,MAAM;IAAEW;EAAmB,CAAC,GAAGV,eAAe,CAACS,YAAY,CAAC;EAC5D,MAAME,UAAU,GAAGf,MAAM,CAAiB,IAAI,CAAC;EAE/C,MAAMgB,cAAc,GAAG,kBAAkB,IAAIV,KAAK,IAAI,kBAAkB,IAAIA,KAAK;EAEjFL,SAAS,CAAC,MAAM;IACd,MAAMgB,EAAE,GAAGF,UAAU,CAACG,OAAO;IAC7B,IAAID,EAAE,EAAE;MACNL,gBAAgB,CAACK,EAAE,CAACE,YAAY,GAAGF,EAAE,CAACG,YAAY,CAAC;IACrD;EACF,CAAC,EAAE,CAACb,QAAQ,EAAEC,SAAS,CAAC,CAAC;EAEzB,MAAMa,YAAiC,GAAG;IACxCC,QAAQ,EAAE,QAAQ;IAClBC,OAAO,EAAE,aAAa;IACtBC,eAAe,EAAE,UAAU;IAC3BC,eAAe,EAAEjB;EACnB,CAAC;EAED,oBACET,KAAA,CAAA2B,aAAA;IAAKC,SAAS,EAAG,+BAAgClB,cAAc,IAAI,EAAE;EAAK,gBACxEV,KAAA,CAAA2B,aAAA;IACEE,GAAG,EAAGb,UAAY;IAClBY,SAAS,EAAG,oBAAsB;IAClCE,KAAK,EAAGnB,UAAU,GAAG;MAAE,GAAGW,YAAY;MAAEI,eAAe,EAAE;IAAO,CAAC,GAAGJ;EAAc,GAEhFd,QACC,CAAC,EACJI,aAAa,KACbK,cAAc,GACZF,kBAAkB,CAChBJ,UAAU,GAAGJ,KAAK,CAACwB,gBAAgB,GAAGxB,KAAK,CAACyB,gBAC9C,CAAC,gBAEDhC,KAAA,CAAA2B,aAAA,CAACxB,YAAY;IACX8B,cAAc,EAAGA,CAAA,KAAM;MACrBnB,YAAY,CAAC,CAAC;MACd,IAAIH,UAAU,EAAE;QACbJ,KAAK,CAAwB2B,6BAA6B,GAAG,CAAC;MACjE,CAAC,MAAM;QACJ3B,KAAK,CAAwB4B,6BAA6B,GAAG,CAAC;MACjE;IACF,CAAG;IACHC,EAAE,EAAC,yBAAyB;IAC5BC,QAAQ,EAAC,gBAAgB;IACzBC,KAAK,EACH3B,UAAU,GACLJ,KAAK,CAAwBgC,eAAe,IAAI,aAAa,GAC7DhC,KAAK,CAAwBiC,eAAe,IAAI,aACtD;IACDC,QAAQ,EACN9B,UAAU,GACLJ,KAAK,CAAwBmC,IAAI,EAAEC,YAAY,GAC/CpC,KAAK,CAAwBmC,IAAI,EAAEE,YACzC;IACD,eAAgBrC,KAAK,CAAC2B,6BAA6B,IAAI3B,KAAK,CAAC4B,6BAA6B,GAAG,KAAK,GAAG;EAAM,CAC5G,CACF,CAEA,CAAC;AAEV,CAAC","ignoreList":[]}
|
|
@@ -1,6 +1,14 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './skeleton.css';
|
|
3
|
-
|
|
3
|
+
// Sizes, calc(), min(), var(--x) and the like. Excludes `;`, `:`, quotes, braces and backslashes, which
|
|
4
|
+
// could end the declaration in a server-rendered style attribute, since React does not escape them.
|
|
5
|
+
const CSS_SIZE_PATTERN = /^[\w\s.%()+\-*/,]+$/;
|
|
6
|
+
const toCssSize = value => {
|
|
7
|
+
if (typeof value === 'number') {
|
|
8
|
+
return Number.isFinite(value) ? `${value}px` : undefined;
|
|
9
|
+
}
|
|
10
|
+
return typeof value === 'string' && CSS_SIZE_PATTERN.test(value) ? value : undefined;
|
|
11
|
+
};
|
|
4
12
|
export const Skeleton = ({
|
|
5
13
|
variant = 'text',
|
|
6
14
|
width,
|
|
@@ -18,11 +26,13 @@ export const Skeleton = ({
|
|
|
18
26
|
const barCount = variant === 'text' ? rowCount : 1;
|
|
19
27
|
const animationCssClass = animation ? `skeleton_${animation}` : 'skeleton_noAnimation';
|
|
20
28
|
const skeletonStyle = {};
|
|
21
|
-
|
|
22
|
-
|
|
29
|
+
const cssWidth = width === undefined ? undefined : toCssSize(width);
|
|
30
|
+
const cssHeight = height === undefined || variant === 'circle' ? undefined : toCssSize(height);
|
|
31
|
+
if (cssWidth) {
|
|
32
|
+
skeletonStyle['--skeletonWidth'] = cssWidth;
|
|
23
33
|
}
|
|
24
|
-
if (
|
|
25
|
-
skeletonStyle['--skeletonHeight'] =
|
|
34
|
+
if (cssHeight) {
|
|
35
|
+
skeletonStyle['--skeletonHeight'] = cssHeight;
|
|
26
36
|
}
|
|
27
37
|
return /*#__PURE__*/React.createElement("span", {
|
|
28
38
|
id: id,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Skeleton.js","names":["React","toCssSize","value","Skeleton","variant","width","height","lines","animation","appearance","isLoaded","children","id","customCssClass","createElement","Fragment","rowCount","
|
|
1
|
+
{"version":3,"file":"Skeleton.js","names":["React","CSS_SIZE_PATTERN","toCssSize","value","Number","isFinite","undefined","test","Skeleton","variant","width","height","lines","animation","appearance","isLoaded","children","id","customCssClass","createElement","Fragment","rowCount","Math","max","floor","barCount","animationCssClass","skeletonStyle","cssWidth","cssHeight","className","style","Array","from","length","_bar","index","key"],"sources":["../../../../../src/components/design/skeleton/Skeleton.tsx"],"sourcesContent":["import React from 'react';\n\nimport './skeleton.scss';\n\nexport interface SkeletonProps {\n /** Structural style of the placeholder. `text` renders line sized bars, `block` a sharp cornered area, `rounded` a softened one, and `circle` an avatar style disc. */\n variant?: 'text' | 'block' | 'circle' | 'rounded';\n /** Inline size of the placeholder. Numbers are treated as pixels, strings are passed through as written (for example `'50%'` or `'calc(100% - 2rem)'`). Strings containing characters that could not be part of a size, such as `;` or quotes, are ignored. */\n width?: string | number;\n /** Block size of the placeholder. Numbers are treated as pixels. Ignored for the `circle` variant, which stays square. */\n height?: string | number;\n /** How many placeholder rows to render. Applies to the `text` variant only; all other variants render a single bar. */\n lines?: number;\n /** Animation style, or `false` for a static placeholder. Both animations are suppressed under `prefers-reduced-motion`. */\n animation?: 'pulse' | 'wave' | false;\n /** Visual intensity. `opaque` gives a higher contrast fill for busier or lower contrast surfaces. */\n appearance?: 'subtle' | 'opaque';\n /** When true, `children` are rendered in place of the placeholder. */\n isLoaded?: boolean;\n /** Real content, rendered once `isLoaded` is true. */\n children?: React.ReactNode;\n /** Applied to the placeholder wrapper. Note the wrapper is `aria-hidden`, so this is intended for styling and testing rather than as an ARIA target. */\n id?: string;\n /** Additional class names appended to the placeholder wrapper. */\n customCssClass?: string;\n}\n\n// Sizes, calc(), min(), var(--x) and the like. Excludes `;`, `:`, quotes, braces and backslashes, which\n// could end the declaration in a server-rendered style attribute, since React does not escape them.\nconst CSS_SIZE_PATTERN = /^[\\w\\s.%()+\\-*/,]+$/;\n\nconst toCssSize = (value: string | number): string | undefined => {\n if (typeof value === 'number') {\n return Number.isFinite(value) ? `${ value }px` : undefined;\n }\n return typeof value === 'string' && CSS_SIZE_PATTERN.test(value) ? value : undefined;\n};\n\nexport const Skeleton: React.FC<SkeletonProps> = (\n {\n variant = 'text',\n width,\n height,\n lines = 1,\n animation = 'wave',\n appearance = 'subtle',\n isLoaded = false,\n children,\n id,\n customCssClass = ''\n }\n) => {\n if (isLoaded) return <>{ children }</>;\n\n const rowCount = Number.isFinite(lines) ? Math.max(1, Math.floor(lines)) : 1;\n const barCount = variant === 'text' ? rowCount : 1;\n const animationCssClass = animation ? `skeleton_${ animation }` : 'skeleton_noAnimation';\n\n const skeletonStyle: Record<string, string> = {};\n\n const cssWidth = width === undefined ? undefined : toCssSize(width);\n const cssHeight = height === undefined || variant === 'circle' ? undefined : toCssSize(height);\n\n if (cssWidth) {\n skeletonStyle['--skeletonWidth'] = cssWidth;\n }\n\n if (cssHeight) {\n skeletonStyle['--skeletonHeight'] = cssHeight;\n }\n\n return (\n <span\n id={ id }\n aria-hidden=\"true\"\n className={ `skeleton skeleton_${ variant } skeleton_${ appearance } ${ animationCssClass } ${ customCssClass }` }\n style={ skeletonStyle as React.CSSProperties }\n >\n { Array.from({ length: barCount }, (_bar, index) => (\n <span key={ index } className=\"skeletonBar\" />\n )) }\n </span>\n );\n};\n\nexport default Skeleton;\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,OAAO,iBAAiB;AAyBxB;AACA;AACA,MAAMC,gBAAgB,GAAG,qBAAqB;AAE9C,MAAMC,SAAS,GAAIC,KAAsB,IAAyB;EAChE,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOC,MAAM,CAACC,QAAQ,CAACF,KAAK,CAAC,GAAG,GAAIA,KAAK,IAAK,GAAGG,SAAS;EAC5D;EACA,OAAO,OAAOH,KAAK,KAAK,QAAQ,IAAIF,gBAAgB,CAACM,IAAI,CAACJ,KAAK,CAAC,GAAGA,KAAK,GAAGG,SAAS;AACtF,CAAC;AAED,OAAO,MAAME,QAAiC,GAAGA,CAC/C;EACEC,OAAO,GAAG,MAAM;EAChBC,KAAK;EACLC,MAAM;EACNC,KAAK,GAAG,CAAC;EACTC,SAAS,GAAG,MAAM;EAClBC,UAAU,GAAG,QAAQ;EACrBC,QAAQ,GAAG,KAAK;EAChBC,QAAQ;EACRC,EAAE;EACFC,cAAc,GAAG;AACnB,CAAC,KACE;EACH,IAAIH,QAAQ,EAAE,oBAAOf,KAAA,CAAAmB,aAAA,CAAAnB,KAAA,CAAAoB,QAAA,QAAIJ,QAAY,CAAC;EAEtC,MAAMK,QAAQ,GAAGjB,MAAM,CAACC,QAAQ,CAACO,KAAK,CAAC,GAAGU,IAAI,CAACC,GAAG,CAAC,CAAC,EAAED,IAAI,CAACE,KAAK,CAACZ,KAAK,CAAC,CAAC,GAAG,CAAC;EAC5E,MAAMa,QAAQ,GAAGhB,OAAO,KAAK,MAAM,GAAGY,QAAQ,GAAG,CAAC;EAClD,MAAMK,iBAAiB,GAAGb,SAAS,GAAG,YAAaA,SAAS,EAAG,GAAG,sBAAsB;EAExF,MAAMc,aAAqC,GAAG,CAAC,CAAC;EAEhD,MAAMC,QAAQ,GAAGlB,KAAK,KAAKJ,SAAS,GAAGA,SAAS,GAAGJ,SAAS,CAACQ,KAAK,CAAC;EACnE,MAAMmB,SAAS,GAAGlB,MAAM,KAAKL,SAAS,IAAIG,OAAO,KAAK,QAAQ,GAAGH,SAAS,GAAGJ,SAAS,CAACS,MAAM,CAAC;EAE9F,IAAIiB,QAAQ,EAAE;IACZD,aAAa,CAAC,iBAAiB,CAAC,GAAGC,QAAQ;EAC7C;EAEA,IAAIC,SAAS,EAAE;IACbF,aAAa,CAAC,kBAAkB,CAAC,GAAGE,SAAS;EAC/C;EAEA,oBACE7B,KAAA,CAAAmB,aAAA;IACEF,EAAE,EAAGA,EAAI;IACT,eAAY,MAAM;IAClBa,SAAS,EAAG,qBAAsBrB,OAAO,aAAeK,UAAU,IAAMY,iBAAiB,IAAMR,cAAc,EAAK;IAClHa,KAAK,EAAGJ;EAAsC,GAE5CK,KAAK,CAACC,IAAI,CAAC;IAAEC,MAAM,EAAET;EAAS,CAAC,EAAE,CAACU,IAAI,EAAEC,KAAK,kBAC7CpC,KAAA,CAAAmB,aAAA;IAAMkB,GAAG,EAAGD,KAAO;IAACN,SAAS,EAAC;EAAa,CAAE,CAC9C,CACG,CAAC;AAEX,CAAC;AAED,eAAetB,QAAQ","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThemeLoader.js","names":["React","useContext","useEffect","useRef","useMemo","libraryThemes","AppContext","CURRENT_DOMAIN","LIBRARY_CDN_DEV_BASE_URL","LIBRARY_CDN_PROD_BASE_URL","LIBRARY_VERSION","themes","ThemeLoader","useMin","forceProd","forceCacheBusting","userTheme","useLatest","baseCssLink","themeCssLink","appContextProvider","appTheme","appContext","theme","activeTheme","publicLibraryDomain","env","process","NODE_ENV","isProduction","isDevelopment","cdnBaseUrl","getThemeCss","console","warn","buildPath","dev","min","versioned","cssFile","css","cacheBuster","Date","getTime","libraryDomain","baseCss","themeCss","current","href","createElement","Fragment","ref","rel","as"],"sources":["../../../../../src/components/design/themeLoader/ThemeLoader.tsx"],"sourcesContent":["'use client';\n\nimport React, { useContext, useEffect, useRef, useMemo } from 'react';\n\nimport libraryThemes from '../../../autoGenerated/libraryThemes';\nimport { AppContext } from '../../../contextProviders/appContext/AppContextProvider';\nimport { CURRENT_DOMAIN } from '../../../constants/appEnvironment';\nimport { LIBRARY_CDN_DEV_BASE_URL, LIBRARY_CDN_PROD_BASE_URL, LIBRARY_VERSION } from '../../../constants/libraryCDN';\n\nexport type ThemeStructure = {\n buildPath: string;\n dev: {\n css: string;\n map: string;\n };\n min: {\n css: string;\n map: string;\n };\n versioned: {\n css: string;\n map: string;\n };\n};\n\ntype AvailableThemes = {\n [themeName: string]: ThemeStructure;\n};\n\ntype themeLoaderProps = {\n useMin?: boolean,\n forceProd?: boolean,\n forceCacheBusting?: boolean,\n userTheme?: string;\n useLatest?: boolean;\n};\n\nconst themes: AvailableThemes = libraryThemes || {};\n\nexport const ThemeLoader: React.FC<themeLoaderProps> = (\n {\n useMin = false,\n forceProd = false,\n forceCacheBusting = false,\n userTheme,\n useLatest =
|
|
1
|
+
{"version":3,"file":"ThemeLoader.js","names":["React","useContext","useEffect","useRef","useMemo","libraryThemes","AppContext","CURRENT_DOMAIN","LIBRARY_CDN_DEV_BASE_URL","LIBRARY_CDN_PROD_BASE_URL","LIBRARY_VERSION","themes","ThemeLoader","useMin","forceProd","forceCacheBusting","userTheme","useLatest","baseCssLink","themeCssLink","appContextProvider","appTheme","appContext","theme","activeTheme","publicLibraryDomain","env","process","NODE_ENV","isProduction","isDevelopment","cdnBaseUrl","getThemeCss","console","warn","buildPath","dev","min","versioned","cssFile","css","cacheBuster","Date","getTime","libraryDomain","baseCss","themeCss","current","href","createElement","Fragment","ref","rel","as"],"sources":["../../../../../src/components/design/themeLoader/ThemeLoader.tsx"],"sourcesContent":["'use client';\n\nimport React, { useContext, useEffect, useRef, useMemo } from 'react';\n\nimport libraryThemes from '../../../autoGenerated/libraryThemes';\nimport { AppContext } from '../../../contextProviders/appContext/AppContextProvider';\nimport { CURRENT_DOMAIN } from '../../../constants/appEnvironment';\nimport { LIBRARY_CDN_DEV_BASE_URL, LIBRARY_CDN_PROD_BASE_URL, LIBRARY_VERSION } from '../../../constants/libraryCDN';\n\nexport type ThemeStructure = {\n buildPath: string;\n dev: {\n css: string;\n map: string;\n };\n min: {\n css: string;\n map: string;\n };\n versioned: {\n css: string;\n map: string;\n };\n};\n\ntype AvailableThemes = {\n [themeName: string]: ThemeStructure;\n};\n\ntype themeLoaderProps = {\n useMin?: boolean,\n forceProd?: boolean,\n forceCacheBusting?: boolean,\n userTheme?: string;\n // Load the CDN's `latest` stylesheets instead of those for the installed library version. Off by\n // default: `latest` changes under the app on every release, so it can restyle apps that never\n // upgraded with CSS written for components they do not have.\n useLatest?: boolean;\n};\n\nconst themes: AvailableThemes = libraryThemes || {};\n\nexport const ThemeLoader: React.FC<themeLoaderProps> = (\n {\n useMin = false,\n forceProd = false,\n forceCacheBusting = false,\n userTheme,\n useLatest = false,\n }\n) => {\n const baseCssLink = useRef<HTMLLinkElement>(null);\n const themeCssLink = useRef<HTMLLinkElement>(null);\n\n const appContextProvider = useContext(AppContext);\n const appTheme = appContextProvider?.appContext?.theme;\n\n const activeTheme = userTheme || appTheme;\n const publicLibraryDomain = appContextProvider?.appContext?.publicLibraryDomain || '';\n\n const env = process.env.NODE_ENV;\n const isProduction = env === 'production' || env === 'prod';\n const isDevelopment = env === 'development' || env === 'dev';\n\n const cdnBaseUrl = `${ isProduction ? LIBRARY_CDN_PROD_BASE_URL : LIBRARY_CDN_DEV_BASE_URL }/${ useLatest ? 'latest' : LIBRARY_VERSION }`;\n\n const getThemeCss = (theme: string | undefined) => {\n if (!theme || !themes[theme]) {\n console.warn(`Theme \"${ theme }\" not found. Using default variables instead.`);\n return null;\n }\n\n const {\n buildPath, dev, min, versioned\n } = themes[theme];\n\n const cssFile = () => {\n if (forceProd) {\n return versioned.css;\n }\n\n if (isProduction) {\n return useMin ? versioned.css : min.css;\n }\n\n if (isDevelopment) {\n return useMin ? min.css : dev.css;\n }\n\n return dev.css;\n };\n\n const cacheBuster = CURRENT_DOMAIN === 'localhost' || forceCacheBusting ? `?v=${ new Date().getTime() }` : '';\n const libraryDomain = publicLibraryDomain !== '' ? `${ publicLibraryDomain }` : cdnBaseUrl;\n\n return `${ libraryDomain }/${ buildPath }/${ cssFile() }${ cacheBuster }`;\n };\n\n const baseCss = useMemo(() => getThemeCss('base'), [activeTheme, useMin, forceProd, forceCacheBusting]);\n const themeCss = useMemo(() => getThemeCss(activeTheme), [activeTheme, useMin, forceProd, forceCacheBusting]);\n\n useEffect(() => {\n if (baseCss && baseCssLink.current) {\n baseCssLink.current.href = baseCss;\n }\n if (themeCss && themeCssLink.current) {\n themeCssLink.current.href = themeCss;\n }\n }, [activeTheme]);\n\n return (\n <>\n <link ref={ baseCssLink } rel=\"stylesheet\" as=\"style\" />\n <link ref={ themeCssLink } rel=\"stylesheet\" as=\"style\" />\n </>\n );\n};\n"],"mappings":"AAAA,YAAY;;AAEZ,OAAOA,KAAK,IAAIC,UAAU,EAAEC,SAAS,EAAEC,MAAM,EAAEC,OAAO,QAAQ,OAAO;AAErE,OAAOC,aAAa,MAAM,sCAAsC;AAChE,SAASC,UAAU,QAAQ,yDAAyD;AACpF,SAASC,cAAc,QAAQ,mCAAmC;AAClE,SAASC,wBAAwB,EAAEC,yBAAyB,EAAEC,eAAe,QAAQ,+BAA+B;AAiCpH,MAAMC,MAAuB,GAAGN,aAAa,IAAI,CAAC,CAAC;AAEnD,OAAO,MAAMO,WAAuC,GAAGA,CACrD;EACEC,MAAM,GAAG,KAAK;EACdC,SAAS,GAAG,KAAK;EACjBC,iBAAiB,GAAG,KAAK;EACzBC,SAAS;EACTC,SAAS,GAAG;AACd,CAAC,KACE;EACH,MAAMC,WAAW,GAAGf,MAAM,CAAkB,IAAI,CAAC;EACjD,MAAMgB,YAAY,GAAGhB,MAAM,CAAkB,IAAI,CAAC;EAElD,MAAMiB,kBAAkB,GAAGnB,UAAU,CAACK,UAAU,CAAC;EACjD,MAAMe,QAAQ,GAAGD,kBAAkB,EAAEE,UAAU,EAAEC,KAAK;EAEtD,MAAMC,WAAW,GAAGR,SAAS,IAAIK,QAAQ;EACzC,MAAMI,mBAAmB,GAAGL,kBAAkB,EAAEE,UAAU,EAAEG,mBAAmB,IAAI,EAAE;EAErF,MAAMC,GAAG,GAAGC,OAAO,CAACD,GAAG,CAACE,QAAQ;EAChC,MAAMC,YAAY,GAAGH,GAAG,KAAK,YAAY,IAAIA,GAAG,KAAK,MAAM;EAC3D,MAAMI,aAAa,GAAGJ,GAAG,KAAK,aAAa,IAAIA,GAAG,KAAK,KAAK;EAE5D,MAAMK,UAAU,GAAG,GAAIF,YAAY,GAAGpB,yBAAyB,GAAGD,wBAAwB,IAAMS,SAAS,GAAG,QAAQ,GAAGP,eAAe,EAAG;EAEzI,MAAMsB,WAAW,GAAIT,KAAyB,IAAK;IACjD,IAAI,CAACA,KAAK,IAAI,CAACZ,MAAM,CAACY,KAAK,CAAC,EAAE;MAC5BU,OAAO,CAACC,IAAI,CAAC,UAAWX,KAAK,+CAAgD,CAAC;MAC9E,OAAO,IAAI;IACb;IAEA,MAAM;MACJY,SAAS;MAAEC,GAAG;MAAEC,GAAG;MAAEC;IACvB,CAAC,GAAG3B,MAAM,CAACY,KAAK,CAAC;IAEjB,MAAMgB,OAAO,GAAGA,CAAA,KAAM;MACpB,IAAIzB,SAAS,EAAE;QACb,OAAOwB,SAAS,CAACE,GAAG;MACtB;MAEA,IAAIX,YAAY,EAAE;QAChB,OAAOhB,MAAM,GAAGyB,SAAS,CAACE,GAAG,GAAGH,GAAG,CAACG,GAAG;MACzC;MAEA,IAAIV,aAAa,EAAE;QACjB,OAAOjB,MAAM,GAAGwB,GAAG,CAACG,GAAG,GAAGJ,GAAG,CAACI,GAAG;MACnC;MAEA,OAAOJ,GAAG,CAACI,GAAG;IAChB,CAAC;IAED,MAAMC,WAAW,GAAGlC,cAAc,KAAK,WAAW,IAAIQ,iBAAiB,GAAG,MAAO,IAAI2B,IAAI,CAAC,CAAC,CAACC,OAAO,CAAC,CAAC,EAAG,GAAG,EAAE;IAC7G,MAAMC,aAAa,GAAGnB,mBAAmB,KAAK,EAAE,GAAG,GAAIA,mBAAmB,EAAG,GAAGM,UAAU;IAE1F,OAAO,GAAIa,aAAa,IAAMT,SAAS,IAAMI,OAAO,CAAC,CAAC,GAAKE,WAAW,EAAG;EAC3E,CAAC;EAED,MAAMI,OAAO,GAAGzC,OAAO,CAAC,MAAM4B,WAAW,CAAC,MAAM,CAAC,EAAE,CAACR,WAAW,EAAEX,MAAM,EAAEC,SAAS,EAAEC,iBAAiB,CAAC,CAAC;EACvG,MAAM+B,QAAQ,GAAG1C,OAAO,CAAC,MAAM4B,WAAW,CAACR,WAAW,CAAC,EAAE,CAACA,WAAW,EAAEX,MAAM,EAAEC,SAAS,EAAEC,iBAAiB,CAAC,CAAC;EAE7Gb,SAAS,CAAC,MAAM;IACd,IAAI2C,OAAO,IAAI3B,WAAW,CAAC6B,OAAO,EAAE;MAClC7B,WAAW,CAAC6B,OAAO,CAACC,IAAI,GAAGH,OAAO;IACpC;IACA,IAAIC,QAAQ,IAAI3B,YAAY,CAAC4B,OAAO,EAAE;MACpC5B,YAAY,CAAC4B,OAAO,CAACC,IAAI,GAAGF,QAAQ;IACtC;EACF,CAAC,EAAE,CAACtB,WAAW,CAAC,CAAC;EAEjB,oBACExB,KAAA,CAAAiD,aAAA,CAAAjD,KAAA,CAAAkD,QAAA,qBACElD,KAAA,CAAAiD,aAAA;IAAME,GAAG,EAAGjC,WAAa;IAACkC,GAAG,EAAC,YAAY;IAACC,EAAE,EAAC;EAAO,CAAE,CAAC,eACxDrD,KAAA,CAAAiD,aAAA;IAAME,GAAG,EAAGhC,YAAc;IAACiC,GAAG,EAAC,YAAY;IAACC,EAAE,EAAC;EAAO,CAAE,CACxD,CAAC;AAEP,CAAC","ignoreList":[]}
|
|
@@ -17,6 +17,7 @@ export const SimpleButton = /*#__PURE__*/forwardRef(({
|
|
|
17
17
|
disabledMessage = 'This button has been disabled temporarily. There is likely an issue elsewhere on your form that needs to be resolved first.',
|
|
18
18
|
onClickHandler = () => {},
|
|
19
19
|
buttonStyle,
|
|
20
|
+
ariaPressed,
|
|
20
21
|
children
|
|
21
22
|
}, ref) => {
|
|
22
23
|
const buttonCssClass = useMemo(() => {
|
|
@@ -42,7 +43,8 @@ export const SimpleButton = /*#__PURE__*/forwardRef(({
|
|
|
42
43
|
className: buttonCssClass,
|
|
43
44
|
type: buttonType,
|
|
44
45
|
onClick: onClickHandler,
|
|
45
|
-
disabled: disabled
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
"aria-pressed": ariaPressed
|
|
46
48
|
}, disabled && {
|
|
47
49
|
'aria-describedby': disabledMessageId
|
|
48
50
|
}), renderIcon(leftIcon), /*#__PURE__*/React.createElement("span", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SimpleButton.js","names":["_extends","React","useMemo","forwardRef","renderIcon","generateButtonClass","SimpleButton","buttonType","leftIcon","rightIcon","hideLabel","label","title","id","cssClass","disabled","disabledMessage","onClickHandler","buttonStyle","children","ref","buttonCssClass","disabledMessageId","buttonHoverTitle","createElement","Fragment","className","type","onClick","Button"],"sources":["../../../../../src/components/form/buttons/SimpleButton.tsx"],"sourcesContent":["'use client';\n\nimport React, { useMemo, forwardRef } from 'react';\nimport { ButtonProps } from './button.interface';\nimport { renderIcon } from '../../../helpers/iconHelpers';\nimport { generateButtonClass } from './button.helpers';\n\nexport const SimpleButton = forwardRef<HTMLButtonElement, ButtonProps>((\n {\n buttonType = 'button',\n leftIcon,\n rightIcon,\n hideLabel = false,\n label = 'A button',\n title,\n id = 'buttonIdRequired',\n cssClass = 'button primary',\n disabled = false,\n disabledMessage = 'This button has been disabled temporarily. There is likely an issue elsewhere on your form that needs to be resolved first.',\n onClickHandler = () => { },\n buttonStyle,\n children\n },\n ref\n) => {\n \n const buttonCssClass = useMemo(() => {\n return generateButtonClass({ cssClass, buttonStyle, hideLabel });\n }, [cssClass, buttonStyle, hideLabel]);\n\n const disabledMessageId = `${ id }-disabledMessage`;\n\n const buttonHoverTitle = () => {\n if (title) {\n return title;\n }\n if (hideLabel && typeof label === 'string') {\n return label;\n }\n };\n\n return (\n <>\n <button\n ref={ ref }\n id={ id }\n title={ buttonHoverTitle() }\n className={ buttonCssClass }\n type={ buttonType }\n onClick={ onClickHandler }\n disabled={ disabled }\n { ...(disabled && { 'aria-describedby': disabledMessageId }) }\n >\n { renderIcon(leftIcon) }\n\n <span className={ `${ hideLabel ? 'sr-only' : 'labelText' }` }>{ label }</span>\n\n { children }\n\n { renderIcon(rightIcon) }\n </button>\n {\n disabled && (\n <span id={ disabledMessageId } className=\"sr-only\">\n {\n disabledMessage\n }\n </span>\n )\n }\n </>\n );\n});\n\nexport default SimpleButton;\n\nexport { SimpleButton as Button };"],"mappings":"AAAA,YAAY;;AAAC,OAAAA,QAAA;AAEb,OAAOC,KAAK,IAAIC,OAAO,EAAEC,UAAU,QAAQ,OAAO;AAElD,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,OAAO,MAAMC,YAAY,gBAAGH,UAAU,CAAiC,CACrE;EACEI,UAAU,GAAG,QAAQ;EACrBC,QAAQ;EACRC,SAAS;EACTC,SAAS,GAAG,KAAK;EACjBC,KAAK,GAAG,UAAU;EAClBC,KAAK;EACLC,EAAE,GAAG,kBAAkB;EACvBC,QAAQ,GAAG,gBAAgB;EAC3BC,QAAQ,GAAG,KAAK;EAChBC,eAAe,GAAG,6HAA6H;EAC/IC,cAAc,GAAGA,CAAA,KAAM,CAAE,CAAC;EAC1BC,WAAW;EACXC;AACF,CAAC,EACDC,GAAG,KACA;EAEH,MAAMC,cAAc,
|
|
1
|
+
{"version":3,"file":"SimpleButton.js","names":["_extends","React","useMemo","forwardRef","renderIcon","generateButtonClass","SimpleButton","buttonType","leftIcon","rightIcon","hideLabel","label","title","id","cssClass","disabled","disabledMessage","onClickHandler","buttonStyle","ariaPressed","children","ref","buttonCssClass","disabledMessageId","buttonHoverTitle","createElement","Fragment","className","type","onClick","Button"],"sources":["../../../../../src/components/form/buttons/SimpleButton.tsx"],"sourcesContent":["'use client';\n\nimport React, { useMemo, forwardRef } from 'react';\nimport { ButtonProps } from './button.interface';\nimport { renderIcon } from '../../../helpers/iconHelpers';\nimport { generateButtonClass } from './button.helpers';\n\nexport const SimpleButton = forwardRef<HTMLButtonElement, ButtonProps>((\n {\n buttonType = 'button',\n leftIcon,\n rightIcon,\n hideLabel = false,\n label = 'A button',\n title,\n id = 'buttonIdRequired',\n cssClass = 'button primary',\n disabled = false,\n disabledMessage = 'This button has been disabled temporarily. There is likely an issue elsewhere on your form that needs to be resolved first.',\n onClickHandler = () => { },\n buttonStyle,\n ariaPressed,\n children\n },\n ref\n) => {\n \n const buttonCssClass = useMemo(() => {\n return generateButtonClass({ cssClass, buttonStyle, hideLabel });\n }, [cssClass, buttonStyle, hideLabel]);\n\n const disabledMessageId = `${ id }-disabledMessage`;\n\n const buttonHoverTitle = () => {\n if (title) {\n return title;\n }\n if (hideLabel && typeof label === 'string') {\n return label;\n }\n };\n\n return (\n <>\n <button\n ref={ ref }\n id={ id }\n title={ buttonHoverTitle() }\n className={ buttonCssClass }\n type={ buttonType }\n onClick={ onClickHandler }\n disabled={ disabled }\n aria-pressed={ ariaPressed }\n { ...(disabled && { 'aria-describedby': disabledMessageId }) }\n >\n { renderIcon(leftIcon) }\n\n <span className={ `${ hideLabel ? 'sr-only' : 'labelText' }` }>{ label }</span>\n\n { children }\n\n { renderIcon(rightIcon) }\n </button>\n {\n disabled && (\n <span id={ disabledMessageId } className=\"sr-only\">\n {\n disabledMessage\n }\n </span>\n )\n }\n </>\n );\n});\n\nexport default SimpleButton;\n\nexport { SimpleButton as Button };"],"mappings":"AAAA,YAAY;;AAAC,OAAAA,QAAA;AAEb,OAAOC,KAAK,IAAIC,OAAO,EAAEC,UAAU,QAAQ,OAAO;AAElD,SAASC,UAAU,QAAQ,8BAA8B;AACzD,SAASC,mBAAmB,QAAQ,kBAAkB;AAEtD,OAAO,MAAMC,YAAY,gBAAGH,UAAU,CAAiC,CACrE;EACEI,UAAU,GAAG,QAAQ;EACrBC,QAAQ;EACRC,SAAS;EACTC,SAAS,GAAG,KAAK;EACjBC,KAAK,GAAG,UAAU;EAClBC,KAAK;EACLC,EAAE,GAAG,kBAAkB;EACvBC,QAAQ,GAAG,gBAAgB;EAC3BC,QAAQ,GAAG,KAAK;EAChBC,eAAe,GAAG,6HAA6H;EAC/IC,cAAc,GAAGA,CAAA,KAAM,CAAE,CAAC;EAC1BC,WAAW;EACXC,WAAW;EACXC;AACF,CAAC,EACDC,GAAG,KACA;EAEH,MAAMC,cAAc,GAAGpB,OAAO,CAAC,MAAM;IACnC,OAAOG,mBAAmB,CAAC;MAAES,QAAQ;MAAEI,WAAW;MAAER;IAAU,CAAC,CAAC;EAClE,CAAC,EAAE,CAACI,QAAQ,EAAEI,WAAW,EAAER,SAAS,CAAC,CAAC;EAEtC,MAAMa,iBAAiB,GAAG,GAAIV,EAAE,kBAAmB;EAEnD,MAAMW,gBAAgB,GAAGA,CAAA,KAAM;IAC7B,IAAIZ,KAAK,EAAE;MACT,OAAOA,KAAK;IACd;IACA,IAAIF,SAAS,IAAI,OAAOC,KAAK,KAAK,QAAQ,EAAE;MAC1C,OAAOA,KAAK;IACd;EACF,CAAC;EAED,oBACEV,KAAA,CAAAwB,aAAA,CAAAxB,KAAA,CAAAyB,QAAA,qBACEzB,KAAA,CAAAwB,aAAA,WAAAzB,QAAA;IACEqB,GAAG,EAAGA,GAAK;IACXR,EAAE,EAAGA,EAAI;IACTD,KAAK,EAAGY,gBAAgB,CAAC,CAAG;IAC5BG,SAAS,EAAGL,cAAgB;IAC5BM,IAAI,EAAGrB,UAAY;IACnBsB,OAAO,EAAGZ,cAAgB;IAC1BF,QAAQ,EAAGA,QAAU;IACrB,gBAAeI;EAAa,GACtBJ,QAAQ,IAAI;IAAE,kBAAkB,EAAEQ;EAAkB,CAAC,GAEzDnB,UAAU,CAACI,QAAQ,CAAC,eAEtBP,KAAA,CAAAwB,aAAA;IAAME,SAAS,EAAG,GAAIjB,SAAS,GAAG,SAAS,GAAG,WAAW;EAAK,GAAGC,KAAa,CAAC,EAE7ES,QAAQ,EAERhB,UAAU,CAACK,SAAS,CAChB,CAAC,EAEPM,QAAQ,iBACNd,KAAA,CAAAwB,aAAA;IAAMZ,EAAE,EAAGU,iBAAmB;IAACI,SAAS,EAAC;EAAS,GAE9CX,eAEE,CAGV,CAAC;AAEP,CAAC,CAAC;AAEF,eAAeV,YAAY;AAE3B,SAASA,YAAY,IAAIwB,MAAM","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.interface.js","names":[],"sources":["../../../../../src/components/form/buttons/button.interface.ts"],"sourcesContent":["import { ReactElement, ReactNode, RefObject } from 'react';\nimport { IconSource } from '../../../helpers/iconHelpers';\nimport { GenericFunction } from '../../../interfaces/generic.interface';\nimport { ButtonClassCombination } from './buttonVariations';\n\nexport interface ButtonStyles {\n color?: 'primary' | 'secondary' | 'tertiary';\n variant?: 'solid' | 'outline' | 'text-only' | 'icon-only';\n size?: 'default' | 'compact';\n}\n\nexport interface ButtonProps {\n label: string | ReactNode;\n id: string;\n title?: string;\n cssClass?: string | ButtonClassCombination;\n onClickHandler?: GenericFunction;\n buttonType?: 'button' | 'submit' | 'reset';\n buttonStyle?: ButtonStyles;\n leftIcon?: IconSource;\n rightIcon?: IconSource;\n hideLabel?: boolean;\n children?: ReactNode | ReactElement;\n disabled?: boolean;\n disabledMessage?: string;\n ref?: RefObject<HTMLButtonElement>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"button.interface.js","names":[],"sources":["../../../../../src/components/form/buttons/button.interface.ts"],"sourcesContent":["import { ReactElement, ReactNode, RefObject } from 'react';\nimport { IconSource } from '../../../helpers/iconHelpers';\nimport { GenericFunction } from '../../../interfaces/generic.interface';\nimport { ButtonClassCombination } from './buttonVariations';\n\nexport interface ButtonStyles {\n color?: 'primary' | 'secondary' | 'tertiary';\n variant?: 'solid' | 'outline' | 'text-only' | 'icon-only';\n size?: 'default' | 'compact';\n}\n\nexport interface ButtonProps {\n label: string | ReactNode;\n id: string;\n title?: string;\n cssClass?: string | ButtonClassCombination;\n onClickHandler?: GenericFunction;\n buttonType?: 'button' | 'submit' | 'reset';\n buttonStyle?: ButtonStyles;\n leftIcon?: IconSource;\n rightIcon?: IconSource;\n hideLabel?: boolean;\n children?: ReactNode | ReactElement;\n disabled?: boolean;\n disabledMessage?: string;\n // Makes the button a toggle; set for buttons that switch a state on or off, e.g. a view selector.\n ariaPressed?: boolean;\n ref?: RefObject<HTMLButtonElement>;\n}\n"],"mappings":"","ignoreList":[]}
|
|
@@ -5,12 +5,14 @@ import React from 'react';
|
|
|
5
5
|
import { SimpleButton } from '../SimpleButton';
|
|
6
6
|
import { Icon } from '../../../design/icons/basicIcon/Icon';
|
|
7
7
|
import { getInitialsOrAcronym } from '../../../../helpers/stringHelpers';
|
|
8
|
+
import { toCssImageUrl } from '../../../../helpers/urlHelpers';
|
|
8
9
|
import './userPicButton.css';
|
|
9
10
|
export const UserPicButton = props => {
|
|
10
11
|
const {
|
|
11
12
|
user,
|
|
12
13
|
...buttonProps
|
|
13
14
|
} = props;
|
|
15
|
+
const backgroundImage = toCssImageUrl(user.imageUrl);
|
|
14
16
|
return /*#__PURE__*/React.createElement(SimpleButton, _extends({}, buttonProps, {
|
|
15
17
|
hideLabel: true,
|
|
16
18
|
cssClass: "button icon_only userPicButton"
|
|
@@ -18,9 +20,9 @@ export const UserPicButton = props => {
|
|
|
18
20
|
title: user.fullName || 'User profile',
|
|
19
21
|
className: "userPicFallbacks"
|
|
20
22
|
}, /*#__PURE__*/React.createElement("span", {
|
|
21
|
-
style: {
|
|
22
|
-
backgroundImage
|
|
23
|
-
},
|
|
23
|
+
style: backgroundImage ? {
|
|
24
|
+
backgroundImage
|
|
25
|
+
} : undefined,
|
|
24
26
|
className: "userPic"
|
|
25
27
|
}), user.fullName && /*#__PURE__*/React.createElement("span", {
|
|
26
28
|
className: "userInitials"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserPicButton.js","names":["_extends","React","SimpleButton","Icon","getInitialsOrAcronym","UserPicButton","props","user","buttonProps","createElement","hideLabel","cssClass","title","fullName","className","style","
|
|
1
|
+
{"version":3,"file":"UserPicButton.js","names":["_extends","React","SimpleButton","Icon","getInitialsOrAcronym","toCssImageUrl","UserPicButton","props","user","buttonProps","backgroundImage","imageUrl","createElement","hideLabel","cssClass","title","fullName","className","style","undefined","icon","customCssClass"],"sources":["../../../../../../src/components/form/buttons/userPicButton/UserPicButton.tsx"],"sourcesContent":["'use client';\n\nimport React from 'react';\nimport { ButtonProps } from '../button.interface';\nimport { SimpleButton } from '../SimpleButton';\nimport { Icon } from '../../../design/icons/basicIcon/Icon';\nimport { getInitialsOrAcronym } from '../../../../helpers/stringHelpers';\nimport { toCssImageUrl } from '../../../../helpers/urlHelpers';\n\nimport './userPicButton.scss';\n\nexport interface UserPicButtonProps extends ButtonProps {\n user: {\n imageUrl?: string;\n fullName?: string;\n }\n}\n\nexport const UserPicButton: React.FC<UserPicButtonProps> = (props) => {\n const {\n user, ...buttonProps\n } = props;\n const backgroundImage = toCssImageUrl(user.imageUrl);\n\n return (\n <SimpleButton { ...buttonProps } hideLabel cssClass=\"button icon_only userPicButton\">\n <span title={ user.fullName || 'User profile' } className=\"userPicFallbacks\">\n <span\n style={ backgroundImage ? { backgroundImage } : undefined }\n className=\"userPic\"\n />\n {\n user.fullName\n && (\n <span className=\"userInitials\">\n { getInitialsOrAcronym(user.fullName) }\n </span>\n )\n }\n <Icon icon=\"user\" customCssClass=\"userPicFallbackIcon\" />\n </span>\n </SimpleButton>\n );\n};\n"],"mappings":"AAAA,YAAY;;AAAC,OAAAA,QAAA;AAEb,OAAOC,KAAK,MAAM,OAAO;AAEzB,SAASC,YAAY,QAAQ,iBAAiB;AAC9C,SAASC,IAAI,QAAQ,sCAAsC;AAC3D,SAASC,oBAAoB,QAAQ,mCAAmC;AACxE,SAASC,aAAa,QAAQ,gCAAgC;AAE9D,OAAO,sBAAsB;AAS7B,OAAO,MAAMC,aAA2C,GAAIC,KAAK,IAAK;EACpE,MAAM;IACJC,IAAI;IAAE,GAAGC;EACX,CAAC,GAAGF,KAAK;EACT,MAAMG,eAAe,GAAGL,aAAa,CAACG,IAAI,CAACG,QAAQ,CAAC;EAEpD,oBACEV,KAAA,CAAAW,aAAA,CAACV,YAAY,EAAAF,QAAA,KAAMS,WAAW;IAAGI,SAAS;IAACC,QAAQ,EAAC;EAAgC,iBAClFb,KAAA,CAAAW,aAAA;IAAMG,KAAK,EAAGP,IAAI,CAACQ,QAAQ,IAAI,cAAgB;IAACC,SAAS,EAAC;EAAkB,gBAC1EhB,KAAA,CAAAW,aAAA;IACEM,KAAK,EAAGR,eAAe,GAAG;MAAEA;IAAgB,CAAC,GAAGS,SAAW;IAC3DF,SAAS,EAAC;EAAS,CACpB,CAAC,EAEAT,IAAI,CAACQ,QAAQ,iBAEXf,KAAA,CAAAW,aAAA;IAAMK,SAAS,EAAC;EAAc,GAC1Bb,oBAAoB,CAACI,IAAI,CAACQ,QAAQ,CAChC,CACP,eAEHf,KAAA,CAAAW,aAAA,CAACT,IAAI;IAACiB,IAAI,EAAC,MAAM;IAACC,cAAc,EAAC;EAAqB,CAAE,CACpD,CACM,CAAC;AAEnB,CAAC","ignoreList":[]}
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
4
|
import { arrowUpFromBracket } from '@x15ventures/x15-ui-library-icons/iconDefinitions';
|
|
5
5
|
import { useFormContext } from 'react-hook-form';
|
|
6
|
+
import { getFileExtension } from '../../../../../../../helpers/fileHelpers';
|
|
6
7
|
import { renderIcon } from '../../../../../../../helpers/iconHelpers';
|
|
7
8
|
import { HookFormWrapper } from '../../../../../hookFormWrapper/HookFormWrapper';
|
|
8
9
|
import { Spinner } from '../../../../../../design/spinner/Spinner';
|
|
@@ -13,6 +14,53 @@ import { generateButtonClass } from '../../../../../buttons/button.helpers';
|
|
|
13
14
|
import { FileAttachmentsList } from '../fileAttachmentList/FileAttachmentsList';
|
|
14
15
|
import { DEFAULT_UPLOAD_FILE_EXTENSIONS, DEFAULT_UPLOAD_FILE_TYPES, BLACKLISTED_FILE_TYPES } from '../../../../../../../constants';
|
|
15
16
|
import './dragAndDropFileUpload.css';
|
|
17
|
+
|
|
18
|
+
// A dot-file such as `.exe` has no extension by convention, but its name is still checked as one so
|
|
19
|
+
// it cannot slip past the blacklist.
|
|
20
|
+
const getUploadExtension = fileName => getFileExtension(fileName.startsWith('.') ? `upload${fileName}` : fileName);
|
|
21
|
+
const DEFAULT_VALID_FILES = {
|
|
22
|
+
extensions: DEFAULT_UPLOAD_FILE_EXTENSIONS,
|
|
23
|
+
fileTypes: DEFAULT_UPLOAD_FILE_TYPES,
|
|
24
|
+
maxFileCount: 5,
|
|
25
|
+
maxFileSize: 52428800 // 50 MB
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/*
|
|
29
|
+
Limits-only configurations keep the default type restrictions. Once either `extensions` or
|
|
30
|
+
`fileTypes` is supplied (even as undefined), both are taken from the configuration so the picker
|
|
31
|
+
filter and the validation cannot disagree.
|
|
32
|
+
*/
|
|
33
|
+
const resolveValidFiles = customValidFiles => {
|
|
34
|
+
if (!customValidFiles) {
|
|
35
|
+
return DEFAULT_VALID_FILES;
|
|
36
|
+
}
|
|
37
|
+
const customisesTypes = 'extensions' in customValidFiles || 'fileTypes' in customValidFiles;
|
|
38
|
+
return customisesTypes ? {
|
|
39
|
+
...DEFAULT_VALID_FILES,
|
|
40
|
+
...customValidFiles,
|
|
41
|
+
extensions: customValidFiles.extensions,
|
|
42
|
+
fileTypes: customValidFiles.fileTypes
|
|
43
|
+
} : {
|
|
44
|
+
...DEFAULT_VALID_FILES,
|
|
45
|
+
...customValidFiles
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Matches a file against `accept`-style tokens: `.ext`, `type/*` or an exact MIME type.
|
|
50
|
+
const matchesFileTypes = (file, fileTypes) => {
|
|
51
|
+
const extension = getUploadExtension(file.name);
|
|
52
|
+
const mimeType = file.type.toLowerCase();
|
|
53
|
+
return fileTypes.some(token => {
|
|
54
|
+
const normalised = token.trim().toLowerCase();
|
|
55
|
+
if (normalised.startsWith('.')) {
|
|
56
|
+
return normalised.slice(1) === extension;
|
|
57
|
+
}
|
|
58
|
+
if (normalised.endsWith('/*')) {
|
|
59
|
+
return mimeType.startsWith(normalised.slice(0, -1));
|
|
60
|
+
}
|
|
61
|
+
return normalised !== '' && normalised === mimeType;
|
|
62
|
+
});
|
|
63
|
+
};
|
|
16
64
|
export const DragAndDropFileUpload = props => /*#__PURE__*/React.createElement(HookFormWrapper, {
|
|
17
65
|
formContext: props.formContext
|
|
18
66
|
}, /*#__PURE__*/React.createElement(DragAndDropFileUploadField, props));
|
|
@@ -34,14 +82,10 @@ const DragAndDropFileUploadField = ({
|
|
|
34
82
|
labelUploadIcon = arrowUpFromBracket,
|
|
35
83
|
multiple = false,
|
|
36
84
|
restrictionsTxt = '',
|
|
37
|
-
validFiles
|
|
38
|
-
extensions: DEFAULT_UPLOAD_FILE_EXTENSIONS,
|
|
39
|
-
fileTypes: DEFAULT_UPLOAD_FILE_TYPES,
|
|
40
|
-
maxFileCount: 5,
|
|
41
|
-
maxFileSize: 52428800 // 50 MB
|
|
42
|
-
},
|
|
85
|
+
validFiles: customValidFiles,
|
|
43
86
|
onFilesChange = () => {}
|
|
44
87
|
}) => {
|
|
88
|
+
const validFiles = useMemo(() => resolveValidFiles(customValidFiles), [customValidFiles]);
|
|
45
89
|
const {
|
|
46
90
|
setValue,
|
|
47
91
|
trigger
|
|
@@ -73,15 +117,16 @@ const DragAndDropFileUploadField = ({
|
|
|
73
117
|
return () => window.removeEventListener('focus', onFocus);
|
|
74
118
|
}, [trigger, field.name]);
|
|
75
119
|
const supportedFileTypes = useMemo(() => validFiles?.fileTypes?.join(', ') || '', [validFiles?.fileTypes]);
|
|
120
|
+
const isFileAllowed = useCallback(file => {
|
|
121
|
+
const ext = getUploadExtension(file.name);
|
|
122
|
+
const isBlacklisted = BLACKLISTED_FILE_TYPES.includes(ext);
|
|
123
|
+
// Without an extension allowlist, the picker's file types are enforced so dropped files obey them too.
|
|
124
|
+
const isValidExt = validFiles.extensions ? validFiles.extensions.includes(ext) : validFiles.fileTypes?.length ? matchesFileTypes(file, validFiles.fileTypes) : true;
|
|
125
|
+
const isValidSize = validFiles.maxFileSize ? file.size <= validFiles.maxFileSize : true;
|
|
126
|
+
return !isBlacklisted && isValidExt && isValidSize;
|
|
127
|
+
}, [validFiles]);
|
|
76
128
|
const validateAndCommit = useCallback(files => {
|
|
77
|
-
|
|
78
|
-
const validated = files.filter(file => {
|
|
79
|
-
const ext = file.name.split('.').pop()?.toLowerCase() || '';
|
|
80
|
-
const isBlacklisted = BLACKLISTED_FILE_TYPES.includes(ext);
|
|
81
|
-
const isValidExt = validFiles.extensions ? validFiles.extensions.includes(ext) : true;
|
|
82
|
-
const isValidSize = validFiles.maxFileSize ? file.size <= validFiles.maxFileSize : true;
|
|
83
|
-
return !isBlacklisted && isValidExt && isValidSize;
|
|
84
|
-
});
|
|
129
|
+
const validated = files.filter(isFileAllowed);
|
|
85
130
|
const clipped = validFiles.maxFileCount ? validated.slice(0, validFiles.maxFileCount) : validated;
|
|
86
131
|
setFileList(clipped);
|
|
87
132
|
setIsTouched(true);
|
|
@@ -91,7 +136,7 @@ const DragAndDropFileUploadField = ({
|
|
|
91
136
|
shouldTouch: true
|
|
92
137
|
});
|
|
93
138
|
onFilesChange(clipped);
|
|
94
|
-
}, [field.name, onFilesChange, setValue,
|
|
139
|
+
}, [field.name, onFilesChange, setValue, isFileAllowed, validFiles]);
|
|
95
140
|
const handleFileInputChange = useCallback(event => {
|
|
96
141
|
const target = event.target;
|
|
97
142
|
const files = Array.from(target.files ?? []);
|
|
@@ -103,9 +148,10 @@ const DragAndDropFileUploadField = ({
|
|
|
103
148
|
validateAndCommit(dropped);
|
|
104
149
|
trigger(field.name);
|
|
105
150
|
}, [trigger, field.name, validateAndCommit]);
|
|
106
|
-
const handleFilesEdited = useCallback(
|
|
107
|
-
//
|
|
108
|
-
//
|
|
151
|
+
const handleFilesEdited = useCallback(editedFiles => {
|
|
152
|
+
// Edits may rename files, so they are checked again: renaming `notes.txt` to `notes.exe` must not
|
|
153
|
+
// get past the extension rules the original name passed.
|
|
154
|
+
const files = editedFiles.filter(isFileAllowed);
|
|
109
155
|
setFileList(files);
|
|
110
156
|
setValue(field.name, files.length > 0 ? files : null, {
|
|
111
157
|
shouldValidate: true,
|
|
@@ -113,7 +159,7 @@ const DragAndDropFileUploadField = ({
|
|
|
113
159
|
shouldTouch: true
|
|
114
160
|
});
|
|
115
161
|
onFilesChange(files);
|
|
116
|
-
}, [field.name, setValue, onFilesChange]);
|
|
162
|
+
}, [field.name, setValue, onFilesChange, isFileAllowed]);
|
|
117
163
|
const wrapperCssClass = `
|
|
118
164
|
formField
|
|
119
165
|
dragAndDropFileUpload
|