@alpaca-editor/core 1.0.3767 → 1.0.3769
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const [editOperationExecuted, setEditOperationExecuted] = (0, react_1.useState)();
|
|
14
|
-
const [executingEditOperations, setExecutingEditOperations] = (0, react_1.useState)([]);
|
|
15
|
-
const lastOp = (0, react_1.useRef)(undefined);
|
|
16
|
-
const undoing = (0, react_1.useRef)(false);
|
|
17
|
-
const stateRef = (0, react_1.useRef)(state);
|
|
18
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import uuid from "react-uuid";
|
|
2
|
+
import { executeEditOperation, executeRedo, executeUndo, executeWorkflowCommand, executeDeleteItems, lockField, lockItems, unlockItems, executeCreateItem, createVersion as doCreateVersion, executeMoveItems, } from "../services/editService";
|
|
3
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
4
|
+
import { handleErrorResult } from "./helpers";
|
|
5
|
+
import { useDebouncedCallback } from "use-debounce";
|
|
6
|
+
export function getOperationsContext(state, ui) {
|
|
7
|
+
const [editOperationExecuted, setEditOperationExecuted] = useState();
|
|
8
|
+
const [executingEditOperations, setExecutingEditOperations] = useState([]);
|
|
9
|
+
const lastOp = useRef(undefined);
|
|
10
|
+
const undoing = useRef(false);
|
|
11
|
+
const stateRef = useRef(state);
|
|
12
|
+
useEffect(() => {
|
|
19
13
|
stateRef.current = state;
|
|
20
14
|
}, [state]);
|
|
21
15
|
const executeOp = async (op, options = {
|
|
@@ -23,7 +17,7 @@ function getOperationsContext(state, ui) {
|
|
|
23
17
|
}) => {
|
|
24
18
|
console.log("Executing op", op);
|
|
25
19
|
setExecutingEditOperations((ops) => (ops ? [...ops, op] : [op]));
|
|
26
|
-
const result = await
|
|
20
|
+
const result = await executeEditOperation(op, state.sessionId);
|
|
27
21
|
console.log("Result", result);
|
|
28
22
|
handleResult(result, options);
|
|
29
23
|
await state.refreshHistory(op.mainItem);
|
|
@@ -32,13 +26,13 @@ function getOperationsContext(state, ui) {
|
|
|
32
26
|
setExecutingEditOperations((ops) => ops ? ops.filter((x) => x.id !== op.id) : []);
|
|
33
27
|
return result.data;
|
|
34
28
|
};
|
|
35
|
-
const duplicateComponents =
|
|
29
|
+
const duplicateComponents = useCallback(({ componentIds }) => {
|
|
36
30
|
const op = {
|
|
37
31
|
type: "duplicate-components",
|
|
38
32
|
mainItem: state.page?.item.descriptor,
|
|
39
33
|
sourceComponentIds: componentIds,
|
|
40
34
|
date: new Date().toISOString(),
|
|
41
|
-
id: (
|
|
35
|
+
id: uuid(),
|
|
42
36
|
description: "Duplicate components",
|
|
43
37
|
};
|
|
44
38
|
executeOp(op);
|
|
@@ -63,14 +57,14 @@ function getOperationsContext(state, ui) {
|
|
|
63
57
|
placeholderIndex: index,
|
|
64
58
|
componentTypeId,
|
|
65
59
|
date: new Date().toISOString(),
|
|
66
|
-
id: (
|
|
60
|
+
id: uuid(),
|
|
67
61
|
description: "Add component",
|
|
68
62
|
};
|
|
69
63
|
const result = await executeOp(op);
|
|
70
64
|
return result;
|
|
71
65
|
};
|
|
72
66
|
const handleResult = (result, options) => {
|
|
73
|
-
if (
|
|
67
|
+
if (handleErrorResult(result, ui, state))
|
|
74
68
|
return;
|
|
75
69
|
const executedOps = Array.isArray(result.data)
|
|
76
70
|
? result.data
|
|
@@ -91,7 +85,7 @@ function getOperationsContext(state, ui) {
|
|
|
91
85
|
state.requestRefresh(options.refresh === "immediate" ? "immediate" : "waitForQuietPeriod");
|
|
92
86
|
}
|
|
93
87
|
};
|
|
94
|
-
const ensureLock =
|
|
88
|
+
const ensureLock = useCallback(async (field) => {
|
|
95
89
|
if (!field || !field.item)
|
|
96
90
|
return false;
|
|
97
91
|
if (state.lockedField?.fieldId === field.fieldId &&
|
|
@@ -99,7 +93,7 @@ function getOperationsContext(state, ui) {
|
|
|
99
93
|
state.lockedField?.item.language === field.item.language &&
|
|
100
94
|
state.lockedField?.item.version === field.item.version)
|
|
101
95
|
return true;
|
|
102
|
-
const result = await
|
|
96
|
+
const result = await lockField(field.item, field.fieldId, state.sessionId);
|
|
103
97
|
if (result.type == "error") {
|
|
104
98
|
console.log("error locking field", result);
|
|
105
99
|
}
|
|
@@ -110,30 +104,30 @@ function getOperationsContext(state, ui) {
|
|
|
110
104
|
}
|
|
111
105
|
return false;
|
|
112
106
|
}, [state, ui]);
|
|
113
|
-
const lockItemsAndRefresh =
|
|
107
|
+
const lockItemsAndRefresh = useCallback(async (items) => {
|
|
114
108
|
const item = items[0];
|
|
115
109
|
if (!item)
|
|
116
110
|
return;
|
|
117
|
-
await
|
|
111
|
+
await lockItems(items);
|
|
118
112
|
if (item.id == state.contentEditorItem?.id) {
|
|
119
113
|
await state.loadItem(item);
|
|
120
114
|
}
|
|
121
115
|
else
|
|
122
116
|
state.requestRefresh("immediate");
|
|
123
117
|
}, [state]);
|
|
124
|
-
const unlockItemsAndRefresh =
|
|
118
|
+
const unlockItemsAndRefresh = useCallback(async (items) => {
|
|
125
119
|
const item = items[0];
|
|
126
120
|
if (!item)
|
|
127
121
|
return;
|
|
128
|
-
await
|
|
122
|
+
await unlockItems(items);
|
|
129
123
|
if (item.id == state.contentEditorItem?.id) {
|
|
130
124
|
await state.loadItem(item);
|
|
131
125
|
}
|
|
132
126
|
else
|
|
133
127
|
state.requestRefresh("immediate");
|
|
134
128
|
}, [state]);
|
|
135
|
-
const executeWorkflowCommandAndRefresh =
|
|
136
|
-
const result = await
|
|
129
|
+
const executeWorkflowCommandAndRefresh = useCallback(async (item, commandId) => {
|
|
130
|
+
const result = await executeWorkflowCommand(item, commandId, "");
|
|
137
131
|
if (result.type === "success") {
|
|
138
132
|
if (!result.data.succeeded) {
|
|
139
133
|
const errorMessage = {
|
|
@@ -145,12 +139,12 @@ function getOperationsContext(state, ui) {
|
|
|
145
139
|
state.requestRefresh("immediate");
|
|
146
140
|
}
|
|
147
141
|
}, [state]);
|
|
148
|
-
const renameItem =
|
|
142
|
+
const renameItem = useCallback(async (item, newName) => {
|
|
149
143
|
await executeOp({
|
|
150
144
|
type: "rename-item",
|
|
151
145
|
mainItem: state.page?.item.descriptor || item,
|
|
152
146
|
date: new Date().toISOString(),
|
|
153
|
-
id: (
|
|
147
|
+
id: uuid(),
|
|
154
148
|
item,
|
|
155
149
|
newName,
|
|
156
150
|
description: "Rename item",
|
|
@@ -158,8 +152,8 @@ function getOperationsContext(state, ui) {
|
|
|
158
152
|
state.requestRefresh("immediate");
|
|
159
153
|
state.itemsRepository.refreshItems([item]);
|
|
160
154
|
}, [state.itemsRepository, executeOp]);
|
|
161
|
-
const lastEditField =
|
|
162
|
-
const editField =
|
|
155
|
+
const lastEditField = useRef(undefined);
|
|
156
|
+
const editField = useCallback(async ({ field, value, rawValue, refresh = "immediate", }) => {
|
|
163
157
|
state.itemsRepository.updateFieldValue(field, state.user ?? { name: "unknown", ai: false }, true, value, rawValue);
|
|
164
158
|
if (refresh === "immediate" || refresh === "none") {
|
|
165
159
|
return editFieldImmediate({ field, value, rawValue, refresh });
|
|
@@ -173,7 +167,7 @@ function getOperationsContext(state, ui) {
|
|
|
173
167
|
lastEditField.current = field;
|
|
174
168
|
return executeEditFieldDebounced({ field, value, rawValue, refresh });
|
|
175
169
|
}, [state.itemsRepository]);
|
|
176
|
-
const editFieldImmediate =
|
|
170
|
+
const editFieldImmediate = useCallback(async ({ field, value, rawValue, refresh = "immediate", }) => {
|
|
177
171
|
state.itemsRepository.updateFieldValue(field, state.user ?? { name: "unknown", ai: false }, true, value, rawValue);
|
|
178
172
|
const val = rawValue !== undefined ? rawValue : value;
|
|
179
173
|
if (val === undefined)
|
|
@@ -185,7 +179,7 @@ function getOperationsContext(state, ui) {
|
|
|
185
179
|
state.itemsRepository.onFieldSaved(field, val);
|
|
186
180
|
}
|
|
187
181
|
}, [state.itemsRepository, executeOp]);
|
|
188
|
-
const executeEditFieldDebounced =
|
|
182
|
+
const executeEditFieldDebounced = useDebouncedCallback(editFieldImmediate, state.configuration.debounceFieldEditsInterval * 2, { trailing: true });
|
|
189
183
|
async function getEditOP(field, rawValue, value) {
|
|
190
184
|
const item = await state.itemsRepository.getItem(field.item);
|
|
191
185
|
if (!item)
|
|
@@ -219,7 +213,7 @@ function getOperationsContext(state, ui) {
|
|
|
219
213
|
fieldId: field.fieldId,
|
|
220
214
|
fieldName: fieldItem.name,
|
|
221
215
|
date: new Date().toISOString(),
|
|
222
|
-
id: (
|
|
216
|
+
id: uuid(),
|
|
223
217
|
description: "Edit " + item.name,
|
|
224
218
|
focus: item.id + ":" + field.fieldId,
|
|
225
219
|
canUndo: true,
|
|
@@ -235,7 +229,7 @@ function getOperationsContext(state, ui) {
|
|
|
235
229
|
lastOp.current = op;
|
|
236
230
|
return op;
|
|
237
231
|
}
|
|
238
|
-
const undo =
|
|
232
|
+
const undo = useCallback(async (numberOfOperations) => {
|
|
239
233
|
if (undoing.current) {
|
|
240
234
|
return false;
|
|
241
235
|
}
|
|
@@ -254,7 +248,7 @@ function getOperationsContext(state, ui) {
|
|
|
254
248
|
x.undone = true;
|
|
255
249
|
x.canUndo = false;
|
|
256
250
|
});
|
|
257
|
-
const result = await
|
|
251
|
+
const result = await executeUndo(state.sessionId, ops.map((x) => x.id));
|
|
258
252
|
handleResult(result, { refresh: "immediate" });
|
|
259
253
|
if (result.type === "success") {
|
|
260
254
|
const itemsToRefresh = result.data
|
|
@@ -285,7 +279,7 @@ function getOperationsContext(state, ui) {
|
|
|
285
279
|
console.log("undoing flag reset");
|
|
286
280
|
}
|
|
287
281
|
}, [state, ui, undoing]);
|
|
288
|
-
const redo =
|
|
282
|
+
const redo = useCallback(async () => {
|
|
289
283
|
if (undoing.current)
|
|
290
284
|
return false;
|
|
291
285
|
undoing.current = true;
|
|
@@ -301,7 +295,7 @@ function getOperationsContext(state, ui) {
|
|
|
301
295
|
return false;
|
|
302
296
|
op.canRedo = false;
|
|
303
297
|
op.undone = false;
|
|
304
|
-
const result = await
|
|
298
|
+
const result = await executeRedo(state.sessionId, op.id);
|
|
305
299
|
handleResult(result, { refresh: "immediate" });
|
|
306
300
|
if (result.type === "success") {
|
|
307
301
|
const itemsToRefresh = result.data
|
|
@@ -331,29 +325,29 @@ function getOperationsContext(state, ui) {
|
|
|
331
325
|
undoing.current = false;
|
|
332
326
|
}
|
|
333
327
|
}, [state, ui, undoing]);
|
|
334
|
-
const deleteItems =
|
|
328
|
+
const deleteItems = useCallback(async (items) => {
|
|
335
329
|
const itemsToDelete = await state.itemsRepository.getItems(items);
|
|
336
|
-
await
|
|
330
|
+
await executeDeleteItems(items);
|
|
337
331
|
state.itemsRepository.onItemsDeleted(itemsToDelete.map((x) => ({
|
|
338
332
|
item: x.descriptor,
|
|
339
333
|
parentId: x.parentId,
|
|
340
334
|
})));
|
|
341
335
|
state.requestRefresh("immediate");
|
|
342
336
|
}, [state.itemsRepository]);
|
|
343
|
-
const moveItems =
|
|
344
|
-
await
|
|
337
|
+
const moveItems = useCallback(async (items, target, index) => {
|
|
338
|
+
await executeMoveItems(items, target, index);
|
|
345
339
|
}, [state.itemsRepository]);
|
|
346
|
-
const createItem =
|
|
347
|
-
const result = await
|
|
348
|
-
if (
|
|
340
|
+
const createItem = useCallback(async (parent, templateId, name) => {
|
|
341
|
+
const result = await executeCreateItem(parent, templateId, name);
|
|
342
|
+
if (handleErrorResult(result, ui, state))
|
|
349
343
|
return;
|
|
350
344
|
state.itemsRepository.refreshItems([parent]);
|
|
351
345
|
return result.data;
|
|
352
346
|
}, [state.itemsRepository]);
|
|
353
|
-
const createVersion =
|
|
354
|
-
await (
|
|
347
|
+
const createVersion = useCallback(async (item) => {
|
|
348
|
+
await doCreateVersion(item, state.sessionId);
|
|
355
349
|
}, [state]);
|
|
356
|
-
const ops =
|
|
350
|
+
const ops = useMemo(() => ({
|
|
357
351
|
addComponent,
|
|
358
352
|
ensureLock,
|
|
359
353
|
lockItems: lockItemsAndRefresh,
|
|
@@ -388,7 +382,7 @@ function getOperationsContext(state, ui) {
|
|
|
388
382
|
undoing.current,
|
|
389
383
|
moveItems,
|
|
390
384
|
]);
|
|
391
|
-
return
|
|
385
|
+
return useMemo(() => ({
|
|
392
386
|
ops,
|
|
393
387
|
context: {
|
|
394
388
|
editOperationExecuted,
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ItemDescriptor, Page, PageSkeleton } from "../pageModel";
|
|
2
|
+
import { ItemsRepository } from "./itemsRepository";
|
|
3
|
+
export declare function usePageModel(itemsRepository: ItemsRepository | undefined, pageItemDescriptor?: ItemDescriptor): {
|
|
4
|
+
setPageSkeleton: import("react").Dispatch<import("react").SetStateAction<PageSkeleton | undefined>>;
|
|
5
|
+
page: Page | undefined;
|
|
6
|
+
};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const [pageSkeleton, setPageSkeleton] = (0, react_1.useState)();
|
|
9
|
-
const [insertOptions, setInsertOptions] = (0, react_1.useState)([]);
|
|
10
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { useEffect, useState } from "react";
|
|
2
|
+
import { loadPlaceholderInsertOptions } from "../services/editService";
|
|
3
|
+
export function usePageModel(itemsRepository, pageItemDescriptor) {
|
|
4
|
+
const [page, setPage] = useState();
|
|
5
|
+
const [pageSkeleton, setPageSkeleton] = useState();
|
|
6
|
+
const [insertOptions, setInsertOptions] = useState([]);
|
|
7
|
+
useEffect(() => {
|
|
11
8
|
setPage(undefined);
|
|
12
9
|
setPageSkeleton(undefined);
|
|
13
10
|
}, [pageItemDescriptor]);
|
|
14
|
-
|
|
11
|
+
useEffect(() => {
|
|
15
12
|
const loadInsertOptions = async () => {
|
|
16
13
|
if (!pageSkeleton)
|
|
17
14
|
return;
|
|
@@ -27,7 +24,7 @@ function usePageModel(itemsRepository, pageItemDescriptor) {
|
|
|
27
24
|
return keys;
|
|
28
25
|
};
|
|
29
26
|
const placeholderKeys = collectPlaceholderKeys(pageSkeleton);
|
|
30
|
-
const options = await
|
|
27
|
+
const options = await loadPlaceholderInsertOptions(pageSkeleton.item, placeholderKeys);
|
|
31
28
|
setInsertOptions(options);
|
|
32
29
|
};
|
|
33
30
|
loadInsertOptions();
|
|
@@ -119,7 +116,7 @@ function usePageModel(itemsRepository, pageItemDescriptor) {
|
|
|
119
116
|
//console.log("Page model updated", performance.now() - start);
|
|
120
117
|
setPage(page);
|
|
121
118
|
};
|
|
122
|
-
|
|
119
|
+
useEffect(() => {
|
|
123
120
|
updatePageModel();
|
|
124
121
|
}, [pageSkeleton, itemsRepository, insertOptions]);
|
|
125
122
|
return {
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OpenDialog } from "../client/DialogContext";
|
|
2
|
+
import { EditContextType } from "../client/editContext";
|
|
3
|
+
export type CommandContext<T> = {
|
|
4
|
+
editContext: EditContextType;
|
|
5
|
+
openDialog: OpenDialog;
|
|
6
|
+
event?: React.SyntheticEvent;
|
|
7
|
+
searchParams?: URLSearchParams;
|
|
8
|
+
pathname?: string;
|
|
9
|
+
data?: T;
|
|
10
|
+
};
|
|
11
|
+
export type Command<T extends CommandData> = {
|
|
12
|
+
id: string;
|
|
13
|
+
label: string;
|
|
14
|
+
icon: React.ReactNode;
|
|
15
|
+
execute(context: CommandContext<T>): Promise<any>;
|
|
16
|
+
disabled: (context: CommandContext<T>) => boolean;
|
|
17
|
+
keyBinding?: string;
|
|
18
|
+
};
|
|
19
|
+
export type CommandData = {};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { EditContextType } from "../client/editContext";
|
|
2
|
+
import { Command, CommandContext, CommandData } from "./commands";
|
|
3
|
+
import { Component, Placeholder } from "../pageModel";
|
|
4
|
+
export type ComponentCommandData = CommandData & {
|
|
5
|
+
components: Component[];
|
|
6
|
+
};
|
|
7
|
+
export type ComponentCommandContext = CommandContext<ComponentCommandData>;
|
|
8
|
+
export type ComponentCommandVisibilityScope = "editFrame" | "menu" | "contextMenu";
|
|
9
|
+
export type ComponentCommand = Command<ComponentCommandData> & {
|
|
10
|
+
visibilityScopes: ComponentCommandVisibilityScope[];
|
|
11
|
+
};
|
|
12
|
+
export declare function getSelectedComponentCommands(editContext: EditContextType): ComponentCommand[];
|
|
13
|
+
export declare function getComponentCommands(entities: (Placeholder | Component)[], editContext: EditContextType): ComponentCommand[];
|
|
@@ -1,23 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSelectedComponentCommands = getSelectedComponentCommands;
|
|
7
|
-
exports.getComponentCommands = getComponentCommands;
|
|
8
|
-
const react_uuid_1 = __importDefault(require("react-uuid"));
|
|
9
|
-
const componentTreeHelper_1 = require("../componentTreeHelper");
|
|
1
|
+
import uuid from "react-uuid";
|
|
2
|
+
import { getComponentById } from "../componentTreeHelper";
|
|
10
3
|
const isPlaceholder = (x) => x.components !== undefined;
|
|
11
|
-
function getSelectedComponentCommands(editContext) {
|
|
4
|
+
export function getSelectedComponentCommands(editContext) {
|
|
12
5
|
const selection = editContext.selection;
|
|
13
6
|
const selectedComponents = selection
|
|
14
|
-
.map((x) =>
|
|
7
|
+
.map((x) => getComponentById(x, editContext.page))
|
|
15
8
|
.filter((x) => x);
|
|
16
9
|
const componentCommands = getComponentCommands(selectedComponents, editContext);
|
|
17
10
|
const componentCommandMenuItems = componentCommands.filter((x) => x.visibilityScopes.indexOf("menu") >= 0);
|
|
18
11
|
return componentCommandMenuItems;
|
|
19
12
|
}
|
|
20
|
-
function getComponentCommands(entities, editContext) {
|
|
13
|
+
export function getComponentCommands(entities, editContext) {
|
|
21
14
|
const components = entities.filter((x) => x && !isPlaceholder(x));
|
|
22
15
|
const commands = [
|
|
23
16
|
getCreateCommentCommand(),
|
|
@@ -219,7 +212,7 @@ function getSyncCommand(components, editContext) {
|
|
|
219
212
|
type: "synchronize-components",
|
|
220
213
|
date: new Date().toISOString(),
|
|
221
214
|
delete: false,
|
|
222
|
-
id: (
|
|
215
|
+
id: uuid(),
|
|
223
216
|
placeholders: placeholders,
|
|
224
217
|
description: "Synchronize components",
|
|
225
218
|
};
|
|
@@ -245,7 +238,7 @@ function deleteComponents(components, editContext) {
|
|
|
245
238
|
const op = {
|
|
246
239
|
type: "remove-component",
|
|
247
240
|
date: new Date().toISOString(),
|
|
248
|
-
id: (
|
|
241
|
+
id: uuid(),
|
|
249
242
|
componentIds: components.map((x) => x.id),
|
|
250
243
|
mainItem: editContext.page.item.descriptor,
|
|
251
244
|
description: "Remove components: " + components.map((x) => x.name).join(", "),
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const editService_1 = require("../services/editService");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
function getCreateAndSwitchToNewVersionCommand({ language, }) {
|
|
1
|
+
import { createVersion } from "../services/editService";
|
|
2
|
+
import { getItemDescriptor } from "../utils";
|
|
3
|
+
export function getCreateAndSwitchToNewVersionCommand({ language, }) {
|
|
7
4
|
return {
|
|
8
5
|
id: "createAndSwitchToNewVersion",
|
|
9
6
|
execute: (context) => execute(context, language),
|
|
@@ -15,10 +12,10 @@ function getCreateAndSwitchToNewVersionCommand({ language, }) {
|
|
|
15
12
|
async function execute(context, language) {
|
|
16
13
|
if (!context.editContext.item)
|
|
17
14
|
return;
|
|
18
|
-
const descriptor =
|
|
15
|
+
const descriptor = getItemDescriptor(context.editContext.item);
|
|
19
16
|
if (language)
|
|
20
17
|
descriptor.language = language;
|
|
21
|
-
await
|
|
18
|
+
await createVersion(descriptor, context.editContext.sessionId);
|
|
22
19
|
context.editContext.loadItem({
|
|
23
20
|
...descriptor,
|
|
24
21
|
version: 0,
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const editService_1 = require("../services/editService");
|
|
5
|
-
const utils_1 = require("../utils");
|
|
6
|
-
function getDeleteVersionCommand({}) {
|
|
1
|
+
import { deleteVersion } from "../services/editService";
|
|
2
|
+
import { getItemDescriptor } from "../utils";
|
|
3
|
+
export function getDeleteVersionCommand({}) {
|
|
7
4
|
return {
|
|
8
5
|
id: "deleteVersion",
|
|
9
6
|
execute: (context) => execute(context),
|
|
@@ -17,7 +14,7 @@ function getDeleteVersionCommand({}) {
|
|
|
17
14
|
async function execute(context) {
|
|
18
15
|
if (!context.editContext.item)
|
|
19
16
|
return;
|
|
20
|
-
const descriptor =
|
|
17
|
+
const descriptor = getItemDescriptor(context.editContext.item);
|
|
21
18
|
let message = "Are you sure you want to delete version " +
|
|
22
19
|
context.editContext.item.version +
|
|
23
20
|
"?";
|
|
@@ -45,7 +42,7 @@ async function execute(context) {
|
|
|
45
42
|
message,
|
|
46
43
|
showCancel: true,
|
|
47
44
|
accept: async () => {
|
|
48
|
-
await
|
|
45
|
+
await deleteVersion(descriptor, context.editContext.sessionId);
|
|
49
46
|
context.editContext.loadItem({
|
|
50
47
|
...descriptor,
|
|
51
48
|
version: 0,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Command, CommandContext, CommandData } from "./commands";
|
|
2
|
+
import { FullItem } from "../pageModel";
|
|
3
|
+
export type ItemCommandData = CommandData & {
|
|
4
|
+
items: FullItem[];
|
|
5
|
+
};
|
|
6
|
+
export type ItemCommandContext = CommandContext<ItemCommandData>;
|
|
7
|
+
export type ItemCommand = Command<ItemCommandData>;
|
|
8
|
+
export declare const deleteItemCommand: ItemCommand;
|
|
9
|
+
export declare const renameItemCommand: ItemCommand;
|
|
10
|
+
type InsertItemCommandData = ItemCommandData & {
|
|
11
|
+
templateId: string;
|
|
12
|
+
};
|
|
13
|
+
export type InsertItemCommandContext = CommandContext<InsertItemCommandData>;
|
|
14
|
+
export type InsertItemCommand = Command<InsertItemCommandData>;
|
|
15
|
+
export declare const insertItemCommand: ItemCommand;
|
|
16
|
+
export declare const publishItemCommand: ItemCommand;
|
|
17
|
+
export {};
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const ItemNameDialogNew_1 = require("../ui/ItemNameDialogNew");
|
|
6
|
-
exports.deleteItemCommand = {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ItemNameDialog } from "../ui/ItemNameDialogNew";
|
|
3
|
+
export const deleteItemCommand = {
|
|
7
4
|
id: "deleteItem",
|
|
8
5
|
label: "Delete",
|
|
9
6
|
icon: "pi pi-times",
|
|
@@ -14,7 +11,7 @@ exports.deleteItemCommand = {
|
|
|
14
11
|
return;
|
|
15
12
|
const confirmed = await new Promise((resolve) => {
|
|
16
13
|
context.editContext.confirm({
|
|
17
|
-
message: ((
|
|
14
|
+
message: (_jsxs("div", { children: ["Are you sure you want to delete", " ", _jsx("em", { children: items.map((x) => x.name).join(", ") }), "? This cannot be undone."] })),
|
|
18
15
|
header: "Confirmation",
|
|
19
16
|
icon: "pi pi-exclamation-triangle",
|
|
20
17
|
accept: () => resolve(true),
|
|
@@ -39,7 +36,7 @@ exports.deleteItemCommand = {
|
|
|
39
36
|
return false;
|
|
40
37
|
},
|
|
41
38
|
};
|
|
42
|
-
|
|
39
|
+
export const renameItemCommand = {
|
|
43
40
|
id: "renameItem",
|
|
44
41
|
label: "Rename",
|
|
45
42
|
icon: "pi pi-pencil",
|
|
@@ -52,7 +49,7 @@ exports.renameItemCommand = {
|
|
|
52
49
|
const item = context.data?.items[0];
|
|
53
50
|
if (!item)
|
|
54
51
|
return;
|
|
55
|
-
const newName = await context.openDialog(
|
|
52
|
+
const newName = await context.openDialog(ItemNameDialog, {
|
|
56
53
|
name: item.name,
|
|
57
54
|
title: "Rename Item",
|
|
58
55
|
message: "Enter a new name for the item:",
|
|
@@ -64,7 +61,7 @@ exports.renameItemCommand = {
|
|
|
64
61
|
}
|
|
65
62
|
},
|
|
66
63
|
};
|
|
67
|
-
|
|
64
|
+
export const insertItemCommand = {
|
|
68
65
|
id: "insertItem",
|
|
69
66
|
label: "Insert Item",
|
|
70
67
|
icon: "pi pi-plus",
|
|
@@ -80,7 +77,7 @@ exports.insertItemCommand = {
|
|
|
80
77
|
version: 0,
|
|
81
78
|
});
|
|
82
79
|
const templateName = templateItem?.name;
|
|
83
|
-
const name = await context.openDialog(
|
|
80
|
+
const name = await context.openDialog(ItemNameDialog, {
|
|
84
81
|
title: "Create Item",
|
|
85
82
|
message: "Enter a name for the new item:",
|
|
86
83
|
name: templateName,
|
|
@@ -117,7 +114,7 @@ exports.insertItemCommand = {
|
|
|
117
114
|
// );
|
|
118
115
|
// },
|
|
119
116
|
// };
|
|
120
|
-
|
|
117
|
+
export const publishItemCommand = {
|
|
121
118
|
id: "publishItem",
|
|
122
119
|
label: "Publish",
|
|
123
120
|
icon: "pi pi-cloud-upload",
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DialogProps } from "../../client/DialogContext";
|
|
2
|
+
import { FullItem } from "../../pageModel";
|
|
3
|
+
import { EditContextType } from "../../client/editContext";
|
|
4
|
+
export type LocalizeItemDialogProps = {
|
|
5
|
+
items: FullItem[];
|
|
6
|
+
editContext: EditContextType;
|
|
7
|
+
};
|
|
8
|
+
export declare function LocalizeItemDialog(props: LocalizeItemDialogProps & DialogProps<string>): import("react/jsx-runtime").JSX.Element;
|