@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,125 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Quill, { type EmitterSource, type Range as RangeStatic, QuillOptions as QuillOptionsStatic } from "quill";
|
|
3
|
+
import type DeltaStatic from "quill-delta";
|
|
4
|
+
declare namespace ReactQuill {
|
|
5
|
+
type Value = string | DeltaStatic;
|
|
6
|
+
type Range = RangeStatic | null;
|
|
7
|
+
interface QuillOptions extends QuillOptionsStatic {
|
|
8
|
+
scrollingContainer?: HTMLElement | string | undefined;
|
|
9
|
+
strict?: boolean | undefined;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
}
|
|
12
|
+
interface ReactQuillProps {
|
|
13
|
+
bounds?: string | HTMLElement;
|
|
14
|
+
children?: React.ReactElement<any>;
|
|
15
|
+
className?: string;
|
|
16
|
+
defaultValue?: Value;
|
|
17
|
+
formats?: string[];
|
|
18
|
+
id?: string;
|
|
19
|
+
modules?: QuillOptions["modules"];
|
|
20
|
+
onChange?(value: string, delta: DeltaStatic, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
21
|
+
onChangeSelection?(selection: Range, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
22
|
+
onFocus?(selection: Range, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
23
|
+
onBlur?(previousSelection: Range, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
24
|
+
onKeyDown?: React.EventHandler<any>;
|
|
25
|
+
onKeyPress?: React.EventHandler<any>;
|
|
26
|
+
onKeyUp?: React.EventHandler<any>;
|
|
27
|
+
placeholder?: string;
|
|
28
|
+
preserveWhitespace?: boolean;
|
|
29
|
+
readOnly?: boolean;
|
|
30
|
+
scrollingContainer?: string | HTMLElement;
|
|
31
|
+
style?: React.CSSProperties;
|
|
32
|
+
tabIndex?: number;
|
|
33
|
+
theme?: string;
|
|
34
|
+
value?: Value;
|
|
35
|
+
}
|
|
36
|
+
interface UnprivilegedEditor {
|
|
37
|
+
getLength: Quill["getLength"];
|
|
38
|
+
getText: Quill["getText"];
|
|
39
|
+
getHTML: Quill["getSemanticHTML"];
|
|
40
|
+
getBounds: Quill["getBounds"];
|
|
41
|
+
getSelection: Quill["getSelection"];
|
|
42
|
+
getContents: Quill["getContents"];
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
import Value = ReactQuill.Value;
|
|
46
|
+
import Range = ReactQuill.Range;
|
|
47
|
+
import QuillOptions = ReactQuill.QuillOptions;
|
|
48
|
+
import ReactQuillProps = ReactQuill.ReactQuillProps;
|
|
49
|
+
import UnprivilegedEditor = ReactQuill.UnprivilegedEditor;
|
|
50
|
+
interface ReactQuillState {
|
|
51
|
+
generation: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class ReactQuill extends React.Component<ReactQuillProps, ReactQuillState> {
|
|
54
|
+
static displayName: string;
|
|
55
|
+
static Quill: typeof Quill;
|
|
56
|
+
dirtyProps: (keyof ReactQuillProps)[];
|
|
57
|
+
cleanProps: (keyof ReactQuillProps)[];
|
|
58
|
+
static defaultProps: {
|
|
59
|
+
theme: string;
|
|
60
|
+
modules: {};
|
|
61
|
+
readOnly: boolean;
|
|
62
|
+
};
|
|
63
|
+
state: ReactQuillState;
|
|
64
|
+
editor?: Quill;
|
|
65
|
+
editingArea?: React.ReactInstance | null;
|
|
66
|
+
value: Value;
|
|
67
|
+
selection: Range;
|
|
68
|
+
lastDeltaChangeSet?: DeltaStatic;
|
|
69
|
+
regenerationSnapshot?: {
|
|
70
|
+
delta: DeltaStatic;
|
|
71
|
+
selection: Range;
|
|
72
|
+
};
|
|
73
|
+
unprivilegedEditor?: UnprivilegedEditor;
|
|
74
|
+
private editingAreaRef;
|
|
75
|
+
constructor(props: ReactQuillProps);
|
|
76
|
+
validateProps(props: ReactQuillProps): void;
|
|
77
|
+
shouldComponentUpdate(nextProps: ReactQuillProps, nextState: ReactQuillState): boolean;
|
|
78
|
+
shouldComponentRegenerate(nextProps: ReactQuillProps): boolean;
|
|
79
|
+
componentDidMount(): void;
|
|
80
|
+
componentWillUnmount(): void;
|
|
81
|
+
componentDidUpdate(prevProps: ReactQuillProps, prevState: ReactQuillState): void;
|
|
82
|
+
instantiateEditor(): void;
|
|
83
|
+
destroyEditor(): void;
|
|
84
|
+
isControlled(): boolean;
|
|
85
|
+
getEditorConfig(): QuillOptions;
|
|
86
|
+
getEditor(): Quill;
|
|
87
|
+
/**
|
|
88
|
+
Creates an editor on the given element. The editor will be passed the
|
|
89
|
+
configuration, have its events bound,
|
|
90
|
+
*/
|
|
91
|
+
createEditor(element: HTMLElement, config: QuillOptions): Quill;
|
|
92
|
+
hookEditor(editor: Quill): void;
|
|
93
|
+
unhookEditor(editor: Quill): void;
|
|
94
|
+
getEditorContents(): Value;
|
|
95
|
+
getEditorSelection(): Range;
|
|
96
|
+
isDelta(value: any): boolean;
|
|
97
|
+
isEqualValue(value: any, nextValue: any): boolean;
|
|
98
|
+
setEditorContents(editor: Quill, value: Value): void;
|
|
99
|
+
setEditorSelection(editor: Quill, range: Range): void;
|
|
100
|
+
setEditorTabIndex(editor: Quill, tabIndex: number): void;
|
|
101
|
+
setEditorReadOnly(editor: Quill, value: boolean): void;
|
|
102
|
+
makeUnprivilegedEditor(editor: Quill): {
|
|
103
|
+
getHTML: () => string;
|
|
104
|
+
getLength: () => number;
|
|
105
|
+
getText: {
|
|
106
|
+
(range?: RangeStatic): string;
|
|
107
|
+
(index?: number, length?: number): string;
|
|
108
|
+
};
|
|
109
|
+
getContents: (index?: number, length?: number) => DeltaStatic;
|
|
110
|
+
getSelection: {
|
|
111
|
+
(focus: true): RangeStatic;
|
|
112
|
+
(focus?: boolean): RangeStatic | null;
|
|
113
|
+
};
|
|
114
|
+
getBounds: (index: number | RangeStatic, length?: number) => import("quill").Bounds | null;
|
|
115
|
+
};
|
|
116
|
+
getEditingArea(): HTMLElement;
|
|
117
|
+
renderEditingArea(): React.ReactNode;
|
|
118
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
onEditorChange: (eventName: "text-change" | "selection-change", rangeOrDelta: Range | DeltaStatic, source: EmitterSource) => void;
|
|
120
|
+
onEditorChangeText(value: string, delta: DeltaStatic, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
121
|
+
onEditorChangeSelection(nextSelection: RangeStatic, source: EmitterSource, editor: UnprivilegedEditor): void;
|
|
122
|
+
focus(): void;
|
|
123
|
+
blur(): void;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
@@ -1,75 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ReactQuill = void 0;
|
|
7
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
8
2
|
/*
|
|
9
3
|
React-Quill
|
|
10
4
|
https://github.com/zenoamaro/react-quill
|
|
11
5
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
class ReactQuill extends
|
|
6
|
+
import React from "react";
|
|
7
|
+
import isEqual from "lodash/isEqual";
|
|
8
|
+
import Quill from "quill";
|
|
9
|
+
export class ReactQuill extends React.Component {
|
|
10
|
+
static displayName = "React Quill";
|
|
11
|
+
/*
|
|
12
|
+
Export Quill to be able to call `register`
|
|
13
|
+
*/
|
|
14
|
+
static Quill = Quill;
|
|
15
|
+
/*
|
|
16
|
+
Changing one of these props should cause a full re-render and a
|
|
17
|
+
re-instantiation of the Quill editor.
|
|
18
|
+
*/
|
|
19
|
+
dirtyProps = [
|
|
20
|
+
"modules",
|
|
21
|
+
"formats",
|
|
22
|
+
"bounds",
|
|
23
|
+
"theme",
|
|
24
|
+
"children",
|
|
25
|
+
];
|
|
26
|
+
/*
|
|
27
|
+
Changing one of these props should cause a regular update. These are mostly
|
|
28
|
+
props that act on the container, rather than the quillized editing area.
|
|
29
|
+
*/
|
|
30
|
+
cleanProps = [
|
|
31
|
+
"id",
|
|
32
|
+
"className",
|
|
33
|
+
"style",
|
|
34
|
+
"placeholder",
|
|
35
|
+
"tabIndex",
|
|
36
|
+
"onChange",
|
|
37
|
+
"onChangeSelection",
|
|
38
|
+
"onFocus",
|
|
39
|
+
"onBlur",
|
|
40
|
+
"onKeyPress",
|
|
41
|
+
"onKeyDown",
|
|
42
|
+
"onKeyUp",
|
|
43
|
+
];
|
|
44
|
+
static defaultProps = {
|
|
45
|
+
theme: "snow",
|
|
46
|
+
modules: {},
|
|
47
|
+
readOnly: false,
|
|
48
|
+
};
|
|
49
|
+
state = {
|
|
50
|
+
generation: 0,
|
|
51
|
+
};
|
|
52
|
+
/*
|
|
53
|
+
The Quill Editor instance.
|
|
54
|
+
*/
|
|
55
|
+
editor;
|
|
56
|
+
/*
|
|
57
|
+
Reference to the element holding the Quill editing area.
|
|
58
|
+
*/
|
|
59
|
+
editingArea;
|
|
60
|
+
/*
|
|
61
|
+
Tracks the internal value of the Quill editor
|
|
62
|
+
*/
|
|
63
|
+
value;
|
|
64
|
+
/*
|
|
65
|
+
Tracks the internal selection of the Quill editor
|
|
66
|
+
*/
|
|
67
|
+
selection = null;
|
|
68
|
+
/*
|
|
69
|
+
Used to compare whether deltas from `onChange` are being used as `value`.
|
|
70
|
+
*/
|
|
71
|
+
lastDeltaChangeSet;
|
|
72
|
+
/*
|
|
73
|
+
Stores the contents of the editor to be restored after regeneration.
|
|
74
|
+
*/
|
|
75
|
+
regenerationSnapshot;
|
|
76
|
+
/*
|
|
77
|
+
A weaker, unprivileged proxy for the editor that does not allow accidentally
|
|
78
|
+
modifying editor state.
|
|
79
|
+
*/
|
|
80
|
+
unprivilegedEditor;
|
|
81
|
+
editingAreaRef = React.createRef();
|
|
16
82
|
constructor(props) {
|
|
17
83
|
super(props);
|
|
18
|
-
/*
|
|
19
|
-
Changing one of these props should cause a full re-render and a
|
|
20
|
-
re-instantiation of the Quill editor.
|
|
21
|
-
*/
|
|
22
|
-
this.dirtyProps = [
|
|
23
|
-
"modules",
|
|
24
|
-
"formats",
|
|
25
|
-
"bounds",
|
|
26
|
-
"theme",
|
|
27
|
-
"children",
|
|
28
|
-
];
|
|
29
|
-
/*
|
|
30
|
-
Changing one of these props should cause a regular update. These are mostly
|
|
31
|
-
props that act on the container, rather than the quillized editing area.
|
|
32
|
-
*/
|
|
33
|
-
this.cleanProps = [
|
|
34
|
-
"id",
|
|
35
|
-
"className",
|
|
36
|
-
"style",
|
|
37
|
-
"placeholder",
|
|
38
|
-
"tabIndex",
|
|
39
|
-
"onChange",
|
|
40
|
-
"onChangeSelection",
|
|
41
|
-
"onFocus",
|
|
42
|
-
"onBlur",
|
|
43
|
-
"onKeyPress",
|
|
44
|
-
"onKeyDown",
|
|
45
|
-
"onKeyUp",
|
|
46
|
-
];
|
|
47
|
-
this.state = {
|
|
48
|
-
generation: 0,
|
|
49
|
-
};
|
|
50
|
-
/*
|
|
51
|
-
Tracks the internal selection of the Quill editor
|
|
52
|
-
*/
|
|
53
|
-
this.selection = null;
|
|
54
|
-
this.editingAreaRef = react_1.default.createRef();
|
|
55
|
-
this.onEditorChange = (eventName, rangeOrDelta,
|
|
56
|
-
//oldRangeOrDelta: Range | DeltaStatic,
|
|
57
|
-
source) => {
|
|
58
|
-
if (eventName === "text-change") {
|
|
59
|
-
this.onEditorChangeText?.(this.editor.root.innerHTML, rangeOrDelta, source, this.unprivilegedEditor);
|
|
60
|
-
}
|
|
61
|
-
else if (eventName === "selection-change") {
|
|
62
|
-
this.onEditorChangeSelection?.(rangeOrDelta, source, this.unprivilegedEditor);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
84
|
const value = this.isControlled() ? props.value : props.defaultValue;
|
|
66
85
|
this.value = value ?? "";
|
|
67
86
|
}
|
|
68
87
|
validateProps(props) {
|
|
69
|
-
if (
|
|
88
|
+
if (React.Children.count(props.children) > 1)
|
|
70
89
|
throw new Error("The Quill editing area can only be composed of a single React element.");
|
|
71
|
-
if (
|
|
72
|
-
const child =
|
|
90
|
+
if (React.Children.count(props.children)) {
|
|
91
|
+
const child = React.Children.only(props.children);
|
|
73
92
|
if (child?.type === "textarea")
|
|
74
93
|
throw new Error("Quill does not support editing on a <textarea>. Use a <div> instead.");
|
|
75
94
|
}
|
|
@@ -105,13 +124,13 @@ class ReactQuill extends react_1.default.Component {
|
|
|
105
124
|
}
|
|
106
125
|
// Clean and Dirty props require a render
|
|
107
126
|
return [...this.cleanProps, ...this.dirtyProps].some((prop) => {
|
|
108
|
-
return !(
|
|
127
|
+
return !isEqual(nextProps[prop], this.props[prop]);
|
|
109
128
|
});
|
|
110
129
|
}
|
|
111
130
|
shouldComponentRegenerate(nextProps) {
|
|
112
131
|
// Whenever a `dirtyProp` changes, the editor needs reinstantiation.
|
|
113
132
|
return this.dirtyProps.some((prop) => {
|
|
114
|
-
return !(
|
|
133
|
+
return !isEqual(nextProps[prop], this.props[prop]);
|
|
115
134
|
});
|
|
116
135
|
}
|
|
117
136
|
componentDidMount() {
|
|
@@ -185,7 +204,7 @@ class ReactQuill extends react_1.default.Component {
|
|
|
185
204
|
configuration, have its events bound,
|
|
186
205
|
*/
|
|
187
206
|
createEditor(element, config) {
|
|
188
|
-
const editor = new
|
|
207
|
+
const editor = new Quill(element, config);
|
|
189
208
|
if (config.tabIndex != null) {
|
|
190
209
|
this.setEditorTabIndex(editor, config.tabIndex);
|
|
191
210
|
}
|
|
@@ -220,10 +239,10 @@ class ReactQuill extends react_1.default.Component {
|
|
|
220
239
|
*/
|
|
221
240
|
isEqualValue(value, nextValue) {
|
|
222
241
|
if (this.isDelta(value) && this.isDelta(nextValue)) {
|
|
223
|
-
return (
|
|
242
|
+
return isEqual(value.ops, nextValue.ops);
|
|
224
243
|
}
|
|
225
244
|
else {
|
|
226
|
-
return (
|
|
245
|
+
return isEqual(value, nextValue);
|
|
227
246
|
}
|
|
228
247
|
}
|
|
229
248
|
/*
|
|
@@ -292,16 +311,26 @@ class ReactQuill extends react_1.default.Component {
|
|
|
292
311
|
renderEditingArea() {
|
|
293
312
|
const { children, preserveWhitespace } = this.props;
|
|
294
313
|
const { generation } = this.state;
|
|
295
|
-
if (
|
|
296
|
-
return
|
|
314
|
+
if (React.Children.count(children)) {
|
|
315
|
+
return React.cloneElement(React.Children.only(children), {
|
|
297
316
|
ref: this.editingAreaRef,
|
|
298
317
|
});
|
|
299
318
|
}
|
|
300
|
-
return preserveWhitespace ? ((
|
|
319
|
+
return preserveWhitespace ? (_jsx("pre", { ref: this.editingAreaRef }, generation)) : (_jsx("div", { ref: this.editingAreaRef }, generation));
|
|
301
320
|
}
|
|
302
321
|
render() {
|
|
303
|
-
return ((
|
|
322
|
+
return (_jsx("div", { id: this.props.id, style: this.props.style, className: `quill ${this.props.className ?? ""}`, onKeyPress: this.props.onKeyPress, onKeyDownCapture: this.props.onKeyDown, onKeyUp: this.props.onKeyUp, children: this.renderEditingArea() }, this.state.generation));
|
|
304
323
|
}
|
|
324
|
+
onEditorChange = (eventName, rangeOrDelta,
|
|
325
|
+
//oldRangeOrDelta: Range | DeltaStatic,
|
|
326
|
+
source) => {
|
|
327
|
+
if (eventName === "text-change") {
|
|
328
|
+
this.onEditorChangeText?.(this.editor.root.innerHTML, rangeOrDelta, source, this.unprivilegedEditor);
|
|
329
|
+
}
|
|
330
|
+
else if (eventName === "selection-change") {
|
|
331
|
+
this.onEditorChangeSelection?.(rangeOrDelta, source, this.unprivilegedEditor);
|
|
332
|
+
}
|
|
333
|
+
};
|
|
305
334
|
onEditorChangeText(value, delta, source, editor) {
|
|
306
335
|
if (!this.editor)
|
|
307
336
|
return;
|
|
@@ -324,7 +353,7 @@ class ReactQuill extends react_1.default.Component {
|
|
|
324
353
|
const currentSelection = this.getEditorSelection();
|
|
325
354
|
const hasGainedFocus = !currentSelection && nextSelection;
|
|
326
355
|
const hasLostFocus = currentSelection && !nextSelection;
|
|
327
|
-
if ((
|
|
356
|
+
if (isEqual(nextSelection, currentSelection))
|
|
328
357
|
return;
|
|
329
358
|
this.selection = nextSelection;
|
|
330
359
|
this.props.onChangeSelection?.(nextSelection, source, editor);
|
|
@@ -347,17 +376,6 @@ class ReactQuill extends react_1.default.Component {
|
|
|
347
376
|
this.editor.blur();
|
|
348
377
|
}
|
|
349
378
|
}
|
|
350
|
-
exports.ReactQuill = ReactQuill;
|
|
351
|
-
ReactQuill.displayName = "React Quill";
|
|
352
|
-
/*
|
|
353
|
-
Export Quill to be able to call `register`
|
|
354
|
-
*/
|
|
355
|
-
ReactQuill.Quill = quill_1.default;
|
|
356
|
-
ReactQuill.defaultProps = {
|
|
357
|
-
theme: "snow",
|
|
358
|
-
modules: {},
|
|
359
|
-
readOnly: false,
|
|
360
|
-
};
|
|
361
379
|
/*
|
|
362
380
|
Small helper to execute a function in the next micro-tick.
|
|
363
381
|
*/
|
|
@@ -1,46 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
-
}
|
|
9
|
-
Object.defineProperty(o, k2, desc);
|
|
10
|
-
}) : (function(o, m, k, k2) {
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
-
};
|
|
39
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
-
exports.RichTextEditor = RichTextEditor;
|
|
41
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
42
|
-
const dynamic_1 = __importDefault(require("next/dynamic"));
|
|
43
|
-
const RichTextEditorComponent = (0, dynamic_1.default)(() => Promise.resolve().then(() => __importStar(require("./RichTextEditorComponent"))).then((dnd) => dnd.RichTextEditorComponent), { ssr: false });
|
|
44
|
-
function RichTextEditor({ field, readOnly, }) {
|
|
45
|
-
return (0, jsx_runtime_1.jsx)(RichTextEditorComponent, { field: field, readOnly: readOnly });
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import dynamic from "next/dynamic";
|
|
4
|
+
const RichTextEditorComponent = dynamic(() => import("./RichTextEditorComponent").then((dnd) => dnd.RichTextEditorComponent), { ssr: false });
|
|
5
|
+
export function RichTextEditor({ field, readOnly, }) {
|
|
6
|
+
return _jsx(RichTextEditorComponent, { field: field, readOnly: readOnly });
|
|
46
7
|
}
|
|
@@ -1,22 +1,19 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
const
|
|
14
|
-
const modifiedFieldsContext = (0, editContext_1.useModifiedFieldsContext)();
|
|
15
|
-
const state = (0, react_1.useRef)({ focus: false });
|
|
16
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { useEditContextRef, useModifiedFieldsContext, } from "../client/editContext";
|
|
4
|
+
import { useThrottledCallback } from "use-debounce";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { ReactQuill } from "./ReactQuill";
|
|
7
|
+
import "react-quill-new/dist/quill.snow.css";
|
|
8
|
+
import { classNames } from "primereact/utils";
|
|
9
|
+
export function RichTextEditorComponent({ field, readOnly, }) {
|
|
10
|
+
const editContextRef = useEditContextRef();
|
|
11
|
+
const modifiedFieldsContext = useModifiedFieldsContext();
|
|
12
|
+
const state = useRef({ focus: false });
|
|
13
|
+
const inputRef = useRef(null);
|
|
17
14
|
if (!editContextRef.current)
|
|
18
15
|
return;
|
|
19
|
-
const [value, setValue] =
|
|
16
|
+
const [value, setValue] = useState(field.value);
|
|
20
17
|
const fieldItem = field.descriptor.item;
|
|
21
18
|
if (!fieldItem)
|
|
22
19
|
return;
|
|
@@ -24,7 +21,7 @@ function RichTextEditorComponent({ field, readOnly, }) {
|
|
|
24
21
|
x.item.id === fieldItem.id &&
|
|
25
22
|
x.item.language === fieldItem.language &&
|
|
26
23
|
x.item.version === fieldItem.version);
|
|
27
|
-
|
|
24
|
+
useEffect(() => {
|
|
28
25
|
if (!state.current.focus ||
|
|
29
26
|
!document.activeElement?.classList.contains("ql-editor")) {
|
|
30
27
|
if (field.isHistoric)
|
|
@@ -33,7 +30,7 @@ function RichTextEditorComponent({ field, readOnly, }) {
|
|
|
33
30
|
setValue(modifiedField?.value ?? field.value);
|
|
34
31
|
}
|
|
35
32
|
}, [field.value, modifiedFieldsContext?.modifiedFields]);
|
|
36
|
-
const debouncedSetFieldvalue =
|
|
33
|
+
const debouncedSetFieldvalue = useThrottledCallback((value) => {
|
|
37
34
|
editContextRef.current?.operations.editField({
|
|
38
35
|
field: field.descriptor,
|
|
39
36
|
value: value,
|
|
@@ -62,7 +59,7 @@ function RichTextEditorComponent({ field, readOnly, }) {
|
|
|
62
59
|
// // debouncedSetFieldvalue(val);
|
|
63
60
|
// // }}
|
|
64
61
|
// />
|
|
65
|
-
(
|
|
62
|
+
_jsx("div", { className: classNames(readOnly ? "bg-gray-100" : "bg-white", "focus-shadow"), children: _jsx(ReactQuill, { ref: inputRef, theme: "snow", value: value, onChange: handleChange, onFocus: () => {
|
|
66
63
|
setTimeout(() => {
|
|
67
64
|
state.current.focus = true;
|
|
68
65
|
}, 101);
|
|
@@ -1,27 +1,24 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
const editContext = (0, editContext_1.useEditContext)();
|
|
12
|
-
const modifiedFieldsContext = (0, editContext_1.useModifiedFieldsContext)();
|
|
13
|
-
const inputRef = (0, react_1.useRef)(null);
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { InputText } from "primereact/inputtext";
|
|
4
|
+
import { useEditContext, useEditContextRef, useModifiedFieldsContext, } from "../client/editContext";
|
|
5
|
+
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
export function SingleLineText({ field, readOnly, updateFieldValue, }) {
|
|
7
|
+
const editContextRef = useEditContextRef();
|
|
8
|
+
const editContext = useEditContext();
|
|
9
|
+
const modifiedFieldsContext = useModifiedFieldsContext();
|
|
10
|
+
const inputRef = useRef(null);
|
|
14
11
|
// const [selectionStart, setSelectionStart] = useState(0);
|
|
15
12
|
// const [selectionEnd, setSelectionEnd] = useState(0);
|
|
16
13
|
if (!editContextRef.current)
|
|
17
14
|
return;
|
|
18
15
|
const fieldItem = field.descriptor.item;
|
|
19
|
-
const [value, setValue] =
|
|
16
|
+
const [value, setValue] = useState(undefined);
|
|
20
17
|
const modifiedField = modifiedFieldsContext?.modifiedFields.find((x) => x.fieldId === field.id &&
|
|
21
18
|
x.item.id === fieldItem.id &&
|
|
22
19
|
x.item.language === fieldItem.language &&
|
|
23
20
|
x.item.version === fieldItem.version);
|
|
24
|
-
|
|
21
|
+
useEffect(() => {
|
|
25
22
|
if (inputRef.current !== document.activeElement) {
|
|
26
23
|
if (field.isHistoric)
|
|
27
24
|
setValue(field.value);
|
|
@@ -52,7 +49,7 @@ function SingleLineText({ field, readOnly, updateFieldValue, }) {
|
|
|
52
49
|
};
|
|
53
50
|
editContextRef.current?.setSelectedRange(range);
|
|
54
51
|
};
|
|
55
|
-
|
|
52
|
+
useEffect(() => {
|
|
56
53
|
if (editContextRef.current?.focusedField?.fieldId === field.id &&
|
|
57
54
|
editContextRef.current?.focusedField?.item.id === fieldItem.id &&
|
|
58
55
|
editContextRef.current?.focusedField?.item.language ===
|
|
@@ -88,5 +85,5 @@ function SingleLineText({ field, readOnly, updateFieldValue, }) {
|
|
|
88
85
|
// width: `${width}px`,
|
|
89
86
|
// };
|
|
90
87
|
// };
|
|
91
|
-
return ((
|
|
88
|
+
return (_jsx("div", { className: "relative", children: _jsx(InputText, { ref: inputRef, value: value || "", disabled: readOnly, className: "p-1.5 focus-shadow text-sm", style: { width: "100%" }, onChange: handleChange, onSelect: handleSelect }, fieldItem.id + field.id + fieldItem.language + fieldItem.version) }));
|
|
92
89
|
}
|