@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,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const editContext_1 = require("../client/editContext");
|
|
10
|
-
function ItemEditor({ item, compareToItem, }) {
|
|
11
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Button } from "primereact/button";
|
|
3
|
+
import { EditorWarnings } from "../EditorWarnings";
|
|
4
|
+
import { FieldList } from "../FieldList";
|
|
5
|
+
import { ItemInfo } from "../ItemInfo";
|
|
6
|
+
import { useEditContext } from "../client/editContext";
|
|
7
|
+
export function ItemEditor({ item, compareToItem, }) {
|
|
8
|
+
const editContext = useEditContext();
|
|
12
9
|
if (!editContext)
|
|
13
10
|
return;
|
|
14
11
|
if (!item)
|
|
@@ -18,7 +15,7 @@ function ItemEditor({ item, compareToItem, }) {
|
|
|
18
15
|
const pageValidators = editContext.validationResult?.find((x) => x.item.id === item?.id &&
|
|
19
16
|
x.item.language === item?.language &&
|
|
20
17
|
x.item.version === item?.version)?.results || [];
|
|
21
|
-
return ((
|
|
18
|
+
return (_jsxs("div", { className: "absolute inset-0 overflow-y-auto", children: [_jsx(EditorWarnings, { item: item }), _jsx(ItemInfo, { item: item }), editContext.itemVersions.length > 0 && (_jsx(FieldList, { fields: [{ fields: Object.values(item.fields) }], validators: pageValidators.filter((x) => x.itemId === item.id), showStandardFieldsEnabled: true, compareToFields: compareToItem?.fields })), editContext.itemVersions.length === 0 && (_jsx("div", { className: "flex justify-center p-4", children: _jsxs(Button, { onClick: async () => {
|
|
22
19
|
await editContext.operations.createVersion(item.descriptor);
|
|
23
20
|
}, children: ["Create First Version (", item.language, ")"] }) }))] }));
|
|
24
21
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PageViewContext } from "../page-viewer/pageViewContext";
|
|
2
|
+
import { ItemDescriptor } from "../pageModel";
|
|
3
|
+
export declare function SingleEditView({ pageViewContext, itemDescriptor, mode, name, }: {
|
|
4
|
+
pageViewContext: PageViewContext;
|
|
5
|
+
itemDescriptor?: ItemDescriptor;
|
|
6
|
+
mode: "edit" | "compare" | "view";
|
|
7
|
+
name: string;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
12
|
-
const [item, setItem] = (0, react_1.useState)(undefined);
|
|
13
|
-
(0, react_2.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
import { PageViewer } from "../page-viewer/PageViewer";
|
|
6
|
+
import { ItemEditor } from "./ItemEditor";
|
|
7
|
+
export function SingleEditView({ pageViewContext, itemDescriptor, mode, name, }) {
|
|
8
|
+
const editContext = useEditContext();
|
|
9
|
+
const [item, setItem] = useState(undefined);
|
|
10
|
+
useEffect(() => {
|
|
14
11
|
async function loadItem() {
|
|
15
12
|
if (!itemDescriptor)
|
|
16
13
|
return;
|
|
@@ -20,6 +17,6 @@ function SingleEditView({ pageViewContext, itemDescriptor, mode, name, }) {
|
|
|
20
17
|
loadItem();
|
|
21
18
|
}, [itemDescriptor]);
|
|
22
19
|
if ((item && !item.hasLayout) || pageViewContext.device === "")
|
|
23
|
-
return (
|
|
24
|
-
return ((
|
|
20
|
+
return _jsx(ItemEditor, { item: item });
|
|
21
|
+
return (_jsx(PageViewer, { mode: mode, pageViewContext: pageViewContext, showFormEditor: true, name: name, followEditsDefault: true }));
|
|
25
22
|
}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -1,22 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.configureForUser = exports.Editor = void 0;
|
|
18
|
-
__exportStar(require("./config/types"), exports);
|
|
19
|
-
var Editor_1 = require("./editor/Editor");
|
|
20
|
-
Object.defineProperty(exports, "Editor", { enumerable: true, get: function () { return Editor_1.Editor; } });
|
|
21
|
-
var config_1 = require("./config/config");
|
|
22
|
-
Object.defineProperty(exports, "configureForUser", { enumerable: true, get: function () { return config_1.configureForUser; } });
|
|
1
|
+
export * from "./config/types";
|
|
2
|
+
export { Editor } from "./editor/Editor";
|
|
3
|
+
export { configureForUser } from "./config/config";
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Thumbnail } from "../editor/media-selector/Thumbnails";
|
|
2
|
+
export type Wizard = {
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
steps: WizardStep[];
|
|
7
|
+
icon: string;
|
|
8
|
+
schema: PageSchema;
|
|
9
|
+
templateId: string;
|
|
10
|
+
};
|
|
11
|
+
export type PageSchema = SchemaPlaceholder[];
|
|
12
|
+
export type SchemaComponent = {
|
|
13
|
+
type: string;
|
|
14
|
+
typeId: string;
|
|
15
|
+
fields: SchemaField[];
|
|
16
|
+
placeholders: SchemaPlaceholder[];
|
|
17
|
+
};
|
|
18
|
+
export type SchemaPlaceholder = {
|
|
19
|
+
name: string;
|
|
20
|
+
components: SchemaComponent[];
|
|
21
|
+
};
|
|
22
|
+
export type SchemaField = {
|
|
23
|
+
id: string;
|
|
24
|
+
name: string;
|
|
25
|
+
type: string;
|
|
26
|
+
};
|
|
27
|
+
export type WizardSchemaComponent = {
|
|
28
|
+
type: string;
|
|
29
|
+
fields: WizardSchemaField[];
|
|
30
|
+
availableParentPlaceholders?: string[];
|
|
31
|
+
allowedChildrenComponentTypes: string[];
|
|
32
|
+
allowedOnRoot: boolean;
|
|
33
|
+
};
|
|
34
|
+
export type WizardSchemaField = {
|
|
35
|
+
name: string;
|
|
36
|
+
type: string;
|
|
37
|
+
};
|
|
38
|
+
export type WizardStep = {
|
|
39
|
+
id: string;
|
|
40
|
+
name: string;
|
|
41
|
+
description: string;
|
|
42
|
+
[property: string]: string;
|
|
43
|
+
};
|
|
44
|
+
export type WizardData = {
|
|
45
|
+
[key: string]: any;
|
|
46
|
+
};
|
|
47
|
+
export type WizardPageModel = {
|
|
48
|
+
components: WizardPageComponent[];
|
|
49
|
+
name: string;
|
|
50
|
+
metaDescription: string;
|
|
51
|
+
metaKeywords: string;
|
|
52
|
+
message?: string;
|
|
53
|
+
images?: Thumbnail[];
|
|
54
|
+
};
|
|
55
|
+
export type WizardPageComponent = {
|
|
56
|
+
id: string;
|
|
57
|
+
name: string;
|
|
58
|
+
type: string;
|
|
59
|
+
fields: WizardField[];
|
|
60
|
+
children?: WizardPageComponent[];
|
|
61
|
+
description: string;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
};
|
|
64
|
+
export type WizardField = {
|
|
65
|
+
name: string;
|
|
66
|
+
value: string;
|
|
67
|
+
type: string;
|
|
68
|
+
writtenValue?: string;
|
|
69
|
+
};
|
|
70
|
+
export declare function PageWizard(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const [wizard, setWizard] = (0, react_1.useState)(null);
|
|
14
|
-
const [parentItem, setParentItem] = (0, react_1.useState)();
|
|
15
|
-
const searchParams = (0, navigation_1.useSearchParams)();
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../editor/client/editContext";
|
|
3
|
+
import { SelectWizard } from "./SelectWizard";
|
|
4
|
+
import { useState, useEffect } from "react";
|
|
5
|
+
import { WizardSteps } from "./WizardSteps";
|
|
6
|
+
import { getWizards } from "./service"; // Adjust import as needed
|
|
7
|
+
import { useSearchParams } from "next/navigation";
|
|
8
|
+
export function PageWizard() {
|
|
9
|
+
const editContext = useEditContext();
|
|
10
|
+
const [wizard, setWizard] = useState(null);
|
|
11
|
+
const [parentItem, setParentItem] = useState();
|
|
12
|
+
const searchParams = useSearchParams();
|
|
16
13
|
// Load all wizards and check URL param on mount
|
|
17
|
-
|
|
14
|
+
useEffect(() => {
|
|
18
15
|
if (!editContext?.currentItemDescriptor)
|
|
19
16
|
return;
|
|
20
|
-
|
|
17
|
+
getWizards(editContext?.currentItemDescriptor).then((availableWizards) => {
|
|
21
18
|
// Check for wizard ID in URL
|
|
22
19
|
const params = new URLSearchParams(window.location.search);
|
|
23
20
|
const wizardName = params.get("wizard");
|
|
@@ -49,11 +46,11 @@ function PageWizard() {
|
|
|
49
46
|
if (!editContext?.currentItemDescriptor)
|
|
50
47
|
return null;
|
|
51
48
|
if (!wizard) {
|
|
52
|
-
return ((
|
|
49
|
+
return (_jsx("div", { className: "fixed inset-0 z-1000 bg-white", children: _jsx(SelectWizard, { parentItem: parentItem, setParentItem: setParentItem, onSelect: handleSelect }) }));
|
|
53
50
|
}
|
|
54
51
|
if (!parentItem)
|
|
55
52
|
return null;
|
|
56
|
-
return ((
|
|
53
|
+
return (_jsx("div", { className: "fixed inset-0 z-1000 bg-white text-gray-950", children: _jsx(WizardSteps, { wizard: wizard, onCancel: handleCancel, parentItem: parentItem, onLanguageSelected: (language) => {
|
|
57
54
|
setParentItem({
|
|
58
55
|
...parentItem,
|
|
59
56
|
language: language.languageCode,
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ItemDescriptor } from "../editor/pageModel";
|
|
2
|
+
import { Wizard } from "./PageWizard";
|
|
3
|
+
export declare function SelectWizard({ parentItem, setParentItem, onSelect, }: {
|
|
4
|
+
parentItem?: ItemDescriptor;
|
|
5
|
+
setParentItem: (item: ItemDescriptor) => void;
|
|
6
|
+
onSelect: (wizard: Wizard) => void;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
14
|
-
const [wizards, setWizards] = (0, react_1.useState)([]);
|
|
15
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { getWizards } from "./service";
|
|
4
|
+
import { ScrollingContentTree } from "../editor/ScrollingContentTree";
|
|
5
|
+
import { Splitter } from "../editor/ui/Splitter";
|
|
6
|
+
import { PageWizardLogo } from "../editor/ui/Icons";
|
|
7
|
+
import { SimpleIconButton } from "../editor/ui/SimpleIconButton";
|
|
8
|
+
import { useEditContext } from "../editor/client/editContext";
|
|
9
|
+
export function SelectWizard({ parentItem, setParentItem, onSelect, }) {
|
|
10
|
+
const editContext = useEditContext();
|
|
11
|
+
const [wizards, setWizards] = useState([]);
|
|
12
|
+
useEffect(() => {
|
|
16
13
|
const fetchWizards = async () => {
|
|
17
14
|
if (!parentItem)
|
|
18
15
|
return;
|
|
19
|
-
const wizards = await
|
|
16
|
+
const wizards = await getWizards(parentItem);
|
|
20
17
|
setWizards(wizards);
|
|
21
18
|
};
|
|
22
19
|
fetchWizards();
|
|
@@ -24,7 +21,7 @@ function SelectWizard({ parentItem, setParentItem, onSelect, }) {
|
|
|
24
21
|
const treePanel = {
|
|
25
22
|
name: "tree",
|
|
26
23
|
defaultSize: 450,
|
|
27
|
-
content: ((
|
|
24
|
+
content: (_jsx("div", { className: "flex h-full gap-2", children: _jsx(ScrollingContentTree, { selectedItemId: parentItem?.id, onSelectionChange: (x) => {
|
|
28
25
|
setParentItem({
|
|
29
26
|
...parentItem,
|
|
30
27
|
id: x.id,
|
|
@@ -37,7 +34,7 @@ function SelectWizard({ parentItem, setParentItem, onSelect, }) {
|
|
|
37
34
|
name: "wizard",
|
|
38
35
|
defaultSize: "auto",
|
|
39
36
|
collapsible: false,
|
|
40
|
-
content: ((
|
|
37
|
+
content: (_jsxs("div", { className: "absolute inset-2 overflow-auto", children: [!parentItem && (_jsx("div", { className: "flex h-full items-center justify-center text-center text-gray-500", children: "Select a parent item on the left!" })), parentItem && wizards?.length === 0 && (_jsx("div", { className: "text-center text-gray-500", children: "No wizards found" })), parentItem && wizards.length > 0 && (_jsx("div", { className: "mx-2 flex flex-wrap gap-3", children: wizards.map((wizard) => (_jsxs("div", { className: "flex cursor-pointer items-center gap-2 rounded-md border border-gray-300 p-4 hover:bg-gray-100", onClick: () => onSelect(wizard), children: [_jsx("img", { src: wizard.icon, alt: wizard.name, className: "h-10 w-10" }), _jsxs("div", { children: [_jsx("h2", { className: "text-lg", children: wizard.name }), _jsx("p", { className: "text-sm", children: wizard.description })] })] }, wizard.id))) }))] })),
|
|
41
38
|
};
|
|
42
|
-
return ((
|
|
39
|
+
return (_jsxs("div", { className: "flex h-full flex-col", children: [_jsxs("h1", { className: "bg-shape-black flex w-full items-center gap-2 p-4 text-xl font-bold text-white", children: [_jsx(PageWizardLogo, {}), "Select Wizard", _jsx(SimpleIconButton, { icon: "pi pi-times", className: "ml-auto", onClick: () => editContext?.switchView("editor"), label: "Cancel" })] }), _jsx("div", { className: "flex gap-2 bg-gray-100 px-4 py-3 text-sm text-gray-600", children: "First select a parent item, then select a wizard to create a new page." }), _jsx(Splitter, { panels: [treePanel, wizardPanel] })] }));
|
|
43
40
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Wizard } from "./PageWizard";
|
|
2
|
+
import { ItemDescriptor, Language } from "../editor/pageModel";
|
|
3
|
+
export declare function WizardSteps({ wizard, onCancel, parentItem, }: {
|
|
4
|
+
wizard: Wizard;
|
|
5
|
+
onCancel: () => void;
|
|
6
|
+
parentItem: ItemDescriptor;
|
|
7
|
+
onLanguageSelected: (language: Language) => void;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const react_dom_1 = require("react-dom");
|
|
10
|
-
const editContext_1 = require("../editor/client/editContext");
|
|
11
|
-
const utils_1 = require("primereact/utils");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { Button } from "primereact/button";
|
|
4
|
+
import { PageWizardLogo } from "../editor/ui/Icons";
|
|
5
|
+
import { SimpleIconButton } from "../editor/ui/SimpleIconButton";
|
|
6
|
+
import { flushSync } from "react-dom";
|
|
7
|
+
import { useEditContext } from "../editor/client/editContext";
|
|
8
|
+
import { classNames } from "primereact/utils";
|
|
12
9
|
// import { LanguageSelector } from "../editor/menubar/LanguageSelector";
|
|
13
|
-
function WizardSteps({ wizard, onCancel, parentItem, }) {
|
|
14
|
-
const [currentStepIndex, setCurrentStepIndex] =
|
|
15
|
-
const [data, setData] =
|
|
16
|
-
const [pageModel, setPageModel] =
|
|
10
|
+
export function WizardSteps({ wizard, onCancel, parentItem, }) {
|
|
11
|
+
const [currentStepIndex, setCurrentStepIndex] = useState(0);
|
|
12
|
+
const [data, setData] = useState({});
|
|
13
|
+
const [pageModel, setPageModel] = useState({
|
|
17
14
|
components: [],
|
|
18
15
|
name: "",
|
|
19
16
|
metaDescription: "",
|
|
20
17
|
metaKeywords: "",
|
|
21
18
|
});
|
|
22
|
-
const editContext =
|
|
23
|
-
const [internalState, setInternalState] =
|
|
24
|
-
const [stepCompleted, setStepCompleted] =
|
|
19
|
+
const editContext = useEditContext();
|
|
20
|
+
const [internalState, setInternalState] = useState({});
|
|
21
|
+
const [stepCompleted, setStepCompleted] = useState(-1);
|
|
25
22
|
const getCurrentStep = () => {
|
|
26
23
|
const step = wizard.steps[currentStepIndex];
|
|
27
24
|
if (!step)
|
|
@@ -38,7 +35,7 @@ function WizardSteps({ wizard, onCancel, parentItem, }) {
|
|
|
38
35
|
// Get the appropriate component based on the extracted name
|
|
39
36
|
const StepComponent = config.pageWizard.stepComponents[componentName];
|
|
40
37
|
if (StepComponent) {
|
|
41
|
-
return ((
|
|
38
|
+
return (_jsx(StepComponent, { step: wizard.steps[currentStepIndex], data: data, setData: setData, setPageModel: setPageModel, pageModel: pageModel, wizard: wizard, setStepCompleted: (completed) => {
|
|
42
39
|
if (completed) {
|
|
43
40
|
setStepCompleted((prev) => Math.max(prev, currentStepIndex));
|
|
44
41
|
}
|
|
@@ -51,7 +48,7 @@ function WizardSteps({ wizard, onCancel, parentItem, }) {
|
|
|
51
48
|
};
|
|
52
49
|
const switchStep = (index) => {
|
|
53
50
|
document.startViewTransition(() => {
|
|
54
|
-
|
|
51
|
+
flushSync(() => {
|
|
55
52
|
setCurrentStepIndex(index);
|
|
56
53
|
});
|
|
57
54
|
});
|
|
@@ -59,13 +56,13 @@ function WizardSteps({ wizard, onCancel, parentItem, }) {
|
|
|
59
56
|
const currentStep = wizard.steps[currentStepIndex];
|
|
60
57
|
if (!currentStep)
|
|
61
58
|
return null;
|
|
62
|
-
return ((
|
|
59
|
+
return (_jsxs("div", { className: "flex flex-col flex-1 h-full justify-stretch ", children: [_jsxs("div", { className: "flex flex-col border-b border-gray-200 bg-gray-100 flex-1", children: [_jsxs("div", { className: "flex gap-2 items-center bg-shape-black text-white p-4 py-4", children: [_jsx(PageWizardLogo, {}), " ", _jsx("h1", { className: "text-xl font-bold text-white", children: wizard.name }), wizard.description && (_jsxs("div", { className: "text-gray-200", children: ["- ", wizard.description] })), _jsx(SimpleIconButton, { icon: "pi pi-times", className: "ml-auto", onClick: onCancel, label: "Cancel" })] }), _jsxs("div", { className: "flex gap-2 flex-1", children: [_jsx("div", { className: "flex flex-col animate-fadeLeft transition-all duration-900 bg-white", children: _jsx("div", { className: "flex flex-col text-sm text-gray-500 px-5 py-4", children: wizard.steps.map((step, index) => (_jsxs("div", { className: classNames("flex gap-4 items-center mb-5", currentStepIndex > index && "cursor-pointer"), onClick: () => index < currentStepIndex ? switchStep(index) : undefined, children: [_jsx("span", { className: classNames("border-2 rounded-full w-7 h-7 p-2 flex items-center justify-center text-xs font-medium text-activeStepColor", currentStepIndex >= index
|
|
63
60
|
? "border-canvas-red text-canvas-red"
|
|
64
|
-
: "border-gray-400"), children: index + 1 }), (
|
|
61
|
+
: "border-gray-400"), children: index + 1 }), _jsx("div", { className: classNames("w-auto opacity-100", currentStepIndex === index
|
|
65
62
|
? "text-canvas-red font-semibold text-base"
|
|
66
63
|
: currentStepIndex >= index
|
|
67
64
|
? "text-gray-600 text-sm"
|
|
68
|
-
: "text-gray-400 text-sm"), children: step.name })] }, step.id))) }) }), (
|
|
65
|
+
: "text-gray-400 text-sm"), children: step.name })] }, step.id))) }) }), _jsxs("div", { className: "flex-1 flex flex-col px-8 pt-9 bg-secondary lg:pr-20 xl:pr-32 container animate-fadeIn transition-all duration-500", children: [_jsx("div", { className: "text-4xl font-semibold", children: currentStep?.name }), currentStep?.description && (_jsx("div", { className: "text-base mt-2 font-light", children: currentStep.description })), _jsx("div", { className: "flex-1 pt-8", children: getCurrentStep() })] })] })] }), _jsxs("div", { className: "flex justify-between border-t border-gray-200 p-3", children: [_jsx("div", { children: currentStepIndex > 0 && (_jsx(Button, { icon: "pi pi-arrow-left mr-2", onClick: () => switchStep(currentStepIndex - 1), disabled: currentStepIndex === 0, children: wizard.steps[currentStepIndex - 1]?.name })) }), _jsxs("div", { children: [currentStepIndex < wizard.steps.length - 1 && (_jsx(Button, { icon: "pi pi-arrow-right mr-2", disabled: stepCompleted < currentStepIndex, onClick: () => switchStep(currentStepIndex + 1), children: wizard.steps[currentStepIndex + 1]?.name })), currentStepIndex === wizard.steps.length - 1 && (_jsx(Button, { icon: "pi pi-check", disabled: stepCompleted < currentStepIndex, onClick: () => {
|
|
69
66
|
editContext?.switchView("editor");
|
|
70
67
|
}, label: "Finish", className: "ml-2" }))] })] })] }));
|
|
71
68
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { EditContextType } from "../editor/client/editContext";
|
|
2
|
+
import { ItemDescriptor } from "../editor/pageModel";
|
|
3
|
+
import { Wizard } from "./PageWizard";
|
|
4
|
+
export declare function getWizards(parentItem: ItemDescriptor): Promise<Wizard[]>;
|
|
5
|
+
export declare function createWizardAiContext({ editContext, }: {
|
|
6
|
+
editContext: EditContextType;
|
|
7
|
+
}): {
|
|
8
|
+
endpoint: string;
|
|
9
|
+
promptData: {
|
|
10
|
+
itemid: string | undefined;
|
|
11
|
+
language: string | undefined;
|
|
12
|
+
version: number | undefined;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export declare function wipeComponents(pageItem: ItemDescriptor): Promise<unknown>;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.createWizardAiContext = createWizardAiContext;
|
|
5
|
-
exports.wipeComponents = wipeComponents;
|
|
6
|
-
const serviceHelper_1 = require("../editor/services/serviceHelper");
|
|
7
|
-
async function getWizards(parentItem) {
|
|
8
|
-
const result = await (0, serviceHelper_1.post)("/alpaca/editor/page-wizard/wizards", parentItem);
|
|
1
|
+
import { post } from "../editor/services/serviceHelper";
|
|
2
|
+
export async function getWizards(parentItem) {
|
|
3
|
+
const result = await post("/alpaca/editor/page-wizard/wizards", parentItem);
|
|
9
4
|
return result.data;
|
|
10
5
|
}
|
|
11
|
-
function createWizardAiContext({ editContext, }) {
|
|
6
|
+
export function createWizardAiContext({ editContext, }) {
|
|
12
7
|
const aiPromptUrl = "/alpaca/editor/page-wizard/prompt";
|
|
13
8
|
return {
|
|
14
9
|
// configuration.services.editorService.baseUrl +
|
|
@@ -20,7 +15,7 @@ function createWizardAiContext({ editContext, }) {
|
|
|
20
15
|
},
|
|
21
16
|
};
|
|
22
17
|
}
|
|
23
|
-
async function wipeComponents(pageItem) {
|
|
24
|
-
const result = await
|
|
18
|
+
export async function wipeComponents(pageItem) {
|
|
19
|
+
const result = await post("/alpaca/editor/page-wizard/wipePage", pageItem);
|
|
25
20
|
return result.data;
|
|
26
21
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { CommandContext } from "../editor/commands/commands";
|
|
2
|
+
import { ItemDescriptor } from "../editor/pageModel";
|
|
3
|
+
import { Wizard } from "./PageWizard";
|
|
4
|
+
export declare const startPageWizardCommand: {
|
|
5
|
+
id: string;
|
|
6
|
+
label: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
execute: (context: CommandContext<{
|
|
9
|
+
wizard: Wizard;
|
|
10
|
+
item: ItemDescriptor;
|
|
11
|
+
}>) => Promise<void>;
|
|
12
|
+
disabled: () => boolean;
|
|
13
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.startPageWizardCommand = void 0;
|
|
4
|
-
exports.startPageWizardCommand = {
|
|
1
|
+
export const startPageWizardCommand = {
|
|
5
2
|
id: "startWizard",
|
|
6
3
|
label: "Start Wizard",
|
|
7
4
|
icon: "pi pi-magic",
|
|
@@ -1,32 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
const [createdPageDescriptor, setCreatedPageDescriptor] = (0, react_1.useState)();
|
|
20
|
-
const [pageLoaded, setPageLoaded] = (0, react_1.useState)(false);
|
|
21
|
-
const [fullParentItem, setFullParentItem] = (0, react_1.useState)();
|
|
22
|
-
const [isBuilding, setIsBuilding] = (0, react_1.useState)(false);
|
|
23
|
-
const [validationMessage, setValidationMessage] = (0, react_1.useState)();
|
|
24
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Splitter } from "../../editor/ui/Splitter";
|
|
3
|
+
import { useEditContext } from "../../editor/client/editContext";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { PageViewer } from "../../editor/page-viewer/PageViewer";
|
|
6
|
+
import { useDebouncedCallback } from "use-debounce";
|
|
7
|
+
import { getChildren } from "../../editor/services/contentService";
|
|
8
|
+
import { ActionButton } from "../../components/ActionButton";
|
|
9
|
+
import Generate from "./Generate";
|
|
10
|
+
import { usePageCreator } from "./usePageCreator";
|
|
11
|
+
export function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, }) {
|
|
12
|
+
const editContext = useEditContext();
|
|
13
|
+
const [createdPageDescriptor, setCreatedPageDescriptor] = useState();
|
|
14
|
+
const [pageLoaded, setPageLoaded] = useState(false);
|
|
15
|
+
const [fullParentItem, setFullParentItem] = useState();
|
|
16
|
+
const [isBuilding, setIsBuilding] = useState(false);
|
|
17
|
+
const [validationMessage, setValidationMessage] = useState();
|
|
18
|
+
useEffect(() => {
|
|
25
19
|
if (createdPageDescriptor &&
|
|
26
20
|
createdPageDescriptor.id === editContext?.page?.item?.descriptor.id)
|
|
27
21
|
setPageLoaded(true);
|
|
28
22
|
}, [editContext?.page]);
|
|
29
|
-
|
|
23
|
+
useEffect(() => {
|
|
30
24
|
const loadParentItem = async () => {
|
|
31
25
|
if (!parentItem)
|
|
32
26
|
return;
|
|
@@ -35,7 +29,7 @@ function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, })
|
|
|
35
29
|
};
|
|
36
30
|
loadParentItem();
|
|
37
31
|
}, [parentItem]);
|
|
38
|
-
|
|
32
|
+
useEffect(() => {
|
|
39
33
|
const buildComponents = async () => {
|
|
40
34
|
try {
|
|
41
35
|
console.log("Building components", createdPageDescriptor, editContext?.page);
|
|
@@ -76,7 +70,7 @@ function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, })
|
|
|
76
70
|
return;
|
|
77
71
|
let valid = !!wizard.templateId && pageModel.name.trim().length >= 3;
|
|
78
72
|
if (valid) {
|
|
79
|
-
const children = await
|
|
73
|
+
const children = await getChildren(parentItem.id, editContext?.sessionId ?? "", [], false, editContext?.contentEditorItem?.language || "en");
|
|
80
74
|
if (children.find((x) => x.name.toLocaleLowerCase() ===
|
|
81
75
|
pageModel.name.trim().toLocaleLowerCase())) {
|
|
82
76
|
valid = false;
|
|
@@ -93,8 +87,8 @@ function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, })
|
|
|
93
87
|
setValidationMessage(undefined);
|
|
94
88
|
return valid;
|
|
95
89
|
};
|
|
96
|
-
const checkNameValidDebounced =
|
|
97
|
-
|
|
90
|
+
const checkNameValidDebounced = useDebouncedCallback(async () => checkName(), 500);
|
|
91
|
+
useEffect(() => {
|
|
98
92
|
checkNameValidDebounced();
|
|
99
93
|
}, [pageModel.name]);
|
|
100
94
|
const createPage = () => {
|
|
@@ -119,12 +113,12 @@ function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, })
|
|
|
119
113
|
}
|
|
120
114
|
}, 1);
|
|
121
115
|
};
|
|
122
|
-
const pageCreator =
|
|
116
|
+
const pageCreator = usePageCreator(createdPageDescriptor, wizard, (pageModel) => setData({ ...data, pageModel }));
|
|
123
117
|
const settingsPanel = {
|
|
124
118
|
name: "settings",
|
|
125
119
|
defaultSize: 450,
|
|
126
120
|
collapsible: false,
|
|
127
|
-
content: ((
|
|
121
|
+
content: (_jsxs("div", { className: "pr-6", children: [_jsxs("div", { className: "mb-4", children: [_jsx("div", { className: "text-sm font-medium mb-1", children: "Target Parent Item" }), _jsx("div", { className: "mb-4 text-xs break-after-all", children: fullParentItem?.path })] }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "pageName", className: "block text-sm font-medium mb-1", children: "Page Name" }), _jsx("input", { id: "pageName", type: "text", className: "w-full p-2 border rounded text-sm", value: pageModel.name, onChange: (e) => handleInputChange("name", e.target.value), placeholder: "Enter page name" }), validationMessage && (_jsx("div", { className: "mt-2 text-sm text-red-500", children: validationMessage }))] }), _jsxs("div", { className: "mb-4", children: [_jsx("label", { htmlFor: "metaDescription", className: "block text-sm font-medium mb-1", children: "Meta Description" }), _jsx("textarea", { id: "metaDescription", className: "w-full p-2 border rounded min-h-[100px] text-sm", value: pageModel.metaDescription, onChange: (e) => handleInputChange("metaDescription", e.target.value), placeholder: "Enter meta description" })] }), _jsx(ActionButton, { disabled: isBuilding || !!validationMessage, className: "flex-1 w-full", onClick: () => {
|
|
128
122
|
createPage();
|
|
129
123
|
}, isLoading: isBuilding, loadingText: "Working", children: "Create Page" })] })),
|
|
130
124
|
};
|
|
@@ -132,7 +126,7 @@ function BuildPageStep({ data, setData, parentItem, wizard, setStepCompleted, })
|
|
|
132
126
|
name: "content",
|
|
133
127
|
defaultSize: "auto",
|
|
134
128
|
collapsible: false,
|
|
135
|
-
content: ((
|
|
129
|
+
content: (_jsxs(_Fragment, { children: [_jsx("div", { className: pageLoaded ? "h-full" : "h-0", children: _jsx(PageViewer, { name: "single", mode: editContext?.previewMode ? "view" : "edit", showFormEditor: false, followEditsDefault: true, pageViewContext: editContext.pageView }) }), isBuilding && !pageLoaded && (_jsx("div", { className: "flex items-center justify-center h-full", children: _jsx(Generate, { title: "Building page..." }) }))] })),
|
|
136
130
|
};
|
|
137
|
-
return (
|
|
131
|
+
return _jsx(Splitter, { panels: [settingsPanel, contentPanel] });
|
|
138
132
|
}
|