@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,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function EditButton({ field, onEdit, className = "" }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("button", { type: "button", onClick: onEdit, className: `inline-flex items-center justify-center p-1 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${className}`, "aria-label": `Edit ${field.name || "field"}`, title: `Edit ${field.name || "field"}`, children: (0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: (0, jsx_runtime_1.jsx)("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function EditButton({ field, onEdit, className = "" }) {
|
|
3
|
+
return (_jsx("button", { type: "button", onClick: onEdit, className: `inline-flex items-center justify-center p-1 text-sm font-medium text-gray-700 bg-white border border-gray-300 rounded-md shadow-sm hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500 ${className}`, "aria-label": `Edit ${field.name || "field"}`, title: `Edit ${field.name || "field"}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: _jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M15.232 5.232l3.536 3.536m-2.036-5.036a2.5 2.5 0 113.536 3.536L6.5 21.036H3v-3.572L16.732 3.732z" }) }) }));
|
|
7
4
|
}
|
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
const [fieldValue, setFieldValue] = (0, react_1.useState)("");
|
|
9
|
-
const [isEditing, setIsEditing] = (0, react_1.useState)(false);
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { Editor } from "primereact/editor";
|
|
4
|
+
export function FieldEditor({ field, onFieldEdited, }) {
|
|
5
|
+
const [fieldValue, setFieldValue] = useState("");
|
|
6
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
7
|
+
useEffect(() => {
|
|
11
8
|
if (isEditing) {
|
|
12
9
|
const value = field.value;
|
|
13
10
|
setFieldValue(typeof value === "string" ? value : "");
|
|
14
11
|
}
|
|
15
12
|
}, [isEditing]);
|
|
16
13
|
if (!isEditing) {
|
|
17
|
-
return ((
|
|
14
|
+
return (_jsxs("div", { onClick: () => setIsEditing(true), className: "cursor-pointer mb-2", children: [_jsxs("div", { className: "font-bold text-gray-900", children: [field.name, ":"] }), _jsx("div", { className: "text-gray-700 [&_ul]:list-disc [&_ul]:pl-5 [&_li]:my-1 [&_p]:my-1", dangerouslySetInnerHTML: { __html: field.value } })] }));
|
|
18
15
|
}
|
|
19
16
|
const isRichText = field.type === "Rich Text";
|
|
20
17
|
const handleSave = () => {
|
|
@@ -26,5 +23,5 @@ function FieldEditor({ field, onFieldEdited, }) {
|
|
|
26
23
|
const handleCancel = () => {
|
|
27
24
|
setIsEditing(false);
|
|
28
25
|
};
|
|
29
|
-
return ((
|
|
26
|
+
return (_jsx("div", { className: "fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-1000", children: _jsxs("div", { className: "bg-white rounded-lg shadow-xl p-6 w-full max-w-lg", children: [_jsxs("h3", { className: "text-lg font-medium text-gray-900 mb-4", children: ["Edit ", field.name || "Field"] }), isRichText ? (_jsx("div", { className: "mb-4", children: _jsx(Editor, { className: "w-full h-64 p-2 border border-gray-300 rounded-md", value: fieldValue, onTextChange: (e) => setFieldValue(e.htmlValue || "") }) })) : (_jsx("div", { className: "mb-4", children: _jsx("textarea", { className: "w-full p-2 border border-gray-300 rounded-md", value: fieldValue, onChange: (e) => setFieldValue(e.target.value) }) })), _jsxs("div", { className: "flex justify-end space-x-3", children: [_jsx("button", { type: "button", onClick: handleCancel, className: "inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Cancel" }), _jsx("button", { type: "button", onClick: handleSave, className: "inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-blue-600 hover:bg-blue-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500", children: "Save" })] })] }) }));
|
|
30
27
|
}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const Icons_1 = require("../../editor/ui/Icons");
|
|
6
|
-
const Icons_2 = require("../../editor/ui/Icons");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "primereact/utils";
|
|
3
|
+
import { SparkleIconBig } from "../../editor/ui/Icons";
|
|
4
|
+
import { SparkleIconSmall } from "../../editor/ui/Icons";
|
|
7
5
|
function Generate({ title }) {
|
|
8
6
|
console.log("Generate", title);
|
|
9
|
-
return ((
|
|
7
|
+
return (_jsx("div", { className: classNames("flex flex-col justify-center items-center h-full transition-all duration-300 animate-fadeIn text-canvas-pink"), children: _jsxs("div", { className: "mb-20", children: [_jsx("div", { className: "flex justify-center ml-20 animate-sparkle w-auto min-h-10 delay-700", children: _jsx(SparkleIconSmall, {}) }), _jsx("div", { className: "flex justify-center ml-5 animate-sparkle w-auto min-h-20", children: _jsx(SparkleIconBig, {}) }), _jsx("div", { className: "flex justify-center mr-20 animate-sparkle w-auto min-h-10 delay-500", children: _jsx(SparkleIconSmall, {}) })] }) }));
|
|
10
8
|
}
|
|
11
|
-
|
|
9
|
+
export default Generate;
|
|
@@ -1,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const button_1 = require("primereact/button");
|
|
14
|
-
const dialog_1 = require("primereact/dialog");
|
|
15
|
-
const ImagesStep = (props) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { ScrollingContentTree } from "../../editor/ScrollingContentTree";
|
|
4
|
+
import { Splitter } from "../../editor/ui/Splitter";
|
|
5
|
+
import { useEditContext } from "../../editor/client/editContext";
|
|
6
|
+
import { executePrompt, executeSearch } from "../../editor/services/aiService";
|
|
7
|
+
import { createWizardAiContext } from "../service";
|
|
8
|
+
import { ActionButton } from "../../components/ActionButton";
|
|
9
|
+
import { classNames } from "primereact/utils";
|
|
10
|
+
import { Button } from "primereact/button";
|
|
11
|
+
import { Dialog } from "primereact/dialog";
|
|
12
|
+
export const ImagesStep = (props) => {
|
|
16
13
|
const mediaRootId = "3D6658D8-A0BF-4E75-B3E2-D050FABCF4E1";
|
|
17
|
-
const [selectedFolderId, setSelectedFolderId] =
|
|
18
|
-
const [isLoading, setIsLoading] =
|
|
19
|
-
const [error, setError] =
|
|
20
|
-
const editContext =
|
|
14
|
+
const [selectedFolderId, setSelectedFolderId] = useState(mediaRootId);
|
|
15
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
+
const [error, setError] = useState(null);
|
|
17
|
+
const editContext = useEditContext();
|
|
21
18
|
const propName = props.step.propertyName || "images";
|
|
22
|
-
const [showFolderDialog, setShowFolderDialog] =
|
|
23
|
-
const [selectedFolder, setSelectedFolder] =
|
|
24
|
-
|
|
19
|
+
const [showFolderDialog, setShowFolderDialog] = useState(false);
|
|
20
|
+
const [selectedFolder, setSelectedFolder] = useState();
|
|
21
|
+
useEffect(() => {
|
|
25
22
|
if (props.data[propName]?.length > 0) {
|
|
26
23
|
props.setStepCompleted(true);
|
|
27
24
|
}
|
|
@@ -35,7 +32,7 @@ const ImagesStep = (props) => {
|
|
|
35
32
|
}));
|
|
36
33
|
try {
|
|
37
34
|
// First, ask AI for keywords based on the content
|
|
38
|
-
const aiPromptResult = await
|
|
35
|
+
const aiPromptResult = await executePrompt([
|
|
39
36
|
{
|
|
40
37
|
content: `You are an AI assistant for building a web page. You will later have to create images for the page.
|
|
41
38
|
Please anaylze the provided data and suggest a number of images and specific keywords per image. The keywords will be used to find matching images in the image library.
|
|
@@ -45,11 +42,11 @@ const ImagesStep = (props) => {
|
|
|
45
42
|
name: "system",
|
|
46
43
|
role: "system",
|
|
47
44
|
},
|
|
48
|
-
], editContext,
|
|
45
|
+
], editContext, createWizardAiContext, [""], true, undefined, "o3-mini-low");
|
|
49
46
|
const images = JSON.parse(aiPromptResult.content).images;
|
|
50
47
|
// Create an array of promises for all search operations
|
|
51
48
|
const searchPromises = images.map(async (image) => {
|
|
52
|
-
const searchResult = await
|
|
49
|
+
const searchResult = await executeSearch({
|
|
53
50
|
query: image.keywords.join(" "),
|
|
54
51
|
rootItemIds: selectedFolderId ? [selectedFolderId] : undefined,
|
|
55
52
|
editContext: editContext,
|
|
@@ -97,7 +94,7 @@ const ImagesStep = (props) => {
|
|
|
97
94
|
setIsLoading(false);
|
|
98
95
|
}
|
|
99
96
|
};
|
|
100
|
-
|
|
97
|
+
useEffect(() => {
|
|
101
98
|
const loadFolder = async () => {
|
|
102
99
|
if (selectedFolderId) {
|
|
103
100
|
const item = await editContext?.itemsRepository.getItem({
|
|
@@ -116,25 +113,25 @@ const ImagesStep = (props) => {
|
|
|
116
113
|
{
|
|
117
114
|
name: "Settings",
|
|
118
115
|
defaultSize: 400,
|
|
119
|
-
content: ((
|
|
116
|
+
content: (_jsxs("div", { className: "flex h-full flex-col gap-2 pr-6 pb-4", children: [_jsxs("div", { className: "relative mb-2 rounded-md border border-gray-400 bg-white p-4", children: [_jsx("div", { className: "mb-2 text-sm font-bold text-gray-800", children: "Image library folder" }), selectedFolder && (_jsx("div", { className: "mb-2 text-sm text-gray-500", children: selectedFolder.path })), _jsx(Button, { label: "Change Folder", onClick: () => {
|
|
120
117
|
setShowFolderDialog(true);
|
|
121
|
-
} }), (
|
|
118
|
+
} }), _jsx(Dialog, { header: "Select Folder", visible: showFolderDialog, onHide: () => {
|
|
122
119
|
setShowFolderDialog(false);
|
|
123
|
-
}, style: { width: "50vw", height: "50vh" }, children: (
|
|
120
|
+
}, style: { width: "50vw", height: "50vh" }, children: _jsx("div", { className: "relative flex h-full flex-col", children: _jsx(ScrollingContentTree, { rootItemId: mediaRootId, onSelectionChange: (selection) => {
|
|
124
121
|
const selectedNode = selection[0];
|
|
125
122
|
if (selectedNode)
|
|
126
123
|
setSelectedFolderId(selectedNode.id);
|
|
127
124
|
else
|
|
128
125
|
setSelectedFolderId(mediaRootId);
|
|
129
126
|
setShowFolderDialog(false);
|
|
130
|
-
} }) }) })] }), (
|
|
127
|
+
} }) }) })] }), _jsx(ActionButton, { onClick: findMatchingImages, isLoading: isLoading, disabled: isLoading, loadingText: "Searching...", children: "Find Matching Images" })] })),
|
|
131
128
|
},
|
|
132
129
|
{
|
|
133
130
|
name: "Images",
|
|
134
131
|
defaultSize: "auto",
|
|
135
|
-
content: ((
|
|
132
|
+
content: (_jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx("div", { className: "flex flex-col gap-4 p-4 pt-0", children: _jsxs("div", { className: "flex items-center gap-4", children: [error && _jsx("div", { className: "text-red-500", children: error }), props.data[propName]?.length > 0 && (_jsx("div", { className: "flex flex-col gap-4", children: props.data[propName]?.map((image, index) => (_jsxs("span", { className: classNames("rounded border border-gray-400 bg-white p-4 text-sm", index % 2 === 0
|
|
136
133
|
? "animate-fadeRight"
|
|
137
|
-
: "animate-fadeLeft"), children: [(
|
|
134
|
+
: "animate-fadeLeft"), children: [_jsx("div", { className: "mb-3 text-lg", children: image.title }), _jsx("div", { className: "flex flex-wrap gap-5", children: image.options?.map((option, thumbnailIndex) => (_jsxs("div", { className: "relative flex h-28 w-28 cursor-pointer items-center justify-center border border-gray-400", onClick: () => {
|
|
138
135
|
props.setData((prevData) => ({
|
|
139
136
|
...prevData,
|
|
140
137
|
[propName]: prevData[propName].map((img, imgIndex) => ({
|
|
@@ -149,11 +146,10 @@ const ImagesStep = (props) => {
|
|
|
149
146
|
: option),
|
|
150
147
|
})),
|
|
151
148
|
}));
|
|
152
|
-
}, children: [(
|
|
149
|
+
}, children: [_jsx("img", { src: option.thumbUrl, alt: option.name }, thumbnailIndex), _jsx("div", { className: classNames("peer ring-offset-background focus-visible:ring-ring pointer-events-none absolute right-1 bottom-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full border-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50", option.selected
|
|
153
150
|
? "text-canvas-pink border-canvas-pink bg-white"
|
|
154
|
-
: ""), children: option.selected && ((
|
|
151
|
+
: ""), children: option.selected && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M20 6 9 17l-5-5" }) })) })] }, thumbnailIndex))) })] }, index))) }))] }) }) })),
|
|
155
152
|
},
|
|
156
153
|
];
|
|
157
|
-
return (
|
|
154
|
+
return _jsx(Splitter, { panels: panels });
|
|
158
155
|
};
|
|
159
|
-
exports.ImagesStep = ImagesStep;
|
|
@@ -1,33 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const ComponentTypesSelector_1 = require("./ComponentTypesSelector");
|
|
14
|
-
function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalState, setInternalState, }) {
|
|
15
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../../editor/client/editContext";
|
|
4
|
+
import { executePrompt } from "../../editor/services/aiService";
|
|
5
|
+
import { createWizardAiContext } from "../service";
|
|
6
|
+
import { Components } from "./Components";
|
|
7
|
+
import { Splitter } from "../../editor/ui/Splitter";
|
|
8
|
+
import { convertPageSchemaToWizardComponents } from "./schema";
|
|
9
|
+
import { ActionButton } from "../../components/ActionButton";
|
|
10
|
+
import { ComponentTypeSelector } from "./ComponentTypesSelector";
|
|
11
|
+
export function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalState, setInternalState, }) {
|
|
12
|
+
const editContext = useEditContext();
|
|
16
13
|
const abortController = new AbortController();
|
|
17
14
|
const localAbortController = abortController || new AbortController();
|
|
18
|
-
const [isLoading, setIsLoading] =
|
|
19
|
-
const [message, setMessage] =
|
|
20
|
-
const [selectedComponentTypes, setSelectedComponentTypes] =
|
|
21
|
-
const [customInstructions, setCustomInstructions] =
|
|
15
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
16
|
+
const [message, setMessage] = useState();
|
|
17
|
+
const [selectedComponentTypes, setSelectedComponentTypes] = useState([]);
|
|
18
|
+
const [customInstructions, setCustomInstructions] = useState();
|
|
22
19
|
if (!editContext) {
|
|
23
20
|
return null;
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
useEffect(() => {
|
|
26
23
|
if (data.pageModel?.components?.length) {
|
|
27
24
|
setStepCompleted(!isLoading);
|
|
28
25
|
}
|
|
29
26
|
}, [data.pageModel, isLoading]);
|
|
30
|
-
|
|
27
|
+
useEffect(() => {
|
|
31
28
|
setCustomInstructions(step.instructions);
|
|
32
29
|
}, []);
|
|
33
30
|
const createLayout = async () => {
|
|
@@ -38,8 +35,8 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
|
|
|
38
35
|
? JSON.parse(wizard.schema)
|
|
39
36
|
: wizard.schema;
|
|
40
37
|
// Filter the schema based on selected component types and placeholders
|
|
41
|
-
const filteredSchema =
|
|
42
|
-
const result = await
|
|
38
|
+
const filteredSchema = convertPageSchemaToWizardComponents(schema, selectedComponentTypes);
|
|
39
|
+
const result = await executePrompt([
|
|
43
40
|
{
|
|
44
41
|
content: `${customInstructions?.trim()} Reply with a json object of type PageModel = { name: string; metaDescription: string; components: Component[]; message: string; };
|
|
45
42
|
Component = { name: string, type: string; fields: Field[]; placeholder?: string; children?: Component[]; };
|
|
@@ -56,7 +53,7 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
|
|
|
56
53
|
name: "system",
|
|
57
54
|
role: "system",
|
|
58
55
|
},
|
|
59
|
-
], editContext,
|
|
56
|
+
], editContext, createWizardAiContext, [""], true, { signal: localAbortController.signal }, "o3-mini-low", (response) => {
|
|
60
57
|
try {
|
|
61
58
|
const newLayout = JSON.parse(response.content);
|
|
62
59
|
if (newLayout) {
|
|
@@ -89,7 +86,7 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
|
|
|
89
86
|
const regenerateLayout = () => {
|
|
90
87
|
createLayout();
|
|
91
88
|
};
|
|
92
|
-
|
|
89
|
+
useEffect(() => {
|
|
93
90
|
if (!selectedComponentTypes.length)
|
|
94
91
|
return;
|
|
95
92
|
// Only set custom instructions if they're not already set or if step.instructions has changed
|
|
@@ -99,22 +96,22 @@ function LayoutStep({ wizard, step, data, setData, setStepCompleted, internalSta
|
|
|
99
96
|
}, [step.instructions, selectedComponentTypes]);
|
|
100
97
|
// Custom instructions panel
|
|
101
98
|
const customInstructionsPanel = () => {
|
|
102
|
-
return ((
|
|
99
|
+
return (_jsxs("div", { className: "mb-4", children: [_jsx("h3", { className: "text-sm font-bold", children: "Instructions" }), _jsx("div", { className: "mb-3 text-xs text-gray-500", children: "Provide guidance for the AI when generating your layout" }), _jsx("textarea", { value: customInstructions, onChange: (e) => setCustomInstructions(e.target.value), placeholder: "Example: Make it modern and minimalist. Focus on images. Include a hero section at the top.", className: "w-full px-3 py-2 border border-gray-300 rounded text-sm focus:outline-none focus:ring-1 focus:ring-blue-500 h-48", disabled: isLoading })] }));
|
|
103
100
|
};
|
|
104
101
|
const settingsPanel = {
|
|
105
102
|
name: "Settings",
|
|
106
103
|
collapsible: false,
|
|
107
104
|
defaultSize: 450,
|
|
108
|
-
content: ((
|
|
105
|
+
content: (_jsxs("div", { className: "absolute inset-0 overflow-auto flex flex-col h-full pr-4", children: [customInstructionsPanel(), _jsx(ComponentTypeSelector, { selectedComponentTypes: selectedComponentTypes, setSelectedComponentTypes: setSelectedComponentTypes, schema: wizard.schema, data: data, setData: setData, step: step }), _jsxs("div", { className: "flex gap-2", children: [_jsx(ActionButton, { onClick: regenerateLayout, disabled: isLoading || selectedComponentTypes.length === 0, isLoading: isLoading, loadingText: "Working", className: "flex-1", children: data.pageModel ? "Regenerate Layout" : "Generate Layout" }), isLoading && (_jsxs("button", { onClick: () => {
|
|
109
106
|
localAbortController.abort();
|
|
110
107
|
setIsLoading(false);
|
|
111
|
-
}, className: "bg-red-500 text-white px-2 py-1 rounded text-xs hover:bg-red-600 flex items-center gap-1", children: [(
|
|
108
|
+
}, className: "bg-red-500 text-white px-2 py-1 rounded text-xs hover:bg-red-600 flex items-center gap-1", children: [_jsx("span", { className: "pi pi-times" }), "Abort"] }))] }), _jsx("div", { className: "text-xs text-gray-500 p-2", children: message })] })),
|
|
112
109
|
};
|
|
113
110
|
const layoutPanel = {
|
|
114
111
|
name: "Layout",
|
|
115
112
|
defaultSize: "auto",
|
|
116
113
|
collapsible: false,
|
|
117
|
-
content: ((
|
|
114
|
+
content: (_jsx("div", { className: "absolute inset-2 flex flex-col justify-center items-center text-gray-600", children: _jsx(Components, { pageModel: data.pageModel, onComponentRemoved: () => setData({ ...data }), onFieldEdited: () => setData({ ...data }), thumbnails: internalState.thumbnails, setInternalState: setInternalState }) })),
|
|
118
115
|
};
|
|
119
|
-
return ((
|
|
116
|
+
return (_jsx(Splitter, { panels: [settingsPanel, layoutPanel], localStorageKey: "editor.page-wizard.layout" }));
|
|
120
117
|
}
|
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
19
|
-
const [options, setOptions] = (0, react_1.useState)([]);
|
|
20
|
-
const [loading, setLoading] = (0, react_1.useState)(false);
|
|
21
|
-
const [error, setError] = (0, react_1.useState)(null);
|
|
22
|
-
const [selectedOptions, setSelectedOptions] = (0, react_1.useState)([]);
|
|
23
|
-
const [instructions, setInstructions] = (0, react_1.useState)(step.instructions);
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { useEditContext } from "../../editor/client/editContext";
|
|
4
|
+
import { executePrompt } from "../../editor/services/aiService";
|
|
5
|
+
import { createWizardAiContext } from "../service";
|
|
6
|
+
import { classNames } from "primereact/utils";
|
|
7
|
+
import { Splitter } from "../../editor/ui/Splitter";
|
|
8
|
+
import { InputTextarea } from "primereact/inputtextarea";
|
|
9
|
+
import { ActionButton } from "../../components/ActionButton";
|
|
10
|
+
import Generate from "./Generate";
|
|
11
|
+
export function SelectStep({ step, data, setData, setStepCompleted, internalState, setInternalState, }) {
|
|
12
|
+
const editContext = useEditContext();
|
|
13
|
+
const [options, setOptions] = useState([]);
|
|
14
|
+
const [loading, setLoading] = useState(false);
|
|
15
|
+
const [error, setError] = useState(null);
|
|
16
|
+
const [selectedOptions, setSelectedOptions] = useState([]);
|
|
17
|
+
const [instructions, setInstructions] = useState(step.instructions);
|
|
24
18
|
// Get the property name from the step or use "choice" as default
|
|
25
19
|
const propertyName = step.propertyName || "selectedOptions";
|
|
26
|
-
|
|
20
|
+
useEffect(() => {
|
|
27
21
|
if (data[propertyName]?.length) {
|
|
28
22
|
setStepCompleted(true);
|
|
29
23
|
}
|
|
30
24
|
}, [data]);
|
|
31
25
|
// Initialize the property in data
|
|
32
|
-
|
|
26
|
+
useEffect(() => {
|
|
33
27
|
if (!data[propertyName]) {
|
|
34
28
|
setData((prevData) => ({
|
|
35
29
|
...prevData,
|
|
@@ -46,7 +40,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
|
|
|
46
40
|
// Create a prompt based on step instructions and data
|
|
47
41
|
const prompt = `${instructions}\n\nCurrent data: ${JSON.stringify(data, null, 2)}`;
|
|
48
42
|
// Call the executePrompt function with the prompt
|
|
49
|
-
const result = await
|
|
43
|
+
const result = await executePrompt([
|
|
50
44
|
{
|
|
51
45
|
content: `You are a helpful assistant that generates options for a wizard select step.
|
|
52
46
|
Generate a JSON array of options based on the instructions and current data.
|
|
@@ -60,7 +54,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
|
|
|
60
54
|
name: "user",
|
|
61
55
|
role: "user",
|
|
62
56
|
},
|
|
63
|
-
], editContext,
|
|
57
|
+
], editContext, createWizardAiContext, [""], true, undefined, step.aiModel || "o3-mini-low");
|
|
64
58
|
// Parse the result and set options
|
|
65
59
|
if (result && result.content) {
|
|
66
60
|
try {
|
|
@@ -92,7 +86,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
|
|
|
92
86
|
}
|
|
93
87
|
};
|
|
94
88
|
// Generate options on component mount
|
|
95
|
-
|
|
89
|
+
useEffect(() => {
|
|
96
90
|
if (internalState[step.id + "options"]?.length > 0) {
|
|
97
91
|
setOptions(internalState[step.id + "options"]);
|
|
98
92
|
return;
|
|
@@ -100,7 +94,7 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
|
|
|
100
94
|
generateOptions();
|
|
101
95
|
}, [editContext, step.instructions, internalState]);
|
|
102
96
|
// Sync data[propertyName] with selectedOptions state
|
|
103
|
-
|
|
97
|
+
useEffect(() => {
|
|
104
98
|
const currentSelections = data[propertyName] || [];
|
|
105
99
|
setSelectedOptions(currentSelections.map((option) => option.id));
|
|
106
100
|
}, [data, propertyName]);
|
|
@@ -127,24 +121,24 @@ function SelectStep({ step, data, setData, setStepCompleted, internalState, setI
|
|
|
127
121
|
});
|
|
128
122
|
};
|
|
129
123
|
if (error) {
|
|
130
|
-
return ((
|
|
124
|
+
return (_jsxs("div", { className: "text-red-500 p-4", children: [error, _jsx("button", { className: "ml-4 px-2 py-1 bg-blue-500 text-white rounded", onClick: () => window.location.reload(), children: "Retry" })] }));
|
|
131
125
|
}
|
|
132
126
|
const optionsPanel = {
|
|
133
127
|
name: "options",
|
|
134
128
|
defaultSize: "auto",
|
|
135
|
-
content: ((
|
|
129
|
+
content: (_jsxs("div", { className: "p-4 h-full", children: [loading && (_jsx("div", { className: "flex items-center justify-center h-full", children: _jsx(Generate, { title: "Generating options..." }) })), !loading && (_jsx("div", { children: options.length === 0 ? (_jsx("div", { className: "text-gray-500 p-4", children: "No options available. Try refreshing the page." })) : (options.map((option, index) => {
|
|
136
130
|
const isSelected = selectedOptions.includes(option.id);
|
|
137
|
-
return ((
|
|
131
|
+
return (_jsxs("div", { className: classNames("mb-3 flex items-center p-3 rounded bg-white border-2", index % 2 === 0
|
|
138
132
|
? "animate-fadeRight"
|
|
139
133
|
: "animate-fadeLeft", isSelected
|
|
140
134
|
? "text-canvas-pink border-canvas-pink"
|
|
141
|
-
: "text-gray-600 border-gray-300"), onClick: () => handleOptionSelect(option), children: [(
|
|
135
|
+
: "text-gray-600 border-gray-300"), onClick: () => handleOptionSelect(option), children: [_jsxs("div", { className: "flex flex-col flex-1 cursor-pointer", children: [_jsx("div", { className: "font-medium", children: option.title }), _jsx("div", { className: "text-xs text-gray-600", children: option.description })] }), isSelected && (_jsx("div", { className: "text-canvas-pink ml-2", children: "\u2713" }))] }, option.id));
|
|
142
136
|
})) }))] })),
|
|
143
137
|
};
|
|
144
138
|
const settingsPanel = {
|
|
145
139
|
name: "settings",
|
|
146
140
|
defaultSize: 400,
|
|
147
|
-
content: ((
|
|
141
|
+
content: (_jsxs("div", { className: "flex flex-col gap-2 pr-6", children: [_jsx("h3", { className: "text-sm font-bold", children: "Instructions" }), _jsx(InputTextarea, { className: "h-48 text-sm", value: instructions, onChange: (e) => setInstructions(e.target.value), placeholder: "Enter instructions for the options" }), _jsx(ActionButton, { onClick: generateOptions, isLoading: loading, disabled: loading, loadingText: "Thinking...", children: "Regenerate Options" })] })),
|
|
148
142
|
};
|
|
149
|
-
return (
|
|
143
|
+
return _jsx(Splitter, { panels: [settingsPanel, optionsPanel] });
|
|
150
144
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { WizardSchemaComponent, PageSchema } from "../PageWizard";
|
|
2
|
+
export declare function convertPageSchemaToWizardComponents(pageSchema: PageSchema, whitelist: string[]): WizardSchemaComponent[];
|
|
3
|
+
/**
|
|
4
|
+
* Finds a placeholder (by its name) where a child component of type `childComponentType`
|
|
5
|
+
* can be placed inside a parent of type `parentComponentType`. For a parentComponentType
|
|
6
|
+
* equal to "root" (case‑insensitive), the function searches among top‑level placeholders.
|
|
7
|
+
*
|
|
8
|
+
* @param schema - The PageSchema (an array of SchemaPlaceholders).
|
|
9
|
+
* @param parentComponentType - The type of the parent component, or "root" to indicate top‑level.
|
|
10
|
+
* @param childComponentType - The type of the child component to place.
|
|
11
|
+
* @returns The name of a valid placeholder or undefined if none is found.
|
|
12
|
+
*/
|
|
13
|
+
export declare function getPlaceholder(schema: PageSchema, parentComponentType: string, childComponentType: string): string | undefined;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.convertPageSchemaToWizardComponents = convertPageSchemaToWizardComponents;
|
|
4
|
-
exports.getPlaceholder = getPlaceholder;
|
|
5
|
-
function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
|
|
1
|
+
export function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
|
|
6
2
|
const componentMap = new Map();
|
|
7
3
|
/**
|
|
8
4
|
* Recursively processes a SchemaComponent.
|
|
@@ -83,7 +79,7 @@ function convertPageSchemaToWizardComponents(pageSchema, whitelist) {
|
|
|
83
79
|
* @param childComponentType - The type of the child component to place.
|
|
84
80
|
* @returns The name of a valid placeholder or undefined if none is found.
|
|
85
81
|
*/
|
|
86
|
-
function getPlaceholder(schema, parentComponentType, childComponentType) {
|
|
82
|
+
export function getPlaceholder(schema, parentComponentType, childComponentType) {
|
|
87
83
|
// Check for the special case where we want to place at the root level.
|
|
88
84
|
if (parentComponentType.toLowerCase() === "root") {
|
|
89
85
|
// First, look for a top-level placeholder that already contains a component
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
import { Wizard, WizardPageComponent, WizardPageModel } from "../PageWizard";
|
|
3
|
+
import { ItemDescriptor } from "../../editor/pageModel";
|
|
4
|
+
export declare function usePageCreator(pageItem: ItemDescriptor | undefined, wizard: Wizard, setPageModel: Dispatch<SetStateAction<WizardPageModel>>): {
|
|
5
|
+
createComponentsRecursively: (components: WizardPageComponent[], parentComponentType: string, parentComponentId?: string, parentPath?: number[]) => Promise<void>;
|
|
6
|
+
};
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
function usePageCreator(pageItem, wizard, setPageModel) {
|
|
11
|
-
const editContext = (0, editContext_2.useEditContext)();
|
|
12
|
-
const editContextRef = (0, editContext_1.useEditContextRef)();
|
|
1
|
+
import { useMemo } from "react";
|
|
2
|
+
import { useEditContextRef } from "../../editor/client/editContext";
|
|
3
|
+
import { useEditContext } from "../../editor/client/editContext";
|
|
4
|
+
import { getComponentById } from "../../editor/componentTreeHelper";
|
|
5
|
+
import { getPlaceholder } from "./schema";
|
|
6
|
+
import { normalizeGuid } from "../../editor/utils";
|
|
7
|
+
export function usePageCreator(pageItem, wizard, setPageModel) {
|
|
8
|
+
const editContext = useEditContext();
|
|
9
|
+
const editContextRef = useEditContextRef();
|
|
13
10
|
// Function to build a map of all components from wizard schema
|
|
14
11
|
const buildComponentTypeMap = () => {
|
|
15
12
|
const componentMap = new Map();
|
|
@@ -46,7 +43,7 @@ function usePageCreator(pageItem, wizard, setPageModel) {
|
|
|
46
43
|
return { componentMap, fieldIdsMap };
|
|
47
44
|
};
|
|
48
45
|
// Build the component type to typeId map
|
|
49
|
-
const mappings =
|
|
46
|
+
const mappings = useMemo(() => buildComponentTypeMap(), [wizard.schema]);
|
|
50
47
|
const createNewComponent = async (component, parentComponentType, index, parentComponentId) => {
|
|
51
48
|
if (!editContext)
|
|
52
49
|
return undefined;
|
|
@@ -56,9 +53,9 @@ function usePageCreator(pageItem, wizard, setPageModel) {
|
|
|
56
53
|
// 1. Add the component to the placeholder
|
|
57
54
|
console.log(`Adding component ${component.type} (typeId: ${typeId}) to placeholder ${parentComponentId} at index ${index}`);
|
|
58
55
|
const placeholderKey = component.placeholder ||
|
|
59
|
-
|
|
56
|
+
getPlaceholder(wizard.schema, parentComponentType, component.type);
|
|
60
57
|
const placeholderId = parentComponentId
|
|
61
|
-
? placeholderKey + "_" +
|
|
58
|
+
? placeholderKey + "_" + normalizeGuid(parentComponentId)
|
|
62
59
|
: placeholderKey;
|
|
63
60
|
if (!placeholderId) {
|
|
64
61
|
console.error("Placeholder ID not found", component);
|
|
@@ -78,7 +75,7 @@ function usePageCreator(pageItem, wizard, setPageModel) {
|
|
|
78
75
|
const maxAttempts = 40;
|
|
79
76
|
while (!createdComponent && attempts < maxAttempts) {
|
|
80
77
|
if (editContextRef.current?.page) {
|
|
81
|
-
createdComponent =
|
|
78
|
+
createdComponent = getComponentById(componentId, editContextRef.current?.page);
|
|
82
79
|
if (createdComponent) {
|
|
83
80
|
break;
|
|
84
81
|
}
|