@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,27 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
const [isSaving, setIsSaving] = (0, react_1.useState)(false);
|
|
18
|
-
const ref = (0, react_1.useRef)(null);
|
|
19
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { useEditContext } from "../client/editContext";
|
|
4
|
+
import { createOrUpdateComment, deleteComment, resolveComment, } from "../services/reviewsService";
|
|
5
|
+
import { Button } from "primereact/button";
|
|
6
|
+
import { formatDate } from "../utils";
|
|
7
|
+
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
8
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
9
|
+
import { ProgressSpinner } from "primereact/progressspinner";
|
|
10
|
+
export function Comment({ comment }) {
|
|
11
|
+
const editContext = useEditContext();
|
|
12
|
+
const [commentText, setCommentText] = useState(comment.text);
|
|
13
|
+
const [isEditing, setIsEditing] = useState(false);
|
|
14
|
+
const [isSaving, setIsSaving] = useState(false);
|
|
15
|
+
const ref = useRef(null);
|
|
16
|
+
useEffect(() => {
|
|
20
17
|
if (comment.isNew)
|
|
21
18
|
setIsEditing(true);
|
|
22
19
|
}, [comment]);
|
|
23
20
|
const isSelected = comment.id === editContext?.selectedComment?.id;
|
|
24
|
-
|
|
21
|
+
useEffect(() => {
|
|
25
22
|
if (isSelected) {
|
|
26
23
|
if (ref.current) {
|
|
27
24
|
ref.current.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
@@ -33,7 +30,7 @@ function Comment({ comment }) {
|
|
|
33
30
|
const showFieldName = comment.fieldId;
|
|
34
31
|
if (!showItemName && !showFieldName)
|
|
35
32
|
return null;
|
|
36
|
-
return ((
|
|
33
|
+
return (_jsxs("div", { className: "mt-3 flex items-center border-t pt-3", children: [showItemName && (_jsx("div", { className: "text-2xs text-gray-500 ", children: comment.itemName })), showFieldName && showItemName && (_jsx("div", { className: "text-2xs text-gray-500 mx-2", children: ">" })), showFieldName && (_jsx("div", { className: "text-2xs text-gray-500 ", children: comment.fieldName }))] }));
|
|
37
34
|
};
|
|
38
35
|
const canDelete = !comment.isNew && comment.author === editContext?.user?.name;
|
|
39
36
|
const canEdit = !comment.isNew &&
|
|
@@ -41,18 +38,18 @@ function Comment({ comment }) {
|
|
|
41
38
|
comment.author === editContext?.user?.name;
|
|
42
39
|
const canResolve = !comment.isNew && !editContext?.readonly;
|
|
43
40
|
const renderHeader = () => {
|
|
44
|
-
const overlayPanelRef =
|
|
45
|
-
return ((
|
|
41
|
+
const overlayPanelRef = useRef(null);
|
|
42
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex justify-between items-start mb-3", children: [_jsxs("div", { children: [_jsx("div", { className: "text-xs text-gray-900 font-bold", title: comment.author, children: comment.authorDisplayName }), _jsx("div", { className: "text-xs text-gray-500", children: comment.created ? formatDate(new Date(comment.created)) : "" })] }), _jsxs("div", { className: "text-xs text-gray-500", children: [!isEditing && canEdit && (_jsx(SimpleIconButton, { icon: "pi pi-pencil", label: "Edit", onClick: () => setIsEditing(true) })), canDelete && (_jsx(SimpleIconButton, { icon: "pi pi-trash", label: "Delete", onClick: (e) => {
|
|
46
43
|
overlayPanelRef.current?.toggle(e);
|
|
47
|
-
} })), (
|
|
48
|
-
await
|
|
49
|
-
} }) }), canResolve && !comment.isResolved && ((
|
|
50
|
-
await
|
|
51
|
-
} })), comment.isResolved && ((
|
|
44
|
+
} })), _jsx(OverlayPanel, { ref: overlayPanelRef, children: _jsx(Button, { className: "m-2", icon: "pi pi-trash", label: "Delete", onClick: async () => {
|
|
45
|
+
await deleteComment(comment);
|
|
46
|
+
} }) }), canResolve && !comment.isResolved && (_jsx(SimpleIconButton, { icon: "pi pi-check", label: "Resolve", onClick: async () => {
|
|
47
|
+
await resolveComment(comment);
|
|
48
|
+
} })), comment.isResolved && (_jsx("i", { className: "pi pi-check text-green-500 text-xs px-1", style: { fontWeight: "bold" }, title: "Resolved by " +
|
|
52
49
|
comment.resolvedBy +
|
|
53
50
|
" (" +
|
|
54
|
-
|
|
55
|
-
")" })), canResolve && !comment.isResolved && ((
|
|
51
|
+
formatDate(new Date(comment.resolvedDate)) +
|
|
52
|
+
")" })), canResolve && !comment.isResolved && (_jsx(SimpleIconButton, { icon: "pi pi-sparkles", label: "AI", onClick: async (event) => {
|
|
56
53
|
console.log("showing ai popup", comment.text);
|
|
57
54
|
editContext?.showAiPopup(event, {
|
|
58
55
|
initialPrompt: 'Please help me resolve this comment: "' +
|
|
@@ -62,7 +59,7 @@ function Comment({ comment }) {
|
|
|
62
59
|
});
|
|
63
60
|
} }))] })] }) }));
|
|
64
61
|
};
|
|
65
|
-
return !isEditing ? ((
|
|
62
|
+
return !isEditing ? (_jsxs("div", { ref: ref, className: `bg-white rounded-lg p-3 mb-3 shadow-sm cursor-pointer hover:bg-gray-50 border-2 ${isSelected ? " border-blue-500" : "border-transparent"}`, onClick: () => {
|
|
66
63
|
editContext?.setSelectedComment(comment);
|
|
67
64
|
editContext?.setScrollIntoView(comment.itemId);
|
|
68
65
|
editContext?.select([comment.itemId]);
|
|
@@ -76,14 +73,14 @@ function Comment({ comment }) {
|
|
|
76
73
|
},
|
|
77
74
|
}, false);
|
|
78
75
|
}
|
|
79
|
-
}, children: [renderHeader(), (
|
|
76
|
+
}, children: [renderHeader(), _jsx("div", { className: "text-gray-700 text-sm whitespace-pre-wrap", children: comment.text }), renderContextInfo()] }, comment.id)) : (_jsxs("div", { className: "bg-white rounded-lg p-3 mb-3 shadow-sm", children: [renderHeader(), _jsx("textarea", { className: "w-full min-h-[100px] p-2 text-sm border border-gray-200 rounded focus:outline-none focus:ring-2 focus:ring-blue-500 mt-2", placeholder: "Add a comment...", value: commentText, onChange: async (e) => {
|
|
80
77
|
if (!editContext)
|
|
81
78
|
return;
|
|
82
79
|
setCommentText(e.target.value);
|
|
83
80
|
if (editContext?.setComments) {
|
|
84
81
|
editContext.setComments([...editContext.comments]);
|
|
85
82
|
}
|
|
86
|
-
}, autoFocus: true }), isSaving && ((
|
|
83
|
+
}, autoFocus: true }), isSaving && (_jsx("div", { className: "flex justify-end gap-2 mt-1", children: _jsxs("div", { className: "text-xs text-gray-500 flex items-center gap-2", children: [_jsx(ProgressSpinner, { className: "w-4 h-4" }), "Saving..."] }) })), !isSaving && (_jsxs("div", { className: "flex justify-end gap-2 mt-1", children: [_jsx(Button, { severity: "secondary", onClick: () => {
|
|
87
84
|
if (comment.isNew) {
|
|
88
85
|
if (editContext?.setComments) {
|
|
89
86
|
editContext.setComments([
|
|
@@ -94,7 +91,7 @@ function Comment({ comment }) {
|
|
|
94
91
|
else {
|
|
95
92
|
setIsEditing(false);
|
|
96
93
|
}
|
|
97
|
-
}, label: "Cancel" }), (
|
|
94
|
+
}, label: "Cancel" }), _jsx(Button, { className: "tour-submit-comment-button", onClick: async () => {
|
|
98
95
|
comment.text = commentText;
|
|
99
96
|
setIsSaving(true);
|
|
100
97
|
const item = await editContext?.itemsRepository?.getItem({
|
|
@@ -105,7 +102,7 @@ function Comment({ comment }) {
|
|
|
105
102
|
if (item) {
|
|
106
103
|
comment.fieldValue = item.fields.find((f) => f.id === comment.fieldId)?.rawValue;
|
|
107
104
|
}
|
|
108
|
-
await
|
|
105
|
+
await createOrUpdateComment(comment);
|
|
109
106
|
setIsSaving(false);
|
|
110
107
|
setIsEditing(false);
|
|
111
108
|
}, label: comment.isNew ? "Comment" : "Save" })] })), renderContextInfo()] }, "new-comment"));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Comments(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,24 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
13
|
-
const [comments, setComments] = (0, react_2.useState)([]);
|
|
14
|
-
(0, react_1.useEffect)(() => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { useEditContext } from "../client/editContext";
|
|
5
|
+
import { Comment } from "./Comment";
|
|
6
|
+
import { SimpleToolbar } from "../ui/SimpleToolbar";
|
|
7
|
+
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
8
|
+
export function Comments() {
|
|
9
|
+
const editContext = useEditContext();
|
|
10
|
+
const [comments, setComments] = useState([]);
|
|
11
|
+
useEffect(() => {
|
|
15
12
|
const comments = editContext?.comments || [];
|
|
16
13
|
comments.sort((a, b) => a.position - b.position);
|
|
17
14
|
setComments(comments);
|
|
18
15
|
}, [editContext]);
|
|
19
|
-
return ((
|
|
16
|
+
return (_jsxs("div", { className: "flex flex-col h-full", children: [_jsxs(SimpleToolbar, { children: [_jsx(SimpleIconButton, { id: "add-comment", icon: "pi pi-plus", label: "Add Comment", onClick: () => {
|
|
20
17
|
editContext?.addComment();
|
|
21
|
-
} }), (
|
|
18
|
+
} }), _jsx(SimpleIconButton, { selected: editContext?.showComments, icon: "pi pi-eye", label: "Show Comments", onClick: () => {
|
|
22
19
|
editContext?.setShowComments((x) => !x);
|
|
23
|
-
} })] }), (
|
|
20
|
+
} })] }), _jsx("div", { className: "flex-1 overflow-auto", children: _jsx("div", { className: "p-4 bg-gray-50 border-l border-gray-200 h-fill-available", children: comments.map((comment) => (_jsx(Comment, { comment: comment }, comment.id))) }) })] }));
|
|
24
21
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PreviewInfo(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const utils_1 = require("../utils");
|
|
7
|
-
function PreviewInfo() {
|
|
8
|
-
const editContext = (0, client_components_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEditContext } from "../../client-components";
|
|
3
|
+
import { formatDate } from "../utils";
|
|
4
|
+
export function PreviewInfo() {
|
|
5
|
+
const editContext = useEditContext();
|
|
9
6
|
if (!editContext)
|
|
10
7
|
return null;
|
|
11
8
|
const review = editContext.reviews.reviews.find((x) => x.reviewerEmail === editContext.user?.email);
|
|
12
|
-
return ((
|
|
9
|
+
return (_jsxs("div", { className: "flex gap-3 items-center", children: [_jsxs("div", { className: "text-white", children: ["Welcome to your page ", _jsx("b", { children: "preview" }), ", ", editContext.user?.displayName, "!", _jsxs("div", { className: "text-gray-300 text-xs", children: [editContext.contentEditorItem?.path, " ", editContext.contentEditorItem?.language, " ", editContext.contentEditorItem?.version] })] }), review?.approvalDate && (_jsx("i", { className: "pi pi-check text-green-400 text-2xl font-bold", title: "Approved " + formatDate(new Date(review.approvalDate)) })), review?.rejectedDate && (_jsx("i", { className: "pi pi-times text-red-400 text-2xl font-bold", title: "Rejected " + formatDate(new Date(review.rejectedDate)) }))] }));
|
|
13
10
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function Reviews(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
};
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
const SimpleIconButton_1 = require("../ui/SimpleIconButton");
|
|
18
|
-
const button_1 = require("primereact/button");
|
|
19
|
-
const react_uuid_1 = __importDefault(require("react-uuid"));
|
|
20
|
-
function Reviews() {
|
|
21
|
-
const [reviewData, setReviewData] = (0, react_1.useState)([]);
|
|
22
|
-
const [newReviewer, setNewReviewer] = (0, react_1.useState)({
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { SimpleToolbar } from "../ui/SimpleToolbar";
|
|
3
|
+
import { useEffect, useRef, useState } from "react";
|
|
4
|
+
import { SimpleTable } from "../ui/SimpleTable";
|
|
5
|
+
import { inviteReviewer, addReview } from "../services/reviewsService";
|
|
6
|
+
import { useEditContext } from "../client/editContext";
|
|
7
|
+
import { Checkbox } from "primereact/checkbox";
|
|
8
|
+
import { formatDate } from "../utils";
|
|
9
|
+
import { InputText } from "primereact/inputtext";
|
|
10
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
11
|
+
import { SimpleIconButton } from "../ui/SimpleIconButton";
|
|
12
|
+
import { Button } from "primereact/button";
|
|
13
|
+
import uuid from "react-uuid";
|
|
14
|
+
export function Reviews() {
|
|
15
|
+
const [reviewData, setReviewData] = useState([]);
|
|
16
|
+
const [newReviewer, setNewReviewer] = useState({
|
|
23
17
|
email: "",
|
|
24
18
|
name: "",
|
|
25
19
|
});
|
|
26
|
-
const overlayPanelRef =
|
|
27
|
-
const editContext =
|
|
28
|
-
const [showErrors, setShowErrors] =
|
|
29
|
-
const [waiting, setWaiting] =
|
|
30
|
-
|
|
20
|
+
const overlayPanelRef = useRef(null);
|
|
21
|
+
const editContext = useEditContext();
|
|
22
|
+
const [showErrors, setShowErrors] = useState(false);
|
|
23
|
+
const [waiting, setWaiting] = useState(false);
|
|
24
|
+
useEffect(() => {
|
|
31
25
|
if (editContext?.reviews) {
|
|
32
26
|
setReviewData(editContext.reviews.reviews.map((x) => ({
|
|
33
27
|
review: x,
|
|
@@ -46,21 +40,21 @@ function Reviews() {
|
|
|
46
40
|
};
|
|
47
41
|
const getStatus = (reviewData) => {
|
|
48
42
|
if (reviewData?.updating) {
|
|
49
|
-
return (
|
|
43
|
+
return _jsx("i", { className: "pi pi-spinner pi-spin" });
|
|
50
44
|
}
|
|
51
45
|
if (reviewData?.error) {
|
|
52
|
-
return ((
|
|
46
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("i", { className: "pi pi-times text-red-500 " }), " ", reviewData.error] }));
|
|
53
47
|
}
|
|
54
48
|
const review = reviewData?.review;
|
|
55
49
|
if (review) {
|
|
56
50
|
if (review.approvalDate) {
|
|
57
|
-
return ((
|
|
51
|
+
return (_jsxs("div", { className: "flex flex-row gap-1", children: [_jsx("i", { className: "pi pi-check text-green-500 " }), "Approved ", formatDate(new Date(review.approvalDate))] }));
|
|
58
52
|
}
|
|
59
53
|
if (review.rejectedDate) {
|
|
60
|
-
return ((
|
|
54
|
+
return (_jsxs("div", { className: "flex flex-row gap-1", children: [_jsx("i", { className: "pi pi-times text-red-500 " }), "Rejected ", formatDate(new Date(review.rejectedDate))] }));
|
|
61
55
|
}
|
|
62
56
|
if (review.invitationSentDate) {
|
|
63
|
-
return ("Invitation Sent " +
|
|
57
|
+
return ("Invitation Sent " + formatDate(new Date(review.invitationSentDate)));
|
|
64
58
|
}
|
|
65
59
|
}
|
|
66
60
|
return "Not yet invited";
|
|
@@ -78,7 +72,7 @@ function Reviews() {
|
|
|
78
72
|
if (x.checked) {
|
|
79
73
|
x.updating = true;
|
|
80
74
|
setReviewData([...reviewData]);
|
|
81
|
-
const result = await
|
|
75
|
+
const result = await inviteReviewer(x.review);
|
|
82
76
|
if (result.response.status !== 200) {
|
|
83
77
|
x.error = "Error inviting reviewer";
|
|
84
78
|
}
|
|
@@ -88,22 +82,22 @@ function Reviews() {
|
|
|
88
82
|
}
|
|
89
83
|
});
|
|
90
84
|
};
|
|
91
|
-
return ((
|
|
85
|
+
return (_jsxs("div", { className: "flex flex-col h-full", children: [_jsxs(SimpleToolbar, { children: [_jsx(SimpleIconButton, { label: "Add Reviewer", icon: "pi pi-plus", onClick: (x) => {
|
|
92
86
|
overlayPanelRef.current?.toggle(x);
|
|
93
87
|
setTimeout(() => {
|
|
94
88
|
document.getElementById("name")?.focus();
|
|
95
89
|
}, 100);
|
|
96
|
-
} }), (
|
|
90
|
+
} }), _jsx(SimpleIconButton, { label: "Send Invitations", icon: "pi pi-send", disabled: !reviewData.some((x) => x.checked), onClick: sendInvitations })] }), _jsx(OverlayPanel, { ref: overlayPanelRef, children: _jsx("div", { className: "p-2 text-xs flex flex-col gap-2", children: _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: "name", children: "Name" }), _jsx(InputText, { id: "name", className: "w-full", value: newReviewer?.name, onChange: (e) => {
|
|
97
91
|
setNewReviewer((x) => ({
|
|
98
92
|
...x,
|
|
99
93
|
name: e.target.value,
|
|
100
94
|
}));
|
|
101
|
-
}, autoFocus: true }), showErrors && !newReviewer?.name && ((
|
|
95
|
+
}, autoFocus: true }), showErrors && !newReviewer?.name && (_jsx("small", { style: { color: "red" }, children: "Name is required" })), _jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("label", { htmlFor: "email", children: "Email" }), _jsx(InputText, { id: "email", className: "w-full", value: newReviewer?.email, onChange: (e) => {
|
|
102
96
|
setNewReviewer((x) => ({
|
|
103
97
|
...x,
|
|
104
98
|
email: e.target.value,
|
|
105
99
|
}));
|
|
106
|
-
} }), showErrors && !isValidEmail(newReviewer.email) && ((
|
|
100
|
+
} }), showErrors && !isValidEmail(newReviewer.email) && (_jsx("small", { style: { color: "red" }, children: "Not a valid email address" })), showErrors && emailAlreadyExists(newReviewer.email) && (_jsx("small", { style: { color: "red" }, children: "Email already exists" }))] }), _jsx(Button, { label: "Add Reviewer", disabled: waiting, icon: "pi pi-plus", onClick: async () => {
|
|
107
101
|
if (!editContext?.contentEditorItem)
|
|
108
102
|
return;
|
|
109
103
|
setShowErrors(true);
|
|
@@ -114,8 +108,8 @@ function Reviews() {
|
|
|
114
108
|
return;
|
|
115
109
|
}
|
|
116
110
|
setWaiting(true);
|
|
117
|
-
await
|
|
118
|
-
id: (
|
|
111
|
+
await addReview({
|
|
112
|
+
id: uuid(),
|
|
119
113
|
reviewerName: newReviewer.name,
|
|
120
114
|
reviewerEmail: newReviewer.email,
|
|
121
115
|
itemId: editContext.contentEditorItem.id,
|
|
@@ -129,15 +123,15 @@ function Reviews() {
|
|
|
129
123
|
name: "",
|
|
130
124
|
});
|
|
131
125
|
setWaiting(false);
|
|
132
|
-
} })] }) }) }), (
|
|
126
|
+
} })] }) }) }), _jsx("div", { className: "flex-1 relative", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(SimpleTable, { columns: [
|
|
133
127
|
{
|
|
134
|
-
header: ((
|
|
128
|
+
header: (_jsx(Checkbox, { checked: reviewData.every((x) => x.checked), onChange: (e) => {
|
|
135
129
|
setReviewData((reviews) => reviews.map((x) => ({
|
|
136
130
|
...x,
|
|
137
131
|
checked: e.checked ?? false,
|
|
138
132
|
})));
|
|
139
133
|
} })),
|
|
140
|
-
body: (x) => ((
|
|
134
|
+
body: (x) => (_jsx(Checkbox, { checked: x.checked, onChange: (e) => {
|
|
141
135
|
setReviewData((reviews) => {
|
|
142
136
|
// It’s safer to update by index or assign an id to each reviewer.
|
|
143
137
|
// For brevity, we’re using the email to locate the reviewer.
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const reviewsService_1 = require("../services/reviewsService");
|
|
6
|
-
exports.approveReviewCommand = {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { approveReview, rejectReview } from "../services/reviewsService";
|
|
3
|
+
export const approveReviewCommand = {
|
|
7
4
|
id: "approveReview",
|
|
8
5
|
label: "Approve Page",
|
|
9
|
-
icon: (
|
|
6
|
+
icon: _jsx("i", { className: "pi pi-check text-green-500 mr-3" }),
|
|
10
7
|
execute: async (context) => {
|
|
11
8
|
if (!context.editContext.currentItemDescriptor) {
|
|
12
9
|
return;
|
|
13
10
|
}
|
|
14
|
-
await
|
|
11
|
+
await approveReview(context.editContext.currentItemDescriptor);
|
|
15
12
|
context.editContext.showToast({
|
|
16
13
|
summary: "Page/item approved",
|
|
17
14
|
severity: "success",
|
|
@@ -21,15 +18,15 @@ exports.approveReviewCommand = {
|
|
|
21
18
|
return !isReviewer(context);
|
|
22
19
|
},
|
|
23
20
|
};
|
|
24
|
-
|
|
21
|
+
export const rejectReviewCommand = {
|
|
25
22
|
id: "rejectReview",
|
|
26
23
|
label: "Reject Page",
|
|
27
|
-
icon: (
|
|
24
|
+
icon: _jsx("i", { className: "pi pi-times text-red-500 mr-3" }),
|
|
28
25
|
execute: async (context) => {
|
|
29
26
|
if (!context.editContext.currentItemDescriptor) {
|
|
30
27
|
return;
|
|
31
28
|
}
|
|
32
|
-
await
|
|
29
|
+
await rejectReview(context.editContext.currentItemDescriptor);
|
|
33
30
|
context.editContext.showToast({
|
|
34
31
|
summary: "Page/item rejected",
|
|
35
32
|
severity: "error",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Review } from "../../types";
|
|
2
|
+
import { ItemDescriptor } from "../pageModel";
|
|
3
|
+
export declare function useReviews({ currentItemDescriptor, addSocketMessageListener, }: {
|
|
4
|
+
currentItemDescriptor?: ItemDescriptor;
|
|
5
|
+
addSocketMessageListener: (callback: (message: {
|
|
6
|
+
type: string;
|
|
7
|
+
payload: any;
|
|
8
|
+
}) => void) => void;
|
|
9
|
+
}): {
|
|
10
|
+
reviews: Review[];
|
|
11
|
+
loadReviews: () => Promise<void>;
|
|
12
|
+
};
|
|
@@ -1,19 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
exports.useReviews = useReviews;
|
|
7
|
-
const react_1 = require("react");
|
|
8
|
-
const reviewsService_1 = require("../services/reviewsService");
|
|
9
|
-
const react_uuid_1 = __importDefault(require("react-uuid"));
|
|
10
|
-
function useReviews({ currentItemDescriptor, addSocketMessageListener, }) {
|
|
11
|
-
const [reviews, setReviews] = (0, react_1.useState)([]);
|
|
1
|
+
import { useEffect, useState, useMemo } from "react";
|
|
2
|
+
import { getReviewers, getReviews } from "../services/reviewsService";
|
|
3
|
+
import uuid from "react-uuid";
|
|
4
|
+
export function useReviews({ currentItemDescriptor, addSocketMessageListener, }) {
|
|
5
|
+
const [reviews, setReviews] = useState([]);
|
|
12
6
|
const loadReviews = async () => {
|
|
13
7
|
if (!currentItemDescriptor)
|
|
14
8
|
return;
|
|
15
|
-
const reviewers = await
|
|
16
|
-
const reviewsResult = await
|
|
9
|
+
const reviewers = await getReviewers(currentItemDescriptor.id, currentItemDescriptor.language);
|
|
10
|
+
const reviewsResult = await getReviews(currentItemDescriptor.id, currentItemDescriptor.language, currentItemDescriptor.version);
|
|
17
11
|
const reviews = reviewsResult.data;
|
|
18
12
|
if (!reviews)
|
|
19
13
|
return;
|
|
@@ -23,7 +17,7 @@ function useReviews({ currentItemDescriptor, addSocketMessageListener, }) {
|
|
|
23
17
|
const existingReview = reviews.find((r) => r.reviewerEmail === reviewer.email);
|
|
24
18
|
if (!existingReview) {
|
|
25
19
|
reviews.push({
|
|
26
|
-
id: (
|
|
20
|
+
id: uuid(),
|
|
27
21
|
itemId: currentItemDescriptor.id,
|
|
28
22
|
language: currentItemDescriptor.language,
|
|
29
23
|
version: currentItemDescriptor.version,
|
|
@@ -34,15 +28,15 @@ function useReviews({ currentItemDescriptor, addSocketMessageListener, }) {
|
|
|
34
28
|
});
|
|
35
29
|
setReviews(reviews);
|
|
36
30
|
};
|
|
37
|
-
|
|
31
|
+
useEffect(() => {
|
|
38
32
|
loadReviews();
|
|
39
33
|
}, [currentItemDescriptor]);
|
|
40
|
-
|
|
34
|
+
useEffect(() => {
|
|
41
35
|
return addSocketMessageListener((message) => {
|
|
42
36
|
if (message.type === "reviews-updated") {
|
|
43
37
|
loadReviews();
|
|
44
38
|
}
|
|
45
39
|
});
|
|
46
40
|
}, [currentItemDescriptor]);
|
|
47
|
-
return
|
|
41
|
+
return useMemo(() => ({ reviews, loadReviews }), [reviews]);
|
|
48
42
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { AiContext } from "../ai/AiTerminal";
|
|
2
|
+
import { EditContextType } from "../client/editContext";
|
|
3
|
+
import { ItemDescriptor } from "../pageModel";
|
|
4
|
+
import { ExecutionResult } from "./serviceHelper";
|
|
5
|
+
export type AiProfile = {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
instructions: string;
|
|
9
|
+
defaultModel: string;
|
|
10
|
+
models: string[];
|
|
11
|
+
prompts: {
|
|
12
|
+
prompt: string;
|
|
13
|
+
title: string;
|
|
14
|
+
}[];
|
|
15
|
+
errorMessage?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare function loadAiProfiles(item: ItemDescriptor): Promise<AiProfile[]>;
|
|
18
|
+
type Message = {
|
|
19
|
+
content: string;
|
|
20
|
+
name: string;
|
|
21
|
+
role: string;
|
|
22
|
+
};
|
|
23
|
+
export declare function executePrompt(messages: Message[], editContext: EditContextType, createAiContext: ({ editContext }: {
|
|
24
|
+
editContext: any;
|
|
25
|
+
}) => AiContext, allowedFunctions?: string[], addContextContent?: boolean, options?: RequestInit, model?: string, callback?: (response: any) => void): Promise<any>;
|
|
26
|
+
export declare function executeSearch({ query, editContext, maxResults, index, rootItemIds, skipValidation, }: {
|
|
27
|
+
query: string;
|
|
28
|
+
editContext: EditContextType;
|
|
29
|
+
maxResults: number;
|
|
30
|
+
index: string;
|
|
31
|
+
rootItemIds?: string[];
|
|
32
|
+
skipValidation?: boolean;
|
|
33
|
+
}): Promise<ExecutionResult<unknown>>;
|
|
34
|
+
export {};
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.loadAiProfiles = loadAiProfiles;
|
|
4
|
-
exports.executePrompt = executePrompt;
|
|
5
|
-
exports.executeSearch = executeSearch;
|
|
6
|
-
const serviceHelper_1 = require("./serviceHelper");
|
|
7
|
-
async function loadAiProfiles(item) {
|
|
1
|
+
import { post } from "./serviceHelper";
|
|
2
|
+
export async function loadAiProfiles(item) {
|
|
8
3
|
let url = "/alpaca/editor/ai/profiles";
|
|
9
|
-
const response = await
|
|
4
|
+
const response = await post(url, item);
|
|
10
5
|
if (response.type !== "success") {
|
|
11
6
|
throw new Error("Error loading AI profiles");
|
|
12
7
|
}
|
|
13
8
|
return response.data || [];
|
|
14
9
|
}
|
|
15
|
-
async function executePrompt(messages, editContext, createAiContext, allowedFunctions, addContextContent, options, model, callback) {
|
|
10
|
+
export async function executePrompt(messages, editContext, createAiContext, allowedFunctions, addContextContent, options, model, callback) {
|
|
16
11
|
const context = createAiContext({ editContext });
|
|
17
12
|
const response = await fetch(context.endpoint, {
|
|
18
13
|
method: "POST",
|
|
@@ -73,7 +68,7 @@ async function executePrompt(messages, editContext, createAiContext, allowedFunc
|
|
|
73
68
|
}
|
|
74
69
|
return result;
|
|
75
70
|
}
|
|
76
|
-
async function executeSearch({ query, editContext, maxResults = 10, index, rootItemIds, skipValidation = false, }) {
|
|
71
|
+
export async function executeSearch({ query, editContext, maxResults = 10, index, rootItemIds, skipValidation = false, }) {
|
|
77
72
|
const response = await fetch("/alpaca/editor/ai/search", {
|
|
78
73
|
method: "POST",
|
|
79
74
|
body: JSON.stringify({
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { InsertOption, Rendering } from "../../types";
|
|
2
|
+
import { ItemDescriptor } from "../pageModel";
|
|
3
|
+
export declare function createNewComponent(name: string, contextItem: ItemDescriptor): Promise<string | Error>;
|
|
4
|
+
export declare function createRendering(name: string, context: ItemDescriptor, componentTemplateId: string): Promise<{
|
|
5
|
+
id: string;
|
|
6
|
+
} | Error>;
|
|
7
|
+
export declare function getAllComponents(contextItemId: string): Promise<Array<Component>>;
|
|
8
|
+
export declare function getFieldTypes(): Promise<Array<FieldTypeGroup>>;
|
|
9
|
+
export type Component = {
|
|
10
|
+
templateId: string;
|
|
11
|
+
name: string;
|
|
12
|
+
svg: string;
|
|
13
|
+
icon: string;
|
|
14
|
+
};
|
|
15
|
+
export type PlaceholderDefinition = {
|
|
16
|
+
name: string;
|
|
17
|
+
components: InsertOption[];
|
|
18
|
+
insertOptionsNode?: ItemDescriptor;
|
|
19
|
+
};
|
|
20
|
+
export type ComponentDetails = Component & {
|
|
21
|
+
compatibleRenderings: Rendering[];
|
|
22
|
+
template: Template;
|
|
23
|
+
placeholders: PlaceholderDefinition[];
|
|
24
|
+
};
|
|
25
|
+
export declare function loadComponentDetails(id: string, contextItemId: string): Promise<ComponentDetails>;
|
|
26
|
+
export declare function saveComponentDetails(component: ComponentDetails, contextItem: ItemDescriptor): Promise<boolean>;
|
|
27
|
+
export type Template = {
|
|
28
|
+
sections: TemplateSection[];
|
|
29
|
+
};
|
|
30
|
+
export type TemplateSection = {
|
|
31
|
+
id?: string;
|
|
32
|
+
name: string;
|
|
33
|
+
fields: TemplateField[];
|
|
34
|
+
key?: string;
|
|
35
|
+
};
|
|
36
|
+
export type TemplateField = {
|
|
37
|
+
id?: string;
|
|
38
|
+
name: string;
|
|
39
|
+
type: string;
|
|
40
|
+
source: string;
|
|
41
|
+
key?: string;
|
|
42
|
+
};
|
|
43
|
+
export type FieldTypeGroup = {
|
|
44
|
+
name: string;
|
|
45
|
+
types: string[];
|
|
46
|
+
};
|