@alpaca-editor/core 1.0.3767 → 1.0.3768
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/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const [
|
|
12
|
-
const [preferredSizes, setPreferredSizes] = (0, react_1.useState)(undefined);
|
|
13
|
-
const [panelsExpanded, setPanelsExpanded] = (0, react_1.useState)([]);
|
|
14
|
-
const [sizeToSet, setSizeToSet] = (0, react_1.useState)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import "allotment/dist/style.css";
|
|
3
|
+
import { Allotment } from "allotment";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { classNames } from "primereact/utils";
|
|
6
|
+
export function StackedPanels({ panels }) {
|
|
7
|
+
const splitter = useRef(null);
|
|
8
|
+
const [sizes, setSizes] = useState([]);
|
|
9
|
+
const [preferredSizes, setPreferredSizes] = useState(undefined);
|
|
10
|
+
const [panelsExpanded, setPanelsExpanded] = useState([]);
|
|
11
|
+
const [sizeToSet, setSizeToSet] = useState();
|
|
15
12
|
const panelHeaderSize = 30;
|
|
16
13
|
const toggle = (panelIndex) => {
|
|
17
14
|
const newSize = panelsExpanded[panelIndex]
|
|
@@ -24,7 +21,7 @@ function StackedPanels({ panels }) {
|
|
|
24
21
|
return newState;
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
|
-
|
|
24
|
+
useEffect(() => {
|
|
28
25
|
setPanelsExpanded(panels.map(() => true));
|
|
29
26
|
setPreferredSizes(() => panels.map((x) => x.initialSize));
|
|
30
27
|
}, [panels]);
|
|
@@ -41,18 +38,18 @@ function StackedPanels({ panels }) {
|
|
|
41
38
|
setSizes(newSizes);
|
|
42
39
|
setSizeToSet(newSizes);
|
|
43
40
|
};
|
|
44
|
-
|
|
41
|
+
useEffect(() => {
|
|
45
42
|
if (sizeToSet)
|
|
46
43
|
splitter.current?.resize(sizeToSet);
|
|
47
44
|
}, [sizeToSet]);
|
|
48
45
|
const getHeader = (panel, index) => {
|
|
49
46
|
if (panel.header)
|
|
50
47
|
return panel.header({ panel, index });
|
|
51
|
-
return ((
|
|
52
|
-
(typeof panel.icon === "string" ? ((
|
|
48
|
+
return (_jsxs("div", { className: classNames("p-1.5 bg-gray-50 uppercase text-gray-500 text-xs flex justify items-center cursor-pointer", panelsExpanded[index] ? "border-b" : ""), onClick: () => toggle(index), children: [panel.icon &&
|
|
49
|
+
(typeof panel.icon === "string" ? (_jsx("i", { className: classNames(panel.icon, "pi mr-1.5") })) : (_jsx("div", { className: "w-4 h-4 mr-1.5", children: panel.icon }))), _jsx("div", { className: "mr-auto", children: panel.title }), _jsx("i", { className: classNames(panelsExpanded[index] ? "pi-chevron-up" : "pi-chevron-down", "pi text-sm") })] }));
|
|
53
50
|
};
|
|
54
51
|
const initalSizes = panels.map((x) => x.initialSize);
|
|
55
|
-
return ((
|
|
52
|
+
return (_jsx(Allotment, { vertical: true, snap: true, ref: splitter, defaultSizes: initalSizes, onChange: (s) => {
|
|
56
53
|
if (sizes.join(",") != s.join(","))
|
|
57
54
|
setSizes(s);
|
|
58
55
|
const newPreferred = [...(preferredSizes || s)];
|
|
@@ -61,9 +58,9 @@ function StackedPanels({ panels }) {
|
|
|
61
58
|
newPreferred[i] = x;
|
|
62
59
|
});
|
|
63
60
|
setPreferredSizes(newPreferred);
|
|
64
|
-
}, children: panels.map((panel, index) => ((
|
|
61
|
+
}, children: panels.map((panel, index) => (_jsx(Allotment.Pane, {
|
|
65
62
|
// preferredSize={(preferredSizes || initalSizes)[index] + "%"}
|
|
66
63
|
maxSize: panelsExpanded.length <= index || panelsExpanded[index]
|
|
67
64
|
? 10000
|
|
68
|
-
: panelHeaderSize, children: (
|
|
65
|
+
: panelHeaderSize, children: _jsxs("div", { className: "flex flex-col h-full", children: [getHeader(panel, index), panelsExpanded[index] && (_jsx("div", { className: "overflow-hidden relative flex-1", children: _jsx("div", { className: classNames("inset-0 absolute", panel.noOverflow ? "" : "overflow-y-auto"), children: panel.content }) }))] }) }, index))) }));
|
|
69
66
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function Toolbar({ children }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "bg-gray-50 flex gap-1 p-0.5 border-b items-center", children: children }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function Toolbar({ children }) {
|
|
3
|
+
return (_jsx("div", { className: "bg-gray-50 flex gap-1 p-0.5 border-b items-center", children: children }));
|
|
7
4
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cleanId(id?: string): string | undefined;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getInsertOptionsForCurrentSelection = getInsertOptionsForCurrentSelection;
|
|
4
|
-
const componentTreeHelper_1 = require("../componentTreeHelper");
|
|
5
|
-
function getInsertOptionsForCurrentSelection(editContext) {
|
|
1
|
+
import { getComponentById } from "../componentTreeHelper";
|
|
2
|
+
export function getInsertOptionsForCurrentSelection(editContext) {
|
|
6
3
|
const page = editContext.page;
|
|
7
4
|
if (!page)
|
|
8
5
|
return [];
|
|
9
6
|
const insertingPlaceholderKeys = [editContext.selectedForInsertion]
|
|
10
|
-
.map((x) =>
|
|
7
|
+
.map((x) => getComponentById(x, editContext.page))
|
|
11
8
|
.filter((x) => x)
|
|
12
9
|
.reduce((a, x) => a.concat(x.placeholders?.map((y) => y.key) || []), []);
|
|
13
10
|
const selectedPlaceholderKeys = [
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.confirmCreateVersion = void 0;
|
|
4
|
-
const createVersionCommand_1 = require("../commands/createVersionCommand");
|
|
5
|
-
const confirmCreateVersion = (editContext, language) => {
|
|
1
|
+
import { getCreateAndSwitchToNewVersionCommand } from "../commands/createVersionCommand";
|
|
2
|
+
export const confirmCreateVersion = (editContext, language) => {
|
|
6
3
|
editContext.confirm({
|
|
7
4
|
message: "This page has no version in language " +
|
|
8
5
|
language.name +
|
|
@@ -15,11 +12,10 @@ const confirmCreateVersion = (editContext, language) => {
|
|
|
15
12
|
rejectLabel: "No",
|
|
16
13
|
accept: async () => {
|
|
17
14
|
await editContext?.executeCommand({
|
|
18
|
-
command:
|
|
15
|
+
command: getCreateAndSwitchToNewVersionCommand({
|
|
19
16
|
language: language.languageCode,
|
|
20
17
|
}),
|
|
21
18
|
});
|
|
22
19
|
},
|
|
23
20
|
});
|
|
24
21
|
};
|
|
25
|
-
exports.confirmCreateVersion = confirmCreateVersion;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useMemoWithDebug<T>(factory: () => T, dependencies: any[]): T;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useMemoWithDebug = useMemoWithDebug;
|
|
4
|
-
const react_1 = require("react");
|
|
1
|
+
import { useMemo, useRef } from "react";
|
|
5
2
|
// Generic type for the return value of the memoized factory
|
|
6
|
-
function useMemoWithDebug(factory, dependencies) {
|
|
7
|
-
const previousDependenciesRef =
|
|
3
|
+
export function useMemoWithDebug(factory, dependencies) {
|
|
4
|
+
const previousDependenciesRef = useRef([]);
|
|
8
5
|
const hasChanged = dependencies.some((dep, index) => {
|
|
9
6
|
return dep !== previousDependenciesRef.current[index];
|
|
10
7
|
});
|
|
@@ -16,5 +13,5 @@ function useMemoWithDebug(factory, dependencies) {
|
|
|
16
13
|
});
|
|
17
14
|
}
|
|
18
15
|
previousDependenciesRef.current = dependencies;
|
|
19
|
-
return
|
|
16
|
+
return useMemo(factory, dependencies);
|
|
20
17
|
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { EditContextType } from "./client/editContext";
|
|
3
|
+
import { FieldDescriptor } from "../types";
|
|
4
|
+
import { Field, FullItem, ItemDescriptor } from "./pageModel";
|
|
5
|
+
export type Rect = {
|
|
6
|
+
x: number;
|
|
7
|
+
y: number;
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
};
|
|
11
|
+
export declare function useEventListenerExt(eventName: string, handler: any, element: HTMLElement | Window, capture?: boolean): void;
|
|
12
|
+
export declare const useLocalStorage: <T>(storageKey: string, fallbackState: T) => [T, React.Dispatch<React.SetStateAction<T>>];
|
|
13
|
+
export declare function isFieldActionExecuting(field: Field, editContext: EditContextType): boolean;
|
|
14
|
+
export declare function getItemDescriptor(item: FullItem | ItemDescriptor): ItemDescriptor;
|
|
15
|
+
export declare function getAbsoluteIconUrl(url: string): string;
|
|
16
|
+
export declare function findParentWithAttribute(element: HTMLElement, attr: string): HTMLElement | null;
|
|
17
|
+
export declare function parsePlaceholderKey(key: string): {
|
|
18
|
+
name: string;
|
|
19
|
+
componentId: string | undefined;
|
|
20
|
+
};
|
|
21
|
+
export declare function hasFieldLock(field: FieldDescriptor, editContext: EditContextType): boolean;
|
|
22
|
+
export declare function getSessionWithFieldLock(field: FieldDescriptor, editContext: EditContextType): import("../types").EditSession | undefined;
|
|
23
|
+
export declare function getFieldDescriptorFromElement(element: Element): FieldDescriptor;
|
|
24
|
+
export declare function findNearestComponentId(startElement: Element): string | undefined;
|
|
25
|
+
export declare function findFieldElement(iframe: HTMLIFrameElement, fieldDescriptor: FieldDescriptor): Element | null | undefined;
|
|
26
|
+
export declare function findComponentRect(iframe: HTMLIFrameElement, componentId: string, takeScrollPositionIntoAccount?: boolean): {
|
|
27
|
+
rect: {
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
};
|
|
33
|
+
elements: Element[];
|
|
34
|
+
} | null | undefined;
|
|
35
|
+
export declare const getAbsolutePosition: (element: HTMLElement, iframe: HTMLIFrameElement) => {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
width: number;
|
|
39
|
+
height: number;
|
|
40
|
+
};
|
|
41
|
+
export declare function findParentComponentId(element: HTMLElement): string | null;
|
|
42
|
+
export declare function normalizeGuid(id: string): string;
|
|
43
|
+
export declare function formatDate(date: Date): string;
|
|
44
|
+
export declare function findClosestFieldElement(node: Node | null): HTMLElement | null;
|
package/dist/editor/utils.js
CHANGED
|
@@ -1,36 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.getAbsolutePosition = exports.useLocalStorage = void 0;
|
|
4
|
-
exports.useEventListenerExt = useEventListenerExt;
|
|
5
|
-
exports.isFieldActionExecuting = isFieldActionExecuting;
|
|
6
|
-
exports.getItemDescriptor = getItemDescriptor;
|
|
7
|
-
exports.getAbsoluteIconUrl = getAbsoluteIconUrl;
|
|
8
|
-
exports.findParentWithAttribute = findParentWithAttribute;
|
|
9
|
-
exports.parsePlaceholderKey = parsePlaceholderKey;
|
|
10
|
-
exports.hasFieldLock = hasFieldLock;
|
|
11
|
-
exports.getSessionWithFieldLock = getSessionWithFieldLock;
|
|
12
|
-
exports.getFieldDescriptorFromElement = getFieldDescriptorFromElement;
|
|
13
|
-
exports.findNearestComponentId = findNearestComponentId;
|
|
14
|
-
exports.findFieldElement = findFieldElement;
|
|
15
|
-
exports.findComponentRect = findComponentRect;
|
|
16
|
-
exports.findParentComponentId = findParentComponentId;
|
|
17
|
-
exports.normalizeGuid = normalizeGuid;
|
|
18
|
-
exports.formatDate = formatDate;
|
|
19
|
-
exports.findClosestFieldElement = findClosestFieldElement;
|
|
20
|
-
const react_1 = require("react");
|
|
21
|
-
const react_2 = require("react");
|
|
1
|
+
import { useState } from "react";
|
|
2
|
+
import { useEffect, useRef } from "react";
|
|
22
3
|
// Hook
|
|
23
|
-
function useEventListenerExt(eventName, handler, element, capture = false) {
|
|
4
|
+
export function useEventListenerExt(eventName, handler, element, capture = false) {
|
|
24
5
|
// Create a ref that stores handler
|
|
25
|
-
const savedHandler =
|
|
6
|
+
const savedHandler = useRef(undefined);
|
|
26
7
|
// Update ref.current value if handler changes.
|
|
27
8
|
// This allows our effect below to always get latest handler ...
|
|
28
9
|
// ... without us needing to pass it in effect deps array ...
|
|
29
10
|
// ... and potentially cause effect to re-run every render.
|
|
30
|
-
|
|
11
|
+
useEffect(() => {
|
|
31
12
|
savedHandler.current = handler;
|
|
32
13
|
}, [handler]);
|
|
33
|
-
|
|
14
|
+
useEffect(() => {
|
|
34
15
|
// Make sure element supports addEventListener
|
|
35
16
|
// On
|
|
36
17
|
const isSupported = element && element.addEventListener;
|
|
@@ -47,18 +28,17 @@ function useEventListenerExt(eventName, handler, element, capture = false) {
|
|
|
47
28
|
}, [eventName, element] // Re-run if eventName or element changes
|
|
48
29
|
);
|
|
49
30
|
}
|
|
50
|
-
const useLocalStorage = (storageKey, fallbackState) => {
|
|
51
|
-
const [value, setValue] =
|
|
31
|
+
export const useLocalStorage = (storageKey, fallbackState) => {
|
|
32
|
+
const [value, setValue] = useState(JSON.parse(typeof window !== "undefined"
|
|
52
33
|
? localStorage.getItem(storageKey) ?? JSON.stringify(fallbackState)
|
|
53
34
|
: JSON.stringify(fallbackState)));
|
|
54
|
-
|
|
35
|
+
useEffect(() => {
|
|
55
36
|
if (typeof window !== "undefined")
|
|
56
37
|
localStorage.setItem(storageKey, JSON.stringify(value));
|
|
57
38
|
}, [value, storageKey]);
|
|
58
39
|
return [value, setValue];
|
|
59
40
|
};
|
|
60
|
-
|
|
61
|
-
function isFieldActionExecuting(field, editContext) {
|
|
41
|
+
export function isFieldActionExecuting(field, editContext) {
|
|
62
42
|
const fieldItem = field.descriptor.item;
|
|
63
43
|
if (!fieldItem) {
|
|
64
44
|
return false;
|
|
@@ -69,7 +49,7 @@ function isFieldActionExecuting(field, editContext) {
|
|
|
69
49
|
x.field.item?.version == fieldItem.version);
|
|
70
50
|
return action?.state == "running";
|
|
71
51
|
}
|
|
72
|
-
function getItemDescriptor(item) {
|
|
52
|
+
export function getItemDescriptor(item) {
|
|
73
53
|
if (!item)
|
|
74
54
|
throw new Error("Item is null");
|
|
75
55
|
if ("descriptor" in item) {
|
|
@@ -82,11 +62,11 @@ function getItemDescriptor(item) {
|
|
|
82
62
|
name: item.name,
|
|
83
63
|
};
|
|
84
64
|
}
|
|
85
|
-
function getAbsoluteIconUrl(url) {
|
|
65
|
+
export function getAbsoluteIconUrl(url) {
|
|
86
66
|
//return configuration.services.editorService.baseUrl + url;
|
|
87
67
|
return url;
|
|
88
68
|
}
|
|
89
|
-
function findParentWithAttribute(element, attr) {
|
|
69
|
+
export function findParentWithAttribute(element, attr) {
|
|
90
70
|
while (element && element !== document.documentElement) {
|
|
91
71
|
if (element.hasAttribute(attr)) {
|
|
92
72
|
return element;
|
|
@@ -95,7 +75,7 @@ function findParentWithAttribute(element, attr) {
|
|
|
95
75
|
}
|
|
96
76
|
return null;
|
|
97
77
|
}
|
|
98
|
-
function parsePlaceholderKey(key) {
|
|
78
|
+
export function parsePlaceholderKey(key) {
|
|
99
79
|
const placeholderKeyComponents = key.split("_");
|
|
100
80
|
const placeholderName = placeholderKeyComponents.length === 1
|
|
101
81
|
? placeholderKeyComponents[0]
|
|
@@ -159,7 +139,7 @@ function parsePlaceholderKey(key) {
|
|
|
159
139
|
// }
|
|
160
140
|
// editContext.setModifiedFields([...editContext.modifiedFields]);
|
|
161
141
|
// }
|
|
162
|
-
function hasFieldLock(field, editContext) {
|
|
142
|
+
export function hasFieldLock(field, editContext) {
|
|
163
143
|
if (!editContext.lockedField) {
|
|
164
144
|
return false;
|
|
165
145
|
}
|
|
@@ -168,14 +148,14 @@ function hasFieldLock(field, editContext) {
|
|
|
168
148
|
editContext.lockedField.item.language === field.item.language &&
|
|
169
149
|
editContext.lockedField.item.version === field.item.version);
|
|
170
150
|
}
|
|
171
|
-
function getSessionWithFieldLock(field, editContext) {
|
|
151
|
+
export function getSessionWithFieldLock(field, editContext) {
|
|
172
152
|
return editContext.activeSessions.find((s) => s.fieldLock?.fieldId === field.fieldId &&
|
|
173
153
|
s.fieldLock?.fieldId === field.fieldId &&
|
|
174
154
|
s.fieldLock?.item.id === field.item.id &&
|
|
175
155
|
s.fieldLock?.item.language === field.item.language &&
|
|
176
156
|
s.fieldLock?.item.version === field.item.version);
|
|
177
157
|
}
|
|
178
|
-
function getFieldDescriptorFromElement(element) {
|
|
158
|
+
export function getFieldDescriptorFromElement(element) {
|
|
179
159
|
return {
|
|
180
160
|
item: {
|
|
181
161
|
id: element.getAttribute("data-itemid"),
|
|
@@ -185,7 +165,7 @@ function getFieldDescriptorFromElement(element) {
|
|
|
185
165
|
fieldId: element.getAttribute("data-fieldid"),
|
|
186
166
|
};
|
|
187
167
|
}
|
|
188
|
-
function findNearestComponentId(startElement) {
|
|
168
|
+
export function findNearestComponentId(startElement) {
|
|
189
169
|
let element = startElement;
|
|
190
170
|
while (element) {
|
|
191
171
|
if (element.hasAttribute("data-component-start")) {
|
|
@@ -200,7 +180,7 @@ function findNearestComponentId(startElement) {
|
|
|
200
180
|
}
|
|
201
181
|
return;
|
|
202
182
|
}
|
|
203
|
-
function findFieldElement(iframe, fieldDescriptor) {
|
|
183
|
+
export function findFieldElement(iframe, fieldDescriptor) {
|
|
204
184
|
if (!iframe.contentWindow?.document.body)
|
|
205
185
|
return undefined;
|
|
206
186
|
const fieldElement = iframe.contentWindow?.document.body.querySelector("[data-itemid='" +
|
|
@@ -214,7 +194,7 @@ function findFieldElement(iframe, fieldDescriptor) {
|
|
|
214
194
|
"']");
|
|
215
195
|
return fieldElement;
|
|
216
196
|
}
|
|
217
|
-
function findComponentRect(iframe, componentId, takeScrollPositionIntoAccount = false) {
|
|
197
|
+
export function findComponentRect(iframe, componentId, takeScrollPositionIntoAccount = false) {
|
|
218
198
|
if (!iframe.contentWindow?.document.body)
|
|
219
199
|
return undefined;
|
|
220
200
|
const componentStart = iframe.contentWindow?.document.body.querySelector("[data-component-start='" + componentId + "']");
|
|
@@ -231,7 +211,7 @@ function findComponentRect(iframe, componentId, takeScrollPositionIntoAccount =
|
|
|
231
211
|
return null;
|
|
232
212
|
}
|
|
233
213
|
const startRect = takeScrollPositionIntoAccount
|
|
234
|
-
?
|
|
214
|
+
? getAbsolutePosition(startElement, iframe)
|
|
235
215
|
: startElement.getBoundingClientRect();
|
|
236
216
|
let endElement = componentEnd.previousElementSibling;
|
|
237
217
|
while (endElement && endElement.tagName === "SCRIPT") {
|
|
@@ -240,7 +220,7 @@ function findComponentRect(iframe, componentId, takeScrollPositionIntoAccount =
|
|
|
240
220
|
if (!endElement)
|
|
241
221
|
return null;
|
|
242
222
|
const endRect = takeScrollPositionIntoAccount
|
|
243
|
-
?
|
|
223
|
+
? getAbsolutePosition(endElement, iframe)
|
|
244
224
|
: endElement.getBoundingClientRect();
|
|
245
225
|
const elements = startElement === endElement ? [startElement] : [startElement, endElement];
|
|
246
226
|
// console.log(
|
|
@@ -260,7 +240,7 @@ function findComponentRect(iframe, componentId, takeScrollPositionIntoAccount =
|
|
|
260
240
|
elements: elements,
|
|
261
241
|
};
|
|
262
242
|
}
|
|
263
|
-
const getAbsolutePosition = (element, iframe) => {
|
|
243
|
+
export const getAbsolutePosition = (element, iframe) => {
|
|
264
244
|
const rect = element.getBoundingClientRect();
|
|
265
245
|
const scrollLeft = iframe.contentWindow?.scrollX ||
|
|
266
246
|
iframe.contentDocument?.documentElement.scrollLeft || 0;
|
|
@@ -273,8 +253,7 @@ const getAbsolutePosition = (element, iframe) => {
|
|
|
273
253
|
height: rect.height,
|
|
274
254
|
};
|
|
275
255
|
};
|
|
276
|
-
|
|
277
|
-
function findParentComponentId(element) {
|
|
256
|
+
export function findParentComponentId(element) {
|
|
278
257
|
while (element && element !== document.documentElement) {
|
|
279
258
|
const startElement = findStartElement(element);
|
|
280
259
|
if (startElement) {
|
|
@@ -294,7 +273,7 @@ function findStartElement(element) {
|
|
|
294
273
|
}
|
|
295
274
|
return null;
|
|
296
275
|
}
|
|
297
|
-
function normalizeGuid(id) {
|
|
276
|
+
export function normalizeGuid(id) {
|
|
298
277
|
id = id.toUpperCase();
|
|
299
278
|
if (id.length && id[0] === "{")
|
|
300
279
|
return id;
|
|
@@ -310,10 +289,10 @@ const dateOptions = {
|
|
|
310
289
|
hour12: false,
|
|
311
290
|
};
|
|
312
291
|
const dateFormat = Intl.DateTimeFormat(typeof navigator !== 'undefined' ? navigator.language : 'en', dateOptions);
|
|
313
|
-
function formatDate(date) {
|
|
292
|
+
export function formatDate(date) {
|
|
314
293
|
return dateFormat.format(date);
|
|
315
294
|
}
|
|
316
|
-
function findClosestFieldElement(node) {
|
|
295
|
+
export function findClosestFieldElement(node) {
|
|
317
296
|
let current = node;
|
|
318
297
|
while (current) {
|
|
319
298
|
if (current.nodeType === Node.ELEMENT_NODE) {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CompareView(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
18
|
-
const searchParams = (0, navigation_1.useSearchParams)();
|
|
19
|
-
const router = (0, navigation_2.useRouter)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { LanguageSelector } from "../menubar/LanguageSelector";
|
|
5
|
+
import { VersionSelector } from "../menubar/VersionSelector";
|
|
6
|
+
import { usePageViewContext } from "../page-viewer/pageViewContext";
|
|
7
|
+
import { useSearchParams } from "next/navigation";
|
|
8
|
+
import { useRouter } from "next/navigation";
|
|
9
|
+
import { SingleEditView } from "./SingleEditView";
|
|
10
|
+
import { getLanguagesAndVersions } from "../services/contentService";
|
|
11
|
+
import { Allotment } from "allotment";
|
|
12
|
+
import { ItemEditor } from "./ItemEditor";
|
|
13
|
+
export function CompareView() {
|
|
14
|
+
const editContext = useEditContext();
|
|
15
|
+
const searchParams = useSearchParams();
|
|
16
|
+
const router = useRouter();
|
|
20
17
|
if (!editContext)
|
|
21
18
|
return;
|
|
22
|
-
const [compareToItem, setCompareToItem] =
|
|
23
|
-
const [compareToVersions, setCompareToVersions] =
|
|
19
|
+
const [compareToItem, setCompareToItem] = useState();
|
|
20
|
+
const [compareToVersions, setCompareToVersions] = useState([]);
|
|
24
21
|
const compareTo = editContext.compareTo;
|
|
25
22
|
const setCompareTo = editContext.setCompareTo;
|
|
26
|
-
const comparePageViewContext =
|
|
23
|
+
const comparePageViewContext = usePageViewContext({
|
|
27
24
|
pageItemDescriptor: compareToItem?.descriptor,
|
|
28
25
|
itemsRepository: editContext.itemsRepository,
|
|
29
26
|
configuration: editContext.configuration,
|
|
30
27
|
});
|
|
31
|
-
|
|
28
|
+
useEffect(() => {
|
|
32
29
|
comparePageViewContext.setDevice(editContext.pageView.device);
|
|
33
30
|
}, [editContext.pageView.device]);
|
|
34
31
|
const updateCompareToVersions = async () => {
|
|
@@ -36,13 +33,13 @@ function CompareView() {
|
|
|
36
33
|
setCompareToVersions([]);
|
|
37
34
|
return;
|
|
38
35
|
}
|
|
39
|
-
const result = await
|
|
36
|
+
const result = await getLanguagesAndVersions(compareTo);
|
|
40
37
|
if (result?.data) {
|
|
41
38
|
const versions = result.data.versions.reverse();
|
|
42
39
|
setCompareToVersions(versions);
|
|
43
40
|
}
|
|
44
41
|
};
|
|
45
|
-
|
|
42
|
+
useEffect(() => {
|
|
46
43
|
const updateCompareTo = async () => {
|
|
47
44
|
if (!editContext)
|
|
48
45
|
return;
|
|
@@ -59,7 +56,7 @@ function CompareView() {
|
|
|
59
56
|
setCompareTo(undefined);
|
|
60
57
|
return;
|
|
61
58
|
}
|
|
62
|
-
const result = await
|
|
59
|
+
const result = await getLanguagesAndVersions({
|
|
63
60
|
id: editContext.currentItemDescriptor?.id,
|
|
64
61
|
language: language.languageCode,
|
|
65
62
|
version: 0,
|
|
@@ -77,7 +74,7 @@ function CompareView() {
|
|
|
77
74
|
};
|
|
78
75
|
updateCompareTo();
|
|
79
76
|
}, [searchParams, editContext?.itemLanguages]);
|
|
80
|
-
|
|
77
|
+
useEffect(() => {
|
|
81
78
|
const updateCompareToItem = async () => {
|
|
82
79
|
if (!compareTo || !compareTo.id || !compareTo.language) {
|
|
83
80
|
setCompareToItem(undefined);
|
|
@@ -97,7 +94,7 @@ function CompareView() {
|
|
|
97
94
|
router.push(`?${newParams.toString()}`);
|
|
98
95
|
}
|
|
99
96
|
}
|
|
100
|
-
const originalSelector = ((
|
|
97
|
+
const originalSelector = (_jsxs("div", { className: "flex-1 bg-gray-100 border-b flex items-center justify-center flex-shrink-0 text-sm text-gray-600 p-1", children: [_jsx(LanguageSelector, { selectedLanguage: editContext.contentEditorItem?.descriptor?.language, showAllLanguagesSwitch: false, darkMode: true, onLanguageSelected: (language) => {
|
|
101
98
|
if (!editContext.contentEditorItem)
|
|
102
99
|
return;
|
|
103
100
|
editContext.loadItem({
|
|
@@ -105,7 +102,7 @@ function CompareView() {
|
|
|
105
102
|
language: language.languageCode,
|
|
106
103
|
version: 0,
|
|
107
104
|
});
|
|
108
|
-
} }), compareTo?.language && ((
|
|
105
|
+
} }), compareTo?.language && (_jsx(VersionSelector, { darkMode: true, readOnly: true, versions: editContext.itemVersions, itemDescriptor: editContext.currentItemDescriptor, actualVersion: editContext.contentEditorItem?.version, onVersionSelected: (version) => {
|
|
109
106
|
if (!editContext.contentEditorItem)
|
|
110
107
|
return;
|
|
111
108
|
editContext.loadItem({
|
|
@@ -114,7 +111,7 @@ function CompareView() {
|
|
|
114
111
|
version,
|
|
115
112
|
});
|
|
116
113
|
} }))] }));
|
|
117
|
-
const compareToSelector = ((
|
|
114
|
+
const compareToSelector = (_jsxs("div", { className: "flex-1 bg-gray-100 border-b flex items-center justify-center flex-shrink-0 text-sm text-gray-600 p-1", children: [_jsx(LanguageSelector, { selectedLanguage: compareTo?.language, showAllLanguagesSwitch: false, darkMode: true, onLanguageSelected: (language) => {
|
|
118
115
|
if (!compareTo?.id)
|
|
119
116
|
return;
|
|
120
117
|
updateCompareTo({
|
|
@@ -122,7 +119,7 @@ function CompareView() {
|
|
|
122
119
|
language: language.languageCode,
|
|
123
120
|
version: compareTo.version,
|
|
124
121
|
});
|
|
125
|
-
} }), compareTo?.language && ((
|
|
122
|
+
} }), compareTo?.language && (_jsx(VersionSelector, { darkMode: true, readOnly: true, versions: compareToVersions, itemDescriptor: compareTo, actualVersion: compareToItem?.version, onVersionSelected: (version) => {
|
|
126
123
|
if (!compareTo?.id)
|
|
127
124
|
return;
|
|
128
125
|
updateCompareTo({
|
|
@@ -133,8 +130,8 @@ function CompareView() {
|
|
|
133
130
|
} }))] }));
|
|
134
131
|
if ((compareToItem && !compareToItem.hasLayout) ||
|
|
135
132
|
comparePageViewContext.device === "")
|
|
136
|
-
return ((
|
|
137
|
-
return ((
|
|
133
|
+
return (_jsxs("div", { className: "flex flex-col h-full w-full items-stretch", children: [_jsxs("div", { className: "flex w-full", children: [originalSelector, compareToSelector] }), _jsx("div", { className: "flex-1 relative", children: _jsx("div", { className: "absolute w-full h-full", children: _jsx(ItemEditor, { pageViewContext: editContext.pageView, compareToItem: compareToItem }) }) })] }));
|
|
134
|
+
return (_jsxs(Allotment, { className: "flex h-full w-full", children: [_jsx(Allotment.Pane, { children: _jsxs("div", { className: "flex flex-col h-full w-full items-stretch", children: [originalSelector, _jsx(SingleEditView, { name: "original", mode: editContext?.previewMode ? "view" : "edit", pageViewContext: editContext.pageView, itemDescriptor: editContext.contentEditorItem?.descriptor }, "original")] }) }), _jsx(Allotment.Pane, { children: _jsxs("div", { className: "flex flex-col h-full w-full items-stretch", children: [compareToSelector, compareTo?.language && (_jsx(SingleEditView, { name: "compareTo", mode: compareToItem?.id ===
|
|
138
135
|
editContext.contentEditorItem?.descriptor.id &&
|
|
139
136
|
compareToItem?.language ===
|
|
140
137
|
editContext.contentEditorItem?.descriptor.language &&
|
|
@@ -143,5 +140,5 @@ function CompareView() {
|
|
|
143
140
|
? editContext?.previewMode
|
|
144
141
|
? "view"
|
|
145
142
|
: "edit"
|
|
146
|
-
: "compare", pageViewContext: comparePageViewContext, itemDescriptor: compareTo }, "compareTo")), !compareTo?.language && ((
|
|
143
|
+
: "compare", pageViewContext: comparePageViewContext, itemDescriptor: compareTo }, "compareTo")), !compareTo?.language && (_jsx("div", { className: "flex flex-col h-full w-full items-center justify-center", children: _jsx("div", { className: "text-gray-400", children: "Select a language and version to compare" }) }))] }) })] }));
|
|
147
144
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function EditView(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const SingleEditView_1 = require("./SingleEditView");
|
|
8
|
-
function EditView() {
|
|
9
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../client/editContext";
|
|
3
|
+
import { CompareView } from "./CompareView";
|
|
4
|
+
import { SingleEditView } from "./SingleEditView";
|
|
5
|
+
export function EditView() {
|
|
6
|
+
const editContext = useEditContext();
|
|
10
7
|
if (!editContext)
|
|
11
8
|
return null;
|
|
12
9
|
if (!editContext.contentEditorItem?.descriptor)
|
|
13
|
-
return ((
|
|
10
|
+
return (_jsx("div", { className: "grid items-center justify-center h-full w-full", children: _jsx("div", { className: "text-sm text-gray-500", children: "Not item selected" }) }));
|
|
14
11
|
if (editContext.compareMode)
|
|
15
|
-
return (
|
|
16
|
-
return ((
|
|
12
|
+
return _jsx(CompareView, {});
|
|
13
|
+
return (_jsx(SingleEditView, { name: "single", mode: editContext?.previewMode ? "view" : "edit", pageViewContext: editContext.pageView, itemDescriptor: editContext.contentEditorItem?.descriptor }, "single"));
|
|
17
14
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PageViewContext } from "../page-viewer/pageViewContext";
|
|
2
|
+
import { FullItem } from "../pageModel";
|
|
3
|
+
export declare function ItemEditor({ item, compareToItem, }: {
|
|
4
|
+
item?: FullItem;
|
|
5
|
+
compareToItem?: FullItem;
|
|
6
|
+
pageViewContext?: PageViewContext;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|