@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,39 @@
|
|
|
1
|
+
import { ALLOWED_STYLE_PROPS } from './allowlist.js'
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Sanitize an inline `style` attribute value.
|
|
5
|
+
* Keeps only whitelisted CSS properties and blocks values containing
|
|
6
|
+
* `expression(` or `url(` (defense against legacy IE expression and CSS fetching).
|
|
7
|
+
*
|
|
8
|
+
* @param {string} style
|
|
9
|
+
* @returns {string} Canonical `prop: value; prop: value;` string, or '' if nothing left.
|
|
10
|
+
*/
|
|
11
|
+
export function sanitizeStyle(style) {
|
|
12
|
+
if (!style) return ''
|
|
13
|
+
|
|
14
|
+
/** @type {string[]} */
|
|
15
|
+
const safe = []
|
|
16
|
+
|
|
17
|
+
for (const part of style.split(';')) {
|
|
18
|
+
const trimmed = part.trim()
|
|
19
|
+
if (!trimmed) continue
|
|
20
|
+
|
|
21
|
+
const colonIndex = trimmed.indexOf(':')
|
|
22
|
+
if (colonIndex === -1) continue
|
|
23
|
+
|
|
24
|
+
const property = trimmed.slice(0, colonIndex).trim().toLowerCase()
|
|
25
|
+
const value = trimmed.slice(colonIndex + 1).trim()
|
|
26
|
+
|
|
27
|
+
if (!ALLOWED_STYLE_PROPS.has(property)) continue
|
|
28
|
+
if (!value) continue
|
|
29
|
+
// Block known CSS attack vectors
|
|
30
|
+
if (value.includes('expression')) continue
|
|
31
|
+
if (value.includes('url(')) continue
|
|
32
|
+
|
|
33
|
+
safe.push(`${property}: ${value}`)
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// Match CSSStyleDeclaration/innerHTML serialization so save → render → save
|
|
37
|
+
// remains byte-stable for formatting created through element.style.
|
|
38
|
+
return safe.length > 0 ? `${safe.join('; ')};` : ''
|
|
39
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sanitize a URL string — strip control chars, block dangerous schemes.
|
|
3
|
+
* Returns '#' for rejected URLs so callers can safely set it on an attribute.
|
|
4
|
+
* @param {string} url
|
|
5
|
+
* @returns {string}
|
|
6
|
+
*/
|
|
7
|
+
export function sanitizeUrl(url: string, options?: {}): string;
|
|
8
|
+
/** @param {string} url */
|
|
9
|
+
export function sanitizeExternalUrl(url: string): string;
|
|
10
|
+
/** @param {string} url */
|
|
11
|
+
export function sanitizeMediaUrl(url: string): string;
|
|
12
|
+
/** @param {string} url */
|
|
13
|
+
export function sanitizeDownloadUrl(url: string): string;
|
|
14
|
+
/**
|
|
15
|
+
* Set or remove a URL-bearing DOM attribute according to a field policy.
|
|
16
|
+
* @param {Element} element
|
|
17
|
+
* @param {'href' | 'src' | 'poster'} attribute
|
|
18
|
+
* @param {string} url
|
|
19
|
+
* @param {UrlPolicy} [policy]
|
|
20
|
+
* @returns {string}
|
|
21
|
+
*/
|
|
22
|
+
export function setSafeUrlAttribute(element: Element, attribute: "href" | "src" | "poster", url: string, policy?: UrlPolicy): string;
|
|
23
|
+
export type UrlPolicy = "link" | "external" | "media" | "download";
|
|
24
|
+
export type SanitizeUrlOptions = {
|
|
25
|
+
policy?: UrlPolicy;
|
|
26
|
+
allowRelative?: boolean;
|
|
27
|
+
fallback?: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { DANGEROUS_URL_RE } from './allowlist.js'
|
|
2
|
+
|
|
3
|
+
const LINK_PROTOCOLS = new Set(['http:', 'https:', 'mailto:', 'tel:'])
|
|
4
|
+
const EXTERNAL_PROTOCOLS = new Set(['http:', 'https:'])
|
|
5
|
+
const MEDIA_PROTOCOLS = new Set(['http:', 'https:', 'blob:'])
|
|
6
|
+
const DOWNLOAD_PROTOCOLS = new Set(['http:', 'https:', 'blob:'])
|
|
7
|
+
const SAFE_IMAGE_DATA_RE = /^data:image\/(?:avif|gif|jpeg|png|webp);base64,[a-z0-9+/=\s]+$/i
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {'link' | 'external' | 'media' | 'download'} UrlPolicy
|
|
11
|
+
* @typedef {{
|
|
12
|
+
* policy?: UrlPolicy,
|
|
13
|
+
* allowRelative?: boolean,
|
|
14
|
+
* fallback?: string,
|
|
15
|
+
* }} SanitizeUrlOptions
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
/** @param {UrlPolicy} policy */
|
|
19
|
+
function getAllowedProtocols(policy) {
|
|
20
|
+
if (policy === 'external') return EXTERNAL_PROTOCOLS
|
|
21
|
+
if (policy === 'media') return MEDIA_PROTOCOLS
|
|
22
|
+
if (policy === 'download') return DOWNLOAD_PROTOCOLS
|
|
23
|
+
return LINK_PROTOCOLS
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sanitize a URL string — strip control chars, block dangerous schemes.
|
|
28
|
+
* Returns '#' for rejected URLs so callers can safely set it on an attribute.
|
|
29
|
+
* @param {string} url
|
|
30
|
+
* @returns {string}
|
|
31
|
+
*/
|
|
32
|
+
export function sanitizeUrl(url, options = {}) {
|
|
33
|
+
const fallback = options.fallback ?? '#'
|
|
34
|
+
if (typeof url !== 'string' || !url) return fallback
|
|
35
|
+
|
|
36
|
+
const policy = options.policy ?? 'link'
|
|
37
|
+
const allowRelative = options.allowRelative ?? true
|
|
38
|
+
const stripped = url.replace(/[\x00-\x1f\x7f]/g, '').trim()
|
|
39
|
+
if (!stripped) return fallback
|
|
40
|
+
|
|
41
|
+
const normalized = stripped.replace(/[\t\n\r ]/g, '')
|
|
42
|
+
if (DANGEROUS_URL_RE.test(normalized)) return fallback
|
|
43
|
+
|
|
44
|
+
if ((policy === 'media' || policy === 'download') && SAFE_IMAGE_DATA_RE.test(stripped)) return stripped
|
|
45
|
+
if (/^data\s*:/i.test(normalized)) return fallback
|
|
46
|
+
|
|
47
|
+
if (stripped.startsWith('//')) return allowRelative ? stripped : fallback
|
|
48
|
+
|
|
49
|
+
const schemeMatch = normalized.match(/^([a-z][a-z0-9+.-]*):/i)
|
|
50
|
+
if (!schemeMatch) return allowRelative ? stripped : fallback
|
|
51
|
+
|
|
52
|
+
const protocol = String(schemeMatch[1]).toLowerCase() + ':'
|
|
53
|
+
if (!getAllowedProtocols(policy).has(protocol)) return fallback
|
|
54
|
+
|
|
55
|
+
return stripped
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/** @param {string} url */
|
|
59
|
+
export function sanitizeExternalUrl(url) {
|
|
60
|
+
return sanitizeUrl(url, { policy: 'external' })
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** @param {string} url */
|
|
64
|
+
export function sanitizeMediaUrl(url) {
|
|
65
|
+
return sanitizeUrl(url, { policy: 'media', fallback: '' })
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** @param {string} url */
|
|
69
|
+
export function sanitizeDownloadUrl(url) {
|
|
70
|
+
return sanitizeUrl(url, { policy: 'download', fallback: '' })
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Set or remove a URL-bearing DOM attribute according to a field policy.
|
|
75
|
+
* @param {Element} element
|
|
76
|
+
* @param {'href' | 'src' | 'poster'} attribute
|
|
77
|
+
* @param {string} url
|
|
78
|
+
* @param {UrlPolicy} [policy]
|
|
79
|
+
* @returns {string}
|
|
80
|
+
*/
|
|
81
|
+
export function setSafeUrlAttribute(element, attribute, url, policy = 'link') {
|
|
82
|
+
const safe = sanitizeUrl(url, { policy, fallback: '' })
|
|
83
|
+
if (safe) element.setAttribute(attribute, safe)
|
|
84
|
+
else element.removeAttribute(attribute)
|
|
85
|
+
return safe
|
|
86
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Recursively sanitize a DOM subtree in place.
|
|
3
|
+
*
|
|
4
|
+
* - Unknown tags are unwrapped (children preserved).
|
|
5
|
+
* - Disallowed attributes are stripped.
|
|
6
|
+
* - `<a>` href is sanitized and `rel="noopener noreferrer"` is forced.
|
|
7
|
+
* - `<span style>` is filtered through the style allowlist.
|
|
8
|
+
* - `<span data-inline-plugin>` subtrees keep all their attributes/styles intact
|
|
9
|
+
* (inline plugins manage their own markup; style/class whitelisting here would
|
|
10
|
+
* strip legitimate plugin state like color swatches). Their children are still
|
|
11
|
+
* recursively sanitized so user-authored content inside plugin widgets is safe.
|
|
12
|
+
*
|
|
13
|
+
* @param {Node} node
|
|
14
|
+
*/
|
|
15
|
+
export function sanitizeSubtree(node: Node): void;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { ALLOWED_TAGS, ALLOWED_ATTRS, INLINE_PLUGIN_ATTRS } from './allowlist.js'
|
|
2
|
+
import { sanitizeUrl } from './sanitizeUrl.js'
|
|
3
|
+
import { sanitizeStyle } from './sanitizeStyle.js'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Recursively sanitize a DOM subtree in place.
|
|
7
|
+
*
|
|
8
|
+
* - Unknown tags are unwrapped (children preserved).
|
|
9
|
+
* - Disallowed attributes are stripped.
|
|
10
|
+
* - `<a>` href is sanitized and `rel="noopener noreferrer"` is forced.
|
|
11
|
+
* - `<span style>` is filtered through the style allowlist.
|
|
12
|
+
* - `<span data-inline-plugin>` subtrees keep all their attributes/styles intact
|
|
13
|
+
* (inline plugins manage their own markup; style/class whitelisting here would
|
|
14
|
+
* strip legitimate plugin state like color swatches). Their children are still
|
|
15
|
+
* recursively sanitized so user-authored content inside plugin widgets is safe.
|
|
16
|
+
*
|
|
17
|
+
* @param {Node} node
|
|
18
|
+
*/
|
|
19
|
+
export function sanitizeSubtree(node) {
|
|
20
|
+
let i = 0
|
|
21
|
+
|
|
22
|
+
while (i < node.childNodes.length) {
|
|
23
|
+
const child = /** @type {ChildNode} */ (node.childNodes[i])
|
|
24
|
+
|
|
25
|
+
if (child.nodeType === Node.TEXT_NODE) {
|
|
26
|
+
i++
|
|
27
|
+
continue
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (child.nodeType !== Node.ELEMENT_NODE) {
|
|
31
|
+
child.remove()
|
|
32
|
+
continue
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const el = /** @type {HTMLElement} */ (child)
|
|
36
|
+
const tag = el.tagName.toLowerCase()
|
|
37
|
+
|
|
38
|
+
if (!ALLOWED_TAGS.has(tag)) {
|
|
39
|
+
// Unwrap: keep children, remove the tag itself.
|
|
40
|
+
// Don't advance i — the newly-inserted children must be revisited.
|
|
41
|
+
while (el.firstChild) {
|
|
42
|
+
node.insertBefore(el.firstChild, el)
|
|
43
|
+
}
|
|
44
|
+
el.remove()
|
|
45
|
+
continue
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
// Inline plugin span — preserve attributes/styles, recurse into children.
|
|
49
|
+
if (tag === 'span' && el.hasAttribute('data-inline-plugin')) {
|
|
50
|
+
for (const attr of Array.from(el.attributes)) {
|
|
51
|
+
if (!INLINE_PLUGIN_ATTRS.has(attr.name) || attr.name.startsWith('on')) {
|
|
52
|
+
el.removeAttribute(attr.name)
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
el.removeAttribute('style')
|
|
56
|
+
el.setAttribute('contenteditable', 'false')
|
|
57
|
+
sanitizeSubtree(el)
|
|
58
|
+
i++
|
|
59
|
+
continue
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Strip disallowed attributes
|
|
63
|
+
const allowedAttrs = ALLOWED_ATTRS[tag]
|
|
64
|
+
const attrs = Array.from(el.attributes)
|
|
65
|
+
for (const attr of attrs) {
|
|
66
|
+
if (!allowedAttrs?.has(attr.name)) {
|
|
67
|
+
el.removeAttribute(attr.name)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
if (tag === 'a') {
|
|
72
|
+
const href = el.getAttribute('href') || ''
|
|
73
|
+
el.setAttribute('href', sanitizeUrl(href))
|
|
74
|
+
el.setAttribute('rel', 'noopener noreferrer')
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if (el.hasAttribute('style')) {
|
|
78
|
+
const safeStyle = sanitizeStyle(el.getAttribute('style') || '')
|
|
79
|
+
if (safeStyle) {
|
|
80
|
+
el.setAttribute('style', safeStyle)
|
|
81
|
+
} else {
|
|
82
|
+
el.removeAttribute('style')
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// Unwrap empty `<span>` with no meaningful attributes.
|
|
87
|
+
if (tag === 'span' && !el.getAttribute('style') && !el.getAttribute('class')) {
|
|
88
|
+
while (el.firstChild) {
|
|
89
|
+
node.insertBefore(el.firstChild, el)
|
|
90
|
+
}
|
|
91
|
+
el.remove()
|
|
92
|
+
continue
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
sanitizeSubtree(el)
|
|
96
|
+
i++
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** Reference-counted stylesheet ownership shared by editor and renderer. */
|
|
2
|
+
const entries = new Map()
|
|
3
|
+
|
|
4
|
+
/** @param {string[]} urls */
|
|
5
|
+
export function acquireStyleUrls(urls) {
|
|
6
|
+
const tracked = []
|
|
7
|
+
for (const url of new Set(urls)) {
|
|
8
|
+
const existing = entries.get(url)
|
|
9
|
+
if (existing) {
|
|
10
|
+
existing.count++
|
|
11
|
+
} else {
|
|
12
|
+
const link = document.createElement('link')
|
|
13
|
+
link.rel = 'stylesheet'
|
|
14
|
+
link.href = url
|
|
15
|
+
link.dataset.oeStyle = ''
|
|
16
|
+
document.head.appendChild(link)
|
|
17
|
+
entries.set(url, { count: 1, link })
|
|
18
|
+
}
|
|
19
|
+
tracked.push(url)
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let released = false
|
|
23
|
+
return {
|
|
24
|
+
destroy() {
|
|
25
|
+
if (released) return
|
|
26
|
+
released = true
|
|
27
|
+
for (const url of tracked) {
|
|
28
|
+
const entry = entries.get(url)
|
|
29
|
+
if (!entry) continue
|
|
30
|
+
entry.count--
|
|
31
|
+
if (entry.count <= 0) {
|
|
32
|
+
entry.link.remove()
|
|
33
|
+
entries.delete(url)
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Return a serialized text field only when it is a string.
|
|
3
|
+
*
|
|
4
|
+
* Renderers run before document validation so invalid external documents can
|
|
5
|
+
* still be inspected and reported. Normalizing at the rendering boundary
|
|
6
|
+
* prevents objects and arrays from leaking into the DOM as "[object Object]".
|
|
7
|
+
*
|
|
8
|
+
* @param {unknown} value
|
|
9
|
+
* @returns {string}
|
|
10
|
+
*/
|
|
11
|
+
export function normalizeTextValue(value: unknown): string;
|
|
12
|
+
/**
|
|
13
|
+
* Check whether a value is a supported serialized text alignment.
|
|
14
|
+
* @param {unknown} value
|
|
15
|
+
* @returns {value is 'left' | 'center' | 'right' | 'justify'}
|
|
16
|
+
*/
|
|
17
|
+
export function isTextAlign(value: unknown): value is "left" | "center" | "right" | "justify";
|
|
18
|
+
/**
|
|
19
|
+
* Return a supported text alignment or an empty string for invalid input.
|
|
20
|
+
* @param {unknown} value
|
|
21
|
+
* @returns {'' | 'left' | 'center' | 'right' | 'justify'}
|
|
22
|
+
*/
|
|
23
|
+
export function normalizeTextAlign(value: unknown): "" | "left" | "center" | "right" | "justify";
|
|
24
|
+
/**
|
|
25
|
+
* Normalize a heading level to the supported H2-H6 range.
|
|
26
|
+
* Non-integer and non-finite values fall back to H2.
|
|
27
|
+
* @param {unknown} value
|
|
28
|
+
* @returns {2 | 3 | 4 | 5 | 6}
|
|
29
|
+
*/
|
|
30
|
+
export function normalizeHeadingLevel(value: unknown): 2 | 3 | 4 | 5 | 6;
|
|
31
|
+
/** Supported CSS text-align values in serialized block data. */
|
|
32
|
+
export const TEXT_ALIGNS: readonly string[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** Supported CSS text-align values in serialized block data. */
|
|
2
|
+
export const TEXT_ALIGNS = Object.freeze(['left', 'center', 'right', 'justify'])
|
|
3
|
+
|
|
4
|
+
const TEXT_ALIGN_SET = new Set(TEXT_ALIGNS)
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Return a serialized text field only when it is a string.
|
|
8
|
+
*
|
|
9
|
+
* Renderers run before document validation so invalid external documents can
|
|
10
|
+
* still be inspected and reported. Normalizing at the rendering boundary
|
|
11
|
+
* prevents objects and arrays from leaking into the DOM as "[object Object]".
|
|
12
|
+
*
|
|
13
|
+
* @param {unknown} value
|
|
14
|
+
* @returns {string}
|
|
15
|
+
*/
|
|
16
|
+
export function normalizeTextValue(value) {
|
|
17
|
+
return typeof value === 'string' ? value : ''
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Check whether a value is a supported serialized text alignment.
|
|
22
|
+
* @param {unknown} value
|
|
23
|
+
* @returns {value is 'left' | 'center' | 'right' | 'justify'}
|
|
24
|
+
*/
|
|
25
|
+
export function isTextAlign(value) {
|
|
26
|
+
return typeof value === 'string' && TEXT_ALIGN_SET.has(value)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Return a supported text alignment or an empty string for invalid input.
|
|
31
|
+
* @param {unknown} value
|
|
32
|
+
* @returns {'' | 'left' | 'center' | 'right' | 'justify'}
|
|
33
|
+
*/
|
|
34
|
+
export function normalizeTextAlign(value) {
|
|
35
|
+
return isTextAlign(value) ? value : ''
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Normalize a heading level to the supported H2-H6 range.
|
|
40
|
+
* Non-integer and non-finite values fall back to H2.
|
|
41
|
+
* @param {unknown} value
|
|
42
|
+
* @returns {2 | 3 | 4 | 5 | 6}
|
|
43
|
+
*/
|
|
44
|
+
export function normalizeHeadingLevel(value) {
|
|
45
|
+
const number = Number(value)
|
|
46
|
+
if (!Number.isInteger(number)) return 2
|
|
47
|
+
return /** @type {2 | 3 | 4 | 5 | 6} */ (Math.min(Math.max(number, 2), 6))
|
|
48
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @returns {ZipRuntime | null}
|
|
3
|
+
*/
|
|
4
|
+
export function getZipRuntime(): ZipRuntime | null;
|
|
5
|
+
/**
|
|
6
|
+
* @param {ZipRuntime} value
|
|
7
|
+
*/
|
|
8
|
+
export function setZipRuntime(value: ZipRuntime): void;
|
|
9
|
+
/**
|
|
10
|
+
* Load the browser-native local distribution once.
|
|
11
|
+
* @returns {Promise<ZipRuntime>}
|
|
12
|
+
*/
|
|
13
|
+
export function loadZipRuntime(): Promise<ZipRuntime>;
|
|
14
|
+
export type ZipRuntime = new () => {
|
|
15
|
+
file(name: string, content: Blob): unknown;
|
|
16
|
+
generateAsync(options: {
|
|
17
|
+
type: "blob";
|
|
18
|
+
}): Promise<Blob>;
|
|
19
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @ts-check
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @typedef {new () => {
|
|
5
|
+
* file(name: string, content: Blob): unknown,
|
|
6
|
+
* generateAsync(options: { type: 'blob' }): Promise<Blob>
|
|
7
|
+
* }} ZipRuntime
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
/** @type {ZipRuntime | null} */
|
|
11
|
+
let runtime = null
|
|
12
|
+
/** @type {Promise<ZipRuntime> | null} */
|
|
13
|
+
let loadPromise = null
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* @returns {ZipRuntime | null}
|
|
17
|
+
*/
|
|
18
|
+
export function getZipRuntime() {
|
|
19
|
+
if (!runtime && typeof globalThis !== 'undefined') {
|
|
20
|
+
const globalRuntime = /** @type {{ JSZip?: ZipRuntime }} */ (globalThis).JSZip
|
|
21
|
+
if (globalRuntime) runtime = globalRuntime
|
|
22
|
+
}
|
|
23
|
+
return runtime
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* @param {ZipRuntime} value
|
|
28
|
+
*/
|
|
29
|
+
export function setZipRuntime(value) {
|
|
30
|
+
runtime = value
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Load the browser-native local distribution once.
|
|
35
|
+
* @returns {Promise<ZipRuntime>}
|
|
36
|
+
*/
|
|
37
|
+
export function loadZipRuntime() {
|
|
38
|
+
const current = getZipRuntime()
|
|
39
|
+
if (current) return Promise.resolve(current)
|
|
40
|
+
if (loadPromise) return loadPromise
|
|
41
|
+
|
|
42
|
+
loadPromise = import('./runtime/jszip.js')
|
|
43
|
+
.then(() => {
|
|
44
|
+
const loaded = getZipRuntime()
|
|
45
|
+
if (!loaded) throw new Error('JSZip runtime failed to initialize')
|
|
46
|
+
return loaded
|
|
47
|
+
})
|
|
48
|
+
.catch(error => {
|
|
49
|
+
loadPromise = null
|
|
50
|
+
throw error
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
return loadPromise
|
|
54
|
+
}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './core/types.js'
|
package/package.json
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shelamkoff/rector",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Extensible browser-native block editor with atomic history, versioned JSON, and document rendering",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.css"
|
|
8
|
+
],
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./core": {
|
|
15
|
+
"types": "./dist/core/index.d.ts",
|
|
16
|
+
"import": "./dist/core/index.js"
|
|
17
|
+
},
|
|
18
|
+
"./types": {
|
|
19
|
+
"types": "./dist/types.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./plugins": {
|
|
22
|
+
"types": "./dist/plugins/index.d.ts",
|
|
23
|
+
"import": "./dist/plugins/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./plugins/async": {
|
|
26
|
+
"types": "./dist/plugins/async.d.ts",
|
|
27
|
+
"import": "./dist/plugins/async.js"
|
|
28
|
+
},
|
|
29
|
+
"./plugins/*": {
|
|
30
|
+
"types": "./dist/plugins/*/index.d.ts",
|
|
31
|
+
"import": "./dist/plugins/*/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./inline-plugins/color": {
|
|
34
|
+
"types": "./dist/inline-plugins/color.d.ts",
|
|
35
|
+
"import": "./dist/inline-plugins/color.js"
|
|
36
|
+
},
|
|
37
|
+
"./inline-plugins/mention": {
|
|
38
|
+
"types": "./dist/inline-plugins/mention/index.d.ts",
|
|
39
|
+
"import": "./dist/inline-plugins/mention/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./inline-tools": {
|
|
42
|
+
"types": "./dist/inline-tools/defaults.d.ts",
|
|
43
|
+
"import": "./dist/inline-tools/defaults.js"
|
|
44
|
+
},
|
|
45
|
+
"./inline-tools/*": {
|
|
46
|
+
"types": "./dist/inline-tools/*.d.ts",
|
|
47
|
+
"import": "./dist/inline-tools/*.js"
|
|
48
|
+
},
|
|
49
|
+
"./renderer": {
|
|
50
|
+
"types": "./dist/renderer/index.d.ts",
|
|
51
|
+
"import": "./dist/renderer/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./renderer/types": {
|
|
54
|
+
"types": "./dist/renderer/types.d.ts"
|
|
55
|
+
},
|
|
56
|
+
"./renderer/async": {
|
|
57
|
+
"types": "./dist/renderer/async.d.ts",
|
|
58
|
+
"import": "./dist/renderer/async.js"
|
|
59
|
+
},
|
|
60
|
+
"./renderer/renderers": {
|
|
61
|
+
"types": "./dist/renderer/renderers/index.d.ts",
|
|
62
|
+
"import": "./dist/renderer/renderers/index.js"
|
|
63
|
+
},
|
|
64
|
+
"./renderer/renderers/async": {
|
|
65
|
+
"types": "./dist/renderer/renderers/async.d.ts",
|
|
66
|
+
"import": "./dist/renderer/renderers/async.js"
|
|
67
|
+
},
|
|
68
|
+
"./renderer/renderers/*": {
|
|
69
|
+
"types": "./dist/renderer/renderers/*/index.d.ts",
|
|
70
|
+
"import": "./dist/renderer/renderers/*/index.js"
|
|
71
|
+
},
|
|
72
|
+
"./locale/*": {
|
|
73
|
+
"types": "./dist/locale/*.d.ts",
|
|
74
|
+
"import": "./dist/locale/*.js"
|
|
75
|
+
},
|
|
76
|
+
"./styles/editor.css": "./dist/styles/editor.css",
|
|
77
|
+
"./styles/renderer.css": "./dist/renderer/styles/base.css",
|
|
78
|
+
"./styles/themes/*": "./dist/core/themes/*.css",
|
|
79
|
+
"./package.json": "./package.json"
|
|
80
|
+
},
|
|
81
|
+
"files": [
|
|
82
|
+
"dist",
|
|
83
|
+
"README.md",
|
|
84
|
+
"LICENSE",
|
|
85
|
+
"NOTICE",
|
|
86
|
+
"THIRD_PARTY_LICENSES.txt"
|
|
87
|
+
],
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "npm run docs:validate-readmes && node scripts/build-package.mjs",
|
|
90
|
+
"build:types": "node scripts/generate-declarations.mjs --out dist",
|
|
91
|
+
"typecheck": "node node_modules/typescript/bin/tsc -p jsconfig.json",
|
|
92
|
+
"docs:validate-readmes": "node scripts/validate-extension-readmes.mjs",
|
|
93
|
+
"docs:sync": "npm run docs:validate-readmes && node scripts/sync-vitepress-readmes.mjs",
|
|
94
|
+
"docs:dev": "npm run docs:sync && vitepress dev docs --host 127.0.0.1",
|
|
95
|
+
"docs:build": "npm run docs:sync && vitepress build docs",
|
|
96
|
+
"docs:preview": "vitepress preview docs --host 127.0.0.1",
|
|
97
|
+
"docs:check": "npm run docs:build && node scripts/vitepress-docs-smoke.mjs && node scripts/vitepress-browser-smoke.mjs",
|
|
98
|
+
"test": "node --test",
|
|
99
|
+
"test:browser": "node tests/browser/run.mjs && node tests/browser/physical-history.mjs && node tests/browser/heap-gate.mjs",
|
|
100
|
+
"test:plugin-source": "node scripts/plugin-source-audit.mjs",
|
|
101
|
+
"test:plugin-locales": "node scripts/plugin-locale-audit.mjs",
|
|
102
|
+
"test:docs": "npm run docs:validate-readmes && npm run test:plugin-source && npm run test:plugin-locales && node scripts/documentation-contract-audit.mjs && node scripts/readme-smoke.mjs",
|
|
103
|
+
"test:types": "node --test shared/declarationParity.test.js",
|
|
104
|
+
"test:package": "node scripts/package-consumer-gate.mjs",
|
|
105
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run test:browser && npm run test:docs && npm run test:types && npm run test:package",
|
|
106
|
+
"prepack": "npm run build"
|
|
107
|
+
},
|
|
108
|
+
"dependencies": {
|
|
109
|
+
"@shelamkoff/color-picker": "^1.0.0",
|
|
110
|
+
"@shelamkoff/event-bus": "^1.0.0"
|
|
111
|
+
},
|
|
112
|
+
"peerDependencies": {
|
|
113
|
+
"@shelamkoff/carousel": "^1.0.0",
|
|
114
|
+
"@shelamkoff/cropper": "^1.0.0",
|
|
115
|
+
"@shelamkoff/expose": "^1.0.0"
|
|
116
|
+
},
|
|
117
|
+
"devDependencies": {
|
|
118
|
+
"@tabler/icons-vue": "^3.41.1",
|
|
119
|
+
"typescript": "~5.9.3",
|
|
120
|
+
"vite": "^7.0.0",
|
|
121
|
+
"vitepress": "2.0.0-alpha.17"
|
|
122
|
+
},
|
|
123
|
+
"engines": {
|
|
124
|
+
"node": ">=20"
|
|
125
|
+
},
|
|
126
|
+
"keywords": [
|
|
127
|
+
"editor",
|
|
128
|
+
"block-editor",
|
|
129
|
+
"rich-text",
|
|
130
|
+
"renderer",
|
|
131
|
+
"plugins",
|
|
132
|
+
"framework-agnostic",
|
|
133
|
+
"esm"
|
|
134
|
+
],
|
|
135
|
+
"author": "Shelamkoff",
|
|
136
|
+
"repository": {
|
|
137
|
+
"type": "git",
|
|
138
|
+
"url": "git+https://github.com/Shelamkoff/editor.git"
|
|
139
|
+
},
|
|
140
|
+
"homepage": "https://shelamkoff.github.io/editor/",
|
|
141
|
+
"bugs": {
|
|
142
|
+
"url": "https://github.com/Shelamkoff/editor/issues"
|
|
143
|
+
},
|
|
144
|
+
"license": "MIT",
|
|
145
|
+
"publishConfig": {
|
|
146
|
+
"access": "public",
|
|
147
|
+
"registry": "https://registry.npmjs.org/"
|
|
148
|
+
}
|
|
149
|
+
}
|