@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,20 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
const [showMenu, setShowMenu] = (0, react_1.useState)(false);
|
|
10
|
-
const [showCropper, setShowCropper] = (0, react_1.useState)(false);
|
|
11
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useState } from "react";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { PictureCropper } from "./PictureCropper";
|
|
5
|
+
export function PictureEditor({ field, variantName, style, forwardScrollevents, isPageEditor, }) {
|
|
6
|
+
const [showMenu, setShowMenu] = useState(false);
|
|
7
|
+
const [showCropper, setShowCropper] = useState(false);
|
|
8
|
+
const editContext = useEditContext();
|
|
12
9
|
const variant = field.value?.variants?.find((v) => v.name === variantName);
|
|
13
10
|
const raw = field?.rawValue && field?.rawValue[0] === "{"
|
|
14
11
|
? JSON.parse(field?.rawValue)
|
|
15
12
|
: { Variants: [] };
|
|
16
13
|
const rawVariant = raw.Variants?.find((x) => x.Name == variantName);
|
|
17
|
-
const reset =
|
|
14
|
+
const reset = useCallback(() => {
|
|
18
15
|
raw.Variants = raw.Variants.filter((x) => x.Name !== variantName);
|
|
19
16
|
editContext.operations.editField({
|
|
20
17
|
field: field.descriptor,
|
|
@@ -22,7 +19,7 @@ function PictureEditor({ field, variantName, style, forwardScrollevents, isPageE
|
|
|
22
19
|
refresh: "immediate",
|
|
23
20
|
});
|
|
24
21
|
}, [field, variant]);
|
|
25
|
-
const imageSelected =
|
|
22
|
+
const imageSelected = useCallback(async (imageId) => {
|
|
26
23
|
const selected = raw.Variants?.find((x) => x.Name == variantName);
|
|
27
24
|
if (!selected) {
|
|
28
25
|
if (!raw.Variants)
|
|
@@ -41,7 +38,7 @@ function PictureEditor({ field, variantName, style, forwardScrollevents, isPageE
|
|
|
41
38
|
refresh: "immediate",
|
|
42
39
|
});
|
|
43
40
|
}, [field, variant]);
|
|
44
|
-
const videoSelected =
|
|
41
|
+
const videoSelected = useCallback(async (videoId) => {
|
|
45
42
|
const selected = raw.Variants?.find((x) => x.Name == variantName);
|
|
46
43
|
if (!selected) {
|
|
47
44
|
if (!raw.Variants)
|
|
@@ -77,7 +74,7 @@ function PictureEditor({ field, variantName, style, forwardScrollevents, isPageE
|
|
|
77
74
|
videoSelected(selectedVideoId);
|
|
78
75
|
}
|
|
79
76
|
const notEmpty = variant?.mediaId;
|
|
80
|
-
return ((
|
|
77
|
+
return (_jsxs("div", { className: "absolute inset-0 flex items-center justify-center", onMouseEnter: () => setShowMenu(true), onMouseLeave: () => setShowMenu(false), onClick: () => {
|
|
81
78
|
if (!isPageEditor)
|
|
82
79
|
return;
|
|
83
80
|
const itemId = field.descriptor.item?.id;
|
|
@@ -95,10 +92,10 @@ function PictureEditor({ field, variantName, style, forwardScrollevents, isPageE
|
|
|
95
92
|
left: 0,
|
|
96
93
|
top: e.deltaY,
|
|
97
94
|
});
|
|
98
|
-
}, style: style, "data-testid": "select-media", children: [showMenu && ((
|
|
95
|
+
}, style: style, "data-testid": "select-media", children: [showMenu && (_jsxs("div", { className: "p-3 grid grid-cols-2 gap-1.5 items-stretch justify-center text-sm min-w-48", children: [_jsx(Btn, { label: "Select", icon: "pi pi-image", onClick: () => selectMedia("images"), testId: "select-media-button", className: "min-w-[80px]" }), field.value?.allowVideos && (_jsx(Btn, { label: "Video", icon: "pi pi-video", onClick: () => selectVideo(), testId: "video-media-button", className: "min-w-[80px]" })), notEmpty && (_jsx(Btn, { label: "Crop", icon: "pi pi-expand", onClick: () => {
|
|
99
96
|
setShowCropper(true);
|
|
100
|
-
}, testId: "crop-media-button", className: "min-w-[80px]" })), rawVariant && ((
|
|
97
|
+
}, testId: "crop-media-button", className: "min-w-[80px]" })), rawVariant && (_jsx(Btn, { label: "Reset", icon: "pi pi-times", onClick: () => reset(), testId: "reset-media-button", className: "min-w-[80px]" }))] })), showCropper && (_jsx(PictureCropper, { field: field, onClose: () => setShowCropper(false), variantName: variantName }))] }));
|
|
101
98
|
}
|
|
102
99
|
function Btn({ label, icon, onClick, testId, className, }) {
|
|
103
|
-
return ((
|
|
100
|
+
return (_jsxs("button", { className: `btn bg-gray-500 text-white p-1.5 rounded-lg opacity-70 border hover:opacity-85 gap-1.5 flex items-center cursor-pointer ${className}`, onClick: onClick, "data-testid": testId, children: [_jsx("i", { className: icon }), " ", label] }));
|
|
104
101
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PictureField, PictureValue } from "./fieldTypes";
|
|
2
|
+
import { MediaPictureParams, PictureParams } from "./picture-shared";
|
|
3
|
+
export declare function PictureEditorDialog({ field, onCancel, onOk, params, }: {
|
|
4
|
+
field: PictureField;
|
|
5
|
+
onOk: (link: PictureValue) => void;
|
|
6
|
+
onCancel: () => void;
|
|
7
|
+
params?: PictureParams | MediaPictureParams;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const editService_1 = require("./services/editService");
|
|
14
|
-
const picture_shared_1 = require("./picture-shared");
|
|
15
|
-
function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
16
|
-
const [selectedVariantName, setSelectedVariantName] = (0, react_1.useState)();
|
|
17
|
-
const [pictureValue, setPictureValue] = (0, react_1.useState)();
|
|
18
|
-
const [rawValue, setRawValue] = (0, react_1.useState)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Dialog } from "primereact/dialog";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
|
+
import { Button } from "primereact/button";
|
|
6
|
+
import DialogButtons from "./ui/DialogButtons";
|
|
7
|
+
import { getPictureValue } from "./services/editService";
|
|
8
|
+
import { getRenderedPictureVariant, } from "./picture-shared";
|
|
9
|
+
export function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
10
|
+
const [selectedVariantName, setSelectedVariantName] = useState();
|
|
11
|
+
const [pictureValue, setPictureValue] = useState();
|
|
12
|
+
const [rawValue, setRawValue] = useState();
|
|
19
13
|
const emptyRect = () => ({
|
|
20
14
|
width: 0,
|
|
21
15
|
height: 0,
|
|
22
16
|
top: 0,
|
|
23
17
|
left: 0,
|
|
24
18
|
});
|
|
25
|
-
const [rect, setRect] =
|
|
26
|
-
const editContext =
|
|
27
|
-
|
|
19
|
+
const [rect, setRect] = useState(emptyRect());
|
|
20
|
+
const editContext = useEditContext();
|
|
21
|
+
useEffect(() => {
|
|
28
22
|
setSelectedVariantName(field?.value?.variants[0].name);
|
|
29
23
|
}, []);
|
|
30
|
-
|
|
24
|
+
useEffect(() => {
|
|
31
25
|
const deepCopy = JSON.parse(JSON.stringify(field.value));
|
|
32
26
|
setPictureValue(deepCopy);
|
|
33
27
|
const raw = field?.rawValue
|
|
@@ -48,7 +42,7 @@ function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
|
48
42
|
const selectedVariant = pictureValue && pictureValue.variants
|
|
49
43
|
? pictureValue.variants?.find((x) => x.name == selectedVariantName)
|
|
50
44
|
: null;
|
|
51
|
-
|
|
45
|
+
useEffect(() => {
|
|
52
46
|
if (selectedVariant?.region &&
|
|
53
47
|
(!selectedVariant.aspectRatioLock ||
|
|
54
48
|
Math.abs(selectedVariant.aspectRatioLock -
|
|
@@ -66,9 +60,9 @@ function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
|
66
60
|
const getPictureFieldValue = async (field, rawValue) => {
|
|
67
61
|
if (!editContext?.pageView.site)
|
|
68
62
|
return null;
|
|
69
|
-
return
|
|
63
|
+
return getPictureValue(field, rawValue, editContext.pageView.site?.name, editContext.sessionId);
|
|
70
64
|
};
|
|
71
|
-
const imageSelected =
|
|
65
|
+
const imageSelected = useCallback(async (imageId, variantName, rawValue) => {
|
|
72
66
|
if (!variantName || !rawValue)
|
|
73
67
|
return;
|
|
74
68
|
const selected = rawValue.Variants?.find((x) => x.Name == variantName);
|
|
@@ -122,11 +116,11 @@ function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
|
122
116
|
}
|
|
123
117
|
};
|
|
124
118
|
const usage = getUsage(pictureValue, params);
|
|
125
|
-
return ((
|
|
126
|
-
pictureValue.variants?.map((variant) => ((
|
|
119
|
+
return (_jsx(_Fragment, { children: _jsx(Dialog, { header: "Edit " + field.name, visible: true, style: { width: "70vw", height: "70vh" }, onHide: onCancel, 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: " h-full border-r pt-3 w-48 relative", children: [_jsx("div", { className: "absolute inset-0 overflow-y-auto flex flex-col gap-6", children: pictureValue &&
|
|
120
|
+
pictureValue.variants?.map((variant) => (_jsxs("div", { onClick: () => setSelectedVariantName(variant.name), className: "text-xs flex flex-col items-center justify-center gap-1 cursor-pointer", children: [_jsx("div", { className: "flex justify-center items-center h-40 w-40 border relative" +
|
|
127
121
|
(selectedVariantName == variant.name
|
|
128
122
|
? " shadow-xl "
|
|
129
|
-
: ""), children: variant.src && (
|
|
123
|
+
: ""), children: variant.src && _jsx("img", { src: variant.thumbSrc }) }), _jsxs("div", { className: "w-40", children: [_jsx("div", { children: variant.name }), _jsx("div", { children: variant.aspectRatioLockText }), _jsxs("div", { children: [_jsxs("div", { className: "break-all", children: ["Name: ", variant.mediaItemName] }), _jsxs("div", { children: ["Orig. size: ", variant.width, " x ", variant.height] }), (variant.width < 1 || variant.height < 1) && (_jsxs("span", { children: [" ", _jsx("i", { className: "pi pi-exclamation-triangle text-red-600 " })] }))] })] })] }, variant.name))) }), usage && _jsx("div", { className: "text-xs", children: usage })] }), _jsx("div", { className: "flex-1 relative p-3", children: _jsxs("div", { className: "absolute inset-0 top-3 overflow-auto select-none flex align-center justify-center", children: [selectedVariant && (_jsxs("div", { className: "relative", onDoubleClick: () => selectMedia(), onMouseDown: (ev) => {
|
|
130
124
|
ev.preventDefault();
|
|
131
125
|
ev.stopPropagation();
|
|
132
126
|
const bounds = ev.currentTarget.getBoundingClientRect();
|
|
@@ -152,12 +146,12 @@ function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
|
152
146
|
ev.preventDefault();
|
|
153
147
|
ev.stopPropagation();
|
|
154
148
|
}
|
|
155
|
-
}, onMouseUp: () => setVariantCrop(), children: [(
|
|
149
|
+
}, onMouseUp: () => setVariantCrop(), children: [_jsx("img", { src: selectedVariant.originalSrc ?? selectedVariant.src, className: "object-contain h-full w-full" }), _jsx("div", { className: "absolute bg-opacity-70 bg-gray-300", style: {
|
|
156
150
|
left: rect.left * 100 + "%",
|
|
157
151
|
top: rect.top * 100 + "%",
|
|
158
152
|
width: rect.width * 100 + "%",
|
|
159
153
|
height: rect.height * 100 + "%",
|
|
160
|
-
} })] })), selectedVariant && ((
|
|
154
|
+
} })] })), selectedVariant && (_jsxs("div", { className: "absolute top-0 right-0 cursor-pointer text-sm flex flex-col gap-1 items-center p-2 bg-gray-100 bg-opacity-70", onClick: () => selectMedia(), children: [_jsx("i", { className: "pi pi-pencil text-xl" }), "Choose"] }))] }) })] }), _jsxs(DialogButtons, { children: [_jsx(Button, { size: "small", onClick: () => {
|
|
161
155
|
if (pictureValue) {
|
|
162
156
|
if (field) {
|
|
163
157
|
editContext?.operations.editField({
|
|
@@ -168,7 +162,7 @@ function PictureEditorDialog({ field, onCancel, onOk, params, }) {
|
|
|
168
162
|
}
|
|
169
163
|
onOk(pictureValue);
|
|
170
164
|
}
|
|
171
|
-
}, children: "Ok" }), (
|
|
165
|
+
}, children: "Ok" }), _jsx(Button, { onClick: () => {
|
|
172
166
|
onCancel();
|
|
173
167
|
}, size: "small", children: "Cancel" })] })] }) }) }));
|
|
174
168
|
}
|
|
@@ -185,10 +179,10 @@ function getUsage(pictureValue, params) {
|
|
|
185
179
|
const variants = sources
|
|
186
180
|
.map((source) => ({
|
|
187
181
|
source,
|
|
188
|
-
variant:
|
|
182
|
+
variant: getRenderedPictureVariant(mediaParams[source], pictureValue.variants),
|
|
189
183
|
}))
|
|
190
184
|
.filter((x) => x.variant);
|
|
191
|
-
return ((
|
|
185
|
+
return (_jsxs(_Fragment, { children: ["This field rendering is using these variants:", _jsx("table", { children: variants.map((v) => (_jsxs("tr", { children: [_jsx("td", { children: v.source }), _jsx("td", { children: _jsx("b", { children: v.variant.name }) })] }))) })] }));
|
|
192
186
|
}
|
|
193
|
-
return ((
|
|
187
|
+
return (_jsxs(_Fragment, { children: ["This field rendering is using the variant", " ", _jsxs("b", { children: [getRenderedPictureVariant(params, pictureValue.variants)?.name, "."] })] }));
|
|
194
188
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ItemTreeNodeData } from "./services/contentService";
|
|
2
|
+
export declare function ScrollingContentTree({ selectedItemId, onSelectionChange, rootItemId, }: {
|
|
3
|
+
selectedItemId?: string;
|
|
4
|
+
onSelectionChange?: (itemIds: ItemTreeNodeData[]) => void;
|
|
5
|
+
rootItemId?: string;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,18 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const config_1 = require("../config/config");
|
|
11
|
-
const editContext_1 = require("./client/editContext");
|
|
12
|
-
function ScrollingContentTree({ selectedItemId, onSelectionChange, rootItemId, }) {
|
|
13
|
-
const [selectedItem, setSelectdItem] = (0, react_1.useState)(null);
|
|
14
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
15
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import ContentTree from "./ContentTree";
|
|
4
|
+
import { contentItemId } from "../config/config";
|
|
5
|
+
import { useEditContext } from "./client/editContext";
|
|
6
|
+
export function ScrollingContentTree({ selectedItemId, onSelectionChange, rootItemId, }) {
|
|
7
|
+
const [selectedItem, setSelectdItem] = useState(null);
|
|
8
|
+
const editContext = useEditContext();
|
|
9
|
+
useEffect(() => {
|
|
16
10
|
const loadItem = async () => {
|
|
17
11
|
if (!selectedItemId)
|
|
18
12
|
return;
|
|
@@ -26,5 +20,5 @@ function ScrollingContentTree({ selectedItemId, onSelectionChange, rootItemId, }
|
|
|
26
20
|
};
|
|
27
21
|
loadItem();
|
|
28
22
|
}, [selectedItemId]);
|
|
29
|
-
return ((
|
|
23
|
+
return (_jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(ContentTree, { language: editContext.currentItemDescriptor?.language ?? "en", rootItemId: rootItemId ?? contentItemId, expandIdPath: selectedItem?.idPath, selectedItemIds: selectedItemId ? [selectedItemId] : [], selectionMode: "single", className: "h-full p-1", onSelectionChange: onSelectionChange }) }));
|
|
30
24
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const Terminal: React.ForwardRefExoticComponent<{
|
|
3
|
+
commandHandler: (text: string, callback: (text: React.ReactNode, finished: boolean) => void) => void;
|
|
4
|
+
prompt: string;
|
|
5
|
+
setPrompt: (text: string) => void;
|
|
6
|
+
onReset: () => void;
|
|
7
|
+
toolbar?: React.ReactNode;
|
|
8
|
+
statusbar?: React.ReactNode;
|
|
9
|
+
infobar?: React.ReactNode;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
className?: string;
|
|
12
|
+
} & React.RefAttributes<{
|
|
13
|
+
submit: () => void;
|
|
14
|
+
}>>;
|
package/dist/editor/Terminal.js
CHANGED
|
@@ -1,34 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const inputtextarea_1 = require("primereact/inputtextarea");
|
|
8
|
-
const utils_1 = require("primereact/utils");
|
|
9
|
-
exports.Terminal = (0, react_1.forwardRef)((props, ref) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useEffect, useRef, useState, useImperativeHandle, } from "react";
|
|
3
|
+
import { Button } from "primereact/button";
|
|
4
|
+
import { InputTextarea } from "primereact/inputtextarea";
|
|
5
|
+
import { classNames } from "primereact/utils";
|
|
6
|
+
export const Terminal = forwardRef((props, ref) => {
|
|
10
7
|
const { commandHandler, prompt, setPrompt, onReset, toolbar, statusbar, infobar, disabled, className, } = props;
|
|
11
|
-
const [response, setResponse] =
|
|
12
|
-
const [messages, setMessages] =
|
|
13
|
-
const bottomRef =
|
|
14
|
-
const messageRef =
|
|
15
|
-
const inputRef =
|
|
16
|
-
const [promptHistory, setPromptHistory] =
|
|
8
|
+
const [response, setResponse] = useState();
|
|
9
|
+
const [messages, setMessages] = useState([]);
|
|
10
|
+
const bottomRef = useRef(null);
|
|
11
|
+
const messageRef = useRef(messages);
|
|
12
|
+
const inputRef = useRef(null);
|
|
13
|
+
const [promptHistory, setPromptHistory] = useState(() => {
|
|
17
14
|
if (typeof window !== "undefined") {
|
|
18
15
|
return JSON.parse(localStorage.getItem("editor.ai.promptHistory") || "[]");
|
|
19
16
|
}
|
|
20
17
|
return [];
|
|
21
18
|
});
|
|
22
|
-
const [currentHistoryIndex, setCurrentHistoryIndex] =
|
|
23
|
-
|
|
19
|
+
const [currentHistoryIndex, setCurrentHistoryIndex] = useState(-1);
|
|
20
|
+
useEffect(() => {
|
|
24
21
|
localStorage.setItem("editor.ai.promptHistory", JSON.stringify(promptHistory));
|
|
25
22
|
}, [promptHistory]);
|
|
26
|
-
|
|
23
|
+
useEffect(() => {
|
|
27
24
|
if (inputRef.current) {
|
|
28
25
|
inputRef.current.focus();
|
|
29
26
|
}
|
|
30
27
|
}, []);
|
|
31
|
-
|
|
28
|
+
useEffect(() => {
|
|
32
29
|
messageRef.current = messages;
|
|
33
30
|
}, [messages]);
|
|
34
31
|
const callback = (text, finished) => {
|
|
@@ -75,7 +72,7 @@ exports.Terminal = (0, react_1.forwardRef)((props, ref) => {
|
|
|
75
72
|
}
|
|
76
73
|
}
|
|
77
74
|
};
|
|
78
|
-
|
|
75
|
+
useEffect(() => {
|
|
79
76
|
// Scroll to bottom every time messages or response changes.
|
|
80
77
|
bottomRef.current?.scrollIntoView({ behavior: "smooth" });
|
|
81
78
|
}, [messages, response]);
|
|
@@ -99,11 +96,11 @@ exports.Terminal = (0, react_1.forwardRef)((props, ref) => {
|
|
|
99
96
|
setResponse("...");
|
|
100
97
|
commandHandler(prompt, callback);
|
|
101
98
|
};
|
|
102
|
-
|
|
99
|
+
useImperativeHandle(ref, () => ({
|
|
103
100
|
submit,
|
|
104
101
|
}));
|
|
105
|
-
return ((
|
|
102
|
+
return (_jsxs("div", { className: classNames("flex flex-col h-full", className), children: [_jsxs("div", { className: "p-1 border-b border-gray-200 flex justify-between gap-2 text-xs items-center", children: [_jsx("button", { onClick: () => {
|
|
106
103
|
setMessages([]);
|
|
107
104
|
onReset();
|
|
108
|
-
}, children: (
|
|
105
|
+
}, children: _jsx("i", { className: "pi pi-trash text-sm m-1" }) }), toolbar] }), _jsx("div", { className: "overflow-y-auto h-full overflow-x-hidden p-2", children: _jsxs("div", { className: "flex flex-col gap-3 items-end select-text", children: [messages.map((m, i) => (_jsx("div", { className: getClasses(m), children: m.text }, i))), response != null && (_jsx("div", { className: responseBoxClasses, children: _jsxs("div", { className: "flex text-xs", children: [_jsxs("div", { className: "text-xs mr-4", children: [_jsx("i", { className: "pi pi-spin pi-spinner" }), " "] }), response] }) })), _jsx("div", { ref: bottomRef })] }) }), _jsxs("div", { className: "flex flex-col p-1 pb-0", children: [infobar, _jsx(InputTextarea, { ref: inputRef, value: prompt, className: "border-gray-300 border rounded flex-1 text-xs resize-none self-stretch", onKeyDown: handleKeyPress, onChange: (e) => setPrompt(e.target.value), rows: 4, cols: 30, disabled: disabled }), _jsxs("div", { className: "flex justify-between items-center py-1", children: [statusbar, _jsx(Button, { icon: "pi pi-send", text: true, size: "small", className: "tour-send-button", onClick: submit, disabled: prompt.trim().length === 0 })] })] })] }));
|
|
109
106
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Titlebar(): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/editor/Titlebar.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
const editContext_1 = require("./client/editContext");
|
|
6
|
-
function Titlebar() {
|
|
7
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "./client/editContext";
|
|
3
|
+
export function Titlebar() {
|
|
4
|
+
const editContext = useEditContext();
|
|
8
5
|
if (!editContext?.view)
|
|
9
6
|
return null;
|
|
10
|
-
return ((
|
|
7
|
+
return (_jsxs("div", { className: "bg-gradient-to-r from-gray-900 from-10% vigray-500 to-indigo-950 h-12 flex justify-between items-center z-1 min-h-12", children: [_jsxs("div", { className: "text-white flex gap-2 items-center relative pl-2 font-bold", children: [_jsx("a", { href: "/sitecore/shell/sitecore/client/Applications/Launchpad", className: "glow-text", children: _jsx("i", { className: "pi pi-sparkles text-pink-400" }) }), " ", _jsx("span", { className: "ml-2 font-mono", children: "editor" })] }), _jsx("div", { children: editContext?.view.primaryControls }), _jsx("div", { children: editContext?.view.secondaryControls })] }));
|
|
11
8
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SyntheticEvent } from "react";
|
|
2
|
+
import { AiTerminalOptions } from "./AiTerminal";
|
|
3
|
+
export interface AiPopupRef {
|
|
4
|
+
show: (event: SyntheticEvent, terminalOptions?: AiTerminalOptions) => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface AiPopupProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const AiPopup: import("react").ForwardRefExoticComponent<AiPopupProps & import("react").RefAttributes<AiPopupRef>>;
|
|
10
|
+
export {};
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
exports.AiPopup = (0, react_1.forwardRef)((_, ref) => {
|
|
11
|
-
const overlayRef = (0, react_1.useRef)(null);
|
|
12
|
-
const [terminalOptions, setTerminalOptions] = (0, react_1.useState)();
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
4
|
+
import { Button } from "primereact/button";
|
|
5
|
+
import { forwardRef, useImperativeHandle, useRef, useState, } from "react";
|
|
6
|
+
import { EditorAiTerminal } from "./EditorAiTerminal";
|
|
7
|
+
export const AiPopup = forwardRef((_, ref) => {
|
|
8
|
+
const overlayRef = useRef(null);
|
|
9
|
+
const [terminalOptions, setTerminalOptions] = useState();
|
|
13
10
|
//const [components, setComponents] = useState<ComponentData[]>([]); // [componentId, componentId, ...]
|
|
14
|
-
|
|
11
|
+
useImperativeHandle(ref, () => ({
|
|
15
12
|
show: (ev, terminalOptions) => {
|
|
16
13
|
setTerminalOptions(terminalOptions);
|
|
17
14
|
//setComponents(components || []);
|
|
@@ -21,5 +18,5 @@ exports.AiPopup = (0, react_1.forwardRef)((_, ref) => {
|
|
|
21
18
|
overlayRef.current?.hide();
|
|
22
19
|
},
|
|
23
20
|
}));
|
|
24
|
-
return ((
|
|
21
|
+
return (_jsx(OverlayPanel, { ref: overlayRef, children: _jsx("div", { className: "w-96 h-96 flex flex-col gap-2", onClick: (ev) => ev.stopPropagation(), children: _jsx(EditorAiTerminal, { options: terminalOptions, closeButton: _jsx(Button, { icon: "pi pi-times", onClick: () => overlayRef.current?.hide(), size: "small", text: true }) }) }) }));
|
|
25
22
|
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToolCall } from "./AiToolCall";
|
|
2
|
+
import { EditOperation } from "../../types";
|
|
3
|
+
export declare function AiResponseMessage({ responseText, toolcalls, editOperations, finished, }: {
|
|
4
|
+
responseText: string;
|
|
5
|
+
toolcalls: ToolCall[];
|
|
6
|
+
editOperations: EditOperation[];
|
|
7
|
+
finished: boolean;
|
|
8
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const editContext_1 = require("../client/editContext");
|
|
8
|
-
function AiResponseMessage({ responseText, toolcalls, editOperations, finished, }) {
|
|
9
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from "react";
|
|
3
|
+
import { AiToolCall } from "./AiToolCall";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
export function AiResponseMessage({ responseText, toolcalls, editOperations, finished, }) {
|
|
6
|
+
const editContext = useEditContext();
|
|
10
7
|
if (!editContext)
|
|
11
|
-
return (
|
|
12
|
-
const [showFunctions, setShowFunctions] =
|
|
13
|
-
const [changesRejected, setChangesRejected] =
|
|
8
|
+
return _jsx(_Fragment, {});
|
|
9
|
+
const [showFunctions, setShowFunctions] = useState(false);
|
|
10
|
+
const [changesRejected, setChangesRejected] = useState(undefined);
|
|
14
11
|
const reversedEditOperations = [...editOperations].reverse();
|
|
15
12
|
const canReject = editContext.editHistory.length >= editOperations.length &&
|
|
16
13
|
reversedEditOperations.find((x, index) => editContext.editHistory[index]?.id !== x.id ||
|
|
17
14
|
!editContext.editHistory[index]?.canUndo) === undefined;
|
|
18
|
-
return ((
|
|
15
|
+
return (_jsxs("div", { children: [_jsx("div", { dangerouslySetInnerHTML: {
|
|
19
16
|
__html: responseText.replaceAll("\\n", "<br>"),
|
|
20
|
-
} }), toolcalls.length > 0 && ((
|
|
17
|
+
} }), toolcalls.length > 0 && (_jsxs("div", { className: "text-xs text-gray-400 cursor-pointer flex items-center gap-1 mt-1", onClick: () => setShowFunctions(!showFunctions), children: [_jsx("i", { className: "pi pi-wrench text-xs" }), " Tool calls"] })), showFunctions && (_jsx("div", { className: "text-xs text-gray-400", children: toolcalls.map((x, index) => (_jsx(AiToolCall, { toolCall: x }, index))) })), finished && editOperations.length > 0 && (_jsxs("div", { className: "flex gap-2 my-2 items-center", children: [_jsxs("div", { className: "text-xs tour-ai-response-message-changes", children: [editOperations.length, " changes"] }), canReject && !changesRejected && (_jsxs("div", { className: "text-xs text-red-500 cursor-pointer flex items-center gap-1", onClick: async () => {
|
|
21
18
|
await editContext?.operations.undo(editOperations.length);
|
|
22
19
|
setChangesRejected(true);
|
|
23
|
-
}, children: [(
|
|
20
|
+
}, children: [_jsx("i", { className: "pi pi-times" }), " Reject"] })), changesRejected && (_jsx("div", { className: "text-xs text-red-500", children: "rejected" }))] }))] }));
|
|
24
21
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EditOperation } from "../../types";
|
|
2
|
+
type Response = {
|
|
3
|
+
responseText: string;
|
|
4
|
+
editOperations: EditOperation[];
|
|
5
|
+
numInputTokens: number;
|
|
6
|
+
numOutputTokens: number;
|
|
7
|
+
numCachedTokens: number;
|
|
8
|
+
toolCalls?: ToolCall[];
|
|
9
|
+
state: string;
|
|
10
|
+
};
|
|
11
|
+
type ToolCall = {
|
|
12
|
+
function: {
|
|
13
|
+
name: string;
|
|
14
|
+
arguments: string;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type AiContext = {
|
|
18
|
+
promptData: any;
|
|
19
|
+
endpoint: string;
|
|
20
|
+
callback?: (response: Response) => void;
|
|
21
|
+
};
|
|
22
|
+
export type AiTerminalOptions = {
|
|
23
|
+
initialPrompt?: string;
|
|
24
|
+
hiddenSystemPrompt?: string;
|
|
25
|
+
};
|
|
26
|
+
export declare function AiTerminal({ closeButton, createAiContext, defaultProfile, options, }: {
|
|
27
|
+
closeButton?: React.ReactNode;
|
|
28
|
+
createAiContext: ({ editContext }: {
|
|
29
|
+
editContext: any;
|
|
30
|
+
}) => AiContext;
|
|
31
|
+
defaultProfile?: string;
|
|
32
|
+
options?: AiTerminalOptions;
|
|
33
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
34
|
+
export {};
|