@ecomcx/ecomweb-editor 0.0.0-stage → 1.17.1
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/README.md +107 -2
- package/node_modules/@floating-ui/core/LICENSE +20 -0
- package/node_modules/@floating-ui/core/README.md +4 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.min.mjs +1 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.browser.mjs +1164 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.d.mts +535 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.d.ts +535 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.esm.js +1038 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.mjs +1038 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.js +1183 -0
- package/node_modules/@floating-ui/core/dist/floating-ui.core.umd.min.js +1 -0
- package/node_modules/@floating-ui/core/package.json +63 -0
- package/node_modules/@floating-ui/dom/LICENSE +20 -0
- package/node_modules/@floating-ui/dom/README.md +4 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.min.mjs +1 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.browser.mjs +964 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.mts +362 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.d.ts +362 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.esm.js +789 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs +789 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.js +983 -0
- package/node_modules/@floating-ui/dom/dist/floating-ui.dom.umd.min.js +1 -0
- package/node_modules/@floating-ui/dom/package.json +72 -0
- package/node_modules/@floating-ui/utils/LICENSE +20 -0
- package/node_modules/@floating-ui/utils/README.md +4 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.mts +105 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.d.ts +105 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.mts +47 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.d.ts +47 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.esm.js +165 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +165 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.js +192 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.umd.min.js +1 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.esm.js +136 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs +136 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.js +167 -0
- package/node_modules/@floating-ui/utils/dist/floating-ui.utils.umd.min.js +1 -0
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.d.ts +47 -0
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.esm.js +165 -0
- package/node_modules/@floating-ui/utils/dom/floating-ui.utils.dom.umd.js +192 -0
- package/node_modules/@floating-ui/utils/dom/package.json +6 -0
- package/node_modules/@floating-ui/utils/package.json +70 -0
- package/node_modules/@tiptap/core/LICENSE.md +21 -0
- package/node_modules/@tiptap/core/README.md +18 -0
- package/node_modules/@tiptap/core/dist/index.cjs +8463 -0
- package/node_modules/@tiptap/core/dist/index.d.cts +5798 -0
- package/node_modules/@tiptap/core/dist/index.d.ts +5797 -0
- package/node_modules/@tiptap/core/dist/index.js +8288 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.cjs +70 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.cts +28 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.d.ts +28 -0
- package/node_modules/@tiptap/core/dist/jsx-runtime/jsx-runtime.js +64 -0
- package/node_modules/@tiptap/core/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/node_modules/@tiptap/core/jsx-dev-runtime/index.cjs +1 -0
- package/node_modules/@tiptap/core/jsx-dev-runtime/index.d.cts +1 -0
- package/node_modules/@tiptap/core/jsx-dev-runtime/index.d.ts +1 -0
- package/node_modules/@tiptap/core/jsx-dev-runtime/index.js +1 -0
- package/node_modules/@tiptap/core/jsx-runtime/index.cjs +1 -0
- package/node_modules/@tiptap/core/jsx-runtime/index.d.cts +1 -0
- package/node_modules/@tiptap/core/jsx-runtime/index.d.ts +1 -0
- package/node_modules/@tiptap/core/jsx-runtime/index.js +1 -0
- package/node_modules/@tiptap/core/package.json +74 -0
- package/node_modules/@tiptap/extension-blockquote/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-blockquote/README.md +18 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.cjs +132 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.d.cts +40 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.d.ts +40 -0
- package/node_modules/@tiptap/extension-blockquote/dist/index.js +126 -0
- package/node_modules/@tiptap/extension-blockquote/package.json +52 -0
- package/node_modules/@tiptap/extension-bold/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-bold/README.md +18 -0
- package/node_modules/@tiptap/extension-bold/dist/index.cjs +117 -0
- package/node_modules/@tiptap/extension-bold/dist/index.d.cts +52 -0
- package/node_modules/@tiptap/extension-bold/dist/index.d.ts +52 -0
- package/node_modules/@tiptap/extension-bold/dist/index.js +108 -0
- package/node_modules/@tiptap/extension-bold/package.json +50 -0
- package/node_modules/@tiptap/extension-bubble-menu/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-bubble-menu/README.md +18 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.cjs +333 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.cts +170 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.d.ts +170 -0
- package/node_modules/@tiptap/extension-bubble-menu/dist/index.js +326 -0
- package/node_modules/@tiptap/extension-bubble-menu/package.json +56 -0
- package/node_modules/@tiptap/extension-bullet-list/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-bullet-list/README.md +18 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.cjs +17 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-bullet-list/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-bullet-list/package.json +50 -0
- package/node_modules/@tiptap/extension-code/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-code/README.md +18 -0
- package/node_modules/@tiptap/extension-code/dist/index.cjs +136 -0
- package/node_modules/@tiptap/extension-code/dist/index.d.cts +60 -0
- package/node_modules/@tiptap/extension-code/dist/index.d.ts +60 -0
- package/node_modules/@tiptap/extension-code/dist/index.js +127 -0
- package/node_modules/@tiptap/extension-code/package.json +50 -0
- package/node_modules/@tiptap/extension-code-block/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-code-block/README.md +18 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.cjs +255 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.d.cts +84 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.d.ts +84 -0
- package/node_modules/@tiptap/extension-code-block/dist/index.js +248 -0
- package/node_modules/@tiptap/extension-code-block/package.json +52 -0
- package/node_modules/@tiptap/extension-document/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-document/README.md +18 -0
- package/node_modules/@tiptap/extension-document/dist/index.cjs +26 -0
- package/node_modules/@tiptap/extension-document/dist/index.d.cts +10 -0
- package/node_modules/@tiptap/extension-document/dist/index.d.ts +10 -0
- package/node_modules/@tiptap/extension-document/dist/index.js +22 -0
- package/node_modules/@tiptap/extension-document/package.json +50 -0
- package/node_modules/@tiptap/extension-dropcursor/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-dropcursor/README.md +18 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.cjs +17 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-dropcursor/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-dropcursor/package.json +50 -0
- package/node_modules/@tiptap/extension-floating-menu/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-floating-menu/README.md +18 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.cjs +272 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.cts +180 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.d.ts +180 -0
- package/node_modules/@tiptap/extension-floating-menu/dist/index.js +265 -0
- package/node_modules/@tiptap/extension-floating-menu/package.json +55 -0
- package/node_modules/@tiptap/extension-gapcursor/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-gapcursor/README.md +18 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.cjs +17 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-gapcursor/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-gapcursor/package.json +50 -0
- package/node_modules/@tiptap/extension-hard-break/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-hard-break/README.md +18 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.cjs +69 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-hard-break/dist/index.js +64 -0
- package/node_modules/@tiptap/extension-hard-break/package.json +50 -0
- package/node_modules/@tiptap/extension-heading/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-heading/README.md +18 -0
- package/node_modules/@tiptap/extension-heading/dist/index.cjs +93 -0
- package/node_modules/@tiptap/extension-heading/dist/index.d.cts +50 -0
- package/node_modules/@tiptap/extension-heading/dist/index.d.ts +50 -0
- package/node_modules/@tiptap/extension-heading/dist/index.js +88 -0
- package/node_modules/@tiptap/extension-heading/package.json +50 -0
- package/node_modules/@tiptap/extension-highlight/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-highlight/README.md +18 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.cjs +113 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.d.cts +59 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.d.ts +59 -0
- package/node_modules/@tiptap/extension-highlight/dist/index.js +106 -0
- package/node_modules/@tiptap/extension-highlight/package.json +50 -0
- package/node_modules/@tiptap/extension-horizontal-rule/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-horizontal-rule/README.md +18 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.cjs +78 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-horizontal-rule/dist/index.js +73 -0
- package/node_modules/@tiptap/extension-horizontal-rule/package.json +52 -0
- package/node_modules/@tiptap/extension-image/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-image/README.md +18 -0
- package/node_modules/@tiptap/extension-image/dist/index.cjs +181 -0
- package/node_modules/@tiptap/extension-image/dist/index.d.cts +69 -0
- package/node_modules/@tiptap/extension-image/dist/index.d.ts +69 -0
- package/node_modules/@tiptap/extension-image/dist/index.js +175 -0
- package/node_modules/@tiptap/extension-image/package.json +50 -0
- package/node_modules/@tiptap/extension-italic/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-italic/README.md +18 -0
- package/node_modules/@tiptap/extension-italic/dist/index.cjs +113 -0
- package/node_modules/@tiptap/extension-italic/dist/index.d.cts +55 -0
- package/node_modules/@tiptap/extension-italic/dist/index.d.ts +55 -0
- package/node_modules/@tiptap/extension-italic/dist/index.js +104 -0
- package/node_modules/@tiptap/extension-italic/package.json +50 -0
- package/node_modules/@tiptap/extension-link/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-link/README.md +18 -0
- package/node_modules/@tiptap/extension-link/dist/index.cjs +560 -0
- package/node_modules/@tiptap/extension-link/dist/index.d.cts +159 -0
- package/node_modules/@tiptap/extension-link/dist/index.d.ts +159 -0
- package/node_modules/@tiptap/extension-link/dist/index.js +553 -0
- package/node_modules/@tiptap/extension-link/package.json +56 -0
- package/node_modules/@tiptap/extension-list/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-list/README.md +18 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.cjs +84 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.cts +52 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.d.ts +52 -0
- package/node_modules/@tiptap/extension-list/dist/bullet-list/index.js +82 -0
- package/node_modules/@tiptap/extension-list/dist/index.cjs +1570 -0
- package/node_modules/@tiptap/extension-list/dist/index.d.cts +391 -0
- package/node_modules/@tiptap/extension-list/dist/index.d.ts +390 -0
- package/node_modules/@tiptap/extension-list/dist/index.js +1533 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.cjs +308 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.d.cts +30 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.d.ts +30 -0
- package/node_modules/@tiptap/extension-list/dist/item/index.js +307 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.cjs +263 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.d.cts +66 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.d.ts +65 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/index.js +245 -0
- package/node_modules/@tiptap/extension-list/dist/keymap/rolldown-runtime-D7D4PA-g.js +13 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.cjs +1487 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.d.cts +235 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.d.ts +235 -0
- package/node_modules/@tiptap/extension-list/dist/kit/index.js +1486 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.cjs +671 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.cts +120 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.d.ts +120 -0
- package/node_modules/@tiptap/extension-list/dist/ordered-list/index.js +659 -0
- package/node_modules/@tiptap/extension-list/dist/rolldown-runtime-D7D4PA-g.js +13 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.cjs +327 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.d.cts +69 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.d.ts +69 -0
- package/node_modules/@tiptap/extension-list/dist/task-item/index.js +325 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.cjs +121 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-list/dist/task-list/index.js +120 -0
- package/node_modules/@tiptap/extension-list/package.json +108 -0
- package/node_modules/@tiptap/extension-list-item/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-list-item/README.md +18 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.cjs +17 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-list-item/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-list-item/package.json +50 -0
- package/node_modules/@tiptap/extension-list-keymap/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-list-keymap/README.md +18 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.cjs +23 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-list-keymap/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-list-keymap/package.json +50 -0
- package/node_modules/@tiptap/extension-ordered-list/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-ordered-list/README.md +18 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.cjs +17 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.d.cts +2 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.d.ts +2 -0
- package/node_modules/@tiptap/extension-ordered-list/dist/index.js +7 -0
- package/node_modules/@tiptap/extension-ordered-list/package.json +50 -0
- package/node_modules/@tiptap/extension-paragraph/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-paragraph/README.md +18 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.cjs +73 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.d.cts +29 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.d.ts +29 -0
- package/node_modules/@tiptap/extension-paragraph/dist/index.js +68 -0
- package/node_modules/@tiptap/extension-paragraph/package.json +50 -0
- package/node_modules/@tiptap/extension-strike/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-strike/README.md +18 -0
- package/node_modules/@tiptap/extension-strike/dist/index.cjs +88 -0
- package/node_modules/@tiptap/extension-strike/dist/index.d.cts +47 -0
- package/node_modules/@tiptap/extension-strike/dist/index.d.ts +47 -0
- package/node_modules/@tiptap/extension-strike/dist/index.js +81 -0
- package/node_modules/@tiptap/extension-strike/package.json +50 -0
- package/node_modules/@tiptap/extension-subscript/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-subscript/README.md +18 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.cjs +56 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.cts +39 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.d.ts +39 -0
- package/node_modules/@tiptap/extension-subscript/dist/index.js +51 -0
- package/node_modules/@tiptap/extension-subscript/package.json +52 -0
- package/node_modules/@tiptap/extension-superscript/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-superscript/README.md +18 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.cjs +56 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.cts +39 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.d.ts +39 -0
- package/node_modules/@tiptap/extension-superscript/dist/index.js +51 -0
- package/node_modules/@tiptap/extension-superscript/package.json +52 -0
- package/node_modules/@tiptap/extension-table/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-table/README.md +18 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.cjs +142 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-table/dist/cell/index.js +141 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.cjs +142 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-table/dist/header/index.js +141 -0
- package/node_modules/@tiptap/extension-table/dist/index.cjs +832 -0
- package/node_modules/@tiptap/extension-table/dist/index.d.cts +344 -0
- package/node_modules/@tiptap/extension-table/dist/index.d.ts +344 -0
- package/node_modules/@tiptap/extension-table/dist/index.js +819 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.cjs +817 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.d.cts +265 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.d.ts +265 -0
- package/node_modules/@tiptap/extension-table/dist/kit/index.js +816 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.cjs +29 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.d.cts +35 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.d.ts +35 -0
- package/node_modules/@tiptap/extension-table/dist/row/index.js +28 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.cjs +616 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.d.cts +254 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.d.ts +254 -0
- package/node_modules/@tiptap/extension-table/dist/table/index.js +609 -0
- package/node_modules/@tiptap/extension-table/package.json +92 -0
- package/node_modules/@tiptap/extension-text/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-text/README.md +18 -0
- package/node_modules/@tiptap/extension-text/dist/index.cjs +28 -0
- package/node_modules/@tiptap/extension-text/dist/index.d.cts +10 -0
- package/node_modules/@tiptap/extension-text/dist/index.d.ts +10 -0
- package/node_modules/@tiptap/extension-text/dist/index.js +24 -0
- package/node_modules/@tiptap/extension-text/package.json +50 -0
- package/node_modules/@tiptap/extension-text-align/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-text-align/README.md +18 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.cjs +73 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.d.cts +53 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.d.ts +53 -0
- package/node_modules/@tiptap/extension-text-align/dist/index.js +68 -0
- package/node_modules/@tiptap/extension-text-align/package.json +50 -0
- package/node_modules/@tiptap/extension-text-style/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-text-style/README.md +18 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.cjs +121 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.cts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.d.ts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/background-color/index.js +116 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.cjs +121 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.d.cts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.d.ts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/color/index.js +116 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.cjs +120 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.cts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.d.ts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-family/index.js +115 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.cjs +120 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.cts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.d.ts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/font-size/index.js +115 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.cjs +298 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.d.cts +275 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.d.ts +275 -0
- package/node_modules/@tiptap/extension-text-style/dist/index.js +291 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.cjs +120 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.cts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.d.ts +161 -0
- package/node_modules/@tiptap/extension-text-style/dist/line-height/index.js +115 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.cjs +80 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.cts +170 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.d.ts +170 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style/index.js +79 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.cjs +292 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.cts +244 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.d.ts +244 -0
- package/node_modules/@tiptap/extension-text-style/dist/text-style-kit/index.js +291 -0
- package/node_modules/@tiptap/extension-text-style/package.json +106 -0
- package/node_modules/@tiptap/extension-underline/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-underline/README.md +18 -0
- package/node_modules/@tiptap/extension-underline/dist/index.cjs +81 -0
- package/node_modules/@tiptap/extension-underline/dist/index.d.cts +39 -0
- package/node_modules/@tiptap/extension-underline/dist/index.d.ts +39 -0
- package/node_modules/@tiptap/extension-underline/dist/index.js +76 -0
- package/node_modules/@tiptap/extension-underline/package.json +50 -0
- package/node_modules/@tiptap/extension-youtube/LICENSE.md +21 -0
- package/node_modules/@tiptap/extension-youtube/README.md +18 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.cjs +254 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.d.cts +204 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.d.ts +204 -0
- package/node_modules/@tiptap/extension-youtube/dist/index.js +246 -0
- package/node_modules/@tiptap/extension-youtube/package.json +50 -0
- package/node_modules/@tiptap/extensions/LICENSE.md +21 -0
- package/node_modules/@tiptap/extensions/README.md +18 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.cjs +87 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.d.cts +70 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.d.ts +70 -0
- package/node_modules/@tiptap/extensions/dist/character-count/index.js +86 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.cjs +27 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.cts +32 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.d.ts +32 -0
- package/node_modules/@tiptap/extensions/dist/drop-cursor/index.js +26 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.cjs +48 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.d.cts +29 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.d.ts +29 -0
- package/node_modules/@tiptap/extensions/dist/focus/index.js +47 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.cjs +29 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.cts +26 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.d.ts +26 -0
- package/node_modules/@tiptap/extensions/dist/gap-cursor/index.js +28 -0
- package/node_modules/@tiptap/extensions/dist/index.cjs +711 -0
- package/node_modules/@tiptap/extensions/dist/index.d.cts +321 -0
- package/node_modules/@tiptap/extensions/dist/index.d.ts +321 -0
- package/node_modules/@tiptap/extensions/dist/index.js +699 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.cjs +372 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.d.cts +91 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.d.ts +91 -0
- package/node_modules/@tiptap/extensions/dist/placeholder/index.js +368 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.cjs +72 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.d.cts +20 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.d.ts +20 -0
- package/node_modules/@tiptap/extensions/dist/selection/index.js +71 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.cjs +62 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.cts +30 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.d.ts +30 -0
- package/node_modules/@tiptap/extensions/dist/trailing-node/index.js +60 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.cjs +48 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.cts +45 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.d.ts +45 -0
- package/node_modules/@tiptap/extensions/dist/undo-redo/index.js +47 -0
- package/node_modules/@tiptap/extensions/package.json +116 -0
- package/node_modules/@tiptap/pm/LICENSE +21 -0
- package/node_modules/@tiptap/pm/README.md +22 -0
- package/node_modules/@tiptap/pm/THIRD_PARTY_LICENSES.md +47 -0
- package/node_modules/@tiptap/pm/changeset/index.ts +1 -0
- package/node_modules/@tiptap/pm/commands/index.ts +1 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/changeset/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/commands/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/commands/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/commands/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/commands/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/dropcursor/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/dropcursor/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/dropcursor/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/gapcursor/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/gapcursor/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/gapcursor/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/history/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/history/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/history/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/history/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/inputrules/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/inputrules/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/inputrules/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/keymap/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/keymap/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/keymap/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/keymap/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/model/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/model/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/model/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/model/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/schema-list/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/schema-list/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/schema-list/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/state/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/state/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/state/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/state/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/tables/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/tables/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/tables/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/tables/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/transform/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/transform/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/transform/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/transform/index.js +2 -0
- package/node_modules/@tiptap/pm/dist/view/index.cjs +9 -0
- package/node_modules/@tiptap/pm/dist/view/index.d.cts +1 -0
- package/node_modules/@tiptap/pm/dist/view/index.d.ts +1 -0
- package/node_modules/@tiptap/pm/dist/view/index.js +2 -0
- package/node_modules/@tiptap/pm/dropcursor/index.ts +1 -0
- package/node_modules/@tiptap/pm/gapcursor/index.ts +1 -0
- package/node_modules/@tiptap/pm/history/index.ts +1 -0
- package/node_modules/@tiptap/pm/inputrules/index.ts +1 -0
- package/node_modules/@tiptap/pm/keymap/index.ts +1 -0
- package/node_modules/@tiptap/pm/model/index.ts +1 -0
- package/node_modules/@tiptap/pm/package.json +166 -0
- package/node_modules/@tiptap/pm/schema-list/index.ts +1 -0
- package/node_modules/@tiptap/pm/state/index.ts +1 -0
- package/node_modules/@tiptap/pm/tables/index.ts +1 -0
- package/node_modules/@tiptap/pm/transform/index.ts +1 -0
- package/node_modules/@tiptap/pm/view/index.ts +1 -0
- package/node_modules/@tiptap/react/LICENSE.md +21 -0
- package/node_modules/@tiptap/react/README.md +18 -0
- package/node_modules/@tiptap/react/dist/index.cjs +1396 -0
- package/node_modules/@tiptap/react/dist/index.d.cts +632 -0
- package/node_modules/@tiptap/react/dist/index.d.ts +632 -0
- package/node_modules/@tiptap/react/dist/index.js +1337 -0
- package/node_modules/@tiptap/react/dist/menus/index.cjs +469 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.cts +21 -0
- package/node_modules/@tiptap/react/dist/menus/index.d.ts +21 -0
- package/node_modules/@tiptap/react/dist/menus/index.js +444 -0
- package/node_modules/@tiptap/react/package.json +80 -0
- package/node_modules/@tiptap/starter-kit/LICENSE.md +21 -0
- package/node_modules/@tiptap/starter-kit/README.md +18 -0
- package/node_modules/@tiptap/starter-kit/dist/index.cjs +76 -0
- package/node_modules/@tiptap/starter-kit/dist/index.d.cts +137 -0
- package/node_modules/@tiptap/starter-kit/dist/index.d.ts +137 -0
- package/node_modules/@tiptap/starter-kit/dist/index.js +71 -0
- package/node_modules/@tiptap/starter-kit/package.json +70 -0
- package/node_modules/@tiptap/suggestion/LICENSE.md +21 -0
- package/node_modules/@tiptap/suggestion/README.md +18 -0
- package/node_modules/@tiptap/suggestion/dist/index.cjs +665 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.cts +419 -0
- package/node_modules/@tiptap/suggestion/dist/index.d.ts +419 -0
- package/node_modules/@tiptap/suggestion/dist/index.js +657 -0
- package/node_modules/@tiptap/suggestion/package.json +54 -0
- package/node_modules/@types/use-sync-external-store/LICENSE +21 -0
- package/node_modules/@types/use-sync-external-store/README.md +15 -0
- package/node_modules/@types/use-sync-external-store/index.d.ts +5 -0
- package/node_modules/@types/use-sync-external-store/package.json +30 -0
- package/node_modules/@types/use-sync-external-store/shim/index.d.ts +1 -0
- package/node_modules/@types/use-sync-external-store/shim/with-selector.d.ts +1 -0
- package/node_modules/@types/use-sync-external-store/with-selector.d.ts +7 -0
- package/node_modules/fast-equals/LICENSE +21 -0
- package/node_modules/fast-equals/README.md +479 -0
- package/node_modules/fast-equals/dist/cjs/index.cjs +796 -0
- package/node_modules/fast-equals/dist/cjs/index.d.cts +211 -0
- package/node_modules/fast-equals/dist/es/index.d.mts +211 -0
- package/node_modules/fast-equals/dist/es/index.mjs +785 -0
- package/node_modules/fast-equals/dist/umd/index.d.ts +211 -0
- package/node_modules/fast-equals/dist/umd/index.js +802 -0
- package/node_modules/fast-equals/index.d.ts +211 -0
- package/node_modules/fast-equals/package.json +120 -0
- package/node_modules/linkifyjs/LICENSE +19 -0
- package/node_modules/linkifyjs/README.md +47 -0
- package/node_modules/linkifyjs/dist/linkify.cjs +1854 -0
- package/node_modules/linkifyjs/dist/linkify.d.cts +637 -0
- package/node_modules/linkifyjs/dist/linkify.d.mts +637 -0
- package/node_modules/linkifyjs/dist/linkify.js +1859 -0
- package/node_modules/linkifyjs/dist/linkify.min.js +1 -0
- package/node_modules/linkifyjs/dist/linkify.mjs +1836 -0
- package/node_modules/linkifyjs/package.json +38 -0
- package/node_modules/orderedmap/LICENSE +19 -0
- package/node_modules/orderedmap/README.md +69 -0
- package/node_modules/orderedmap/dist/index.cjs +139 -0
- package/node_modules/orderedmap/dist/index.d.cts +33 -0
- package/node_modules/orderedmap/dist/index.d.ts +33 -0
- package/node_modules/orderedmap/dist/index.js +137 -0
- package/node_modules/orderedmap/package.json +39 -0
- package/node_modules/prosemirror-changeset/CHANGELOG.md +171 -0
- package/node_modules/prosemirror-changeset/LICENSE +19 -0
- package/node_modules/prosemirror-changeset/README.md +175 -0
- package/node_modules/prosemirror-changeset/dist/index.cjs +588 -0
- package/node_modules/prosemirror-changeset/dist/index.d.cts +187 -0
- package/node_modules/prosemirror-changeset/dist/index.d.ts +187 -0
- package/node_modules/prosemirror-changeset/dist/index.js +722 -0
- package/node_modules/prosemirror-changeset/package.json +40 -0
- package/node_modules/prosemirror-changeset/test/test-changed-range.ts +48 -0
- package/node_modules/prosemirror-changeset/test/test-changes.ts +211 -0
- package/node_modules/prosemirror-changeset/test/test-diff.ts +77 -0
- package/node_modules/prosemirror-changeset/test/test-merge.ts +56 -0
- package/node_modules/prosemirror-changeset/test/test-simplify.ts +74 -0
- package/node_modules/prosemirror-commands/.tern-project +8 -0
- package/node_modules/prosemirror-commands/CHANGELOG.md +328 -0
- package/node_modules/prosemirror-commands/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-commands/LICENSE +19 -0
- package/node_modules/prosemirror-commands/README.md +28 -0
- package/node_modules/prosemirror-commands/dist/index.cjs +688 -0
- package/node_modules/prosemirror-commands/dist/index.d.cts +215 -0
- package/node_modules/prosemirror-commands/dist/index.d.ts +215 -0
- package/node_modules/prosemirror-commands/dist/index.js +852 -0
- package/node_modules/prosemirror-commands/package.json +39 -0
- package/node_modules/prosemirror-dropcursor/CHANGELOG.md +149 -0
- package/node_modules/prosemirror-dropcursor/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-dropcursor/LICENSE +19 -0
- package/node_modules/prosemirror-dropcursor/README.md +50 -0
- package/node_modules/prosemirror-dropcursor/dist/index.cjs +200 -0
- package/node_modules/prosemirror-dropcursor/dist/index.d.cts +38 -0
- package/node_modules/prosemirror-dropcursor/dist/index.d.ts +38 -0
- package/node_modules/prosemirror-dropcursor/dist/index.js +163 -0
- package/node_modules/prosemirror-dropcursor/package.json +38 -0
- package/node_modules/prosemirror-gapcursor/CHANGELOG.md +122 -0
- package/node_modules/prosemirror-gapcursor/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-gapcursor/LICENSE +19 -0
- package/node_modules/prosemirror-gapcursor/README.md +31 -0
- package/node_modules/prosemirror-gapcursor/dist/index.cjs +239 -0
- package/node_modules/prosemirror-gapcursor/dist/index.d.cts +31 -0
- package/node_modules/prosemirror-gapcursor/dist/index.d.ts +31 -0
- package/node_modules/prosemirror-gapcursor/dist/index.js +239 -0
- package/node_modules/prosemirror-gapcursor/package.json +43 -0
- package/node_modules/prosemirror-gapcursor/style/gapcursor.css +25 -0
- package/node_modules/prosemirror-history/.tern-project +8 -0
- package/node_modules/prosemirror-history/CHANGELOG.md +176 -0
- package/node_modules/prosemirror-history/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-history/LICENSE +19 -0
- package/node_modules/prosemirror-history/README.md +27 -0
- package/node_modules/prosemirror-history/dist/index.cjs +383 -0
- package/node_modules/prosemirror-history/dist/index.d.cts +64 -0
- package/node_modules/prosemirror-history/dist/index.d.ts +64 -0
- package/node_modules/prosemirror-history/dist/index.js +454 -0
- package/node_modules/prosemirror-history/package.json +40 -0
- package/node_modules/prosemirror-inputrules/.tern-project +8 -0
- package/node_modules/prosemirror-inputrules/CHANGELOG.md +127 -0
- package/node_modules/prosemirror-inputrules/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-inputrules/LICENSE +19 -0
- package/node_modules/prosemirror-inputrules/README.md +29 -0
- package/node_modules/prosemirror-inputrules/dist/index.cjs +194 -0
- package/node_modules/prosemirror-inputrules/dist/index.d.cts +131 -0
- package/node_modules/prosemirror-inputrules/dist/index.d.ts +131 -0
- package/node_modules/prosemirror-inputrules/dist/index.js +239 -0
- package/node_modules/prosemirror-inputrules/package.json +36 -0
- package/node_modules/prosemirror-keymap/.tern-project +8 -0
- package/node_modules/prosemirror-keymap/CHANGELOG.md +104 -0
- package/node_modules/prosemirror-keymap/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-keymap/LICENSE +19 -0
- package/node_modules/prosemirror-keymap/README.md +27 -0
- package/node_modules/prosemirror-keymap/dist/index.cjs +65 -0
- package/node_modules/prosemirror-keymap/dist/index.d.cts +47 -0
- package/node_modules/prosemirror-keymap/dist/index.d.ts +47 -0
- package/node_modules/prosemirror-keymap/dist/index.js +128 -0
- package/node_modules/prosemirror-keymap/package.json +38 -0
- package/node_modules/prosemirror-model/.tern-project +8 -0
- package/node_modules/prosemirror-model/CHANGELOG.md +782 -0
- package/node_modules/prosemirror-model/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-model/LICENSE +19 -0
- package/node_modules/prosemirror-model/README.md +29 -0
- package/node_modules/prosemirror-model/dist/index.cjs +2911 -0
- package/node_modules/prosemirror-model/dist/index.d.cts +1683 -0
- package/node_modules/prosemirror-model/dist/index.d.ts +1683 -0
- package/node_modules/prosemirror-model/dist/index.js +3463 -0
- package/node_modules/prosemirror-model/package.json +38 -0
- package/node_modules/prosemirror-schema-list/.tern-project +8 -0
- package/node_modules/prosemirror-schema-list/CHANGELOG.md +140 -0
- package/node_modules/prosemirror-schema-list/CONTRIBUTING.md +100 -0
- package/node_modules/prosemirror-schema-list/LICENSE +19 -0
- package/node_modules/prosemirror-schema-list/README.md +28 -0
- package/node_modules/prosemirror-schema-list/dist/index.cjs +253 -0
- package/node_modules/prosemirror-schema-list/dist/index.d.cts +71 -0
- package/node_modules/prosemirror-schema-list/dist/index.d.ts +71 -0
- package/node_modules/prosemirror-schema-list/dist/index.js +289 -0
- package/node_modules/prosemirror-schema-list/package.json +40 -0
- package/node_modules/prosemirror-state/.tern-project +8 -0
- package/node_modules/prosemirror-state/CHANGELOG.md +296 -0
- package/node_modules/prosemirror-state/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-state/LICENSE +19 -0
- package/node_modules/prosemirror-state/README.md +28 -0
- package/node_modules/prosemirror-state/dist/index.cjs +884 -0
- package/node_modules/prosemirror-state/dist/index.d.cts +709 -0
- package/node_modules/prosemirror-state/dist/index.d.ts +709 -0
- package/node_modules/prosemirror-state/dist/index.js +1002 -0
- package/node_modules/prosemirror-state/package.json +39 -0
- package/node_modules/prosemirror-tables/LICENSE +19 -0
- package/node_modules/prosemirror-tables/README.md +254 -0
- package/node_modules/prosemirror-tables/dist/index.cjs +2683 -0
- package/node_modules/prosemirror-tables/dist/index.d.cts +751 -0
- package/node_modules/prosemirror-tables/dist/index.d.ts +751 -0
- package/node_modules/prosemirror-tables/dist/index.js +2626 -0
- package/node_modules/prosemirror-tables/package.json +80 -0
- package/node_modules/prosemirror-tables/style/tables.css +48 -0
- package/node_modules/prosemirror-transform/.tern-project +8 -0
- package/node_modules/prosemirror-transform/CHANGELOG.md +530 -0
- package/node_modules/prosemirror-transform/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-transform/LICENSE +19 -0
- package/node_modules/prosemirror-transform/README.md +29 -0
- package/node_modules/prosemirror-transform/dist/index.cjs +2014 -0
- package/node_modules/prosemirror-transform/dist/index.d.cts +857 -0
- package/node_modules/prosemirror-transform/dist/index.d.ts +857 -0
- package/node_modules/prosemirror-transform/dist/index.js +2272 -0
- package/node_modules/prosemirror-transform/package.json +37 -0
- package/node_modules/prosemirror-view/.tern-project +8 -0
- package/node_modules/prosemirror-view/CHANGELOG.md +2543 -0
- package/node_modules/prosemirror-view/CONTRIBUTING.md +104 -0
- package/node_modules/prosemirror-view/LICENSE +19 -0
- package/node_modules/prosemirror-view/README.md +28 -0
- package/node_modules/prosemirror-view/dist/index.cjs +5549 -0
- package/node_modules/prosemirror-view/dist/index.d.cts +913 -0
- package/node_modules/prosemirror-view/dist/index.d.ts +913 -0
- package/node_modules/prosemirror-view/dist/index.js +6053 -0
- package/node_modules/prosemirror-view/package.json +43 -0
- package/node_modules/prosemirror-view/style/prosemirror.css +54 -0
- package/node_modules/rope-sequence/LICENSE +19 -0
- package/node_modules/rope-sequence/README.md +63 -0
- package/node_modules/rope-sequence/dist/index.cjs +209 -0
- package/node_modules/rope-sequence/dist/index.d.cts +11 -0
- package/node_modules/rope-sequence/dist/index.d.ts +11 -0
- package/node_modules/rope-sequence/dist/index.js +207 -0
- package/node_modules/rope-sequence/index.js +190 -0
- package/node_modules/rope-sequence/package.json +34 -0
- package/node_modules/rope-sequence/test.js +78 -0
- package/node_modules/use-sync-external-store/LICENSE +21 -0
- package/node_modules/use-sync-external-store/README.md +5 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js +97 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js +85 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +95 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.development.js +88 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.native.production.js +59 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js +66 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.development.js +96 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js +84 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store.development.js +27 -0
- package/node_modules/use-sync-external-store/cjs/use-sync-external-store.production.js +13 -0
- package/node_modules/use-sync-external-store/index.js +7 -0
- package/node_modules/use-sync-external-store/package.json +43 -0
- package/node_modules/use-sync-external-store/shim/index.js +7 -0
- package/node_modules/use-sync-external-store/shim/index.native.js +7 -0
- package/node_modules/use-sync-external-store/shim/with-selector.js +7 -0
- package/node_modules/use-sync-external-store/with-selector.js +7 -0
- package/node_modules/w3c-keyname/.tern-port +1 -0
- package/node_modules/w3c-keyname/LICENSE +19 -0
- package/node_modules/w3c-keyname/README.md +18 -0
- package/node_modules/w3c-keyname/index.cjs +127 -0
- package/node_modules/w3c-keyname/index.d.cts +5 -0
- package/node_modules/w3c-keyname/index.d.ts +5 -0
- package/node_modules/w3c-keyname/index.js +119 -0
- package/node_modules/w3c-keyname/package.json +37 -0
- package/package.json +79 -4
- package/src/Editor.tsx +425 -0
- package/src/ask.tsx +154 -0
- package/src/basic.tsx +149 -0
- package/src/blockMeta.ts +42 -0
- package/src/blockops.ts +179 -0
- package/src/blocks.tsx +189 -0
- package/src/boundary.tsx +17 -0
- package/src/content.ts +22 -0
- package/src/dynamic.tsx +105 -0
- package/src/editor.css +345 -0
- package/src/extensions.ts +78 -0
- package/src/handle.tsx +188 -0
- package/src/handles.tsx +149 -0
- package/src/index.ts +29 -0
- package/src/insert.ts +9 -0
- package/src/inserter.tsx +163 -0
- package/src/inspector.tsx +237 -0
- package/src/labels.ts +135 -0
- package/src/layout.tsx +174 -0
- package/src/layoutUi.tsx +226 -0
- package/src/media.ts +31 -0
- package/src/nodes.tsx +107 -0
- package/src/outline.tsx +124 -0
- package/src/panels.ts +59 -0
- package/src/paste.ts +100 -0
- package/src/patterns.ts +129 -0
- package/src/rank.ts +22 -0
- package/src/registry.ts +20 -0
- package/src/styleattr.ts +55 -0
- package/src/stylepanel.tsx +275 -0
- package/src/synced.tsx +128 -0
- package/src/toolbar.tsx +238 -0
- package/src/types.ts +55 -0
- package/src/unknown.tsx +74 -0
- package/src/util.ts +3 -0
package/src/synced.tsx
ADDED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { Node, mergeAttributes, type Editor, type JSONContent } from "@tiptap/core";
|
|
2
|
+
import { DOMSerializer } from "@tiptap/pm/model";
|
|
3
|
+
import { NodeViewWrapper, ReactNodeViewRenderer, type ReactNodeViewProps } from "@tiptap/react";
|
|
4
|
+
import { Pencil, Repeat2, Unlink } from "lucide-react";
|
|
5
|
+
import { useEffect, useMemo, useState } from "react";
|
|
6
|
+
import { labelsOf } from "./nodes";
|
|
7
|
+
import { patternNodes } from "./patterns";
|
|
8
|
+
import { cx } from "./util";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Mẫu đồng bộ: khối `syncedPattern { ref }` chỉ là tham chiếu — nội dung lấy từ mẫu gốc (ứng dụng cung cấp qua PatternHost),
|
|
12
|
+
* sửa mẫu gốc thì mọi chỗ dùng đổi theo. "Tách ra" thay tham chiếu bằng bản chép để sửa riêng.
|
|
13
|
+
*/
|
|
14
|
+
export interface PatternHost {
|
|
15
|
+
/** Nội dung + tên của mẫu (`content`: cây khối hoặc `{ version, blocks }`). null = mẫu đã bị xoá / không xem được. */
|
|
16
|
+
resolve(ref: number): Promise<{ title: string; content: unknown } | null>;
|
|
17
|
+
/** Lưu các khối thành mẫu (ứng dụng hỏi tên, nhóm, đồng bộ). null = huỷ. */
|
|
18
|
+
create?(nodes: JSONContent[]): Promise<{ ref: number; synced: boolean } | null>;
|
|
19
|
+
/** Mở mẫu gốc để sửa (vd tab mới). */
|
|
20
|
+
edit?(ref: number): void;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export const patternHostOf = (editor: Editor): PatternHost | undefined => (editor.storage as any).cmsEditorContext?.patterns;
|
|
24
|
+
|
|
25
|
+
// Mỗi mẫu tải một lần cho mọi trình soạn; quay lại tab (có thể vừa sửa mẫu gốc) thì tải lại
|
|
26
|
+
type Resolved = { title: string; content: unknown } | null;
|
|
27
|
+
const cache = new Map<number, Promise<Resolved>>();
|
|
28
|
+
const listeners = new Set<() => void>();
|
|
29
|
+
export function refreshSyncedPatterns(ref?: number) {
|
|
30
|
+
if (ref == null) cache.clear(); else cache.delete(ref);
|
|
31
|
+
listeners.forEach((l) => l());
|
|
32
|
+
}
|
|
33
|
+
if (typeof document !== "undefined") document.addEventListener("visibilitychange", () => { if (document.visibilityState === "visible") refreshSyncedPatterns(); });
|
|
34
|
+
|
|
35
|
+
function useResolved(editor: Editor, ref: number | null) {
|
|
36
|
+
const [state, setState] = useState<{ ref: number | null; value: Resolved | undefined }>({ ref, value: undefined });
|
|
37
|
+
const [version, setVersion] = useState(0);
|
|
38
|
+
useEffect(() => { const l = () => setVersion((v) => v + 1); listeners.add(l); return () => { listeners.delete(l); }; }, []);
|
|
39
|
+
useEffect(() => {
|
|
40
|
+
const host = patternHostOf(editor);
|
|
41
|
+
if (!ref || !host) { setState({ ref, value: null }); return; }
|
|
42
|
+
let alive = true;
|
|
43
|
+
if (!cache.has(ref)) cache.set(ref, host.resolve(ref).catch(() => null));
|
|
44
|
+
cache.get(ref)!.then((value) => { if (alive) setState({ ref, value }); });
|
|
45
|
+
return () => { alive = false; };
|
|
46
|
+
}, [editor, ref, version]);
|
|
47
|
+
return state.ref === ref ? state.value : undefined;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function SyncedView({ node, editor, selected, getPos }: ReactNodeViewProps) {
|
|
51
|
+
const t = labelsOf(editor);
|
|
52
|
+
const ref = typeof node.attrs.ref === "number" ? node.attrs.ref : null;
|
|
53
|
+
const pattern = useResolved(editor, ref);
|
|
54
|
+
const nodes = useMemo(() => (pattern ? patternNodes({ name: "", title: "", category: "", content: pattern.content }) : []), [pattern]);
|
|
55
|
+
const html = useMemo(() => {
|
|
56
|
+
if (!nodes.length) return "";
|
|
57
|
+
try {
|
|
58
|
+
const doc = editor.schema.nodeFromJSON({ type: "doc", content: nodes });
|
|
59
|
+
const div = document.createElement("div");
|
|
60
|
+
div.appendChild(DOMSerializer.fromSchema(editor.schema).serializeFragment(doc.content));
|
|
61
|
+
return div.innerHTML;
|
|
62
|
+
} catch { return ""; }
|
|
63
|
+
}, [editor, nodes]);
|
|
64
|
+
const host = patternHostOf(editor);
|
|
65
|
+
|
|
66
|
+
function detach() {
|
|
67
|
+
const pos = typeof getPos === "function" ? getPos() : null;
|
|
68
|
+
if (pos == null || !nodes.length) return;
|
|
69
|
+
editor.chain().focus().insertContentAt({ from: pos, to: pos + node.nodeSize }, nodes).run();
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<NodeViewWrapper className={cx("cms-ed-block", "cms-ed-synced", selected && "is-selected")} data-drag-handle data-synced-pattern={ref ?? ""}>
|
|
74
|
+
<div className="cms-ed-synced-bar" contentEditable={false}>
|
|
75
|
+
<Repeat2 size={13} />
|
|
76
|
+
<span className="cms-ed-synced-title">{pattern === undefined ? t.syncedLoading : pattern ? `${t.syncedPattern}: ${pattern.title}` : t.syncedMissing}</span>
|
|
77
|
+
{ref && host?.edit && pattern && <button type="button" onClick={() => host.edit!(ref)}><Pencil size={12} />{t.syncedEdit}</button>}
|
|
78
|
+
{pattern && <button type="button" onClick={detach}><Unlink size={12} />{t.syncedDetach}</button>}
|
|
79
|
+
</div>
|
|
80
|
+
{html && <div className="cms-ed-synced-preview ecx-content" contentEditable={false} dangerouslySetInnerHTML={{ __html: html }} />}
|
|
81
|
+
</NodeViewWrapper>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export const SyncedPattern = Node.create({
|
|
86
|
+
name: "syncedPattern",
|
|
87
|
+
group: "block",
|
|
88
|
+
atom: true,
|
|
89
|
+
draggable: true,
|
|
90
|
+
selectable: true,
|
|
91
|
+
addAttributes: () => ({ ref: { default: null, parseHTML: (el: HTMLElement) => Number(el.getAttribute("data-synced-pattern")) || null, renderHTML: () => ({}) } }),
|
|
92
|
+
parseHTML: () => [{ tag: "div[data-synced-pattern]" }],
|
|
93
|
+
renderHTML: ({ node, HTMLAttributes }) => ["div", mergeAttributes(HTMLAttributes, { "data-synced-pattern": String(node.attrs.ref ?? "") })],
|
|
94
|
+
addNodeView: () => ReactNodeViewRenderer(SyncedView),
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/** Khối cùng cấp đang được chọn (bôi đen qua nhiều khối) chứa `pos`, không thì chỉ khối ở `pos`. */
|
|
98
|
+
export function selectedSiblings(editor: Editor, block: { pos: number; node: { nodeSize: number }; depth: number }): { from: number; to: number; nodes: JSONContent[] } {
|
|
99
|
+
const { state } = editor;
|
|
100
|
+
const { from, to, empty } = state.selection;
|
|
101
|
+
let start = block.pos, end = block.pos + block.node.nodeSize;
|
|
102
|
+
if (!empty) {
|
|
103
|
+
const $b = state.doc.resolve(block.pos);
|
|
104
|
+
const parent = $b.parent, base = $b.start();
|
|
105
|
+
let offset = 0;
|
|
106
|
+
parent.forEach((child) => {
|
|
107
|
+
const a = base + offset, b = a + child.nodeSize;
|
|
108
|
+
if (b > from && a < to) { start = Math.min(start, a); end = Math.max(end, b); }
|
|
109
|
+
offset += child.nodeSize;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
const slice = state.doc.slice(start, end);
|
|
113
|
+
const nodes: JSONContent[] = [];
|
|
114
|
+
slice.content.forEach((n) => nodes.push(n.toJSON()));
|
|
115
|
+
return { from: start, to: end, nodes };
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
/** Lưu khối đang chọn thành mẫu; mẫu đồng bộ → thay các khối bằng tham chiếu. */
|
|
119
|
+
export async function createPatternFrom(editor: Editor, block: { pos: number; node: { nodeSize: number }; depth: number }): Promise<boolean> {
|
|
120
|
+
const host = patternHostOf(editor);
|
|
121
|
+
if (!host?.create) return false;
|
|
122
|
+
const range = selectedSiblings(editor, block);
|
|
123
|
+
if (!range.nodes.length) return false;
|
|
124
|
+
const res = await host.create(range.nodes);
|
|
125
|
+
if (!res) return false;
|
|
126
|
+
if (res.synced) editor.chain().focus().insertContentAt({ from: range.from, to: range.to }, { type: "syncedPattern", attrs: { ref: res.ref } }).run();
|
|
127
|
+
return true;
|
|
128
|
+
}
|
package/src/toolbar.tsx
ADDED
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
import type { Editor as TiptapEditor } from "@tiptap/core";
|
|
2
|
+
import { NodeSelection } from "@tiptap/pm/state";
|
|
3
|
+
import { useEditorState } from "@tiptap/react";
|
|
4
|
+
import {
|
|
5
|
+
AlignCenter, AlignLeft, AlignRight, ArrowDown, ArrowUp, Bold, ChevronDown, Copy, CornerLeftUp, GripVertical, Heading2, Heading3, Heading4,
|
|
6
|
+
IndentDecrease, IndentIncrease, Italic, Link2, List, ListOrdered, Maximize2, MoreVertical, Pilcrow, Quote, SquareCode, Trash2, type LucideIcon,
|
|
7
|
+
} from "lucide-react";
|
|
8
|
+
import { useEffect, useRef, useState, type ReactNode } from "react";
|
|
9
|
+
import { createPortal } from "react-dom";
|
|
10
|
+
import { askOf } from "./ask";
|
|
11
|
+
import { blockInfo } from "./blockMeta";
|
|
12
|
+
import { currentBlock, parentBlock, type BlockRef } from "./blockops";
|
|
13
|
+
import { runBlockAction, startBlockDrag, type BlockAction } from "./handle";
|
|
14
|
+
import type { EditorLabels } from "./labels";
|
|
15
|
+
import { LAYOUT_TYPES } from "./layoutUi";
|
|
16
|
+
import { imageAttrs } from "./media";
|
|
17
|
+
import type { MediaKind, MediaProvider } from "./types";
|
|
18
|
+
import { cx } from "./util";
|
|
19
|
+
|
|
20
|
+
type RequestMedia = (editor: TiptapEditor, kind: MediaKind) => void;
|
|
21
|
+
const TEXT = new Set(["paragraph", "heading", "bulletList", "orderedList", "taskList", "blockquote", "codeBlock"]);
|
|
22
|
+
|
|
23
|
+
function Btn({ title, active, disabled, onClick, children }: { title: string; active?: boolean; disabled?: boolean; onClick(): void; children: ReactNode }) {
|
|
24
|
+
return (
|
|
25
|
+
<button type="button" title={title} aria-label={title} aria-pressed={active} disabled={disabled} onMouseDown={(e) => e.preventDefault()} onClick={onClick}
|
|
26
|
+
className={cx("cms-ed-btn", active && "is-active")}>{children}</button>
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const Sep = () => <span className="cms-ed-sep" />;
|
|
30
|
+
|
|
31
|
+
/** Menu thả xuống nhỏ của thanh công cụ (đổi loại khối, tuỳ chọn khác). */
|
|
32
|
+
function Menu({ label, icon, items, close }: { label: string; icon: ReactNode; items: Array<{ key: string; icon: LucideIcon; label: string; run(): void; disabled?: boolean; danger?: boolean; active?: boolean }>; close?: number }) {
|
|
33
|
+
const [open, setOpen] = useState(false);
|
|
34
|
+
const ref = useRef<HTMLSpanElement>(null);
|
|
35
|
+
useEffect(() => setOpen(false), [close]);
|
|
36
|
+
useEffect(() => {
|
|
37
|
+
if (!open) return;
|
|
38
|
+
ref.current?.querySelector<HTMLElement>("[role=menuitem]:not(:disabled)")?.focus();
|
|
39
|
+
const outside = (e: MouseEvent) => { if (!ref.current?.contains(e.target as Node)) setOpen(false); };
|
|
40
|
+
document.addEventListener("mousedown", outside, true);
|
|
41
|
+
return () => document.removeEventListener("mousedown", outside, true);
|
|
42
|
+
}, [open]);
|
|
43
|
+
return (
|
|
44
|
+
<span ref={ref} className="cms-ed-blockbar-menu">
|
|
45
|
+
<button type="button" className={cx("cms-ed-btn", "is-wide", open && "is-active")} title={label} aria-label={label} aria-haspopup="menu" aria-expanded={open}
|
|
46
|
+
onMouseDown={(e) => e.preventDefault()} onClick={() => setOpen(!open)}>{icon}</button>
|
|
47
|
+
{open && (
|
|
48
|
+
<div role="menu" aria-label={label} className="cms-ed-menu" onKeyDown={(e) => {
|
|
49
|
+
const list = [...(ref.current?.querySelectorAll<HTMLElement>("[role=menuitem]:not(:disabled)") ?? [])];
|
|
50
|
+
const i = list.indexOf(document.activeElement as HTMLElement);
|
|
51
|
+
if (e.key === "ArrowDown" || e.key === "ArrowUp") { e.preventDefault(); list[(i + (e.key === "ArrowDown" ? 1 : -1) + list.length) % list.length]?.focus(); }
|
|
52
|
+
if (e.key === "Escape") { e.preventDefault(); setOpen(false); }
|
|
53
|
+
}}>
|
|
54
|
+
{items.map((it) => (
|
|
55
|
+
<button key={it.key} type="button" role="menuitem" tabIndex={-1} disabled={it.disabled} aria-current={it.active || undefined}
|
|
56
|
+
className={cx("cms-ed-menu-item", it.danger && "is-danger", it.active && "is-active")} onClick={() => { setOpen(false); it.run(); }}>
|
|
57
|
+
<it.icon size={14} /><span>{it.label}</span>
|
|
58
|
+
</button>
|
|
59
|
+
))}
|
|
60
|
+
</div>
|
|
61
|
+
)}
|
|
62
|
+
</span>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/** Chọn trọn khối rồi đổi loại (đoạn văn ↔ tiêu đề ↔ danh sách ↔ trích dẫn ↔ khối mã). */
|
|
67
|
+
function transform(editor: TiptapEditor, block: BlockRef, to: string) {
|
|
68
|
+
const c = editor.chain().focus().setTextSelection({ from: block.pos + 1, to: block.pos + block.node.nodeSize - 1 }).clearNodes();
|
|
69
|
+
switch (to) {
|
|
70
|
+
case "h2": case "h3": case "h4": c.setHeading({ level: Number(to[1]) as 2 | 3 | 4 }); break;
|
|
71
|
+
case "bulletList": c.toggleBulletList(); break;
|
|
72
|
+
case "orderedList": c.toggleOrderedList(); break;
|
|
73
|
+
case "blockquote": c.toggleBlockquote(); break;
|
|
74
|
+
case "codeBlock": c.toggleCodeBlock(); break;
|
|
75
|
+
}
|
|
76
|
+
c.run();
|
|
77
|
+
// Thu vùng chọn về cuối khối (vùng chọn chữ sẽ ẩn thanh công cụ)
|
|
78
|
+
editor.commands.setTextSelection(editor.state.selection.to);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Nút riêng của ảnh: cỡ, căn lề, alt, chú thích, thay ảnh, cỡ gốc. */
|
|
82
|
+
function ImageTools({ editor, t, media, requestMedia }: { editor: TiptapEditor; t: EditorLabels; media?: MediaProvider; requestMedia: RequestMedia }) {
|
|
83
|
+
const attrs = useEditorState({ editor, selector: ({ editor: e }) => (e.isActive("image") ? { ...e.getAttributes("image") } : null) });
|
|
84
|
+
if (!attrs) return null;
|
|
85
|
+
const set = (a: Record<string, unknown>) => editor.chain().focus().updateAttributes("image", a).run();
|
|
86
|
+
async function resize(size: string) {
|
|
87
|
+
if (!attrs?.mediaId || !media?.get) return set({ size });
|
|
88
|
+
const m = await media.get(attrs.mediaId).catch(() => null);
|
|
89
|
+
set(m ? { ...imageAttrs(m, size), alt: attrs.alt, caption: attrs.caption, align: attrs.align } : { size });
|
|
90
|
+
}
|
|
91
|
+
const aligns: Array<[string | null, LucideIcon, string]> = [["left", AlignLeft, t.floatLeft], [null, AlignCenter, t.center], ["right", AlignRight, t.floatRight], ["wide", Maximize2, t.wide]];
|
|
92
|
+
const ask = async (title: string, label: string, key: "alt" | "caption") => {
|
|
93
|
+
const r = await askOf(editor)({ title, fields: [{ key: "v", label, type: "textarea", value: attrs[key] ?? "" }] });
|
|
94
|
+
if (r && r !== "remove") set({ [key]: String(r.v) || (key === "caption" ? null : "") });
|
|
95
|
+
};
|
|
96
|
+
return (
|
|
97
|
+
<>
|
|
98
|
+
{attrs.mediaId != null && media?.get && (
|
|
99
|
+
<select className="cms-ed-select" value={attrs.size ?? "large"} onChange={(e) => resize(e.target.value)} title={t.size} aria-label={t.size}>
|
|
100
|
+
{([["medium", t.sizeMedium], ["medium_large", t.sizeMediumLarge], ["large", t.sizeLarge], ["full", t.sizeFull]] as const).map(([v, l]) => <option key={v} value={v}>{l}</option>)}
|
|
101
|
+
</select>
|
|
102
|
+
)}
|
|
103
|
+
{aligns.map(([v, Icon, title]) => <Btn key={title} title={title} active={(attrs.align ?? null) === v} onClick={() => set({ align: v })}><Icon size={16} /></Btn>)}
|
|
104
|
+
<Sep />
|
|
105
|
+
<button type="button" className="cms-ed-text-btn" onClick={() => ask(t.alt, t.altPrompt, "alt")}>{t.alt}</button>
|
|
106
|
+
<button type="button" className="cms-ed-text-btn" onClick={() => ask(t.caption, t.captionPrompt, "caption")}>{t.caption}</button>
|
|
107
|
+
<button type="button" className="cms-ed-text-btn" onClick={() => requestMedia(editor, "image")}>{t.replace}</button>
|
|
108
|
+
{attrs.mediaId != null && media?.get && <button type="button" className="cms-ed-text-btn" onClick={() => resize(attrs.size ?? "large")}>{t.resetSize}</button>}
|
|
109
|
+
</>
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** Nút riêng theo loại khối. */
|
|
114
|
+
function BlockTools({ editor, block, t, media, requestMedia }: { editor: TiptapEditor; block: BlockRef; t: EditorLabels; media?: MediaProvider; requestMedia: RequestMedia }) {
|
|
115
|
+
const s = useEditorState({ editor, selector: ({ editor: e }) => ({
|
|
116
|
+
left: e.isActive({ textAlign: "left" }), center: e.isActive({ textAlign: "center" }), right: e.isActive({ textAlign: "right" }),
|
|
117
|
+
bold: e.isActive("bold"), italic: e.isActive("italic"), link: e.isActive("link"), header: e.isActive("tableHeader"),
|
|
118
|
+
}) });
|
|
119
|
+
const c = () => editor.chain().focus();
|
|
120
|
+
const type = block.node.type.name;
|
|
121
|
+
const parts: ReactNode[] = [];
|
|
122
|
+
if (type === "paragraph" || type === "heading") parts.push(
|
|
123
|
+
<span key="align" role="group" aria-label={t.textAlign} className="cms-ed-blockbar-group">
|
|
124
|
+
<Btn title={t.alignLeft} active={s.left} onClick={() => c().setTextAlign("left").run()}><AlignLeft size={16} /></Btn>
|
|
125
|
+
<Btn title={t.alignCenter} active={s.center} onClick={() => c().setTextAlign("center").run()}><AlignCenter size={16} /></Btn>
|
|
126
|
+
<Btn title={t.alignRight} active={s.right} onClick={() => c().setTextAlign("right").run()}><AlignRight size={16} /></Btn>
|
|
127
|
+
</span>);
|
|
128
|
+
if (type === "bulletList" || type === "orderedList" || type === "taskList") {
|
|
129
|
+
const item = type === "taskList" ? "taskItem" : "listItem";
|
|
130
|
+
parts.push(
|
|
131
|
+
<span key="indent" role="group" aria-label={t.listIndent} className="cms-ed-blockbar-group">
|
|
132
|
+
<Btn title={t.outdent} onClick={() => c().liftListItem(item).run()}><IndentDecrease size={16} /></Btn>
|
|
133
|
+
<Btn title={t.indent} onClick={() => c().sinkListItem(item).run()}><IndentIncrease size={16} /></Btn>
|
|
134
|
+
</span>);
|
|
135
|
+
}
|
|
136
|
+
if (TEXT.has(type) && type !== "codeBlock") parts.push(
|
|
137
|
+
<span key="marks" role="group" aria-label={t.formatting} className="cms-ed-blockbar-group">
|
|
138
|
+
<Btn title={t.bold} active={s.bold} onClick={() => c().toggleBold().run()}><Bold size={16} /></Btn>
|
|
139
|
+
<Btn title={t.italic} active={s.italic} onClick={() => c().toggleItalic().run()}><Italic size={16} /></Btn>
|
|
140
|
+
<Btn title={t.link} active={s.link} onClick={() => (editor.storage as any).cmsEditorContext?.setLink?.()}><Link2 size={16} /></Btn>
|
|
141
|
+
</span>);
|
|
142
|
+
if (type === "image") parts.push(<span key="image" role="group" aria-label={t.image} className="cms-ed-blockbar-group"><ImageTools editor={editor} t={t} media={media} requestMedia={requestMedia} /></span>);
|
|
143
|
+
if (type === "table") parts.push(
|
|
144
|
+
<span key="table" role="group" aria-label={t.table} className="cms-ed-table-tools">
|
|
145
|
+
{([[t.addRow, () => c().addRowAfter().run()], [t.addCol, () => c().addColumnAfter().run()], [t.delRow, () => c().deleteRow().run()], [t.delCol, () => c().deleteColumn().run()],
|
|
146
|
+
[t.headerRow, () => c().toggleHeaderRow().run()],
|
|
147
|
+
[t.footerRow, () => c().updateAttributes("table", { footer: !editor.getAttributes("table").footer }).run()]] as const).map(([l, f]) => <button key={l} type="button" onMouseDown={(e) => e.preventDefault()} onClick={f}>{l}</button>)}
|
|
148
|
+
<button type="button" className="is-danger" onMouseDown={(e) => e.preventDefault()} onClick={() => c().deleteTable().run()}>{t.delTable}</button>
|
|
149
|
+
</span>);
|
|
150
|
+
return <>{parts.flatMap((p, i) => (i ? [<Sep key={`s${i}`} />, p] : [p]))}</>;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* Thanh công cụ nổi phía trên khối đang chọn: loại khối (bấm để đổi loại), kéo, lên/xuống, nút riêng theo khối
|
|
155
|
+
* (căn chữ, thụt danh sách, định dạng, ảnh, bảng), menu ⋮ (thêm khối trên/dưới, nhân bản, chọn khối cha, xoá).
|
|
156
|
+
* Ẩn khi đang gõ chữ, hiện lại khi rê chuột / bấm.
|
|
157
|
+
*/
|
|
158
|
+
export function BlockToolbar({ editor, t, media, requestMedia }: { editor: TiptapEditor; t: EditorLabels; media?: MediaProvider; requestMedia: RequestMedia }) {
|
|
159
|
+
const block = useEditorState({ editor, selector: ({ editor: e }) => {
|
|
160
|
+
const sel = e.state.selection;
|
|
161
|
+
if (!sel.empty && !(sel instanceof NodeSelection) && !e.isActive("image")) return null; // đang bôi đen chữ → menu định dạng
|
|
162
|
+
return currentBlock(e.state);
|
|
163
|
+
}, equalityFn: (a, b) => a?.pos === b?.pos && a?.node === b?.node });
|
|
164
|
+
const ref = useRef<HTMLDivElement>(null);
|
|
165
|
+
const [rect, setRect] = useState<DOMRect | null>(null);
|
|
166
|
+
const [visible, setVisible] = useState(editor.isFocused);
|
|
167
|
+
const [typing, setTyping] = useState(false);
|
|
168
|
+
const [inside, setInside] = useState(false);
|
|
169
|
+
|
|
170
|
+
useEffect(() => {
|
|
171
|
+
const f = () => setVisible(true), b = () => setVisible(false);
|
|
172
|
+
const key = (e: KeyboardEvent) => { if (e.key.length === 1 && !e.metaKey && !e.ctrlKey && !e.altKey) setTyping(true); };
|
|
173
|
+
const move = () => setTyping(false);
|
|
174
|
+
const dom = editor.view.dom;
|
|
175
|
+
editor.on("focus", f); editor.on("blur", b);
|
|
176
|
+
dom.addEventListener("keydown", key); dom.addEventListener("mousedown", move); document.addEventListener("mousemove", move);
|
|
177
|
+
return () => { editor.off("focus", f); editor.off("blur", b); dom.removeEventListener("keydown", key); dom.removeEventListener("mousedown", move); document.removeEventListener("mousemove", move); };
|
|
178
|
+
}, [editor]);
|
|
179
|
+
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (!block) { setRect(null); return; }
|
|
182
|
+
let frame = 0;
|
|
183
|
+
const update = () => { cancelAnimationFrame(frame); frame = requestAnimationFrame(() => {
|
|
184
|
+
const dom = editor.view.nodeDOM(block.pos) as HTMLElement | null;
|
|
185
|
+
setRect(dom?.getBoundingClientRect ? dom.getBoundingClientRect() : null);
|
|
186
|
+
}); };
|
|
187
|
+
update();
|
|
188
|
+
editor.on("transaction", update);
|
|
189
|
+
window.addEventListener("scroll", update, true); window.addEventListener("resize", update);
|
|
190
|
+
return () => { cancelAnimationFrame(frame); editor.off("transaction", update); window.removeEventListener("scroll", update, true); window.removeEventListener("resize", update); };
|
|
191
|
+
}, [editor, block?.pos, block?.node]);
|
|
192
|
+
|
|
193
|
+
if (!block || !rect || !(visible || inside) || (typing && !inside)) return null;
|
|
194
|
+
const type = block.node.type.name;
|
|
195
|
+
// Khối bố cục khi không có tab "Khối": thanh cài đặt riêng của nó đã nằm đúng chỗ này
|
|
196
|
+
const inspector = ((editor.storage as any).cmsEditorContext?.inspector ?? 0) > 0;
|
|
197
|
+
if (LAYOUT_TYPES.has(type) && !inspector && editor.state.selection instanceof NodeSelection) return null;
|
|
198
|
+
|
|
199
|
+
const info = blockInfo(type, t);
|
|
200
|
+
const $p = editor.state.doc.resolve(Math.min(block.pos, editor.state.doc.content.size));
|
|
201
|
+
const index = $p.index(), count = $p.parent.childCount;
|
|
202
|
+
const act = (a: BlockAction) => runBlockAction(editor, a, block);
|
|
203
|
+
const head = type === "heading" ? `h${block.node.attrs.level}` : type;
|
|
204
|
+
const transforms: Array<[string, LucideIcon, string]> = [
|
|
205
|
+
["paragraph", Pilcrow, t.paragraph], ["h2", Heading2, t.h2], ["h3", Heading3, t.h3], ["h4", Heading4, t.h4],
|
|
206
|
+
["bulletList", List, t.bulletList], ["orderedList", ListOrdered, t.orderedList], ["blockquote", Quote, t.quote], ["codeBlock", SquareCode, t.codeBlock],
|
|
207
|
+
];
|
|
208
|
+
const top = rect.top - 46 < 8 ? rect.bottom + 6 : rect.top - 46;
|
|
209
|
+
return createPortal(
|
|
210
|
+
<div ref={ref} role="toolbar" aria-label={t.blockToolbar} className="cms-ed-blockbar" style={{ top, left: Math.max(8, rect.left) }}
|
|
211
|
+
onMouseEnter={() => setInside(true)} onMouseLeave={() => { if (!ref.current?.contains(document.activeElement)) setInside(false); }}
|
|
212
|
+
onFocus={() => setInside(true)} onBlur={(e) => { if (!ref.current?.contains(e.relatedTarget as Node)) setInside(false); }}>
|
|
213
|
+
<span role="group" aria-label={info.title} className="cms-ed-blockbar-group">
|
|
214
|
+
{TEXT.has(type)
|
|
215
|
+
? <Menu label={`${info.title} — ${t.transformTo}`} icon={<><info.icon size={16} /><ChevronDown size={12} /></>}
|
|
216
|
+
items={transforms.map(([k, icon, label]) => ({ key: k, icon, label, active: k === head, run: () => transform(editor, block, k) }))} />
|
|
217
|
+
: <span className="cms-ed-blockbar-type" title={info.title}><info.icon size={16} /></span>}
|
|
218
|
+
<button type="button" className="cms-ed-btn is-grip" draggable title={t.blockOptions} aria-label={t.blockOptions} onMouseDown={(e) => e.stopPropagation()}
|
|
219
|
+
onDragStart={(e) => startBlockDrag(editor, block, e)}><GripVertical size={14} /></button>
|
|
220
|
+
<span className="cms-ed-blockbar-mover">
|
|
221
|
+
<button type="button" title={t.moveUp} aria-label={t.moveUp} disabled={index === 0} onMouseDown={(e) => e.preventDefault()} onClick={() => act("up")}><ArrowUp size={12} /></button>
|
|
222
|
+
<button type="button" title={t.moveDown} aria-label={t.moveDown} disabled={index >= count - 1} onMouseDown={(e) => e.preventDefault()} onClick={() => act("down")}><ArrowDown size={12} /></button>
|
|
223
|
+
</span>
|
|
224
|
+
</span>
|
|
225
|
+
<Sep />
|
|
226
|
+
<BlockTools editor={editor} block={block} t={t} media={media} requestMedia={requestMedia} />
|
|
227
|
+
<Sep />
|
|
228
|
+
<Menu label={t.moreOptions} icon={<MoreVertical size={16} />} items={[
|
|
229
|
+
{ key: "before", icon: ArrowUp, label: t.insertBefore, run: () => act("insertBefore") },
|
|
230
|
+
{ key: "after", icon: ArrowDown, label: t.addBelow, run: () => act("insert") },
|
|
231
|
+
{ key: "dup", icon: Copy, label: t.duplicate, run: () => act("duplicate") },
|
|
232
|
+
...(parentBlock(editor.state.doc, block) ? [{ key: "parent", icon: CornerLeftUp, label: t.selectParent, run: () => act("parent") }] : []),
|
|
233
|
+
{ key: "del", icon: Trash2, label: t.deleteBlock, danger: true, run: () => act("delete") },
|
|
234
|
+
]} />
|
|
235
|
+
</div>,
|
|
236
|
+
document.body,
|
|
237
|
+
);
|
|
238
|
+
}
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { AnyExtension, Editor, Range } from "@tiptap/core";
|
|
2
|
+
import type { LucideIcon } from "lucide-react";
|
|
3
|
+
|
|
4
|
+
/** Kích thước ảnh đã tạo sẵn (thumbnail, medium, large…), kèm bản WebP nếu có. */
|
|
5
|
+
export interface MediaSize { url: string; width: number; height: number; webpUrl?: string | null }
|
|
6
|
+
|
|
7
|
+
/** File media mà ứng dụng cung cấp cho trình soạn (ảnh, video, âm thanh, tài liệu). */
|
|
8
|
+
export interface MediaItem {
|
|
9
|
+
id: number | string;
|
|
10
|
+
url: string;
|
|
11
|
+
mimeType: string;
|
|
12
|
+
fileName: string;
|
|
13
|
+
title?: string;
|
|
14
|
+
alt?: string;
|
|
15
|
+
caption?: string;
|
|
16
|
+
width?: number | null;
|
|
17
|
+
height?: number | null;
|
|
18
|
+
size?: number;
|
|
19
|
+
sizes?: Record<string, MediaSize>;
|
|
20
|
+
webpUrl?: string | null;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type MediaKind = "image" | "gallery" | "video" | "audio" | "file";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Nguồn media do ứng dụng nhúng cung cấp (thư viện media của CMS, S3, Cloudinary…).
|
|
27
|
+
* Không truyền → trình soạn cho dán URL ảnh/video.
|
|
28
|
+
*/
|
|
29
|
+
export interface MediaProvider {
|
|
30
|
+
/** Mở hộp chọn của ứng dụng; trả về file được chọn (rỗng = huỷ). */
|
|
31
|
+
pick(options: { kind: MediaKind; multiple: boolean }): Promise<MediaItem[]>;
|
|
32
|
+
/** Lấy lại thông tin một file (để đổi cỡ ảnh đã chèn). */
|
|
33
|
+
get?(id: MediaItem["id"]): Promise<MediaItem | null>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Một lệnh chèn trong slash menu ("/"). */
|
|
37
|
+
export interface InsertItem {
|
|
38
|
+
key: string;
|
|
39
|
+
title: string;
|
|
40
|
+
hint: string;
|
|
41
|
+
icon: LucideIcon;
|
|
42
|
+
/** Từ khoá tìm kiếm (không dấu, cách nhau bởi khoảng trắng). */
|
|
43
|
+
keywords: string;
|
|
44
|
+
run(editor: Editor, range?: Range): void;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Gói mở rộng (plugin của CMS hoặc ứng dụng): thêm node/mark TipTap và lệnh chèn. */
|
|
48
|
+
export interface EditorExtensionPack {
|
|
49
|
+
name: string;
|
|
50
|
+
extensions?: AnyExtension[];
|
|
51
|
+
insertItems?: InsertItem[];
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** Nội dung lưu trữ: danh sách khối (sẵn sàng cho page builder). */
|
|
55
|
+
export interface ContentDoc { version: number; blocks: Array<{ id?: string; type: string; data: any }> }
|
package/src/unknown.tsx
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Mark, Node } from "@tiptap/core";
|
|
2
|
+
import { NodeViewWrapper, ReactNodeViewRenderer, type ReactNodeViewProps } from "@tiptap/react";
|
|
3
|
+
import { labelsOf } from "./nodes";
|
|
4
|
+
import { cx } from "./util";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Khối / định dạng mà trình soạn không hiểu (plugin đã tắt hoặc chưa cài): giữ NGUYÊN dữ liệu gốc trong thuộc tính `raw`,
|
|
8
|
+
* hiển thị khung "không xác định", lưu lại trả về đúng như cũ (unwrapUnknown) — bật lại plugin là hiện như trước.
|
|
9
|
+
*/
|
|
10
|
+
export const UNKNOWN_BLOCK = "cmsUnknownBlock", UNKNOWN_INLINE = "cmsUnknownInline", UNKNOWN_MARK = "cmsUnknownMark";
|
|
11
|
+
|
|
12
|
+
const raw = { raw: { default: null, renderHTML: () => ({}), parseHTML: () => null } };
|
|
13
|
+
|
|
14
|
+
function View({ node, selected, editor }: ReactNodeViewProps) {
|
|
15
|
+
const t = labelsOf(editor);
|
|
16
|
+
const type = (node.attrs.raw as { type?: string } | null)?.type ?? "?";
|
|
17
|
+
const inline = node.type.name === UNKNOWN_INLINE;
|
|
18
|
+
return (
|
|
19
|
+
<NodeViewWrapper as={inline ? "span" : "div"} className={cx(inline ? "cms-ed-unknown-inline" : "cms-ed-block cms-ed-unknown", selected && "is-selected")} data-drag-handle>
|
|
20
|
+
{inline ? <code>{type}</code> : <><div className="cms-ed-block-label">{t.unknownBlock}</div><code>{type}</code> <span>{t.unknownBlockHint}</span></>}
|
|
21
|
+
</NodeViewWrapper>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const UnknownBlock = Node.create({
|
|
26
|
+
name: UNKNOWN_BLOCK, group: "block", atom: true, draggable: true, selectable: true,
|
|
27
|
+
addAttributes: () => raw,
|
|
28
|
+
parseHTML: () => [{ tag: "div[data-cms-unknown]" }],
|
|
29
|
+
renderHTML: () => ["div", { "data-cms-unknown": "" }],
|
|
30
|
+
addNodeView: () => ReactNodeViewRenderer(View),
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const UnknownInline = Node.create({
|
|
34
|
+
name: UNKNOWN_INLINE, group: "inline", inline: true, atom: true, selectable: true,
|
|
35
|
+
addAttributes: () => raw,
|
|
36
|
+
parseHTML: () => [{ tag: "span[data-cms-unknown]" }],
|
|
37
|
+
renderHTML: () => ["span", { "data-cms-unknown": "" }],
|
|
38
|
+
addNodeView: () => ReactNodeViewRenderer(View),
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
/** Định dạng chữ lạ: giữ nguyên, có thể chồng nhiều cái (excludes ""). */
|
|
42
|
+
export const UnknownMark = Mark.create({
|
|
43
|
+
name: UNKNOWN_MARK, excludes: "",
|
|
44
|
+
addAttributes: () => raw,
|
|
45
|
+
parseHTML: () => [{ tag: "span[data-cms-unknown-mark]" }],
|
|
46
|
+
renderHTML: () => ["span", { "data-cms-unknown-mark": "", class: "cms-ed-unknown-mark" }, 0],
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
type J = { type: string; attrs?: Record<string, any>; content?: J[]; marks?: Array<{ type: string; attrs?: Record<string, any> }>; text?: string };
|
|
50
|
+
const TEXTBLOCKS = new Set(["paragraph", "heading", "codeBlock"]);
|
|
51
|
+
|
|
52
|
+
/** Nội dung → trình soạn: thay khối / định dạng lạ bằng bản bọc giữ nguyên dữ liệu gốc. */
|
|
53
|
+
export function wrapUnknown(doc: J, known: { nodes: Set<string>; marks: Set<string> }): J {
|
|
54
|
+
const walk = (n: J, inlineContext: boolean): J => {
|
|
55
|
+
if (!known.nodes.has(n.type)) return { type: inlineContext ? UNKNOWN_INLINE : UNKNOWN_BLOCK, attrs: { raw: n } };
|
|
56
|
+
const out: J = { ...n };
|
|
57
|
+
if (n.marks) out.marks = n.marks.map((m) => (known.marks.has(m.type) ? m : { type: UNKNOWN_MARK, attrs: { raw: m } }));
|
|
58
|
+
if (n.content) out.content = n.content.map((c) => walk(c, TEXTBLOCKS.has(n.type) || (inlineContext && n.type !== "doc")));
|
|
59
|
+
return out;
|
|
60
|
+
};
|
|
61
|
+
return walk(doc, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Trình soạn → nội dung: trả khối / định dạng lạ về đúng dữ liệu gốc. */
|
|
65
|
+
export function unwrapUnknown(doc: J): J {
|
|
66
|
+
const walk = (n: J): J => {
|
|
67
|
+
if ((n.type === UNKNOWN_BLOCK || n.type === UNKNOWN_INLINE) && n.attrs?.raw) return n.attrs.raw as J;
|
|
68
|
+
const out: J = { ...n };
|
|
69
|
+
if (n.marks) out.marks = n.marks.map((m) => (m.type === UNKNOWN_MARK && m.attrs?.raw ? m.attrs.raw : m));
|
|
70
|
+
if (n.content) out.content = n.content.map(walk);
|
|
71
|
+
return out;
|
|
72
|
+
};
|
|
73
|
+
return walk(doc);
|
|
74
|
+
}
|
package/src/util.ts
ADDED