@alpaca-editor/core 1.0.3938 → 1.0.3941
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ActionButton.d.ts +1 -0
- package/dist/components/ActionButton.js +2 -2
- package/dist/components/ActionButton.js.map +1 -1
- package/dist/editor/ContentTree.js +12 -8
- package/dist/editor/ContentTree.js.map +1 -1
- package/dist/editor/ContextMenu.d.ts +1 -1
- package/dist/editor/ContextMenu.js +17 -3
- package/dist/editor/ContextMenu.js.map +1 -1
- package/dist/editor/FieldActionsOverlay.d.ts +18 -0
- package/dist/editor/FieldActionsOverlay.js +139 -0
- package/dist/editor/FieldActionsOverlay.js.map +1 -0
- package/dist/editor/FieldHistory.d.ts +2 -1
- package/dist/editor/FieldHistory.js +11 -8
- package/dist/editor/FieldHistory.js.map +1 -1
- package/dist/editor/FieldListField.js +14 -17
- package/dist/editor/FieldListField.js.map +1 -1
- package/dist/editor/PictureCropper.js +65 -23
- package/dist/editor/PictureCropper.js.map +1 -1
- package/dist/editor/PictureEditor.js +43 -3
- package/dist/editor/PictureEditor.js.map +1 -1
- package/dist/editor/Titlebar.js +19 -10
- package/dist/editor/Titlebar.js.map +1 -1
- package/dist/editor/ai/AiTerminal.js +27 -41
- package/dist/editor/ai/AiTerminal.js.map +1 -1
- package/dist/editor/ai/GhostWriter.js +21 -2
- package/dist/editor/ai/GhostWriter.js.map +1 -1
- package/dist/editor/client/EditorClient.js +48 -18
- package/dist/editor/client/EditorClient.js.map +1 -1
- package/dist/editor/client/editContext.d.ts +1 -1
- package/dist/editor/client/editContext.js.map +1 -1
- package/dist/editor/client/itemsRepository.js +126 -90
- package/dist/editor/client/itemsRepository.js.map +1 -1
- package/dist/editor/commands/componentCommands.js +7 -3
- package/dist/editor/commands/componentCommands.js.map +1 -1
- package/dist/editor/media-selector/MediaFolderBrowser.d.ts +5 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js +77 -0
- package/dist/editor/media-selector/MediaFolderBrowser.js.map +1 -0
- package/dist/editor/media-selector/MediaSelector.js +1 -1
- package/dist/editor/media-selector/MediaSelector.js.map +1 -1
- package/dist/editor/media-selector/Thumbnails.js +2 -2
- package/dist/editor/media-selector/index.d.ts +8 -0
- package/dist/editor/media-selector/index.js +9 -0
- package/dist/editor/media-selector/index.js.map +1 -0
- package/dist/editor/menubar/BrowseHistory.js +3 -4
- package/dist/editor/menubar/BrowseHistory.js.map +1 -1
- package/dist/editor/menubar/PageSelector.js +62 -10
- package/dist/editor/menubar/PageSelector.js.map +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +1 -1
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js.map +1 -1
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js +37 -11
- package/dist/editor/page-editor-chrome/useInlineAICompletion.js.map +1 -1
- package/dist/editor/page-viewer/PageViewerFrame.js +98 -2
- package/dist/editor/page-viewer/PageViewerFrame.js.map +1 -1
- package/dist/editor/pageModel.d.ts +14 -0
- package/dist/editor/reviews/Comment.js +3 -2
- package/dist/editor/reviews/Comment.js.map +1 -1
- package/dist/editor/services/aiService.js +0 -1
- package/dist/editor/services/aiService.js.map +1 -1
- package/dist/editor/services/editService.d.ts +1 -1
- package/dist/editor/services/editService.js +2 -1
- package/dist/editor/services/editService.js.map +1 -1
- package/dist/editor/sidebar/ComponentTree.js +3 -4
- package/dist/editor/sidebar/ComponentTree.js.map +1 -1
- package/dist/editor/ui/Icons.js +1 -1
- package/dist/editor/ui/Icons.js.map +1 -1
- package/dist/editor/ui/ItemList.d.ts +16 -0
- package/dist/editor/ui/ItemList.js +19 -0
- package/dist/editor/ui/ItemList.js.map +1 -0
- package/dist/editor/ui/ItemSearch.js +2 -12
- package/dist/editor/ui/ItemSearch.js.map +1 -1
- package/dist/editor/ui/SimpleTabs.d.ts +1 -0
- package/dist/editor/ui/SimpleTabs.js +3 -3
- package/dist/editor/ui/SimpleTabs.js.map +1 -1
- package/dist/editor/ui/Splitter.js +61 -6
- package/dist/editor/ui/Splitter.js.map +1 -1
- package/dist/editor/views/MediaFolderEditView.d.ts +4 -0
- package/dist/editor/views/MediaFolderEditView.js +40 -0
- package/dist/editor/views/MediaFolderEditView.js.map +1 -0
- package/dist/editor/views/SingleEditView.js +9 -1
- package/dist/editor/views/SingleEditView.js.map +1 -1
- package/dist/revision.d.ts +2 -2
- package/dist/revision.js +2 -2
- package/dist/styles.css +64 -13
- package/package.json +8 -2
- package/.prettierrc +0 -3
- package/build.css +0 -3
- package/components.json +0 -21
- package/eslint.config.mjs +0 -4
- package/images/bg-shape-black.webp +0 -0
- package/images/wizard-bg.png +0 -0
- package/images/wizard-tour.png +0 -0
- package/images/wizard.png +0 -0
- package/src/client-components/api.ts +0 -6
- package/src/client-components/index.ts +0 -19
- package/src/components/ActionButton.tsx +0 -41
- package/src/components/Error.tsx +0 -57
- package/src/components/ui/CardConnector.tsx +0 -56
- package/src/components/ui/button.tsx +0 -62
- package/src/components/ui/card.tsx +0 -372
- package/src/components/ui/context-menu.tsx +0 -250
- package/src/config/config.tsx +0 -917
- package/src/config/types.ts +0 -286
- package/src/editor/ComponentInfo.tsx +0 -90
- package/src/editor/ConfirmationDialog.tsx +0 -103
- package/src/editor/ContentTree.tsx +0 -727
- package/src/editor/ContextMenu.tsx +0 -212
- package/src/editor/Editor.tsx +0 -90
- package/src/editor/EditorWarning.tsx +0 -34
- package/src/editor/EditorWarnings.tsx +0 -33
- package/src/editor/FieldEditorPopup.tsx +0 -65
- package/src/editor/FieldHistory.tsx +0 -74
- package/src/editor/FieldList.tsx +0 -190
- package/src/editor/FieldListField.tsx +0 -391
- package/src/editor/FieldListFieldWithFallbacks.tsx +0 -217
- package/src/editor/FloatingToolbar.tsx +0 -163
- package/src/editor/ImageEditor.tsx +0 -128
- package/src/editor/ItemInfo.tsx +0 -90
- package/src/editor/LinkEditorDialog.tsx +0 -196
- package/src/editor/MainLayout.tsx +0 -95
- package/src/editor/MobileLayout.tsx +0 -68
- package/src/editor/NewEditorClient.tsx +0 -11
- package/src/editor/PictureCropper.tsx +0 -503
- package/src/editor/PictureEditor.tsx +0 -212
- package/src/editor/PictureEditorDialog.tsx +0 -381
- package/src/editor/PublishDialog.ignore +0 -74
- package/src/editor/ScrollingContentTree.tsx +0 -67
- package/src/editor/Terminal.tsx +0 -227
- package/src/editor/Titlebar.tsx +0 -93
- package/src/editor/ai/AiPopup.tsx +0 -59
- package/src/editor/ai/AiResponseMessage.tsx +0 -106
- package/src/editor/ai/AiTerminal.tsx +0 -514
- package/src/editor/ai/AiToolCall.tsx +0 -61
- package/src/editor/ai/EditorAiTerminal.tsx +0 -20
- package/src/editor/ai/GhostWriter.tsx +0 -432
- package/src/editor/ai/aiPageModel.ts +0 -108
- package/src/editor/ai/editorAiContext.ts +0 -18
- package/src/editor/client/AboutDialog.tsx +0 -44
- package/src/editor/client/EditorClient.tsx +0 -2197
- package/src/editor/client/GenericDialog.tsx +0 -50
- package/src/editor/client/editContext.ts +0 -412
- package/src/editor/client/helpers.ts +0 -44
- package/src/editor/client/itemsRepository.ts +0 -538
- package/src/editor/client/operations.ts +0 -768
- package/src/editor/client/pageModelBuilder.ts +0 -219
- package/src/editor/commands/commands.ts +0 -22
- package/src/editor/commands/componentCommands.tsx +0 -424
- package/src/editor/commands/createVersionCommand.ts +0 -33
- package/src/editor/commands/deleteVersionCommand.ts +0 -71
- package/src/editor/commands/itemCommands.tsx +0 -351
- package/src/editor/commands/localizeItem/LocalizeItemDialog.tsx +0 -201
- package/src/editor/commands/localizeItem/LocalizeItemUtils.ts +0 -27
- package/src/editor/commands/undo.ts +0 -39
- package/src/editor/component-designer/ComponentDesigner.tsx +0 -70
- package/src/editor/component-designer/ComponentDesignerAiTerminal.tsx +0 -11
- package/src/editor/component-designer/ComponentDesignerMenu.tsx +0 -91
- package/src/editor/component-designer/ComponentEditor.tsx +0 -97
- package/src/editor/component-designer/ComponentRenderingCodeEditor.tsx +0 -31
- package/src/editor/component-designer/ComponentRenderingEditor.tsx +0 -104
- package/src/editor/component-designer/ComponentsDropdown.tsx +0 -39
- package/src/editor/component-designer/PlaceholdersEditor.tsx +0 -179
- package/src/editor/component-designer/RenderingsDropdown.tsx +0 -36
- package/src/editor/component-designer/TemplateEditor.tsx +0 -236
- package/src/editor/component-designer/aiContext.ts +0 -23
- package/src/editor/componentTreeHelper.tsx +0 -116
- package/src/editor/context-menu/CopyMoveMenu.tsx +0 -103
- package/src/editor/context-menu/InsertMenu.tsx +0 -347
- package/src/editor/control-center/About.tsx +0 -342
- package/src/editor/control-center/ControlCenterMenu.tsx +0 -76
- package/src/editor/control-center/IndexOverview.tsx +0 -50
- package/src/editor/control-center/IndexSettings.tsx +0 -266
- package/src/editor/control-center/Info.tsx +0 -104
- package/src/editor/control-center/QuotaInfo.tsx +0 -301
- package/src/editor/control-center/Status.tsx +0 -113
- package/src/editor/control-center/WebSocketMessages.tsx +0 -155
- package/src/editor/editor-warnings/ItemLocked.tsx +0 -63
- package/src/editor/editor-warnings/NoLanguageWriteAccess.tsx +0 -22
- package/src/editor/editor-warnings/NoWorkflowWriteAccess.tsx +0 -23
- package/src/editor/editor-warnings/NoWriteAccess.tsx +0 -16
- package/src/editor/editor-warnings/ValidationErrors.tsx +0 -54
- package/src/editor/field-types/AttachmentEditor.tsx +0 -9
- package/src/editor/field-types/CheckboxEditor.tsx +0 -47
- package/src/editor/field-types/DropLinkEditor.tsx +0 -80
- package/src/editor/field-types/DropListEditor.tsx +0 -84
- package/src/editor/field-types/ImageFieldEditor.tsx +0 -65
- package/src/editor/field-types/InternalLinkFieldEditor.tsx +0 -117
- package/src/editor/field-types/LinkFieldEditor.tsx +0 -85
- package/src/editor/field-types/MultiLineText.tsx +0 -82
- package/src/editor/field-types/PictureFieldEditor.tsx +0 -121
- package/src/editor/field-types/RawEditor.tsx +0 -53
- package/src/editor/field-types/ReactQuill.tsx +0 -580
- package/src/editor/field-types/RichTextEditor.tsx +0 -22
- package/src/editor/field-types/RichTextEditorComponent.tsx +0 -127
- package/src/editor/field-types/SingleLineText.tsx +0 -174
- package/src/editor/field-types/TreeListEditor.tsx +0 -261
- package/src/editor/fieldTypes.ts +0 -140
- package/src/editor/media-selector/AiImageSearch.tsx +0 -185
- package/src/editor/media-selector/AiImageSearchPrompt.tsx +0 -94
- package/src/editor/media-selector/MediaSelector.tsx +0 -42
- package/src/editor/media-selector/Preview.tsx +0 -14
- package/src/editor/media-selector/Thumbnails.tsx +0 -48
- package/src/editor/media-selector/TreeSelector.tsx +0 -292
- package/src/editor/media-selector/UploadZone.tsx +0 -137
- package/src/editor/menubar/ActionsMenu.tsx +0 -94
- package/src/editor/menubar/ActiveUsers.tsx +0 -17
- package/src/editor/menubar/ApproveAndPublish.tsx +0 -18
- package/src/editor/menubar/BrowseHistory.tsx +0 -37
- package/src/editor/menubar/ItemLanguageVersion.tsx +0 -76
- package/src/editor/menubar/LanguageSelector.tsx +0 -226
- package/src/editor/menubar/Menu.tsx +0 -83
- package/src/editor/menubar/NavButtons.tsx +0 -74
- package/src/editor/menubar/PageSelector.tsx +0 -141
- package/src/editor/menubar/PageViewerControls.tsx +0 -120
- package/src/editor/menubar/PreviewSecondaryControls.tsx +0 -18
- package/src/editor/menubar/SecondaryControls.tsx +0 -45
- package/src/editor/menubar/Separator.tsx +0 -12
- package/src/editor/menubar/SiteInfo.tsx +0 -53
- package/src/editor/menubar/User.tsx +0 -27
- package/src/editor/menubar/VersionSelector.tsx +0 -142
- package/src/editor/page-editor-chrome/CommentHighlighting.tsx +0 -307
- package/src/editor/page-editor-chrome/CommentHighlightings.tsx +0 -35
- package/src/editor/page-editor-chrome/FieldActionIndicator.tsx +0 -59
- package/src/editor/page-editor-chrome/FieldActionIndicators.tsx +0 -23
- package/src/editor/page-editor-chrome/FieldEditedIndicator.tsx +0 -64
- package/src/editor/page-editor-chrome/FieldEditedIndicators.tsx +0 -35
- package/src/editor/page-editor-chrome/FrameMenu.tsx +0 -338
- package/src/editor/page-editor-chrome/FrameMenus.tsx +0 -48
- package/src/editor/page-editor-chrome/InlineEditor.tsx +0 -765
- package/src/editor/page-editor-chrome/LockedFieldIndicator.tsx +0 -61
- package/src/editor/page-editor-chrome/NoLayout.tsx +0 -36
- package/src/editor/page-editor-chrome/PageEditorChrome.tsx +0 -122
- package/src/editor/page-editor-chrome/PictureEditorOverlay.tsx +0 -161
- package/src/editor/page-editor-chrome/PlaceholderDropZone.tsx +0 -169
- package/src/editor/page-editor-chrome/PlaceholderDropZones.tsx +0 -315
- package/src/editor/page-editor-chrome/SuggestionHighlighting.tsx +0 -300
- package/src/editor/page-editor-chrome/SuggestionHighlightings.tsx +0 -40
- package/src/editor/page-editor-chrome/useInlineAICompletion.tsx +0 -791
- package/src/editor/page-viewer/DeviceToolbar.tsx +0 -70
- package/src/editor/page-viewer/EditorForm.tsx +0 -258
- package/src/editor/page-viewer/MiniMap.tsx +0 -362
- package/src/editor/page-viewer/PageViewer.tsx +0 -169
- package/src/editor/page-viewer/PageViewerFrame.tsx +0 -879
- package/src/editor/page-viewer/pageModelSkeletonBuilder.ts +0 -412
- package/src/editor/page-viewer/pageViewContext.ts +0 -186
- package/src/editor/pageModel.ts +0 -208
- package/src/editor/picture-shared.tsx +0 -53
- package/src/editor/reviews/Comment.tsx +0 -308
- package/src/editor/reviews/Comments.tsx +0 -125
- package/src/editor/reviews/DiffView.tsx +0 -109
- package/src/editor/reviews/PreviewInfo.tsx +0 -35
- package/src/editor/reviews/Reviews.tsx +0 -280
- package/src/editor/reviews/SuggestedEdit.tsx +0 -316
- package/src/editor/reviews/reviewCommands.tsx +0 -47
- package/src/editor/reviews/useReviews.tsx +0 -70
- package/src/editor/services/aiService.ts +0 -174
- package/src/editor/services/componentDesignerService.ts +0 -151
- package/src/editor/services/contentService.ts +0 -180
- package/src/editor/services/editService.ts +0 -486
- package/src/editor/services/indexService.ts +0 -24
- package/src/editor/services/reviewsService.ts +0 -53
- package/src/editor/services/serviceHelper.ts +0 -95
- package/src/editor/services/suggestedEditsService.ts +0 -39
- package/src/editor/services/systemService.ts +0 -5
- package/src/editor/services/translationService.ts +0 -21
- package/src/editor/services-server/api.ts +0 -150
- package/src/editor/services-server/graphQL.ts +0 -106
- package/src/editor/sidebar/ComponentPalette.tsx +0 -161
- package/src/editor/sidebar/ComponentTree.tsx +0 -548
- package/src/editor/sidebar/ComponentTree2.tsxx +0 -490
- package/src/editor/sidebar/Debug.tsx +0 -111
- package/src/editor/sidebar/DictionaryEditor.tsx +0 -261
- package/src/editor/sidebar/EditHistory.tsx +0 -134
- package/src/editor/sidebar/GraphQL.tsx +0 -164
- package/src/editor/sidebar/Insert.tsx +0 -35
- package/src/editor/sidebar/MainContentTree.tsx +0 -102
- package/src/editor/sidebar/Performance.tsx +0 -53
- package/src/editor/sidebar/Sessions.tsx +0 -35
- package/src/editor/sidebar/Sidebar.tsx +0 -20
- package/src/editor/sidebar/SidebarView.tsx +0 -152
- package/src/editor/sidebar/Translations.tsx +0 -295
- package/src/editor/sidebar/Validation.tsx +0 -102
- package/src/editor/sidebar/ViewSelector.tsx +0 -60
- package/src/editor/sidebar/Workbox.tsx +0 -209
- package/src/editor/ui/CenteredMessage.tsx +0 -7
- package/src/editor/ui/CopyMoveTargetSelectorDialog.tsx +0 -81
- package/src/editor/ui/CopyToClipboardButton.tsx +0 -24
- package/src/editor/ui/DialogButtons.tsx +0 -11
- package/src/editor/ui/Icons.tsx +0 -708
- package/src/editor/ui/ItemNameDialogNew.tsx +0 -118
- package/src/editor/ui/ItemSearch.tsx +0 -190
- package/src/editor/ui/PerfectTree.tsx +0 -571
- package/src/editor/ui/Section.tsx +0 -35
- package/src/editor/ui/SimpleIconButton.tsx +0 -54
- package/src/editor/ui/SimpleMenu.tsx +0 -40
- package/src/editor/ui/SimpleTable.tsx +0 -60
- package/src/editor/ui/SimpleTabs.tsx +0 -55
- package/src/editor/ui/SimpleToolbar.tsx +0 -7
- package/src/editor/ui/Spinner.tsx +0 -9
- package/src/editor/ui/Splitter.tsx +0 -314
- package/src/editor/ui/StackedPanels.tsx +0 -134
- package/src/editor/ui/Toolbar.tsx +0 -7
- package/src/editor/utils/id-helper.ts +0 -3
- package/src/editor/utils/insertOptions.ts +0 -69
- package/src/editor/utils/itemutils.ts +0 -29
- package/src/editor/utils/useMemoDebug.ts +0 -28
- package/src/editor/utils.ts +0 -486
- package/src/editor/views/CompareView.tsx +0 -245
- package/src/editor/views/EditView.tsx +0 -27
- package/src/editor/views/ItemEditor.tsx +0 -58
- package/src/editor/views/SingleEditView.tsx +0 -46
- 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/fonts/index.ts +0 -10
- package/src/index.ts +0 -23
- package/src/lib/safelist.tsx +0 -16
- package/src/lib/utils.ts +0 -6
- package/src/page-wizard/PageWizard.tsx +0 -139
- package/src/page-wizard/WizardBox.tsx +0 -4
- package/src/page-wizard/WizardBoxConnector.tsx +0 -56
- package/src/page-wizard/WizardSteps.tsx +0 -458
- package/src/page-wizard/service.ts +0 -35
- package/src/page-wizard/startPageWizardCommand.ts +0 -26
- package/src/page-wizard/steps/BuildPageStep.tsx +0 -259
- package/src/page-wizard/steps/CollectStep.tsx +0 -296
- package/src/page-wizard/steps/ComponentTypesSelector.tsx +0 -454
- package/src/page-wizard/steps/Components.tsx +0 -193
- package/src/page-wizard/steps/ContentStep.tsx +0 -890
- package/src/page-wizard/steps/EditButton.tsx +0 -34
- package/src/page-wizard/steps/FieldEditor.tsx +0 -102
- package/src/page-wizard/steps/Generate.tsx +0 -60
- package/src/page-wizard/steps/ImagesStep.tsx +0 -382
- package/src/page-wizard/steps/LayoutStep.tsx +0 -227
- package/src/page-wizard/steps/MetaDataStep.tsx +0 -173
- package/src/page-wizard/steps/SelectStep.tsx +0 -281
- package/src/page-wizard/steps/schema.ts +0 -180
- package/src/page-wizard/steps/usePageCreator.ts +0 -325
- package/src/page-wizard/usePageWizard.ts +0 -79
- package/src/revision.ts +0 -2
- package/src/splash-screen/NewPage.tsx +0 -294
- package/src/splash-screen/OpenPage.tsx +0 -113
- package/src/splash-screen/RecentPages.tsx +0 -123
- package/src/splash-screen/SectionHeadline.tsx +0 -21
- package/src/splash-screen/SplashScreen.tsx +0 -195
- package/src/tour/Tour.tsx +0 -566
- package/src/tour/default-tour.tsx +0 -301
- package/src/tour/preview-tour.tsx +0 -128
- package/src/types.ts +0 -335
- package/styles.css +0 -765
- package/tsconfig.build.json +0 -31
- package/tsconfig.json +0 -14
package/src/config/config.tsx
DELETED
|
@@ -1,917 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ClientFieldButton,
|
|
3
|
-
EditorConfiguration,
|
|
4
|
-
MenuItem,
|
|
5
|
-
MenuItemGroup,
|
|
6
|
-
RichTextEditorProfile,
|
|
7
|
-
} from "./types";
|
|
8
|
-
import { RichTextEditor } from "../editor/field-types/RichTextEditor";
|
|
9
|
-
import { LinkFieldEditor } from "../editor/field-types/LinkFieldEditor";
|
|
10
|
-
import { PictureFieldEditor } from "../editor/field-types/PictureFieldEditor";
|
|
11
|
-
import { InternalLinkFieldEditor } from "../editor/field-types/InternalLinkFieldEditor";
|
|
12
|
-
import TreeListEditor from "../editor/field-types/TreeListEditor";
|
|
13
|
-
import { SingleLineText } from "../editor/field-types/SingleLineText";
|
|
14
|
-
import { MultiLineText } from "../editor/field-types/MultiLineText";
|
|
15
|
-
import { DropLinkEditor } from "../editor/field-types/DropLinkEditor";
|
|
16
|
-
import { DropListEditor } from "../editor/field-types/DropListEditor";
|
|
17
|
-
import { RawEditor } from "../editor/field-types/RawEditor";
|
|
18
|
-
import { CheckboxEditor } from "../editor/field-types/CheckboxEditor";
|
|
19
|
-
|
|
20
|
-
import { ItemLocked } from "../editor/editor-warnings/ItemLocked";
|
|
21
|
-
import { NoWriteAccess } from "../editor/editor-warnings/NoWriteAccess";
|
|
22
|
-
import { ValidationErrors } from "../editor/editor-warnings/ValidationErrors";
|
|
23
|
-
import { ComponentTree } from "../editor/sidebar/ComponentTree";
|
|
24
|
-
import { Performance } from "../editor/sidebar/Performance";
|
|
25
|
-
|
|
26
|
-
import { EditHistory } from "../editor/sidebar/EditHistory";
|
|
27
|
-
import { Sessions } from "../editor/sidebar/Sessions";
|
|
28
|
-
import { Workbox } from "../editor/sidebar/Workbox";
|
|
29
|
-
import { DictionaryEditor } from "../editor/sidebar/DictionaryEditor";
|
|
30
|
-
import {
|
|
31
|
-
BugIcon,
|
|
32
|
-
EditIcon,
|
|
33
|
-
GraphQLIcon,
|
|
34
|
-
JsonIcon,
|
|
35
|
-
PageWizardIcon,
|
|
36
|
-
TreeIcon,
|
|
37
|
-
WizardIcon,
|
|
38
|
-
WorkboxIcon,
|
|
39
|
-
UsersIcon,
|
|
40
|
-
} from "../editor/ui/Icons";
|
|
41
|
-
import { Debug } from "../editor/sidebar/Debug";
|
|
42
|
-
import { GraphQL } from "../editor/sidebar/GraphQL";
|
|
43
|
-
|
|
44
|
-
import { EditorAiTerminal } from "../editor/ai/EditorAiTerminal";
|
|
45
|
-
|
|
46
|
-
import { EditContextType } from "../editor/client/editContext";
|
|
47
|
-
|
|
48
|
-
import { Titlebar } from "../editor/Titlebar";
|
|
49
|
-
import { NoWriteLanguageAccess } from "../editor/editor-warnings/NoLanguageWriteAccess";
|
|
50
|
-
import { NoWorkflowWriteAccess } from "../editor/editor-warnings/NoWorkflowWriteAccess";
|
|
51
|
-
import { SplashScreen } from "../splash-screen/SplashScreen";
|
|
52
|
-
import { PageViewerControls } from "../editor/menubar/PageViewerControls";
|
|
53
|
-
|
|
54
|
-
import { Validation } from "../editor/sidebar/Validation";
|
|
55
|
-
|
|
56
|
-
import { FullItem } from "../editor/pageModel";
|
|
57
|
-
import { LinkValue } from "../editor/fieldTypes";
|
|
58
|
-
import {
|
|
59
|
-
localizeItemCommand,
|
|
60
|
-
deleteItemCommand,
|
|
61
|
-
insertItemCommand,
|
|
62
|
-
ItemCommand,
|
|
63
|
-
moveItemsCommand,
|
|
64
|
-
copyItemsCommand,
|
|
65
|
-
publishItemCommand,
|
|
66
|
-
renameItemCommand,
|
|
67
|
-
duplicateItemCommand,
|
|
68
|
-
} from "../editor/commands/itemCommands";
|
|
69
|
-
import { loadInsertOptions } from "../editor/services/editService";
|
|
70
|
-
import { getDefaultTourSteps } from "../tour/default-tour";
|
|
71
|
-
import { Translation } from "../editor/sidebar/Translations";
|
|
72
|
-
import { EditView } from "../editor/views/EditView";
|
|
73
|
-
import { InsertMenuTemplate } from "../editor/context-menu/InsertMenu";
|
|
74
|
-
|
|
75
|
-
import { Status } from "../editor/control-center/Status";
|
|
76
|
-
import { IndexOverview } from "../editor/control-center/IndexOverview";
|
|
77
|
-
import { Info } from "../editor/control-center/Info";
|
|
78
|
-
import { QuotaInfo } from "../editor/control-center/QuotaInfo";
|
|
79
|
-
import { About } from "../editor/control-center/About";
|
|
80
|
-
import { WebSocketMessages } from "../editor/control-center/WebSocketMessages";
|
|
81
|
-
import { MainContentTree } from "../editor/sidebar/MainContentTree";
|
|
82
|
-
import { AttachmentEditor } from "../editor/field-types/AttachmentEditor";
|
|
83
|
-
import { Comments } from "../editor/reviews/Comments";
|
|
84
|
-
import { Reviews } from "../editor/reviews/Reviews";
|
|
85
|
-
|
|
86
|
-
import { rejectReviewCommand } from "../editor/reviews/reviewCommands";
|
|
87
|
-
import { approveReviewCommand } from "../editor/reviews/reviewCommands";
|
|
88
|
-
|
|
89
|
-
import { User } from "../types";
|
|
90
|
-
import { getPreviewTourSteps } from "../tour/preview-tour";
|
|
91
|
-
import { PageWizard } from "../page-wizard/PageWizard";
|
|
92
|
-
import { CollectStep } from "../page-wizard/steps/CollectStep";
|
|
93
|
-
import { LayoutStep } from "../page-wizard/steps/LayoutStep";
|
|
94
|
-
import { BuildPageStep } from "../page-wizard/steps/BuildPageStep";
|
|
95
|
-
import { SelectStep } from "../page-wizard/steps/SelectStep";
|
|
96
|
-
import { ImagesStep } from "../page-wizard/steps/ImagesStep";
|
|
97
|
-
import { ContentStep } from "../page-wizard/steps/ContentStep";
|
|
98
|
-
import { MetaDataStep } from "../page-wizard/steps/MetaDataStep";
|
|
99
|
-
import { getWizards } from "../page-wizard/service";
|
|
100
|
-
|
|
101
|
-
import { startPageWizardCommand } from "../page-wizard/startPageWizardCommand";
|
|
102
|
-
import { ImageFieldEditor } from "../editor/field-types/ImageFieldEditor";
|
|
103
|
-
|
|
104
|
-
import {
|
|
105
|
-
BookA,
|
|
106
|
-
Ghost,
|
|
107
|
-
Languages,
|
|
108
|
-
Layers,
|
|
109
|
-
MessageCircleMore,
|
|
110
|
-
Settings,
|
|
111
|
-
} from "lucide-react";
|
|
112
|
-
import { GhostWriter } from "../editor/ai/GhostWriter";
|
|
113
|
-
import { SecondaryControls } from "../editor/menubar/SecondaryControls";
|
|
114
|
-
|
|
115
|
-
import { Command } from "../editor/commands/commands";
|
|
116
|
-
import { PreviewSecondaryControls } from "../editor/menubar/PreviewSecondaryControls";
|
|
117
|
-
import { AboutDialog } from "../editor/client/AboutDialog";
|
|
118
|
-
import { NewPage } from "../splash-screen/NewPage";
|
|
119
|
-
import { OpenPage } from "../splash-screen/OpenPage";
|
|
120
|
-
const defaultRichTextEditorProfile: RichTextEditorProfile = {
|
|
121
|
-
toolbar: {
|
|
122
|
-
groups: [
|
|
123
|
-
{
|
|
124
|
-
items: ["bold", "italic", "underline", "strikethrough"],
|
|
125
|
-
},
|
|
126
|
-
],
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export const contentItemId = "0DE95AE4-41AB-4D01-9EB0-67441B7C2450";
|
|
131
|
-
export const templatesRootItemId = "3c1715fe-6a13-4fcf-845f-de308ba9741d";
|
|
132
|
-
export const rootItemId = "11111111-1111-1111-1111-111111111111";
|
|
133
|
-
|
|
134
|
-
const openTargetActionButton: ClientFieldButton = {
|
|
135
|
-
label: "Open target item",
|
|
136
|
-
icon: "pi pi-external-link",
|
|
137
|
-
clientAction: ({ field, editContext }) => {
|
|
138
|
-
const fieldValue = field.value as LinkValue;
|
|
139
|
-
|
|
140
|
-
if (fieldValue?.targetItemId) {
|
|
141
|
-
editContext.loadItem({
|
|
142
|
-
id: fieldValue.targetItemId,
|
|
143
|
-
language: field.descriptor.item.language,
|
|
144
|
-
version: 0,
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
isGenerator: false,
|
|
149
|
-
id: "open-target-in-content-editor",
|
|
150
|
-
description: "Opens the target item in the content/page editor",
|
|
151
|
-
};
|
|
152
|
-
|
|
153
|
-
const pageEditorRightSidebar = {
|
|
154
|
-
title: "COMPONENT NAVIGATOR & HISTORY",
|
|
155
|
-
panels: [
|
|
156
|
-
{
|
|
157
|
-
name: "component-tree",
|
|
158
|
-
icon: <Layers size={14} />,
|
|
159
|
-
title: "Component Navigator",
|
|
160
|
-
content: <ComponentTree />,
|
|
161
|
-
initialSize: 20,
|
|
162
|
-
},
|
|
163
|
-
{
|
|
164
|
-
name: "history",
|
|
165
|
-
icon: "pi pi-clock",
|
|
166
|
-
title: "History",
|
|
167
|
-
content: <EditHistory />,
|
|
168
|
-
initialSize: 15,
|
|
169
|
-
},
|
|
170
|
-
],
|
|
171
|
-
};
|
|
172
|
-
|
|
173
|
-
const editView = <EditView />;
|
|
174
|
-
const editPrimaryControls = <PageViewerControls />;
|
|
175
|
-
const itemPageEditorSecondaryControls = <SecondaryControls />;
|
|
176
|
-
|
|
177
|
-
const pageEditorViewBase = {
|
|
178
|
-
primaryControls: editPrimaryControls,
|
|
179
|
-
secondaryControls: itemPageEditorSecondaryControls,
|
|
180
|
-
rightSidebar: pageEditorRightSidebar,
|
|
181
|
-
defaultCenterPanelView: editView,
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
export const getConfiguration = (): EditorConfiguration => {
|
|
185
|
-
return {
|
|
186
|
-
extensions: {},
|
|
187
|
-
tours: {
|
|
188
|
-
default: {
|
|
189
|
-
getSteps: (params) =>
|
|
190
|
-
getDefaultTourSteps(params, {
|
|
191
|
-
firstComponentTemplateId: "39593ec8-0d85-46f2-9573-c368ef7e4ae3",
|
|
192
|
-
firstComponentTemplateName: "Section",
|
|
193
|
-
firstComponentTextFieldName: "Title",
|
|
194
|
-
firstComponentTextFieldId: "f352f51f-062c-4874-a561-6283f8679583",
|
|
195
|
-
firstComponentRichTextFieldName: "Introduction",
|
|
196
|
-
firstComponentRichTextFieldId:
|
|
197
|
-
"b44b547b-33f5-4379-8ac3-c57ccea2d407",
|
|
198
|
-
}),
|
|
199
|
-
},
|
|
200
|
-
preview: {
|
|
201
|
-
getSteps: (params) => getPreviewTourSteps(params),
|
|
202
|
-
},
|
|
203
|
-
},
|
|
204
|
-
activeTour: "default",
|
|
205
|
-
commands: {
|
|
206
|
-
localizeItem: localizeItemCommand,
|
|
207
|
-
renameItem: renameItemCommand,
|
|
208
|
-
deleteItem: deleteItemCommand,
|
|
209
|
-
insertItem: insertItemCommand,
|
|
210
|
-
publishItem: publishItemCommand,
|
|
211
|
-
moveItems: moveItemsCommand,
|
|
212
|
-
copyItems: copyItemsCommand,
|
|
213
|
-
allItemCommands: [
|
|
214
|
-
renameItemCommand,
|
|
215
|
-
deleteItemCommand,
|
|
216
|
-
publishItemCommand,
|
|
217
|
-
duplicateItemCommand as Command<{ items: FullItem[] }>,
|
|
218
|
-
copyItemsCommand as Command<{ items: FullItem[] }>,
|
|
219
|
-
moveItemsCommand as Command<{ items: FullItem[] }>,
|
|
220
|
-
],
|
|
221
|
-
reviewcommands: [approveReviewCommand, rejectReviewCommand],
|
|
222
|
-
},
|
|
223
|
-
events: {},
|
|
224
|
-
services: {
|
|
225
|
-
renderService: { path: "/alpaca/editor/render" },
|
|
226
|
-
editorService: {
|
|
227
|
-
//baseUrl: "",
|
|
228
|
-
},
|
|
229
|
-
aiService: {
|
|
230
|
-
promptUrl: "/alpaca/editor/ai/prompt",
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
|
-
fieldTypes: {
|
|
234
|
-
raw: {
|
|
235
|
-
editor: RawEditor,
|
|
236
|
-
},
|
|
237
|
-
"single-line text": {
|
|
238
|
-
editor: SingleLineText,
|
|
239
|
-
},
|
|
240
|
-
"multi-line text": {
|
|
241
|
-
editor: MultiLineText,
|
|
242
|
-
},
|
|
243
|
-
"rich text": {
|
|
244
|
-
editor: RichTextEditor,
|
|
245
|
-
custom: {
|
|
246
|
-
profiles: { default: defaultRichTextEditorProfile },
|
|
247
|
-
},
|
|
248
|
-
},
|
|
249
|
-
"general link": {
|
|
250
|
-
editor: LinkFieldEditor,
|
|
251
|
-
},
|
|
252
|
-
picture: {
|
|
253
|
-
editor: PictureFieldEditor,
|
|
254
|
-
},
|
|
255
|
-
image: {
|
|
256
|
-
editor: ImageFieldEditor,
|
|
257
|
-
buttons: [],
|
|
258
|
-
},
|
|
259
|
-
droplink: {
|
|
260
|
-
editor: DropLinkEditor,
|
|
261
|
-
buttons: [openTargetActionButton],
|
|
262
|
-
},
|
|
263
|
-
"enhanced dropLink": {
|
|
264
|
-
editor: DropLinkEditor,
|
|
265
|
-
buttons: [openTargetActionButton],
|
|
266
|
-
},
|
|
267
|
-
"enhanced internal link": {
|
|
268
|
-
editor: InternalLinkFieldEditor,
|
|
269
|
-
buttons: [openTargetActionButton],
|
|
270
|
-
},
|
|
271
|
-
droplist: {
|
|
272
|
-
editor: DropListEditor,
|
|
273
|
-
},
|
|
274
|
-
treelistex: {
|
|
275
|
-
editor: TreeListEditor,
|
|
276
|
-
},
|
|
277
|
-
treelist: {
|
|
278
|
-
editor: TreeListEditor,
|
|
279
|
-
},
|
|
280
|
-
"enhanced treelist": {
|
|
281
|
-
editor: TreeListEditor,
|
|
282
|
-
},
|
|
283
|
-
"tree list": {
|
|
284
|
-
editor: TreeListEditor,
|
|
285
|
-
},
|
|
286
|
-
multilist: {
|
|
287
|
-
editor: TreeListEditor,
|
|
288
|
-
},
|
|
289
|
-
checkbox: {
|
|
290
|
-
editor: CheckboxEditor,
|
|
291
|
-
},
|
|
292
|
-
droptree: {
|
|
293
|
-
editor: InternalLinkFieldEditor,
|
|
294
|
-
},
|
|
295
|
-
attachment: {
|
|
296
|
-
editor: AttachmentEditor,
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
editorWarnings: [
|
|
300
|
-
NoWriteAccess,
|
|
301
|
-
NoWriteLanguageAccess,
|
|
302
|
-
NoWorkflowWriteAccess,
|
|
303
|
-
ItemLocked,
|
|
304
|
-
ValidationErrors,
|
|
305
|
-
],
|
|
306
|
-
outline: {
|
|
307
|
-
width: 100,
|
|
308
|
-
},
|
|
309
|
-
debounceFieldEditsInterval: 250,
|
|
310
|
-
devices: [
|
|
311
|
-
{ name: "iPhone 14 Pro Max", width: 430, height: 932 },
|
|
312
|
-
{ name: "iPhone SE", width: 375, height: 667 },
|
|
313
|
-
{ name: "Pixel 7", width: 412, height: 915 },
|
|
314
|
-
{ name: "iPad Mini", width: 768, height: 1024 },
|
|
315
|
-
{ name: "iPad Pro", width: 1024, height: 1366 },
|
|
316
|
-
{ name: "Responsive", width: undefined, height: undefined },
|
|
317
|
-
],
|
|
318
|
-
|
|
319
|
-
pageWizard: {
|
|
320
|
-
getWizards: getWizards,
|
|
321
|
-
startWizardCommand: startPageWizardCommand,
|
|
322
|
-
|
|
323
|
-
stepComponents: {
|
|
324
|
-
CollectStep,
|
|
325
|
-
LayoutStep,
|
|
326
|
-
BuildPageStep,
|
|
327
|
-
SelectStep,
|
|
328
|
-
ImagesStep,
|
|
329
|
-
ContentStep,
|
|
330
|
-
MetaDataStep,
|
|
331
|
-
},
|
|
332
|
-
},
|
|
333
|
-
|
|
334
|
-
controlCenter: {
|
|
335
|
-
groups: [
|
|
336
|
-
{
|
|
337
|
-
title: "System",
|
|
338
|
-
icon: <i className="pi pi-info-circle" />,
|
|
339
|
-
panels: [
|
|
340
|
-
{
|
|
341
|
-
id: "info",
|
|
342
|
-
title: "System Info",
|
|
343
|
-
icon: <i className="pi pi-info-circle" />,
|
|
344
|
-
content: <Info />,
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
id: "quota",
|
|
348
|
-
title: "AI Quota",
|
|
349
|
-
icon: <i className="pi pi-chart-bar" />,
|
|
350
|
-
content: <QuotaInfo />,
|
|
351
|
-
},
|
|
352
|
-
{
|
|
353
|
-
id: "about",
|
|
354
|
-
title: "About",
|
|
355
|
-
icon: <i className="pi pi-info" />,
|
|
356
|
-
content: <About />,
|
|
357
|
-
},
|
|
358
|
-
{
|
|
359
|
-
id: "websocket-messages",
|
|
360
|
-
title: "WebSocket Messages",
|
|
361
|
-
icon: <i className="pi pi-comments" />,
|
|
362
|
-
content: <WebSocketMessages />,
|
|
363
|
-
},
|
|
364
|
-
],
|
|
365
|
-
},
|
|
366
|
-
{
|
|
367
|
-
title: "Indexing",
|
|
368
|
-
icon: <i className="pi pi-search" />,
|
|
369
|
-
panels: [
|
|
370
|
-
{
|
|
371
|
-
id: "indexes",
|
|
372
|
-
title: "All Indexes",
|
|
373
|
-
icon: <i className="pi pi-search" />,
|
|
374
|
-
content: <IndexOverview />,
|
|
375
|
-
},
|
|
376
|
-
],
|
|
377
|
-
},
|
|
378
|
-
],
|
|
379
|
-
},
|
|
380
|
-
editor: {
|
|
381
|
-
defaultPanelSizes: [400, 300],
|
|
382
|
-
dialogs: {
|
|
383
|
-
newPage: {
|
|
384
|
-
expandTreeNode: "bafb88a1-506a-4671-b47b-1947730d25f6",
|
|
385
|
-
},
|
|
386
|
-
},
|
|
387
|
-
views: [
|
|
388
|
-
{
|
|
389
|
-
name: "splash-screen",
|
|
390
|
-
title: "Splash Screen",
|
|
391
|
-
icon: "pi pi-home",
|
|
392
|
-
hidden: true,
|
|
393
|
-
defaultCenterPanelView: <SplashScreen />,
|
|
394
|
-
hideViewSelector: true,
|
|
395
|
-
},
|
|
396
|
-
{
|
|
397
|
-
name: "open-page",
|
|
398
|
-
title: "Open Page",
|
|
399
|
-
icon: "pi pi-home",
|
|
400
|
-
hidden: true,
|
|
401
|
-
defaultCenterPanelView: <OpenPage />,
|
|
402
|
-
hideViewSelector: true,
|
|
403
|
-
},
|
|
404
|
-
{
|
|
405
|
-
name: "new-page",
|
|
406
|
-
title: "New Page",
|
|
407
|
-
icon: "pi pi-home",
|
|
408
|
-
hidden: true,
|
|
409
|
-
defaultCenterPanelView: <NewPage />,
|
|
410
|
-
hideViewSelector: true,
|
|
411
|
-
},
|
|
412
|
-
{
|
|
413
|
-
name: "page-editor",
|
|
414
|
-
title: "Edit",
|
|
415
|
-
icon: <EditIcon />,
|
|
416
|
-
...pageEditorViewBase,
|
|
417
|
-
},
|
|
418
|
-
// {
|
|
419
|
-
// name: "ghostwriter ",
|
|
420
|
-
// title: "Ghostwriter",
|
|
421
|
-
// icon: <Ghost size={16} />,
|
|
422
|
-
// leftSidebar: {
|
|
423
|
-
// panels: [
|
|
424
|
-
// {
|
|
425
|
-
// name: "ghostwriter",
|
|
426
|
-
// icon: <Ghost size={16} />,
|
|
427
|
-
// title: "Ghostwriter",
|
|
428
|
-
// content: <GhostWriter />,
|
|
429
|
-
// initialSize: 100,
|
|
430
|
-
// },
|
|
431
|
-
// ],
|
|
432
|
-
// },
|
|
433
|
-
// ...pageEditorViewBase,
|
|
434
|
-
// },
|
|
435
|
-
{
|
|
436
|
-
name: "ai",
|
|
437
|
-
title: "AI",
|
|
438
|
-
icon: <WizardIcon />,
|
|
439
|
-
leftSidebar: {
|
|
440
|
-
panels: [
|
|
441
|
-
{
|
|
442
|
-
name: "ai-terminal",
|
|
443
|
-
icon: "pi pi-comments",
|
|
444
|
-
title: "AI",
|
|
445
|
-
content: <EditorAiTerminal />,
|
|
446
|
-
initialSize: 70,
|
|
447
|
-
noOverflow: true,
|
|
448
|
-
},
|
|
449
|
-
],
|
|
450
|
-
},
|
|
451
|
-
...pageEditorViewBase,
|
|
452
|
-
},
|
|
453
|
-
{
|
|
454
|
-
name: "translate",
|
|
455
|
-
icon: <Languages />,
|
|
456
|
-
title: "Translate",
|
|
457
|
-
leftSidebar: {
|
|
458
|
-
panels: [
|
|
459
|
-
{
|
|
460
|
-
name: "translation",
|
|
461
|
-
icon: "pi pi-language",
|
|
462
|
-
title: "Translations",
|
|
463
|
-
content: <Translation />,
|
|
464
|
-
initialSize: 20,
|
|
465
|
-
},
|
|
466
|
-
],
|
|
467
|
-
},
|
|
468
|
-
...pageEditorViewBase,
|
|
469
|
-
},
|
|
470
|
-
{
|
|
471
|
-
name: "reviews",
|
|
472
|
-
title: "Reviews",
|
|
473
|
-
icon: <MessageCircleMore />,
|
|
474
|
-
leftSidebar: {
|
|
475
|
-
panels: [
|
|
476
|
-
{
|
|
477
|
-
name: "comments",
|
|
478
|
-
icon: "pi pi-comments",
|
|
479
|
-
title: "Comments & Suggestions",
|
|
480
|
-
content: <Comments />,
|
|
481
|
-
initialSize: 65,
|
|
482
|
-
noOverflow: true,
|
|
483
|
-
},
|
|
484
|
-
{
|
|
485
|
-
name: "reviews",
|
|
486
|
-
icon: "pi pi-users",
|
|
487
|
-
title: "Reviews",
|
|
488
|
-
content: <Reviews />,
|
|
489
|
-
initialSize: 35,
|
|
490
|
-
noOverflow: true,
|
|
491
|
-
},
|
|
492
|
-
],
|
|
493
|
-
},
|
|
494
|
-
...pageEditorViewBase,
|
|
495
|
-
},
|
|
496
|
-
{
|
|
497
|
-
name: "publish",
|
|
498
|
-
title: "Publish",
|
|
499
|
-
icon: <WorkboxIcon />,
|
|
500
|
-
|
|
501
|
-
leftSidebar: {
|
|
502
|
-
panels: [
|
|
503
|
-
{
|
|
504
|
-
name: "Workbox",
|
|
505
|
-
title: "Workbox",
|
|
506
|
-
icon: "pi-inbox",
|
|
507
|
-
content: <Workbox />,
|
|
508
|
-
initialSize: 50,
|
|
509
|
-
},
|
|
510
|
-
{
|
|
511
|
-
name: "Validation",
|
|
512
|
-
title: "Validation",
|
|
513
|
-
icon: "pi-check",
|
|
514
|
-
content: <Validation />,
|
|
515
|
-
initialSize: 50,
|
|
516
|
-
},
|
|
517
|
-
],
|
|
518
|
-
},
|
|
519
|
-
|
|
520
|
-
...pageEditorViewBase,
|
|
521
|
-
},
|
|
522
|
-
{
|
|
523
|
-
name: "content-editor",
|
|
524
|
-
title: "Content Editor",
|
|
525
|
-
icon: <TreeIcon />,
|
|
526
|
-
defaultCenterPanelView: editView,
|
|
527
|
-
leftSidebar: {
|
|
528
|
-
panels: [
|
|
529
|
-
{
|
|
530
|
-
name: "tree",
|
|
531
|
-
icon: <TreeIcon />,
|
|
532
|
-
title: "Content",
|
|
533
|
-
content: <MainContentTree mode="normal" />,
|
|
534
|
-
initialSize: 80,
|
|
535
|
-
},
|
|
536
|
-
],
|
|
537
|
-
},
|
|
538
|
-
rightSidebar: pageEditorRightSidebar,
|
|
539
|
-
primaryControls: editPrimaryControls,
|
|
540
|
-
secondaryControls: itemPageEditorSecondaryControls,
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
{
|
|
544
|
-
name: "dictionary",
|
|
545
|
-
title: "Dictionary",
|
|
546
|
-
icon: <BookA />,
|
|
547
|
-
leftSidebar: {
|
|
548
|
-
panels: [
|
|
549
|
-
{
|
|
550
|
-
name: "dictionary",
|
|
551
|
-
icon: "pi pi-book",
|
|
552
|
-
title: "Dictionary",
|
|
553
|
-
content: <DictionaryEditor />,
|
|
554
|
-
initialSize: 100,
|
|
555
|
-
},
|
|
556
|
-
],
|
|
557
|
-
},
|
|
558
|
-
...pageEditorViewBase,
|
|
559
|
-
},
|
|
560
|
-
{
|
|
561
|
-
name: "sessions",
|
|
562
|
-
title: "Sessions",
|
|
563
|
-
icon: <UsersIcon />,
|
|
564
|
-
leftSidebar: {
|
|
565
|
-
panels: [
|
|
566
|
-
{
|
|
567
|
-
name: "sessions",
|
|
568
|
-
icon: "pi pi-users",
|
|
569
|
-
title: "Sessions",
|
|
570
|
-
content: <Sessions />,
|
|
571
|
-
initialSize: 100,
|
|
572
|
-
},
|
|
573
|
-
],
|
|
574
|
-
},
|
|
575
|
-
...pageEditorViewBase,
|
|
576
|
-
},
|
|
577
|
-
{
|
|
578
|
-
name: "debug",
|
|
579
|
-
title: "Debug",
|
|
580
|
-
icon: <BugIcon />,
|
|
581
|
-
|
|
582
|
-
leftSidebar: {
|
|
583
|
-
panels: [
|
|
584
|
-
{
|
|
585
|
-
name: "component-tree",
|
|
586
|
-
icon: "pi pi-list",
|
|
587
|
-
title: "Outline",
|
|
588
|
-
content: <ComponentTree />,
|
|
589
|
-
initialSize: 20,
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
name: "debug",
|
|
593
|
-
icon: <JsonIcon />,
|
|
594
|
-
title: "JSON",
|
|
595
|
-
content: <Debug />,
|
|
596
|
-
initialSize: 30,
|
|
597
|
-
},
|
|
598
|
-
{
|
|
599
|
-
name: "graphql",
|
|
600
|
-
icon: <GraphQLIcon />,
|
|
601
|
-
title: "GraphQL",
|
|
602
|
-
content: <GraphQL />,
|
|
603
|
-
initialSize: 30,
|
|
604
|
-
},
|
|
605
|
-
{
|
|
606
|
-
name: "performance",
|
|
607
|
-
icon: "pi pi-stopwatch",
|
|
608
|
-
title: "Performance",
|
|
609
|
-
content: <Performance />,
|
|
610
|
-
initialSize: 20,
|
|
611
|
-
},
|
|
612
|
-
],
|
|
613
|
-
},
|
|
614
|
-
...pageEditorViewBase,
|
|
615
|
-
},
|
|
616
|
-
// {
|
|
617
|
-
// name: "component-designer",
|
|
618
|
-
// title: "Component Designer",
|
|
619
|
-
// icon: "pi pi-palette",
|
|
620
|
-
// defaultCenterPanelView: <ComponentDesigner />,
|
|
621
|
-
// menuBar: <ComponentDesignerMenu />,
|
|
622
|
-
// leftSidebar: {
|
|
623
|
-
// panels: [
|
|
624
|
-
// {
|
|
625
|
-
// name: "component-tree",
|
|
626
|
-
// icon: "pi pi-list",
|
|
627
|
-
// title: "Outline",
|
|
628
|
-
// content: <ComponentTree />,
|
|
629
|
-
// initialSize: 30,
|
|
630
|
-
// },
|
|
631
|
-
// {
|
|
632
|
-
// name: "ai-terminal",
|
|
633
|
-
// icon: "pi pi-comments",
|
|
634
|
-
// title: "AI",
|
|
635
|
-
// content: <ComponentDesignerAiTerminal />,
|
|
636
|
-
// initialSize: 40,
|
|
637
|
-
// },
|
|
638
|
-
// {
|
|
639
|
-
// name: "history",
|
|
640
|
-
// icon: "pi pi-clock",
|
|
641
|
-
// title: "History",
|
|
642
|
-
// content: <EditHistory />,
|
|
643
|
-
// initialSize: 30,
|
|
644
|
-
// },
|
|
645
|
-
// ],
|
|
646
|
-
// },
|
|
647
|
-
// },
|
|
648
|
-
{
|
|
649
|
-
name: "page-wizard",
|
|
650
|
-
title: "Page Wizard",
|
|
651
|
-
icon: <PageWizardIcon />,
|
|
652
|
-
defaultCenterPanelView: <PageWizard />,
|
|
653
|
-
hideViewSelector: true,
|
|
654
|
-
visible: (editContext) => !!editContext.pageWizard.wizard,
|
|
655
|
-
headerTitle: (editContext) => {
|
|
656
|
-
const wizardName = editContext.pageWizard.wizard?.name;
|
|
657
|
-
return wizardName ? `${wizardName}` : "Page Wizard";
|
|
658
|
-
},
|
|
659
|
-
beforeClose: async (editContext) => {
|
|
660
|
-
return new Promise<boolean>((resolve) => {
|
|
661
|
-
editContext.confirm({
|
|
662
|
-
showCancel: true,
|
|
663
|
-
showAccept: true,
|
|
664
|
-
header: "Close Page Wizard",
|
|
665
|
-
message: "Are you sure you want to close the page wizard?",
|
|
666
|
-
accept: () => {
|
|
667
|
-
editContext.pageWizard.setWizard(undefined);
|
|
668
|
-
resolve(true);
|
|
669
|
-
},
|
|
670
|
-
reject: () => {
|
|
671
|
-
resolve(false);
|
|
672
|
-
},
|
|
673
|
-
});
|
|
674
|
-
});
|
|
675
|
-
},
|
|
676
|
-
},
|
|
677
|
-
{
|
|
678
|
-
name: "control-center",
|
|
679
|
-
title: "Control Center",
|
|
680
|
-
icon: <Settings />,
|
|
681
|
-
defaultCenterPanelView: <Status />,
|
|
682
|
-
menuBar: <></>,
|
|
683
|
-
},
|
|
684
|
-
],
|
|
685
|
-
|
|
686
|
-
titlebar: <Titlebar />,
|
|
687
|
-
actionsMenu: {
|
|
688
|
-
itemsFactory: (editContext: EditContextType): MenuItemGroup[] => {
|
|
689
|
-
const groups: MenuItemGroup[] = [];
|
|
690
|
-
|
|
691
|
-
if (!editContext.contentEditorItem) return [];
|
|
692
|
-
|
|
693
|
-
const items = [editContext.contentEditorItem];
|
|
694
|
-
|
|
695
|
-
const generateItems = (commands: Command<any>[]) =>
|
|
696
|
-
commands.map((command) => {
|
|
697
|
-
if (typeof command === "string") {
|
|
698
|
-
return {
|
|
699
|
-
id: "separator",
|
|
700
|
-
separator: true,
|
|
701
|
-
label: "",
|
|
702
|
-
icon: "pi pi-splitter",
|
|
703
|
-
};
|
|
704
|
-
}
|
|
705
|
-
return {
|
|
706
|
-
id: command.id,
|
|
707
|
-
label: command.label,
|
|
708
|
-
icon: command.icon,
|
|
709
|
-
disabled: editContext.isCommandDisabled({
|
|
710
|
-
command: command,
|
|
711
|
-
data: { items },
|
|
712
|
-
}),
|
|
713
|
-
command: async (event: any) => {
|
|
714
|
-
await editContext.executeCommand({
|
|
715
|
-
command: command,
|
|
716
|
-
event: event,
|
|
717
|
-
data: { items },
|
|
718
|
-
});
|
|
719
|
-
},
|
|
720
|
-
};
|
|
721
|
-
});
|
|
722
|
-
|
|
723
|
-
groups.push({
|
|
724
|
-
id: "review",
|
|
725
|
-
label: "Review",
|
|
726
|
-
items: generateItems(
|
|
727
|
-
editContext.configuration.commands.reviewcommands,
|
|
728
|
-
),
|
|
729
|
-
});
|
|
730
|
-
|
|
731
|
-
groups.push({
|
|
732
|
-
id: "all-item-commands",
|
|
733
|
-
label: "All Item Commands",
|
|
734
|
-
items: generateItems(
|
|
735
|
-
editContext.configuration.commands.allItemCommands,
|
|
736
|
-
),
|
|
737
|
-
});
|
|
738
|
-
|
|
739
|
-
groups.push({
|
|
740
|
-
id: "new",
|
|
741
|
-
label: "New",
|
|
742
|
-
items: [
|
|
743
|
-
{
|
|
744
|
-
id: "new-page",
|
|
745
|
-
label: "New Page",
|
|
746
|
-
icon: "pi pi-file",
|
|
747
|
-
command: async () => {
|
|
748
|
-
editContext.switchView("new-page");
|
|
749
|
-
},
|
|
750
|
-
},
|
|
751
|
-
],
|
|
752
|
-
});
|
|
753
|
-
|
|
754
|
-
groups.push({
|
|
755
|
-
id: "about",
|
|
756
|
-
label: "About",
|
|
757
|
-
items: [
|
|
758
|
-
{
|
|
759
|
-
id: "about",
|
|
760
|
-
label: "About",
|
|
761
|
-
icon: "pi pi-info-circle",
|
|
762
|
-
command: async () => {
|
|
763
|
-
editContext.openDialog(AboutDialog, {});
|
|
764
|
-
},
|
|
765
|
-
},
|
|
766
|
-
],
|
|
767
|
-
});
|
|
768
|
-
|
|
769
|
-
groups.push({
|
|
770
|
-
id: "account",
|
|
771
|
-
label: "Account",
|
|
772
|
-
items: [
|
|
773
|
-
{
|
|
774
|
-
id: "logout",
|
|
775
|
-
label: "Log Out",
|
|
776
|
-
icon: "pi pi-sign-out",
|
|
777
|
-
command: async () => {
|
|
778
|
-
// Redirect to Sitecore logout endpoint
|
|
779
|
-
window.location.href = "/sitecore/login?action=logout";
|
|
780
|
-
},
|
|
781
|
-
},
|
|
782
|
-
],
|
|
783
|
-
});
|
|
784
|
-
|
|
785
|
-
return groups;
|
|
786
|
-
},
|
|
787
|
-
},
|
|
788
|
-
|
|
789
|
-
contentTree: {
|
|
790
|
-
contextMenu: {
|
|
791
|
-
factory: async (props: {
|
|
792
|
-
items: FullItem[];
|
|
793
|
-
editContext: EditContextType;
|
|
794
|
-
commandCallback?: (command: Command<any>, result: any) => void;
|
|
795
|
-
}): Promise<MenuItem[] | undefined> => {
|
|
796
|
-
const editContext = props.editContext;
|
|
797
|
-
|
|
798
|
-
if (!props.items) return;
|
|
799
|
-
|
|
800
|
-
const menuItems: MenuItem[] =
|
|
801
|
-
props.editContext.configuration.commands.allItemCommands?.map(
|
|
802
|
-
(x: ItemCommand) => {
|
|
803
|
-
const commandData = {
|
|
804
|
-
items: props.items,
|
|
805
|
-
};
|
|
806
|
-
|
|
807
|
-
return {
|
|
808
|
-
id: x.id,
|
|
809
|
-
label: x.label,
|
|
810
|
-
icon: x.icon,
|
|
811
|
-
command: async (triggerEvent: any) => {
|
|
812
|
-
const result = await editContext?.executeCommand({
|
|
813
|
-
command: x,
|
|
814
|
-
data: commandData,
|
|
815
|
-
event: triggerEvent,
|
|
816
|
-
});
|
|
817
|
-
|
|
818
|
-
if (props.commandCallback)
|
|
819
|
-
props.commandCallback(x, result);
|
|
820
|
-
},
|
|
821
|
-
disabled: editContext?.isCommandDisabled({
|
|
822
|
-
command: x,
|
|
823
|
-
data: commandData,
|
|
824
|
-
}),
|
|
825
|
-
};
|
|
826
|
-
},
|
|
827
|
-
);
|
|
828
|
-
|
|
829
|
-
// const copyMenuItem = {
|
|
830
|
-
// label: "Copy",
|
|
831
|
-
// id: "copy",
|
|
832
|
-
// template: (
|
|
833
|
-
// <CopyMoveMenuTemplate
|
|
834
|
-
// command={editContext.configuration.commands.copyItems}
|
|
835
|
-
// items={props.items}
|
|
836
|
-
// commandCallback={(command, result) =>
|
|
837
|
-
// props.commandCallback?.(command, result)
|
|
838
|
-
// }
|
|
839
|
-
// />
|
|
840
|
-
// ),
|
|
841
|
-
// };
|
|
842
|
-
// menuItems.push(copyMenuItem);
|
|
843
|
-
|
|
844
|
-
// const moveMenuItem = {
|
|
845
|
-
// label: "Move",
|
|
846
|
-
// id: "move",
|
|
847
|
-
// template: (
|
|
848
|
-
// <CopyMoveMenuTemplate
|
|
849
|
-
// command={editContext.configuration.commands.moveItems}
|
|
850
|
-
// items={props.items}
|
|
851
|
-
// commandCallback={(command, result) =>
|
|
852
|
-
// props.commandCallback?.(command, result)
|
|
853
|
-
// }
|
|
854
|
-
// />
|
|
855
|
-
// ),
|
|
856
|
-
// };
|
|
857
|
-
// menuItems.push(moveMenuItem);
|
|
858
|
-
|
|
859
|
-
if (props.items.length > 1) return menuItems;
|
|
860
|
-
|
|
861
|
-
const item = props.items[0];
|
|
862
|
-
if (!item) return menuItems;
|
|
863
|
-
const insertOptions = await loadInsertOptions(item.descriptor);
|
|
864
|
-
|
|
865
|
-
const insertMenuItem = {
|
|
866
|
-
label: "Insert",
|
|
867
|
-
id: "insert",
|
|
868
|
-
disabled: insertOptions.length == 0,
|
|
869
|
-
template: (
|
|
870
|
-
<InsertMenuTemplate
|
|
871
|
-
insertOptions={insertOptions}
|
|
872
|
-
item={item}
|
|
873
|
-
commandCallback={props.commandCallback}
|
|
874
|
-
/>
|
|
875
|
-
),
|
|
876
|
-
};
|
|
877
|
-
|
|
878
|
-
return [insertMenuItem, ...menuItems];
|
|
879
|
-
},
|
|
880
|
-
},
|
|
881
|
-
},
|
|
882
|
-
},
|
|
883
|
-
};
|
|
884
|
-
};
|
|
885
|
-
|
|
886
|
-
export function configureForUser(
|
|
887
|
-
configuration: EditorConfiguration,
|
|
888
|
-
user: User,
|
|
889
|
-
): EditorConfiguration {
|
|
890
|
-
if (user.isLimitedPreviewUser) {
|
|
891
|
-
return {
|
|
892
|
-
...configuration,
|
|
893
|
-
activeTour: "preview",
|
|
894
|
-
|
|
895
|
-
editor: {
|
|
896
|
-
...configuration.editor,
|
|
897
|
-
views: configuration.editor.views
|
|
898
|
-
.filter((x) => x.name === "reviews")
|
|
899
|
-
.map((x) => {
|
|
900
|
-
return {
|
|
901
|
-
...x,
|
|
902
|
-
leftSidebar: {
|
|
903
|
-
...x.leftSidebar,
|
|
904
|
-
panels: [
|
|
905
|
-
...(x.leftSidebar?.panels ?? []).filter(
|
|
906
|
-
(x) => x.name !== "reviews",
|
|
907
|
-
),
|
|
908
|
-
],
|
|
909
|
-
},
|
|
910
|
-
secondaryControls: <PreviewSecondaryControls />,
|
|
911
|
-
};
|
|
912
|
-
}),
|
|
913
|
-
},
|
|
914
|
-
};
|
|
915
|
-
}
|
|
916
|
-
return configuration;
|
|
917
|
-
}
|