@alpaca-editor/core 1.0.3767 → 1.0.3769
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,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const resizeObserverRef = (0, react_1.useRef)(null);
|
|
12
|
-
const mutationObserverRef = (0, react_1.useRef)(null);
|
|
13
|
-
const [componentRect, setComponentRect] = (0, react_1.useState)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { findComponentRect } from "../utils";
|
|
5
|
+
import { useThrottledCallback } from "use-debounce";
|
|
6
|
+
export function FrameMenu({ component, mode, pageViewContext, }) {
|
|
7
|
+
const editContext = useEditContext();
|
|
8
|
+
const resizeObserverRef = useRef(null);
|
|
9
|
+
const mutationObserverRef = useRef(null);
|
|
10
|
+
const [componentRect, setComponentRect] = useState();
|
|
14
11
|
const updatePosition = () => {
|
|
15
12
|
if (!component || !editContext || !pageViewContext)
|
|
16
13
|
return;
|
|
@@ -20,16 +17,16 @@ function FrameMenu({ component, mode, pageViewContext, }) {
|
|
|
20
17
|
const resetSelection = () => {
|
|
21
18
|
setComponentRect(undefined);
|
|
22
19
|
};
|
|
23
|
-
const componentRect =
|
|
20
|
+
const componentRect = findComponentRect(iframe, component.id)?.rect;
|
|
24
21
|
if (!componentRect) {
|
|
25
22
|
resetSelection();
|
|
26
23
|
return;
|
|
27
24
|
}
|
|
28
25
|
setComponentRect(componentRect);
|
|
29
26
|
};
|
|
30
|
-
const updatePositionThrottled =
|
|
27
|
+
const updatePositionThrottled = useThrottledCallback(updatePosition, 30);
|
|
31
28
|
// Effect to handle changes in the observed element
|
|
32
|
-
|
|
29
|
+
useEffect(() => {
|
|
33
30
|
if (component) {
|
|
34
31
|
const iframe = pageViewContext.editorIframeRef.current;
|
|
35
32
|
if (!iframe)
|
|
@@ -53,7 +50,7 @@ function FrameMenu({ component, mode, pageViewContext, }) {
|
|
|
53
50
|
iframe.contentWindow?.document.body;
|
|
54
51
|
scrollContainer?.addEventListener("scroll", updatePositionThrottled);
|
|
55
52
|
iframe.contentWindow?.addEventListener("scroll", updatePositionThrottled);
|
|
56
|
-
const componentRect =
|
|
53
|
+
const componentRect = findComponentRect(iframe, component.id);
|
|
57
54
|
if (!componentRect) {
|
|
58
55
|
updatePosition();
|
|
59
56
|
return;
|
|
@@ -73,7 +70,7 @@ function FrameMenu({ component, mode, pageViewContext, }) {
|
|
|
73
70
|
}
|
|
74
71
|
};
|
|
75
72
|
}, [component]);
|
|
76
|
-
|
|
73
|
+
useEffect(() => {
|
|
77
74
|
setTimeout(() => {
|
|
78
75
|
updatePosition();
|
|
79
76
|
}, 100);
|
|
@@ -159,13 +156,13 @@ function FrameMenu({ component, mode, pageViewContext, }) {
|
|
|
159
156
|
if (!componentRect)
|
|
160
157
|
return null;
|
|
161
158
|
const isMultiSelected = editContext.selection.length > 1;
|
|
162
|
-
return ((
|
|
159
|
+
return (_jsx(_Fragment, { children: _jsx("div", { className: `pointer-events-none absolute inset-0 border-2 ${colorVariants[color]} tour-frame-menu opacity-50 hover:opacity-100`, style: {
|
|
163
160
|
left: componentRect.x,
|
|
164
161
|
top: componentRect.y,
|
|
165
162
|
width: componentRect.width,
|
|
166
163
|
height: componentRect.height,
|
|
167
164
|
zIndex: 8,
|
|
168
|
-
}, "data-testid": "frame-menu", children: !isMultiSelected && ((
|
|
165
|
+
}, "data-testid": "frame-menu", children: !isMultiSelected && (_jsxs("div", { className: `editframe-menu pointer-events-auto absolute z-1000 flex items-center pr-4 text-base text-white ${bgColorVariants[color]} ` +
|
|
169
166
|
(componentRect.y - 36 < 0 ? "rounded-bl-lg" : "rounded-t-lg"), style: {
|
|
170
167
|
right: "-2px",
|
|
171
168
|
top: componentRect.y - 36 < 0 ? "0" : undefined,
|
|
@@ -174,5 +171,5 @@ function FrameMenu({ component, mode, pageViewContext, }) {
|
|
|
174
171
|
: undefined,
|
|
175
172
|
zIndex: 800,
|
|
176
173
|
height: "36px",
|
|
177
|
-
}, children: [(
|
|
174
|
+
}, children: [_jsx("div", { draggable: isDraggable, onDragStart: handleDragStart, onDragEnd: handleDragEnd, className: `px-4 ${isDraggable ? "cursor-move" : "cursor-default"} `, children: component.name }), mode === "edit" && (_jsx("div", { className: "flex items-center gap-2", children: buttons.map((b, i) => (_jsx("div", { className: "cursor-pointer p-1", children: typeof b.icon === "string" ? (_jsx("i", { className: b.icon + " cursor-pointer", onClick: b.onClick, title: b.label })) : (b.icon) }, i))) }))] })) }) }));
|
|
178
175
|
}
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const FrameMenu_1 = require("./FrameMenu");
|
|
9
|
-
function FrameMenus({ mode, pageViewContext, }) {
|
|
10
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { findComponent } from "../componentTreeHelper";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
import { FrameMenu } from "./FrameMenu";
|
|
6
|
+
export function FrameMenus({ mode, pageViewContext, }) {
|
|
7
|
+
const editContext = useEditContext();
|
|
11
8
|
const selection = editContext?.selection;
|
|
12
|
-
const [components, setComponents] =
|
|
13
|
-
|
|
9
|
+
const [components, setComponents] = useState([]);
|
|
10
|
+
useEffect(() => {
|
|
14
11
|
if (!pageViewContext.page)
|
|
15
12
|
return;
|
|
16
13
|
const comps = selection
|
|
17
14
|
? selection
|
|
18
|
-
.map((id) =>
|
|
15
|
+
.map((id) => findComponent(id, pageViewContext.page?.rootComponent.placeholders || []))
|
|
19
16
|
.filter((c) => c !== undefined)
|
|
20
17
|
: [];
|
|
21
18
|
setComponents(comps);
|
|
22
19
|
}, [selection, pageViewContext.page]);
|
|
23
|
-
return ((
|
|
20
|
+
return (_jsxs(_Fragment, { children: [components.map((c) => (_jsx(FrameMenu, { component: c, mode: mode, pageViewContext: pageViewContext }, c.id))), " "] }));
|
|
24
21
|
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
function InlineEditor({ pageViewContext, mode, }) {
|
|
9
|
-
const context = (0, editContext_1.useEditContext)();
|
|
10
|
-
const modifiedFieldsContext = (0, editContext_1.useModifiedFieldsContext)();
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useEditContext, useModifiedFieldsContext, } from "../client/editContext";
|
|
3
|
+
import { useThrottledCallback } from "use-debounce";
|
|
4
|
+
import { getFieldDescriptorFromElement, hasFieldLock } from "../utils";
|
|
5
|
+
export function InlineEditor({ pageViewContext, mode, }) {
|
|
6
|
+
const context = useEditContext();
|
|
7
|
+
const modifiedFieldsContext = useModifiedFieldsContext();
|
|
11
8
|
if (!context)
|
|
12
9
|
return;
|
|
13
|
-
const mutationObserverRef =
|
|
14
|
-
const debouncedSetFieldvalue =
|
|
10
|
+
const mutationObserverRef = useRef(null);
|
|
11
|
+
const debouncedSetFieldvalue = useThrottledCallback((value, fieldId, fieldName, itemId, language, version) => {
|
|
15
12
|
var modifiedFieldValue = modifiedFieldsContext?.modifiedFields.find((x) => x.fieldId === fieldId &&
|
|
16
13
|
x.item.id === itemId &&
|
|
17
14
|
x.item.language === language &&
|
|
@@ -32,7 +29,7 @@ function InlineEditor({ pageViewContext, mode, }) {
|
|
|
32
29
|
value: value,
|
|
33
30
|
});
|
|
34
31
|
}, context.configuration.debounceFieldEditsInterval);
|
|
35
|
-
|
|
32
|
+
useEffect(() => {
|
|
36
33
|
if (!context || mode === "view")
|
|
37
34
|
return;
|
|
38
35
|
const element = context.inlineEditingFieldElement;
|
|
@@ -51,8 +48,8 @@ function InlineEditor({ pageViewContext, mode, }) {
|
|
|
51
48
|
const isRichText = element.getAttribute("data-is-richtext") === "true";
|
|
52
49
|
if (!fieldId || !itemId || !language || !version)
|
|
53
50
|
return;
|
|
54
|
-
const fieldDescriptor =
|
|
55
|
-
const hasFielLock =
|
|
51
|
+
const fieldDescriptor = getFieldDescriptorFromElement(element);
|
|
52
|
+
const hasFielLock = hasFieldLock(fieldDescriptor, context);
|
|
56
53
|
if (!hasFielLock)
|
|
57
54
|
return;
|
|
58
55
|
element.setAttribute("contenteditable", "true");
|
|
@@ -74,7 +71,7 @@ function InlineEditor({ pageViewContext, mode, }) {
|
|
|
74
71
|
}
|
|
75
72
|
};
|
|
76
73
|
}, [context?.inlineEditingFieldElement]);
|
|
77
|
-
|
|
74
|
+
useEffect(() => {
|
|
78
75
|
const updateFields = async () => {
|
|
79
76
|
modifiedFieldsContext?.modifiedFields.forEach((field) => {
|
|
80
77
|
const elements = pageViewContext.editorIframeRef.current.contentWindow?.document.querySelectorAll(`[data-fieldid="${field.fieldId}"][data-itemid="${field.item.id}"][data-language="${field.item.language}"][data-version="${field.item.version}"`);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LockedFieldIndicator(): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,31 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
function LockedFieldIndicator() {
|
|
8
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../client/editContext";
|
|
3
|
+
import { findFieldElement } from "../utils";
|
|
4
|
+
export function LockedFieldIndicator() {
|
|
5
|
+
const editContext = useEditContext();
|
|
9
6
|
if (!editContext)
|
|
10
7
|
return;
|
|
11
8
|
const sessionsWithFieldLock = editContext.activeSessions.filter((x) => x.fieldLock && x.sessionId !== editContext.sessionId);
|
|
12
|
-
return ((
|
|
9
|
+
return (_jsx(_Fragment, { children: sessionsWithFieldLock.map((session) => {
|
|
13
10
|
if (!session.fieldLock)
|
|
14
11
|
return;
|
|
15
12
|
const iframe = editContext.pageView.editorIframeRef.current;
|
|
16
13
|
if (!iframe)
|
|
17
14
|
return;
|
|
18
|
-
const element =
|
|
15
|
+
const element = findFieldElement(iframe, session.fieldLock);
|
|
19
16
|
if (!element)
|
|
20
17
|
return;
|
|
21
|
-
return ((
|
|
18
|
+
return (_jsx(FieldLock, { element: element, iframe: iframe, session: session }, session.sessionId));
|
|
22
19
|
}) }));
|
|
23
20
|
}
|
|
24
21
|
function FieldLock({ element, iframe, session, }) {
|
|
25
22
|
const rect = element.getBoundingClientRect();
|
|
26
23
|
const editorRect = iframe.getBoundingClientRect();
|
|
27
24
|
if (rect && editorRect) {
|
|
28
|
-
return ((
|
|
25
|
+
return (_jsx("div", { className: "absolute text-xs text-white p-0.5 rounded hover:opacity-100 opacity-90", style: {
|
|
29
26
|
left: rect.left + "px",
|
|
30
27
|
top: rect.top + "px",
|
|
31
28
|
background: session.color,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function NoLayout(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const [lastPageItem, setLastPageItem] = (0, react_1.useState)(null);
|
|
9
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
export function NoLayout() {
|
|
5
|
+
const [lastPageItem, setLastPageItem] = useState(null);
|
|
6
|
+
const editContext = useEditContext();
|
|
7
|
+
useEffect(() => {
|
|
11
8
|
const updateLastPage = async () => {
|
|
12
9
|
if (!editContext?.pageView.pageItemDescriptor)
|
|
13
10
|
return;
|
|
@@ -17,5 +14,5 @@ function NoLayout() {
|
|
|
17
14
|
};
|
|
18
15
|
updateLastPage();
|
|
19
16
|
}, [editContext?.currentItemDescriptor]);
|
|
20
|
-
return ((
|
|
17
|
+
return (_jsxs("div", { className: "h-full w-full flex flex-col items-center justify-center text-sm", children: ["Item has no layout.", lastPageItem && (_jsxs("div", { className: "cursor-pointer hover:underline p-2", onClick: () => editContext?.loadItem(lastPageItem.descriptor), children: ["Load ", lastPageItem?.name, "?"] }))] }));
|
|
21
18
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PageViewContext } from "../page-viewer/pageViewContext";
|
|
2
|
+
export declare function PageEditorChrome({ iframe, mode, pageViewContext, }: {
|
|
3
|
+
iframe: HTMLIFrameElement;
|
|
4
|
+
mode: "edit" | "compare" | "view";
|
|
5
|
+
pageViewContext: PageViewContext;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
function PageEditorChrome({ iframe, mode, pageViewContext, }) {
|
|
16
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
17
|
-
const [insertingStyle, setInsertingStyle] = (0, react_1.useState)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../client/editContext";
|
|
3
|
+
import { InlineEditor } from "./InlineEditor";
|
|
4
|
+
import { FieldActionsIndicators } from "./FieldActionIndicators";
|
|
5
|
+
import { PlaceholderDropZones } from "./PlaceholderDropZones";
|
|
6
|
+
import { PictureEditorOverlay } from "./PictureEditorOverlay";
|
|
7
|
+
import { useEffect, useState } from "react";
|
|
8
|
+
import { LockedFieldIndicator } from "./LockedFieldIndicator";
|
|
9
|
+
import { FrameMenus } from "./FrameMenus";
|
|
10
|
+
import { FieldEditedIndicators } from "./FieldEditedIndicators";
|
|
11
|
+
import { CommentHighlightings } from "./CommentHighlightings";
|
|
12
|
+
export function PageEditorChrome({ iframe, mode, pageViewContext, }) {
|
|
13
|
+
const editContext = useEditContext();
|
|
14
|
+
const [insertingStyle, setInsertingStyle] = useState();
|
|
18
15
|
if (!editContext?.pageView || !iframe?.contentDocument)
|
|
19
16
|
return null;
|
|
20
|
-
|
|
17
|
+
useEffect(() => {
|
|
21
18
|
if (!editContext.inserting)
|
|
22
19
|
setInsertingStyle(undefined);
|
|
23
20
|
let insertingPosition;
|
|
@@ -61,5 +58,5 @@ function PageEditorChrome({ iframe, mode, pageViewContext, }) {
|
|
|
61
58
|
const insertingStyle = getInsertingStyle();
|
|
62
59
|
setInsertingStyle(insertingStyle);
|
|
63
60
|
}, [editContext.inserting, pageViewContext.viewport]);
|
|
64
|
-
return ((
|
|
61
|
+
return (_jsxs(_Fragment, { children: [_jsx(FrameMenus, { mode: mode, pageViewContext: pageViewContext }), _jsx(InlineEditor, { mode: mode === "edit" ? "edit" : "view", pageViewContext: pageViewContext }), _jsx(LockedFieldIndicator, {}), _jsx(FieldActionsIndicators, {}), editContext.showComments && (_jsx(CommentHighlightings, { iframe: pageViewContext?.editorIframeRef.current, scale: 1 })), _jsx(FieldEditedIndicators, { pageViewContext: pageViewContext }), mode === "edit" && (_jsxs(_Fragment, { children: [_jsx(PlaceholderDropZones, { iframe: pageViewContext?.editorIframeRef.current, size: "large" }), _jsx(PictureEditorOverlay, {}), insertingStyle && (_jsxs("div", { className: "absolute flex h-8 w-8", style: insertingStyle, children: [_jsx("span", { className: "animate-ping absolute inline-flex h-full w-full rounded-full bg-sky-400 opacity-75" }), _jsx("span", { className: "relative inline-flex rounded-full h-8 w-8 bg-sky-500" })] }))] }))] }));
|
|
65
62
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PictureEditorOverlay(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const componentTreeHelper_1 = require("../componentTreeHelper");
|
|
9
|
-
function PictureEditorOverlay() {
|
|
10
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { PictureEditor } from "../PictureEditor";
|
|
5
|
+
import { getComponentById } from "../componentTreeHelper";
|
|
6
|
+
export function PictureEditorOverlay() {
|
|
7
|
+
const editContext = useEditContext();
|
|
11
8
|
const pageViewContext = editContext?.pageView;
|
|
12
9
|
const iframe = pageViewContext?.editorIframeRef.current;
|
|
13
|
-
const [field, setField] =
|
|
14
|
-
const [variantName, setVariantName] =
|
|
15
|
-
const [element, setElement] =
|
|
16
|
-
const editContextRef =
|
|
17
|
-
|
|
10
|
+
const [field, setField] = useState();
|
|
11
|
+
const [variantName, setVariantName] = useState();
|
|
12
|
+
const [element, setElement] = useState();
|
|
13
|
+
const editContextRef = useRef(editContext);
|
|
14
|
+
useEffect(() => {
|
|
18
15
|
editContextRef.current = editContext;
|
|
19
16
|
}, [editContext]);
|
|
20
|
-
const onMouseEnter =
|
|
17
|
+
const onMouseEnter = useCallback((e) => {
|
|
21
18
|
if (!e.target)
|
|
22
19
|
return;
|
|
23
20
|
if (!("closest" in e.target))
|
|
@@ -26,7 +23,7 @@ function PictureEditorOverlay() {
|
|
|
26
23
|
const pictureElement = target.closest("picture") || target.closest("img");
|
|
27
24
|
setElement(pictureElement || undefined);
|
|
28
25
|
}, [iframe, editContext]);
|
|
29
|
-
|
|
26
|
+
useEffect(() => {
|
|
30
27
|
if (element) {
|
|
31
28
|
const itemId = element.getAttribute("data-itemid");
|
|
32
29
|
const language = element.getAttribute("data-language");
|
|
@@ -39,7 +36,7 @@ function PictureEditorOverlay() {
|
|
|
39
36
|
!pageViewContext?.page ||
|
|
40
37
|
!iframe?.contentWindow)
|
|
41
38
|
return;
|
|
42
|
-
const component =
|
|
39
|
+
const component = getComponentById(itemId, pageViewContext.page);
|
|
43
40
|
if (component == null)
|
|
44
41
|
return;
|
|
45
42
|
const pictureField = component.datasourceItem?.fields.find((f) => f.id === fieldId);
|
|
@@ -51,7 +48,7 @@ function PictureEditorOverlay() {
|
|
|
51
48
|
setField(undefined);
|
|
52
49
|
}
|
|
53
50
|
}, [element, pageViewContext?.page]);
|
|
54
|
-
|
|
51
|
+
useEffect(() => {
|
|
55
52
|
if (!element || !iframe?.contentWindow)
|
|
56
53
|
return;
|
|
57
54
|
const sourceELement = getCurrentPictureSource(element, iframe.contentWindow);
|
|
@@ -67,7 +64,7 @@ function PictureEditorOverlay() {
|
|
|
67
64
|
iframe.contentDocument.addEventListener("mouseenter", onMouseEnter, true);
|
|
68
65
|
}
|
|
69
66
|
};
|
|
70
|
-
|
|
67
|
+
useEffect(() => {
|
|
71
68
|
if (iframe) {
|
|
72
69
|
// Ensure the iframe is loaded and accessible
|
|
73
70
|
iframe.addEventListener("load", handleLoad);
|
|
@@ -90,7 +87,7 @@ function PictureEditorOverlay() {
|
|
|
90
87
|
width: bounds.width + "px",
|
|
91
88
|
height: bounds.height + "px",
|
|
92
89
|
};
|
|
93
|
-
return ((
|
|
90
|
+
return (_jsx(PictureEditor, { field: field, variantName: variantName, style: style, forwardScrollevents: true, isPageEditor: true }));
|
|
94
91
|
}
|
|
95
92
|
function getCurrentPictureSource(pictureElement, iframeWindow) {
|
|
96
93
|
if (pictureElement.tagName === "IMG")
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Placeholder } from "../pageModel";
|
|
2
|
+
export declare function PlaceholderDropZone({ placeholder, description, index, parentName, spotPosition, spotPositionElement, spotPositionAnchor, size, }: {
|
|
3
|
+
placeholder: Placeholder;
|
|
4
|
+
description?: string;
|
|
5
|
+
index: number;
|
|
6
|
+
parentName?: string;
|
|
7
|
+
spotPosition: {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
};
|
|
11
|
+
spotPositionElement: Element;
|
|
12
|
+
size: "large" | "small";
|
|
13
|
+
spotPositionAnchor: "top" | "bottom" | "left" | "right";
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
function PlaceholderDropZone({ placeholder, description, index, parentName, spotPosition, spotPositionElement, spotPositionAnchor, size, }) {
|
|
11
|
-
const [isHovering, setIsHovering] = (0, react_1.useState)(false);
|
|
12
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useState } from "react";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
import { classNames } from "primereact/utils";
|
|
6
|
+
import { getAbsoluteIconUrl } from "../utils";
|
|
7
|
+
export function PlaceholderDropZone({ placeholder, description, index, parentName, spotPosition, spotPositionElement, spotPositionAnchor, size, }) {
|
|
8
|
+
const [isHovering, setIsHovering] = useState(false);
|
|
9
|
+
const editContext = useEditContext();
|
|
13
10
|
if (!editContext)
|
|
14
11
|
return;
|
|
15
12
|
function dragOver(ev) {
|
|
@@ -32,15 +29,15 @@ function PlaceholderDropZone({ placeholder, description, index, parentName, spot
|
|
|
32
29
|
};
|
|
33
30
|
if (size === "small")
|
|
34
31
|
overlayStyle.transform = "scale(0.5)";
|
|
35
|
-
|
|
32
|
+
useEffect(() => {
|
|
36
33
|
if (isHovering) {
|
|
37
|
-
editContext.setStatusMessage((
|
|
34
|
+
editContext.setStatusMessage(_jsxs("div", { children: ["Drop into placeholder", " ", _jsx("span", { className: "font-bold", children: parentName }), " /", " ", _jsx("span", { className: "font-bold", children: description || placeholder.name }), " ", "at position ", _jsx("span", { className: "font-bold", children: index + 1 })] }));
|
|
38
35
|
}
|
|
39
36
|
else {
|
|
40
37
|
editContext.setStatusMessage("");
|
|
41
38
|
}
|
|
42
39
|
}, [isHovering]);
|
|
43
|
-
return ((
|
|
40
|
+
return (_jsx("div", { className: "absolute", style: overlayStyle, children: _jsx("div", { onDragOver: dragOver, title: (description ?? placeholder.name) + " (" + index + ")", "data-testid": "placeholder-dropzone", "data-testindex": index, onDrop: drop, onDragLeave: () => setIsHovering(false), onClick: (e) => {
|
|
44
41
|
//const placeholderKeyComponents = placeholder.key.split("_");
|
|
45
42
|
// const parentId =
|
|
46
43
|
// placeholderKeyComponents.length === 1
|
|
@@ -55,7 +52,7 @@ function PlaceholderDropZone({ placeholder, description, index, parentName, spot
|
|
|
55
52
|
?.filter((x) => !x.isHidden && !x.isInvalid)
|
|
56
53
|
.map((x) => ({
|
|
57
54
|
id: x.typeId,
|
|
58
|
-
icon: ((
|
|
55
|
+
icon: (_jsx("img", { src: getAbsoluteIconUrl(x.icon), width: "16", height: "16", className: "m-1" })),
|
|
59
56
|
label: x.name,
|
|
60
57
|
command: () => {
|
|
61
58
|
editContext.operations.addComponent(x.typeId, placeholder.key, index);
|
|
@@ -68,15 +65,15 @@ function PlaceholderDropZone({ placeholder, description, index, parentName, spot
|
|
|
68
65
|
disabled: true,
|
|
69
66
|
className: "border-b border-gray-400 pb-2 pl-2",
|
|
70
67
|
template: () => {
|
|
71
|
-
return ((
|
|
68
|
+
return (_jsx("span", { className: "text-black text-sm ", children: "Insert" }));
|
|
72
69
|
},
|
|
73
70
|
},
|
|
74
71
|
...insertOptions,
|
|
75
72
|
]);
|
|
76
73
|
e.preventDefault();
|
|
77
|
-
}, className: "placeholder cursor-pointer placeholder-dropzone", children: (
|
|
74
|
+
}, className: "placeholder cursor-pointer placeholder-dropzone", children: _jsx("div", { className: classNames(isHovering
|
|
78
75
|
? "z-30 shadow-xl shadow-black w-20 h-20 shadow-blue-500/50"
|
|
79
|
-
: "z-30 w-10 h-10 hover:scale-[1.1]", "transition-all duration-200 text-white text-center p-2 text-sm flex justify-center items-center bg-blue-500 rounded-full absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 test-ph-dropzone tour-placeholder-dropzone"), "data-testid": "placeholder-dropzone-button", children: (
|
|
76
|
+
: "z-30 w-10 h-10 hover:scale-[1.1]", "transition-all duration-200 text-white text-center p-2 text-sm flex justify-center items-center bg-blue-500 rounded-full absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 test-ph-dropzone tour-placeholder-dropzone"), "data-testid": "placeholder-dropzone-button", children: _jsx("i", { className: "pi pi-plus block" }) }) }) })
|
|
80
77
|
// </div>
|
|
81
78
|
);
|
|
82
79
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
function PlaceholderDropZones({ scale, iframe, size, }) {
|
|
11
|
-
const [placeholders, setPlaceholders] = (0, react_1.useState)([]);
|
|
12
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { getAllPlaceholders } from "../componentTreeHelper";
|
|
5
|
+
import { findComponentRect } from "../utils";
|
|
6
|
+
import { PlaceholderDropZone } from "./PlaceholderDropZone";
|
|
7
|
+
export function PlaceholderDropZones({ scale, iframe, size, }) {
|
|
8
|
+
const [placeholders, setPlaceholders] = useState([]);
|
|
9
|
+
const editContext = useEditContext();
|
|
13
10
|
const pageViewContext = editContext?.pageView;
|
|
14
|
-
|
|
11
|
+
useEffect(() => {
|
|
15
12
|
if (!pageViewContext?.page)
|
|
16
13
|
return;
|
|
17
|
-
setPlaceholders(
|
|
14
|
+
setPlaceholders(getAllPlaceholders(pageViewContext.page));
|
|
18
15
|
}, [pageViewContext?.page]);
|
|
19
16
|
if (!pageViewContext ||
|
|
20
17
|
(!editContext?.dragObject && !editContext.selectedForInsertion) ||
|
|
@@ -81,7 +78,7 @@ function PlaceholderDropZones({ scale, iframe, size, }) {
|
|
|
81
78
|
break;
|
|
82
79
|
}
|
|
83
80
|
if (nextElement.getAttribute("data-component-end")) {
|
|
84
|
-
const componentRect =
|
|
81
|
+
const componentRect = findComponentRect(iframe, (nextElement.getAttribute("data-component-end") ||
|
|
85
82
|
nextElement.getAttribute("data-dropzone")));
|
|
86
83
|
if (!componentRect)
|
|
87
84
|
continue;
|
|
@@ -113,7 +110,7 @@ function PlaceholderDropZones({ scale, iframe, size, }) {
|
|
|
113
110
|
return zones.map((zone, index) => {
|
|
114
111
|
const x = Math.min(pageViewContext.viewport.width - 20, Math.max(20, zone.position.x * (scale || 1)));
|
|
115
112
|
const y = Math.min(scrollHeight - 20, Math.max(20 - pageViewContext.scroll, zone.position.y * (scale || 1)));
|
|
116
|
-
return ((
|
|
113
|
+
return (_jsx(PlaceholderDropZone, { placeholder: zone.placeholder, spotPosition: {
|
|
117
114
|
x,
|
|
118
115
|
y,
|
|
119
116
|
}, index: zone.index, size: size, spotPositionElement: zone.element, spotPositionAnchor: zone.anchor, parentName: zone.placeholder.parentComponent?.name, description: zone.description || undefined }, index));
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PageViewContext } from "./pageViewContext";
|
|
2
|
+
import { EditorConfiguration } from "../../config/types";
|
|
3
|
+
export declare function DeviceToolbar({ pageViewContext, configuration, }: {
|
|
4
|
+
pageViewContext: PageViewContext;
|
|
5
|
+
configuration: EditorConfiguration;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|