@shelamkoff/rector 1.0.0
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/LICENSE +21 -0
- package/NOTICE +17 -0
- package/README.md +23 -0
- package/THIRD_PARTY_LICENSES.txt +298 -0
- package/dist/I18n.d.ts +1 -0
- package/dist/core/Block.d.ts +110 -0
- package/dist/core/Block.js +390 -0
- package/dist/core/BlockAnimator.d.ts +39 -0
- package/dist/core/BlockAnimator.js +106 -0
- package/dist/core/BlockManager.d.ts +163 -0
- package/dist/core/BlockManager.js +640 -0
- package/dist/core/BlockOperations.d.ts +67 -0
- package/dist/core/BlockOperations.js +238 -0
- package/dist/core/ChangeNotifier.d.ts +15 -0
- package/dist/core/ChangeNotifier.js +55 -0
- package/dist/core/CommandDispatcher.d.ts +52 -0
- package/dist/core/CommandDispatcher.js +208 -0
- package/dist/core/CrossBlockSelection.d.ts +30 -0
- package/dist/core/CrossBlockSelection.js +74 -0
- package/dist/core/Diagnostics.d.ts +23 -0
- package/dist/core/Diagnostics.js +62 -0
- package/dist/core/DocumentSchema.d.ts +29 -0
- package/dist/core/DocumentSchema.js +147 -0
- package/dist/core/DocumentSnapshotStore.d.ts +34 -0
- package/dist/core/DocumentSnapshotStore.js +153 -0
- package/dist/core/DragManager.d.ts +17 -0
- package/dist/core/DragManager.js +223 -0
- package/dist/core/EditorFacade.d.ts +154 -0
- package/dist/core/EditorFacade.js +361 -0
- package/dist/core/EditorHolderOwnership.d.ts +12 -0
- package/dist/core/EditorHolderOwnership.js +28 -0
- package/dist/core/I18n.d.ts +147 -0
- package/dist/core/I18n.js +296 -0
- package/dist/core/InlinePatternMatcher.d.ts +26 -0
- package/dist/core/InlinePatternMatcher.js +267 -0
- package/dist/core/InlinePluginRegistry.d.ts +55 -0
- package/dist/core/InlinePluginRegistry.js +128 -0
- package/dist/core/KeyboardManager.d.ts +17 -0
- package/dist/core/KeyboardManager.js +231 -0
- package/dist/core/LifecycleScope.d.ts +19 -0
- package/dist/core/LifecycleScope.js +41 -0
- package/dist/core/MouseSelectionManager.d.ts +30 -0
- package/dist/core/MouseSelectionManager.js +307 -0
- package/dist/core/PluginOwnership.d.ts +9 -0
- package/dist/core/PluginOwnership.js +40 -0
- package/dist/core/PopupManager.d.ts +50 -0
- package/dist/core/PopupManager.js +183 -0
- package/dist/core/PreservedBlockPlugin.d.ts +11 -0
- package/dist/core/PreservedBlockPlugin.js +42 -0
- package/dist/core/PublicEditorApi.d.ts +82 -0
- package/dist/core/PublicEditorApi.js +158 -0
- package/dist/core/SelectionManager.d.ts +50 -0
- package/dist/core/SelectionManager.js +205 -0
- package/dist/core/ShortcutRegistry.d.ts +29 -0
- package/dist/core/ShortcutRegistry.js +106 -0
- package/dist/core/SlashCommands.d.ts +34 -0
- package/dist/core/SlashCommands.js +483 -0
- package/dist/core/StyleInjector.d.ts +1 -0
- package/dist/core/StyleInjector.js +1 -0
- package/dist/core/Tooltip.d.ts +17 -0
- package/dist/core/Tooltip.js +60 -0
- package/dist/core/TriggerManager.d.ts +17 -0
- package/dist/core/TriggerManager.js +159 -0
- package/dist/core/TypeSelector.d.ts +31 -0
- package/dist/core/TypeSelector.js +464 -0
- package/dist/core/UndoManager.d.ts +72 -0
- package/dist/core/UndoManager.js +383 -0
- package/dist/core/block-settings-menu/BlockActions.d.ts +81 -0
- package/dist/core/block-settings-menu/BlockActions.js +233 -0
- package/dist/core/block-settings-menu/BlockSettingsMenu.d.ts +46 -0
- package/dist/core/block-settings-menu/BlockSettingsMenu.js +205 -0
- package/dist/core/block-settings-menu/MenuBuilder.d.ts +43 -0
- package/dist/core/block-settings-menu/MenuBuilder.js +203 -0
- package/dist/core/block-settings-menu/MenuPositioner.d.ts +22 -0
- package/dist/core/block-settings-menu/MenuPositioner.js +79 -0
- package/dist/core/clipboard/Clipboard.d.ts +47 -0
- package/dist/core/clipboard/Clipboard.js +653 -0
- package/dist/core/clipboard/CrossBlockEditor.d.ts +43 -0
- package/dist/core/clipboard/CrossBlockEditor.js +198 -0
- package/dist/core/clipboard/PasteRouter.d.ts +27 -0
- package/dist/core/clipboard/PasteRouter.js +86 -0
- package/dist/core/clipboard/pasteInsert.d.ts +35 -0
- package/dist/core/clipboard/pasteInsert.js +215 -0
- package/dist/core/clipboard/pasteUtils.d.ts +25 -0
- package/dist/core/clipboard/pasteUtils.js +98 -0
- package/dist/core/config.d.ts +77 -0
- package/dist/core/config.js +100 -0
- package/dist/core/constants.d.ts +23 -0
- package/dist/core/constants.js +30 -0
- package/dist/core/crossBlockConvert.d.ts +38 -0
- package/dist/core/crossBlockConvert.js +253 -0
- package/dist/core/dom.d.ts +35 -0
- package/dist/core/dom.js +65 -0
- package/dist/core/editorEvents.d.ts +89 -0
- package/dist/core/editorEvents.js +60 -0
- package/dist/core/hydrateInlinePlugins.d.ts +9 -0
- package/dist/core/hydrateInlinePlugins.js +36 -0
- package/dist/core/icons.d.ts +10 -0
- package/dist/core/icons.js +21 -0
- package/dist/core/index.d.ts +59 -0
- package/dist/core/index.js +703 -0
- package/dist/core/inline-toolbar/ActionsPanel.d.ts +61 -0
- package/dist/core/inline-toolbar/ActionsPanel.js +132 -0
- package/dist/core/inline-toolbar/InlinePositioner.d.ts +20 -0
- package/dist/core/inline-toolbar/InlinePositioner.js +63 -0
- package/dist/core/inline-toolbar/InlineToolbar.d.ts +45 -0
- package/dist/core/inline-toolbar/InlineToolbar.js +456 -0
- package/dist/core/inline-toolbar/PluginControlsSlot.d.ts +52 -0
- package/dist/core/inline-toolbar/PluginControlsSlot.js +118 -0
- package/dist/core/inline-toolbar/SelectionTracker.d.ts +63 -0
- package/dist/core/inline-toolbar/SelectionTracker.js +173 -0
- package/dist/core/inlinePluginInsert.d.ts +13 -0
- package/dist/core/inlinePluginInsert.js +56 -0
- package/dist/core/locale/en.d.ts +35 -0
- package/dist/core/locale/en.js +37 -0
- package/dist/core/locale/ru.d.ts +35 -0
- package/dist/core/locale/ru.js +37 -0
- package/dist/core/menuKeyboardNav.d.ts +15 -0
- package/dist/core/menuKeyboardNav.js +52 -0
- package/dist/core/sanitize.d.ts +2 -0
- package/dist/core/sanitize.js +6 -0
- package/dist/core/splitConvert.d.ts +46 -0
- package/dist/core/splitConvert.js +190 -0
- package/dist/core/textOffset.d.ts +46 -0
- package/dist/core/textOffset.js +180 -0
- package/dist/core/themes/dark.css +30 -0
- package/dist/core/themes/light.css +33 -0
- package/dist/core/themes/variables.css +1170 -0
- package/dist/core/toolbar/OffcanvasRoot.d.ts +37 -0
- package/dist/core/toolbar/OffcanvasRoot.js +127 -0
- package/dist/core/toolbar/Toolbar.d.ts +70 -0
- package/dist/core/toolbar/Toolbar.js +432 -0
- package/dist/core/toolbar/ToolbarPositioner.d.ts +60 -0
- package/dist/core/toolbar/ToolbarPositioner.js +188 -0
- package/dist/core/toolbar/ToolboxBuilder.d.ts +44 -0
- package/dist/core/toolbar/ToolboxBuilder.js +260 -0
- package/dist/core/types.d.ts +747 -0
- package/dist/core/uid.d.ts +6 -0
- package/dist/core/uid.js +29 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/inline-plugins/README.md +35 -0
- package/dist/inline-plugins/README.ru.md +35 -0
- package/dist/inline-plugins/color/README.md +61 -0
- package/dist/inline-plugins/color/README.ru.md +61 -0
- package/dist/inline-plugins/color.d.ts +8 -0
- package/dist/inline-plugins/color.js +184 -0
- package/dist/inline-plugins/locale/en.d.ts +7 -0
- package/dist/inline-plugins/locale/en.js +6 -0
- package/dist/inline-plugins/locale/ru.d.ts +7 -0
- package/dist/inline-plugins/locale/ru.js +6 -0
- package/dist/inline-plugins/mention/README.md +97 -0
- package/dist/inline-plugins/mention/README.ru.md +97 -0
- package/dist/inline-plugins/mention/index.d.ts +110 -0
- package/dist/inline-plugins/mention/index.js +1897 -0
- package/dist/inline-plugins/mention/styles.css +183 -0
- package/dist/inline-plugins/mention/widget.d.ts +16 -0
- package/dist/inline-plugins/mention/widget.js +75 -0
- package/dist/inline-tools/align.d.ts +14 -0
- package/dist/inline-tools/align.js +120 -0
- package/dist/inline-tools/bold.d.ts +8 -0
- package/dist/inline-tools/bold.js +12 -0
- package/dist/inline-tools/caseTransform.d.ts +8 -0
- package/dist/inline-tools/caseTransform.js +87 -0
- package/dist/inline-tools/clearFormatting.d.ts +8 -0
- package/dist/inline-tools/clearFormatting.js +74 -0
- package/dist/inline-tools/code.d.ts +8 -0
- package/dist/inline-tools/code.js +12 -0
- package/dist/inline-tools/colorPicker.d.ts +7 -0
- package/dist/inline-tools/colorPicker.js +271 -0
- package/dist/inline-tools/defaults.d.ts +10 -0
- package/dist/inline-tools/defaults.js +57 -0
- package/dist/inline-tools/fontSize.d.ts +7 -0
- package/dist/inline-tools/fontSize.js +524 -0
- package/dist/inline-tools/italic.d.ts +8 -0
- package/dist/inline-tools/italic.js +12 -0
- package/dist/inline-tools/link.d.ts +12 -0
- package/dist/inline-tools/link.js +251 -0
- package/dist/inline-tools/marker.d.ts +8 -0
- package/dist/inline-tools/marker.js +12 -0
- package/dist/inline-tools/scriptTool.d.ts +11 -0
- package/dist/inline-tools/scriptTool.js +149 -0
- package/dist/inline-tools/strikethrough.d.ts +8 -0
- package/dist/inline-tools/strikethrough.js +12 -0
- package/dist/inline-tools/utils.d.ts +220 -0
- package/dist/inline-tools/utils.js +992 -0
- package/dist/locale/en.d.ts +311 -0
- package/dist/locale/en.js +52 -0
- package/dist/locale/ru.d.ts +315 -0
- package/dist/locale/ru.js +52 -0
- package/dist/plugins/BlockPluginAbstract.d.ts +82 -0
- package/dist/plugins/BlockPluginAbstract.js +111 -0
- package/dist/plugins/README.md +44 -0
- package/dist/plugins/README.ru.md +40 -0
- package/dist/plugins/async.d.ts +35 -0
- package/dist/plugins/async.js +79 -0
- package/dist/plugins/attaches/README.md +86 -0
- package/dist/plugins/attaches/README.ru.md +87 -0
- package/dist/plugins/attaches/attaches.css +374 -0
- package/dist/plugins/attaches/index.d.ts +133 -0
- package/dist/plugins/attaches/index.js +921 -0
- package/dist/plugins/attaches/locale/en.d.ts +23 -0
- package/dist/plugins/attaches/locale/en.js +19 -0
- package/dist/plugins/attaches/locale/keys.d.ts +5 -0
- package/dist/plugins/attaches/locale/ru.d.ts +25 -0
- package/dist/plugins/attaches/locale/ru.js +19 -0
- package/dist/plugins/carousel/README.md +108 -0
- package/dist/plugins/carousel/README.ru.md +109 -0
- package/dist/plugins/carousel/carousel.css +198 -0
- package/dist/plugins/carousel/icons.d.ts +12 -0
- package/dist/plugins/carousel/icons.js +13 -0
- package/dist/plugins/carousel/index.d.ts +137 -0
- package/dist/plugins/carousel/index.js +859 -0
- package/dist/plugins/carousel/locale/en.d.ts +41 -0
- package/dist/plugins/carousel/locale/en.js +40 -0
- package/dist/plugins/carousel/locale/keys.d.ts +2 -0
- package/dist/plugins/carousel/locale/ru.d.ts +41 -0
- package/dist/plugins/carousel/locale/ru.js +40 -0
- package/dist/plugins/carousel/state.d.ts +29 -0
- package/dist/plugins/carousel/state.js +42 -0
- package/dist/plugins/checklist/README.md +54 -0
- package/dist/plugins/checklist/README.ru.md +55 -0
- package/dist/plugins/checklist/checklist.css +80 -0
- package/dist/plugins/checklist/index.d.ts +75 -0
- package/dist/plugins/checklist/index.js +407 -0
- package/dist/plugins/checklist/locale/en.d.ts +5 -0
- package/dist/plugins/checklist/locale/en.js +4 -0
- package/dist/plugins/checklist/locale/keys.d.ts +5 -0
- package/dist/plugins/checklist/locale/ru.d.ts +5 -0
- package/dist/plugins/checklist/locale/ru.js +4 -0
- package/dist/plugins/checklist/mapTextFields.d.ts +1 -0
- package/dist/plugins/checklist/mapTextFields.js +1 -0
- package/dist/plugins/code/README.md +59 -0
- package/dist/plugins/code/README.ru.md +60 -0
- package/dist/plugins/code/code.css +360 -0
- package/dist/plugins/code/index.d.ts +109 -0
- package/dist/plugins/code/index.js +1012 -0
- package/dist/plugins/code/locale/en.d.ts +11 -0
- package/dist/plugins/code/locale/en.js +10 -0
- package/dist/plugins/code/locale/keys.d.ts +5 -0
- package/dist/plugins/code/locale/ru.d.ts +11 -0
- package/dist/plugins/code/locale/ru.js +10 -0
- package/dist/plugins/columns/README.md +55 -0
- package/dist/plugins/columns/README.ru.md +56 -0
- package/dist/plugins/columns/columns.css +103 -0
- package/dist/plugins/columns/index.d.ts +58 -0
- package/dist/plugins/columns/index.js +236 -0
- package/dist/plugins/columns/locale/en.d.ts +6 -0
- package/dist/plugins/columns/locale/en.js +5 -0
- package/dist/plugins/columns/locale/keys.d.ts +5 -0
- package/dist/plugins/columns/locale/ru.d.ts +6 -0
- package/dist/plugins/columns/locale/ru.js +5 -0
- package/dist/plugins/delimiter/README.md +48 -0
- package/dist/plugins/delimiter/README.ru.md +49 -0
- package/dist/plugins/delimiter/delimiter.css +22 -0
- package/dist/plugins/delimiter/index.d.ts +38 -0
- package/dist/plugins/delimiter/index.js +69 -0
- package/dist/plugins/delimiter/locale/en.d.ts +4 -0
- package/dist/plugins/delimiter/locale/en.js +3 -0
- package/dist/plugins/delimiter/locale/keys.d.ts +5 -0
- package/dist/plugins/delimiter/locale/ru.d.ts +4 -0
- package/dist/plugins/delimiter/locale/ru.js +3 -0
- package/dist/plugins/embed/README.md +81 -0
- package/dist/plugins/embed/README.ru.md +82 -0
- package/dist/plugins/embed/embed.css +558 -0
- package/dist/plugins/embed/index.d.ts +271 -0
- package/dist/plugins/embed/index.js +967 -0
- package/dist/plugins/embed/locale/en.d.ts +20 -0
- package/dist/plugins/embed/locale/en.js +19 -0
- package/dist/plugins/embed/locale/keys.d.ts +5 -0
- package/dist/plugins/embed/locale/ru.d.ts +20 -0
- package/dist/plugins/embed/locale/ru.js +19 -0
- package/dist/plugins/embed/player.d.ts +1 -0
- package/dist/plugins/embed/player.js +1 -0
- package/dist/plugins/gallery/README.md +92 -0
- package/dist/plugins/gallery/README.ru.md +93 -0
- package/dist/plugins/gallery/css.d.ts +52 -0
- package/dist/plugins/gallery/css.js +67 -0
- package/dist/plugins/gallery/gallery.css +860 -0
- package/dist/plugins/gallery/icons.d.ts +13 -0
- package/dist/plugins/gallery/icons.js +45 -0
- package/dist/plugins/gallery/index.d.ts +126 -0
- package/dist/plugins/gallery/index.js +355 -0
- package/dist/plugins/gallery/layout.d.ts +35 -0
- package/dist/plugins/gallery/layout.js +79 -0
- package/dist/plugins/gallery/locale/en.d.ts +36 -0
- package/dist/plugins/gallery/locale/en.js +35 -0
- package/dist/plugins/gallery/locale/keys.d.ts +5 -0
- package/dist/plugins/gallery/locale/ru.d.ts +36 -0
- package/dist/plugins/gallery/locale/ru.js +35 -0
- package/dist/plugins/gallery/settings.d.ts +25 -0
- package/dist/plugins/gallery/settings.js +199 -0
- package/dist/plugins/gallery/slot.d.ts +73 -0
- package/dist/plugins/gallery/slot.js +260 -0
- package/dist/plugins/gallery/state.d.ts +67 -0
- package/dist/plugins/gallery/state.js +133 -0
- package/dist/plugins/gallery/styles.d.ts +10 -0
- package/dist/plugins/gallery/styles.js +24 -0
- package/dist/plugins/gallery/uploader.d.ts +31 -0
- package/dist/plugins/gallery/uploader.js +111 -0
- package/dist/plugins/gallery/view-empty.d.ts +41 -0
- package/dist/plugins/gallery/view-empty.js +56 -0
- package/dist/plugins/gallery/view-filled.d.ts +55 -0
- package/dist/plugins/gallery/view-filled.js +353 -0
- package/dist/plugins/heading/HeadingLevelSelect.d.ts +16 -0
- package/dist/plugins/heading/HeadingLevelSelect.js +183 -0
- package/dist/plugins/heading/README.md +58 -0
- package/dist/plugins/heading/README.ru.md +59 -0
- package/dist/plugins/heading/heading.css +76 -0
- package/dist/plugins/heading/index.d.ts +124 -0
- package/dist/plugins/heading/index.js +273 -0
- package/dist/plugins/heading/locale/en.d.ts +11 -0
- package/dist/plugins/heading/locale/en.js +10 -0
- package/dist/plugins/heading/locale/keys.d.ts +5 -0
- package/dist/plugins/heading/locale/ru.d.ts +11 -0
- package/dist/plugins/heading/locale/ru.js +10 -0
- package/dist/plugins/heading/mapTextFields.d.ts +1 -0
- package/dist/plugins/heading/mapTextFields.js +1 -0
- package/dist/plugins/image/README.md +93 -0
- package/dist/plugins/image/README.ru.md +94 -0
- package/dist/plugins/image/css.d.ts +47 -0
- package/dist/plugins/image/css.js +47 -0
- package/dist/plugins/image/icons.d.ts +13 -0
- package/dist/plugins/image/icons.js +26 -0
- package/dist/plugins/image/image.css +559 -0
- package/dist/plugins/image/index.d.ts +129 -0
- package/dist/plugins/image/index.js +346 -0
- package/dist/plugins/image/locale/en.d.ts +39 -0
- package/dist/plugins/image/locale/en.js +38 -0
- package/dist/plugins/image/locale/keys.d.ts +5 -0
- package/dist/plugins/image/locale/ru.d.ts +39 -0
- package/dist/plugins/image/locale/ru.js +38 -0
- package/dist/plugins/image/settings.d.ts +23 -0
- package/dist/plugins/image/settings.js +347 -0
- package/dist/plugins/image/state.d.ts +86 -0
- package/dist/plugins/image/state.js +151 -0
- package/dist/plugins/image/styles.d.ts +21 -0
- package/dist/plugins/image/styles.js +58 -0
- package/dist/plugins/image/uploader.d.ts +31 -0
- package/dist/plugins/image/uploader.js +92 -0
- package/dist/plugins/image/view-empty.d.ts +44 -0
- package/dist/plugins/image/view-empty.js +61 -0
- package/dist/plugins/image/view-filled.d.ts +49 -0
- package/dist/plugins/image/view-filled.js +282 -0
- package/dist/plugins/index.d.ts +21 -0
- package/dist/plugins/index.js +22 -0
- package/dist/plugins/link-preview/README.md +69 -0
- package/dist/plugins/link-preview/README.ru.md +70 -0
- package/dist/plugins/link-preview/index.d.ts +169 -0
- package/dist/plugins/link-preview/index.js +698 -0
- package/dist/plugins/link-preview/link-preview.css +254 -0
- package/dist/plugins/link-preview/locale/en.d.ts +14 -0
- package/dist/plugins/link-preview/locale/en.js +13 -0
- package/dist/plugins/link-preview/locale/keys.d.ts +5 -0
- package/dist/plugins/link-preview/locale/ru.d.ts +14 -0
- package/dist/plugins/link-preview/locale/ru.js +13 -0
- package/dist/plugins/list/README.md +59 -0
- package/dist/plugins/list/README.ru.md +60 -0
- package/dist/plugins/list/index.d.ts +134 -0
- package/dist/plugins/list/index.js +566 -0
- package/dist/plugins/list/list.css +57 -0
- package/dist/plugins/list/locale/en.d.ts +5 -0
- package/dist/plugins/list/locale/en.js +4 -0
- package/dist/plugins/list/locale/keys.d.ts +5 -0
- package/dist/plugins/list/locale/ru.d.ts +5 -0
- package/dist/plugins/list/locale/ru.js +4 -0
- package/dist/plugins/list/mapTextFields.d.ts +1 -0
- package/dist/plugins/list/mapTextFields.js +1 -0
- package/dist/plugins/paragraph/README.md +57 -0
- package/dist/plugins/paragraph/README.ru.md +58 -0
- package/dist/plugins/paragraph/index.d.ts +112 -0
- package/dist/plugins/paragraph/index.js +158 -0
- package/dist/plugins/paragraph/locale/en.d.ts +5 -0
- package/dist/plugins/paragraph/locale/en.js +4 -0
- package/dist/plugins/paragraph/locale/keys.d.ts +5 -0
- package/dist/plugins/paragraph/locale/ru.d.ts +5 -0
- package/dist/plugins/paragraph/locale/ru.js +4 -0
- package/dist/plugins/paragraph/mapTextFields.d.ts +1 -0
- package/dist/plugins/paragraph/mapTextFields.js +1 -0
- package/dist/plugins/paragraph/paragraph.css +56 -0
- package/dist/plugins/person/README.md +72 -0
- package/dist/plugins/person/README.ru.md +73 -0
- package/dist/plugins/person/index.d.ts +189 -0
- package/dist/plugins/person/index.js +777 -0
- package/dist/plugins/person/locale/en.d.ts +18 -0
- package/dist/plugins/person/locale/en.js +17 -0
- package/dist/plugins/person/locale/keys.d.ts +5 -0
- package/dist/plugins/person/locale/ru.d.ts +18 -0
- package/dist/plugins/person/locale/ru.js +17 -0
- package/dist/plugins/person/person.css +431 -0
- package/dist/plugins/person/socialResolver.d.ts +18 -0
- package/dist/plugins/person/socialResolver.js +69 -0
- package/dist/plugins/poll/README.md +96 -0
- package/dist/plugins/poll/README.ru.md +97 -0
- package/dist/plugins/poll/index.d.ts +134 -0
- package/dist/plugins/poll/index.js +825 -0
- package/dist/plugins/poll/locale/en.d.ts +23 -0
- package/dist/plugins/poll/locale/en.js +22 -0
- package/dist/plugins/poll/locale/keys.d.ts +5 -0
- package/dist/plugins/poll/locale/ru.d.ts +23 -0
- package/dist/plugins/poll/locale/ru.js +22 -0
- package/dist/plugins/poll/poll.css +400 -0
- package/dist/plugins/quote/README.md +55 -0
- package/dist/plugins/quote/README.ru.md +56 -0
- package/dist/plugins/quote/index.d.ts +81 -0
- package/dist/plugins/quote/index.js +165 -0
- package/dist/plugins/quote/locale/en.d.ts +6 -0
- package/dist/plugins/quote/locale/en.js +5 -0
- package/dist/plugins/quote/locale/keys.d.ts +5 -0
- package/dist/plugins/quote/locale/ru.d.ts +6 -0
- package/dist/plugins/quote/locale/ru.js +5 -0
- package/dist/plugins/quote/mapTextFields.d.ts +1 -0
- package/dist/plugins/quote/mapTextFields.js +1 -0
- package/dist/plugins/quote/quote.css +72 -0
- package/dist/plugins/raw/README.md +54 -0
- package/dist/plugins/raw/README.ru.md +55 -0
- package/dist/plugins/raw/index.d.ts +62 -0
- package/dist/plugins/raw/index.js +227 -0
- package/dist/plugins/raw/locale/en.d.ts +7 -0
- package/dist/plugins/raw/locale/en.js +6 -0
- package/dist/plugins/raw/locale/keys.d.ts +5 -0
- package/dist/plugins/raw/locale/ru.d.ts +7 -0
- package/dist/plugins/raw/locale/ru.js +6 -0
- package/dist/plugins/raw/raw.css +127 -0
- package/dist/plugins/shared/actionBar.d.ts +19 -0
- package/dist/plugins/shared/actionBar.js +35 -0
- package/dist/plugins/shared/dropzone.d.ts +106 -0
- package/dist/plugins/shared/dropzone.js +107 -0
- package/dist/plugins/shared/fileInput.d.ts +44 -0
- package/dist/plugins/shared/fileInput.js +62 -0
- package/dist/plugins/spoiler/README.md +55 -0
- package/dist/plugins/spoiler/README.ru.md +56 -0
- package/dist/plugins/spoiler/index.d.ts +61 -0
- package/dist/plugins/spoiler/index.js +169 -0
- package/dist/plugins/spoiler/locale/en.d.ts +7 -0
- package/dist/plugins/spoiler/locale/en.js +6 -0
- package/dist/plugins/spoiler/locale/keys.d.ts +5 -0
- package/dist/plugins/spoiler/locale/ru.d.ts +7 -0
- package/dist/plugins/spoiler/locale/ru.js +6 -0
- package/dist/plugins/spoiler/spoiler.css +101 -0
- package/dist/plugins/table/README.md +55 -0
- package/dist/plugins/table/README.ru.md +56 -0
- package/dist/plugins/table/index.d.ts +85 -0
- package/dist/plugins/table/index.js +399 -0
- package/dist/plugins/table/locale/en.d.ts +9 -0
- package/dist/plugins/table/locale/en.js +8 -0
- package/dist/plugins/table/locale/keys.d.ts +5 -0
- package/dist/plugins/table/locale/ru.d.ts +9 -0
- package/dist/plugins/table/locale/ru.js +8 -0
- package/dist/plugins/table/table.css +58 -0
- package/dist/plugins/toggle/README.md +56 -0
- package/dist/plugins/toggle/README.ru.md +57 -0
- package/dist/plugins/toggle/index.d.ts +69 -0
- package/dist/plugins/toggle/index.js +191 -0
- package/dist/plugins/toggle/locale/en.d.ts +7 -0
- package/dist/plugins/toggle/locale/en.js +6 -0
- package/dist/plugins/toggle/locale/keys.d.ts +5 -0
- package/dist/plugins/toggle/locale/ru.d.ts +7 -0
- package/dist/plugins/toggle/locale/ru.js +6 -0
- package/dist/plugins/toggle/toggle.css +101 -0
- package/dist/plugins/warning/README.md +55 -0
- package/dist/plugins/warning/README.ru.md +56 -0
- package/dist/plugins/warning/index.d.ts +66 -0
- package/dist/plugins/warning/index.js +167 -0
- package/dist/plugins/warning/locale/en.d.ts +6 -0
- package/dist/plugins/warning/locale/en.js +5 -0
- package/dist/plugins/warning/locale/keys.d.ts +5 -0
- package/dist/plugins/warning/locale/ru.d.ts +6 -0
- package/dist/plugins/warning/locale/ru.js +5 -0
- package/dist/plugins/warning/warning.css +63 -0
- package/dist/renderer/async.d.ts +1 -0
- package/dist/renderer/async.js +7 -0
- package/dist/renderer/errors.d.ts +27 -0
- package/dist/renderer/errors.js +48 -0
- package/dist/renderer/index.d.ts +82 -0
- package/dist/renderer/index.js +413 -0
- package/dist/renderer/inline.d.ts +5 -0
- package/dist/renderer/inline.js +61 -0
- package/dist/renderer/locale/en.d.ts +35 -0
- package/dist/renderer/locale/en.js +29 -0
- package/dist/renderer/locale/ru.d.ts +37 -0
- package/dist/renderer/locale/ru.js +29 -0
- package/dist/renderer/renderers/README.md +7 -0
- package/dist/renderer/renderers/README.ru.md +5 -0
- package/dist/renderer/renderers/async.d.ts +51 -0
- package/dist/renderer/renderers/async.js +99 -0
- package/dist/renderer/renderers/attaches/README.md +48 -0
- package/dist/renderer/renderers/attaches/README.ru.md +48 -0
- package/dist/renderer/renderers/attaches/index.d.ts +37 -0
- package/dist/renderer/renderers/attaches/index.js +451 -0
- package/dist/renderer/renderers/attaches/locale/en.d.ts +11 -0
- package/dist/renderer/renderers/attaches/locale/en.js +7 -0
- package/dist/renderer/renderers/attaches/locale/ru.d.ts +13 -0
- package/dist/renderer/renderers/attaches/locale/ru.js +7 -0
- package/dist/renderer/renderers/attaches/styles.css +196 -0
- package/dist/renderer/renderers/carousel/README.md +43 -0
- package/dist/renderer/renderers/carousel/README.ru.md +43 -0
- package/dist/renderer/renderers/carousel/index.d.ts +7 -0
- package/dist/renderer/renderers/carousel/index.js +110 -0
- package/dist/renderer/renderers/carousel/styles.css +7 -0
- package/dist/renderer/renderers/checklist/README.md +33 -0
- package/dist/renderer/renderers/checklist/README.ru.md +33 -0
- package/dist/renderer/renderers/checklist/index.d.ts +7 -0
- package/dist/renderer/renderers/checklist/index.js +55 -0
- package/dist/renderer/renderers/checklist/styles.css +54 -0
- package/dist/renderer/renderers/code/README.md +33 -0
- package/dist/renderer/renderers/code/README.ru.md +33 -0
- package/dist/renderer/renderers/code/index.d.ts +9 -0
- package/dist/renderer/renderers/code/index.js +137 -0
- package/dist/renderer/renderers/code/locale/en.d.ts +5 -0
- package/dist/renderer/renderers/code/locale/en.js +4 -0
- package/dist/renderer/renderers/code/locale/ru.d.ts +5 -0
- package/dist/renderer/renderers/code/locale/ru.js +4 -0
- package/dist/renderer/renderers/code/styles.css +330 -0
- package/dist/renderer/renderers/columns/README.md +33 -0
- package/dist/renderer/renderers/columns/README.ru.md +33 -0
- package/dist/renderer/renderers/columns/index.d.ts +7 -0
- package/dist/renderer/renderers/columns/index.js +53 -0
- package/dist/renderer/renderers/columns/styles.css +5 -0
- package/dist/renderer/renderers/delimiter/README.md +33 -0
- package/dist/renderer/renderers/delimiter/README.ru.md +33 -0
- package/dist/renderer/renderers/delimiter/index.d.ts +7 -0
- package/dist/renderer/renderers/delimiter/index.js +28 -0
- package/dist/renderer/renderers/delimiter/styles.css +12 -0
- package/dist/renderer/renderers/embed/README.md +35 -0
- package/dist/renderer/renderers/embed/README.ru.md +35 -0
- package/dist/renderer/renderers/embed/index.d.ts +8 -0
- package/dist/renderer/renderers/embed/index.js +66 -0
- package/dist/renderer/renderers/embed/styles.css +217 -0
- package/dist/renderer/renderers/gallery/README.md +41 -0
- package/dist/renderer/renderers/gallery/README.ru.md +41 -0
- package/dist/renderer/renderers/gallery/index.d.ts +8 -0
- package/dist/renderer/renderers/gallery/index.js +329 -0
- package/dist/renderer/renderers/gallery/styles.css +419 -0
- package/dist/renderer/renderers/heading/README.md +33 -0
- package/dist/renderer/renderers/heading/README.ru.md +33 -0
- package/dist/renderer/renderers/heading/index.d.ts +8 -0
- package/dist/renderer/renderers/heading/index.js +38 -0
- package/dist/renderer/renderers/heading/styles.css +26 -0
- package/dist/renderer/renderers/image/README.md +42 -0
- package/dist/renderer/renderers/image/README.ru.md +42 -0
- package/dist/renderer/renderers/image/index.d.ts +7 -0
- package/dist/renderer/renderers/image/index.js +93 -0
- package/dist/renderer/renderers/image/styles.css +40 -0
- package/dist/renderer/renderers/index.d.ts +47 -0
- package/dist/renderer/renderers/index.js +125 -0
- package/dist/renderer/renderers/link-preview/README.md +43 -0
- package/dist/renderer/renderers/link-preview/README.ru.md +43 -0
- package/dist/renderer/renderers/link-preview/index.d.ts +9 -0
- package/dist/renderer/renderers/link-preview/index.js +118 -0
- package/dist/renderer/renderers/link-preview/styles.css +246 -0
- package/dist/renderer/renderers/list/README.md +33 -0
- package/dist/renderer/renderers/list/README.ru.md +33 -0
- package/dist/renderer/renderers/list/index.d.ts +8 -0
- package/dist/renderer/renderers/list/index.js +42 -0
- package/dist/renderer/renderers/list/styles.css +20 -0
- package/dist/renderer/renderers/paragraph/README.md +33 -0
- package/dist/renderer/renderers/paragraph/README.ru.md +33 -0
- package/dist/renderer/renderers/paragraph/index.d.ts +7 -0
- package/dist/renderer/renderers/paragraph/index.js +35 -0
- package/dist/renderer/renderers/paragraph/styles.css +3 -0
- package/dist/renderer/renderers/person/README.md +44 -0
- package/dist/renderer/renderers/person/README.ru.md +44 -0
- package/dist/renderer/renderers/person/index.d.ts +7 -0
- package/dist/renderer/renderers/person/index.js +213 -0
- package/dist/renderer/renderers/person/locale/en.d.ts +6 -0
- package/dist/renderer/renderers/person/locale/en.js +5 -0
- package/dist/renderer/renderers/person/locale/ru.d.ts +6 -0
- package/dist/renderer/renderers/person/locale/ru.js +5 -0
- package/dist/renderer/renderers/person/styles.css +47 -0
- package/dist/renderer/renderers/poll/README.md +68 -0
- package/dist/renderer/renderers/poll/README.ru.md +68 -0
- package/dist/renderer/renderers/poll/index.d.ts +9 -0
- package/dist/renderer/renderers/poll/index.js +339 -0
- package/dist/renderer/renderers/poll/styles.css +148 -0
- package/dist/renderer/renderers/quote/README.md +33 -0
- package/dist/renderer/renderers/quote/README.ru.md +33 -0
- package/dist/renderer/renderers/quote/index.d.ts +7 -0
- package/dist/renderer/renderers/quote/index.js +59 -0
- package/dist/renderer/renderers/quote/styles.css +43 -0
- package/dist/renderer/renderers/raw/README.md +33 -0
- package/dist/renderer/renderers/raw/README.ru.md +33 -0
- package/dist/renderer/renderers/raw/index.d.ts +7 -0
- package/dist/renderer/renderers/raw/index.js +27 -0
- package/dist/renderer/renderers/spoiler/README.md +33 -0
- package/dist/renderer/renderers/spoiler/README.ru.md +33 -0
- package/dist/renderer/renderers/spoiler/index.d.ts +9 -0
- package/dist/renderer/renderers/spoiler/index.js +84 -0
- package/dist/renderer/renderers/spoiler/locale/en.d.ts +4 -0
- package/dist/renderer/renderers/spoiler/locale/en.js +3 -0
- package/dist/renderer/renderers/spoiler/locale/ru.d.ts +4 -0
- package/dist/renderer/renderers/spoiler/locale/ru.js +3 -0
- package/dist/renderer/renderers/spoiler/styles.css +61 -0
- package/dist/renderer/renderers/table/README.md +33 -0
- package/dist/renderer/renderers/table/README.ru.md +33 -0
- package/dist/renderer/renderers/table/index.d.ts +7 -0
- package/dist/renderer/renderers/table/index.js +83 -0
- package/dist/renderer/renderers/table/styles.css +34 -0
- package/dist/renderer/renderers/toggle/README.md +33 -0
- package/dist/renderer/renderers/toggle/README.ru.md +33 -0
- package/dist/renderer/renderers/toggle/index.d.ts +7 -0
- package/dist/renderer/renderers/toggle/index.js +59 -0
- package/dist/renderer/renderers/toggle/styles.css +49 -0
- package/dist/renderer/renderers/warning/README.md +33 -0
- package/dist/renderer/renderers/warning/README.ru.md +33 -0
- package/dist/renderer/renderers/warning/index.d.ts +7 -0
- package/dist/renderer/renderers/warning/index.js +62 -0
- package/dist/renderer/renderers/warning/styles.css +41 -0
- package/dist/renderer/styles/base.css +168 -0
- package/dist/renderer/types.d.ts +464 -0
- package/dist/shared/blockDataNormalizers.d.ts +14 -0
- package/dist/shared/blockDataNormalizers.js +235 -0
- package/dist/shared/blockDataValidators.d.ts +81 -0
- package/dist/shared/blockDataValidators.js +313 -0
- package/dist/shared/blockTypes.d.ts +2 -0
- package/dist/shared/blockTypes.js +26 -0
- package/dist/shared/carouselData.d.ts +34 -0
- package/dist/shared/carouselData.js +111 -0
- package/dist/shared/cloneEditorData.d.ts +11 -0
- package/dist/shared/cloneEditorData.js +20 -0
- package/dist/shared/documentTypes.d.ts +35 -0
- package/dist/shared/embedPlayer.d.ts +42 -0
- package/dist/shared/embedPlayer.js +141 -0
- package/dist/shared/fileUtils.d.ts +33 -0
- package/dist/shared/fileUtils.js +109 -0
- package/dist/shared/highlightRuntime.d.ts +38 -0
- package/dist/shared/highlightRuntime.js +75 -0
- package/dist/shared/inlineMarshal.d.ts +82 -0
- package/dist/shared/inlineMarshal.js +215 -0
- package/dist/shared/jsonData.d.ts +11 -0
- package/dist/shared/jsonData.js +53 -0
- package/dist/shared/localeTypes.d.ts +11 -0
- package/dist/shared/mapTextFields.d.ts +89 -0
- package/dist/shared/mapTextFields.js +119 -0
- package/dist/shared/pollData.d.ts +90 -0
- package/dist/shared/pollData.js +231 -0
- package/dist/shared/resolvePath.d.ts +8 -0
- package/dist/shared/resolvePath.js +10 -0
- package/dist/shared/runtime/dompurify.js +2424 -0
- package/dist/shared/runtime/highlightBundle.js +10 -0
- package/dist/shared/runtime/jszip.js +13 -0
- package/dist/shared/sanitize/allowlist.d.ts +21 -0
- package/dist/shared/sanitize/allowlist.js +40 -0
- package/dist/shared/sanitize/escapeHtml.d.ts +6 -0
- package/dist/shared/sanitize/escapeHtml.js +11 -0
- package/dist/shared/sanitize/index.d.ts +8 -0
- package/dist/shared/sanitize/index.js +8 -0
- package/dist/shared/sanitize/parseInline.d.ts +11 -0
- package/dist/shared/sanitize/parseInline.js +25 -0
- package/dist/shared/sanitize/sanitizeHtml.d.ts +8 -0
- package/dist/shared/sanitize/sanitizeHtml.js +19 -0
- package/dist/shared/sanitize/sanitizeRawHtml.d.ts +15 -0
- package/dist/shared/sanitize/sanitizeRawHtml.js +162 -0
- package/dist/shared/sanitize/sanitizeStyle.d.ts +9 -0
- package/dist/shared/sanitize/sanitizeStyle.js +39 -0
- package/dist/shared/sanitize/sanitizeUrl.d.ts +28 -0
- package/dist/shared/sanitize/sanitizeUrl.js +86 -0
- package/dist/shared/sanitize/walker.d.ts +15 -0
- package/dist/shared/sanitize/walker.js +98 -0
- package/dist/shared/styleRegistry.d.ts +4 -0
- package/dist/shared/styleRegistry.js +38 -0
- package/dist/shared/textFormat.d.ts +32 -0
- package/dist/shared/textFormat.js +48 -0
- package/dist/shared/zipRuntime.d.ts +19 -0
- package/dist/shared/zipRuntime.js +54 -0
- package/dist/styles/editor.css +3 -0
- package/dist/types.d.ts +1 -0
- package/package.json +149 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# Paragraph block plugin
|
|
2
|
+
|
|
3
|
+
Editable rich-text paragraph with alignment, inline tools, inline widgets, merge, and block conversion support.
|
|
4
|
+
|
|
5
|
+
## Install and register
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @shelamkoff/rector
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { createEditor } from '@shelamkoff/rector'
|
|
13
|
+
import { Paragraph } from '@shelamkoff/rector/plugins/paragraph'
|
|
14
|
+
import '@shelamkoff/rector/styles/editor.css'
|
|
15
|
+
|
|
16
|
+
const editor = createEditor({
|
|
17
|
+
holder: document.querySelector('#editor'),
|
|
18
|
+
plugins: [new Paragraph()],
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The registered block type is `paragraph`. The class is also exported by the complete `@shelamkoff/rector/plugins` preset and can be loaded through `@shelamkoff/rector/plugins/async`.
|
|
23
|
+
|
|
24
|
+
## Data
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{ "text": "Hello <strong>world</strong>", "align": "left" }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Field reference
|
|
31
|
+
|
|
32
|
+
| Field | Required | Meaning and constraints |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `text` | yes | Non-blank sanitized inline HTML. Serialized text may contain placeholders whose data lives in the block's `inline` map. |
|
|
35
|
+
| `align` | no | `left`, `center`, `right`, or `justify`. When omitted, the editor and renderer use their normal text alignment. |
|
|
36
|
+
|
|
37
|
+
An empty paragraph may exist temporarily while the user is editing. It is not valid persisted paragraph data in strict validation mode.
|
|
38
|
+
|
|
39
|
+
## Configuration
|
|
40
|
+
|
|
41
|
+
Every built-in block plugin accepts two style ownership options: `injectStyles?: boolean` defaults to `true`; set it to `false` when the host bundles that plugin's CSS. `css?: string` adds one host-provided stylesheet URL after the plugin default, or acts as the replacement URL when default injection is disabled.
|
|
42
|
+
|
|
43
|
+
`placeholder?: string` overrides the empty paragraph prompt.
|
|
44
|
+
|
|
45
|
+
## Capabilities
|
|
46
|
+
|
|
47
|
+
Inline tools and widgets; paragraph merge; export for conversion.
|
|
48
|
+
|
|
49
|
+
## Undo, lifecycle, and styles
|
|
50
|
+
|
|
51
|
+
User actions exposed by the plugin enter the command pipeline through the supplied `context.mutate()` capability, so each completed action is one undo/redo step. The editor reference-counts the plugin's declared stylesheet URLs. Removing a block calls its cleanup hook; removing the editor calls `destroy()` for every remaining block and then releases shared plugin resources.
|
|
52
|
+
|
|
53
|
+
Do not remove the editor holder without first calling `editor.destroy()`.
|
|
54
|
+
|
|
55
|
+
## Document output
|
|
56
|
+
|
|
57
|
+
Use the matching renderer from `@shelamkoff/rector/renderer/renderers/paragraph`. The VitePress guide documents configuration, commands and history, extension contracts, document migrations, styling, security, and lifecycle in a sequential form.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Блочный плагин Paragraph
|
|
2
|
+
|
|
3
|
+
Абзац с форматированием, выравниванием, внутристрочными инструментами и виджетами.
|
|
4
|
+
|
|
5
|
+
## Установка и регистрация
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @shelamkoff/rector
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { createEditor } from '@shelamkoff/rector'
|
|
13
|
+
import { Paragraph } from '@shelamkoff/rector/plugins/paragraph'
|
|
14
|
+
import '@shelamkoff/rector/styles/editor.css'
|
|
15
|
+
|
|
16
|
+
const editor = createEditor({
|
|
17
|
+
holder: document.querySelector('#editor'),
|
|
18
|
+
plugins: [new Paragraph()],
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Тип блока — `paragraph`. Класс также экспортируется общей точкой входа `@shelamkoff/rector/plugins` и может загружаться по типу документа через `@shelamkoff/rector/plugins/async`.
|
|
23
|
+
|
|
24
|
+
## Данные
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{ "text": "Привет, <strong>мир</strong>", "align": "left" }
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Поля данных
|
|
31
|
+
|
|
32
|
+
| Поле | Обязательно | Назначение и ограничения |
|
|
33
|
+
| --- | --- | --- |
|
|
34
|
+
| `text` | да | Непустой очищенный внутристрочный HTML. Сериализованный текст может содержать заполнители, данные которых находятся в карте `inline` блока. |
|
|
35
|
+
| `align` | нет | `left`, `center`, `right` или `justify`. Если поле отсутствует, редактор и рендерер используют обычное выравнивание текста. |
|
|
36
|
+
|
|
37
|
+
Пустой абзац может временно существовать во время редактирования. В строгом режиме проверки он не является допустимыми сохранёнными данными абзаца.
|
|
38
|
+
|
|
39
|
+
## Конфигурация
|
|
40
|
+
|
|
41
|
+
Каждый встроенный блочный плагин принимает два параметра владения стилями: `injectStyles?: boolean` по умолчанию равен `true`; укажите `false`, если приложение само включает CSS этого плагина. `css?: string` добавляет URL таблицы стилей приложения после стандартной, а при отключённой стандартной инъекции служит URL замены.
|
|
42
|
+
|
|
43
|
+
`placeholder?: string` заменяет подсказку пустого абзаца.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Возможности
|
|
47
|
+
|
|
48
|
+
Внутристрочные инструменты и виджеты; объединение абзацев; экспорт данных для преобразования блока.
|
|
49
|
+
|
|
50
|
+
## История, жизненный цикл и стили
|
|
51
|
+
|
|
52
|
+
Действия плагина входят в конвейер команд через предоставленный контекст `mutate()`, поэтому одно завершённое действие создаёт один шаг отмены и повтора. Редактор подсчитывает владельцев объявленных URL стилей. Удаление блока вызывает его метод освобождения ресурсов; `editor.destroy()` освобождает оставшиеся блоки и общие ресурсы.
|
|
53
|
+
|
|
54
|
+
Не удаляйте контейнер редактора до вызова `editor.destroy()`.
|
|
55
|
+
|
|
56
|
+
## Вывод документа
|
|
57
|
+
|
|
58
|
+
Используйте фабричную функцию из `@shelamkoff/rector/renderer/renderers/paragraph`. Последовательное руководство VitePress описывает проверку данных, миграции, разработку расширений, диагностику, безопасность и стили.
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type {} from './locale/keys.js'
|
|
2
|
+
/**
|
|
3
|
+
* Consumer configuration for {@link Paragraph}.
|
|
4
|
+
* @typedef {Object} ParagraphConfig
|
|
5
|
+
* @property {string} [placeholder] Text shown by an empty paragraph. The
|
|
6
|
+
* default comes from the active editor locale.
|
|
7
|
+
* @property {boolean} [injectStyles=true] Whether the editor should load the
|
|
8
|
+
* built-in paragraph stylesheet.
|
|
9
|
+
* @property {string} [css] Additional stylesheet URL, or the replacement URL
|
|
10
|
+
* when `injectStyles` is `false`.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Editable paragraph block that stores sanitized rich text and alignment.
|
|
14
|
+
* @extends {BlockPluginAbstract<ParagraphConfig>}
|
|
15
|
+
*/
|
|
16
|
+
export class Paragraph extends BlockPluginAbstract<ParagraphConfig> {
|
|
17
|
+
static isTextBlock: boolean;
|
|
18
|
+
static styles: string[];
|
|
19
|
+
/**
|
|
20
|
+
* Create a Paragraph instance with the supplied consumer configuration.
|
|
21
|
+
* @param {ParagraphConfig} [config]
|
|
22
|
+
*/
|
|
23
|
+
constructor(config?: ParagraphConfig);
|
|
24
|
+
type: string;
|
|
25
|
+
icon: string;
|
|
26
|
+
inlineTools: boolean;
|
|
27
|
+
mapTextFields: typeof mapTextFields;
|
|
28
|
+
/**
|
|
29
|
+
* Return the localized toolbox label for this block.
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
get title(): string;
|
|
33
|
+
/**
|
|
34
|
+
* Set placeholder from editor-level config (lower priority than constructor config).
|
|
35
|
+
* @param {string} placeholder
|
|
36
|
+
* @returns {void}
|
|
37
|
+
*/
|
|
38
|
+
setPlaceholder(placeholder: string): void;
|
|
39
|
+
/**
|
|
40
|
+
* Create the editable DOM owned by this block instance.
|
|
41
|
+
* @param {{ text?: string, align?: string }} data
|
|
42
|
+
* @returns {HTMLElement}
|
|
43
|
+
*/
|
|
44
|
+
render(data: {
|
|
45
|
+
text?: string;
|
|
46
|
+
align?: string;
|
|
47
|
+
}): HTMLElement;
|
|
48
|
+
/**
|
|
49
|
+
* Serialize the current block DOM into document data.
|
|
50
|
+
* @param {HTMLElement} element
|
|
51
|
+
* @returns {{ text: string, align?: string }}
|
|
52
|
+
*/
|
|
53
|
+
save(element: HTMLElement): {
|
|
54
|
+
text: string;
|
|
55
|
+
align?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Check whether serialized data satisfies this block's schema.
|
|
59
|
+
* @param {{ text: string }} data
|
|
60
|
+
* @returns {boolean}
|
|
61
|
+
*/
|
|
62
|
+
validate(data: {
|
|
63
|
+
text: string;
|
|
64
|
+
}): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* Merge another paragraph's data into this element.
|
|
67
|
+
* @param {HTMLElement} element
|
|
68
|
+
* @param {{ text?: string, align?: string }} data
|
|
69
|
+
* @returns {void}
|
|
70
|
+
*/
|
|
71
|
+
merge(element: HTMLElement, data: {
|
|
72
|
+
text?: string;
|
|
73
|
+
align?: string;
|
|
74
|
+
}): void;
|
|
75
|
+
/**
|
|
76
|
+
* Extract transferable data for block type conversion.
|
|
77
|
+
* @param {HTMLElement} element
|
|
78
|
+
* @returns {{ text: string, align?: string }}
|
|
79
|
+
*/
|
|
80
|
+
exportData(element: HTMLElement): {
|
|
81
|
+
text: string;
|
|
82
|
+
align?: string;
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Check if the paragraph content is empty.
|
|
86
|
+
* @param {HTMLElement} element
|
|
87
|
+
* @returns {boolean}
|
|
88
|
+
*/
|
|
89
|
+
isEmpty(element: HTMLElement): boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Consumer configuration for {@link Paragraph}.
|
|
93
|
+
*/
|
|
94
|
+
export type ParagraphConfig = {
|
|
95
|
+
/**
|
|
96
|
+
* Text shown by an empty paragraph. The
|
|
97
|
+
* default comes from the active editor locale.
|
|
98
|
+
*/
|
|
99
|
+
placeholder?: string;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the editor should load the
|
|
102
|
+
* built-in paragraph stylesheet.
|
|
103
|
+
*/
|
|
104
|
+
injectStyles?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Additional stylesheet URL, or the replacement URL
|
|
107
|
+
* when `injectStyles` is `false`.
|
|
108
|
+
*/
|
|
109
|
+
css?: string;
|
|
110
|
+
};
|
|
111
|
+
import { BlockPluginAbstract } from '../BlockPluginAbstract.js';
|
|
112
|
+
import { mapTextFields } from './mapTextFields.js';
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import { sanitizeHtml } from '../../core/sanitize.js'
|
|
2
|
+
import { resolvePath } from '../../shared/resolvePath.js'
|
|
3
|
+
import { BlockPluginAbstract } from '../BlockPluginAbstract.js'
|
|
4
|
+
import { mapTextFields } from './mapTextFields.js'
|
|
5
|
+
import { validateParagraphData } from '../../shared/blockDataValidators.js'
|
|
6
|
+
import { normalizeTextAlign, normalizeTextValue } from '../../shared/textFormat.js'
|
|
7
|
+
|
|
8
|
+
const editorStyles = resolvePath('./paragraph.css', import.meta.url)
|
|
9
|
+
|
|
10
|
+
// Tabler icon: letter-t
|
|
11
|
+
const ICON = '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M6 4l12 0"/><path d="M12 4l0 16"/></svg>'
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Consumer configuration for {@link Paragraph}.
|
|
16
|
+
* @typedef {Object} ParagraphConfig
|
|
17
|
+
* @property {string} [placeholder] Text shown by an empty paragraph. The
|
|
18
|
+
* default comes from the active editor locale.
|
|
19
|
+
* @property {boolean} [injectStyles=true] Whether the editor should load the
|
|
20
|
+
* built-in paragraph stylesheet.
|
|
21
|
+
* @property {string} [css] Additional stylesheet URL, or the replacement URL
|
|
22
|
+
* when `injectStyles` is `false`.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Editable paragraph block that stores sanitized rich text and alignment.
|
|
27
|
+
* @extends {BlockPluginAbstract<ParagraphConfig>}
|
|
28
|
+
*/
|
|
29
|
+
export class Paragraph extends BlockPluginAbstract {
|
|
30
|
+
static isTextBlock = true
|
|
31
|
+
static styles = [editorStyles]
|
|
32
|
+
type = 'paragraph'
|
|
33
|
+
icon = ICON
|
|
34
|
+
inlineTools = true
|
|
35
|
+
mapTextFields = mapTextFields
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Create a Paragraph instance with the supplied consumer configuration.
|
|
39
|
+
* @param {ParagraphConfig} [config]
|
|
40
|
+
*/
|
|
41
|
+
constructor(config) {
|
|
42
|
+
super(config)
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Return the localized toolbox label for this block.
|
|
47
|
+
* @returns {string}
|
|
48
|
+
*/
|
|
49
|
+
get title() {
|
|
50
|
+
return this._t('title', 'Text')
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Set placeholder from editor-level config (lower priority than constructor config).
|
|
55
|
+
* @param {string} placeholder
|
|
56
|
+
* @returns {void}
|
|
57
|
+
*/
|
|
58
|
+
setPlaceholder(placeholder) {
|
|
59
|
+
if (!Object.hasOwn(this._config, 'placeholder')) {
|
|
60
|
+
this._config = /** @type {typeof this._config} */ (Object.freeze({ ...this._config, placeholder }))
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Create the editable DOM owned by this block instance.
|
|
66
|
+
* @param {{ text?: string, align?: string }} data
|
|
67
|
+
* @returns {HTMLElement}
|
|
68
|
+
*/
|
|
69
|
+
render(data) {
|
|
70
|
+
const p = document.createElement('p')
|
|
71
|
+
p.classList.add('oe-paragraph')
|
|
72
|
+
p.contentEditable = 'true'
|
|
73
|
+
|
|
74
|
+
const text = normalizeTextValue(data?.text)
|
|
75
|
+
if (text) {
|
|
76
|
+
p.innerHTML = sanitizeHtml(text)
|
|
77
|
+
}
|
|
78
|
+
const align = normalizeTextAlign(data?.align)
|
|
79
|
+
if (align) {
|
|
80
|
+
p.style.textAlign = align
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Placeholder via data attribute + CSS :empty::before
|
|
84
|
+
// Priority: explicit config > i18n locale > empty (no placeholder)
|
|
85
|
+
const placeholder = Object.hasOwn(this._config, 'placeholder')
|
|
86
|
+
? this._config.placeholder
|
|
87
|
+
: this._t('placeholder', '')
|
|
88
|
+
if (placeholder) {
|
|
89
|
+
p.dataset.placeholder = placeholder
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// No Level 1 paste handler — paragraph is a simple text block.
|
|
93
|
+
// Clipboard (Level 2) handles all paste: sanitization, multi-line splitting.
|
|
94
|
+
// Level 1 is for specialized plugins (code block, image) that need custom paste.
|
|
95
|
+
|
|
96
|
+
return p
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Serialize the current block DOM into document data.
|
|
101
|
+
* @param {HTMLElement} element
|
|
102
|
+
* @returns {{ text: string, align?: string }}
|
|
103
|
+
*/
|
|
104
|
+
save(element) {
|
|
105
|
+
const data = { text: element.innerHTML.trim() }
|
|
106
|
+
if (element.style.textAlign) data.align = element.style.textAlign
|
|
107
|
+
return data
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Check whether serialized data satisfies this block's schema.
|
|
112
|
+
* @param {{ text: string }} data
|
|
113
|
+
* @returns {boolean}
|
|
114
|
+
*/
|
|
115
|
+
validate(data) {
|
|
116
|
+
return validateParagraphData(data)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Merge another paragraph's data into this element.
|
|
121
|
+
* @param {HTMLElement} element
|
|
122
|
+
* @param {{ text?: string, align?: string }} data
|
|
123
|
+
* @returns {void}
|
|
124
|
+
*/
|
|
125
|
+
merge(element, data) {
|
|
126
|
+
const text = normalizeTextValue(data.text)
|
|
127
|
+
if (text) {
|
|
128
|
+
element.innerHTML += sanitizeHtml(text)
|
|
129
|
+
}
|
|
130
|
+
// Preserve alignment from merged block if current has none
|
|
131
|
+
const align = normalizeTextAlign(data.align)
|
|
132
|
+
if (align && !element.style.textAlign) {
|
|
133
|
+
element.style.textAlign = align
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Extract transferable data for block type conversion.
|
|
139
|
+
* @param {HTMLElement} element
|
|
140
|
+
* @returns {{ text: string, align?: string }}
|
|
141
|
+
*/
|
|
142
|
+
exportData(element) {
|
|
143
|
+
/** @type {{ text: string, align?: string }} */
|
|
144
|
+
const data = { text: element.innerHTML.trim() }
|
|
145
|
+
if (element.style.textAlign) data.align = element.style.textAlign
|
|
146
|
+
return data
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Check if the paragraph content is empty.
|
|
151
|
+
* @param {HTMLElement} element
|
|
152
|
+
* @returns {boolean}
|
|
153
|
+
*/
|
|
154
|
+
isEmpty(element) {
|
|
155
|
+
return (element.textContent?.trim().length ?? 0) === 0
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { mapParagraphTextFields as mapTextFields } from "../../shared/mapTextFields.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { mapParagraphTextFields as mapTextFields } from '../../shared/mapTextFields.js'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
.oe-paragraph {
|
|
2
|
+
margin: 0;
|
|
3
|
+
padding: 0;
|
|
4
|
+
font-size: var(--oe-font-size, 15px);
|
|
5
|
+
line-height: var(--oe-line-height, 1.7);
|
|
6
|
+
color: var(--oe-text-1, #f5f5f5);
|
|
7
|
+
font-family: var(--oe-font, inherit);
|
|
8
|
+
outline: none;
|
|
9
|
+
word-break: break-word;
|
|
10
|
+
white-space: pre-wrap;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/* Placeholder — only when it's the sole empty block in the editor */
|
|
14
|
+
.oe-blocks > :first-child:last-child .oe-paragraph:empty::before {
|
|
15
|
+
content: attr(data-placeholder);
|
|
16
|
+
color: var(--oe-text-3, #908c8c);
|
|
17
|
+
pointer-events: none;
|
|
18
|
+
font-weight: 400;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/* Inline formatting inside paragraphs */
|
|
22
|
+
.oe-paragraph b,
|
|
23
|
+
.oe-paragraph strong {
|
|
24
|
+
font-weight: 600;
|
|
25
|
+
color: var(--oe-text-1, #f5f5f5);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.oe-paragraph i,
|
|
29
|
+
.oe-paragraph em {
|
|
30
|
+
font-style: italic;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.oe-paragraph a {
|
|
34
|
+
color: var(--oe-text-2, #c4c4c4);
|
|
35
|
+
text-decoration: underline;
|
|
36
|
+
text-underline-offset: 3px;
|
|
37
|
+
transition: color 0.15s;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.oe-paragraph a:hover {
|
|
41
|
+
color: var(--oe-text-1, #f5f5f5);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
.oe-paragraph mark {
|
|
46
|
+
padding: 1px 4px;
|
|
47
|
+
background: var(--oe-mark-bg, rgba(245, 166, 35, 0.2));
|
|
48
|
+
border-radius: 3px;
|
|
49
|
+
color: var(--oe-text-1, #f5f5f5);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.oe-paragraph s,
|
|
53
|
+
.oe-paragraph strike {
|
|
54
|
+
text-decoration: line-through;
|
|
55
|
+
color: var(--oe-text-2, #c4c4c4);
|
|
56
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Person block plugin
|
|
2
|
+
|
|
3
|
+
One or more profile cards with cropped avatars, biography, role, and social links.
|
|
4
|
+
|
|
5
|
+
## Install and register
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @shelamkoff/rector @shelamkoff/cropper
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { createEditor } from '@shelamkoff/rector'
|
|
13
|
+
import { Person } from '@shelamkoff/rector/plugins/person'
|
|
14
|
+
import '@shelamkoff/rector/styles/editor.css'
|
|
15
|
+
|
|
16
|
+
const editor = createEditor({
|
|
17
|
+
holder: document.querySelector('#editor'),
|
|
18
|
+
plugins: [new Person()],
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
The registered block type is `person`. The class is also exported by the complete `@shelamkoff/rector/plugins` preset and can be loaded through `@shelamkoff/rector/plugins/async`.
|
|
23
|
+
|
|
24
|
+
## Data
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"persons": [{
|
|
29
|
+
"avatar": "https://cdn.example/ada.jpg",
|
|
30
|
+
"name": "Ada",
|
|
31
|
+
"role": "Author",
|
|
32
|
+
"bio": "",
|
|
33
|
+
"links": [{ "type": "website", "url": "https://example.com" }]
|
|
34
|
+
}]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Field reference
|
|
39
|
+
|
|
40
|
+
| Field | Required | Meaning and constraints |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `persons` | yes | Non-empty array of profile cards. The saved order is the display order. |
|
|
43
|
+
| `persons[].avatar` | yes | Empty string or canonical media URL. Cropping and uploading replace this value. |
|
|
44
|
+
| `persons[].name` | yes | Profile name string. A profile with both an empty name and empty avatar is treated as empty by the editor. |
|
|
45
|
+
| `persons[].role`, `persons[].bio` | yes | Role and biography strings; empty values are allowed. |
|
|
46
|
+
| `persons[].links` | yes | Array of social links; it may be empty. Every item needs a string `type` and a canonical link-policy `url`. |
|
|
47
|
+
|
|
48
|
+
All fields are present in normalized saved data even when their values are empty. Unknown application fields are not part of the contract and should be stored outside the block.
|
|
49
|
+
|
|
50
|
+
The active profile tab is view state, not document data: `save()` persists all profiles in their current order but does not persist which tab was open. Tab switching therefore remains available in read-only mode so a reader can inspect every profile; it does not create a history entry. Adding, removing, reordering, or editing profiles is disabled in read-only mode.
|
|
51
|
+
|
|
52
|
+
Callback avatar URLs must pass the shared media URL policy. The editor plugin requires `@shelamkoff/cropper`. The multi-card renderer requires `@shelamkoff/carousel`.
|
|
53
|
+
|
|
54
|
+
## Configuration
|
|
55
|
+
|
|
56
|
+
Every built-in block plugin accepts two style ownership options: `injectStyles?: boolean` defaults to `true`; set it to `false` when the host bundles that plugin's CSS. `css?: string` adds one host-provided stylesheet URL after the plugin default, or acts as the replacement URL when default injection is disabled.
|
|
57
|
+
|
|
58
|
+
`uploadFile?: (file: File, context: { signal: AbortSignal }) => Promise<{ url: string }>` uploads the cropped avatar as `avatar.webp` and must stop work when the supplied signal is aborted. Without it, the cropped avatar is embedded in `persons[].avatar` as a data URL, which increases document size. `socialResolvers?: Array<{ test: RegExp | ((url: string) => boolean); type: string; icon?: string }>` extends social-link icon resolution.
|
|
59
|
+
|
|
60
|
+
## Capabilities
|
|
61
|
+
|
|
62
|
+
Multiple profiles; tab reordering; avatar crop/upload; social links; read-only profile navigation; deterministic dialog cleanup.
|
|
63
|
+
|
|
64
|
+
## Undo, lifecycle, and styles
|
|
65
|
+
|
|
66
|
+
User actions exposed by the plugin enter the command pipeline through the supplied `context.mutate()` capability, so each completed action is one undo/redo step. The editor reference-counts the plugin's declared stylesheet URLs. Removing a block calls its cleanup hook; removing the editor calls `destroy()` for every remaining block and then releases shared plugin resources.
|
|
67
|
+
|
|
68
|
+
Do not remove the editor holder without first calling `editor.destroy()`.
|
|
69
|
+
|
|
70
|
+
## Document output
|
|
71
|
+
|
|
72
|
+
Use the matching renderer from `@shelamkoff/rector/renderer/renderers/person`. The VitePress guide documents configuration, commands and history, extension contracts, document migrations, styling, security, and lifecycle in a sequential form.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Блочный плагин Person
|
|
2
|
+
|
|
3
|
+
Одна или несколько карточек профиля с обрезанным аватаром, биографией, ролью и ссылками.
|
|
4
|
+
|
|
5
|
+
## Установка и регистрация
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @shelamkoff/rector @shelamkoff/cropper
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```js
|
|
12
|
+
import { createEditor } from '@shelamkoff/rector'
|
|
13
|
+
import { Person } from '@shelamkoff/rector/plugins/person'
|
|
14
|
+
import '@shelamkoff/rector/styles/editor.css'
|
|
15
|
+
|
|
16
|
+
const editor = createEditor({
|
|
17
|
+
holder: document.querySelector('#editor'),
|
|
18
|
+
plugins: [new Person()],
|
|
19
|
+
})
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Тип блока — `person`. Класс также экспортируется общей точкой входа `@shelamkoff/rector/plugins` и может загружаться по типу документа через `@shelamkoff/rector/plugins/async`.
|
|
23
|
+
|
|
24
|
+
## Данные
|
|
25
|
+
|
|
26
|
+
```json
|
|
27
|
+
{
|
|
28
|
+
"persons": [{
|
|
29
|
+
"avatar": "https://cdn.example/ada.jpg",
|
|
30
|
+
"name": "Ada",
|
|
31
|
+
"role": "Автор",
|
|
32
|
+
"bio": "",
|
|
33
|
+
"links": [{ "type": "website", "url": "https://example.com" }]
|
|
34
|
+
}]
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### Поля данных
|
|
39
|
+
|
|
40
|
+
| Поле | Обязательное | Назначение и ограничения |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| `persons` | да | Непустой массив карточек. Порядок сохранения определяет порядок отображения. |
|
|
43
|
+
| `persons[].avatar` | да | Пустая строка или канонический адрес медиафайла. Обрезка и загрузка заменяют это значение. |
|
|
44
|
+
| `persons[].name` | да | Строка с именем. Профиль с пустыми именем и аватаром редактор считает пустым. |
|
|
45
|
+
| `persons[].role`, `persons[].bio` | да | Строки с ролью и биографией; пустые значения допустимы. |
|
|
46
|
+
| `persons[].links` | да | Массив социальных ссылок, который может быть пустым. Каждому элементу нужны строковый `type` и канонический `url`, разрешённый политикой ссылок. |
|
|
47
|
+
|
|
48
|
+
После нормализации все поля присутствуют в сохранённых данных, даже если их значения пусты. Произвольные поля приложения не входят в контракт и должны храниться вне блока.
|
|
49
|
+
|
|
50
|
+
Открытая вкладка профиля относится к состоянию интерфейса, а не к данным документа: `save()` сохраняет все профили и их порядок, но не номер открытой вкладки. Поэтому переключение вкладок доступно и в режиме просмотра — читатель может открыть любой профиль, а история документа при этом не меняется. Добавление, удаление, сортировка и редактирование профилей в режиме просмотра отключены.
|
|
51
|
+
|
|
52
|
+
Для обработки аватара нужен `@shelamkoff/cropper`, а для нескольких карточек в рендерере — `@shelamkoff/carousel`.
|
|
53
|
+
|
|
54
|
+
## Конфигурация
|
|
55
|
+
|
|
56
|
+
Каждый встроенный блочный плагин принимает два параметра владения стилями: `injectStyles?: boolean` по умолчанию равен `true`; укажите `false`, если приложение само включает CSS этого плагина. `css?: string` добавляет URL таблицы стилей приложения после стандартной, а при отключённой стандартной инъекции служит URL замены.
|
|
57
|
+
|
|
58
|
+
`uploadFile(file, { signal })` загружает `avatar.webp` и должен учитывать переданный `AbortSignal`. Возвращённый URL проходит общую политику адресов медиафайлов. Без этого обработчика обрезанный аватар встраивается в `persons[].avatar` как URL со встроенными данными и увеличивает размер документа. `socialResolvers` расширяет определение типа и значка ссылки.
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
## Возможности
|
|
62
|
+
|
|
63
|
+
Несколько профилей; сортировка вкладок; обрезка и загрузка аватара; ссылки; навигация по профилям в режиме просмотра; детерминированное освобождение ресурсов диалога.
|
|
64
|
+
|
|
65
|
+
## История, жизненный цикл и стили
|
|
66
|
+
|
|
67
|
+
Действия плагина входят в конвейер команд через предоставленный контекст `mutate()`, поэтому одно завершённое действие создаёт один шаг отмены и повтора. Редактор подсчитывает владельцев объявленных URL стилей. Удаление блока вызывает его метод освобождения ресурсов; `editor.destroy()` освобождает оставшиеся блоки и общие ресурсы.
|
|
68
|
+
|
|
69
|
+
Не удаляйте контейнер редактора до вызова `editor.destroy()`.
|
|
70
|
+
|
|
71
|
+
## Вывод документа
|
|
72
|
+
|
|
73
|
+
Используйте фабричную функцию из `@shelamkoff/rector/renderer/renderers/person`. Последовательное руководство VitePress описывает проверку данных, миграции, разработку расширений, диагностику, безопасность и стили.
|