@alpaca-editor/core 1.0.3767 → 1.0.3768
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,35 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
16
|
-
const editContext = (0, client_components_1.useEditContext)();
|
|
17
|
-
const opRef = (0, react_1.useRef)(null);
|
|
18
|
-
const [filter, setFilter] = (0, react_1.useState)("");
|
|
19
|
-
const filterRef = (0, react_1.useRef)(null);
|
|
20
|
-
const [activeTab, setActiveTab] = (0, react_1.useState)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../client-components";
|
|
3
|
+
import { useRef, useState, useEffect } from "react";
|
|
4
|
+
import { InputText } from "primereact/inputtext";
|
|
5
|
+
import { ScrollingContentTree } from "./ScrollingContentTree";
|
|
6
|
+
import { SimpleTabs } from "./ui/SimpleTabs";
|
|
7
|
+
import ItemSearch from "./ui/ItemSearch";
|
|
8
|
+
import { templatesRootItemId } from "../config/config";
|
|
9
|
+
export const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
10
|
+
const editContext = useEditContext();
|
|
11
|
+
const opRef = useRef(null);
|
|
12
|
+
const [filter, setFilter] = useState("");
|
|
13
|
+
const filterRef = useRef(null);
|
|
14
|
+
const [activeTab, setActiveTab] = useState(() => {
|
|
21
15
|
const stored = localStorage.getItem("editor.defaultInsertTab");
|
|
22
16
|
return stored ? parseInt(stored) : 0;
|
|
23
17
|
});
|
|
24
|
-
|
|
18
|
+
useEffect(() => {
|
|
25
19
|
localStorage.setItem("editor.defaultInsertTab", activeTab.toString());
|
|
26
20
|
}, [activeTab]);
|
|
27
|
-
const [recentTemplates, setRecentTemplates] =
|
|
28
|
-
const [recentItems, setRecentItems] =
|
|
29
|
-
const [hoveredItem, setHoveredItem] =
|
|
30
|
-
const [wizards, setWizards] =
|
|
31
|
-
const hideTimeoutRef =
|
|
32
|
-
|
|
21
|
+
const [recentTemplates, setRecentTemplates] = useState([]);
|
|
22
|
+
const [recentItems, setRecentItems] = useState([]);
|
|
23
|
+
const [hoveredItem, setHoveredItem] = useState();
|
|
24
|
+
const [wizards, setWizards] = useState([]);
|
|
25
|
+
const hideTimeoutRef = useRef(undefined);
|
|
26
|
+
useEffect(() => {
|
|
33
27
|
const loadRecentItems = async () => {
|
|
34
28
|
const items = await editContext?.itemsRepository.getItems(recentTemplates.map((id) => ({
|
|
35
29
|
id,
|
|
@@ -41,14 +35,14 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
41
35
|
};
|
|
42
36
|
loadRecentItems();
|
|
43
37
|
}, [recentTemplates]);
|
|
44
|
-
|
|
38
|
+
useEffect(() => {
|
|
45
39
|
const stored = localStorage.getItem("editor.recentTemplates");
|
|
46
40
|
if (stored) {
|
|
47
41
|
const parsed = JSON.parse(stored);
|
|
48
42
|
setRecentTemplates(parsed);
|
|
49
43
|
}
|
|
50
44
|
}, [insertOptions]);
|
|
51
|
-
|
|
45
|
+
useEffect(() => {
|
|
52
46
|
const loadWizards = async () => {
|
|
53
47
|
const wizards = await editContext?.configuration.pageWizard.getWizards(item.descriptor);
|
|
54
48
|
setWizards(wizards ?? []);
|
|
@@ -79,37 +73,37 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
79
73
|
: insertOptions.map((x) => ({
|
|
80
74
|
label: x.name,
|
|
81
75
|
id: x.id,
|
|
82
|
-
icon: ((
|
|
76
|
+
icon: (_jsx("img", { className: "p-menuitem-icon", src: x.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() })),
|
|
83
77
|
command: getCommand(x),
|
|
84
78
|
}));
|
|
85
79
|
const tabs = [
|
|
86
80
|
{
|
|
87
81
|
label: "Options",
|
|
88
|
-
content: ((
|
|
82
|
+
content: (_jsxs("div", { className: "flex flex-col gap-2 h-full", children: [_jsx(InputText, { ref: filterRef, className: "w-full", placeholder: "Filter", onChange: (e) => setFilter(e.target.value) }), _jsx("div", { className: "flex-1 relative", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: options
|
|
89
83
|
?.filter((x) => x.label.toLowerCase().indexOf(filter.toLowerCase()) > -1)
|
|
90
|
-
.map((option) => ((
|
|
84
|
+
.map((option) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
|
|
91
85
|
ev.stopPropagation();
|
|
92
86
|
ev.preventDefault();
|
|
93
87
|
option.command(ev);
|
|
94
|
-
}, children: [option.icon, (
|
|
88
|
+
}, children: [option.icon, _jsx("span", { className: "flex-1", children: option.label
|
|
95
89
|
.split(new RegExp(`(${filter})`, "i"))
|
|
96
|
-
.map((part, i) => part.toLowerCase() === filter.toLowerCase() ? ((
|
|
90
|
+
.map((part, i) => part.toLowerCase() === filter.toLowerCase() ? (_jsx("u", { className: "font-bold", children: part }, i)) : (part)) })] }, option.id))) }) })] })),
|
|
97
91
|
id: "options",
|
|
98
92
|
},
|
|
99
93
|
{
|
|
100
94
|
label: "Recent",
|
|
101
|
-
content: ((
|
|
95
|
+
content: (_jsx("div", { className: "flex flex-col h-full", children: recentItems.length === 0 ? (_jsx("div", { className: "text-sm text-gray-500 p-2", children: "No recent templates" })) : (recentItems.map((template) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
|
|
102
96
|
ev.stopPropagation();
|
|
103
97
|
ev.preventDefault();
|
|
104
98
|
getCommand(template)(ev);
|
|
105
|
-
}, children: [(
|
|
99
|
+
}, children: [_jsx("img", { className: "p-menuitem-icon", src: template.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), _jsx("span", { className: "flex-1", children: template.name })] }, template.id)))) })),
|
|
106
100
|
id: "recent",
|
|
107
101
|
},
|
|
108
102
|
{
|
|
109
103
|
label: "From Template",
|
|
110
|
-
content: ((
|
|
104
|
+
content: (_jsxs("div", { className: " h-full w-full flex flex-col gap-2", children: [_jsx(ItemSearch, { setHoveredItem: setHoveredItem, rootItemIds: [templatesRootItemId], itemSelected: (item) => {
|
|
111
105
|
getCommand(item)(null);
|
|
112
|
-
} }), (
|
|
106
|
+
} }), _jsx("div", { className: "flex-2 relative", children: _jsx("div", { className: "overflow-auto absolute inset-0", children: _jsx(ScrollingContentTree, { selectedItemId: hoveredItem?.id ?? item?.id, rootItemId: templatesRootItemId, onSelectionChange: (node) => {
|
|
113
107
|
if (Array.isArray(node) && node[0]) {
|
|
114
108
|
node = node[0];
|
|
115
109
|
}
|
|
@@ -123,7 +117,7 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
123
117
|
if (wizards.length > 0) {
|
|
124
118
|
tabs.push({
|
|
125
119
|
label: "Wizards",
|
|
126
|
-
content: ((
|
|
120
|
+
content: (_jsx("div", { children: wizards.map((wizard) => (_jsxs("div", { className: "flex items-center p-1 cursor-pointer hover:bg-gray-100 gap-2 text-xs", onClick: (ev) => {
|
|
127
121
|
ev.stopPropagation();
|
|
128
122
|
ev.preventDefault();
|
|
129
123
|
editContext?.executeCommand({
|
|
@@ -131,11 +125,11 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
131
125
|
data: { wizard, item: item.descriptor },
|
|
132
126
|
event: ev,
|
|
133
127
|
});
|
|
134
|
-
}, children: [(
|
|
128
|
+
}, children: [_jsx("img", { className: "p-menuitem-icon", src: wizard.icon, style: { height: "16px" }, width: "16", height: "16", onDragStart: (e) => e.preventDefault() }), _jsx("span", { className: "flex-1", children: wizard.name })] }, wizard.id))) })),
|
|
135
129
|
id: "wizards",
|
|
136
130
|
});
|
|
137
131
|
}
|
|
138
|
-
return ((
|
|
132
|
+
return (_jsxs("div", { className: "p-2", style: { display: "flex", alignItems: "center", cursor: "pointer" }, onMouseEnter: () => {
|
|
139
133
|
if (hideTimeoutRef.current) {
|
|
140
134
|
clearTimeout(hideTimeoutRef.current);
|
|
141
135
|
}
|
|
@@ -148,7 +142,7 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
148
142
|
}, onClick: (ev) => {
|
|
149
143
|
ev.stopPropagation();
|
|
150
144
|
ev.preventDefault();
|
|
151
|
-
}, children: [(
|
|
145
|
+
}, children: [_jsx("i", { className: "mr-2 pi pi-plus" }), _jsx("span", { className: "p-menuitem-text", children: "Insert" }), _jsx("div", { ref: opRef, className: "absolute bg-white shadow-lg rounded-md z-50 p-2", onKeyDownCapture: (ev) => {
|
|
152
146
|
ev.stopPropagation();
|
|
153
147
|
}, onKeyUpCapture: (ev) => {
|
|
154
148
|
ev.stopPropagation();
|
|
@@ -159,6 +153,5 @@ const InsertMenuTemplate = ({ insertOptions, item, commandCallback, }) => {
|
|
|
159
153
|
minWidth: "450px",
|
|
160
154
|
minHeight: "380px",
|
|
161
155
|
border: "1px solid #ddd",
|
|
162
|
-
}, children: (
|
|
156
|
+
}, children: _jsx("div", { className: "absolute inset-4 flex flex-col", children: _jsx(SimpleTabs, { tabs: tabs, setActiveTab: setActiveTab, activeTab: activeTab }) }) })] }));
|
|
163
157
|
};
|
|
164
|
-
exports.InsertMenuTemplate = InsertMenuTemplate;
|
package/dist/editor/ItemInfo.js
CHANGED
|
@@ -1,30 +1,27 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const CopyToClipboardButton_1 = require("./ui/CopyToClipboardButton");
|
|
8
|
-
const Section_1 = require("./ui/Section");
|
|
9
|
-
function ItemInfo({ item }) {
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { CopyToClipboardButton } from "./ui/CopyToClipboardButton";
|
|
5
|
+
import { Section } from "./ui/Section";
|
|
6
|
+
export function ItemInfo({ item }) {
|
|
10
7
|
if (!item?.fields)
|
|
11
8
|
return;
|
|
12
|
-
const editContext =
|
|
9
|
+
const editContext = useEditContext();
|
|
13
10
|
function formatRow(label, value) {
|
|
14
|
-
return ((
|
|
11
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: "font-bold", children: label }), _jsx("div", { children: value })] }));
|
|
15
12
|
}
|
|
16
|
-
return ((
|
|
13
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "flex items-center py-2 px-3 my-2", children: [_jsx("img", { src: item.largeIcon, alt: "Icon", className: "mr-2", style: { height: "32px", width: "32px" } }), _jsxs("h2", { className: "text-l font-bold", children: [item.name, _jsx("button", { className: "ml-2", onClick: () => {
|
|
17
14
|
editContext?.executeCommand({
|
|
18
15
|
command: editContext.configuration.commands.renameItem,
|
|
19
16
|
data: { items: [item] },
|
|
20
17
|
});
|
|
21
|
-
}, children: (
|
|
18
|
+
}, children: _jsx("i", { className: "pi pi-pencil" }) })] })] }), _jsx(Section, { title: "Info", children: _jsxs("div", { className: "grid grid-cols-[min-content_1fr] gap-3 text-xs", children: [_jsx("div", { className: "font-bold", children: "ID:" }), _jsxs("div", { children: [item.id, " ", _jsx(CopyToClipboardButton, { text: item.id })] }), _jsx("div", { className: "font-bold", children: "Path:" }), _jsxs("div", { children: [item.path, " ", _jsx(CopyToClipboardButton, { text: item.path })] }), _jsx("div", { className: "font-bold", children: "Language:" }), _jsx("div", { children: item.language }), _jsx("div", { className: "font-bold", children: "Version:" }), _jsx("div", { children: item.versions > 0 ? item.version : "No versions" }), _jsx("div", { className: "font-bold", children: "Template:" }), _jsxs("div", { children: [_jsxs("span", { className: "cursor-pointer hover:underline", onClick: () => {
|
|
22
19
|
editContext?.loadItem({
|
|
23
20
|
id: item.templateId,
|
|
24
21
|
language: "en",
|
|
25
22
|
version: 0,
|
|
26
23
|
});
|
|
27
24
|
editContext?.switchView("content-editor");
|
|
28
|
-
}, children: [" ", item.templateName, " (", item.templateId, " "] }), (
|
|
29
|
-
formatRow("Master languages", item.masterLanguages.join(", ")), item.translations && ((
|
|
25
|
+
}, children: [" ", item.templateName, " (", item.templateId, " "] }), _jsx(CopyToClipboardButton, { text: item.templateId }), ")"] }), item.masterLanguages &&
|
|
26
|
+
formatRow("Master languages", item.masterLanguages.join(", ")), item.translations && (_jsxs(_Fragment, { children: [_jsx("div", { className: "font-bold", children: "Languages" }), _jsx("div", { children: item.translations?.join(", ") })] }))] }) })] }));
|
|
30
27
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export type Link = {
|
|
2
|
+
url?: string;
|
|
3
|
+
itemId?: string;
|
|
4
|
+
queryString?: string;
|
|
5
|
+
target?: string;
|
|
6
|
+
customTarget?: string;
|
|
7
|
+
type: string;
|
|
8
|
+
targetItemLongId?: string;
|
|
9
|
+
targetItemName?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function LinkEditorDialog({ linkValue, onCancel, onOk, }: {
|
|
12
|
+
linkValue: Link;
|
|
13
|
+
onOk: (link: Link) => void;
|
|
14
|
+
onCancel: () => void;
|
|
15
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,29 +1,23 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
const [
|
|
20
|
-
|
|
21
|
-
const [customTarget, setCustomTarget] = (0, react_1.useState)();
|
|
22
|
-
const [queryString, setQueryString] = (0, react_1.useState)();
|
|
23
|
-
const [activeTabIndex, setActiveTabIndex] = (0, react_1.useState)(0);
|
|
24
|
-
const [selectedItemId, setSelectedItemId] = (0, react_1.useState)("");
|
|
25
|
-
const [hoveredItemId, setHoveredItemId] = (0, react_1.useState)();
|
|
26
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "primereact/dialog";
|
|
3
|
+
import { InputText } from "primereact/inputtext";
|
|
4
|
+
import { useEffect, useState } from "react";
|
|
5
|
+
import { Dropdown } from "primereact/dropdown";
|
|
6
|
+
import { Divider } from "primereact/divider";
|
|
7
|
+
import { Button } from "primereact/button";
|
|
8
|
+
import { Splitter, SplitterPanel } from "primereact/splitter";
|
|
9
|
+
import ItemSearch from "./ui/ItemSearch";
|
|
10
|
+
import { SimpleTabs } from "./ui/SimpleTabs";
|
|
11
|
+
import { ScrollingContentTree } from "./ScrollingContentTree";
|
|
12
|
+
export function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
|
|
13
|
+
const [url, setUrl] = useState();
|
|
14
|
+
const [targetWindow, setTargetWindow] = useState();
|
|
15
|
+
const [customTarget, setCustomTarget] = useState();
|
|
16
|
+
const [queryString, setQueryString] = useState();
|
|
17
|
+
const [activeTabIndex, setActiveTabIndex] = useState(0);
|
|
18
|
+
const [selectedItemId, setSelectedItemId] = useState("");
|
|
19
|
+
const [hoveredItemId, setHoveredItemId] = useState();
|
|
20
|
+
useEffect(() => {
|
|
27
21
|
setUrl(linkValue.url);
|
|
28
22
|
setTargetWindow(linkValue.target);
|
|
29
23
|
if (linkValue.type == "external")
|
|
@@ -53,9 +47,9 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
|
|
|
53
47
|
{
|
|
54
48
|
id: "internal",
|
|
55
49
|
label: "Internal",
|
|
56
|
-
content: ((
|
|
50
|
+
content: (_jsxs(Splitter, { className: "mt-4 flex-1", children: [_jsx(SplitterPanel, { className: "relative h-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ScrollingContentTree, { selectedItemId: hoveredItemId || selectedItemId, onSelectionChange: (selection) => {
|
|
57
51
|
setSelectedItemId(selection[0]?.id || "");
|
|
58
|
-
} }) }) }), (
|
|
52
|
+
} }) }) }), _jsx(SplitterPanel, { children: _jsx("div", { className: "relative ml-2 h-full w-full", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ItemSearch, { itemSelected: (item) => {
|
|
59
53
|
setSelectedItemId(item.id);
|
|
60
54
|
}, setHoveredItem: (item) => ((item) => {
|
|
61
55
|
if (!item)
|
|
@@ -66,17 +60,17 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
|
|
|
66
60
|
{
|
|
67
61
|
id: "external",
|
|
68
62
|
label: "External",
|
|
69
|
-
content: ((
|
|
63
|
+
content: (_jsxs("div", { className: "flex-1", children: [" ", _jsx("label", { className: "mt-4 block text-sm", children: "Url:" }), _jsx(InputText, { value: url || "", onChange: (e) => {
|
|
70
64
|
setUrl(e.target.value);
|
|
71
65
|
}, className: "w-full text-sm" })] })),
|
|
72
66
|
},
|
|
73
67
|
];
|
|
74
|
-
return ((
|
|
68
|
+
return (_jsx(Dialog, { style: { width: "60%", height: "70%" }, onHide: onCancel, header: "Select link target", visible: true, onShow: () => {
|
|
75
69
|
// Trigger a resize event to recalculate TabView layout
|
|
76
70
|
window.dispatchEvent(new Event("resize"));
|
|
77
|
-
}, children: (
|
|
71
|
+
}, children: _jsxs("div", { className: "flex h-full flex-col p-4", children: [linkValue && (_jsx(SimpleTabs, { tabs: tabs, activeTab: activeTabIndex, setActiveTab: setActiveTabIndex })), _jsx(Divider, {}), _jsx("label", { className: "text-xs", children: "QueryString" }), _jsx(InputText, { value: queryString, onChange: (e) => setQueryString(e.target.value), className: "text-sm" }), _jsx("label", { className: "mt-4 text-xs", children: "Window" }), _jsx(Dropdown, { options: targetWindows, optionLabel: "name", optionValue: "code", value: targetWindow, onChange: (e) => setTargetWindow(e.value), className: "text-sm" }), targetWindow === "custom" && (_jsxs("div", { className: "m-2", children: [_jsx("label", { className: "block text-xs", children: "Custom:" }), _jsx(InputText, { value: customTarget || "", onChange: (e) => {
|
|
78
72
|
setCustomTarget(e.target.value);
|
|
79
|
-
}, className: "text-sm" })] })), (
|
|
73
|
+
}, className: "text-sm" })] })), _jsx(Divider, {}), _jsxs("div", { className: "flex justify-end gap-3", children: [_jsx(Button, { onClick: () => {
|
|
80
74
|
onOk({
|
|
81
75
|
url,
|
|
82
76
|
target: getTargetWindow(),
|
|
@@ -85,5 +79,5 @@ function LinkEditorDialog({ linkValue, onCancel, onOk, }) {
|
|
|
85
79
|
queryString: queryString,
|
|
86
80
|
type: activeTabIndex === 1 ? "external" : "internal",
|
|
87
81
|
});
|
|
88
|
-
}, children: "Select" }), (
|
|
82
|
+
}, children: "Select" }), _jsx(Button, { onClick: onCancel, children: "Cancel" })] })] }) }));
|
|
89
83
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { EditorView } from "../config/types";
|
|
3
|
+
export default function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }: {
|
|
4
|
+
rightSidebar?: ReactNode;
|
|
5
|
+
rightSidebarTitle?: string;
|
|
6
|
+
view: EditorView;
|
|
7
|
+
centerPanelView: ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,30 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const editContext_1 = require("./client/editContext");
|
|
12
|
-
const Icons_1 = require("./ui/Icons");
|
|
13
|
-
const SidebarView_1 = require("./sidebar/SidebarView");
|
|
14
|
-
const Splitter_1 = require("./ui/Splitter");
|
|
15
|
-
const ViewSelector_1 = require("./sidebar/ViewSelector");
|
|
16
|
-
function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }) {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { classNames } from "primereact/utils";
|
|
5
|
+
import { useEditContext } from "./client/editContext";
|
|
6
|
+
import { NavigatorIcon } from "./ui/Icons";
|
|
7
|
+
import { SidebarView } from "./sidebar/SidebarView";
|
|
8
|
+
import { Splitter } from "./ui/Splitter";
|
|
9
|
+
import { ViewSelector } from "./sidebar/ViewSelector";
|
|
10
|
+
export default function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, className, }) {
|
|
17
11
|
const panels = [];
|
|
18
|
-
const editContext =
|
|
19
|
-
const mainLayoutDivRef =
|
|
20
|
-
const leftSidebarRef =
|
|
12
|
+
const editContext = useEditContext();
|
|
13
|
+
const mainLayoutDivRef = useRef(null);
|
|
14
|
+
const leftSidebarRef = React.useRef(null);
|
|
21
15
|
if (!editContext)
|
|
22
16
|
return null;
|
|
23
17
|
if (view.leftSidebar)
|
|
24
18
|
panels.push({
|
|
25
19
|
name: "leftSidebar",
|
|
26
20
|
defaultSize: 350,
|
|
27
|
-
content: ((
|
|
21
|
+
content: (_jsx("div", { className: "w-full h-full", ref: leftSidebarRef, style: { wordBreak: "normal" }, children: _jsx(SidebarView, { sidebar: view.leftSidebar, editContext: editContext, active: true }) })),
|
|
28
22
|
});
|
|
29
23
|
panels.push({
|
|
30
24
|
name: "center",
|
|
@@ -40,7 +34,7 @@ function MainLayout({ view, centerPanelView, rightSidebar, rightSidebarTitle, cl
|
|
|
40
34
|
});
|
|
41
35
|
}
|
|
42
36
|
if (!editContext?.configuration.editor.embedded) {
|
|
43
|
-
className =
|
|
37
|
+
className = classNames("fixed inset-0", className);
|
|
44
38
|
}
|
|
45
|
-
return ((
|
|
39
|
+
return (_jsxs("div", { className: classNames("flex flex-col select-none", className), ref: mainLayoutDivRef, children: [editContext?.configuration.editor.titlebar, _jsxs("div", { className: "flex flex-1", children: [!view.hideViewSelector && _jsx(ViewSelector, {}), _jsx("div", { className: "flex-1", children: _jsx(Splitter, { localStorageKey: "editor.panelSizes", expandLabel: _jsxs("div", { className: "flex items-center justify-center", children: [_jsx(NavigatorIcon, {}), _jsxs("div", { className: "mt-3", children: [rightSidebarTitle, " "] })] }), panels: panels }) })] })] }));
|
|
46
40
|
}
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.NewEditorClient = NewEditorClient;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
function NewEditorClient(props) {
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
export function NewEditorClient(props) {
|
|
7
4
|
console.log(props);
|
|
8
|
-
return (
|
|
5
|
+
return _jsx("div", { children: "Hello" });
|
|
9
6
|
}
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const [
|
|
17
|
-
const [rawValue, setRawValue] = (0, react_1.useState)();
|
|
18
|
-
const imageRef = (0, react_1.useRef)(null);
|
|
19
|
-
const [rect, setRect] = (0, react_1.useState)();
|
|
20
|
-
const rectRef = (0, react_1.useRef)(rect);
|
|
21
|
-
const movingRef = (0, react_1.useRef)(false);
|
|
22
|
-
const [startPos, setStartPos] = (0, react_1.useState)({
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "primereact/dialog";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { Button } from "primereact/button";
|
|
6
|
+
import DialogButtons from "./ui/DialogButtons";
|
|
7
|
+
import { classNames } from "primereact/utils";
|
|
8
|
+
export function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
9
|
+
const [pictureValue, setPictureValue] = useState();
|
|
10
|
+
const [isValid, setIsValid] = useState(true);
|
|
11
|
+
const [rawValue, setRawValue] = useState();
|
|
12
|
+
const imageRef = useRef(null);
|
|
13
|
+
const [rect, setRect] = useState();
|
|
14
|
+
const rectRef = useRef(rect);
|
|
15
|
+
const movingRef = useRef(false);
|
|
16
|
+
const [startPos, setStartPos] = useState({
|
|
23
17
|
x: 0,
|
|
24
18
|
y: 0,
|
|
25
19
|
});
|
|
26
|
-
const offset =
|
|
27
|
-
const editContext =
|
|
20
|
+
const offset = useRef({ x: 0, y: 0 });
|
|
21
|
+
const editContext = useEditContext();
|
|
28
22
|
const EDGE_THRESHOLD = 10; // pixels from edge to detect resize
|
|
29
|
-
const [resizeEdge, setResizeEdge] =
|
|
30
|
-
const resizeEdgeRef =
|
|
23
|
+
const [resizeEdge, setResizeEdge] = useState(null);
|
|
24
|
+
const resizeEdgeRef = useRef(null);
|
|
31
25
|
const getResizeEdge = (pos, rect, bounds) => {
|
|
32
26
|
if (!rect || !bounds)
|
|
33
27
|
return null;
|
|
@@ -59,7 +53,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
59
53
|
return "s";
|
|
60
54
|
return null;
|
|
61
55
|
};
|
|
62
|
-
|
|
56
|
+
useEffect(() => {
|
|
63
57
|
const deepCopy = JSON.parse(JSON.stringify(field.value));
|
|
64
58
|
setPictureValue(deepCopy);
|
|
65
59
|
const raw = field?.rawValue
|
|
@@ -70,7 +64,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
70
64
|
const selectedVariant = pictureValue && pictureValue.variants
|
|
71
65
|
? pictureValue.variants?.find((x) => x.name == selectedVariantName)
|
|
72
66
|
: null;
|
|
73
|
-
|
|
67
|
+
useEffect(() => {
|
|
74
68
|
if (selectedVariant?.region &&
|
|
75
69
|
(!selectedVariant.aspectRatioLock ||
|
|
76
70
|
Math.abs(selectedVariant.aspectRatioLock -
|
|
@@ -89,7 +83,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
89
83
|
setRect(undefined);
|
|
90
84
|
}
|
|
91
85
|
}, [selectedVariant]);
|
|
92
|
-
|
|
86
|
+
useEffect(() => {
|
|
93
87
|
if (!rect)
|
|
94
88
|
return;
|
|
95
89
|
if ((selectedVariant?.minWidth && selectedVariant.minWidth > widthPx) ||
|
|
@@ -100,7 +94,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
100
94
|
setIsValid(true);
|
|
101
95
|
rectRef.current = rect;
|
|
102
96
|
}, [rect]);
|
|
103
|
-
|
|
97
|
+
useEffect(() => {
|
|
104
98
|
if (!rawValue)
|
|
105
99
|
return;
|
|
106
100
|
if (!selectedVariantName)
|
|
@@ -298,11 +292,11 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
298
292
|
const scale = imageBounds ? selectedVariant.width / imageBounds.width : 0;
|
|
299
293
|
const widthPx = rect ? Math.round(rect.width * selectedVariant.width) : 0;
|
|
300
294
|
const heightPx = rect ? Math.round(rect.height * selectedVariant.height) : 0;
|
|
301
|
-
return ((
|
|
302
|
-
widthPx < selectedVariant.minWidth && ((
|
|
303
|
-
heightPx < selectedVariant.minHeight && ((
|
|
295
|
+
return (_jsx(_Fragment, { children: _jsx(Dialog, { header: "Crop " + field.name + " - " + selectedVariantName, pt: { content: { style: { paddingLeft: "0" } } }, visible: true, style: { width: "75vw", height: "75vh" }, onHide: onClose, children: _jsxs("div", { className: "flex gap-1 flex-col justify h-full", children: [_jsxs("div", { className: "flex-1 flex gap-2", children: [_jsxs("div", { className: "w-56 text-sm p-4 bg-gray-100 flex flex-col gap-3", children: [_jsx(LabelAndValue, { label: "Variant:", value: selectedVariantName }), _jsx(LabelAndValue, { label: "Image Dimensions:", value: _jsxs(_Fragment, { children: [selectedVariant.width, " x ", selectedVariant.height] }) }), selectedVariant.aspectRatioLock && (_jsx(LabelAndValue, { label: "Required Aspect Ratio:", value: selectedVariant.aspectRatioLockText })), selectedVariant.minWidth && (_jsx(LabelAndValue, { label: "Minimum Width:", value: selectedVariant.minWidth })), selectedVariant.minHeight && (_jsx(LabelAndValue, { label: "Minimum Height:", value: selectedVariant.minHeight })), rect && (_jsxs(_Fragment, { children: [_jsx(LabelAndValue, { label: "Selection:", value: _jsxs(_Fragment, { children: [widthPx, " x ", heightPx] }) }), selectedVariant.minWidth &&
|
|
296
|
+
widthPx < selectedVariant.minWidth && (_jsx("div", { className: "text-red-500", children: "Minimum width not met!" })), selectedVariant.minHeight &&
|
|
297
|
+
heightPx < selectedVariant.minHeight && (_jsx("div", { className: "text-red-500", children: "Minimum height not met!" }))] }))] }), _jsx("div", { className: "flex-1 relative p-3", children: _jsx("div", { className: "absolute inset-0 top-3 select-none flex items-center justify-center", children: _jsxs("div", { ref: imageRef, className: "relative cursor-crosshair max-h-full", style: {
|
|
304
298
|
aspectRatio: `${selectedVariant.width}/${selectedVariant.height}`,
|
|
305
|
-
}, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, children: [(
|
|
299
|
+
}, onMouseDown: handleMouseDown, onMouseMove: handleMouseMove, children: [_jsx("img", { className: "object-scale-down", src: selectedVariant.originalSrc ?? selectedVariant.src }), rect && (_jsx("div", { className: classNames("absolute bg-opacity-70 border text-xs cursor-move", isValid
|
|
306
300
|
? "bg-blue-200 border-blue-400 text-blue-500"
|
|
307
301
|
: "bg-red-200 border-red-400 text-red-500"), style: {
|
|
308
302
|
left: rect.x * 100 + "%",
|
|
@@ -314,7 +308,7 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
314
308
|
? `${resizeEdge}-resize`
|
|
315
309
|
: `${resizeEdge}-resize`
|
|
316
310
|
: "move",
|
|
317
|
-
}, children: widthPx / scale > 50 && ((
|
|
311
|
+
}, children: widthPx / scale > 50 && (_jsxs("div", { className: "absolute bottom-1 right-2 text-nowrap", style: { textShadow: "white 1px 1px" }, children: [widthPx, " x ", heightPx] })) }))] }) }) })] }), _jsxs(DialogButtons, { children: [_jsx(Button, { onClick: () => setRect(undefined), children: "Reset" }), _jsx(Button, { size: "small", disabled: !isValid, onClick: () => {
|
|
318
312
|
if (pictureValue) {
|
|
319
313
|
if (field) {
|
|
320
314
|
editContext?.operations.editField({
|
|
@@ -325,8 +319,8 @@ function PictureCropper({ field, onClose, variantName: selectedVariantName, }) {
|
|
|
325
319
|
}
|
|
326
320
|
}
|
|
327
321
|
onClose();
|
|
328
|
-
}, children: "Ok" }), (
|
|
322
|
+
}, children: "Ok" }), _jsx(Button, { onClick: onClose, size: "small", children: "Cancel" })] })] }) }) }));
|
|
329
323
|
}
|
|
330
324
|
function LabelAndValue({ label, value, }) {
|
|
331
|
-
return ((
|
|
325
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "font-bold", children: label }), _jsx("div", { children: value })] }));
|
|
332
326
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PictureField } from "./fieldTypes";
|
|
2
|
+
export declare function PictureEditor({ field, variantName, style, forwardScrollevents, isPageEditor, }: {
|
|
3
|
+
field: PictureField;
|
|
4
|
+
variantName: string;
|
|
5
|
+
style?: React.CSSProperties;
|
|
6
|
+
forwardScrollevents?: boolean;
|
|
7
|
+
isPageEditor?: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|