@alpaca-editor/core 1.0.3767 → 1.0.3769
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client-components/api.d.ts +1 -0
- package/dist/client-components/api.js +1 -4
- package/dist/client-components/index.d.ts +16 -0
- package/dist/client-components/index.js +16 -36
- package/dist/components/ActionButton.d.ts +12 -0
- package/dist/components/ActionButton.js +4 -8
- package/dist/components/Error.d.ts +9 -0
- package/dist/components/Error.js +8 -13
- package/dist/config/config.d.ts +6 -0
- package/dist/config/config.js +145 -153
- package/dist/config/types.d.ts +223 -0
- package/dist/config/types.js +1 -2
- package/dist/editor/ComponentInfo.d.ts +4 -0
- package/dist/editor/ComponentInfo.js +12 -15
- package/dist/editor/ConfirmationDialog.d.ts +19 -0
- package/dist/editor/ConfirmationDialog.js +11 -13
- package/dist/editor/ContentTree.d.ts +35 -0
- package/dist/editor/ContentTree.js +56 -59
- package/dist/editor/ContextMenu.d.ts +13 -0
- package/dist/editor/ContextMenu.js +9 -13
- package/dist/editor/Editor.d.ts +11 -0
- package/dist/editor/Editor.js +21 -27
- package/dist/editor/EditorWarning.d.ts +5 -0
- package/dist/editor/EditorWarning.js +4 -7
- package/dist/editor/EditorWarnings.d.ts +9 -0
- package/dist/editor/EditorWarnings.js +6 -12
- package/dist/editor/FieldEditorPopup.d.ts +10 -0
- package/dist/editor/FieldEditorPopup.js +10 -13
- package/dist/editor/FieldHistory.d.ts +6 -0
- package/dist/editor/FieldHistory.js +17 -20
- package/dist/editor/FieldList.d.ts +16 -0
- package/dist/editor/FieldList.js +17 -23
- package/dist/editor/FieldListField.d.ts +14 -0
- package/dist/editor/FieldListField.js +44 -48
- package/dist/editor/FieldListFieldWithFallbacks.d.ts +10 -0
- package/dist/editor/FieldListFieldWithFallbacks.js +21 -27
- package/dist/editor/FloatingToolbar.d.ts +7 -0
- package/dist/editor/FloatingToolbar.js +20 -23
- package/dist/editor/ImageEditor.d.ts +5 -0
- package/dist/editor/ImageEditor.js +11 -14
- package/dist/editor/InsertMenu.d.ts +8 -0
- package/dist/editor/InsertMenu.js +37 -44
- package/dist/editor/ItemInfo.d.ts +4 -0
- package/dist/editor/ItemInfo.js +11 -14
- package/dist/editor/LinkEditorDialog.d.ts +15 -0
- package/dist/editor/LinkEditorDialog.js +27 -33
- package/dist/editor/MainLayout.d.ts +9 -0
- package/dist/editor/MainLayout.js +16 -22
- package/dist/editor/NewEditorClient.d.ts +5 -0
- package/dist/editor/NewEditorClient.js +3 -6
- package/dist/editor/PictureCropper.d.ts +6 -0
- package/dist/editor/PictureCropper.js +31 -37
- package/dist/editor/PictureEditor.d.ts +8 -0
- package/dist/editor/PictureEditor.js +15 -18
- package/dist/editor/PictureEditorDialog.d.ts +8 -0
- package/dist/editor/PictureEditorDialog.js +28 -34
- package/dist/editor/ScrollingContentTree.d.ts +6 -0
- package/dist/editor/ScrollingContentTree.js +10 -16
- package/dist/editor/Terminal.d.ts +14 -0
- package/dist/editor/Terminal.js +20 -23
- package/dist/editor/Titlebar.d.ts +1 -0
- package/dist/editor/Titlebar.js +5 -8
- package/dist/editor/ai/AiPopup.d.ts +10 -0
- package/dist/editor/ai/AiPopup.js +10 -13
- package/dist/editor/ai/AiResponseMessage.d.ts +8 -0
- package/dist/editor/ai/AiResponseMessage.js +12 -15
- package/dist/editor/ai/AiTerminal.d.ts +34 -0
- package/dist/editor/ai/AiTerminal.js +41 -47
- package/dist/editor/ai/AiToolCall.d.ts +9 -0
- package/dist/editor/ai/AiToolCall.js +8 -11
- package/dist/editor/ai/EditorAiTerminal.d.ts +5 -0
- package/dist/editor/ai/EditorAiTerminal.js +5 -8
- package/dist/editor/ai/editorAiContext.d.ts +11 -0
- package/dist/editor/ai/editorAiContext.js +1 -4
- package/dist/editor/client/DialogContext.d.ts +12 -0
- package/dist/editor/client/DialogContext.js +9 -14
- package/dist/editor/client/EditorClient.d.ts +26 -0
- package/dist/editor/client/EditorClient.js +177 -216
- package/dist/editor/client/GenericDialog.d.ts +10 -0
- package/dist/editor/client/GenericDialog.js +11 -14
- package/dist/editor/client/editContext.d.ts +199 -0
- package/dist/editor/client/editContext.js +14 -54
- package/dist/editor/client/helpers.d.ts +12 -0
- package/dist/editor/client/helpers.js +1 -4
- package/dist/editor/client/itemsRepository.d.ts +24 -0
- package/dist/editor/client/itemsRepository.js +22 -25
- package/dist/editor/client/operations.d.ts +57 -0
- package/dist/editor/client/operations.js +47 -53
- package/dist/editor/client/pageModelBuilder.d.ts +6 -0
- package/dist/editor/client/pageModelBuilder.js +10 -13
- package/dist/editor/commands/commands.d.ts +19 -0
- package/dist/editor/commands/commands.js +1 -2
- package/dist/editor/commands/componentCommands.d.ts +13 -0
- package/dist/editor/commands/componentCommands.js +7 -14
- package/dist/editor/commands/createVersionCommand.d.ts +4 -0
- package/dist/editor/commands/createVersionCommand.js +5 -8
- package/dist/editor/commands/deleteVersionCommand.d.ts +4 -0
- package/dist/editor/commands/deleteVersionCommand.js +5 -8
- package/dist/editor/commands/itemCommands.d.ts +17 -0
- package/dist/editor/commands/itemCommands.js +9 -12
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.d.ts +8 -0
- package/dist/editor/commands/localizeItem/LocalizeItemDialog.js +23 -29
- package/dist/editor/commands/undo.d.ts +15 -0
- package/dist/editor/commands/undo.js +2 -6
- package/dist/editor/component-designer/ComponentDesigner.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesigner.js +21 -24
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerAiTerminal.js +5 -8
- package/dist/editor/component-designer/ComponentDesignerMenu.d.ts +1 -0
- package/dist/editor/component-designer/ComponentDesignerMenu.js +14 -17
- package/dist/editor/component-designer/ComponentEditor.d.ts +4 -0
- package/dist/editor/component-designer/ComponentEditor.js +19 -22
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.d.ts +5 -0
- package/dist/editor/component-designer/ComponentRenderingCodeEditor.js +5 -11
- package/dist/editor/component-designer/ComponentRenderingEditor.d.ts +1 -0
- package/dist/editor/component-designer/ComponentRenderingEditor.js +18 -21
- package/dist/editor/component-designer/ComponentsDropdown.d.ts +4 -0
- package/dist/editor/component-designer/ComponentsDropdown.js +8 -11
- package/dist/editor/component-designer/PlaceholdersEditor.d.ts +4 -0
- package/dist/editor/component-designer/PlaceholdersEditor.js +17 -20
- package/dist/editor/component-designer/RenderingsDropdown.d.ts +1 -0
- package/dist/editor/component-designer/RenderingsDropdown.js +6 -9
- package/dist/editor/component-designer/TemplateEditor.d.ts +1 -0
- package/dist/editor/component-designer/TemplateEditor.js +21 -24
- package/dist/editor/component-designer/aiContext.d.ts +5 -0
- package/dist/editor/component-designer/aiContext.js +3 -6
- package/dist/editor/componentTreeHelper.d.ts +16 -0
- package/dist/editor/componentTreeHelper.js +8 -19
- package/dist/editor/control-center/ControlCenterMenu.d.ts +1 -0
- package/dist/editor/control-center/ControlCenterMenu.js +15 -18
- package/dist/editor/control-center/IndexOverview.d.ts +1 -0
- package/dist/editor/control-center/IndexOverview.js +12 -15
- package/dist/editor/control-center/IndexSettings.d.ts +5 -0
- package/dist/editor/control-center/IndexSettings.js +29 -32
- package/dist/editor/control-center/Status.d.ts +1 -0
- package/dist/editor/control-center/Status.js +3 -6
- package/dist/editor/editor-warnings/ItemLocked.d.ts +2 -0
- package/dist/editor/editor-warnings/ItemLocked.js +7 -10
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoLanguageWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWorkflowWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/NoWriteAccess.d.ts +2 -0
- package/dist/editor/editor-warnings/NoWriteAccess.js +6 -9
- package/dist/editor/editor-warnings/ValidationErrors.d.ts +2 -0
- package/dist/editor/editor-warnings/ValidationErrors.js +5 -8
- package/dist/editor/field-types/AttachmentEditor.d.ts +4 -0
- package/dist/editor/field-types/AttachmentEditor.js +3 -6
- package/dist/editor/field-types/CheckboxEditor.d.ts +5 -0
- package/dist/editor/field-types/CheckboxEditor.js +11 -14
- package/dist/editor/field-types/DropLinkEditor.d.ts +5 -0
- package/dist/editor/field-types/DropLinkEditor.js +14 -17
- package/dist/editor/field-types/DropListEditor.d.ts +5 -0
- package/dist/editor/field-types/DropListEditor.js +12 -15
- package/dist/editor/field-types/ImageFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/ImageFieldEditor.js +10 -13
- package/dist/editor/field-types/InternalLinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/InternalLinkFieldEditor.js +20 -26
- package/dist/editor/field-types/LinkFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/LinkFieldEditor.js +12 -15
- package/dist/editor/field-types/MultiLineText.d.ts +6 -0
- package/dist/editor/field-types/MultiLineText.js +11 -14
- package/dist/editor/field-types/PictureFieldEditor.d.ts +5 -0
- package/dist/editor/field-types/PictureFieldEditor.js +13 -16
- package/dist/editor/field-types/RawEditor.d.ts +5 -0
- package/dist/editor/field-types/RawEditor.js +12 -15
- package/dist/editor/field-types/ReactQuill.d.ts +125 -0
- package/dist/editor/field-types/ReactQuill.js +100 -82
- package/dist/editor/field-types/RichTextEditor.d.ts +5 -0
- package/dist/editor/field-types/RichTextEditor.js +5 -44
- package/dist/editor/field-types/RichTextEditorComponent.d.ts +6 -0
- package/dist/editor/field-types/RichTextEditorComponent.js +16 -19
- package/dist/editor/field-types/SingleLineText.d.ts +6 -0
- package/dist/editor/field-types/SingleLineText.js +13 -16
- package/dist/editor/field-types/TreeListEditor.d.ts +5 -0
- package/dist/editor/field-types/TreeListEditor.js +33 -39
- package/dist/editor/fieldTypes.d.ts +117 -0
- package/dist/editor/fieldTypes.js +1 -2
- package/dist/editor/media-selector/AiImageSearch.d.ts +4 -0
- package/dist/editor/media-selector/AiImageSearch.js +30 -36
- package/dist/editor/media-selector/AiImageSearchPrompt.d.ts +3 -0
- package/dist/editor/media-selector/AiImageSearchPrompt.js +18 -21
- package/dist/editor/media-selector/MediaSelector.d.ts +9 -0
- package/dist/editor/media-selector/MediaSelector.js +5 -9
- package/dist/editor/media-selector/Preview.d.ts +4 -0
- package/dist/editor/media-selector/Preview.js +3 -6
- package/dist/editor/media-selector/Thumbnails.d.ts +13 -0
- package/dist/editor/media-selector/Thumbnails.js +5 -8
- package/dist/editor/media-selector/TreeSelector.d.ts +7 -0
- package/dist/editor/media-selector/TreeSelector.js +39 -46
- package/dist/editor/media-selector/UploadZone.d.ts +4 -0
- package/dist/editor/media-selector/UploadZone.js +17 -20
- package/dist/editor/menubar/ActionsMenu.d.ts +1 -0
- package/dist/editor/menubar/ActionsMenu.js +10 -13
- package/dist/editor/menubar/ActiveUsers.d.ts +1 -0
- package/dist/editor/menubar/ActiveUsers.js +7 -10
- package/dist/editor/menubar/ApproveAndPublish.d.ts +1 -0
- package/dist/editor/menubar/ApproveAndPublish.js +5 -8
- package/dist/editor/menubar/BrowseHistory.d.ts +6 -0
- package/dist/editor/menubar/BrowseHistory.js +6 -9
- package/dist/editor/menubar/ItemLanguageVersion.d.ts +1 -0
- package/dist/editor/menubar/ItemLanguageVersion.js +16 -19
- package/dist/editor/menubar/LanguageSelector.d.ts +9 -0
- package/dist/editor/menubar/LanguageSelector.js +12 -15
- package/dist/editor/menubar/Menu.d.ts +1 -0
- package/dist/editor/menubar/Menu.js +12 -15
- package/dist/editor/menubar/NavButtons.d.ts +1 -0
- package/dist/editor/menubar/NavButtons.js +8 -11
- package/dist/editor/menubar/PageSelector.d.ts +4 -0
- package/dist/editor/menubar/PageSelector.js +16 -19
- package/dist/editor/menubar/PageViewerControls.d.ts +1 -0
- package/dist/editor/menubar/PageViewerControls.js +13 -16
- package/dist/editor/menubar/Separator.d.ts +3 -0
- package/dist/editor/menubar/Separator.js +4 -7
- package/dist/editor/menubar/SiteInfo.d.ts +1 -0
- package/dist/editor/menubar/SiteInfo.js +13 -16
- package/dist/editor/menubar/User.d.ts +4 -0
- package/dist/editor/menubar/User.js +5 -8
- package/dist/editor/menubar/VersionSelector.d.ts +9 -0
- package/dist/editor/menubar/VersionSelector.js +18 -21
- package/dist/editor/page-editor-chrome/CommentHighlighting.d.ts +6 -0
- package/dist/editor/page-editor-chrome/CommentHighlighting.js +16 -19
- package/dist/editor/page-editor-chrome/CommentHighlightings.d.ts +4 -0
- package/dist/editor/page-editor-chrome/CommentHighlightings.js +10 -13
- package/dist/editor/page-editor-chrome/FieldActionIndicator.d.ts +4 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicator.js +6 -9
- package/dist/editor/page-editor-chrome/FieldActionIndicators.d.ts +1 -0
- package/dist/editor/page-editor-chrome/FieldActionIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.d.ts +8 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicator.js +7 -10
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.d.ts +6 -0
- package/dist/editor/page-editor-chrome/FieldEditedIndicators.js +7 -10
- package/dist/editor/page-editor-chrome/FrameMenu.d.ts +7 -0
- package/dist/editor/page-editor-chrome/FrameMenu.js +18 -21
- package/dist/editor/page-editor-chrome/FrameMenus.d.ts +5 -0
- package/dist/editor/page-editor-chrome/FrameMenus.js +11 -14
- package/dist/editor/page-editor-chrome/InlineEditor.d.ts +5 -0
- package/dist/editor/page-editor-chrome/InlineEditor.js +13 -16
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.d.ts +1 -0
- package/dist/editor/page-editor-chrome/LockedFieldIndicator.js +9 -12
- package/dist/editor/page-editor-chrome/NoLayout.d.ts +1 -0
- package/dist/editor/page-editor-chrome/NoLayout.js +8 -11
- package/dist/editor/page-editor-chrome/PageEditorChrome.d.ts +6 -0
- package/dist/editor/page-editor-chrome/PageEditorChrome.js +16 -19
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.d.ts +1 -0
- package/dist/editor/page-editor-chrome/PictureEditorOverlay.js +18 -21
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.d.ts +14 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZone.js +15 -18
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.d.ts +5 -0
- package/dist/editor/page-editor-chrome/PlaceholderDropZones.js +13 -16
- package/dist/editor/page-viewer/DeviceToolbar.d.ts +6 -0
- package/dist/editor/page-viewer/DeviceToolbar.js +11 -14
- package/dist/editor/page-viewer/EditorForm.d.ts +5 -0
- package/dist/editor/page-viewer/EditorForm.js +22 -25
- package/dist/editor/page-viewer/MiniMap.d.ts +9 -0
- package/dist/editor/page-viewer/MiniMap.js +27 -63
- package/dist/editor/page-viewer/PageViewer.d.ts +8 -0
- package/dist/editor/page-viewer/PageViewer.js +21 -24
- package/dist/editor/page-viewer/PageViewerFrame.d.ts +11 -0
- package/dist/editor/page-viewer/PageViewerFrame.js +62 -69
- package/dist/editor/page-viewer/pageViewContext.d.ts +38 -0
- package/dist/editor/page-viewer/pageViewContext.js +26 -29
- package/dist/editor/pageModel.d.ts +171 -0
- package/dist/editor/pageModel.js +1 -2
- package/dist/editor/picture-shared.d.ts +16 -0
- package/dist/editor/picture-shared.js +2 -6
- package/dist/editor/reviews/Comment.d.ts +4 -0
- package/dist/editor/reviews/Comment.js +32 -35
- package/dist/editor/reviews/Comments.d.ts +1 -0
- package/dist/editor/reviews/Comments.js +14 -17
- package/dist/editor/reviews/PreviewInfo.d.ts +1 -0
- package/dist/editor/reviews/PreviewInfo.js +6 -9
- package/dist/editor/reviews/Reviews.d.ts +1 -0
- package/dist/editor/reviews/Reviews.js +36 -42
- package/dist/editor/reviews/reviewCommands.d.ts +3 -0
- package/dist/editor/reviews/reviewCommands.js +8 -11
- package/dist/editor/reviews/useReviews.d.ts +12 -0
- package/dist/editor/reviews/useReviews.js +11 -17
- package/dist/editor/services/aiService.d.ts +34 -0
- package/dist/editor/services/aiService.js +5 -10
- package/dist/editor/services/componentDesignerService.d.ts +46 -0
- package/dist/editor/services/componentDesignerService.js +14 -22
- package/dist/editor/services/contentService.d.ts +34 -0
- package/dist/editor/services/contentService.js +18 -31
- package/dist/editor/services/editService.d.ts +34 -0
- package/dist/editor/services/editService.js +48 -77
- package/dist/editor/services/indexService.d.ts +6 -0
- package/dist/editor/services/indexService.js +11 -18
- package/dist/editor/services/reviewsService.d.ts +12 -0
- package/dist/editor/services/reviewsService.js +30 -42
- package/dist/editor/services/serviceHelper.d.ts +9 -0
- package/dist/editor/services/serviceHelper.js +2 -6
- package/dist/editor/services/systemService.d.ts +2 -0
- package/dist/editor/services/systemService.js +3 -6
- package/dist/editor/services/translationService.d.ts +11 -0
- package/dist/editor/services/translationService.js +7 -12
- package/dist/editor/services-server/api.d.ts +19 -0
- package/dist/editor/services-server/api.js +10 -19
- package/dist/editor/services-server/graphQL.d.ts +29 -0
- package/dist/editor/services-server/graphQL.js +5 -9
- package/dist/editor/sidebar/ComponentPalette.d.ts +1 -0
- package/dist/editor/sidebar/ComponentPalette.js +19 -22
- package/dist/editor/sidebar/ComponentTree.d.ts +1 -0
- package/dist/editor/sidebar/ComponentTree.js +26 -29
- package/dist/editor/sidebar/Debug.d.ts +1 -0
- package/dist/editor/sidebar/Debug.js +20 -23
- package/dist/editor/sidebar/DictionaryEditor.d.ts +1 -0
- package/dist/editor/sidebar/DictionaryEditor.js +45 -48
- package/dist/editor/sidebar/EditHistory.d.ts +1 -0
- package/dist/editor/sidebar/EditHistory.js +22 -25
- package/dist/editor/sidebar/GraphQL.d.ts +1 -0
- package/dist/editor/sidebar/GraphQL.js +17 -20
- package/dist/editor/sidebar/Insert.d.ts +1 -0
- package/dist/editor/sidebar/Insert.js +10 -13
- package/dist/editor/sidebar/MainContentTree.d.ts +4 -0
- package/dist/editor/sidebar/MainContentTree.js +16 -22
- package/dist/editor/sidebar/Performance.d.ts +1 -0
- package/dist/editor/sidebar/Performance.js +7 -10
- package/dist/editor/sidebar/Sessions.d.ts +1 -0
- package/dist/editor/sidebar/Sessions.js +7 -10
- package/dist/editor/sidebar/Sidebar.d.ts +1 -0
- package/dist/editor/sidebar/Sidebar.js +6 -9
- package/dist/editor/sidebar/SidebarView.d.ts +8 -0
- package/dist/editor/sidebar/SidebarView.js +18 -21
- package/dist/editor/sidebar/Translations.d.ts +1 -0
- package/dist/editor/sidebar/Translations.js +31 -34
- package/dist/editor/sidebar/Validation.d.ts +1 -0
- package/dist/editor/sidebar/Validation.js +11 -14
- package/dist/editor/sidebar/ViewSelector.d.ts +1 -0
- package/dist/editor/sidebar/ViewSelector.js +8 -11
- package/dist/editor/sidebar/Workbox.d.ts +1 -0
- package/dist/editor/sidebar/Workbox.js +20 -23
- package/dist/editor/ui/CenteredMessage.d.ts +3 -0
- package/dist/editor/ui/CenteredMessage.js +3 -6
- package/dist/editor/ui/CopyToClipboardButton.d.ts +3 -0
- package/dist/editor/ui/CopyToClipboardButton.js +5 -8
- package/dist/editor/ui/DialogButtons.d.ts +3 -0
- package/dist/editor/ui/DialogButtons.js +3 -6
- package/dist/editor/ui/Icons.d.ts +38 -0
- package/dist/editor/ui/Icons.js +54 -74
- package/dist/editor/ui/ItemNameDialog.d.ts +11 -0
- package/dist/editor/ui/ItemNameDialog.js +16 -22
- package/dist/editor/ui/ItemNameDialogNew.d.ts +10 -0
- package/dist/editor/ui/ItemNameDialogNew.js +22 -28
- package/dist/editor/ui/ItemSearch.d.ts +23 -0
- package/dist/editor/ui/ItemSearch.js +24 -28
- package/dist/editor/ui/PerfectTree.d.ts +60 -0
- package/dist/editor/ui/PerfectTree.js +39 -76
- package/dist/editor/ui/Section.d.ts +4 -0
- package/dist/editor/ui/Section.js +7 -10
- package/dist/editor/ui/SimpleIconButton.d.ts +11 -0
- package/dist/editor/ui/SimpleIconButton.js +4 -7
- package/dist/editor/ui/SimpleMenu.d.ts +13 -0
- package/dist/editor/ui/SimpleMenu.js +4 -7
- package/dist/editor/ui/SimpleTable.d.ts +14 -0
- package/dist/editor/ui/SimpleTable.js +5 -8
- package/dist/editor/ui/SimpleTabs.d.ts +12 -0
- package/dist/editor/ui/SimpleTabs.js +4 -7
- package/dist/editor/ui/SimpleToolbar.d.ts +3 -0
- package/dist/editor/ui/SimpleToolbar.js +3 -6
- package/dist/editor/ui/Spinner.d.ts +3 -0
- package/dist/editor/ui/Spinner.js +3 -6
- package/dist/editor/ui/Splitter.d.ts +15 -0
- package/dist/editor/ui/Splitter.js +16 -53
- package/dist/editor/ui/StackedPanels.d.ts +5 -0
- package/dist/editor/ui/StackedPanels.js +18 -21
- package/dist/editor/ui/Toolbar.d.ts +3 -0
- package/dist/editor/ui/Toolbar.js +3 -6
- package/dist/editor/utils/id-helper.d.ts +1 -0
- package/dist/editor/utils/id-helper.js +1 -4
- package/dist/editor/utils/insertOptions.d.ts +3 -0
- package/dist/editor/utils/insertOptions.js +3 -6
- package/dist/editor/utils/itemutils.d.ts +3 -0
- package/dist/editor/utils/itemutils.js +3 -7
- package/dist/editor/utils/useMemoDebug.d.ts +1 -0
- package/dist/editor/utils/useMemoDebug.js +4 -7
- package/dist/editor/utils.d.ts +44 -0
- package/dist/editor/utils.js +27 -48
- package/dist/editor/views/CompareView.d.ts +1 -0
- package/dist/editor/views/CompareView.js +31 -34
- package/dist/editor/views/EditView.d.ts +1 -0
- package/dist/editor/views/EditView.js +9 -12
- package/dist/editor/views/ItemEditor.d.ts +7 -0
- package/dist/editor/views/ItemEditor.js +9 -12
- package/dist/editor/views/SingleEditView.d.ts +8 -0
- package/dist/editor/views/SingleEditView.js +12 -15
- package/dist/index.d.ts +4 -0
- package/dist/index.js +3 -22
- package/dist/page-wizard/PageWizard.d.ts +70 -0
- package/dist/page-wizard/PageWizard.js +16 -19
- package/dist/page-wizard/SelectWizard.d.ts +7 -0
- package/dist/page-wizard/SelectWizard.js +16 -19
- package/dist/page-wizard/WizardSteps.d.ts +8 -0
- package/dist/page-wizard/WizardSteps.js +20 -23
- package/dist/page-wizard/service.d.ts +15 -0
- package/dist/page-wizard/service.js +6 -11
- package/dist/page-wizard/startPageWizardCommand.d.ts +13 -0
- package/dist/page-wizard/startPageWizardCommand.js +1 -4
- package/dist/page-wizard/steps/BuildPageStep.d.ts +2 -0
- package/dist/page-wizard/steps/BuildPageStep.js +27 -33
- package/dist/page-wizard/steps/CollectStep.d.ts +2 -0
- package/dist/page-wizard/steps/CollectStep.js +21 -27
- package/dist/page-wizard/steps/ComponentTypesSelector.d.ts +11 -0
- package/dist/page-wizard/steps/ComponentTypesSelector.js +21 -24
- package/dist/page-wizard/steps/Components.d.ts +9 -0
- package/dist/page-wizard/steps/Components.js +16 -22
- package/dist/page-wizard/steps/CreatePage.d.ts +12 -0
- package/dist/page-wizard/steps/CreatePage.js +25 -28
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/CreatePageAndLayoutStep.js +38 -41
- package/dist/page-wizard/steps/EditButton.d.ts +8 -0
- package/dist/page-wizard/steps/EditButton.js +3 -6
- package/dist/page-wizard/steps/FieldEditor.d.ts +5 -0
- package/dist/page-wizard/steps/FieldEditor.js +9 -12
- package/dist/page-wizard/steps/Generate.d.ts +5 -0
- package/dist/page-wizard/steps/Generate.js +6 -8
- package/dist/page-wizard/steps/ImagesStep.d.ts +2 -0
- package/dist/page-wizard/steps/ImagesStep.js +32 -36
- package/dist/page-wizard/steps/LayoutStep.d.ts +2 -0
- package/dist/page-wizard/steps/LayoutStep.js +27 -30
- package/dist/page-wizard/steps/SelectStep.d.ts +2 -0
- package/dist/page-wizard/steps/SelectStep.js +29 -35
- package/dist/page-wizard/steps/schema.d.ts +13 -0
- package/dist/page-wizard/steps/schema.js +2 -6
- package/dist/page-wizard/steps/usePageCreator.d.ts +6 -0
- package/dist/page-wizard/steps/usePageCreator.js +13 -16
- package/dist/splash-screen/NewPage.d.ts +3 -0
- package/dist/splash-screen/NewPage.js +39 -42
- package/dist/splash-screen/SectionHeadline.d.ts +4 -0
- package/dist/splash-screen/SectionHeadline.js +5 -8
- package/dist/splash-screen/SplashScreen.d.ts +1 -0
- package/dist/splash-screen/SplashScreen.js +23 -26
- package/dist/tour/Tour.d.ts +3 -0
- package/dist/tour/Tour.js +17 -20
- package/dist/tour/default-tour.d.ts +9 -0
- package/dist/tour/default-tour.js +10 -13
- package/dist/tour/preview-tour.d.ts +2 -0
- package/dist/tour/preview-tour.js +12 -15
- package/dist/types.d.ts +259 -0
- package/dist/types.js +1 -2
- package/package.json +1 -1
- package/tsconfig.build.json +16 -12
- package/dist/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,46 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.PerfectTree = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const react_1 = __importStar(require("react"));
|
|
39
|
-
const progressspinner_1 = require("primereact/progressspinner");
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React, { useEffect, useMemo, useCallback, memo } from "react";
|
|
3
|
+
import { ProgressSpinner } from "primereact/progressspinner";
|
|
40
4
|
// Local DropZone component to handle drag-over state.
|
|
41
|
-
const DropZone =
|
|
42
|
-
const [isDragOver, setIsDragOver] =
|
|
43
|
-
const handleDragEnter =
|
|
5
|
+
const DropZone = memo(({ parent, index, isDragging, onDragOverZone, onDrop, onDragEnd, isLast, }) => {
|
|
6
|
+
const [isDragOver, setIsDragOver] = React.useState(false);
|
|
7
|
+
const handleDragEnter = useCallback((e) => {
|
|
44
8
|
e.preventDefault();
|
|
45
9
|
e.stopPropagation();
|
|
46
10
|
if (onDragOverZone) {
|
|
@@ -49,12 +13,12 @@ const DropZone = (0, react_1.memo)(({ parent, index, isDragging, onDragOverZone,
|
|
|
49
13
|
e.dataTransfer.dropEffect = allowed ? "move" : "none";
|
|
50
14
|
}
|
|
51
15
|
}, [onDragOverZone, parent, index]);
|
|
52
|
-
const handleDragLeave =
|
|
16
|
+
const handleDragLeave = useCallback((e) => {
|
|
53
17
|
e.preventDefault();
|
|
54
18
|
e.stopPropagation();
|
|
55
19
|
setIsDragOver(false);
|
|
56
20
|
}, []);
|
|
57
|
-
const handleDragOver =
|
|
21
|
+
const handleDragOver = useCallback((e) => {
|
|
58
22
|
e.preventDefault();
|
|
59
23
|
e.stopPropagation();
|
|
60
24
|
if (onDragOverZone) {
|
|
@@ -62,7 +26,7 @@ const DropZone = (0, react_1.memo)(({ parent, index, isDragging, onDragOverZone,
|
|
|
62
26
|
setIsDragOver(allowed);
|
|
63
27
|
}
|
|
64
28
|
}, [onDragOverZone, parent, index]);
|
|
65
|
-
const handleDrop =
|
|
29
|
+
const handleDrop = useCallback((e) => {
|
|
66
30
|
e.preventDefault();
|
|
67
31
|
e.stopPropagation();
|
|
68
32
|
setIsDragOver(false);
|
|
@@ -72,17 +36,17 @@ const DropZone = (0, react_1.memo)(({ parent, index, isDragging, onDragOverZone,
|
|
|
72
36
|
}, [onDrop, parent, index]);
|
|
73
37
|
if (!isDragging)
|
|
74
38
|
return null;
|
|
75
|
-
return ((
|
|
39
|
+
return (_jsx("div", { className: `relative ${isLast ? "h-3" : ""}`, children: _jsx("div", { className: `drop-zone absolute top-[-5px] right-0 left-[45px] z-1000 h-3 rounded-md transition-colors duration-100 ${isDragOver ? "bg-sky-200" : ""}`, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDrop: handleDrop, onDragLeave: handleDragLeave }) }));
|
|
76
40
|
});
|
|
77
41
|
// NodeContent component extracted and memoized
|
|
78
|
-
const NodeContent =
|
|
79
|
-
const [isDragOver, setIsDragOver] =
|
|
80
|
-
|
|
42
|
+
const NodeContent = memo(({ node, isExpanded, isSelected, onSelect, onToggleNode, onStartDrag, onDragEnd, onDragOverZone, onDrop, onDoubleClick, renderNode, onContextMenu, enableDragAndDrop = false, selectedKeys, isDragging, }) => {
|
|
43
|
+
const [isDragOver, setIsDragOver] = React.useState(false);
|
|
44
|
+
useEffect(() => {
|
|
81
45
|
if (!isDragging) {
|
|
82
46
|
setIsDragOver(false);
|
|
83
47
|
}
|
|
84
48
|
}, [isDragging]);
|
|
85
|
-
const handleDragStart =
|
|
49
|
+
const handleDragStart = useCallback((event) => {
|
|
86
50
|
const isMultiSelect = isSelected && selectedKeys && selectedKeys.length > 1;
|
|
87
51
|
// Set drag preview for multiple items if applicable
|
|
88
52
|
if (isMultiSelect) {
|
|
@@ -104,18 +68,18 @@ const NodeContent = (0, react_1.memo)(({ node, isExpanded, isSelected, onSelect,
|
|
|
104
68
|
onStartDrag({ node, event, isMultiSelect: isMultiSelect ?? false });
|
|
105
69
|
}
|
|
106
70
|
}, [node, onStartDrag]);
|
|
107
|
-
const handleDragLeave =
|
|
71
|
+
const handleDragLeave = useCallback((event) => {
|
|
108
72
|
event.preventDefault();
|
|
109
73
|
setIsDragOver(false);
|
|
110
74
|
}, []);
|
|
111
|
-
const handleDragEnter =
|
|
75
|
+
const handleDragEnter = useCallback((event) => {
|
|
112
76
|
event.preventDefault();
|
|
113
77
|
if (onDragOverZone) {
|
|
114
78
|
const allowed = onDragOverZone(node, -1, event);
|
|
115
79
|
setIsDragOver(allowed);
|
|
116
80
|
}
|
|
117
81
|
}, [node, onDragOverZone]);
|
|
118
|
-
const handleDragOver =
|
|
82
|
+
const handleDragOver = useCallback((event) => {
|
|
119
83
|
event.preventDefault();
|
|
120
84
|
if (onDragOverZone) {
|
|
121
85
|
const allowed = onDragOverZone(node, -1, event);
|
|
@@ -123,41 +87,41 @@ const NodeContent = (0, react_1.memo)(({ node, isExpanded, isSelected, onSelect,
|
|
|
123
87
|
event.dataTransfer.dropEffect = allowed ? "move" : "none";
|
|
124
88
|
}
|
|
125
89
|
}, [node, onDragOverZone]);
|
|
126
|
-
const handleDrop =
|
|
90
|
+
const handleDrop = useCallback((e) => {
|
|
127
91
|
e.preventDefault();
|
|
128
92
|
e.stopPropagation();
|
|
129
93
|
if (onDrop) {
|
|
130
94
|
onDrop(node, -1, e);
|
|
131
95
|
}
|
|
132
96
|
}, [node, onDrop]);
|
|
133
|
-
const handleDoubleClick =
|
|
97
|
+
const handleDoubleClick = useCallback((e) => {
|
|
134
98
|
e.stopPropagation();
|
|
135
99
|
onDoubleClick?.(node);
|
|
136
100
|
}, [node, onDoubleClick]);
|
|
137
|
-
const handleSelect =
|
|
101
|
+
const handleSelect = useCallback((e) => {
|
|
138
102
|
e.stopPropagation();
|
|
139
103
|
onSelect(node.key, e);
|
|
140
104
|
}, [node.key, onSelect]);
|
|
141
|
-
const handleToggle =
|
|
105
|
+
const handleToggle = useCallback((e) => {
|
|
142
106
|
e.stopPropagation();
|
|
143
107
|
onToggleNode(node);
|
|
144
108
|
}, [node, onToggleNode]);
|
|
145
109
|
const renderToggle = () => {
|
|
146
110
|
if (node.hasChildren && node.children === null) {
|
|
147
|
-
return ((
|
|
111
|
+
return (_jsx(ProgressSpinner, { style: { width: "18px", height: "18px", margin: "0 2px" }, className: "text-gray-500" }));
|
|
148
112
|
}
|
|
149
|
-
return ((
|
|
113
|
+
return (_jsx("span", { onClick: handleToggle, className: `mr-2 inline-block transform cursor-pointer transition duration-150 select-none ${isExpanded ? "rotate-90" : "rotate-0"}`, children: _jsx("svg", { width: "14", height: "14", viewBox: "0 0 14 14", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", "data-pc-section": "togglericon", children: _jsx("path", { d: "M4.38708 13C4.28408 13.0005 4.18203 12.9804 4.08691 12.9409C3.99178 12.9014 3.9055 12.8433 3.83313 12.7701C3.68634 12.6231 3.60388 12.4238 3.60388 12.2161C3.60388 12.0084 3.68634 11.8091 3.83313 11.6622L8.50507 6.99022L3.83313 2.31827C3.69467 2.16968 3.61928 1.97313 3.62287 1.77005C3.62645 1.56698 3.70872 1.37322 3.85234 1.22959C3.99596 1.08597 4.18972 1.00371 4.3928 1.00012C4.59588 0.996539 4.79242 1.07192 4.94102 1.21039L10.1669 6.43628C10.3137 6.58325 10.3962 6.78249 10.3962 6.99022C10.3962 7.19795 10.3137 7.39718 10.1669 7.54416L4.94102 12.7701C4.86865 12.8433 4.78237 12.9014 4.68724 12.9409C4.59212 12.9804 4.49007 13.0005 4.38708 13Z", fill: "currentColor" }) }) }));
|
|
150
114
|
};
|
|
151
|
-
const handleContextMenu =
|
|
115
|
+
const handleContextMenu = useCallback((e) => {
|
|
152
116
|
e.stopPropagation();
|
|
153
117
|
e.preventDefault();
|
|
154
118
|
onContextMenu?.(node, e);
|
|
155
119
|
}, [node, onContextMenu]);
|
|
156
|
-
return ((
|
|
120
|
+
return (_jsxs("div", { className: "tree-node mb-0.5 flex cursor-pointer items-center", draggable: enableDragAndDrop, onClick: handleSelect, onDragStart: (event) => handleDragStart(event), onDragEnd: onDragEnd, onDragLeave: handleDragLeave, onDragEnter: handleDragEnter, onDragOver: handleDragOver, onDrop: handleDrop, onDoubleClick: handleDoubleClick, onContextMenu: handleContextMenu, children: [node.hasChildren || node.children?.length ? (renderToggle()) : (_jsx("div", { className: "w-6" })), _jsx("div", { className: `rounded-md border border-transparent p-0.5 hover:border-gray-300 ${isDragOver ? "bg-sky-200" : isSelected ? "bg-blue-100" : ""}`, onClick: handleSelect, children: renderNode(node) })] }));
|
|
157
121
|
});
|
|
158
|
-
const PerfectTree = ({ nodes, selectedKeys = [], expandedKeys = [], renderNode, onToggleExpand, onSelect, onDragOverZone, onDrop, isDragging = false, onStartDrag, onDragEnd, onLazyLoad, onDoubleClick, onContextMenu, enableDragAndDrop = false, }) => {
|
|
122
|
+
export const PerfectTree = ({ nodes, selectedKeys = [], expandedKeys = [], renderNode, onToggleExpand, onSelect, onDragOverZone, onDrop, isDragging = false, onStartDrag, onDragEnd, onLazyLoad, onDoubleClick, onContextMenu, enableDragAndDrop = false, }) => {
|
|
159
123
|
// When toggling a node, notify parent and trigger external lazy load if needed.
|
|
160
|
-
const handleToggle =
|
|
124
|
+
const handleToggle = useCallback((node) => {
|
|
161
125
|
if (onToggleExpand) {
|
|
162
126
|
onToggleExpand(node.key);
|
|
163
127
|
}
|
|
@@ -167,14 +131,14 @@ const PerfectTree = ({ nodes, selectedKeys = [], expandedKeys = [], renderNode,
|
|
|
167
131
|
onLazyLoad(node);
|
|
168
132
|
}
|
|
169
133
|
}, [onToggleExpand, onLazyLoad]);
|
|
170
|
-
const handleSelect =
|
|
134
|
+
const handleSelect = useCallback((nodeKey, event) => {
|
|
171
135
|
if (onSelect) {
|
|
172
136
|
onSelect(nodeKey, event);
|
|
173
137
|
}
|
|
174
138
|
}, [onSelect]);
|
|
175
139
|
// Global drag end handler.
|
|
176
|
-
const isDraggingRef =
|
|
177
|
-
|
|
140
|
+
const isDraggingRef = React.useRef(false);
|
|
141
|
+
useEffect(() => {
|
|
178
142
|
const handleGlobalDragEnd = (event) => {
|
|
179
143
|
if (isDraggingRef.current && onDragEnd) {
|
|
180
144
|
onDragEnd(event);
|
|
@@ -186,22 +150,22 @@ const PerfectTree = ({ nodes, selectedKeys = [], expandedKeys = [], renderNode,
|
|
|
186
150
|
document.removeEventListener("dragend", handleGlobalDragEnd);
|
|
187
151
|
};
|
|
188
152
|
}, [onDragEnd]);
|
|
189
|
-
const handleDragEnd =
|
|
153
|
+
const handleDragEnd = useCallback((event) => {
|
|
190
154
|
isDraggingRef.current = false;
|
|
191
155
|
if (onDragEnd) {
|
|
192
156
|
onDragEnd(event);
|
|
193
157
|
}
|
|
194
158
|
}, [onDragEnd]);
|
|
195
159
|
// Recursive function to render tree nodes along with drop zones.
|
|
196
|
-
const renderTreeList =
|
|
197
|
-
return ((
|
|
160
|
+
const renderTreeList = useCallback((nodes, depth, parent = null) => {
|
|
161
|
+
return (_jsxs("div", { className: "flex flex-col", children: [nodes.map((node, index) => {
|
|
198
162
|
const children = node.children;
|
|
199
163
|
const isExpanded = expandedKeys.includes(node.key);
|
|
200
164
|
const isSelected = selectedKeys.includes(node.key);
|
|
201
|
-
return ((
|
|
165
|
+
return (_jsxs(React.Fragment, { children: [_jsx(DropZone, { parent: parent, index: index, isDragging: isDragging, onDragOverZone: onDragOverZone, onDrop: onDrop, onDragEnd: onDragEnd }), _jsxs("div", { style: {
|
|
202
166
|
marginLeft: depth > 0 ? "21px" : undefined,
|
|
203
|
-
}, className: "flex flex-col", children: [(
|
|
204
|
-
}), (
|
|
167
|
+
}, className: "flex flex-col", children: [_jsx(NodeContent, { node: node, isExpanded: isExpanded, isSelected: isSelected, onSelect: handleSelect, onToggleNode: handleToggle, onStartDrag: onStartDrag, onDragEnd: handleDragEnd, onDragOverZone: onDragOverZone, onDrop: onDrop, onDoubleClick: onDoubleClick, onContextMenu: onContextMenu, renderNode: renderNode, enableDragAndDrop: enableDragAndDrop, selectedKeys: selectedKeys, isDragging: isDragging }), isExpanded && (_jsx(_Fragment, { children: children && children.length > 0 ? (_jsx("div", { children: renderTreeList(children, depth + 1, node) })) : null }))] })] }, node.key));
|
|
168
|
+
}), _jsx(DropZone, { parent: parent, index: nodes.length, isDragging: isDragging, onDragOverZone: onDragOverZone, onDrop: onDrop, onDragEnd: onDragEnd, isLast: true })] }));
|
|
205
169
|
}, [
|
|
206
170
|
expandedKeys,
|
|
207
171
|
selectedKeys,
|
|
@@ -216,8 +180,7 @@ const PerfectTree = ({ nodes, selectedKeys = [], expandedKeys = [], renderNode,
|
|
|
216
180
|
renderNode,
|
|
217
181
|
]);
|
|
218
182
|
// Memoize the tree structure
|
|
219
|
-
const treeContent =
|
|
220
|
-
return (
|
|
183
|
+
const treeContent = useMemo(() => renderTreeList(nodes, 0), [nodes, renderTreeList]);
|
|
184
|
+
return _jsx("div", { children: treeContent });
|
|
221
185
|
};
|
|
222
|
-
|
|
223
|
-
exports.default = (0, react_1.memo)(exports.PerfectTree);
|
|
186
|
+
export default memo(PerfectTree);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
function Section({ title, children, }) {
|
|
8
|
-
const [open, setOpen] = (0, utils_2.useLocalStorage)("editor.showSection-" + title, true);
|
|
9
|
-
return ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsxs)("div", { className: (0, utils_1.classNames)(open
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "primereact/utils";
|
|
3
|
+
import { useLocalStorage } from "../utils";
|
|
4
|
+
export function Section({ title, children, }) {
|
|
5
|
+
const [open, setOpen] = useLocalStorage("editor.showSection-" + title, true);
|
|
6
|
+
return (_jsxs("div", { children: [_jsxs("div", { className: classNames(open
|
|
10
7
|
? "border-blue-500 bg-gray-600"
|
|
11
|
-
: "border-gray-400 bg-gray-400 hover:bg-gray-500 hover:border-gray-300", "py-2.5 px-3 border-l-[8px] text-white text-xs cursor-pointer flex justify-between items-center"), onClick: () => setOpen(!open), children: [title, (
|
|
8
|
+
: "border-gray-400 bg-gray-400 hover:bg-gray-500 hover:border-gray-300", "py-2.5 px-3 border-l-[8px] text-white text-xs cursor-pointer flex justify-between items-center"), onClick: () => setOpen(!open), children: [title, _jsx("i", { className: classNames(open ? "pi-chevron-up" : "pi-chevron-down", "pi cursor-pointer text-xs") })] }), open && _jsx("div", { className: "pt-4 pb-6 px-2 bg-gray-50", children: children })] }));
|
|
12
9
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { MouseEventHandler } from "react";
|
|
2
|
+
export declare function SimpleIconButton({ onClick, className, icon, label, disabled, size, id, selected, }: {
|
|
3
|
+
onClick: MouseEventHandler;
|
|
4
|
+
className?: string;
|
|
5
|
+
icon?: React.ReactNode;
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
size?: "large" | "small";
|
|
10
|
+
selected?: boolean;
|
|
11
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("primereact/utils");
|
|
6
|
-
function SimpleIconButton({ onClick, className, icon, label, disabled, size, id, selected, }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)("button", { id: id, disabled: disabled, className: (0, utils_1.classNames)(typeof icon === "string" ? icon + " p-[6px]" : "p-[4px]", " rounded-full", disabled ? "text-gray-300" : " hover:bg-gray-200 cursor-pointer", className, size === "large" ? "text-lg" : "text-xs", selected ? "bg-gray-200" : ""), onClick: (ev) => {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "primereact/utils";
|
|
3
|
+
export function SimpleIconButton({ onClick, className, icon, label, disabled, size, id, selected, }) {
|
|
4
|
+
return (_jsx("button", { id: id, disabled: disabled, className: classNames(typeof icon === "string" ? icon + " p-[6px]" : "p-[4px]", " rounded-full", disabled ? "text-gray-300" : " hover:bg-gray-200 cursor-pointer", className, size === "large" ? "text-lg" : "text-xs", selected ? "bg-gray-200" : ""), onClick: (ev) => {
|
|
8
5
|
if (!disabled)
|
|
9
6
|
onClick(ev);
|
|
10
7
|
}, title: label, children: typeof icon !== "string" && icon }));
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export type MenuItem = {
|
|
3
|
+
key: string;
|
|
4
|
+
label: string;
|
|
5
|
+
items?: MenuItem[];
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
command?: () => void;
|
|
8
|
+
};
|
|
9
|
+
export declare function SimpleMenu({ items, activeItemKey, onItemClick, }: {
|
|
10
|
+
items: MenuItem[];
|
|
11
|
+
activeItemKey: string | null;
|
|
12
|
+
onItemClick: (item: MenuItem) => void;
|
|
13
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function SimpleMenu({ items, activeItemKey, onItemClick, }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col p-1 h-full", children: items.map((item, index) => ((0, jsx_runtime_1.jsxs)("div", { className: "p-2 h-full flex flex-col gap-1", children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row items-center gap-2 border-b border-gray-200 pb-1 pl-2", children: [item.icon && item.icon, item.label] }), item.items?.map((subItem, subIndex) => ((0, jsx_runtime_1.jsx)("div", { className: `flex flex-col px-4 p-1 cursor-pointer hover:bg-gray-100 ${activeItemKey === subItem.key ? "bg-gray-100" : ""}`, onClick: () => {
|
|
1
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function SimpleMenu({ items, activeItemKey, onItemClick, }) {
|
|
3
|
+
return (_jsx("div", { className: "flex flex-col p-1 h-full", children: items.map((item, index) => (_jsxs("div", { className: "p-2 h-full flex flex-col gap-1", children: [_jsxs("div", { className: "flex flex-row items-center gap-2 border-b border-gray-200 pb-1 pl-2", children: [item.icon && item.icon, item.label] }), item.items?.map((subItem, subIndex) => (_jsx("div", { className: `flex flex-col px-4 p-1 cursor-pointer hover:bg-gray-100 ${activeItemKey === subItem.key ? "bg-gray-100" : ""}`, onClick: () => {
|
|
7
4
|
onItemClick(subItem);
|
|
8
|
-
}, children: (
|
|
5
|
+
}, children: _jsxs("div", { className: "flex flex-row items-center gap-2 text-sm", children: [subItem.icon && subItem.icon, subItem.label] }) }, subIndex)))] }, index))) }));
|
|
9
6
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare function SimpleTable<T>({ items, columns, onRowHover, onRowClick, rowClassName, }: {
|
|
2
|
+
items: T[];
|
|
3
|
+
columns: {
|
|
4
|
+
header: React.ReactNode;
|
|
5
|
+
body: (item: T) => React.ReactNode;
|
|
6
|
+
className?: string;
|
|
7
|
+
}[];
|
|
8
|
+
onRowClick?: (data: {
|
|
9
|
+
item: T;
|
|
10
|
+
event: React.MouseEvent<HTMLTableRowElement>;
|
|
11
|
+
}) => void;
|
|
12
|
+
onRowHover?: (item: T | undefined) => void;
|
|
13
|
+
rowClassName?: (item: T) => string;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const utils_1 = require("primereact/utils");
|
|
6
|
-
function SimpleTable({ items, columns, onRowHover, onRowClick, rowClassName, }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsxs)("table", { className: "table-auto min-w-full text-left text-xs font-light text-surface", children: [(0, jsx_runtime_1.jsx)("thead", { className: "border-b border-neutral-200 font-medium", children: (0, jsx_runtime_1.jsx)("tr", { children: columns.map((col, index) => ((0, jsx_runtime_1.jsx)("th", { className: "px-2 py-3", children: col.header }, index))) }) }), (0, jsx_runtime_1.jsx)("tbody", { children: items.map((item, index) => ((0, jsx_runtime_1.jsx)("tr", { className: (0, utils_1.classNames)("border-b border-neutral-200", onRowClick ? "cursor-pointer hover:bg-neutral-100" : "", rowClassName ? rowClassName(item) : ""), onClick: (ev) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from "primereact/utils";
|
|
3
|
+
export function SimpleTable({ items, columns, onRowHover, onRowClick, rowClassName, }) {
|
|
4
|
+
return (_jsxs("table", { className: "table-auto min-w-full text-left text-xs font-light text-surface", children: [_jsx("thead", { className: "border-b border-neutral-200 font-medium", children: _jsx("tr", { children: columns.map((col, index) => (_jsx("th", { className: "px-2 py-3", children: col.header }, index))) }) }), _jsx("tbody", { children: items.map((item, index) => (_jsx("tr", { className: classNames("border-b border-neutral-200", onRowClick ? "cursor-pointer hover:bg-neutral-100" : "", rowClassName ? rowClassName(item) : ""), onClick: (ev) => {
|
|
8
5
|
if (onRowClick)
|
|
9
6
|
onRowClick({ item, event: ev });
|
|
10
|
-
}, onMouseOver: () => onRowHover?.(item), onMouseLeave: () => onRowHover?.(undefined), children: columns.map((col, index) => ((
|
|
7
|
+
}, onMouseOver: () => onRowHover?.(item), onMouseLeave: () => onRowHover?.(undefined), children: columns.map((col, index) => (_jsx("td", { className: classNames("px-2 py-2", col.className), children: col.body(item) }, index))) }, index))) })] }));
|
|
11
8
|
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type Tab = {
|
|
2
|
+
label: string;
|
|
3
|
+
content: React.ReactNode;
|
|
4
|
+
id: string;
|
|
5
|
+
testId?: string;
|
|
6
|
+
};
|
|
7
|
+
export declare function SimpleTabs({ tabs, setActiveTab, activeTab, className, }: {
|
|
8
|
+
tabs: Tab[];
|
|
9
|
+
setActiveTab: (index: number) => void;
|
|
10
|
+
activeTab: number;
|
|
11
|
+
className?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const tailwind_merge_1 = require("tailwind-merge");
|
|
6
|
-
function SimpleTabs({ tabs, setActiveTab, activeTab, className, }) {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { twMerge } from "tailwind-merge";
|
|
3
|
+
export function SimpleTabs({ tabs, setActiveTab, activeTab, className, }) {
|
|
7
4
|
if (activeTab > tabs.length - 1) {
|
|
8
5
|
activeTab = 0;
|
|
9
6
|
}
|
|
@@ -12,7 +9,7 @@ function SimpleTabs({ tabs, setActiveTab, activeTab, className, }) {
|
|
|
12
9
|
}
|
|
13
10
|
if (tabs.length === 0)
|
|
14
11
|
return null;
|
|
15
|
-
return ((
|
|
12
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: twMerge("flex gap-4 pb-3", className), children: tabs.map((tab, index) => (_jsx("button", { id: tab.id, className: activeTab === index ? "active-tab" : "cursor-pointer", "data-testid": tab.testId, onClick: () => setActiveTab(index), style: {
|
|
16
13
|
fontWeight: index === activeTab ? "bold" : "normal",
|
|
17
14
|
borderBottom: index === activeTab ? "3px solid black" : "none",
|
|
18
15
|
marginBottom: index === activeTab ? "0" : "3px",
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function SimpleToolbar({ children }) {
|
|
6
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: "flex gap-2 p-2 items-center bg-gray-50 rounded-md border-b border-gray-200 text-gray-500 text-sm", children: children }));
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function SimpleToolbar({ children }) {
|
|
3
|
+
return (_jsx("div", { className: "flex gap-2 p-2 items-center bg-gray-50 rounded-md border-b border-gray-200 text-gray-500 text-sm", children: children }));
|
|
7
4
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
function Spinner({ size = "4xl", }) {
|
|
6
|
-
return (0, jsx_runtime_1.jsx)("i", { className: `pi pi-cog pi-spin text-${size} text-gray-600` });
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function Spinner({ size = "4xl", }) {
|
|
3
|
+
return _jsx("i", { className: `pi pi-cog pi-spin text-${size} text-gray-600` });
|
|
7
4
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export type SplitterPanel = {
|
|
3
|
+
defaultSize: number | "auto";
|
|
4
|
+
name: string;
|
|
5
|
+
content: React.ReactNode;
|
|
6
|
+
collapsible?: boolean;
|
|
7
|
+
};
|
|
8
|
+
interface SplitterProps {
|
|
9
|
+
panels: SplitterPanel[];
|
|
10
|
+
localStorageKey?: string;
|
|
11
|
+
expandLabel?: React.ReactNode;
|
|
12
|
+
growablePanelIndex?: number;
|
|
13
|
+
}
|
|
14
|
+
export declare const Splitter: React.FC<SplitterProps>;
|
|
15
|
+
export {};
|
|
@@ -1,45 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.Splitter = void 0;
|
|
37
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
38
|
-
const react_1 = __importStar(require("react"));
|
|
39
|
-
const react_dom_1 = require("react-dom");
|
|
40
|
-
const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "Expand", }) => {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { useState, useRef, useEffect, useCallback } from "react";
|
|
3
|
+
import { flushSync } from "react-dom";
|
|
4
|
+
export const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "Expand", }) => {
|
|
41
5
|
const totalPanels = panels.length;
|
|
42
|
-
const [panelSizes, setPanelSizes] =
|
|
6
|
+
const [panelSizes, setPanelSizes] = useState(() => {
|
|
43
7
|
// Load sizes from local storage on initial render
|
|
44
8
|
const storedSizes = localStorage.getItem(localStorageKey);
|
|
45
9
|
if (storedSizes) {
|
|
@@ -53,10 +17,10 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
53
17
|
}
|
|
54
18
|
return null; // No stored sizes, initial render will handle defaults
|
|
55
19
|
});
|
|
56
|
-
const panelRefs =
|
|
57
|
-
const splitterRef =
|
|
20
|
+
const panelRefs = useRef([]);
|
|
21
|
+
const splitterRef = useRef(null);
|
|
58
22
|
const lastPanelCollapsible = panels[panels.length - 1]?.collapsible;
|
|
59
|
-
const [isLastPanelCollapsed, setIsLastPanelCollapsed] =
|
|
23
|
+
const [isLastPanelCollapsed, setIsLastPanelCollapsed] = useState(() => {
|
|
60
24
|
const storedSizes = localStorage.getItem(localStorageKey);
|
|
61
25
|
if (storedSizes) {
|
|
62
26
|
const parsedSizes = JSON.parse(storedSizes);
|
|
@@ -64,8 +28,8 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
64
28
|
}
|
|
65
29
|
return true;
|
|
66
30
|
});
|
|
67
|
-
const [isResizing, setIsResizing] =
|
|
68
|
-
|
|
31
|
+
const [isResizing, setIsResizing] = useState(false);
|
|
32
|
+
useEffect(() => {
|
|
69
33
|
if (!panelSizes && splitterRef.current) {
|
|
70
34
|
const initialSizes = {};
|
|
71
35
|
panels.forEach((panel) => {
|
|
@@ -74,7 +38,7 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
74
38
|
setPanelSizes(initialSizes);
|
|
75
39
|
}
|
|
76
40
|
}, [panels]);
|
|
77
|
-
|
|
41
|
+
useEffect(() => {
|
|
78
42
|
if (panelSizes) {
|
|
79
43
|
const storedSizes = {
|
|
80
44
|
panels: panelSizes,
|
|
@@ -86,13 +50,13 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
86
50
|
const toggleLastPanelCollapse = () => {
|
|
87
51
|
if (lastPanelCollapsible) {
|
|
88
52
|
document.startViewTransition(() => {
|
|
89
|
-
|
|
53
|
+
flushSync(() => {
|
|
90
54
|
setIsLastPanelCollapsed((prev) => !prev);
|
|
91
55
|
});
|
|
92
56
|
});
|
|
93
57
|
}
|
|
94
58
|
};
|
|
95
|
-
const handleResize =
|
|
59
|
+
const handleResize = useCallback((index, event) => {
|
|
96
60
|
event.preventDefault();
|
|
97
61
|
const iframes = splitterRef.current?.querySelectorAll("iframe");
|
|
98
62
|
iframes?.forEach((iframe) => {
|
|
@@ -162,17 +126,17 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
162
126
|
return "1fr"; //default
|
|
163
127
|
};
|
|
164
128
|
const getExpandButton = () => {
|
|
165
|
-
return ((
|
|
129
|
+
return (_jsx("div", { onClick: !isResizing ? toggleLastPanelCollapse : undefined, className: "select-none p-1 bg-gray-200 flex items-center justify-center text-gray-500 hover:bg-blue-700 hover:text-white cursor-pointer", style: { writingMode: "vertical-rl", userSelect: "none" }, children: expandLabel }));
|
|
166
130
|
};
|
|
167
131
|
const getSplitter = (index) => {
|
|
168
132
|
if (lastPanelCollapsible && isLastPanelCollapsed && isLastResizer(index)) {
|
|
169
133
|
return getExpandButton();
|
|
170
134
|
}
|
|
171
|
-
return ((
|
|
135
|
+
return (_jsx("div", { className: " bg-gray-200 cursor-ew-resize select-none flex items-center justify-center hover:bg-blue-700 w-[4px] relative z-1000", onDoubleClick: isLastResizer(index) ? toggleLastPanelCollapse : undefined, onMouseDown: (event) => {
|
|
172
136
|
handleResize(index, event);
|
|
173
137
|
} }));
|
|
174
138
|
};
|
|
175
|
-
return ((
|
|
139
|
+
return (_jsx("div", { className: "flex w-full h-full overflow-hidden", ref: splitterRef, children: panels.map((panel, index) => (_jsxs(React.Fragment, { children: [_jsx("div", { ref: (el) => {
|
|
176
140
|
panelRefs.current[index] = el;
|
|
177
141
|
}, className: "relative", style: {
|
|
178
142
|
flex: `${panel.defaultSize === "auto" ? 1 : 0} 1 ${getFlexBasis(index)}`,
|
|
@@ -184,4 +148,3 @@ const Splitter = ({ panels, localStorageKey = "splitter-sizes", expandLabel = "E
|
|
|
184
148
|
: "block",
|
|
185
149
|
}, children: panel.content }), index < panels.length - 1 && getSplitter(index)] }, panel.name))) }));
|
|
186
150
|
};
|
|
187
|
-
exports.Splitter = Splitter;
|