@alpaca-editor/core 1.0.3767 → 1.0.3769
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type ExecutionResult<T> = {
|
|
2
|
+
type: "success" | "error" | "unauthorized";
|
|
3
|
+
summary?: string;
|
|
4
|
+
details?: string;
|
|
5
|
+
response: Response;
|
|
6
|
+
data?: T;
|
|
7
|
+
};
|
|
8
|
+
export declare function post<T>(url: string, body: any, session?: string): Promise<ExecutionResult<T>>;
|
|
9
|
+
export declare function get<T>(url: string, session?: string): Promise<ExecutionResult<T>>;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.post = post;
|
|
4
|
-
exports.get = get;
|
|
5
|
-
async function post(url, body, session) {
|
|
1
|
+
export async function post(url, body, session) {
|
|
6
2
|
if (session)
|
|
7
3
|
url += "?sessionId=" + session;
|
|
8
4
|
const response = await fetch(url, {
|
|
@@ -15,7 +11,7 @@ async function post(url, body, session) {
|
|
|
15
11
|
});
|
|
16
12
|
return handleResponse(response);
|
|
17
13
|
}
|
|
18
|
-
async function get(url, session) {
|
|
14
|
+
export async function get(url, session) {
|
|
19
15
|
if (session)
|
|
20
16
|
url += "?sessionId=" + session;
|
|
21
17
|
const response = await fetch(url, {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const serviceHelper_1 = require("./serviceHelper");
|
|
5
|
-
function getSystemStatus() {
|
|
6
|
-
return (0, serviceHelper_1.get)("/alpaca/editor/status");
|
|
1
|
+
import { get } from "./serviceHelper";
|
|
2
|
+
export function getSystemStatus() {
|
|
3
|
+
return get("/alpaca/editor/status");
|
|
7
4
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TranslationStatus } from "../../config/types";
|
|
2
|
+
import { LanguagesAndVersions } from "../../types";
|
|
3
|
+
export declare function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider }: {
|
|
4
|
+
itemId: string;
|
|
5
|
+
targetLanguage: string;
|
|
6
|
+
sourceLanguage: string;
|
|
7
|
+
sessionId: string;
|
|
8
|
+
provider: string;
|
|
9
|
+
}): Promise<import("./serviceHelper").ExecutionResult<LanguagesAndVersions>>;
|
|
10
|
+
export declare function getTranslationStatus(itemId: string): Promise<import("./serviceHelper").ExecutionResult<TranslationStatus[]>>;
|
|
11
|
+
export declare function getTranslationProviders(): Promise<import("./serviceHelper").ExecutionResult<string[]>>;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.getTranslationStatus = getTranslationStatus;
|
|
5
|
-
exports.getTranslationProviders = getTranslationProviders;
|
|
6
|
-
const serviceHelper_1 = require("./serviceHelper");
|
|
7
|
-
async function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider }) {
|
|
8
|
-
return await (0, serviceHelper_1.post)("/alpaca/editor/translation/requestTranslation", { itemId, targetLanguage, sourceLanguage, sessionId, provider });
|
|
1
|
+
import { get, post } from "./serviceHelper";
|
|
2
|
+
export async function requestTranslation({ itemId, targetLanguage, sourceLanguage, sessionId, provider }) {
|
|
3
|
+
return await post("/alpaca/editor/translation/requestTranslation", { itemId, targetLanguage, sourceLanguage, sessionId, provider });
|
|
9
4
|
}
|
|
10
|
-
async function getTranslationStatus(itemId) {
|
|
11
|
-
return await
|
|
5
|
+
export async function getTranslationStatus(itemId) {
|
|
6
|
+
return await get(`/alpaca/editor/translation/getTranslations?itemId=${itemId}`);
|
|
12
7
|
}
|
|
13
|
-
async function getTranslationProviders() {
|
|
14
|
-
return await
|
|
8
|
+
export async function getTranslationProviders() {
|
|
9
|
+
return await get(`/alpaca/editor/translation/providers`);
|
|
15
10
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import "server-only";
|
|
2
|
+
export type FetchOptions = {
|
|
3
|
+
tags?: string[];
|
|
4
|
+
revalidate?: number | false;
|
|
5
|
+
};
|
|
6
|
+
export type FetchResult = {
|
|
7
|
+
status: number;
|
|
8
|
+
error?: string;
|
|
9
|
+
data?: any;
|
|
10
|
+
headers: Headers;
|
|
11
|
+
};
|
|
12
|
+
export type ApiConfig = {
|
|
13
|
+
apiKey?: string;
|
|
14
|
+
headers?: Headers;
|
|
15
|
+
};
|
|
16
|
+
export declare function apiGet(route: string, config?: ApiConfig): Promise<FetchResult>;
|
|
17
|
+
export declare function apiPostObject(route: string, object: any, config?: ApiConfig): Promise<FetchResult>;
|
|
18
|
+
export declare function getApiKey(): string | undefined;
|
|
19
|
+
export declare function getApiHeaders(): Promise<Headers>;
|
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.apiGet = apiGet;
|
|
7
|
-
exports.apiPostObject = apiPostObject;
|
|
8
|
-
exports.getApiKey = getApiKey;
|
|
9
|
-
exports.getApiHeaders = getApiHeaders;
|
|
10
|
-
require("server-only");
|
|
11
|
-
const headers_1 = require("next/headers");
|
|
12
|
-
const axios_1 = __importDefault(require("axios"));
|
|
13
|
-
async function apiGet(route, config) {
|
|
1
|
+
import "server-only";
|
|
2
|
+
import { headers } from "next/headers";
|
|
3
|
+
import axios from "axios";
|
|
4
|
+
export async function apiGet(route, config) {
|
|
14
5
|
const url = process.env.LAYOUT_SERVICE_URL + route;
|
|
15
6
|
const requestHeaders = getRequestHeaders(config);
|
|
16
7
|
try {
|
|
17
|
-
const response = await
|
|
8
|
+
const response = await axios.get(url, {
|
|
18
9
|
headers: requestHeaders,
|
|
19
10
|
});
|
|
20
11
|
return {
|
|
@@ -53,12 +44,12 @@ function getRequestHeaders(config) {
|
|
|
53
44
|
requestHeaders["x-api-key"] = config?.apiKey ?? getApiKey();
|
|
54
45
|
return requestHeaders;
|
|
55
46
|
}
|
|
56
|
-
async function apiPostObject(route, object, config) {
|
|
47
|
+
export async function apiPostObject(route, object, config) {
|
|
57
48
|
const url = process.env.LAYOUT_SERVICE_URL + route;
|
|
58
49
|
const requestHeaders = getRequestHeaders(config);
|
|
59
50
|
const body = JSON.stringify(object);
|
|
60
51
|
try {
|
|
61
|
-
const response = await
|
|
52
|
+
const response = await axios.post(url, body, {
|
|
62
53
|
headers: requestHeaders,
|
|
63
54
|
});
|
|
64
55
|
return {
|
|
@@ -95,7 +86,7 @@ async function apiPostObject(route, object, config) {
|
|
|
95
86
|
}
|
|
96
87
|
}
|
|
97
88
|
}
|
|
98
|
-
function getApiKey() {
|
|
89
|
+
export function getApiKey() {
|
|
99
90
|
const apiKey = process.env.ALPACA_HEADLESS_API_KEY || process.env.API_KEY;
|
|
100
91
|
if (!apiKey)
|
|
101
92
|
console.log("ERROR: Could not find API key environment variable: ALPACA_HEADLESS_API_KEY");
|
|
@@ -110,8 +101,8 @@ function convertAxiosHeaders(headers) {
|
|
|
110
101
|
}
|
|
111
102
|
return convertedHeaders;
|
|
112
103
|
}
|
|
113
|
-
async function getApiHeaders() {
|
|
114
|
-
const requestHeaders = await
|
|
104
|
+
export async function getApiHeaders() {
|
|
105
|
+
const requestHeaders = await headers();
|
|
115
106
|
const apiHeaders = new Headers();
|
|
116
107
|
apiHeaders.set("Cookie", requestHeaders.get("Cookie") || "");
|
|
117
108
|
apiHeaders.set("Authorization", requestHeaders.get("Authorization") || "");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ApiConfig } from "../services-server/api";
|
|
2
|
+
export type ExecuteGraphQLParams = {
|
|
3
|
+
query: string;
|
|
4
|
+
tags?: string[];
|
|
5
|
+
host?: string;
|
|
6
|
+
path?: string;
|
|
7
|
+
language?: string;
|
|
8
|
+
mode?: string;
|
|
9
|
+
itemId?: string;
|
|
10
|
+
version?: number;
|
|
11
|
+
revalidate?: number;
|
|
12
|
+
siteName?: string;
|
|
13
|
+
sessionId?: string;
|
|
14
|
+
schema?: string;
|
|
15
|
+
apiConfig?: ApiConfig;
|
|
16
|
+
};
|
|
17
|
+
export declare function executeGraphQLQuery({ query, host, path, language, mode, itemId, version, siteName, schema, sessionId, apiConfig, }: ExecuteGraphQLParams): Promise<{
|
|
18
|
+
status: number;
|
|
19
|
+
errors: any;
|
|
20
|
+
data?: undefined;
|
|
21
|
+
} | {
|
|
22
|
+
data: any;
|
|
23
|
+
status: number;
|
|
24
|
+
errors: any;
|
|
25
|
+
}>;
|
|
26
|
+
export declare function getGraphQLSchema({ id, apiConfig, }: {
|
|
27
|
+
id: string;
|
|
28
|
+
apiConfig: ApiConfig;
|
|
29
|
+
}): Promise<any>;
|
|
@@ -1,9 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.executeGraphQLQuery = executeGraphQLQuery;
|
|
4
|
-
exports.getGraphQLSchema = getGraphQLSchema;
|
|
5
|
-
const api_1 = require("../services-server/api");
|
|
6
|
-
async function executeGraphQLQuery({ query, host, path, language, mode, itemId, version,
|
|
1
|
+
import { apiGet, apiPostObject } from "../services-server/api";
|
|
2
|
+
export async function executeGraphQLQuery({ query, host, path, language, mode, itemId, version,
|
|
7
3
|
// tags,
|
|
8
4
|
// revalidate,
|
|
9
5
|
siteName, schema, sessionId, apiConfig, }) {
|
|
@@ -23,7 +19,7 @@ siteName, schema, sessionId, apiConfig, }) {
|
|
|
23
19
|
Schema: schema,
|
|
24
20
|
};
|
|
25
21
|
//TODO: cache:
|
|
26
|
-
const response = await
|
|
22
|
+
const response = await apiPostObject(url, request, apiConfig);
|
|
27
23
|
if (response.status !== 200) {
|
|
28
24
|
return { status: response.status, errors: getErrors(response) };
|
|
29
25
|
}
|
|
@@ -46,9 +42,9 @@ function getErrors(response) {
|
|
|
46
42
|
return [{ message: response.error }];
|
|
47
43
|
return undefined;
|
|
48
44
|
}
|
|
49
|
-
async function getGraphQLSchema({ id, apiConfig, }) {
|
|
45
|
+
export async function getGraphQLSchema({ id, apiConfig, }) {
|
|
50
46
|
let url = "/alpaca/headless/graphql/schema?id=" + id;
|
|
51
|
-
const response = await
|
|
47
|
+
const response = await apiGet(url, apiConfig);
|
|
52
48
|
if (response.status !== 200) {
|
|
53
49
|
return { status: response.status, error: response.error };
|
|
54
50
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ComponentPalette({}: {}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const [filter, setFilter] = (0, react_1.useState)("");
|
|
15
|
-
const filterRef = (0, react_1.useRef)(null);
|
|
16
|
-
const insertOptions = (0, insertOptions_1.getInsertOptionsForCurrentSelection)(editContext);
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getInsertOptionsForCurrentSelection } from "../utils/insertOptions";
|
|
3
|
+
import { ArrowDownIcon } from "../ui/Icons";
|
|
4
|
+
import { getAbsoluteIconUrl } from "../utils";
|
|
5
|
+
import { classNames } from "primereact/utils";
|
|
6
|
+
import { useEditContext } from "../client/editContext";
|
|
7
|
+
import { InputText } from "primereact/inputtext";
|
|
8
|
+
import { useState, useRef } from "react";
|
|
9
|
+
export function ComponentPalette({}) {
|
|
10
|
+
const editContext = useEditContext();
|
|
11
|
+
const [filter, setFilter] = useState("");
|
|
12
|
+
const filterRef = useRef(null);
|
|
13
|
+
const insertOptions = getInsertOptionsForCurrentSelection(editContext);
|
|
17
14
|
const insertOptionsByGroup = insertOptions.reduce((acc, value) => {
|
|
18
15
|
const group = value.group || "Other";
|
|
19
16
|
if (!acc[group]) {
|
|
@@ -22,13 +19,13 @@ function ComponentPalette({}) {
|
|
|
22
19
|
acc[group].push(value);
|
|
23
20
|
return acc;
|
|
24
21
|
}, {});
|
|
25
|
-
return ((
|
|
22
|
+
return (_jsx("div", { className: "h-full relative tour-component-palette", children: _jsxs("div", { className: "overflow-y-auto absolute inset-0", children: [_jsx("div", { className: "p-4", children: _jsx(InputText, { ref: filterRef, className: "w-full text-sm", placeholder: "Filter components", onChange: (e) => setFilter(e.target.value) }) }), Object.keys(insertOptionsByGroup)
|
|
26
23
|
.sort()
|
|
27
24
|
.map((group, index) => {
|
|
28
25
|
const options = insertOptionsByGroup[group].filter((x) => !x.isHidden).filter((x) => x.name.toLowerCase().indexOf(filter.toLowerCase()) > -1);
|
|
29
26
|
if (options.length === 0)
|
|
30
27
|
return;
|
|
31
|
-
return ((
|
|
28
|
+
return (_jsxs("div", { className: classNames("m-4", index > 0 ? " border-t border-gray-200" : ""), children: [_jsxs("div", { className: "text-xs font-bold mt-2 mb-3 flex items-center gap-2", children: [_jsx(ArrowDownIcon, {}), " ", group] }), _jsx("div", { className: "grid gap-4 grid-cols-[repeat(auto-fill,_minmax(70px,_1fr))]", children: options.map((option) => {
|
|
32
29
|
function handleDragStart(event) {
|
|
33
30
|
editContext?.dragStart({
|
|
34
31
|
type: "template",
|
|
@@ -42,14 +39,14 @@ function ComponentPalette({}) {
|
|
|
42
39
|
editContext.setSelectedForInsertion("");
|
|
43
40
|
}
|
|
44
41
|
const isDraggable = !option.isInvalid;
|
|
45
|
-
return ((
|
|
42
|
+
return (_jsxs("div", { id: "insert-component-" + option.typeId, onClick: () => {
|
|
46
43
|
editContext.setSelectedForInsertion(option.typeId);
|
|
47
|
-
}, draggable: isDraggable, onDragStart: handleDragStart, onDragEnd: handleDragEnd, className:
|
|
44
|
+
}, draggable: isDraggable, onDragStart: handleDragStart, onDragEnd: handleDragEnd, className: classNames("p-2 border border-gray-200 flex items-center flex-col gap-2 text-center text-xs relative rounded break-all ", isDraggable ? "cursor-grab" : "", editContext.selectedForInsertion === option.typeId
|
|
48
45
|
? "border-sky-500"
|
|
49
|
-
: ""), "data-testid": "insert-component-option", children: [option.svg && ((
|
|
46
|
+
: ""), "data-testid": "insert-component-option", children: [option.svg && (_jsx("div", { className: "w-8 h-8", dangerouslySetInnerHTML: { __html: option.svg } })), !option.svg && (_jsx("img", { src: getAbsoluteIconUrl(option.icon), width: "32", height: "32" })), _jsx("div", { className: "text-xs", children: option.name
|
|
50
47
|
.split(new RegExp(`(${filter})`, "i"))
|
|
51
48
|
.map((part, i) => part.toLowerCase() === filter.toLowerCase() &&
|
|
52
|
-
part ? ((
|
|
49
|
+
part ? (_jsx("u", { className: "font-bold", children: part }, i)) : (part && _jsx("span", { children: part }, i))) }), option.isInvalid && (_jsx("i", { className: "pi pi-exclamation-triangle text-red-500 absolute top-0 right-0", title: option.message }))] }, option.typeId));
|
|
53
50
|
}) })] }, group));
|
|
54
51
|
})] }) }));
|
|
55
52
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ComponentTree({}: {}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const [
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
19
|
-
const treeRef = (0, react_1.useRef)(null);
|
|
20
|
-
(0, react_1.useEffect)(() => {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEditContext, useEditContextRef } from "../client/editContext";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { confirmDialog } from "primereact/confirmdialog";
|
|
6
|
+
import { getComponentCommands } from "../commands/componentCommands";
|
|
7
|
+
import { PerfectTree } from "../ui/PerfectTree";
|
|
8
|
+
import { isValidPlaceholder } from "../componentTreeHelper";
|
|
9
|
+
export function ComponentTree({}) {
|
|
10
|
+
const [expandedKeys, setExpandedKeys] = useState([]);
|
|
11
|
+
const [selectedKeys, setSelectedKeys] = useState([]);
|
|
12
|
+
const [rootNodes, setRootNodes] = useState([]);
|
|
13
|
+
const [nodeDictionary, setNodeDictionary] = useState({});
|
|
14
|
+
let editContextRef = useEditContextRef();
|
|
15
|
+
const editContext = useEditContext();
|
|
16
|
+
const treeRef = useRef(null);
|
|
17
|
+
useEffect(() => {
|
|
21
18
|
if (treeRef.current) {
|
|
22
19
|
const selectedNodeKey = Object.keys(selectedKeys || {})[0];
|
|
23
20
|
const selectedNodeElement = treeRef.current.querySelector(`[data-id="${selectedNodeKey}"]`);
|
|
@@ -29,14 +26,14 @@ function ComponentTree({}) {
|
|
|
29
26
|
}
|
|
30
27
|
}
|
|
31
28
|
}, [selectedKeys]);
|
|
32
|
-
|
|
29
|
+
useEffect(() => {
|
|
33
30
|
if (editContext?.selection) {
|
|
34
31
|
setSelectedKeys(editContext.selection);
|
|
35
32
|
}
|
|
36
33
|
}, [editContext?.selection]);
|
|
37
34
|
const selection = editContext?.selection || [];
|
|
38
35
|
const page = editContext?.page;
|
|
39
|
-
|
|
36
|
+
useEffect(() => {
|
|
40
37
|
const newExpandedKeys = [...expandedKeys];
|
|
41
38
|
for (const id of selection) {
|
|
42
39
|
if (nodeDictionary[id]?.parent) {
|
|
@@ -112,7 +109,7 @@ function ComponentTree({}) {
|
|
|
112
109
|
});
|
|
113
110
|
if (!hostItem)
|
|
114
111
|
return;
|
|
115
|
-
|
|
112
|
+
confirmDialog({
|
|
116
113
|
header: "Edit layout",
|
|
117
114
|
message: "Edit layout " + hostItem.path + "?",
|
|
118
115
|
accept: () => editContext.loadItem({
|
|
@@ -157,7 +154,7 @@ function ComponentTree({}) {
|
|
|
157
154
|
}
|
|
158
155
|
return node;
|
|
159
156
|
}
|
|
160
|
-
|
|
157
|
+
useEffect(() => {
|
|
161
158
|
if (!page)
|
|
162
159
|
return;
|
|
163
160
|
const treeNodes = mapPlaceholders(page.rootComponent, {
|
|
@@ -227,7 +224,7 @@ function ComponentTree({}) {
|
|
|
227
224
|
if (selectedEntities.length === 0 && item.data) {
|
|
228
225
|
selectedEntities = [item.data];
|
|
229
226
|
}
|
|
230
|
-
let commands =
|
|
227
|
+
let commands = getComponentCommands(selectedEntities, editContextRef.current);
|
|
231
228
|
const menu = commands.map((x) => ({
|
|
232
229
|
label: x.label,
|
|
233
230
|
icon: x.icon,
|
|
@@ -285,7 +282,7 @@ function ComponentTree({}) {
|
|
|
285
282
|
const placeholder = getPlaceholder(dragOverNode);
|
|
286
283
|
if (!placeholder)
|
|
287
284
|
return false;
|
|
288
|
-
var isValid =
|
|
285
|
+
var isValid = isValidPlaceholder(placeholder, editContext.dragObject);
|
|
289
286
|
return isValid;
|
|
290
287
|
};
|
|
291
288
|
// Handle drop on node
|
|
@@ -296,9 +293,9 @@ function ComponentTree({}) {
|
|
|
296
293
|
editContext.droppedInPlaceholder(placeholder.key, index);
|
|
297
294
|
};
|
|
298
295
|
if (!page)
|
|
299
|
-
return ((
|
|
296
|
+
return (_jsx("div", { className: "flex h-full items-center justify-center text-sm text-gray-500" }));
|
|
300
297
|
// Use the PerfectTree component
|
|
301
|
-
return ((
|
|
298
|
+
return (_jsx("div", { className: "p-2", ref: treeRef, children: _jsx(PerfectTree, { nodes: rootNodes, isDragging: !!editContext?.dragObject, selectedKeys: selectedItems, expandedKeys: expandedItems, onToggleExpand: handleToggle, onSelect: handleTreeSelection, enableDragAndDrop: true, onDragOverZone: (parent, index, event) => handleDragOverZone(parent, index, event), onStartDrag: (data) => {
|
|
302
299
|
const component = data.node.data;
|
|
303
300
|
// Initialize drag data to make sure dataTransfer is set
|
|
304
301
|
data.event.dataTransfer.setData("text/plain", data.node.key);
|
|
@@ -321,7 +318,7 @@ function ComponentTree({}) {
|
|
|
321
318
|
}, onDrop: (parent, index, event) => handleDropZone(parent, index, event), renderNode: (node) => renderNode(node) }) }));
|
|
322
319
|
}
|
|
323
320
|
function renderNode(node) {
|
|
324
|
-
return ((
|
|
321
|
+
return (_jsx("div", { children: _jsxs("div", { className: "font-geist-sans flex items-center gap-2 p-0.5 text-[12px] text-gray-600", children: [_jsx("i", { className: node.icon }), _jsx("span", { className: node.className, children: node.label }), node.tags?.map((x) => (_jsx("div", { children: _jsxs("span", { id: `id-${node.key}-${x.id}`, className: "ml-2 rounded px-1 py-0.5 text-xs", style: {
|
|
325
322
|
backgroundColor: x.color,
|
|
326
323
|
marginLeft: "8px",
|
|
327
324
|
fontSize: "10px",
|
|
@@ -331,7 +328,7 @@ function renderNode(node) {
|
|
|
331
328
|
e.stopPropagation();
|
|
332
329
|
x.onClick();
|
|
333
330
|
}
|
|
334
|
-
: undefined, children: [x.icon && (
|
|
331
|
+
: undefined, children: [x.icon && _jsx("i", { className: x.icon }), x.value] }) }, `tag-${node.key}-${x.id}`)))] }) }));
|
|
335
332
|
}
|
|
336
333
|
function createMap(treeNodes, nodeDictionary) {
|
|
337
334
|
treeNodes.forEach((n) => {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Debug({}: {}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,25 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const [activeTab, setActiveTab] = (0, react_1.useState)(0);
|
|
14
|
-
const [pageLayout, setPageLayout] = (0, react_1.useState)(null);
|
|
15
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { TabView, TabPanel } from "primereact/tabview";
|
|
3
|
+
import { CopyToClipboardButton } from "../ui/CopyToClipboardButton";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { getComponentByIdFromHeadlessLayout } from "../componentTreeHelper";
|
|
6
|
+
import { ObjectInspector, ObjectLabel, ObjectRootLabel } from "react-inspector";
|
|
7
|
+
import { useEditContext } from "../client/editContext";
|
|
8
|
+
import { getPageJson } from "../services/contentService";
|
|
9
|
+
export function Debug({}) {
|
|
10
|
+
const [activeTab, setActiveTab] = useState(0);
|
|
11
|
+
const [pageLayout, setPageLayout] = useState(null);
|
|
12
|
+
const editContext = useEditContext();
|
|
16
13
|
if (!editContext)
|
|
17
14
|
return;
|
|
18
|
-
|
|
15
|
+
useEffect(() => {
|
|
19
16
|
const loadLayout = async () => {
|
|
20
17
|
if (!editContext.currentItemDescriptor)
|
|
21
18
|
return;
|
|
22
|
-
const layout = await
|
|
19
|
+
const layout = await getPageJson(editContext.currentItemDescriptor);
|
|
23
20
|
setPageLayout(layout);
|
|
24
21
|
};
|
|
25
22
|
loadLayout();
|
|
@@ -28,7 +25,7 @@ function Debug({}) {
|
|
|
28
25
|
let component = null;
|
|
29
26
|
if (page) {
|
|
30
27
|
const selectedComponents = editContext.selection
|
|
31
|
-
.map((x) =>
|
|
28
|
+
.map((x) => getComponentByIdFromHeadlessLayout(x, page))
|
|
32
29
|
.filter((x) => x);
|
|
33
30
|
component = selectedComponents.length === 1 ? selectedComponents[0] : null;
|
|
34
31
|
}
|
|
@@ -48,13 +45,13 @@ function Debug({}) {
|
|
|
48
45
|
name == "parentComponent" ||
|
|
49
46
|
name == "placeholderReference")
|
|
50
47
|
return null;
|
|
51
|
-
return depth === 0 ? ((
|
|
48
|
+
return depth === 0 ? (_jsx(ObjectRootLabel, { name: name, data: data })) : (_jsx(ObjectLabel, { name: name, data: data, isNonenumerable: isNonenumerable }));
|
|
52
49
|
};
|
|
53
50
|
if (component) {
|
|
54
|
-
tabs.push((
|
|
51
|
+
tabs.push(_jsx(TabPanel, { header: "Component", className: "relative h-full", children: _jsx("div", { className: "relative h-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto p-2", children: _jsx(ObjectInspector, { data: component, nodeRenderer: defaultNodeRenderer }) }) }) }, "component"));
|
|
55
52
|
}
|
|
56
|
-
tabs.push((
|
|
57
|
-
return ((
|
|
53
|
+
tabs.push(_jsx(TabPanel, { header: "Page", className: "relative h-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto p-2", children: _jsx(ObjectInspector, { data: page, nodeRenderer: defaultNodeRenderer }) }) }, "page"));
|
|
54
|
+
return (_jsxs("div", { className: "relative h-[calc(100%-6px)]", children: [_jsx(TabView, { className: "alpaceditor-tabs h-full", onTabChange: (ev) => {
|
|
58
55
|
setActiveTab(ev.index);
|
|
59
|
-
}, activeIndex: activeTab, children: tabs }), (
|
|
56
|
+
}, activeIndex: activeTab, children: tabs }), _jsx("div", { className: "absolute top-2 right-1", children: _jsx(CopyToClipboardButton, { text: JSON.stringify(activeTab === 0 && component ? component : page, replacer, 2) }) })] }));
|
|
60
57
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function DictionaryEditor({}: {}): import("react/jsx-runtime").JSX.Element;
|