@alpaca-editor/core 1.0.3767 → 1.0.3769
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { MenuItem } from "primereact/menuitem";
|
|
2
|
+
import { EditContextType } from "./client/editContext";
|
|
3
|
+
import { FieldDescriptor } from "../types";
|
|
4
|
+
import { Component, FieldButton } from "./pageModel";
|
|
5
|
+
export declare function showComponentContextMenu(components: Component[], editContext: EditContextType, field?: FieldDescriptor, fieldButtons?: FieldButton[]): (e: any) => boolean;
|
|
6
|
+
export interface EditContextMenuRef {
|
|
7
|
+
show: (event: any, menuItems: MenuItem[]) => void;
|
|
8
|
+
close: (event: any) => void;
|
|
9
|
+
}
|
|
10
|
+
interface EditContextMenuProps {
|
|
11
|
+
}
|
|
12
|
+
export declare const EditContextMenu: import("react").ForwardRefExoticComponent<EditContextMenuProps & import("react").RefAttributes<EditContextMenuRef>>;
|
|
13
|
+
export {};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
exports.showComponentContextMenu = showComponentContextMenu;
|
|
5
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
-
const react_1 = require("react");
|
|
7
|
-
const contextmenu_1 = require("primereact/contextmenu");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useImperativeHandle, useRef, useState } from "react";
|
|
3
|
+
import { ContextMenu } from "primereact/contextmenu";
|
|
8
4
|
// export function getFieldContextMenu(
|
|
9
5
|
// field: Field,
|
|
10
6
|
// editContext: EditContextType,
|
|
@@ -52,7 +48,7 @@ const contextmenu_1 = require("primereact/contextmenu");
|
|
|
52
48
|
// }
|
|
53
49
|
// };
|
|
54
50
|
// }
|
|
55
|
-
function showComponentContextMenu(components, editContext, field, fieldButtons) {
|
|
51
|
+
export function showComponentContextMenu(components, editContext, field, fieldButtons) {
|
|
56
52
|
const componentCommandMenuItems = getComponentMenuItems(editContext, components);
|
|
57
53
|
const menuItems = componentCommandMenuItems;
|
|
58
54
|
if (!editContext.readonly && field && fieldButtons?.length) {
|
|
@@ -81,12 +77,12 @@ function showComponentContextMenu(components, editContext, field, fieldButtons)
|
|
|
81
77
|
return false;
|
|
82
78
|
};
|
|
83
79
|
}
|
|
84
|
-
|
|
85
|
-
const cm =
|
|
86
|
-
const [menuItems, setMenuItems] =
|
|
80
|
+
export const EditContextMenu = forwardRef((props, ref) => {
|
|
81
|
+
const cm = useRef(null);
|
|
82
|
+
const [menuItems, setMenuItems] = useState([]);
|
|
87
83
|
if (!props)
|
|
88
84
|
return;
|
|
89
|
-
|
|
85
|
+
useImperativeHandle(ref, () => ({
|
|
90
86
|
show: (e, items) => {
|
|
91
87
|
if (!e.ctrlKey && !e.shiftKey && !e.altKey) {
|
|
92
88
|
setMenuItems(items);
|
|
@@ -98,7 +94,7 @@ exports.EditContextMenu = (0, react_1.forwardRef)((props, ref) => {
|
|
|
98
94
|
cm.current?.hide(event);
|
|
99
95
|
},
|
|
100
96
|
}));
|
|
101
|
-
return (
|
|
97
|
+
return _jsx(ContextMenu, { model: menuItems, ref: cm });
|
|
102
98
|
});
|
|
103
99
|
function getComponentMenuItems(editContext, components) {
|
|
104
100
|
const componentCommands = editContext.getComponentCommands(components);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ItemDescriptor } from "./pageModel";
|
|
2
|
+
import { EditorConfiguration } from "../config/types";
|
|
3
|
+
import { User } from "../types";
|
|
4
|
+
export declare function Editor({ configure, className, page, }: {
|
|
5
|
+
configure: (props: {
|
|
6
|
+
configuration: EditorConfiguration;
|
|
7
|
+
user: User;
|
|
8
|
+
}) => EditorConfiguration;
|
|
9
|
+
className?: string;
|
|
10
|
+
page?: ItemDescriptor;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
package/dist/editor/Editor.js
CHANGED
|
@@ -1,45 +1,39 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const react_uuid_1 = __importDefault(require("react-uuid"));
|
|
15
|
-
const config_1 = require("../config/config");
|
|
16
|
-
function Editor({ configure, className, page, }) {
|
|
17
|
-
const [config, setConfig] = (0, react_1.useState)();
|
|
18
|
-
const [userInfo, setUserInfo] = (0, react_1.useState)();
|
|
19
|
-
const [systemStatus, setSystemStatus] = (0, react_1.useState)();
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { EditorClient } from "./client/EditorClient";
|
|
4
|
+
import { DialogProvider } from "./client/DialogContext";
|
|
5
|
+
import { useEffect, useState } from "react";
|
|
6
|
+
import { getUserInfo } from "./services/editService";
|
|
7
|
+
import { getSystemStatus } from "./services/systemService";
|
|
8
|
+
import uuid from "react-uuid";
|
|
9
|
+
import { getConfiguration } from "../config/config";
|
|
10
|
+
export function Editor({ configure, className, page, }) {
|
|
11
|
+
const [config, setConfig] = useState();
|
|
12
|
+
const [userInfo, setUserInfo] = useState();
|
|
13
|
+
const [systemStatus, setSystemStatus] = useState();
|
|
20
14
|
const sessionId = typeof window !== "undefined"
|
|
21
|
-
? sessionStorage.getItem("sessionId") || (
|
|
22
|
-
: (
|
|
23
|
-
|
|
15
|
+
? sessionStorage.getItem("sessionId") || uuid()
|
|
16
|
+
: uuid();
|
|
17
|
+
useEffect(() => {
|
|
24
18
|
// Get user info and system status
|
|
25
|
-
|
|
19
|
+
getUserInfo().then((userInfo) => {
|
|
26
20
|
if (!userInfo) {
|
|
27
21
|
window.location.href = "/sitecore/login";
|
|
28
22
|
return;
|
|
29
23
|
}
|
|
30
24
|
setUserInfo(userInfo);
|
|
31
25
|
});
|
|
32
|
-
|
|
26
|
+
getSystemStatus().then((status) => {
|
|
33
27
|
if (status.data) {
|
|
34
28
|
setSystemStatus(status.data);
|
|
35
29
|
}
|
|
36
30
|
});
|
|
37
31
|
}, []);
|
|
38
|
-
|
|
32
|
+
useEffect(() => {
|
|
39
33
|
if (!userInfo || !systemStatus)
|
|
40
34
|
return;
|
|
41
35
|
const config = configure({
|
|
42
|
-
configuration:
|
|
36
|
+
configuration: getConfiguration(),
|
|
43
37
|
user: userInfo,
|
|
44
38
|
});
|
|
45
39
|
setConfig(config);
|
|
@@ -47,9 +41,9 @@ function Editor({ configure, className, page, }) {
|
|
|
47
41
|
if (!userInfo || !systemStatus)
|
|
48
42
|
return null;
|
|
49
43
|
if (systemStatus.messages.some((m) => m.severity === "error")) {
|
|
50
|
-
return ((
|
|
44
|
+
return (_jsxs("div", { className: "fixed inset-0 flex flex-col items-center justify-center gap-2 text-sm", children: [_jsx("h1", { className: "text-2xl", children: "Please fix the following issues:" }), _jsx("div", { className: "text-sm text-red-500", children: systemStatus.messages.map((m) => (_jsx("div", { children: m.message }, m.message))) }), _jsx("p", { children: "Check the logs for more details." })] }));
|
|
51
45
|
}
|
|
52
46
|
if (!config)
|
|
53
47
|
return null;
|
|
54
|
-
return ((
|
|
48
|
+
return (_jsx(DialogProvider, { children: _jsx(EditorClient, { configuration: config, className: className, item: page, sessionId: sessionId }) }));
|
|
55
49
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const utils_1 = require("primereact/utils");
|
|
6
|
-
function EditorWarning({ title, severity = "warning", children, }) {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "primereact/utils";
|
|
3
|
+
export function EditorWarning({ title, severity = "warning", children, }) {
|
|
7
4
|
const background = severity === "info"
|
|
8
5
|
? "bg-blue-100"
|
|
9
6
|
: severity === "error"
|
|
10
7
|
? "bg-red-100"
|
|
11
8
|
: "bg-yellow-100";
|
|
12
|
-
return ((
|
|
9
|
+
return (_jsxs("div", { className: classNames(background, "text-sm text-gray-500 border-b border-yellow-300 flex gap-2 items-stretch"), children: [_jsx("div", { className: "bg-yellow-200 px-4 flex items-center text-gray-900", children: _jsx("span", { className: "pi pi-exclamation-triangle text-2xl" }) }), _jsxs("div", { className: "p-2", children: [_jsx("div", { className: "font-bold", children: title }), _jsx("div", { className: "text-xs", children: children })] })] }));
|
|
13
10
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EditContextType } from "./client/editContext";
|
|
2
|
+
import { FullItem } from "./pageModel";
|
|
3
|
+
export type EditorWarningProps = {
|
|
4
|
+
item: FullItem;
|
|
5
|
+
editContext: EditContextType;
|
|
6
|
+
};
|
|
7
|
+
export declare function EditorWarnings({ item }: {
|
|
8
|
+
item?: FullItem;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
exports.EditorWarnings = EditorWarnings;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const react_1 = __importDefault(require("react"));
|
|
9
|
-
const editContext_1 = require("./client/editContext");
|
|
10
|
-
function EditorWarnings({ item }) {
|
|
11
|
-
var context = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { useEditContext } from "./client/editContext";
|
|
4
|
+
export function EditorWarnings({ item }) {
|
|
5
|
+
var context = useEditContext();
|
|
12
6
|
if (!context || context.previewMode)
|
|
13
7
|
return;
|
|
14
8
|
if (!item) {
|
|
@@ -16,7 +10,7 @@ function EditorWarnings({ item }) {
|
|
|
16
10
|
}
|
|
17
11
|
if (!item)
|
|
18
12
|
return;
|
|
19
|
-
return ((
|
|
13
|
+
return (_jsx("div", { className: "z-50 w-full", children: context.configuration.editorWarnings.map((x, i) => React.createElement(x, {
|
|
20
14
|
item,
|
|
21
15
|
key: "warning" + i,
|
|
22
16
|
editContext: context,
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { SyntheticEvent } from "react";
|
|
2
|
+
import { Field } from "./pageModel";
|
|
3
|
+
export interface FieldEditorPopupRef {
|
|
4
|
+
show: (fields: Field[], sections: string[], event: SyntheticEvent) => void;
|
|
5
|
+
close: () => void;
|
|
6
|
+
}
|
|
7
|
+
interface FieldEditorPopupProps {
|
|
8
|
+
}
|
|
9
|
+
export declare const FieldEditorPopup: import("react").ForwardRefExoticComponent<FieldEditorPopupProps & import("react").RefAttributes<FieldEditorPopupRef>>;
|
|
10
|
+
export {};
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const [sections, setSections] = (0, react_1.useState)([]);
|
|
12
|
-
const [fields, setFields] = (0, react_1.useState)([]);
|
|
13
|
-
(0, react_1.useImperativeHandle)(ref, () => ({
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { OverlayPanel } from "primereact/overlaypanel";
|
|
4
|
+
import { forwardRef, useImperativeHandle, useRef, useState, } from "react";
|
|
5
|
+
import { FieldList } from "./FieldList";
|
|
6
|
+
export const FieldEditorPopup = forwardRef((_, ref) => {
|
|
7
|
+
const overlayRef = useRef(null);
|
|
8
|
+
const [sections, setSections] = useState([]);
|
|
9
|
+
const [fields, setFields] = useState([]);
|
|
10
|
+
useImperativeHandle(ref, () => ({
|
|
14
11
|
show: (fields, sections, ev) => {
|
|
15
12
|
setFields(fields);
|
|
16
13
|
setSections(sections);
|
|
@@ -20,5 +17,5 @@ exports.FieldEditorPopup = (0, react_1.forwardRef)((_, ref) => {
|
|
|
20
17
|
overlayRef.current?.hide();
|
|
21
18
|
},
|
|
22
19
|
}));
|
|
23
|
-
return ((
|
|
20
|
+
return (_jsx(OverlayPanel, { ref: overlayRef, children: _jsxs("div", { className: "w-96 h-96 flex flex-col gap-2 overflow-auto", onClick: (ev) => ev.stopPropagation(), children: [_jsx("div", { className: "flex justify-end p-3", children: _jsx("i", { className: "pi pi-times cursor-pointer", onClick: () => overlayRef?.current?.hide() }) }), fields && (_jsx(FieldList, { fields: [{ fields }], sections: sections, validators: [] }))] }) }));
|
|
24
21
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Field } from "../editor/pageModel";
|
|
2
|
+
import { FieldHistoryItem } from "../types";
|
|
3
|
+
export declare function FieldHistory({ field, onHover, }: {
|
|
4
|
+
field: Field;
|
|
5
|
+
onHover: (historyEntry: FieldHistoryItem | undefined) => void;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,36 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
function FieldHistory({ field, onHover, }) {
|
|
13
|
-
const [fieldHistory, setFieldHistory] = (0, react_2.useState)([]);
|
|
14
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getFieldHistory } from "../editor/services/editService";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
import { useEditContext } from "./client/editContext";
|
|
6
|
+
import { formatDate } from "./utils";
|
|
7
|
+
import { SimpleTable } from "./ui/SimpleTable";
|
|
8
|
+
import { SimpleIconButton } from "./ui/SimpleIconButton";
|
|
9
|
+
export function FieldHistory({ field, onHover, }) {
|
|
10
|
+
const [fieldHistory, setFieldHistory] = useState([]);
|
|
11
|
+
const editContext = useEditContext();
|
|
15
12
|
if (!editContext) {
|
|
16
13
|
return null;
|
|
17
14
|
}
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
getFieldHistory(field.descriptor.item, field.id).then((result) => {
|
|
20
17
|
setFieldHistory(result.data ?? []);
|
|
21
18
|
});
|
|
22
19
|
}, [field]);
|
|
23
20
|
if (fieldHistory.length === 0)
|
|
24
|
-
return (
|
|
25
|
-
return ((
|
|
21
|
+
return _jsx("div", { className: "p-2 text-gray-500 text-xs", children: "No history" });
|
|
22
|
+
return (_jsxs("div", { children: [_jsx("div", { className: "text-xs p-2 bg-gray-100 text-gray-500", children: "Field History" }), _jsx("div", { className: "max-h-96 overflow-auto", children: _jsx(SimpleTable, { items: fieldHistory, onRowHover: onHover, rowClassName: (x) => x.undone
|
|
26
23
|
? "text-gray-300 cursor-pointer hover:bg-gray-50 "
|
|
27
24
|
: "cursor-pointer hover:bg-gray-50", columns: [
|
|
28
|
-
{ header: "Date", body: (x) =>
|
|
25
|
+
{ header: "Date", body: (x) => formatDate(new Date(x.date)) },
|
|
29
26
|
{ header: "User", body: (x) => x.user },
|
|
30
27
|
{ header: "Version", body: (x) => x.version },
|
|
31
28
|
{
|
|
32
29
|
header: "Revert",
|
|
33
|
-
body: (x) => ((
|
|
30
|
+
body: (x) => (_jsx(SimpleIconButton, { icon: "pi pi-undo", onClick: () => editContext.operations.editField({
|
|
34
31
|
field: field.descriptor,
|
|
35
32
|
rawValue: x.rawValue,
|
|
36
33
|
refresh: "immediate",
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SingleValidatorResult } from "../types";
|
|
2
|
+
import { Field } from "./pageModel";
|
|
3
|
+
export type ItemFields = {
|
|
4
|
+
headline?: string;
|
|
5
|
+
fields: Field[];
|
|
6
|
+
};
|
|
7
|
+
export declare function FieldList({ fields, compareToFields, sections, validators, filter, simplified, showStandardFieldsEnabled, readonly, }: {
|
|
8
|
+
fields: ItemFields[];
|
|
9
|
+
compareToFields?: Field[];
|
|
10
|
+
sections?: string[];
|
|
11
|
+
validators: SingleValidatorResult[];
|
|
12
|
+
filter?: (field: Field) => boolean;
|
|
13
|
+
simplified?: boolean;
|
|
14
|
+
showStandardFieldsEnabled?: boolean;
|
|
15
|
+
readonly?: boolean;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
package/dist/editor/FieldList.js
CHANGED
|
@@ -1,29 +1,23 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
15
|
-
const
|
|
16
|
-
const SimpleIconButton_1 = require("./ui/SimpleIconButton");
|
|
17
|
-
function FieldList({ fields, compareToFields, sections, validators, filter, simplified, showStandardFieldsEnabled, readonly, }) {
|
|
18
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
19
|
-
const [searchFilter, setSearchFilter] = (0, react_1.useState)("");
|
|
20
|
-
const [showStandardFields, setShowStandardFields] = (0, react_1.useState)(false);
|
|
21
|
-
const uniqueId = (0, react_uuid_1.default)();
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Section } from "./ui/Section";
|
|
4
|
+
import { useEditContext } from "./client/editContext";
|
|
5
|
+
import { FieldListFieldWithFallbacks } from "./FieldListFieldWithFallbacks";
|
|
6
|
+
import { InputText } from "primereact/inputtext";
|
|
7
|
+
import { Fragment, useState } from "react";
|
|
8
|
+
import { Checkbox } from "primereact/checkbox";
|
|
9
|
+
import uuid from "react-uuid";
|
|
10
|
+
import { SimpleIconButton } from "./ui/SimpleIconButton";
|
|
11
|
+
export function FieldList({ fields, compareToFields, sections, validators, filter, simplified, showStandardFieldsEnabled, readonly, }) {
|
|
12
|
+
const editContext = useEditContext();
|
|
13
|
+
const [searchFilter, setSearchFilter] = useState("");
|
|
14
|
+
const [showStandardFields, setShowStandardFields] = useState(false);
|
|
15
|
+
const uniqueId = uuid();
|
|
22
16
|
if (!editContext)
|
|
23
17
|
return;
|
|
24
18
|
if (!fields)
|
|
25
19
|
return;
|
|
26
|
-
return ((
|
|
20
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: "sticky bg-gray-50 top-0 z-10 flex gap-2 border-y border-gray-200 items-center p-2 tour-field-list", children: [_jsx("i", { className: "pi pi-search" }), _jsx("div", { className: "text-xs", children: "Filter" }), _jsx(InputText, { className: "flex-1 text-xs", value: searchFilter, onChange: (x) => setSearchFilter(x.target.value) }), searchFilter && (_jsx(SimpleIconButton, { icon: "pi pi-times", onClick: () => setSearchFilter(""), className: "text-xs", label: "Clear" })), showStandardFieldsEnabled && (_jsxs(_Fragment, { children: [_jsx(Checkbox, { inputId: uniqueId, checked: showStandardFields, onChange: (e) => setShowStandardFields(e.checked) }), " ", _jsx("label", { htmlFor: uniqueId, className: "text-xs cursor-pointer", children: "Show standard fields" })] }))] }), fields.map((itemFields, index) => (_jsxs(Fragment, { children: [itemFields.headline && (_jsxs("div", { className: "text-sm mt-2 py-2 border-b flex items-center gap-1", children: [_jsx("i", { className: "pi pi-angle-right" }), " ", itemFields.headline] })), _jsx(FieldListForSingleItem, { fields: itemFields.fields, validators: validators, filter: filter, searchFilter: searchFilter, showStandardFields: showStandardFields, simplified: simplified, sections: sections, compareToFields: compareToFields, readonly: readonly }, index)] }, index)))] }));
|
|
27
21
|
}
|
|
28
22
|
function FieldListForSingleItem({ fields, validators, filter, searchFilter, simplified, sections, showStandardFields, compareToFields, readonly, }) {
|
|
29
23
|
let fieldsArray = Array.isArray(fields)
|
|
@@ -54,10 +48,10 @@ function FieldListForSingleItem({ fields, validators, filter, searchFilter, simp
|
|
|
54
48
|
sectionList.sort((a, b) => (a[0]?.sectionSortOrder || 0) - (b[0]?.sectionSortOrder || 0));
|
|
55
49
|
function getSectionFields(fields) {
|
|
56
50
|
fields.sort((a, b) => a?.sortOrder - b?.sortOrder);
|
|
57
|
-
return fields.map((field) => ((
|
|
51
|
+
return fields.map((field) => (_jsx(FieldListFieldWithFallbacks, { fieldDescriptor: field.descriptor, simplified: simplified, validators: validators.filter((x) => x.fieldId === field.id), compareToField: compareToFields?.find((x) => x.id === field.id), readonly: readonly }, field.id)));
|
|
58
52
|
}
|
|
59
53
|
return sectionList
|
|
60
54
|
.map((x) => x[0]?.section)
|
|
61
55
|
.filter((x) => !sections || sections.includes(x))
|
|
62
|
-
.map((section) => simplified ? (getSectionFields(sectionsGrouping[section])) : ((
|
|
56
|
+
.map((section) => simplified ? (getSectionFields(sectionsGrouping[section])) : (_jsx(Section, { title: section, children: getSectionFields(sectionsGrouping[section]) }, section)));
|
|
63
57
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EditorConfiguration } from "../config/types";
|
|
2
|
+
import { SingleValidatorResult } from "../types";
|
|
3
|
+
import { Field } from "./pageModel";
|
|
4
|
+
export default function FieldListField({ field, validators, simplified, title, isFocusedField, showFallbackButton, compareToField, readonly, }: {
|
|
5
|
+
field: Field;
|
|
6
|
+
validators: SingleValidatorResult[];
|
|
7
|
+
simplified?: boolean;
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
isFocusedField: boolean;
|
|
10
|
+
showFallbackButton?: React.ReactNode;
|
|
11
|
+
compareToField?: Field;
|
|
12
|
+
readonly?: boolean;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element | undefined;
|
|
14
|
+
export declare function getFieldEditor(field: Field, showRawValue: boolean, isReadOnly: boolean, configuration: EditorConfiguration, debouncedSetFieldvalue: (value: string) => void): import("react/jsx-runtime").JSX.Element | null;
|