@alpaca-editor/core 1.0.3762-mono
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/.prettierrc +3 -0
- package/dist/client-components/api.js +6 -0
- package/dist/client-components/index.js +36 -0
- package/dist/components/ActionButton.js +9 -0
- package/dist/components/Error.js +28 -0
- package/dist/config/config.js +654 -0
- package/dist/config/types.js +2 -0
- package/dist/editor/ComponentInfo.js +31 -0
- package/dist/editor/ConfirmationDialog.js +32 -0
- package/dist/editor/ContentTree.js +406 -0
- package/dist/editor/ContextMenu.js +117 -0
- package/dist/editor/Editor.js +55 -0
- package/dist/editor/EditorWarning.js +13 -0
- package/dist/editor/EditorWarnings.js +24 -0
- package/dist/editor/FieldEditorPopup.js +24 -0
- package/dist/editor/FieldHistory.js +40 -0
- package/dist/editor/FieldList.js +63 -0
- package/dist/editor/FieldListField.js +164 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +114 -0
- package/dist/editor/FloatingToolbar.js +92 -0
- package/dist/editor/ImageEditor.js +55 -0
- package/dist/editor/InsertMenu.js +164 -0
- package/dist/editor/ItemInfo.js +30 -0
- package/dist/editor/LinkEditorDialog.js +89 -0
- package/dist/editor/MainLayout.js +46 -0
- package/dist/editor/NewEditorClient.js +9 -0
- package/dist/editor/PictureCropper.js +332 -0
- package/dist/editor/PictureEditor.js +104 -0
- package/dist/editor/PictureEditorDialog.js +194 -0
- package/dist/editor/ScrollingContentTree.js +30 -0
- package/dist/editor/Terminal.js +109 -0
- package/dist/editor/Titlebar.js +11 -0
- package/dist/editor/ai/AiPopup.js +25 -0
- package/dist/editor/ai/AiResponseMessage.js +24 -0
- package/dist/editor/ai/AiTerminal.js +241 -0
- package/dist/editor/ai/AiToolCall.js +18 -0
- package/dist/editor/ai/EditorAiTerminal.js +9 -0
- package/dist/editor/ai/editorAiContext.js +14 -0
- package/dist/editor/client/DialogContext.js +29 -0
- package/dist/editor/client/EditorClient.js +1336 -0
- package/dist/editor/client/GenericDialog.js +27 -0
- package/dist/editor/client/editContext.js +59 -0
- package/dist/editor/client/helpers.js +31 -0
- package/dist/editor/client/itemsRepository.js +255 -0
- package/dist/editor/client/operations.js +398 -0
- package/dist/editor/client/pageModelBuilder.js +129 -0
- package/dist/editor/commands/commands.js +2 -0
- package/dist/editor/commands/componentCommands.js +277 -0
- package/dist/editor/commands/createVersionCommand.js +26 -0
- package/dist/editor/commands/deleteVersionCommand.js +55 -0
- package/dist/editor/commands/itemCommands.js +134 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +94 -0
- package/dist/editor/commands/undo.js +32 -0
- package/dist/editor/component-designer/ComponentDesigner.js +58 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +9 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +67 -0
- package/dist/editor/component-designer/ComponentEditor.js +59 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +16 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +71 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +22 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +70 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +25 -0
- package/dist/editor/component-designer/TemplateEditor.js +144 -0
- package/dist/editor/component-designer/aiContext.js +18 -0
- package/dist/editor/componentTreeHelper.js +97 -0
- package/dist/editor/control-center/ControlCenterMenu.js +59 -0
- package/dist/editor/control-center/IndexOverview.js +27 -0
- package/dist/editor/control-center/IndexSettings.js +106 -0
- package/dist/editor/control-center/Status.js +7 -0
- package/dist/editor/editor-warnings/ItemLocked.js +40 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +16 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +16 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +14 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +27 -0
- package/dist/editor/field-types/AttachmentEditor.js +7 -0
- package/dist/editor/field-types/CheckboxEditor.js +32 -0
- package/dist/editor/field-types/DropLinkEditor.js +51 -0
- package/dist/editor/field-types/DropListEditor.js +58 -0
- package/dist/editor/field-types/ImageFieldEditor.js +36 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +64 -0
- package/dist/editor/field-types/LinkFieldEditor.js +58 -0
- package/dist/editor/field-types/MultiLineText.js +35 -0
- package/dist/editor/field-types/PictureFieldEditor.js +59 -0
- package/dist/editor/field-types/RawEditor.js +33 -0
- package/dist/editor/field-types/ReactQuill.js +366 -0
- package/dist/editor/field-types/RichTextEditor.js +46 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +72 -0
- package/dist/editor/field-types/SingleLineText.js +92 -0
- package/dist/editor/field-types/TreeListEditor.js +137 -0
- package/dist/editor/fieldTypes.js +2 -0
- package/dist/editor/media-selector/AiImageSearch.js +110 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +58 -0
- package/dist/editor/media-selector/MediaSelector.js +11 -0
- package/dist/editor/media-selector/Preview.js +9 -0
- package/dist/editor/media-selector/Thumbnails.js +11 -0
- package/dist/editor/media-selector/TreeSelector.js +171 -0
- package/dist/editor/media-selector/UploadZone.js +80 -0
- package/dist/editor/menubar/ActionsMenu.js +33 -0
- package/dist/editor/menubar/ActiveUsers.js +13 -0
- package/dist/editor/menubar/ApproveAndPublish.js +13 -0
- package/dist/editor/menubar/BrowseHistory.js +14 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +36 -0
- package/dist/editor/menubar/LanguageSelector.js +33 -0
- package/dist/editor/menubar/Menu.js +65 -0
- package/dist/editor/menubar/NavButtons.js +43 -0
- package/dist/editor/menubar/PageSelector.js +50 -0
- package/dist/editor/menubar/PageViewerControls.js +37 -0
- package/dist/editor/menubar/Separator.js +8 -0
- package/dist/editor/menubar/SiteInfo.js +26 -0
- package/dist/editor/menubar/User.js +18 -0
- package/dist/editor/menubar/VersionSelector.js +49 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +214 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +17 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +27 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +15 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +27 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +15 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +178 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +24 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +101 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +35 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +21 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +65 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +109 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +82 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +147 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +21 -0
- package/dist/editor/page-viewer/EditorForm.js +130 -0
- package/dist/editor/page-viewer/MiniMap.js +257 -0
- package/dist/editor/page-viewer/PageViewer.js +64 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +696 -0
- package/dist/editor/page-viewer/pageViewContext.js +117 -0
- package/dist/editor/pageModel.js +2 -0
- package/dist/editor/picture-shared.js +28 -0
- package/dist/editor/reviews/Comment.js +112 -0
- package/dist/editor/reviews/Comments.js +24 -0
- package/dist/editor/reviews/PreviewInfo.js +13 -0
- package/dist/editor/reviews/Reviews.js +165 -0
- package/dist/editor/reviews/reviewCommands.js +44 -0
- package/dist/editor/reviews/useReviews.js +48 -0
- package/dist/editor/services/aiService.js +99 -0
- package/dist/editor/services/componentDesignerService.js +79 -0
- package/dist/editor/services/contentService.js +104 -0
- package/dist/editor/services/editService.js +322 -0
- package/dist/editor/services/indexService.js +25 -0
- package/dist/editor/services/reviewsService.js +43 -0
- package/dist/editor/services/serviceHelper.js +67 -0
- package/dist/editor/services/systemService.js +7 -0
- package/dist/editor/services/translationService.js +15 -0
- package/dist/editor/services-server/api.js +119 -0
- package/dist/editor/services-server/graphQL.js +56 -0
- package/dist/editor/sidebar/ComponentPalette.js +55 -0
- package/dist/editor/sidebar/ComponentTree.js +362 -0
- package/dist/editor/sidebar/Debug.js +60 -0
- package/dist/editor/sidebar/DictionaryEditor.js +160 -0
- package/dist/editor/sidebar/EditHistory.js +74 -0
- package/dist/editor/sidebar/GraphQL.js +115 -0
- package/dist/editor/sidebar/Insert.js +24 -0
- package/dist/editor/sidebar/MainContentTree.js +52 -0
- package/dist/editor/sidebar/Performance.js +34 -0
- package/dist/editor/sidebar/Sessions.js +31 -0
- package/dist/editor/sidebar/Sidebar.js +15 -0
- package/dist/editor/sidebar/SidebarView.js +76 -0
- package/dist/editor/sidebar/Translations.js +160 -0
- package/dist/editor/sidebar/Validation.js +52 -0
- package/dist/editor/sidebar/ViewSelector.js +15 -0
- package/dist/editor/sidebar/Workbox.js +80 -0
- package/dist/editor/ui/CenteredMessage.js +7 -0
- package/dist/editor/ui/CopyToClipboardButton.js +17 -0
- package/dist/editor/ui/DialogButtons.js +7 -0
- package/dist/editor/ui/Icons.js +75 -0
- package/dist/editor/ui/ItemNameDialog.js +45 -0
- package/dist/editor/ui/ItemNameDialogNew.js +61 -0
- package/dist/editor/ui/ItemSearch.js +93 -0
- package/dist/editor/ui/PerfectTree.js +223 -0
- package/dist/editor/ui/Section.js +12 -0
- package/dist/editor/ui/SimpleIconButton.js +11 -0
- package/dist/editor/ui/SimpleMenu.js +9 -0
- package/dist/editor/ui/SimpleTable.js +11 -0
- package/dist/editor/ui/SimpleTabs.js +21 -0
- package/dist/editor/ui/SimpleToolbar.js +7 -0
- package/dist/editor/ui/Spinner.js +7 -0
- package/dist/editor/ui/Splitter.js +187 -0
- package/dist/editor/ui/StackedPanels.js +69 -0
- package/dist/editor/ui/Toolbar.js +7 -0
- package/dist/editor/utils/id-helper.js +7 -0
- package/dist/editor/utils/insertOptions.js +45 -0
- package/dist/editor/utils/itemutils.js +25 -0
- package/dist/editor/utils/useMemoDebug.js +20 -0
- package/dist/editor/utils.js +328 -0
- package/dist/editor/views/CompareView.js +147 -0
- package/dist/editor/views/EditView.js +17 -0
- package/dist/editor/views/ItemEditor.js +24 -0
- package/dist/editor/views/SingleEditView.js +25 -0
- package/dist/index.js +22 -0
- package/dist/page-wizard/PageWizard.js +62 -0
- package/dist/page-wizard/SelectWizard.js +43 -0
- package/dist/page-wizard/WizardSteps.js +71 -0
- package/dist/page-wizard/service.js +26 -0
- package/dist/page-wizard/startPageWizardCommand.js +23 -0
- package/dist/page-wizard/steps/BuildPageStep.js +138 -0
- package/dist/page-wizard/steps/CollectStep.js +124 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +211 -0
- package/dist/page-wizard/steps/Components.js +94 -0
- package/dist/page-wizard/steps/CreatePage.js +142 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +230 -0
- package/dist/page-wizard/steps/EditButton.js +7 -0
- package/dist/page-wizard/steps/FieldEditor.js +30 -0
- package/dist/page-wizard/steps/Generate.js +11 -0
- package/dist/page-wizard/steps/ImagesStep.js +159 -0
- package/dist/page-wizard/steps/LayoutStep.js +120 -0
- package/dist/page-wizard/steps/SelectStep.js +150 -0
- package/dist/page-wizard/steps/schema.js +140 -0
- package/dist/page-wizard/steps/usePageCreator.js +194 -0
- package/dist/splash-screen/NewPage.js +131 -0
- package/dist/splash-screen/SectionHeadline.js +9 -0
- package/dist/splash-screen/SplashScreen.js +81 -0
- package/dist/tour/Tour.js +321 -0
- package/dist/tour/default-tour.js +231 -0
- package/dist/tour/preview-tour.js +93 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/dist/types.js +2 -0
- package/eslint.config.mjs +4 -0
- package/images/bg-shape-black.webp +0 -0
- package/package.json +52 -0
- package/src/client-components/api.ts +6 -0
- package/src/client-components/index.ts +19 -0
- package/src/components/ActionButton.tsx +43 -0
- package/src/components/Error.tsx +57 -0
- package/src/config/config.tsx +737 -0
- package/src/config/types.ts +263 -0
- package/src/editor/ComponentInfo.tsx +77 -0
- package/src/editor/ConfirmationDialog.tsx +103 -0
- package/src/editor/ContentTree.tsx +654 -0
- package/src/editor/ContextMenu.tsx +155 -0
- package/src/editor/Editor.tsx +91 -0
- package/src/editor/EditorWarning.tsx +34 -0
- package/src/editor/EditorWarnings.tsx +33 -0
- package/src/editor/FieldEditorPopup.tsx +65 -0
- package/src/editor/FieldHistory.tsx +74 -0
- package/src/editor/FieldList.tsx +190 -0
- package/src/editor/FieldListField.tsx +387 -0
- package/src/editor/FieldListFieldWithFallbacks.tsx +211 -0
- package/src/editor/FloatingToolbar.tsx +163 -0
- package/src/editor/ImageEditor.tsx +129 -0
- package/src/editor/InsertMenu.tsx +332 -0
- package/src/editor/ItemInfo.tsx +90 -0
- package/src/editor/LinkEditorDialog.tsx +192 -0
- package/src/editor/MainLayout.tsx +94 -0
- package/src/editor/NewEditorClient.tsx +11 -0
- package/src/editor/PictureCropper.tsx +505 -0
- package/src/editor/PictureEditor.tsx +206 -0
- package/src/editor/PictureEditorDialog.tsx +381 -0
- package/src/editor/PublishDialog.ignore +74 -0
- package/src/editor/ScrollingContentTree.tsx +47 -0
- package/src/editor/Terminal.tsx +215 -0
- package/src/editor/Titlebar.tsx +23 -0
- package/src/editor/ai/AiPopup.tsx +59 -0
- package/src/editor/ai/AiResponseMessage.tsx +82 -0
- package/src/editor/ai/AiTerminal.tsx +450 -0
- package/src/editor/ai/AiToolCall.tsx +46 -0
- package/src/editor/ai/EditorAiTerminal.tsx +20 -0
- package/src/editor/ai/editorAiContext.ts +18 -0
- package/src/editor/client/DialogContext.tsx +49 -0
- package/src/editor/client/EditorClient.tsx +1831 -0
- package/src/editor/client/GenericDialog.tsx +50 -0
- package/src/editor/client/editContext.ts +330 -0
- package/src/editor/client/helpers.ts +44 -0
- package/src/editor/client/itemsRepository.ts +391 -0
- package/src/editor/client/operations.ts +610 -0
- package/src/editor/client/pageModelBuilder.ts +182 -0
- package/src/editor/commands/commands.ts +23 -0
- package/src/editor/commands/componentCommands.tsx +408 -0
- package/src/editor/commands/createVersionCommand.ts +33 -0
- package/src/editor/commands/deleteVersionCommand.ts +71 -0
- package/src/editor/commands/itemCommands.tsx +186 -0
- package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +201 -0
- package/src/editor/commands/undo.ts +39 -0
- package/src/editor/component-designer/ComponentDesigner.tsx +70 -0
- package/src/editor/component-designer/ComponentDesignerAiTerminal.tsx +11 -0
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +91 -0
- package/src/editor/component-designer/ComponentEditor.tsx +97 -0
- package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +31 -0
- package/src/editor/component-designer/ComponentRenderingEditor.tsx +104 -0
- package/src/editor/component-designer/ComponentsDropdown.tsx +39 -0
- package/src/editor/component-designer/PlaceholdersEditor.tsx +183 -0
- package/src/editor/component-designer/RenderingsDropdown.tsx +36 -0
- package/src/editor/component-designer/TemplateEditor.tsx +236 -0
- package/src/editor/component-designer/aiContext.ts +23 -0
- package/src/editor/componentTreeHelper.tsx +114 -0
- package/src/editor/control-center/ControlCenterMenu.tsx +71 -0
- package/src/editor/control-center/IndexOverview.tsx +50 -0
- package/src/editor/control-center/IndexSettings.tsx +266 -0
- package/src/editor/control-center/Status.tsx +7 -0
- package/src/editor/editor-warnings/ItemLocked.tsx +63 -0
- package/src/editor/editor-warnings/NoLanguageWriteAccess.tsx +22 -0
- package/src/editor/editor-warnings/NoWorkflowWriteAccess.tsx +23 -0
- package/src/editor/editor-warnings/NoWriteAccess.tsx +15 -0
- package/src/editor/editor-warnings/ValidationErrors.tsx +54 -0
- package/src/editor/field-types/AttachmentEditor.tsx +9 -0
- package/src/editor/field-types/CheckboxEditor.tsx +47 -0
- package/src/editor/field-types/DropLinkEditor.tsx +75 -0
- package/src/editor/field-types/DropListEditor.tsx +84 -0
- package/src/editor/field-types/ImageFieldEditor.tsx +65 -0
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +112 -0
- package/src/editor/field-types/LinkFieldEditor.tsx +85 -0
- package/src/editor/field-types/MultiLineText.tsx +63 -0
- package/src/editor/field-types/PictureFieldEditor.tsx +121 -0
- package/src/editor/field-types/RawEditor.tsx +53 -0
- package/src/editor/field-types/ReactQuill.tsx +580 -0
- package/src/editor/field-types/RichTextEditor.tsx +22 -0
- package/src/editor/field-types/RichTextEditorComponent.tsx +108 -0
- package/src/editor/field-types/SingleLineText.tsx +150 -0
- package/src/editor/field-types/TreeListEditor.tsx +261 -0
- package/src/editor/fieldTypes.ts +140 -0
- package/src/editor/media-selector/AiImageSearch.tsx +186 -0
- package/src/editor/media-selector/AiImageSearchPrompt.tsx +95 -0
- package/src/editor/media-selector/MediaSelector.tsx +42 -0
- package/src/editor/media-selector/Preview.tsx +14 -0
- package/src/editor/media-selector/Thumbnails.tsx +48 -0
- package/src/editor/media-selector/TreeSelector.tsx +292 -0
- package/src/editor/media-selector/UploadZone.tsx +137 -0
- package/src/editor/menubar/ActionsMenu.tsx +47 -0
- package/src/editor/menubar/ActiveUsers.tsx +17 -0
- package/src/editor/menubar/ApproveAndPublish.tsx +18 -0
- package/src/editor/menubar/BrowseHistory.tsx +37 -0
- package/src/editor/menubar/ItemLanguageVersion.tsx +52 -0
- package/src/editor/menubar/LanguageSelector.tsx +152 -0
- package/src/editor/menubar/Menu.tsx +83 -0
- package/src/editor/menubar/NavButtons.tsx +74 -0
- package/src/editor/menubar/PageSelector.tsx +139 -0
- package/src/editor/menubar/PageViewerControls.tsx +99 -0
- package/src/editor/menubar/Separator.tsx +12 -0
- package/src/editor/menubar/SiteInfo.tsx +53 -0
- package/src/editor/menubar/User.tsx +27 -0
- package/src/editor/menubar/VersionSelector.tsx +143 -0
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +287 -0
- package/src/editor/page-editor-chrome/CommentHighlightings.tsx +35 -0
- package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +44 -0
- package/src/editor/page-editor-chrome/FieldActionIndicators.tsx +23 -0
- package/src/editor/page-editor-chrome/FieldEditedIndicator.tsx +64 -0
- package/src/editor/page-editor-chrome/FieldEditedIndicators.tsx +35 -0
- package/src/editor/page-editor-chrome/FrameMenu.tsx +263 -0
- package/src/editor/page-editor-chrome/FrameMenus.tsx +48 -0
- package/src/editor/page-editor-chrome/InlineEditor.tsx +147 -0
- package/src/editor/page-editor-chrome/LockedFieldIndicator.tsx +61 -0
- package/src/editor/page-editor-chrome/NoLayout.tsx +36 -0
- package/src/editor/page-editor-chrome/PageEditorChrome.tsx +119 -0
- package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +154 -0
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +171 -0
- package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +233 -0
- package/src/editor/page-viewer/DeviceToolbar.tsx +70 -0
- package/src/editor/page-viewer/EditorForm.tsx +247 -0
- package/src/editor/page-viewer/MiniMap.tsx +351 -0
- package/src/editor/page-viewer/PageViewer.tsx +127 -0
- package/src/editor/page-viewer/PageViewerFrame.tsx +1030 -0
- package/src/editor/page-viewer/pageViewContext.ts +186 -0
- package/src/editor/pageModel.ts +191 -0
- package/src/editor/picture-shared.tsx +53 -0
- package/src/editor/reviews/Comment.tsx +265 -0
- package/src/editor/reviews/Comments.tsx +50 -0
- package/src/editor/reviews/PreviewInfo.tsx +35 -0
- package/src/editor/reviews/Reviews.tsx +280 -0
- package/src/editor/reviews/reviewCommands.tsx +47 -0
- package/src/editor/reviews/useReviews.tsx +70 -0
- package/src/editor/services/aiService.ts +155 -0
- package/src/editor/services/componentDesignerService.ts +151 -0
- package/src/editor/services/contentService.ts +159 -0
- package/src/editor/services/editService.ts +462 -0
- package/src/editor/services/indexService.ts +24 -0
- package/src/editor/services/reviewsService.ts +45 -0
- package/src/editor/services/serviceHelper.ts +95 -0
- package/src/editor/services/systemService.ts +5 -0
- package/src/editor/services/translationService.ts +21 -0
- package/src/editor/services-server/api.ts +150 -0
- package/src/editor/services-server/graphQL.ts +106 -0
- package/src/editor/sidebar/ComponentPalette.tsx +146 -0
- package/src/editor/sidebar/ComponentTree.tsx +512 -0
- package/src/editor/sidebar/ComponentTree2.tsxx +490 -0
- package/src/editor/sidebar/Debug.tsx +105 -0
- package/src/editor/sidebar/DictionaryEditor.tsx +261 -0
- package/src/editor/sidebar/EditHistory.tsx +134 -0
- package/src/editor/sidebar/GraphQL.tsx +164 -0
- package/src/editor/sidebar/Insert.tsx +35 -0
- package/src/editor/sidebar/MainContentTree.tsx +95 -0
- package/src/editor/sidebar/Performance.tsx +53 -0
- package/src/editor/sidebar/Sessions.tsx +35 -0
- package/src/editor/sidebar/Sidebar.tsx +20 -0
- package/src/editor/sidebar/SidebarView.tsx +150 -0
- package/src/editor/sidebar/Translations.tsx +276 -0
- package/src/editor/sidebar/Validation.tsx +102 -0
- package/src/editor/sidebar/ViewSelector.tsx +49 -0
- package/src/editor/sidebar/Workbox.tsx +209 -0
- package/src/editor/ui/CenteredMessage.tsx +7 -0
- package/src/editor/ui/CopyToClipboardButton.tsx +23 -0
- package/src/editor/ui/DialogButtons.tsx +11 -0
- package/src/editor/ui/Icons.tsx +585 -0
- package/src/editor/ui/ItemNameDialog.tsx +94 -0
- package/src/editor/ui/ItemNameDialogNew.tsx +118 -0
- package/src/editor/ui/ItemSearch.tsx +173 -0
- package/src/editor/ui/PerfectTree.tsx +550 -0
- package/src/editor/ui/Section.tsx +35 -0
- package/src/editor/ui/SimpleIconButton.tsx +43 -0
- package/src/editor/ui/SimpleMenu.tsx +48 -0
- package/src/editor/ui/SimpleTable.tsx +63 -0
- package/src/editor/ui/SimpleTabs.tsx +55 -0
- package/src/editor/ui/SimpleToolbar.tsx +7 -0
- package/src/editor/ui/Spinner.tsx +7 -0
- package/src/editor/ui/Splitter.tsx +247 -0
- package/src/editor/ui/StackedPanels.tsx +134 -0
- package/src/editor/ui/Toolbar.tsx +7 -0
- package/src/editor/utils/id-helper.ts +3 -0
- package/src/editor/utils/insertOptions.ts +69 -0
- package/src/editor/utils/itemutils.ts +29 -0
- package/src/editor/utils/useMemoDebug.ts +28 -0
- package/src/editor/utils.ts +435 -0
- package/src/editor/views/CompareView.tsx +256 -0
- package/src/editor/views/EditView.tsx +27 -0
- package/src/editor/views/ItemEditor.tsx +58 -0
- package/src/editor/views/SingleEditView.tsx +44 -0
- package/src/fonts/Geist-Black.woff2 +0 -0
- package/src/fonts/Geist-Bold.woff2 +0 -0
- package/src/fonts/Geist-ExtraBold.woff2 +0 -0
- package/src/fonts/Geist-ExtraLight.woff2 +0 -0
- package/src/fonts/Geist-Light.woff2 +0 -0
- package/src/fonts/Geist-Medium.woff2 +0 -0
- package/src/fonts/Geist-Regular.woff2 +0 -0
- package/src/fonts/Geist-SemiBold.woff2 +0 -0
- package/src/fonts/Geist-Thin.woff2 +0 -0
- package/src/fonts/Geist[wght].woff2 +0 -0
- package/src/index.ts +7 -0
- package/src/page-wizard/PageWizard.tsx +163 -0
- package/src/page-wizard/SelectWizard.tsx +109 -0
- package/src/page-wizard/WizardSteps.tsx +207 -0
- package/src/page-wizard/service.ts +35 -0
- package/src/page-wizard/startPageWizardCommand.ts +27 -0
- package/src/page-wizard/steps/BuildPageStep.tsx +266 -0
- package/src/page-wizard/steps/CollectStep.tsx +233 -0
- package/src/page-wizard/steps/ComponentTypesSelector.tsx +443 -0
- package/src/page-wizard/steps/Components.tsx +193 -0
- package/src/page-wizard/steps/CreatePage.tsx +285 -0
- package/src/page-wizard/steps/CreatePageAndLayoutStep.tsx +384 -0
- package/src/page-wizard/steps/EditButton.tsx +34 -0
- package/src/page-wizard/steps/FieldEditor.tsx +102 -0
- package/src/page-wizard/steps/Generate.tsx +32 -0
- package/src/page-wizard/steps/ImagesStep.tsx +318 -0
- package/src/page-wizard/steps/LayoutStep.tsx +228 -0
- package/src/page-wizard/steps/SelectStep.tsx +256 -0
- package/src/page-wizard/steps/schema.ts +180 -0
- package/src/page-wizard/steps/usePageCreator.ts +279 -0
- package/src/splash-screen/NewPage.tsx +232 -0
- package/src/splash-screen/SectionHeadline.tsx +21 -0
- package/src/splash-screen/SplashScreen.tsx +156 -0
- package/src/tour/Tour.tsx +558 -0
- package/src/tour/default-tour.tsx +300 -0
- package/src/tour/preview-tour.tsx +127 -0
- package/src/types.ts +302 -0
- package/styles.css +476 -0
- package/tsconfig.build.json +21 -0
- package/tsconfig.json +11 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.loadAiProfiles = loadAiProfiles;
|
|
4
|
+
exports.executePrompt = executePrompt;
|
|
5
|
+
exports.executeSearch = executeSearch;
|
|
6
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
7
|
+
async function loadAiProfiles(item) {
|
|
8
|
+
let url = "/alpaca/editor/ai/profiles";
|
|
9
|
+
const response = await (0, serviceHelper_1.post)(url, item);
|
|
10
|
+
if (response.type !== "success") {
|
|
11
|
+
throw new Error("Error loading AI profiles");
|
|
12
|
+
}
|
|
13
|
+
return response.data || [];
|
|
14
|
+
}
|
|
15
|
+
async function executePrompt(messages, editContext, createAiContext, allowedFunctions, addContextContent, options, model, callback) {
|
|
16
|
+
const context = createAiContext({ editContext });
|
|
17
|
+
const response = await fetch(context.endpoint, {
|
|
18
|
+
method: "POST",
|
|
19
|
+
body: JSON.stringify({
|
|
20
|
+
messages,
|
|
21
|
+
...context.promptData,
|
|
22
|
+
selection: editContext.selection,
|
|
23
|
+
sessionId: editContext.sessionId,
|
|
24
|
+
allowedFunctions,
|
|
25
|
+
addContextContent,
|
|
26
|
+
model,
|
|
27
|
+
}),
|
|
28
|
+
credentials: "include",
|
|
29
|
+
headers: {
|
|
30
|
+
"Content-Type": "application/json",
|
|
31
|
+
},
|
|
32
|
+
...options,
|
|
33
|
+
});
|
|
34
|
+
if (!response?.body)
|
|
35
|
+
return null;
|
|
36
|
+
const reader = response.body.getReader();
|
|
37
|
+
const decoder = new TextDecoder();
|
|
38
|
+
let buffer = "";
|
|
39
|
+
let result = null;
|
|
40
|
+
while (true) {
|
|
41
|
+
const { done, value } = await reader.read();
|
|
42
|
+
if (done) {
|
|
43
|
+
break;
|
|
44
|
+
}
|
|
45
|
+
buffer += decoder.decode(value, { stream: true }); // 'stream: true' ensures that any incomplete multi-byte characters aren't malformed.
|
|
46
|
+
// Split the buffer by newline and keep the last partial line for the next iteration.
|
|
47
|
+
const lines = buffer.split("\n");
|
|
48
|
+
if (lines.length > 0) {
|
|
49
|
+
buffer = lines.pop() || ""; // Incomplete line (if any) is kept for the next iteration.
|
|
50
|
+
for (let line of lines) {
|
|
51
|
+
if (line.trim() === "")
|
|
52
|
+
continue; // Skip empty lines if any.
|
|
53
|
+
try {
|
|
54
|
+
const jsonData = JSON.parse(line);
|
|
55
|
+
callback?.(jsonData);
|
|
56
|
+
result = jsonData;
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
console.error("Error parsing line:" + line, e);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// If there's any remaining content in the buffer after processing all chunks, try to process it.
|
|
65
|
+
if (buffer.trim() !== "") {
|
|
66
|
+
try {
|
|
67
|
+
const jsonData = JSON.parse(buffer);
|
|
68
|
+
result = jsonData;
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
console.error("Error parsing the final buffer content:", e);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return result;
|
|
75
|
+
}
|
|
76
|
+
async function executeSearch({ query, editContext, maxResults = 10, index, rootItemIds, skipValidation = false, }) {
|
|
77
|
+
const response = await fetch("/alpaca/editor/ai/search", {
|
|
78
|
+
method: "POST",
|
|
79
|
+
body: JSON.stringify({
|
|
80
|
+
contextItem: {
|
|
81
|
+
id: editContext.currentItemDescriptor?.id,
|
|
82
|
+
language: "en",
|
|
83
|
+
version: 0,
|
|
84
|
+
},
|
|
85
|
+
query,
|
|
86
|
+
index,
|
|
87
|
+
maxResults,
|
|
88
|
+
rootItemIds,
|
|
89
|
+
skipValidation,
|
|
90
|
+
}),
|
|
91
|
+
credentials: "include",
|
|
92
|
+
headers: {
|
|
93
|
+
"Content-Type": "application/json",
|
|
94
|
+
},
|
|
95
|
+
});
|
|
96
|
+
if (!response.ok)
|
|
97
|
+
return { type: "error", response };
|
|
98
|
+
return { type: "success", response, data: await response.json() };
|
|
99
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createNewComponent = createNewComponent;
|
|
4
|
+
exports.createRendering = createRendering;
|
|
5
|
+
exports.getAllComponents = getAllComponents;
|
|
6
|
+
exports.getFieldTypes = getFieldTypes;
|
|
7
|
+
exports.loadComponentDetails = loadComponentDetails;
|
|
8
|
+
exports.saveComponentDetails = saveComponentDetails;
|
|
9
|
+
const utils_1 = require("../utils");
|
|
10
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
11
|
+
async function createNewComponent(name, contextItem) {
|
|
12
|
+
let url = "/alpaca/headless/component/create";
|
|
13
|
+
const response = await (0, serviceHelper_1.post)(url, {
|
|
14
|
+
name,
|
|
15
|
+
contextItem: (0, utils_1.getItemDescriptor)(contextItem),
|
|
16
|
+
});
|
|
17
|
+
if (!response.response.ok) {
|
|
18
|
+
return new Error("Error creating new component");
|
|
19
|
+
}
|
|
20
|
+
return await response.response.json();
|
|
21
|
+
}
|
|
22
|
+
async function createRendering(name, context, componentTemplateId) {
|
|
23
|
+
let url = "/alpaca/headless/component/createRendering";
|
|
24
|
+
const response = await (0, serviceHelper_1.post)(url, {
|
|
25
|
+
contextItem: (0, utils_1.getItemDescriptor)(context),
|
|
26
|
+
componentTemplateId,
|
|
27
|
+
name,
|
|
28
|
+
});
|
|
29
|
+
if (!response.response.ok) {
|
|
30
|
+
return new Error("Error creating new rendering");
|
|
31
|
+
}
|
|
32
|
+
return await response.response.json();
|
|
33
|
+
}
|
|
34
|
+
async function getAllComponents(contextItemId) {
|
|
35
|
+
let url = "/alpaca/headless/component/all?contextItemId=" + contextItemId;
|
|
36
|
+
const response = await fetch(url, {
|
|
37
|
+
method: "GET",
|
|
38
|
+
credentials: "include",
|
|
39
|
+
headers: {
|
|
40
|
+
"Content-Type": "application/json",
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
return await response.json();
|
|
44
|
+
}
|
|
45
|
+
async function getFieldTypes() {
|
|
46
|
+
let url = "/alpaca/headless/component/fieldtypes";
|
|
47
|
+
const response = await fetch(url, {
|
|
48
|
+
method: "GET",
|
|
49
|
+
credentials: "include",
|
|
50
|
+
headers: {
|
|
51
|
+
"Content-Type": "application/json",
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
return await response.json();
|
|
55
|
+
}
|
|
56
|
+
async function loadComponentDetails(id, contextItemId) {
|
|
57
|
+
let url = "/alpaca/headless/component?id=" + id + "&contextItemId=" + contextItemId;
|
|
58
|
+
const response = await fetch(url, {
|
|
59
|
+
method: "GET",
|
|
60
|
+
credentials: "include",
|
|
61
|
+
headers: {
|
|
62
|
+
"Content-Type": "application/json",
|
|
63
|
+
},
|
|
64
|
+
});
|
|
65
|
+
return await response.json();
|
|
66
|
+
}
|
|
67
|
+
async function saveComponentDetails(component, contextItem) {
|
|
68
|
+
let url = "/alpaca/headless/component/save";
|
|
69
|
+
const response = await (0, serviceHelper_1.post)(url, {
|
|
70
|
+
component,
|
|
71
|
+
contextItem: (0, utils_1.getItemDescriptor)(contextItem),
|
|
72
|
+
});
|
|
73
|
+
if (response.response.ok) {
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
return false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.getChildren = getChildren;
|
|
7
|
+
exports.fetchItems = fetchItems;
|
|
8
|
+
exports.getSites = getSites;
|
|
9
|
+
exports.resolvePageAndSite = resolvePageAndSite;
|
|
10
|
+
exports.getLanguagesAndVersions = getLanguagesAndVersions;
|
|
11
|
+
exports.getPageJson = getPageJson;
|
|
12
|
+
exports.getDictionary = getDictionary;
|
|
13
|
+
exports.getWorkbox = getWorkbox;
|
|
14
|
+
const universal_cookie_1 = __importDefault(require("universal-cookie"));
|
|
15
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
16
|
+
async function getChildren(itemId, sessionId, templateIds = [], includeEmbeddedItems, language, include) {
|
|
17
|
+
let url =
|
|
18
|
+
// configuration.services.editorService.baseUrl +
|
|
19
|
+
"/alpaca/editor/children?itemId=" +
|
|
20
|
+
itemId +
|
|
21
|
+
"&sessionId=" +
|
|
22
|
+
sessionId +
|
|
23
|
+
"&includeEmbeddedItems=" +
|
|
24
|
+
includeEmbeddedItems +
|
|
25
|
+
"&language=" +
|
|
26
|
+
language +
|
|
27
|
+
"&include=" +
|
|
28
|
+
include;
|
|
29
|
+
url = templateIds.reduce((u, t) => u + "&templateIds=" + t, url);
|
|
30
|
+
const response = await fetch(url, {
|
|
31
|
+
method: "GET",
|
|
32
|
+
credentials: "include",
|
|
33
|
+
headers: {
|
|
34
|
+
"Content-Type": "application/json",
|
|
35
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
return await response.json();
|
|
39
|
+
}
|
|
40
|
+
// export async function getItem(
|
|
41
|
+
// item: ItemDescriptor
|
|
42
|
+
// ): Promise<FullItem | undefined> {
|
|
43
|
+
// let url =
|
|
44
|
+
// "/alpaca/editor/item?itemId=" +
|
|
45
|
+
// item.id +
|
|
46
|
+
// "&language=" +
|
|
47
|
+
// item.language +
|
|
48
|
+
// "&version=" +
|
|
49
|
+
// item.version;
|
|
50
|
+
// const response = await fetch(url, {
|
|
51
|
+
// method: "GET",
|
|
52
|
+
// credentials: "include",
|
|
53
|
+
// headers: {
|
|
54
|
+
// "Content-Type": "application/json",
|
|
55
|
+
// Cookie: new Cookies().getAll(),
|
|
56
|
+
// },
|
|
57
|
+
// });
|
|
58
|
+
// if (response.ok) {
|
|
59
|
+
// const json = await response.json();
|
|
60
|
+
// return json;
|
|
61
|
+
// }
|
|
62
|
+
// return undefined;
|
|
63
|
+
// }
|
|
64
|
+
async function fetchItems(itemDescriptors) {
|
|
65
|
+
let url = "/alpaca/editor/items";
|
|
66
|
+
const response = await (0, serviceHelper_1.post)(url, itemDescriptors);
|
|
67
|
+
return response.data || [];
|
|
68
|
+
}
|
|
69
|
+
async function getSites() {
|
|
70
|
+
return await (0, serviceHelper_1.get)("/alpaca/editor/sites");
|
|
71
|
+
}
|
|
72
|
+
async function resolvePageAndSite(itemId, language, version) {
|
|
73
|
+
const result = await (0, serviceHelper_1.post)("/alpaca/editor/resolve", {
|
|
74
|
+
itemId,
|
|
75
|
+
language,
|
|
76
|
+
version,
|
|
77
|
+
mode: "edit",
|
|
78
|
+
});
|
|
79
|
+
if (result.data) {
|
|
80
|
+
return result.data;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
async function getLanguagesAndVersions(item) {
|
|
84
|
+
return await (0, serviceHelper_1.post)("/alpaca/editor/getLanguagesAndVersions", item);
|
|
85
|
+
}
|
|
86
|
+
async function getPageJson(page) {
|
|
87
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/headless/layout", {
|
|
88
|
+
itemId: page.id,
|
|
89
|
+
language: page.language,
|
|
90
|
+
version: page.version,
|
|
91
|
+
mode: "preview",
|
|
92
|
+
});
|
|
93
|
+
return response.data?.page;
|
|
94
|
+
}
|
|
95
|
+
async function getDictionary(siteName, language) {
|
|
96
|
+
let response = await (0, serviceHelper_1.get)("/alpaca/editor/dictionary/index?siteName=" +
|
|
97
|
+
siteName +
|
|
98
|
+
"&language=" +
|
|
99
|
+
language);
|
|
100
|
+
return response.data;
|
|
101
|
+
}
|
|
102
|
+
async function getWorkbox(items) {
|
|
103
|
+
return await (0, serviceHelper_1.post)("/alpaca/editor/workbox", items);
|
|
104
|
+
}
|
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.connectSocket = connectSocket;
|
|
7
|
+
exports.getPictureValue = getPictureValue;
|
|
8
|
+
exports.executeEditOperation = executeEditOperation;
|
|
9
|
+
exports.executeUndo = executeUndo;
|
|
10
|
+
exports.executeRedo = executeRedo;
|
|
11
|
+
exports.executeDeleteItems = executeDeleteItems;
|
|
12
|
+
exports.lockItems = lockItems;
|
|
13
|
+
exports.unlockItems = unlockItems;
|
|
14
|
+
exports.lockField = lockField;
|
|
15
|
+
exports.releaseFieldLocks = releaseFieldLocks;
|
|
16
|
+
exports.validateItems = validateItems;
|
|
17
|
+
exports.executeWorkflowCommand = executeWorkflowCommand;
|
|
18
|
+
exports.executeFieldAction = executeFieldAction;
|
|
19
|
+
exports.createVersion = createVersion;
|
|
20
|
+
exports.deleteVersion = deleteVersion;
|
|
21
|
+
exports.loadInsertOptions = loadInsertOptions;
|
|
22
|
+
exports.loadPlaceholderInsertOptions = loadPlaceholderInsertOptions;
|
|
23
|
+
exports.loadFieldButtons = loadFieldButtons;
|
|
24
|
+
exports.getLookupSources = getLookupSources;
|
|
25
|
+
exports.executeCreateItem = executeCreateItem;
|
|
26
|
+
exports.getEditHistory = getEditHistory;
|
|
27
|
+
exports.getFieldHistory = getFieldHistory;
|
|
28
|
+
exports.getUserInfo = getUserInfo;
|
|
29
|
+
exports.executeMoveItems = executeMoveItems;
|
|
30
|
+
const universal_cookie_1 = __importDefault(require("universal-cookie"));
|
|
31
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
32
|
+
function connectSocket(sessionId) {
|
|
33
|
+
const host = window.location.hostname;
|
|
34
|
+
const protocol = window.location.protocol === "https:" ? "wss:" : "ws:";
|
|
35
|
+
const port = window.location.port ? `:${window.location.port}` : "";
|
|
36
|
+
const socketUrl = `${protocol}//${host}${port}/alpaca/editor/socket?sessionId=${sessionId}`;
|
|
37
|
+
console.log("Connect to socket: " + socketUrl);
|
|
38
|
+
return new WebSocket(socketUrl);
|
|
39
|
+
}
|
|
40
|
+
async function getPictureValue(field, pictureRawValue, site, sessionId) {
|
|
41
|
+
const fieldItem = field.descriptor.item;
|
|
42
|
+
if (!fieldItem)
|
|
43
|
+
return;
|
|
44
|
+
const response = await fetch("/alpaca/editor/getPictureValue?sessionId=" + sessionId, {
|
|
45
|
+
method: "POST",
|
|
46
|
+
body: JSON.stringify({
|
|
47
|
+
site,
|
|
48
|
+
itemId: fieldItem.id,
|
|
49
|
+
itemLanguage: fieldItem.language,
|
|
50
|
+
itemVersion: fieldItem.version,
|
|
51
|
+
pictureFieldId: field.id,
|
|
52
|
+
pictureValue: JSON.stringify(pictureRawValue),
|
|
53
|
+
}),
|
|
54
|
+
credentials: "include",
|
|
55
|
+
headers: {
|
|
56
|
+
"Content-Type": "application/json",
|
|
57
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
58
|
+
},
|
|
59
|
+
});
|
|
60
|
+
return await response.json();
|
|
61
|
+
}
|
|
62
|
+
async function executeEditOperation(editOperation, sessionId) {
|
|
63
|
+
editOperation.sessionId = sessionId;
|
|
64
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/edit", editOperation, sessionId);
|
|
65
|
+
}
|
|
66
|
+
async function executeUndo(sessionId, editOperationIds) {
|
|
67
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/undo", { editOperationIds }, sessionId);
|
|
68
|
+
}
|
|
69
|
+
async function executeRedo(sessionId, editOperationId) {
|
|
70
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/redo", { editOperationIds: [editOperationId] }, sessionId);
|
|
71
|
+
}
|
|
72
|
+
async function executeDeleteItems(items) {
|
|
73
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/deleteItems", items);
|
|
74
|
+
}
|
|
75
|
+
function getItemDescriptor(item) {
|
|
76
|
+
return {
|
|
77
|
+
id: item.id,
|
|
78
|
+
language: item.language,
|
|
79
|
+
version: item.version,
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
async function lockItems(items) {
|
|
83
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/lock", items.map(getItemDescriptor));
|
|
84
|
+
return response;
|
|
85
|
+
}
|
|
86
|
+
async function unlockItems(items) {
|
|
87
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/unlock", items.map(getItemDescriptor));
|
|
88
|
+
return response;
|
|
89
|
+
}
|
|
90
|
+
async function lockField(item, fieldId, sessionId) {
|
|
91
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/lockField", {
|
|
92
|
+
item,
|
|
93
|
+
fieldId: fieldId,
|
|
94
|
+
sessionId: sessionId,
|
|
95
|
+
});
|
|
96
|
+
return response;
|
|
97
|
+
}
|
|
98
|
+
async function releaseFieldLocks(sessionId) {
|
|
99
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/releaseFieldLocks", {
|
|
100
|
+
sessionId,
|
|
101
|
+
});
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
async function validateItems(items, sessionId) {
|
|
105
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/validate", items.map(getItemDescriptor), sessionId);
|
|
106
|
+
if (response.type !== "success")
|
|
107
|
+
return response;
|
|
108
|
+
return await response;
|
|
109
|
+
}
|
|
110
|
+
async function executeWorkflowCommand(item, commandId, comment) {
|
|
111
|
+
const response = await (0, serviceHelper_1.post)("/alpaca/editor/executeWorkflowCommand", {
|
|
112
|
+
item,
|
|
113
|
+
commandId,
|
|
114
|
+
comment,
|
|
115
|
+
});
|
|
116
|
+
return response;
|
|
117
|
+
}
|
|
118
|
+
async function executeFieldAction(item, fieldId, pageItem, action, sessionId, selectedText, callback) {
|
|
119
|
+
const response = await fetch("/alpaca/editor/executeFieldAction?sessionId=" + sessionId, {
|
|
120
|
+
method: "POST",
|
|
121
|
+
body: JSON.stringify({
|
|
122
|
+
item,
|
|
123
|
+
pageItem,
|
|
124
|
+
fieldId,
|
|
125
|
+
action,
|
|
126
|
+
selectedText,
|
|
127
|
+
sessionId,
|
|
128
|
+
}),
|
|
129
|
+
credentials: "include",
|
|
130
|
+
headers: {
|
|
131
|
+
"Content-Type": "application/json",
|
|
132
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
133
|
+
},
|
|
134
|
+
});
|
|
135
|
+
if (response.status === 500 || response.redirected) {
|
|
136
|
+
return {
|
|
137
|
+
type: "error",
|
|
138
|
+
summary: "Error",
|
|
139
|
+
details: "An error occured executing the field action.",
|
|
140
|
+
response,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
if (response.status === 401) {
|
|
144
|
+
return {
|
|
145
|
+
type: "error",
|
|
146
|
+
summary: "Unauthorized",
|
|
147
|
+
details: "Not logged in anymore?",
|
|
148
|
+
response,
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
if (!response?.body)
|
|
152
|
+
return {
|
|
153
|
+
type: "error",
|
|
154
|
+
summary: "Error",
|
|
155
|
+
details: "An error occured.",
|
|
156
|
+
response,
|
|
157
|
+
};
|
|
158
|
+
const reader = response.body.getReader();
|
|
159
|
+
const decoder = new TextDecoder();
|
|
160
|
+
let buffer = "";
|
|
161
|
+
let result = null;
|
|
162
|
+
while (true) {
|
|
163
|
+
const { done, value } = await reader.read();
|
|
164
|
+
if (done) {
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
buffer += decoder.decode(value, { stream: true }); // 'stream: true' ensures that any incomplete multi-byte characters aren't malformed.
|
|
168
|
+
// Split the buffer by newline and keep the last partial line for the next iteration.
|
|
169
|
+
const lines = buffer.split("\n");
|
|
170
|
+
if (lines.length > 0) {
|
|
171
|
+
buffer = lines.pop() || ""; // Incomplete line (if any) is kept for the next iteration.
|
|
172
|
+
for (let line of lines) {
|
|
173
|
+
if (line.trim() === "")
|
|
174
|
+
continue; // Skip empty lines if any.
|
|
175
|
+
try {
|
|
176
|
+
const jsonData = JSON.parse(line);
|
|
177
|
+
callback(jsonData);
|
|
178
|
+
result = jsonData;
|
|
179
|
+
}
|
|
180
|
+
catch (e) {
|
|
181
|
+
console.error("Error parsing line:" + line, e);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// If there's any remaining content in the buffer after processing all chunks, try to process it.
|
|
187
|
+
if (buffer.trim() !== "") {
|
|
188
|
+
try {
|
|
189
|
+
const jsonData = JSON.parse(buffer);
|
|
190
|
+
result = jsonData;
|
|
191
|
+
}
|
|
192
|
+
catch (e) {
|
|
193
|
+
console.error("Error parsing the final buffer content:", e);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
callback(result);
|
|
197
|
+
return result;
|
|
198
|
+
}
|
|
199
|
+
async function createVersion(page, sessionId) {
|
|
200
|
+
const response = await fetch(
|
|
201
|
+
// configuration.services.editorService.baseUrl +
|
|
202
|
+
"/alpaca/editor/createVersion?sessionId=" + sessionId, {
|
|
203
|
+
method: "POST",
|
|
204
|
+
body: JSON.stringify({
|
|
205
|
+
item: page,
|
|
206
|
+
}),
|
|
207
|
+
credentials: "include",
|
|
208
|
+
headers: {
|
|
209
|
+
"Content-Type": "application/json",
|
|
210
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
211
|
+
},
|
|
212
|
+
});
|
|
213
|
+
if (response.ok)
|
|
214
|
+
return { type: "success", response };
|
|
215
|
+
else {
|
|
216
|
+
if (response.status === 401) {
|
|
217
|
+
return {
|
|
218
|
+
type: "error",
|
|
219
|
+
summary: "Unauthorized",
|
|
220
|
+
details: "Not logged in anymore?",
|
|
221
|
+
response,
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
return {
|
|
225
|
+
type: "error",
|
|
226
|
+
summary: "Error",
|
|
227
|
+
details: "An error occured while saving changes.",
|
|
228
|
+
response,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
async function deleteVersion(page, sessionId) {
|
|
233
|
+
const url = "/alpaca/editor/deleteVersion?sessionId=" + sessionId;
|
|
234
|
+
return await (0, serviceHelper_1.post)(url, { item: getItemDescriptor(page) });
|
|
235
|
+
}
|
|
236
|
+
async function loadInsertOptions(item) {
|
|
237
|
+
let url =
|
|
238
|
+
//configuration.services.editorService.baseUrl +
|
|
239
|
+
"/alpaca/editor/insertoptions";
|
|
240
|
+
const response = await fetch(url, {
|
|
241
|
+
method: "POST",
|
|
242
|
+
credentials: "include",
|
|
243
|
+
body: JSON.stringify(item),
|
|
244
|
+
headers: {
|
|
245
|
+
"Content-Type": "application/json",
|
|
246
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
247
|
+
},
|
|
248
|
+
});
|
|
249
|
+
return await response.json();
|
|
250
|
+
}
|
|
251
|
+
async function loadPlaceholderInsertOptions(pageItem, placeholderKeys) {
|
|
252
|
+
let url = "/alpaca/editor/placeholderinsertoptions";
|
|
253
|
+
const response = await fetch(url, {
|
|
254
|
+
method: "POST",
|
|
255
|
+
credentials: "include",
|
|
256
|
+
body: JSON.stringify({ pageItem, placeholderKeys }),
|
|
257
|
+
headers: {
|
|
258
|
+
"Content-Type": "application/json",
|
|
259
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
260
|
+
},
|
|
261
|
+
});
|
|
262
|
+
return await response.json();
|
|
263
|
+
}
|
|
264
|
+
async function loadFieldButtons(field) {
|
|
265
|
+
let url =
|
|
266
|
+
//configuration.services.editorService.baseUrl +
|
|
267
|
+
"/alpaca/editor/fieldbuttons";
|
|
268
|
+
const response = await fetch(url, {
|
|
269
|
+
method: "POST",
|
|
270
|
+
credentials: "include",
|
|
271
|
+
body: JSON.stringify(field),
|
|
272
|
+
headers: {
|
|
273
|
+
"Content-Type": "application/json",
|
|
274
|
+
Cookie: new universal_cookie_1.default().getAll(),
|
|
275
|
+
},
|
|
276
|
+
});
|
|
277
|
+
return await response.json();
|
|
278
|
+
}
|
|
279
|
+
async function getLookupSources(field, sessionId) {
|
|
280
|
+
let url = "/alpaca/editor/getlookupsources";
|
|
281
|
+
const fieldItem = field.descriptor.item;
|
|
282
|
+
const response = await (0, serviceHelper_1.post)(url, { item: fieldItem, fieldId: field.id }, sessionId);
|
|
283
|
+
return (await response.data) || [];
|
|
284
|
+
}
|
|
285
|
+
async function executeCreateItem(parent, templateId, name) {
|
|
286
|
+
let url = "/alpaca/editor/createItem";
|
|
287
|
+
const resopnse = (0, serviceHelper_1.post)(url, { parent, templateId, name });
|
|
288
|
+
return resopnse;
|
|
289
|
+
}
|
|
290
|
+
async function getEditHistory(item) {
|
|
291
|
+
let url = "/alpaca/editor/editHistory?itemId=" +
|
|
292
|
+
item.id +
|
|
293
|
+
"&language=" +
|
|
294
|
+
item.language +
|
|
295
|
+
"&version=" +
|
|
296
|
+
item.version;
|
|
297
|
+
const result = (0, serviceHelper_1.get)(url);
|
|
298
|
+
return result;
|
|
299
|
+
}
|
|
300
|
+
async function getFieldHistory(item, fieldId) {
|
|
301
|
+
let url = "/alpaca/editor/fieldHistory?itemId=" +
|
|
302
|
+
item.id +
|
|
303
|
+
"&language=" +
|
|
304
|
+
item.language +
|
|
305
|
+
"&version=" +
|
|
306
|
+
item.version +
|
|
307
|
+
"&fieldId=" +
|
|
308
|
+
fieldId;
|
|
309
|
+
const result = (0, serviceHelper_1.get)(url);
|
|
310
|
+
return result;
|
|
311
|
+
}
|
|
312
|
+
async function getUserInfo() {
|
|
313
|
+
const response = await fetch("/alpaca/editor/userinfo");
|
|
314
|
+
return await response.json();
|
|
315
|
+
}
|
|
316
|
+
async function executeMoveItems(items, target, index) {
|
|
317
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/moveItems", {
|
|
318
|
+
items: items.map(getItemDescriptor),
|
|
319
|
+
target: getItemDescriptor(target),
|
|
320
|
+
index,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getIndexStatus = getIndexStatus;
|
|
4
|
+
exports.setupIndex = setupIndex;
|
|
5
|
+
exports.setupRebuildJob = setupRebuildJob;
|
|
6
|
+
exports.rebuildIndex = rebuildIndex;
|
|
7
|
+
exports.getIndexes = getIndexes;
|
|
8
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
9
|
+
async function getIndexStatus(index) {
|
|
10
|
+
var result = await (0, serviceHelper_1.get)("/alpaca/headless/editor/index/status?name=" + index);
|
|
11
|
+
return result.data;
|
|
12
|
+
}
|
|
13
|
+
async function setupIndex(index) {
|
|
14
|
+
await (0, serviceHelper_1.post)("/alpaca/headless/editor/index/setup?name=" + index, {});
|
|
15
|
+
}
|
|
16
|
+
async function setupRebuildJob(index) {
|
|
17
|
+
await (0, serviceHelper_1.post)("/alpaca/headless/editor/index/setuprebuildjob?name=" + index, {});
|
|
18
|
+
}
|
|
19
|
+
async function rebuildIndex(index) {
|
|
20
|
+
await (0, serviceHelper_1.post)("/alpaca/headless/editor/index/rebuild?name=" + index, {});
|
|
21
|
+
}
|
|
22
|
+
async function getIndexes() {
|
|
23
|
+
var result = await (0, serviceHelper_1.get)("/alpaca/headless/editor/index/list");
|
|
24
|
+
return result.data || [];
|
|
25
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createOrUpdateComment = createOrUpdateComment;
|
|
4
|
+
exports.getComments = getComments;
|
|
5
|
+
exports.resolveComment = resolveComment;
|
|
6
|
+
exports.deleteComment = deleteComment;
|
|
7
|
+
exports.getReviewers = getReviewers;
|
|
8
|
+
exports.getReviews = getReviews;
|
|
9
|
+
exports.inviteReviewer = inviteReviewer;
|
|
10
|
+
exports.addReview = addReview;
|
|
11
|
+
exports.approveReview = approveReview;
|
|
12
|
+
exports.rejectReview = rejectReview;
|
|
13
|
+
const serviceHelper_1 = require("./serviceHelper");
|
|
14
|
+
function createOrUpdateComment(comment) {
|
|
15
|
+
return (0, serviceHelper_1.post)("/alpaca/editor/comments/save", comment);
|
|
16
|
+
}
|
|
17
|
+
function getComments(itemId, language, version) {
|
|
18
|
+
return (0, serviceHelper_1.get)(`/alpaca/editor/comments/index?mainItemId=${itemId}&language=${language}&version=${version}`);
|
|
19
|
+
}
|
|
20
|
+
function resolveComment(comment) {
|
|
21
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/comments/resolve?commentId=${comment.id}`, {});
|
|
22
|
+
}
|
|
23
|
+
function deleteComment(comment) {
|
|
24
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/comments/delete?commentId=${comment.id}`, {});
|
|
25
|
+
}
|
|
26
|
+
function getReviewers(itemId, language) {
|
|
27
|
+
return (0, serviceHelper_1.get)(`/alpaca/editor/reviews/reviewers?itemId=${itemId}&language=${language}`);
|
|
28
|
+
}
|
|
29
|
+
function getReviews(itemId, language, version) {
|
|
30
|
+
return (0, serviceHelper_1.get)(`/alpaca/editor/reviews/index?itemId=${itemId}&language=${language}&version=${version}`);
|
|
31
|
+
}
|
|
32
|
+
function inviteReviewer(review) {
|
|
33
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/reviews/invite`, review);
|
|
34
|
+
}
|
|
35
|
+
function addReview(review) {
|
|
36
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/reviews/add`, review);
|
|
37
|
+
}
|
|
38
|
+
function approveReview(itemDescriptor) {
|
|
39
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/reviews/approve`, itemDescriptor);
|
|
40
|
+
}
|
|
41
|
+
function rejectReview(itemDescriptor) {
|
|
42
|
+
return (0, serviceHelper_1.post)(`/alpaca/editor/reviews/reject`, itemDescriptor);
|
|
43
|
+
}
|