@alpaca-editor/core 1.0.0 → 1.0.3
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/build.css +3 -0
- package/components.json +21 -0
- package/dev.css +3 -0
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +4 -0
- package/dist/client-components/api.js.map +1 -0
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +17 -0
- package/dist/client-components/index.js.map +1 -0
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +6 -0
- package/dist/components/ActionButton.js.map +1 -0
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +24 -0
- package/dist/components/Error.js.map +1 -0
- package/dist/components/ui/button.d.ts +10 -0
- package/dist/components/ui/button.js +32 -0
- package/dist/components/ui/button.js.map +1 -0
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +647 -0
- package/dist/config/config.js.map +1 -0
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +2 -0
- package/dist/config/types.js.map +1 -0
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +29 -0
- package/dist/editor/ComponentInfo.js.map +1 -0
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +31 -0
- package/dist/editor/ConfirmationDialog.js.map +1 -0
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +404 -0
- package/dist/editor/ContentTree.js.map +1 -0
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +114 -0
- package/dist/editor/ContextMenu.js.map +1 -0
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +50 -0
- package/dist/editor/Editor.js.map +1 -0
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +11 -0
- package/dist/editor/EditorWarning.js.map +1 -0
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +19 -0
- package/dist/editor/EditorWarnings.js.map +1 -0
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +22 -0
- package/dist/editor/FieldEditorPopup.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +38 -0
- package/dist/editor/FieldHistory.js.map +1 -0
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +58 -0
- package/dist/editor/FieldList.js.map +1 -0
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +161 -0
- package/dist/editor/FieldListField.js.map +1 -0
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +109 -0
- package/dist/editor/FieldListFieldWithFallbacks.js.map +1 -0
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +90 -0
- package/dist/editor/FloatingToolbar.js.map +1 -0
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +53 -0
- package/dist/editor/ImageEditor.js.map +1 -0
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +158 -0
- package/dist/editor/InsertMenu.js.map +1 -0
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +28 -0
- package/dist/editor/ItemInfo.js.map +1 -0
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +84 -0
- package/dist/editor/LinkEditorDialog.js.map +1 -0
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +41 -0
- package/dist/editor/MainLayout.js.map +1 -0
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +7 -0
- package/dist/editor/NewEditorClient.js.map +1 -0
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +327 -0
- package/dist/editor/PictureCropper.js.map +1 -0
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +102 -0
- package/dist/editor/PictureEditor.js.map +1 -0
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +189 -0
- package/dist/editor/PictureEditorDialog.js.map +1 -0
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +25 -0
- package/dist/editor/ScrollingContentTree.js.map +1 -0
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +107 -0
- package/dist/editor/Terminal.js.map +1 -0
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +9 -0
- package/dist/editor/Titlebar.js.map +1 -0
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +23 -0
- package/dist/editor/ai/AiPopup.js.map +1 -0
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +22 -0
- package/dist/editor/ai/AiResponseMessage.js.map +1 -0
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +236 -0
- package/dist/editor/ai/AiTerminal.js.map +1 -0
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +16 -0
- package/dist/editor/ai/AiToolCall.js.map +1 -0
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +7 -0
- package/dist/editor/ai/EditorAiTerminal.js.map +1 -0
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +12 -0
- package/dist/editor/ai/editorAiContext.js.map +1 -0
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +25 -0
- package/dist/editor/client/DialogContext.js.map +1 -0
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +1298 -0
- package/dist/editor/client/EditorClient.js.map +1 -0
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +25 -0
- package/dist/editor/client/GenericDialog.js.map +1 -0
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +20 -0
- package/dist/editor/client/editContext.js.map +1 -0
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +29 -0
- package/dist/editor/client/helpers.js.map +1 -0
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +253 -0
- package/dist/editor/client/itemsRepository.js.map +1 -0
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +393 -0
- package/dist/editor/client/operations.js.map +1 -0
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +127 -0
- package/dist/editor/client/pageModelBuilder.js.map +1 -0
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +2 -0
- package/dist/editor/commands/commands.js.map +1 -0
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +271 -0
- package/dist/editor/commands/componentCommands.js.map +1 -0
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +24 -0
- package/dist/editor/commands/createVersionCommand.js.map +1 -0
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +53 -0
- package/dist/editor/commands/deleteVersionCommand.js.map +1 -0
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +132 -0
- package/dist/editor/commands/itemCommands.js.map +1 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +89 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js.map +1 -0
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +29 -0
- package/dist/editor/commands/undo.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +56 -0
- package/dist/editor/component-designer/ComponentDesigner.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +7 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js.map +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +65 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js.map +1 -0
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +57 -0
- package/dist/editor/component-designer/ComponentEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +11 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +69 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js.map +1 -0
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +20 -0
- package/dist/editor/component-designer/ComponentsDropdown.js.map +1 -0
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +68 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js.map +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +23 -0
- package/dist/editor/component-designer/RenderingsDropdown.js.map +1 -0
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +142 -0
- package/dist/editor/component-designer/TemplateEditor.js.map +1 -0
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +16 -0
- package/dist/editor/component-designer/aiContext.js.map +1 -0
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +87 -0
- package/dist/editor/componentTreeHelper.js.map +1 -0
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +57 -0
- package/dist/editor/control-center/ControlCenterMenu.js.map +1 -0
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +25 -0
- package/dist/editor/control-center/IndexOverview.js.map +1 -0
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +104 -0
- package/dist/editor/control-center/IndexSettings.js.map +1 -0
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +5 -0
- package/dist/editor/control-center/Status.js.map +1 -0
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +38 -0
- package/dist/editor/editor-warnings/ItemLocked.js.map +1 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +12 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js.map +1 -0
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +25 -0
- package/dist/editor/editor-warnings/ValidationErrors.js.map +1 -0
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +5 -0
- package/dist/editor/field-types/AttachmentEditor.js.map +1 -0
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +30 -0
- package/dist/editor/field-types/CheckboxEditor.js.map +1 -0
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +49 -0
- package/dist/editor/field-types/DropLinkEditor.js.map +1 -0
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +56 -0
- package/dist/editor/field-types/DropListEditor.js.map +1 -0
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +34 -0
- package/dist/editor/field-types/ImageFieldEditor.js.map +1 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +59 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +56 -0
- package/dist/editor/field-types/LinkFieldEditor.js.map +1 -0
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +33 -0
- package/dist/editor/field-types/MultiLineText.js.map +1 -0
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +57 -0
- package/dist/editor/field-types/PictureFieldEditor.js.map +1 -0
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +31 -0
- package/dist/editor/field-types/RawEditor.js.map +1 -0
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +385 -0
- package/dist/editor/field-types/ReactQuill.js.map +1 -0
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +8 -0
- package/dist/editor/field-types/RichTextEditor.js.map +1 -0
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +70 -0
- package/dist/editor/field-types/RichTextEditorComponent.js.map +1 -0
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +90 -0
- package/dist/editor/field-types/SingleLineText.js.map +1 -0
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +132 -0
- package/dist/editor/field-types/TreeListEditor.js.map +1 -0
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +2 -0
- package/dist/editor/fieldTypes.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +105 -0
- package/dist/editor/media-selector/AiImageSearch.js.map +1 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +56 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js.map +1 -0
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +8 -0
- package/dist/editor/media-selector/MediaSelector.js.map +1 -0
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +7 -0
- package/dist/editor/media-selector/Preview.js.map +1 -0
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +9 -0
- package/dist/editor/media-selector/Thumbnails.js.map +1 -0
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +165 -0
- package/dist/editor/media-selector/TreeSelector.js.map +1 -0
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +78 -0
- package/dist/editor/media-selector/UploadZone.js.map +1 -0
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +31 -0
- package/dist/editor/menubar/ActionsMenu.js.map +1 -0
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +11 -0
- package/dist/editor/menubar/ActiveUsers.js.map +1 -0
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +11 -0
- package/dist/editor/menubar/ApproveAndPublish.js.map +1 -0
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +12 -0
- package/dist/editor/menubar/BrowseHistory.js.map +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +34 -0
- package/dist/editor/menubar/ItemLanguageVersion.js.map +1 -0
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +31 -0
- package/dist/editor/menubar/LanguageSelector.js.map +1 -0
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +63 -0
- package/dist/editor/menubar/Menu.js.map +1 -0
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +41 -0
- package/dist/editor/menubar/NavButtons.js.map +1 -0
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +48 -0
- package/dist/editor/menubar/PageSelector.js.map +1 -0
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +35 -0
- package/dist/editor/menubar/PageViewerControls.js.map +1 -0
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +6 -0
- package/dist/editor/menubar/Separator.js.map +1 -0
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +24 -0
- package/dist/editor/menubar/SiteInfo.js.map +1 -0
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +16 -0
- package/dist/editor/menubar/User.js.map +1 -0
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +47 -0
- package/dist/editor/menubar/VersionSelector.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +212 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js.map +1 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +15 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +25 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +13 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +25 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +13 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +176 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js.map +1 -0
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +22 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js.map +1 -0
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +99 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js.map +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +33 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js.map +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +19 -0
- package/dist/editor/page-editor-chrome/NoLayout.js.map +1 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +63 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js.map +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +107 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +80 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js.map +1 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +145 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js.map +1 -0
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +19 -0
- package/dist/editor/page-viewer/DeviceToolbar.js.map +1 -0
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +128 -0
- package/dist/editor/page-viewer/EditorForm.js.map +1 -0
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +222 -0
- package/dist/editor/page-viewer/MiniMap.js.map +1 -0
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +62 -0
- package/dist/editor/page-viewer/PageViewer.js.map +1 -0
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +690 -0
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -0
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +115 -0
- package/dist/editor/page-viewer/pageViewContext.js.map +1 -0
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +2 -0
- package/dist/editor/pageModel.js.map +1 -0
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +25 -0
- package/dist/editor/picture-shared.js.map +1 -0
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +114 -0
- package/dist/editor/reviews/Comment.js.map +1 -0
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +22 -0
- package/dist/editor/reviews/Comments.js.map +1 -0
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +11 -0
- package/dist/editor/reviews/PreviewInfo.js.map +1 -0
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +160 -0
- package/dist/editor/reviews/Reviews.js.map +1 -0
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +42 -0
- package/dist/editor/reviews/reviewCommands.js.map +1 -0
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +43 -0
- package/dist/editor/reviews/useReviews.js.map +1 -0
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +95 -0
- package/dist/editor/services/aiService.js.map +1 -0
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +72 -0
- package/dist/editor/services/componentDesignerService.js.map +1 -0
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +92 -0
- package/dist/editor/services/contentService.js.map +1 -0
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +294 -0
- package/dist/editor/services/editService.js.map +1 -0
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +19 -0
- package/dist/editor/services/indexService.js.map +1 -0
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +32 -0
- package/dist/editor/services/reviewsService.js.map +1 -0
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +64 -0
- package/dist/editor/services/serviceHelper.js.map +1 -0
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +5 -0
- package/dist/editor/services/systemService.js.map +1 -0
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +11 -0
- package/dist/editor/services/translationService.js.map +1 -0
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +111 -0
- package/dist/editor/services-server/api.js.map +1 -0
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +53 -0
- package/dist/editor/services-server/graphQL.js.map +1 -0
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +53 -0
- package/dist/editor/sidebar/ComponentPalette.js.map +1 -0
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +360 -0
- package/dist/editor/sidebar/ComponentTree.js.map +1 -0
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +58 -0
- package/dist/editor/sidebar/Debug.js.map +1 -0
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +158 -0
- package/dist/editor/sidebar/DictionaryEditor.js.map +1 -0
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +72 -0
- package/dist/editor/sidebar/EditHistory.js.map +1 -0
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +113 -0
- package/dist/editor/sidebar/GraphQL.js.map +1 -0
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +22 -0
- package/dist/editor/sidebar/Insert.js.map +1 -0
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +49 -0
- package/dist/editor/sidebar/MainContentTree.js.map +1 -0
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +32 -0
- package/dist/editor/sidebar/Performance.js.map +1 -0
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +29 -0
- package/dist/editor/sidebar/Sessions.js.map +1 -0
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +13 -0
- package/dist/editor/sidebar/Sidebar.js.map +1 -0
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +74 -0
- package/dist/editor/sidebar/SidebarView.js.map +1 -0
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +158 -0
- package/dist/editor/sidebar/Translations.js.map +1 -0
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +50 -0
- package/dist/editor/sidebar/Validation.js.map +1 -0
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +13 -0
- package/dist/editor/sidebar/ViewSelector.js.map +1 -0
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +78 -0
- package/dist/editor/sidebar/Workbox.js.map +1 -0
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +5 -0
- package/dist/editor/ui/CenteredMessage.js.map +1 -0
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +15 -0
- package/dist/editor/ui/CopyToClipboardButton.js.map +1 -0
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +5 -0
- package/dist/editor/ui/DialogButtons.js.map +1 -0
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +56 -0
- package/dist/editor/ui/Icons.js.map +1 -0
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +40 -0
- package/dist/editor/ui/ItemNameDialog.js.map +1 -0
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +56 -0
- package/dist/editor/ui/ItemNameDialogNew.js.map +1 -0
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +90 -0
- package/dist/editor/ui/ItemSearch.js.map +1 -0
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +187 -0
- package/dist/editor/ui/PerfectTree.js.map +1 -0
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +10 -0
- package/dist/editor/ui/Section.js.map +1 -0
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +9 -0
- package/dist/editor/ui/SimpleIconButton.js.map +1 -0
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +7 -0
- package/dist/editor/ui/SimpleMenu.js.map +1 -0
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +9 -0
- package/dist/editor/ui/SimpleTable.js.map +1 -0
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +19 -0
- package/dist/editor/ui/SimpleTabs.js.map +1 -0
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +5 -0
- package/dist/editor/ui/SimpleToolbar.js.map +1 -0
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +5 -0
- package/dist/editor/ui/Spinner.js.map +1 -0
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +151 -0
- package/dist/editor/ui/Splitter.js.map +1 -0
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +67 -0
- package/dist/editor/ui/StackedPanels.js.map +1 -0
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +5 -0
- package/dist/editor/ui/Toolbar.js.map +1 -0
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +5 -0
- package/dist/editor/utils/id-helper.js.map +1 -0
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +43 -0
- package/dist/editor/utils/insertOptions.js.map +1 -0
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +22 -0
- package/dist/editor/utils/itemutils.js.map +1 -0
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +18 -0
- package/dist/editor/utils/useMemoDebug.js.map +1 -0
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +309 -0
- package/dist/editor/utils.js.map +1 -0
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +145 -0
- package/dist/editor/views/CompareView.js.map +1 -0
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +15 -0
- package/dist/editor/views/EditView.js.map +1 -0
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +22 -0
- package/dist/editor/views/ItemEditor.js.map +1 -0
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +23 -0
- package/dist/editor/views/SingleEditView.js.map +1 -0
- package/dist/images/bg-shape-black.webp +0 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/utils.d.ts +2 -0
- package/dist/lib/utils.js +6 -0
- package/dist/lib/utils.js.map +1 -0
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +60 -0
- package/dist/page-wizard/PageWizard.js.map +1 -0
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +41 -0
- package/dist/page-wizard/SelectWizard.js.map +1 -0
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +69 -0
- package/dist/page-wizard/WizardSteps.js.map +1 -0
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +22 -0
- package/dist/page-wizard/service.js.map +1 -0
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +21 -0
- package/dist/page-wizard/startPageWizardCommand.js.map +1 -0
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +133 -0
- package/dist/page-wizard/steps/BuildPageStep.js.map +1 -0
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +119 -0
- package/dist/page-wizard/steps/CollectStep.js.map +1 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +209 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js.map +1 -0
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +89 -0
- package/dist/page-wizard/steps/Components.js.map +1 -0
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +140 -0
- package/dist/page-wizard/steps/CreatePage.js.map +1 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +228 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js.map +1 -0
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +5 -0
- package/dist/page-wizard/steps/EditButton.js.map +1 -0
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +28 -0
- package/dist/page-wizard/steps/FieldEditor.js.map +1 -0
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +10 -0
- package/dist/page-wizard/steps/Generate.js.map +1 -0
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +156 -0
- package/dist/page-wizard/steps/ImagesStep.js.map +1 -0
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +118 -0
- package/dist/page-wizard/steps/LayoutStep.js.map +1 -0
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +145 -0
- package/dist/page-wizard/steps/SelectStep.js.map +1 -0
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +137 -0
- package/dist/page-wizard/steps/schema.js.map +1 -0
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +192 -0
- package/dist/page-wizard/steps/usePageCreator.js.map +1 -0
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +129 -0
- package/dist/splash-screen/NewPage.js.map +1 -0
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +7 -0
- package/dist/splash-screen/SectionHeadline.js.map +1 -0
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +79 -0
- package/dist/splash-screen/SplashScreen.js.map +1 -0
- package/dist/styles.css +2739 -0
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +319 -0
- package/dist/tour/Tour.js.map +1 -0
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +229 -0
- package/dist/tour/default-tour.js.map +1 -0
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +91 -0
- package/dist/tour/preview-tour.js.map +1 -0
- package/dist/types.d.ts +259 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +12 -5
- package/src/components/ui/button.tsx +62 -0
- package/src/editor/Titlebar.tsx +2 -2
- package/src/editor/client/EditorClient.tsx +8 -9
- package/src/editor/menubar/ActionsMenu.tsx +1 -1
- package/src/editor/menubar/Menu.tsx +3 -3
- package/src/editor/menubar/VersionSelector.tsx +9 -10
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +8 -9
- package/src/editor/page-viewer/MiniMap.tsx +11 -11
- package/src/editor/reviews/Comment.tsx +38 -33
- package/src/editor/sidebar/ComponentTree.tsx +512 -512
- package/src/editor/sidebar/Insert.tsx +2 -2
- package/src/editor/sidebar/MainContentTree.tsx +1 -0
- package/src/editor/sidebar/Translations.tsx +12 -12
- package/src/editor/sidebar/ViewSelector.tsx +6 -7
- package/src/editor/ui/PerfectTree.tsx +2 -2
- package/src/editor/ui/SimpleTable.tsx +3 -6
- package/src/editor/utils.ts +32 -29
- package/src/index.ts +2 -0
- package/src/lib/utils.ts +6 -0
- package/src/splash-screen/SplashScreen.tsx +2 -2
- package/styles.css +124 -2
- package/tsconfig.build.json +23 -13
- package/tsconfig.json +3 -0
|
@@ -0,0 +1,160 @@
|
|
|
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({
|
|
17
|
+
email: "",
|
|
18
|
+
name: "",
|
|
19
|
+
});
|
|
20
|
+
const overlayPanelRef = useRef(null);
|
|
21
|
+
const editContext = useEditContext();
|
|
22
|
+
const [showErrors, setShowErrors] = useState(false);
|
|
23
|
+
const [waiting, setWaiting] = useState(false);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (editContext?.reviews) {
|
|
26
|
+
setReviewData(editContext.reviews.reviews.map((x) => ({
|
|
27
|
+
review: x,
|
|
28
|
+
checked: false,
|
|
29
|
+
})));
|
|
30
|
+
}
|
|
31
|
+
}, [editContext?.reviews]);
|
|
32
|
+
// Simple email validation function
|
|
33
|
+
const isValidEmail = (email) => {
|
|
34
|
+
// This regular expression is not perfect but works for basic validation
|
|
35
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
36
|
+
return emailRegex.test(email);
|
|
37
|
+
};
|
|
38
|
+
const emailAlreadyExists = (email) => {
|
|
39
|
+
return reviewData.some((x) => x.review?.reviewerEmail === email);
|
|
40
|
+
};
|
|
41
|
+
const getStatus = (reviewData) => {
|
|
42
|
+
if (reviewData?.updating) {
|
|
43
|
+
return _jsx("i", { className: "pi pi-spinner pi-spin" });
|
|
44
|
+
}
|
|
45
|
+
if (reviewData?.error) {
|
|
46
|
+
return (_jsxs("div", { className: "flex items-center gap-1", children: [_jsx("i", { className: "pi pi-times text-red-500 " }), " ", reviewData.error] }));
|
|
47
|
+
}
|
|
48
|
+
const review = reviewData?.review;
|
|
49
|
+
if (review) {
|
|
50
|
+
if (review.approvalDate) {
|
|
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))] }));
|
|
52
|
+
}
|
|
53
|
+
if (review.rejectedDate) {
|
|
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))] }));
|
|
55
|
+
}
|
|
56
|
+
if (review.invitationSentDate) {
|
|
57
|
+
return ("Invitation Sent " + formatDate(new Date(review.invitationSentDate)));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return "Not yet invited";
|
|
61
|
+
};
|
|
62
|
+
const sendInvitations = () => {
|
|
63
|
+
setShowErrors(true);
|
|
64
|
+
const invalidReviewers = reviewData.filter((x) => x.checked &&
|
|
65
|
+
(!x.review?.reviewerEmail || !isValidEmail(x.review?.reviewerEmail)));
|
|
66
|
+
if (invalidReviewers.length > 0) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
reviewData.forEach(async (x) => {
|
|
70
|
+
if (!editContext?.currentItemDescriptor)
|
|
71
|
+
return;
|
|
72
|
+
if (x.checked) {
|
|
73
|
+
x.updating = true;
|
|
74
|
+
setReviewData([...reviewData]);
|
|
75
|
+
const result = await inviteReviewer(x.review);
|
|
76
|
+
if (result.response.status !== 200) {
|
|
77
|
+
x.error = "Error inviting reviewer";
|
|
78
|
+
}
|
|
79
|
+
x.updating = false;
|
|
80
|
+
x.updating = false;
|
|
81
|
+
setReviewData([...reviewData]);
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
};
|
|
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) => {
|
|
86
|
+
overlayPanelRef.current?.toggle(x);
|
|
87
|
+
setTimeout(() => {
|
|
88
|
+
document.getElementById("name")?.focus();
|
|
89
|
+
}, 100);
|
|
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) => {
|
|
91
|
+
setNewReviewer((x) => ({
|
|
92
|
+
...x,
|
|
93
|
+
name: e.target.value,
|
|
94
|
+
}));
|
|
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) => {
|
|
96
|
+
setNewReviewer((x) => ({
|
|
97
|
+
...x,
|
|
98
|
+
email: e.target.value,
|
|
99
|
+
}));
|
|
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 () => {
|
|
101
|
+
if (!editContext?.contentEditorItem)
|
|
102
|
+
return;
|
|
103
|
+
setShowErrors(true);
|
|
104
|
+
if (emailAlreadyExists(newReviewer.email)) {
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
if (!isValidEmail(newReviewer.email) || !newReviewer.name) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
setWaiting(true);
|
|
111
|
+
await addReview({
|
|
112
|
+
id: uuid(),
|
|
113
|
+
reviewerName: newReviewer.name,
|
|
114
|
+
reviewerEmail: newReviewer.email,
|
|
115
|
+
itemId: editContext.contentEditorItem.id,
|
|
116
|
+
language: editContext.contentEditorItem.language,
|
|
117
|
+
version: editContext.contentEditorItem.version,
|
|
118
|
+
});
|
|
119
|
+
editContext.reviews.loadReviews();
|
|
120
|
+
overlayPanelRef.current?.hide();
|
|
121
|
+
setNewReviewer({
|
|
122
|
+
email: "",
|
|
123
|
+
name: "",
|
|
124
|
+
});
|
|
125
|
+
setWaiting(false);
|
|
126
|
+
} })] }) }) }), _jsx("div", { className: "flex-1 relative", children: _jsx("div", { className: "absolute inset-0 overflow-auto", children: _jsx(SimpleTable, { columns: [
|
|
127
|
+
{
|
|
128
|
+
header: (_jsx(Checkbox, { checked: reviewData.every((x) => x.checked), onChange: (e) => {
|
|
129
|
+
setReviewData((reviews) => reviews.map((x) => ({
|
|
130
|
+
...x,
|
|
131
|
+
checked: e.checked ?? false,
|
|
132
|
+
})));
|
|
133
|
+
} })),
|
|
134
|
+
body: (x) => (_jsx(Checkbox, { checked: x.checked, onChange: (e) => {
|
|
135
|
+
setReviewData((reviews) => {
|
|
136
|
+
// It’s safer to update by index or assign an id to each reviewer.
|
|
137
|
+
// For brevity, we’re using the email to locate the reviewer.
|
|
138
|
+
const index = reviews.findIndex((y) => y.review?.reviewerEmail === x.review?.reviewerEmail);
|
|
139
|
+
if (index !== -1) {
|
|
140
|
+
reviews[index].checked = e.checked ?? false;
|
|
141
|
+
}
|
|
142
|
+
return [...reviews];
|
|
143
|
+
});
|
|
144
|
+
} })),
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
header: "Name",
|
|
148
|
+
body: (x) => x.review?.reviewerName,
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
header: "Email",
|
|
152
|
+
body: (x) => x.review?.reviewerEmail,
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
header: "Status",
|
|
156
|
+
body: (z) => getStatus(z),
|
|
157
|
+
},
|
|
158
|
+
], items: reviewData }) }) })] }));
|
|
159
|
+
}
|
|
160
|
+
//# sourceMappingURL=Reviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Reviews.js","sourceRoot":"","sources":["../../../src/editor/reviews/Reviews.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,IAAI,MA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Y;6BACpC;4BACD;gCACE,MAAM,EAAE,OAAO;gCACf,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,EAAE,aAAa;6BACrC;4BACD;gCACE,MAAM,EAAE,QAAQ;gCAChB,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;6BAC1B;yBACF,EACD,KAAK,EAAE,UAAU,GACjB,GACE,GACF,IACF,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { approveReview, rejectReview } from "../services/reviewsService";
|
|
3
|
+
export const approveReviewCommand = {
|
|
4
|
+
id: "approveReview",
|
|
5
|
+
label: "Approve Page",
|
|
6
|
+
icon: _jsx("i", { className: "pi pi-check text-green-500 mr-3" }),
|
|
7
|
+
execute: async (context) => {
|
|
8
|
+
if (!context.editContext.currentItemDescriptor) {
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
await approveReview(context.editContext.currentItemDescriptor);
|
|
12
|
+
context.editContext.showToast({
|
|
13
|
+
summary: "Page/item approved",
|
|
14
|
+
severity: "success",
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
disabled: (context) => {
|
|
18
|
+
return !isReviewer(context);
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
export const rejectReviewCommand = {
|
|
22
|
+
id: "rejectReview",
|
|
23
|
+
label: "Reject Page",
|
|
24
|
+
icon: _jsx("i", { className: "pi pi-times text-red-500 mr-3" }),
|
|
25
|
+
execute: async (context) => {
|
|
26
|
+
if (!context.editContext.currentItemDescriptor) {
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
await rejectReview(context.editContext.currentItemDescriptor);
|
|
30
|
+
context.editContext.showToast({
|
|
31
|
+
summary: "Page/item rejected",
|
|
32
|
+
severity: "error",
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
disabled: (context) => {
|
|
36
|
+
return !isReviewer(context);
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
function isReviewer(context) {
|
|
40
|
+
return (context.editContext.reviews.reviews.find((x) => x.reviewerEmail === context.editContext.user?.email) !== undefined);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=reviewCommands.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"reviewCommands.js","sourceRoot":"","sources":["../../../src/editor/reviews/reviewCommands.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAEzE,MAAM,CAAC,MAAM,oBAAoB,GAAyB;IACxD,EAAE,EAAE,eAAe;IACnB,KAAK,EAAE,cAAc;IACrB,IAAI,EAAE,YAAG,SAAS,EAAC,iCAAiC,GAAG;IACvD,OAAO,EAAE,KAAK,EAAE,OAAoC,EAAE,EAAE;QACtD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;YAC/C,OAAO;QACT,CAAC;QACD,MAAM,aAAa,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;QAC/D,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;YAC5B,OAAO,EAAE,oBAAoB;YAC7B,QAAQ,EAAE,SAAS;SACpB,CAAC,CAAC;IACL,CAAC;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;QACpB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AACF,MAAM,CAAC,MAAM,mBAAmB,GAAyB;IACvD,EAAE,EAAE,cAAc;IAClB,KAAK,EAAE,aAAa;IACpB,IAAI,EAAE,YAAG,SAAS,EAAC,+BAA+B,GAAG;IACrD,OAAO,EAAE,KAAK,EAAE,OAAoC,EAAE,EAAE;QACtD,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,EAAE,CAAC;YAC/C,OAAO;QACT,CAAC;QACD,MAAM,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC,qBAAqB,CAAC,CAAC;QAC9D,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC;YAC5B,OAAO,EAAE,oBAAoB;YAC7B,QAAQ,EAAE,OAAO;SAClB,CAAC,CAAC;IACL,CAAC;IACD,QAAQ,EAAE,CAAC,OAAO,EAAE,EAAE;QACpB,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;IAC9B,CAAC;CACF,CAAC;AAEF,SAAS,UAAU,CAAC,OAAoC;IACtD,OAAO,CACL,OAAO,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CACtC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,aAAa,KAAK,OAAO,CAAC,WAAW,CAAC,IAAI,EAAE,KAAK,CAC3D,KAAK,SAAS,CAChB,CAAC;AACJ,CAAC"}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
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([]);
|
|
6
|
+
const loadReviews = async () => {
|
|
7
|
+
if (!currentItemDescriptor)
|
|
8
|
+
return;
|
|
9
|
+
const reviewers = await getReviewers(currentItemDescriptor.id, currentItemDescriptor.language);
|
|
10
|
+
const reviewsResult = await getReviews(currentItemDescriptor.id, currentItemDescriptor.language, currentItemDescriptor.version);
|
|
11
|
+
const reviews = reviewsResult.data;
|
|
12
|
+
if (!reviews)
|
|
13
|
+
return;
|
|
14
|
+
reviewers.data?.forEach((reviewer) => {
|
|
15
|
+
if (!currentItemDescriptor)
|
|
16
|
+
return;
|
|
17
|
+
const existingReview = reviews.find((r) => r.reviewerEmail === reviewer.email);
|
|
18
|
+
if (!existingReview) {
|
|
19
|
+
reviews.push({
|
|
20
|
+
id: uuid(),
|
|
21
|
+
itemId: currentItemDescriptor.id,
|
|
22
|
+
language: currentItemDescriptor.language,
|
|
23
|
+
version: currentItemDescriptor.version,
|
|
24
|
+
reviewerName: reviewer.name,
|
|
25
|
+
reviewerEmail: reviewer.email,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
setReviews(reviews);
|
|
30
|
+
};
|
|
31
|
+
useEffect(() => {
|
|
32
|
+
loadReviews();
|
|
33
|
+
}, [currentItemDescriptor]);
|
|
34
|
+
useEffect(() => {
|
|
35
|
+
return addSocketMessageListener((message) => {
|
|
36
|
+
if (message.type === "reviews-updated") {
|
|
37
|
+
loadReviews();
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
}, [currentItemDescriptor]);
|
|
41
|
+
return useMemo(() => ({ reviews, loadReviews }), [reviews]);
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=useReviews.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useReviews.js","sourceRoot":"","sources":["../../../src/editor/reviews/useReviews.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAGtE,OAAO,IAAI,M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G,EAAE;QACb,WAAW,EAAE,CAAC;IAChB,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE5B,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,wBAAwB,CAAC,CAAC,OAAO,EAAE,EAAE;YAC1C,IAAI,OAAO,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;gBACvC,WAAW,EAAE,CAAC;YAChB,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,qBAAqB,CAAC,CAAC,CAAC;IAE5B,OAAO,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,WAAW,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;AAC9D,CAAC"}
|
|
@@ -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 {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { post } from "./serviceHelper";
|
|
2
|
+
export async function loadAiProfiles(item) {
|
|
3
|
+
let url = "/alpaca/editor/ai/profiles";
|
|
4
|
+
const response = await post(url, item);
|
|
5
|
+
if (response.type !== "success") {
|
|
6
|
+
throw new Error("Error loading AI profiles");
|
|
7
|
+
}
|
|
8
|
+
return response.data || [];
|
|
9
|
+
}
|
|
10
|
+
export async function executePrompt(messages, editContext, createAiContext, allowedFunctions, addContextContent, options, model, callback) {
|
|
11
|
+
const context = createAiContext({ editContext });
|
|
12
|
+
const response = await fetch(context.endpoint, {
|
|
13
|
+
method: "POST",
|
|
14
|
+
body: JSON.stringify({
|
|
15
|
+
messages,
|
|
16
|
+
...context.promptData,
|
|
17
|
+
selection: editContext.selection,
|
|
18
|
+
sessionId: editContext.sessionId,
|
|
19
|
+
allowedFunctions,
|
|
20
|
+
addContextContent,
|
|
21
|
+
model,
|
|
22
|
+
}),
|
|
23
|
+
credentials: "include",
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-Type": "application/json",
|
|
26
|
+
},
|
|
27
|
+
...options,
|
|
28
|
+
});
|
|
29
|
+
if (!response?.body)
|
|
30
|
+
return null;
|
|
31
|
+
const reader = response.body.getReader();
|
|
32
|
+
const decoder = new TextDecoder();
|
|
33
|
+
let buffer = "";
|
|
34
|
+
let result = null;
|
|
35
|
+
while (true) {
|
|
36
|
+
const { done, value } = await reader.read();
|
|
37
|
+
if (done) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
buffer += decoder.decode(value, { stream: true }); // 'stream: true' ensures that any incomplete multi-byte characters aren't malformed.
|
|
41
|
+
// Split the buffer by newline and keep the last partial line for the next iteration.
|
|
42
|
+
const lines = buffer.split("\n");
|
|
43
|
+
if (lines.length > 0) {
|
|
44
|
+
buffer = lines.pop() || ""; // Incomplete line (if any) is kept for the next iteration.
|
|
45
|
+
for (let line of lines) {
|
|
46
|
+
if (line.trim() === "")
|
|
47
|
+
continue; // Skip empty lines if any.
|
|
48
|
+
try {
|
|
49
|
+
const jsonData = JSON.parse(line);
|
|
50
|
+
callback?.(jsonData);
|
|
51
|
+
result = jsonData;
|
|
52
|
+
}
|
|
53
|
+
catch (e) {
|
|
54
|
+
console.error("Error parsing line:" + line, e);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
// If there's any remaining content in the buffer after processing all chunks, try to process it.
|
|
60
|
+
if (buffer.trim() !== "") {
|
|
61
|
+
try {
|
|
62
|
+
const jsonData = JSON.parse(buffer);
|
|
63
|
+
result = jsonData;
|
|
64
|
+
}
|
|
65
|
+
catch (e) {
|
|
66
|
+
console.error("Error parsing the final buffer content:", e);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return result;
|
|
70
|
+
}
|
|
71
|
+
export async function executeSearch({ query, editContext, maxResults = 10, index, rootItemIds, skipValidation = false, }) {
|
|
72
|
+
const response = await fetch("/alpaca/editor/ai/search", {
|
|
73
|
+
method: "POST",
|
|
74
|
+
body: JSON.stringify({
|
|
75
|
+
contextItem: {
|
|
76
|
+
id: editContext.currentItemDescriptor?.id,
|
|
77
|
+
language: "en",
|
|
78
|
+
version: 0,
|
|
79
|
+
},
|
|
80
|
+
query,
|
|
81
|
+
index,
|
|
82
|
+
maxResults,
|
|
83
|
+
rootItemIds,
|
|
84
|
+
skipValidation,
|
|
85
|
+
}),
|
|
86
|
+
credentials: "include",
|
|
87
|
+
headers: {
|
|
88
|
+
"Content-Type": "application/json",
|
|
89
|
+
},
|
|
90
|
+
});
|
|
91
|
+
if (!response.ok)
|
|
92
|
+
return { type: "error", response };
|
|
93
|
+
return { type: "success", response, data: await response.json() };
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=aiService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiService.js","sourceRoot":"","sources":["../../../src/editor/services/aiService.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAYxD,MAAM,CAAC,KAAK,UAAU,cAAc,CAClC,IAAoB;IAEpB,IAAI,GAAG,GAAG,4BAA4B,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAc,GAAG,EAAE,IAAI,CAAC,CAAC;IAEpD,IAAI,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;IAC/C,CAAC;IAED,OAAO,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;AAC7B,CAAC;AAQD,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAAmB,EACnB,WAA4B,EAC5B,eAAqE,EACrE,gBAA2B,EAC3B,iBAA2B,EAC3B,OAAqB,EACrB,KAAc,EACd,QAAkC;IAElC,MAAM,OAAO,GAAG,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC,CAAC;IAEjD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,QAAQ,EAAE;QAC7C,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,QAAQ;YACR,GAAG,OAAO,CAAC,UAAU;YACrB,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,SAAS,EAAE,WAAW,CAAC,SAAS;YAChC,gBAAgB;YAChB,iBAAiB;YACjB,KAAK;SACN,CAAC;QAEF,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;QACD,GAAG,OAAO;KACX,CAAC,CAAC;IAEH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I,EAAE,KAAK,EAAE,EAAE,CAAC;QACzB,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YACpC,MAAM,GAAG,QAAQ,CAAC;QACpB,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,OAAO,CAAC,KAAK,CAAC,yCAAyC,EAAE,CAAC,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,EAClC,KAAK,EACL,WAAW,EACX,UAAU,GAAG,EAAE,EACf,KAAK,EACL,WAAW,EACX,cAAc,GAAG,KAAK,GAQvB;IACC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,0BAA0B,EAAE;QACvD,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;YACnB,WAAW,EAAE;gBACX,EAAE,EAAE,WAAW,CAAC,qBAAqB,EAAE,EAAE;gBACzC,QAAQ,EAAE,IAAI;gBACd,OAAO,EAAE,CAAC;aACX;YACD,KAAK;YACL,KAAK;YACL,UAAU;YACV,WAAW;YACX,cAAc;SACf,CAAC;QACF,WAAW,EAAE,SAAS;QACtB,OAAO,EAAE;YACP,cAAc,EAAE,kBAAkB;SACnC;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;IAErD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC;AACpE,CAAC"}
|
|
@@ -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
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { getItemDescriptor } from "../utils";
|
|
2
|
+
import { post } from "./serviceHelper";
|
|
3
|
+
export async function createNewComponent(name, contextItem) {
|
|
4
|
+
let url = "/alpaca/headless/component/create";
|
|
5
|
+
const response = await post(url, {
|
|
6
|
+
name,
|
|
7
|
+
contextItem: getItemDescriptor(contextItem),
|
|
8
|
+
});
|
|
9
|
+
if (!response.response.ok) {
|
|
10
|
+
return new Error("Error creating new component");
|
|
11
|
+
}
|
|
12
|
+
return await response.response.json();
|
|
13
|
+
}
|
|
14
|
+
export async function createRendering(name, context, componentTemplateId) {
|
|
15
|
+
let url = "/alpaca/headless/component/createRendering";
|
|
16
|
+
const response = await post(url, {
|
|
17
|
+
contextItem: getItemDescriptor(context),
|
|
18
|
+
componentTemplateId,
|
|
19
|
+
name,
|
|
20
|
+
});
|
|
21
|
+
if (!response.response.ok) {
|
|
22
|
+
return new Error("Error creating new rendering");
|
|
23
|
+
}
|
|
24
|
+
return await response.response.json();
|
|
25
|
+
}
|
|
26
|
+
export async function getAllComponents(contextItemId) {
|
|
27
|
+
let url = "/alpaca/headless/component/all?contextItemId=" + contextItemId;
|
|
28
|
+
const response = await fetch(url, {
|
|
29
|
+
method: "GET",
|
|
30
|
+
credentials: "include",
|
|
31
|
+
headers: {
|
|
32
|
+
"Content-Type": "application/json",
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
return await response.json();
|
|
36
|
+
}
|
|
37
|
+
export async function getFieldTypes() {
|
|
38
|
+
let url = "/alpaca/headless/component/fieldtypes";
|
|
39
|
+
const response = await fetch(url, {
|
|
40
|
+
method: "GET",
|
|
41
|
+
credentials: "include",
|
|
42
|
+
headers: {
|
|
43
|
+
"Content-Type": "application/json",
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
return await response.json();
|
|
47
|
+
}
|
|
48
|
+
export async function loadComponentDetails(id, contextItemId) {
|
|
49
|
+
let url = "/alpaca/headless/component?id=" + id + "&contextItemId=" + contextItemId;
|
|
50
|
+
const response = await fetch(url, {
|
|
51
|
+
method: "GET",
|
|
52
|
+
credentials: "include",
|
|
53
|
+
headers: {
|
|
54
|
+
"Content-Type": "application/json",
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
return await response.json();
|
|
58
|
+
}
|
|
59
|
+
export async function saveComponentDetails(component, contextItem) {
|
|
60
|
+
let url = "/alpaca/headless/component/save";
|
|
61
|
+
const response = await post(url, {
|
|
62
|
+
component,
|
|
63
|
+
contextItem: getItemDescriptor(contextItem),
|
|
64
|
+
});
|
|
65
|
+
if (response.response.ok) {
|
|
66
|
+
return true;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=componentDesignerService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"componentDesignerService.js","sourceRoot":"","sources":["../../../src/editor/services/componentDesignerService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,MAAM,CAAC,KAAK,UAAU,kBAAkB,CACtC,IAAY,EACZ,WAA2B;IAE3B,IAAI,GAAG,GAAG,mCAAmC,CAAC;IAE9C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE;QAC/B,IAAI;QACJ,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC;KAC5C,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QAC1B,OAAO,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IACnD,CAAC;IAED,OAAO,MAAM,QAAQ,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC;AACxC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,IAAY,EACZ,OAAuB,EACvB,mBAA2B;IAE3B,IAAI,GAAG,GAAG,4CAA4C,CAAC;IAEvD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE;QAC/B,WAAW,EAAE,iBAAiB,CAAC,O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IAAI,EAAE,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,SAA2B,EAC3B,WAA2B;IAE3B,IAAI,GAAG,GAAG,iCAAiC,CAAC;IAE5C,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,GAAG,EAAE;QAC/B,SAAS;QACT,WAAW,EAAE,iBAAiB,CAAC,WAAW,CAAC;KAC5C,CAAC,CAAC;IAEH,IAAI,QAAQ,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EditableDictionary, LanguagesAndVersions, Site, WorkboxItem } from "../../types";
|
|
2
|
+
import { FullItem, ItemDescriptor } from "../pageModel";
|
|
3
|
+
export type ItemTreeNodeData = {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
templateId: string;
|
|
7
|
+
icon: string;
|
|
8
|
+
hasChildren: boolean;
|
|
9
|
+
isComponent: boolean;
|
|
10
|
+
thumbUrl: string;
|
|
11
|
+
previewUrl: string;
|
|
12
|
+
resolution?: string;
|
|
13
|
+
format?: string;
|
|
14
|
+
created?: Date;
|
|
15
|
+
language: string;
|
|
16
|
+
version: number;
|
|
17
|
+
hasLayout: boolean;
|
|
18
|
+
path?: string;
|
|
19
|
+
idPath?: string;
|
|
20
|
+
};
|
|
21
|
+
export declare function getChildren(itemId: string, sessionId: string, templateIds: string[] | undefined, includeEmbeddedItems: boolean, language: string, include?: string): Promise<ItemTreeNodeData[]>;
|
|
22
|
+
export declare function fetchItems(itemDescriptors: ItemDescriptor[]): Promise<FullItem[] | undefined>;
|
|
23
|
+
export declare function getSites(): Promise<import("./serviceHelper").ExecutionResult<Site[]>>;
|
|
24
|
+
export declare function resolvePageAndSite(itemId: string, language: string, version: number): Promise<{
|
|
25
|
+
pageItem: ItemDescriptor;
|
|
26
|
+
site: {
|
|
27
|
+
name: string;
|
|
28
|
+
};
|
|
29
|
+
isHeadless: boolean;
|
|
30
|
+
} | undefined>;
|
|
31
|
+
export declare function getLanguagesAndVersions(item: ItemDescriptor): Promise<import("./serviceHelper").ExecutionResult<LanguagesAndVersions>>;
|
|
32
|
+
export declare function getPageJson(page: ItemDescriptor): Promise<any>;
|
|
33
|
+
export declare function getDictionary(siteName: string, language: string): Promise<EditableDictionary>;
|
|
34
|
+
export declare function getWorkbox(items: ItemDescriptor[]): Promise<import("./serviceHelper").ExecutionResult<WorkboxItem[]>>;
|