@griddo/ax 12.3.0 → 12.5.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/config/{jest/componentsMock.js → tests/componentsMock.cjs} +4 -1
- package/config/tests/reactEasyCropMock.js +15 -0
- package/config/tests/reactTimezoneMock.js +14 -0
- package/config/tests/setup.ts +41 -0
- package/config/webpack.config.js +5 -0
- package/package.json +15 -29
- package/public/img/icons/markdown.svg +6 -0
- package/src/__tests__/components/ActionMenu/ActionMenu.test.tsx +12 -12
- package/src/__tests__/components/Breadcrumb/Breadcrumb.test.tsx +2 -2
- package/src/__tests__/components/Browser/Browser.test.tsx +17 -25
- package/src/__tests__/components/BulkSelectionOptions/BulkSelectionOptions.test.tsx +3 -3
- package/src/__tests__/components/CategoryCell/CategoryCell.test.tsx +3 -2
- package/src/__tests__/components/ConfigPanel/ConfigPanel.test.tsx +4 -4
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/ConnectedField.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/NavConnectedField/NavConnectedField.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/Field/Field.test.tsx +3 -3
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/PageConnectedField.test.tsx +17 -14
- package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/TemplateManager.test.tsx +4 -4
- package/src/__tests__/components/ConfigPanel/Form/Form.test.tsx +49 -58
- package/src/__tests__/components/ConfigPanel/GlobalPageForm/GlobalPageForm.test.tsx +11 -11
- package/src/__tests__/components/ConfigPanel/Header/Header.test.tsx +51 -46
- package/src/__tests__/components/ConfigPanel/NavigationForm/Field/Field.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/NavigationForm/NavigationForm.test.tsx +2 -2
- package/src/__tests__/components/ConfigPanel/PreviewForm/PreviewForm.test.tsx +4 -3
- package/src/__tests__/components/ContextMenu/ContextMenu.test.tsx +24 -24
- package/src/__tests__/components/DragAndDrop/DragAndDrop.test.tsx +6 -5
- package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +7 -18
- package/src/__tests__/components/EmptyState/EmptyState.test.tsx +11 -11
- package/src/__tests__/components/ErrorCenter/ErrorCenter.test.tsx +11 -11
- package/src/__tests__/components/FieldContainer/FieldContainer.test.tsx +4 -4
- package/src/__tests__/components/Fields/AnalyticsField/AnalyticsField.test.tsx +3 -3
- package/src/__tests__/components/Fields/AnalyticsField/PageAnalytics/PageAnalytics.test.tsx +4 -4
- package/src/__tests__/components/Fields/AnalyticsField/StructuredDataAnalytics/StructuredDataAnalytics.test.tsx +3 -3
- package/src/__tests__/components/Fields/ArrayFieldGroup/ArrayFieldGroup.test.tsx +6 -5
- package/src/__tests__/components/Fields/AsyncCheckGroup/AsyncCheckGroup.test.tsx +19 -18
- package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +64 -53
- package/src/__tests__/components/Fields/Button/Button.test.tsx +4 -3
- package/src/__tests__/components/Fields/CheckField/CheckField.test.tsx +5 -5
- package/src/__tests__/components/Fields/CheckGroup/CheckGroup.test.tsx +10 -10
- package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +67 -58
- package/src/__tests__/components/Fields/ComponentArray/ComponentArray.test.tsx +3 -3
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +45 -45
- package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/PasteModuleButton/PasteModuleButton.test.tsx +7 -6
- package/src/__tests__/components/Fields/ComponentArray/SameComponentArray/SameComponentArray.test.tsx +7 -7
- package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +223 -426
- package/src/__tests__/components/Fields/ConditionalField/ConditionalField.test.tsx +1 -1
- package/src/__tests__/components/Fields/DateField/DateField.test.tsx +6 -5
- package/src/__tests__/components/Fields/FieldGroup/FieldGroup.test.tsx +2 -2
- package/src/__tests__/components/Fields/FileField/FileField.test.tsx +17 -18
- package/src/__tests__/components/Fields/HeadingField/HeadingField.test.tsx +2 -2
- package/src/__tests__/components/Fields/HiddenField/HiddenField.test.tsx +3 -3
- package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +280 -263
- package/src/__tests__/components/Fields/IntegrationsField/IntegrationsField.test.tsx +60 -57
- package/src/__tests__/components/Fields/MultiCheckSelect/MultiCheckSelect.test.tsx +1 -1
- package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx +7 -6
- package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +10 -9
- package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +16 -20
- package/src/__tests__/components/Fields/RadioField/RadioField.test.tsx +2 -2
- package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +17 -16
- package/src/__tests__/components/Fields/RichText/RichText.test.tsx +1 -1
- package/src/__tests__/components/Fields/Select/Select.test.tsx +1 -1
- package/src/__tests__/components/Fields/SliderField/SliderField.test.tsx +5 -4
- package/src/__tests__/components/Fields/SummaryButton/SummaryButton.test.tsx +2 -2
- package/src/__tests__/components/Fields/TagField/TagField.test.tsx +9 -9
- package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +17 -9
- package/src/__tests__/components/Fields/TextField/TextField.test.tsx +8 -8
- package/src/__tests__/components/Fields/TimeField/HourInput/HourInput.test.tsx +7 -6
- package/src/__tests__/components/Fields/TimeField/TimeField.test.tsx +4 -3
- package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +16 -24
- package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +12 -6
- package/src/__tests__/components/Fields/TranslateButton/TranslateButton.test.tsx +13 -13
- package/src/__tests__/components/Fields/UniqueCheck/UniqueCheck.test.tsx +1 -1
- package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +20 -19
- package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx +3 -2
- package/src/__tests__/components/Fields/VisualUniqueSelection/ScrollableSelection/ScrollableSelection.test.tsx +4 -3
- package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +30 -22
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.atoms.test.tsx +11 -11
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.config.test.tsx +103 -0
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.helpers.test.tsx +13 -14
- package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +28 -28
- package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +22 -16
- package/src/__tests__/components/FloatingMenu/FloatingMenu.test.tsx +36 -35
- package/src/__tests__/components/FloatingPanel/FloatingPanel.test.tsx +10 -10
- package/src/__tests__/components/GuardModal/GuardModal.test.tsx +1 -1
- package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/ErrorItem.test.tsx +11 -11
- package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorsBanner.test.tsx +4 -4
- package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.test.tsx +15 -14
- package/src/__tests__/components/IconAction/IconAction.test.tsx +2 -2
- package/src/__tests__/components/ImageDragAndDrop/CropStep/CropStep.test.tsx +3 -3
- package/src/__tests__/components/ImageDragAndDrop/ImageDragAndDrop.test.tsx +7 -7
- package/src/__tests__/components/KeywordsPreviewModal/KeywordItem/KeywordItem.test.tsx +5 -5
- package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +14 -13
- package/src/__tests__/components/KeywordsPreviewModal/atoms.test.tsx +13 -13
- package/src/__tests__/components/LanguageMenu/LanguageMenu.test.tsx +6 -6
- package/src/__tests__/components/Lists/Lists.test.tsx +1 -1
- package/src/__tests__/components/Loader/Loader.test.tsx +1 -1
- package/src/__tests__/components/Login/Login.test.tsx +32 -32
- package/src/__tests__/components/Login/RecoveryModal/RecoveryModal.test.tsx +10 -9
- package/src/__tests__/components/MainWrapper/AppBar/AppBar.test.tsx +21 -21
- package/src/__tests__/components/MenuItem/MenuItem.test.tsx +5 -5
- package/src/__tests__/components/Modal/Modal.test.tsx +20 -20
- package/src/__tests__/components/Nav/Nav.test.tsx +2 -2
- package/src/__tests__/components/Notification/Notification.test.tsx +2 -2
- package/src/__tests__/components/Pagination/Pagination.test.tsx +13 -14
- package/src/__tests__/components/ProfileImage/ProfileImage.test.tsx +6 -7
- package/src/__tests__/components/ReorderArrows/ReorderArrows.test.tsx +4 -3
- package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +18 -17
- package/src/__tests__/components/RestrictionsModal/CurrentAccessList/CurrentAccessList.test.tsx +7 -6
- package/src/__tests__/components/RestrictionsModal/OptionsStep/OptionsStep.test.tsx +12 -11
- package/src/__tests__/components/RestrictionsModal/RestrictionsModal.test.tsx +11 -10
- package/src/__tests__/components/RestrictionsModal/RolesList/RolesList.test.tsx +8 -8
- package/src/__tests__/components/RestrictionsModal/UsersList/UsersList.test.tsx +16 -15
- package/src/__tests__/components/SearchField/SearchField.test.tsx +13 -13
- package/src/__tests__/components/SideModal/SideModal.test.tsx +175 -127
- package/src/__tests__/components/SubNav/SubNav.test.tsx +1 -1
- package/src/__tests__/components/TableFilters/CategoryFilter/CategoryFilter.test.tsx +9 -8
- package/src/__tests__/components/TableFilters/CustomizeFilters/CustomizeFilters.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/DateFilter/DateFilter.test.tsx +8 -8
- package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +26 -39
- package/src/__tests__/components/TableFilters/NameFilter/NameFilter.test.tsx +10 -10
- package/src/__tests__/components/TableFilters/RoleFilter/RoleFilter.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/SiteFilter/SiteFilter.test.tsx +10 -9
- package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +70 -45
- package/src/__tests__/components/TableFilters/TranslationsFilter/TranslationsFilter.test.tsx +8 -8
- package/src/__tests__/components/TableFilters/TypeFilter/TypeFilter.test.tsx +5 -5
- package/src/__tests__/components/TableFilters/UsersFilter/UsersFilter.test.tsx +8 -8
- package/src/__tests__/components/TableList/TableList.test.tsx +4 -4
- package/src/__tests__/components/Tabs/Tabs.test.tsx +73 -70
- package/src/__tests__/components/Tag/Tag.test.tsx +3 -3
- package/src/__tests__/components/Toast/Toast.test.tsx +24 -26
- package/src/__tests__/hooks/modals.test.tsx +4 -4
- package/src/__tests__/hooks/users.test.tsx +6 -5
- package/src/__tests__/modules/FileDrive/MarkdownFormat.test.tsx +58 -0
- package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +56 -39
- package/src/__tests__/modules/FramePreview/HeadingsOverlay/HeadingsOverlay.test.tsx +11 -11
- package/src/__tests__/modules/Settings/Integrations/Integrations.test.tsx +2 -2
- package/src/__tests__/modules/Settings/Social/Social.test.tsx +4 -3
- package/src/__tests__/modules/Sites/Sites.test.tsx +5 -4
- package/src/__tests__/modules/Sites/SitesList/ListView/BulkHeader/BulkHeader.test.tsx +26 -21
- package/src/__tests__/modules/Sites/SitesList/SitesList.test.tsx +19 -9
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/DataStep/DataStep.test.tsx +6 -6
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/FinalStep/FinalStep.test.tsx +4 -4
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/CropView/CropView.test.tsx +3 -3
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/ImageStep.test.tsx +9 -5
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/UploadView/UploadView.test.tsx +8 -6
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/TimezoneStep/TimezoneStep.test.tsx +7 -7
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeModal.test.tsx +1 -1
- package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeStep/WelcomeStep.test.tsx +3 -3
- package/src/__tests__/modules/Users/Roles/BulkHeader/BulkHeader.test.tsx +72 -67
- package/src/__tests__/modules/Users/Roles/Roles.test.tsx +14 -10
- package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RoleItem/RoleItem.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RolesModal.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/SiteItem/SiteItem.test.tsx +3 -3
- package/src/__tests__/modules/Users/UserCreate/UserCreate.test.tsx +6 -5
- package/src/__tests__/modules/Users/UserList/UserItem/UserItem.test.tsx +9 -9
- package/src/__tests__/modules/Users/UserList/UserList.test.tsx +4 -4
- package/src/components/Fields/Wysiwyg/config.tsx +68 -17
- package/src/components/Fields/Wysiwyg/helpers.tsx +2 -0
- package/src/components/Fields/Wysiwyg/index.tsx +41 -10
- package/src/components/Flag/components/index.ts +30 -0
- package/src/components/Flag/index.tsx +3 -5
- package/src/components/Icon/components/index.ts +229 -0
- package/src/components/Icon/index.tsx +3 -7
- package/src/components/ResizePanel/index.tsx +7 -2
- package/src/constants/index.ts +1 -1
- package/src/helpers/files.tsx +2 -0
- package/src/modules/FileDrive/FileFilters/Type/index.tsx +1 -0
- package/tsconfig.json +1 -1
- package/config/jest/cssTransform.js +0 -14
- package/config/jest/fileMock.js +0 -1
- package/config/jest/fileTransform.js +0 -40
- package/config/jest/reactEasyCropMock.js +0 -15
- package/config/jest/reactTimezoneMock.js +0 -13
- package/config/jest/setup.js +0 -31
- package/config/jest/styleMock.js +0 -1
- /package/config/{jest/test-utils.js → tests/test-utils.jsx} +0 -0
- /package/src/components/Flag/components/{Ca_ES.js → Ca_ES.jsx} +0 -0
- /package/src/components/Flag/components/{De_DE.js → De_DE.jsx} +0 -0
- /package/src/components/Flag/components/{En_GB.js → En_GB.jsx} +0 -0
- /package/src/components/Flag/components/{Es_ES.js → Es_ES.jsx} +0 -0
- /package/src/components/Flag/components/{Eu_ES.js → Eu_ES.jsx} +0 -0
- /package/src/components/Flag/components/{Fr_FR.js → Fr_FR.jsx} +0 -0
- /package/src/components/Flag/components/{It_IT.js → It_IT.jsx} +0 -0
- /package/src/components/Flag/components/{Pt_PT.js → Pt_PT.jsx} +0 -0
- /package/src/components/Icon/components/{Active.js → Active.jsx} +0 -0
- /package/src/components/Icon/components/{Add.js → Add.jsx} +0 -0
- /package/src/components/Icon/components/{AddCircle.js → AddCircle.jsx} +0 -0
- /package/src/components/Icon/components/{Alert.js → Alert.jsx} +0 -0
- /package/src/components/Icon/components/{AlignLeft.js → AlignLeft.jsx} +0 -0
- /package/src/components/Icon/components/{Back.js → Back.jsx} +0 -0
- /package/src/components/Icon/components/{BulletList.js → BulletList.jsx} +0 -0
- /package/src/components/Icon/components/{Button.js → Button.jsx} +0 -0
- /package/src/components/Icon/components/{Calendar.js → Calendar.jsx} +0 -0
- /package/src/components/Icon/components/{CancelEvent.js → CancelEvent.jsx} +0 -0
- /package/src/components/Icon/components/{Category.js → Category.jsx} +0 -0
- /package/src/components/Icon/components/{Change.js → Change.jsx} +0 -0
- /package/src/components/Icon/components/{Close.js → Close.jsx} +0 -0
- /package/src/components/Icon/components/{ClosePanel.js → ClosePanel.jsx} +0 -0
- /package/src/components/Icon/components/{CodeBody.js → CodeBody.jsx} +0 -0
- /package/src/components/Icon/components/{CodeHead.js → CodeHead.jsx} +0 -0
- /package/src/components/Icon/components/{CodeHeadBody.js → CodeHeadBody.jsx} +0 -0
- /package/src/components/Icon/components/{Collapsed.js → Collapsed.jsx} +0 -0
- /package/src/components/Icon/components/{ColorPicker.js → ColorPicker.jsx} +0 -0
- /package/src/components/Icon/components/{Compose.js → Compose.jsx} +0 -0
- /package/src/components/Icon/components/{Copy.js → Copy.jsx} +0 -0
- /package/src/components/Icon/components/{Copy2.js → Copy2.jsx} +0 -0
- /package/src/components/Icon/components/{Data.js → Data.jsx} +0 -0
- /package/src/components/Icon/components/{DataAdd.js → DataAdd.jsx} +0 -0
- /package/src/components/Icon/components/{Deactivate.js → Deactivate.jsx} +0 -0
- /package/src/components/Icon/components/{Delete.js → Delete.jsx} +0 -0
- /package/src/components/Icon/components/{Desktop.js → Desktop.jsx} +0 -0
- /package/src/components/Icon/components/{Disabled.js → Disabled.jsx} +0 -0
- /package/src/components/Icon/components/{Done.js → Done.jsx} +0 -0
- /package/src/components/Icon/components/{DownArrow.js → DownArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Download.js → Download.jsx} +0 -0
- /package/src/components/Icon/components/{Drag.js → Drag.jsx} +0 -0
- /package/src/components/Icon/components/{Duplicate.js → Duplicate.jsx} +0 -0
- /package/src/components/Icon/components/{Edit.js → Edit.jsx} +0 -0
- /package/src/components/Icon/components/{Empty.js → Empty.jsx} +0 -0
- /package/src/components/Icon/components/{EmptyCheck.js → EmptyCheck.jsx} +0 -0
- /package/src/components/Icon/components/{Extend.js → Extend.jsx} +0 -0
- /package/src/components/Icon/components/{File.js → File.jsx} +0 -0
- /package/src/components/Icon/components/{Filter.js → Filter.jsx} +0 -0
- /package/src/components/Icon/components/{Form.js → Form.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowDown.js → FullArrowDown.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowLeft.js → FullArrowLeft.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowRight.js → FullArrowRight.jsx} +0 -0
- /package/src/components/Icon/components/{FullArrowUp.js → FullArrowUp.jsx} +0 -0
- /package/src/components/Icon/components/{Grid.js → Grid.jsx} +0 -0
- /package/src/components/Icon/components/{Grid2.js → Grid2.jsx} +0 -0
- /package/src/components/Icon/components/{GriddoLogo.js → GriddoLogo.jsx} +0 -0
- /package/src/components/Icon/components/{HeroCard.js → HeroCard.jsx} +0 -0
- /package/src/components/Icon/components/{Hide.js → Hide.jsx} +0 -0
- /package/src/components/Icon/components/{History.js → History.jsx} +0 -0
- /package/src/components/Icon/components/{Home.js → Home.jsx} +0 -0
- /package/src/components/Icon/components/{Ia.js → Ia.jsx} +0 -0
- /package/src/components/Icon/components/{Image.js → Image.jsx} +0 -0
- /package/src/components/Icon/components/{Info.js → Info.jsx} +0 -0
- /package/src/components/Icon/components/{Laptop.js → Laptop.jsx} +0 -0
- /package/src/components/Icon/components/{LeftArrow.js → LeftArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Link.js → Link.jsx} +0 -0
- /package/src/components/Icon/components/{Lock.js → Lock.jsx} +0 -0
- /package/src/components/Icon/components/{Log.js → Log.jsx} +0 -0
- /package/src/components/Icon/components/{Map.js → Map.jsx} +0 -0
- /package/src/components/Icon/components/{Menu.js → Menu.jsx} +0 -0
- /package/src/components/Icon/components/{Microsoft.js → Microsoft.jsx} +0 -0
- /package/src/components/Icon/components/{Modified.js → Modified.jsx} +0 -0
- /package/src/components/Icon/components/{Modules.js → Modules.jsx} +0 -0
- /package/src/components/Icon/components/{More.js → More.jsx} +0 -0
- /package/src/components/Icon/components/{NewFolder.js → NewFolder.jsx} +0 -0
- /package/src/components/Icon/components/{Offline.js → Offline.jsx} +0 -0
- /package/src/components/Icon/components/{OfflinePending.js → OfflinePending.jsx} +0 -0
- /package/src/components/Icon/components/{OpenOutside.js → OpenOutside.jsx} +0 -0
- /package/src/components/Icon/components/{OpenPanel.js → OpenPanel.jsx} +0 -0
- /package/src/components/Icon/components/{OutOfSection.js → OutOfSection.jsx} +0 -0
- /package/src/components/Icon/components/{Page.js → Page.jsx} +0 -0
- /package/src/components/Icon/components/{Party.js → Party.jsx} +0 -0
- /package/src/components/Icon/components/{Paste.js → Paste.jsx} +0 -0
- /package/src/components/Icon/components/{Phone.js → Phone.jsx} +0 -0
- /package/src/components/Icon/components/{PhotoLibrary.js → PhotoLibrary.jsx} +0 -0
- /package/src/components/Icon/components/{Power.js → Power.jsx} +0 -0
- /package/src/components/Icon/components/{Preview.js → Preview.jsx} +0 -0
- /package/src/components/Icon/components/{Project.js → Project.jsx} +0 -0
- /package/src/components/Icon/components/{QrCode.js → QrCode.jsx} +0 -0
- /package/src/components/Icon/components/{Question.js → Question.jsx} +0 -0
- /package/src/components/Icon/components/{Refresh.js → Refresh.jsx} +0 -0
- /package/src/components/Icon/components/{Republish.js → Republish.jsx} +0 -0
- /package/src/components/Icon/components/{RightArrow.js → RightArrow.jsx} +0 -0
- /package/src/components/Icon/components/{Scheduled.js → Scheduled.jsx} +0 -0
- /package/src/components/Icon/components/{Search.js → Search.jsx} +0 -0
- /package/src/components/Icon/components/{SendEmail.js → SendEmail.jsx} +0 -0
- /package/src/components/Icon/components/{Settings.js → Settings.jsx} +0 -0
- /package/src/components/Icon/components/{Share.js → Share.jsx} +0 -0
- /package/src/components/Icon/components/{Subsection.js → Subsection.jsx} +0 -0
- /package/src/components/Icon/components/{Success.js → Success.jsx} +0 -0
- /package/src/components/Icon/components/{SuccessSolid.js → SuccessSolid.jsx} +0 -0
- /package/src/components/Icon/components/{Sync.js → Sync.jsx} +0 -0
- /package/src/components/Icon/components/{Tablet.js → Tablet.jsx} +0 -0
- /package/src/components/Icon/components/{Translate.js → Translate.jsx} +0 -0
- /package/src/components/Icon/components/{Unlink.js → Unlink.jsx} +0 -0
- /package/src/components/Icon/components/{UpArrow.js → UpArrow.jsx} +0 -0
- /package/src/components/Icon/components/{UploadFile.js → UploadFile.jsx} +0 -0
- /package/src/components/Icon/components/{UploadPending.js → UploadPending.jsx} +0 -0
- /package/src/components/Icon/components/{UrlLink.js → UrlLink.jsx} +0 -0
- /package/src/components/Icon/components/{User.js → User.jsx} +0 -0
- /package/src/components/Icon/components/{Users.js → Users.jsx} +0 -0
- /package/src/components/Icon/components/{Video.js → Video.jsx} +0 -0
- /package/src/components/Icon/components/{View.js → View.jsx} +0 -0
- /package/src/components/Icon/components/{Warning.js → Warning.jsx} +0 -0
- /package/src/components/Icon/components/{Web.js → Web.jsx} +0 -0
- /package/src/components/Icon/components/{Working.js → Working.jsx} +0 -0
- /package/src/components/Loader/components/{Circle.js → Circle.jsx} +0 -0
- /package/src/components/Loader/components/{Dots.js → Dots.jsx} +0 -0
- /package/src/components/Loader/components/{SmallCircle.js → SmallCircle.jsx} +0 -0
|
@@ -19,6 +19,18 @@ const getTableCellStyles = () => {
|
|
|
19
19
|
const config = getRichTextConfigLazy();
|
|
20
20
|
return config?.tableCellStyles ? parseClassNames(config.tableCellStyles) : undefined;
|
|
21
21
|
};
|
|
22
|
+
const getImageStyles = () => {
|
|
23
|
+
const config = getRichTextConfigLazy();
|
|
24
|
+
return config?.imageStyles ? parseClassNames(config.imageStyles) : undefined;
|
|
25
|
+
};
|
|
26
|
+
// Opt-in: instances not asking for it keep their images unresizable.
|
|
27
|
+
const getImageResize = () => getRichTextConfigLazy()?.imageResize === true;
|
|
28
|
+
// When resizing is allowed the size is stored as a rounded percentage, so it
|
|
29
|
+
// still adapts to its container instead of being pinned to a pixel width.
|
|
30
|
+
const getImageResizeConfig = () => {
|
|
31
|
+
const imageResize = getImageResize();
|
|
32
|
+
return { imageResize, imageResizeWithPercent: imageResize, imageRoundPercent: imageResize };
|
|
33
|
+
};
|
|
22
34
|
|
|
23
35
|
const getMiscButtons = () => {
|
|
24
36
|
const paragraphStyles = getParagraphStyles();
|
|
@@ -49,7 +61,14 @@ const getButtonsFull = () => ({
|
|
|
49
61
|
buttonsVisible: 6,
|
|
50
62
|
},
|
|
51
63
|
moreText2: {
|
|
52
|
-
buttons: [
|
|
64
|
+
buttons: [
|
|
65
|
+
"insertLinkGriddo",
|
|
66
|
+
"insertImageGriddo",
|
|
67
|
+
"insertFileGriddo",
|
|
68
|
+
"insertVideo",
|
|
69
|
+
"clearFormatting",
|
|
70
|
+
"fullscreen",
|
|
71
|
+
],
|
|
53
72
|
buttonsVisible: 6,
|
|
54
73
|
},
|
|
55
74
|
moreMisc: {
|
|
@@ -76,6 +95,25 @@ const getButtons = () => {
|
|
|
76
95
|
|
|
77
96
|
const getInlineToolbar = () => ["langDropdown", "undo", "redo"];
|
|
78
97
|
|
|
98
|
+
const getImageEditButtons = () => {
|
|
99
|
+
const imageStyles = getImageStyles();
|
|
100
|
+
return [
|
|
101
|
+
"imageReplaceGriddo",
|
|
102
|
+
"imageAlign",
|
|
103
|
+
"imageCaption",
|
|
104
|
+
"imageRemove",
|
|
105
|
+
"|",
|
|
106
|
+
"imageLinkGriddo",
|
|
107
|
+
"linkOpen",
|
|
108
|
+
"linkRemove",
|
|
109
|
+
"-",
|
|
110
|
+
"imageDisplay",
|
|
111
|
+
imageStyles ? "imageStyle" : undefined,
|
|
112
|
+
"imageAlt",
|
|
113
|
+
getImageResize() ? "imageSize" : undefined,
|
|
114
|
+
];
|
|
115
|
+
};
|
|
116
|
+
|
|
79
117
|
const getWysiwygConfig = () => ({
|
|
80
118
|
key: process.env.GRIDDO_FROALA_KEY || process.env.REACT_APP_FROALA_KEY,
|
|
81
119
|
// pastePlain: false,
|
|
@@ -89,20 +127,10 @@ const getWysiwygConfig = () => ({
|
|
|
89
127
|
H3: "Heading 3",
|
|
90
128
|
H4: "Heading 4",
|
|
91
129
|
},
|
|
92
|
-
imageEditButtons:
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"imageRemove",
|
|
97
|
-
"|",
|
|
98
|
-
"imageLinkGriddo",
|
|
99
|
-
"linkOpen",
|
|
100
|
-
"linkRemove",
|
|
101
|
-
"-",
|
|
102
|
-
"imageDisplay",
|
|
103
|
-
"imageAlt",
|
|
104
|
-
],
|
|
105
|
-
imageResize: false,
|
|
130
|
+
imageEditButtons: getImageEditButtons(),
|
|
131
|
+
...getImageResizeConfig(),
|
|
132
|
+
imageDefaultWidth: null,
|
|
133
|
+
imageDefaultHeight: null,
|
|
106
134
|
linkEditButtons: ["linkOpen", "editLinkGriddo", "linkRemove"],
|
|
107
135
|
videoInsertButtons: ["videoBack", "|", "videoByURL", "videoEmbed"],
|
|
108
136
|
imageAllowedTypes: ["jpeg", "jpg", "png", "svg"],
|
|
@@ -112,6 +140,7 @@ const getWysiwygConfig = () => ({
|
|
|
112
140
|
paragraphStyles: getParagraphStyles(),
|
|
113
141
|
tableStyles: getTableStyles(),
|
|
114
142
|
tableCellStyles: getTableCellStyles(),
|
|
143
|
+
imageStyles: getImageStyles(),
|
|
115
144
|
imageUploadRemoteUrls: false,
|
|
116
145
|
});
|
|
117
146
|
|
|
@@ -161,6 +190,7 @@ FroalaEditor.RegisterCommand("insertImageGriddo", {
|
|
|
161
190
|
undo: false,
|
|
162
191
|
focus: false,
|
|
163
192
|
callback: function (this: any) {
|
|
193
|
+
this.selection.save();
|
|
164
194
|
const el = this.$el?.get?.(0) || this.el;
|
|
165
195
|
el?.dispatchEvent(
|
|
166
196
|
new CustomEvent("griddo:openGallery", {
|
|
@@ -177,6 +207,7 @@ FroalaEditor.RegisterCommand("insertFileGriddo", {
|
|
|
177
207
|
undo: false,
|
|
178
208
|
focus: false,
|
|
179
209
|
callback: function (this: any) {
|
|
210
|
+
this.selection.save();
|
|
180
211
|
const el = this.$el?.get?.(0) || this.el;
|
|
181
212
|
el?.dispatchEvent(
|
|
182
213
|
new CustomEvent("griddo:openFileGallery", {
|
|
@@ -296,7 +327,17 @@ FroalaEditor.RegisterCommand("imageLinkGriddo", {
|
|
|
296
327
|
editorEl.dispatchEvent(
|
|
297
328
|
new CustomEvent("griddo:openLinkPopover", {
|
|
298
329
|
bubbles: true,
|
|
299
|
-
detail: {
|
|
330
|
+
detail: {
|
|
331
|
+
x,
|
|
332
|
+
y,
|
|
333
|
+
selectedText: "",
|
|
334
|
+
linkUrl,
|
|
335
|
+
isNewTab,
|
|
336
|
+
isNoFollow,
|
|
337
|
+
isEditing: true,
|
|
338
|
+
linkPageId,
|
|
339
|
+
isImageLink: true,
|
|
340
|
+
},
|
|
300
341
|
}),
|
|
301
342
|
);
|
|
302
343
|
} else {
|
|
@@ -304,7 +345,17 @@ FroalaEditor.RegisterCommand("imageLinkGriddo", {
|
|
|
304
345
|
editorEl.dispatchEvent(
|
|
305
346
|
new CustomEvent("griddo:openLinkPopover", {
|
|
306
347
|
bubbles: true,
|
|
307
|
-
detail: {
|
|
348
|
+
detail: {
|
|
349
|
+
x,
|
|
350
|
+
y,
|
|
351
|
+
selectedText: "",
|
|
352
|
+
linkUrl: "",
|
|
353
|
+
isNewTab: false,
|
|
354
|
+
isNoFollow: false,
|
|
355
|
+
isEditing: false,
|
|
356
|
+
linkPageId: null,
|
|
357
|
+
isImageLink: true,
|
|
358
|
+
},
|
|
308
359
|
}),
|
|
309
360
|
);
|
|
310
361
|
}
|
|
@@ -17,6 +17,8 @@ interface IRichTextConfig {
|
|
|
17
17
|
paragraphStyles?: { label: string; className: string }[];
|
|
18
18
|
tableStyles?: { label: string; className: string }[];
|
|
19
19
|
tableCellStyles?: { label: string; className: string }[];
|
|
20
|
+
imageStyles?: { label: string; className: string }[];
|
|
21
|
+
imageResize?: boolean;
|
|
20
22
|
editorLangs?: { name: string; iso: string }[];
|
|
21
23
|
}
|
|
22
24
|
|
|
@@ -84,10 +84,16 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
84
84
|
|
|
85
85
|
const handleFileSelected = (file: IFile) => {
|
|
86
86
|
if (file?.url && editorRef.current) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
87
|
+
// Wait for Froala to stabilize after re-render before restoring selection
|
|
88
|
+
setTimeout(() => {
|
|
89
|
+
if (!editorRef.current) return;
|
|
90
|
+
editorRef.current.selection.restore();
|
|
91
|
+
// Use html.insert instead of link.insert to avoid selection issues
|
|
92
|
+
const linkHtml = `<a href="${file.url}" target="_blank">${file.fileName}</a>`;
|
|
93
|
+
editorRef.current.html.insert(linkHtml);
|
|
94
|
+
const updatedHtml = editorRef.current.html.get();
|
|
95
|
+
handleChange(updatedHtml);
|
|
96
|
+
}, 100);
|
|
91
97
|
}
|
|
92
98
|
};
|
|
93
99
|
|
|
@@ -99,14 +105,23 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
99
105
|
if (img.alt) {
|
|
100
106
|
imgElement.alt = img.alt;
|
|
101
107
|
}
|
|
108
|
+
replaceImgRef.current = null;
|
|
109
|
+
const updatedHtml = editorRef.current.html.get();
|
|
110
|
+
handleChange(updatedHtml);
|
|
102
111
|
} else {
|
|
103
|
-
|
|
104
|
-
|
|
112
|
+
// Wait for Froala to stabilize after re-render before restoring selection
|
|
113
|
+
setTimeout(() => {
|
|
114
|
+
if (!editorRef.current) return;
|
|
115
|
+
editorRef.current.selection.restore();
|
|
116
|
+
// Use html.insert instead of image.insert to avoid selection issues
|
|
117
|
+
const imgHtml = `<img src="${img.url}" alt="${img.alt || ""}" />`;
|
|
118
|
+
editorRef.current.html.insert(imgHtml);
|
|
119
|
+
const updatedHtml = editorRef.current.html.get();
|
|
120
|
+
handleChange(updatedHtml);
|
|
121
|
+
}, 100);
|
|
105
122
|
}
|
|
106
123
|
|
|
107
124
|
replaceImgRef.current = null;
|
|
108
|
-
const updatedHtml = editorRef.current.html.get();
|
|
109
|
-
handleChange(updatedHtml);
|
|
110
125
|
}
|
|
111
126
|
};
|
|
112
127
|
|
|
@@ -219,12 +234,10 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
219
234
|
editorEl.addEventListener("griddo:openGallery", (e: Event) => {
|
|
220
235
|
const detail = (e as CustomEvent).detail;
|
|
221
236
|
replaceImgRef.current = detail?.mode === "replace" ? detail.$img : null;
|
|
222
|
-
editorRef.current?.selection.save();
|
|
223
237
|
toggleModal("image");
|
|
224
238
|
});
|
|
225
239
|
|
|
226
240
|
editorEl.addEventListener("griddo:openFileGallery", () => {
|
|
227
|
-
editorRef.current?.selection.save();
|
|
228
241
|
toggleModal("file");
|
|
229
242
|
});
|
|
230
243
|
|
|
@@ -278,6 +291,24 @@ const Wysiwyg = (props: IWysiwygProps) => {
|
|
|
278
291
|
const stripedHtml = decodeEntities(html);
|
|
279
292
|
handleValidation?.(stripedHtml);
|
|
280
293
|
},
|
|
294
|
+
contentChanged: function (this: any) {
|
|
295
|
+
const editorEl = this.$el?.get?.(0) || this.el;
|
|
296
|
+
const images = editorEl?.querySelectorAll?.("img");
|
|
297
|
+
if (images) {
|
|
298
|
+
images.forEach((img: HTMLImageElement) => {
|
|
299
|
+
const hasFrDib = img.classList.contains("fr-dib");
|
|
300
|
+
const hasFrDii = img.classList.contains("fr-dii");
|
|
301
|
+
|
|
302
|
+
img.classList.remove("img-inline", "img-block");
|
|
303
|
+
|
|
304
|
+
if (hasFrDib) {
|
|
305
|
+
img.classList.add("img-block");
|
|
306
|
+
} else if (hasFrDii) {
|
|
307
|
+
img.classList.add("img-inline");
|
|
308
|
+
}
|
|
309
|
+
});
|
|
310
|
+
}
|
|
311
|
+
},
|
|
281
312
|
},
|
|
282
313
|
}),
|
|
283
314
|
[placeholder, inline, full, disabled, token, toggleModal, handleValidation, imageSite, uploadImage],
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
import Ca_ES from "./Ca_ES";
|
|
4
|
+
import De_DE from "./De_DE";
|
|
5
|
+
import En_GB from "./En_GB";
|
|
6
|
+
import Es_ES from "./Es_ES";
|
|
7
|
+
import Eu_ES from "./Eu_ES";
|
|
8
|
+
import Fr_FR from "./Fr_FR";
|
|
9
|
+
import It_IT from "./It_IT";
|
|
10
|
+
import Pt_PT from "./Pt_PT";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Static registry of every flag. Replaces the dynamic `require()` this
|
|
14
|
+
* component used to do: a template-literal require only resolves through
|
|
15
|
+
* webpack's CommonJS context modules, so it breaks under ESM.
|
|
16
|
+
*
|
|
17
|
+
* When adding a flag, import it above and register it here.
|
|
18
|
+
*/
|
|
19
|
+
const flags: Record<string, ComponentType<any>> = {
|
|
20
|
+
Ca_ES,
|
|
21
|
+
De_DE,
|
|
22
|
+
En_GB,
|
|
23
|
+
Es_ES,
|
|
24
|
+
Eu_ES,
|
|
25
|
+
Fr_FR,
|
|
26
|
+
It_IT,
|
|
27
|
+
Pt_PT,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default flags;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
+
import flags from "./components";
|
|
4
|
+
|
|
3
5
|
const getImage = (name: string) => {
|
|
4
6
|
const simpleIcons: any = {
|
|
5
7
|
es: "Es_ES",
|
|
@@ -11,11 +13,7 @@ const getImage = (name: string) => {
|
|
|
11
13
|
};
|
|
12
14
|
const filename = simpleIcons[name?.toLowerCase()] || name;
|
|
13
15
|
|
|
14
|
-
|
|
15
|
-
return require(`./components/${filename}`).default;
|
|
16
|
-
} catch (err) {
|
|
17
|
-
return null;
|
|
18
|
-
}
|
|
16
|
+
return flags[filename] ?? null;
|
|
19
17
|
};
|
|
20
18
|
const Flag = (props: IProps) => {
|
|
21
19
|
const name = props.name.charAt(0).toUpperCase() + props.name.slice(1);
|
|
@@ -0,0 +1,229 @@
|
|
|
1
|
+
import type { ComponentType } from "react";
|
|
2
|
+
|
|
3
|
+
import Active from "./Active";
|
|
4
|
+
import Add from "./Add";
|
|
5
|
+
import AddCircle from "./AddCircle";
|
|
6
|
+
import Alert from "./Alert";
|
|
7
|
+
import AlignLeft from "./AlignLeft";
|
|
8
|
+
import Back from "./Back";
|
|
9
|
+
import BulletList from "./BulletList";
|
|
10
|
+
import Button from "./Button";
|
|
11
|
+
import Calendar from "./Calendar";
|
|
12
|
+
import CancelEvent from "./CancelEvent";
|
|
13
|
+
import Category from "./Category";
|
|
14
|
+
import Change from "./Change";
|
|
15
|
+
import Close from "./Close";
|
|
16
|
+
import ClosePanel from "./ClosePanel";
|
|
17
|
+
import CodeBody from "./CodeBody";
|
|
18
|
+
import CodeHead from "./CodeHead";
|
|
19
|
+
import CodeHeadBody from "./CodeHeadBody";
|
|
20
|
+
import Collapsed from "./Collapsed";
|
|
21
|
+
import ColorPicker from "./ColorPicker";
|
|
22
|
+
import Compose from "./Compose";
|
|
23
|
+
import Copy from "./Copy";
|
|
24
|
+
import Copy2 from "./Copy2";
|
|
25
|
+
import Data from "./Data";
|
|
26
|
+
import DataAdd from "./DataAdd";
|
|
27
|
+
import Deactivate from "./Deactivate";
|
|
28
|
+
import Delete from "./Delete";
|
|
29
|
+
import Desktop from "./Desktop";
|
|
30
|
+
import Disabled from "./Disabled";
|
|
31
|
+
import Done from "./Done";
|
|
32
|
+
import DownArrow from "./DownArrow";
|
|
33
|
+
import Download from "./Download";
|
|
34
|
+
import Drag from "./Drag";
|
|
35
|
+
import Duplicate from "./Duplicate";
|
|
36
|
+
import Edit from "./Edit";
|
|
37
|
+
import Empty from "./Empty";
|
|
38
|
+
import EmptyCheck from "./EmptyCheck";
|
|
39
|
+
import Extend from "./Extend";
|
|
40
|
+
import File from "./File";
|
|
41
|
+
import Filter from "./Filter";
|
|
42
|
+
import Form from "./Form";
|
|
43
|
+
import FullArrowDown from "./FullArrowDown";
|
|
44
|
+
import FullArrowLeft from "./FullArrowLeft";
|
|
45
|
+
import FullArrowRight from "./FullArrowRight";
|
|
46
|
+
import FullArrowUp from "./FullArrowUp";
|
|
47
|
+
import Grid from "./Grid";
|
|
48
|
+
import Grid2 from "./Grid2";
|
|
49
|
+
import GriddoLogo from "./GriddoLogo";
|
|
50
|
+
import HeroCard from "./HeroCard";
|
|
51
|
+
import Hide from "./Hide";
|
|
52
|
+
import History from "./History";
|
|
53
|
+
import Home from "./Home";
|
|
54
|
+
import Ia from "./Ia";
|
|
55
|
+
import Image from "./Image";
|
|
56
|
+
import Info from "./Info";
|
|
57
|
+
import Laptop from "./Laptop";
|
|
58
|
+
import LeftArrow from "./LeftArrow";
|
|
59
|
+
import Link from "./Link";
|
|
60
|
+
import Lock from "./Lock";
|
|
61
|
+
import Log from "./Log";
|
|
62
|
+
// Aliased: a binding named `Map` would shadow the global.
|
|
63
|
+
import MapIcon from "./Map";
|
|
64
|
+
import Menu from "./Menu";
|
|
65
|
+
import Microsoft from "./Microsoft";
|
|
66
|
+
import Modified from "./Modified";
|
|
67
|
+
import Modules from "./Modules";
|
|
68
|
+
import More from "./More";
|
|
69
|
+
import NewFolder from "./NewFolder";
|
|
70
|
+
import Offline from "./Offline";
|
|
71
|
+
import OfflinePending from "./OfflinePending";
|
|
72
|
+
import OpenOutside from "./OpenOutside";
|
|
73
|
+
import OpenPanel from "./OpenPanel";
|
|
74
|
+
import OutOfSection from "./OutOfSection";
|
|
75
|
+
import Page from "./Page";
|
|
76
|
+
import Party from "./Party";
|
|
77
|
+
import Paste from "./Paste";
|
|
78
|
+
import Phone from "./Phone";
|
|
79
|
+
import PhotoLibrary from "./PhotoLibrary";
|
|
80
|
+
import Power from "./Power";
|
|
81
|
+
import Preview from "./Preview";
|
|
82
|
+
import Project from "./Project";
|
|
83
|
+
import QrCode from "./QrCode";
|
|
84
|
+
import Question from "./Question";
|
|
85
|
+
import Refresh from "./Refresh";
|
|
86
|
+
import Republish from "./Republish";
|
|
87
|
+
import RightArrow from "./RightArrow";
|
|
88
|
+
import Scheduled from "./Scheduled";
|
|
89
|
+
import Search from "./Search";
|
|
90
|
+
import SendEmail from "./SendEmail";
|
|
91
|
+
import Settings from "./Settings";
|
|
92
|
+
import Share from "./Share";
|
|
93
|
+
import Subsection from "./Subsection";
|
|
94
|
+
import Success from "./Success";
|
|
95
|
+
import SuccessSolid from "./SuccessSolid";
|
|
96
|
+
import Sync from "./Sync";
|
|
97
|
+
import Tablet from "./Tablet";
|
|
98
|
+
import Translate from "./Translate";
|
|
99
|
+
import Unlink from "./Unlink";
|
|
100
|
+
import UpArrow from "./UpArrow";
|
|
101
|
+
import UploadFile from "./UploadFile";
|
|
102
|
+
import UploadPending from "./UploadPending";
|
|
103
|
+
import UrlLink from "./UrlLink";
|
|
104
|
+
import User from "./User";
|
|
105
|
+
import Users from "./Users";
|
|
106
|
+
import Video from "./Video";
|
|
107
|
+
import View from "./View";
|
|
108
|
+
import Warning from "./Warning";
|
|
109
|
+
import Web from "./Web";
|
|
110
|
+
import Working from "./Working";
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Static registry of every icon. Replaces the dynamic `require()` this
|
|
114
|
+
* component used to do: a template-literal require only resolves through
|
|
115
|
+
* webpack's CommonJS context modules, so it breaks under ESM.
|
|
116
|
+
*
|
|
117
|
+
* When adding an icon, import it above and register it here.
|
|
118
|
+
*/
|
|
119
|
+
const icons: Record<string, ComponentType<any>> = {
|
|
120
|
+
Active,
|
|
121
|
+
Add,
|
|
122
|
+
AddCircle,
|
|
123
|
+
Alert,
|
|
124
|
+
AlignLeft,
|
|
125
|
+
Back,
|
|
126
|
+
BulletList,
|
|
127
|
+
Button,
|
|
128
|
+
Calendar,
|
|
129
|
+
CancelEvent,
|
|
130
|
+
Category,
|
|
131
|
+
Change,
|
|
132
|
+
Close,
|
|
133
|
+
ClosePanel,
|
|
134
|
+
CodeBody,
|
|
135
|
+
CodeHead,
|
|
136
|
+
CodeHeadBody,
|
|
137
|
+
Collapsed,
|
|
138
|
+
ColorPicker,
|
|
139
|
+
Compose,
|
|
140
|
+
Copy,
|
|
141
|
+
Copy2,
|
|
142
|
+
Data,
|
|
143
|
+
DataAdd,
|
|
144
|
+
Deactivate,
|
|
145
|
+
Delete,
|
|
146
|
+
Desktop,
|
|
147
|
+
Disabled,
|
|
148
|
+
Done,
|
|
149
|
+
DownArrow,
|
|
150
|
+
Download,
|
|
151
|
+
Drag,
|
|
152
|
+
Duplicate,
|
|
153
|
+
Edit,
|
|
154
|
+
Empty,
|
|
155
|
+
EmptyCheck,
|
|
156
|
+
Extend,
|
|
157
|
+
File,
|
|
158
|
+
Filter,
|
|
159
|
+
Form,
|
|
160
|
+
FullArrowDown,
|
|
161
|
+
FullArrowLeft,
|
|
162
|
+
FullArrowRight,
|
|
163
|
+
FullArrowUp,
|
|
164
|
+
Grid,
|
|
165
|
+
Grid2,
|
|
166
|
+
GriddoLogo,
|
|
167
|
+
HeroCard,
|
|
168
|
+
Hide,
|
|
169
|
+
History,
|
|
170
|
+
Home,
|
|
171
|
+
Ia,
|
|
172
|
+
Image,
|
|
173
|
+
Info,
|
|
174
|
+
Laptop,
|
|
175
|
+
LeftArrow,
|
|
176
|
+
Link,
|
|
177
|
+
Lock,
|
|
178
|
+
Log,
|
|
179
|
+
Map: MapIcon,
|
|
180
|
+
Menu,
|
|
181
|
+
Microsoft,
|
|
182
|
+
Modified,
|
|
183
|
+
Modules,
|
|
184
|
+
More,
|
|
185
|
+
NewFolder,
|
|
186
|
+
Offline,
|
|
187
|
+
OfflinePending,
|
|
188
|
+
OpenOutside,
|
|
189
|
+
OpenPanel,
|
|
190
|
+
OutOfSection,
|
|
191
|
+
Page,
|
|
192
|
+
Party,
|
|
193
|
+
Paste,
|
|
194
|
+
Phone,
|
|
195
|
+
PhotoLibrary,
|
|
196
|
+
Power,
|
|
197
|
+
Preview,
|
|
198
|
+
Project,
|
|
199
|
+
QrCode,
|
|
200
|
+
Question,
|
|
201
|
+
Refresh,
|
|
202
|
+
Republish,
|
|
203
|
+
RightArrow,
|
|
204
|
+
Scheduled,
|
|
205
|
+
Search,
|
|
206
|
+
SendEmail,
|
|
207
|
+
Settings,
|
|
208
|
+
Share,
|
|
209
|
+
Subsection,
|
|
210
|
+
Success,
|
|
211
|
+
SuccessSolid,
|
|
212
|
+
Sync,
|
|
213
|
+
Tablet,
|
|
214
|
+
Translate,
|
|
215
|
+
Unlink,
|
|
216
|
+
UpArrow,
|
|
217
|
+
UploadFile,
|
|
218
|
+
UploadPending,
|
|
219
|
+
UrlLink,
|
|
220
|
+
User,
|
|
221
|
+
Users,
|
|
222
|
+
Video,
|
|
223
|
+
View,
|
|
224
|
+
Warning,
|
|
225
|
+
Web,
|
|
226
|
+
Working,
|
|
227
|
+
};
|
|
228
|
+
|
|
229
|
+
export default icons;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} catch (_err) {
|
|
5
|
-
return null;
|
|
6
|
-
}
|
|
7
|
-
};
|
|
1
|
+
import icons from "./components";
|
|
2
|
+
|
|
3
|
+
const getImage = (name: string) => icons[name] ?? null;
|
|
8
4
|
|
|
9
5
|
const Icon = (props: IProps) => {
|
|
10
6
|
const name = props.name
|
|
@@ -27,8 +27,10 @@ const ResizePanel = (props: IResizePanelProps): JSX.Element => {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
useEffect(() => {
|
|
30
|
+
let frame = 0;
|
|
31
|
+
|
|
30
32
|
const updateWidth = () => {
|
|
31
|
-
requestAnimationFrame(() => {
|
|
33
|
+
frame = requestAnimationFrame(() => {
|
|
32
34
|
if (rightPanelRef.current) {
|
|
33
35
|
setRwidth(rightPanelRef.current.offsetWidth);
|
|
34
36
|
}
|
|
@@ -38,7 +40,10 @@ const ResizePanel = (props: IResizePanelProps): JSX.Element => {
|
|
|
38
40
|
updateWidth();
|
|
39
41
|
|
|
40
42
|
window.addEventListener("resize", updateWidth);
|
|
41
|
-
return () =>
|
|
43
|
+
return () => {
|
|
44
|
+
cancelAnimationFrame(frame);
|
|
45
|
+
window.removeEventListener("resize", updateWidth);
|
|
46
|
+
};
|
|
42
47
|
}, []);
|
|
43
48
|
|
|
44
49
|
useEffect(() => {
|
package/src/constants/index.ts
CHANGED
|
@@ -25,7 +25,7 @@ const itemLabel = {
|
|
|
25
25
|
type ItemLabel = ValueOf<typeof itemLabel>;
|
|
26
26
|
|
|
27
27
|
const VALID_IMAGE_FORMATS = ["jpeg", "jpg", "png", "svg", "gif", "webp"];
|
|
28
|
-
const VALID_DOCUMENT_FORMATS = ["pdf", "doc", "docx", "xls", "xlsx", "zip", "csv", "txt"];
|
|
28
|
+
const VALID_DOCUMENT_FORMATS = ["pdf", "doc", "docx", "xls", "xlsx", "zip", "csv", "txt", "md"];
|
|
29
29
|
const VALID_VIDEO_FORMATS = ["mov", "mp4", "wmv", "avi", "webm", "mkv"];
|
|
30
30
|
const VALID_FILE_FORMATS = [...VALID_DOCUMENT_FORMATS, ...VALID_VIDEO_FORMATS];
|
|
31
31
|
|
package/src/helpers/files.tsx
CHANGED
|
@@ -22,6 +22,7 @@ const Type = (props: ITypeProps): JSX.Element => {
|
|
|
22
22
|
{ name: "csv", value: "csv", title: "CSV" },
|
|
23
23
|
{ name: "zip", value: "zip", title: "ZIP" },
|
|
24
24
|
{ name: "txt", value: "txt", title: "TXT" },
|
|
25
|
+
{ name: "md", value: "md", title: "MD" },
|
|
25
26
|
];
|
|
26
27
|
|
|
27
28
|
useEffect(() => {
|
package/tsconfig.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"useUnknownInCatchVariables": false,
|
|
17
17
|
"noEmit": true,
|
|
18
18
|
"jsx": "react-jsx",
|
|
19
|
-
"types": ["
|
|
19
|
+
"types": ["vitest/globals", "react", "reflect-metadata", "node", "webpack-env", "react-dom", "@testing-library/jest-dom"]
|
|
20
20
|
},
|
|
21
21
|
"include": ["src"],
|
|
22
22
|
"extends": "./tsconfig.paths.json"
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
// This is a custom Jest transformer turning style imports into empty objects.
|
|
4
|
-
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
process() {
|
|
8
|
-
return "module.exports = {};";
|
|
9
|
-
},
|
|
10
|
-
getCacheKey() {
|
|
11
|
-
// The output is always the same.
|
|
12
|
-
return "cssTransform";
|
|
13
|
-
},
|
|
14
|
-
};
|
package/config/jest/fileMock.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = "test-file-stub";
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const path = require("path");
|
|
4
|
-
const camelcase = require("camelcase");
|
|
5
|
-
|
|
6
|
-
// This is a custom Jest transformer turning file imports into filenames.
|
|
7
|
-
// http://facebook.github.io/jest/docs/en/webpack.html
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
process(src, filename) {
|
|
11
|
-
const assetFilename = JSON.stringify(path.basename(filename));
|
|
12
|
-
|
|
13
|
-
if (filename.match(/\.svg$/)) {
|
|
14
|
-
// Based on how SVGR generates a component name:
|
|
15
|
-
// https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
|
|
16
|
-
const pascalCaseFilename = camelcase(path.parse(filename).name, {
|
|
17
|
-
pascalCase: true,
|
|
18
|
-
});
|
|
19
|
-
const componentName = `Svg${pascalCaseFilename}`;
|
|
20
|
-
return `const React = require('react');
|
|
21
|
-
module.exports = {
|
|
22
|
-
__esModule: true,
|
|
23
|
-
default: ${assetFilename},
|
|
24
|
-
ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
|
|
25
|
-
return {
|
|
26
|
-
$$typeof: Symbol.for('react.element'),
|
|
27
|
-
type: 'svg',
|
|
28
|
-
ref: ref,
|
|
29
|
-
key: null,
|
|
30
|
-
props: Object.assign({}, props, {
|
|
31
|
-
children: ${assetFilename}
|
|
32
|
-
})
|
|
33
|
-
};
|
|
34
|
-
}),
|
|
35
|
-
};`;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
return `module.exports = ${assetFilename};`;
|
|
39
|
-
},
|
|
40
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const React = require("react");
|
|
2
|
-
|
|
3
|
-
const Cropper = ({ onCropComplete }) => {
|
|
4
|
-
React.useEffect(() => {
|
|
5
|
-
if (onCropComplete) {
|
|
6
|
-
onCropComplete({}, { x: 0, y: 0, width: 100, height: 100 });
|
|
7
|
-
}
|
|
8
|
-
}, []);
|
|
9
|
-
return React.createElement("div", { "data-testid": "cropper-mock" });
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
module.exports = {
|
|
13
|
-
__esModule: true,
|
|
14
|
-
default: Cropper,
|
|
15
|
-
};
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
const React = require("react");
|
|
2
|
-
|
|
3
|
-
const WorldMap = () => React.createElement("div", { "data-testid": "world-map-mock" });
|
|
4
|
-
const TimeZoneSelectDialog = () => React.createElement("div", { "data-testid": "timezone-dialog-mock" });
|
|
5
|
-
|
|
6
|
-
module.exports = {
|
|
7
|
-
__esModule: true,
|
|
8
|
-
default: WorldMap,
|
|
9
|
-
WorldMap,
|
|
10
|
-
TimeZoneSelectDialog,
|
|
11
|
-
findTimeZone: jest.fn((tz) => tz),
|
|
12
|
-
convertOffsetInMinutesToString: jest.fn((offset) => String(offset)),
|
|
13
|
-
};
|