@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
|
@@ -0,0 +1,1533 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.js";
|
|
2
|
+
import { Extension, Node, getNodeAtPosition, getNodeType, getPreviousBlockSibling, getRenderedAttributes, isAtEndOfNode, isAtStartOfNode, isNodeActive, mergeAttributes, parseIndentedBlocks, renderNestedMarkdownContent, wrappingInputRule } from "@tiptap/core";
|
|
3
|
+
import { Fragment } from "@tiptap/pm/model";
|
|
4
|
+
import { Plugin, TextSelection } from "@tiptap/pm/state";
|
|
5
|
+
//#region src/bullet-list/bullet-list.ts
|
|
6
|
+
const ListItemName$1 = "listItem";
|
|
7
|
+
const TextStyleName$1 = "textStyle";
|
|
8
|
+
/**
|
|
9
|
+
* Matches a bullet list to a dash or asterisk.
|
|
10
|
+
*/
|
|
11
|
+
const bulletListInputRegex = /^\s*([-+*])\s$/;
|
|
12
|
+
/**
|
|
13
|
+
* This extension allows you to create bullet lists.
|
|
14
|
+
* This requires the ListItem extension
|
|
15
|
+
* @see https://tiptap.dev/api/nodes/bullet-list
|
|
16
|
+
* @see https://tiptap.dev/api/nodes/list-item.
|
|
17
|
+
*/
|
|
18
|
+
const BulletList = Node.create({
|
|
19
|
+
name: "bulletList",
|
|
20
|
+
addOptions() {
|
|
21
|
+
return {
|
|
22
|
+
itemTypeName: "listItem",
|
|
23
|
+
HTMLAttributes: {},
|
|
24
|
+
keepMarks: false,
|
|
25
|
+
keepAttributes: false
|
|
26
|
+
};
|
|
27
|
+
},
|
|
28
|
+
group: "block list",
|
|
29
|
+
content() {
|
|
30
|
+
return `${this.options.itemTypeName}+`;
|
|
31
|
+
},
|
|
32
|
+
parseHTML() {
|
|
33
|
+
return [{ tag: "ul" }];
|
|
34
|
+
},
|
|
35
|
+
renderHTML({ HTMLAttributes }) {
|
|
36
|
+
return [
|
|
37
|
+
"ul",
|
|
38
|
+
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
39
|
+
0
|
|
40
|
+
];
|
|
41
|
+
},
|
|
42
|
+
markdownTokenName: "list",
|
|
43
|
+
parseMarkdown: (token, helpers) => {
|
|
44
|
+
if (token.type !== "list" || token.ordered) return [];
|
|
45
|
+
return {
|
|
46
|
+
type: "bulletList",
|
|
47
|
+
content: token.items ? helpers.parseChildren(token.items) : []
|
|
48
|
+
};
|
|
49
|
+
},
|
|
50
|
+
renderMarkdown: (node, h) => {
|
|
51
|
+
if (!node.content) return "";
|
|
52
|
+
return h.renderChildren(node.content, "\n");
|
|
53
|
+
},
|
|
54
|
+
markdownOptions: { indentsContent: true },
|
|
55
|
+
addCommands() {
|
|
56
|
+
return { toggleBulletList: () => ({ commands, chain }) => {
|
|
57
|
+
if (this.options.keepAttributes) return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName$1, this.editor.getAttributes(TextStyleName$1)).run();
|
|
58
|
+
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
|
|
59
|
+
} };
|
|
60
|
+
},
|
|
61
|
+
addKeyboardShortcuts() {
|
|
62
|
+
return { "Mod-Shift-8": () => this.editor.commands.toggleBulletList() };
|
|
63
|
+
},
|
|
64
|
+
addInputRules() {
|
|
65
|
+
let inputRule = wrappingInputRule({
|
|
66
|
+
find: bulletListInputRegex,
|
|
67
|
+
type: this.type
|
|
68
|
+
});
|
|
69
|
+
if (this.options.keepMarks || this.options.keepAttributes) inputRule = wrappingInputRule({
|
|
70
|
+
find: bulletListInputRegex,
|
|
71
|
+
type: this.type,
|
|
72
|
+
keepMarks: this.options.keepMarks,
|
|
73
|
+
keepAttributes: this.options.keepAttributes,
|
|
74
|
+
getAttributes: () => {
|
|
75
|
+
return this.editor.getAttributes(TextStyleName$1);
|
|
76
|
+
},
|
|
77
|
+
editor: this.editor
|
|
78
|
+
});
|
|
79
|
+
return [inputRule];
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/helpers/getBranchingNestedListAtCursor.ts
|
|
84
|
+
/**
|
|
85
|
+
* Resolves a branching nested list immediately after the cursor when the selection is
|
|
86
|
+
* collapsed at the end of a textblock inside a list item.
|
|
87
|
+
*
|
|
88
|
+
* @param state - The editor state to inspect.
|
|
89
|
+
* @param itemName - The list item node name (for example `listItem` or `taskItem`).
|
|
90
|
+
* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).
|
|
91
|
+
* @returns Resolved positions and nodes for hoisting, or `null` when not applicable.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const context = getBranchingNestedListAtCursor(editor.state, 'listItem', [
|
|
96
|
+
* 'bulletList',
|
|
97
|
+
* 'orderedList',
|
|
98
|
+
* ])
|
|
99
|
+
*
|
|
100
|
+
* if (context) {
|
|
101
|
+
* // cursor is at the end of Item 1 before a branching nested sublist
|
|
102
|
+
* }
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
const getBranchingNestedListAtCursor = (state, itemName, wrapperNames) => {
|
|
106
|
+
const { selection } = state;
|
|
107
|
+
if (!selection.empty) return null;
|
|
108
|
+
const { $from } = selection;
|
|
109
|
+
if (!$from.parent.isTextblock) return null;
|
|
110
|
+
if ($from.parentOffset !== $from.parent.content.size) return null;
|
|
111
|
+
let listItemDepth = -1;
|
|
112
|
+
for (let depth = $from.depth; depth > 0; depth -= 1) if ($from.node(depth).type.name === itemName) {
|
|
113
|
+
listItemDepth = depth;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
if (listItemDepth < 0) return null;
|
|
117
|
+
const listItem = $from.node(listItemDepth);
|
|
118
|
+
const indexInListItem = $from.index(listItemDepth);
|
|
119
|
+
if (indexInListItem + 1 >= listItem.childCount) return null;
|
|
120
|
+
const nextChild = listItem.child(indexInListItem + 1);
|
|
121
|
+
if (!wrapperNames.includes(nextChild.type.name)) return null;
|
|
122
|
+
const itemType = state.schema.nodes[itemName];
|
|
123
|
+
let hasBranching = false;
|
|
124
|
+
nextChild.forEach((child) => {
|
|
125
|
+
if (child.type === itemType && child.childCount > 1) hasBranching = true;
|
|
126
|
+
});
|
|
127
|
+
if (!hasBranching) return null;
|
|
128
|
+
const nodeAfter = state.doc.resolve($from.after()).nodeAfter;
|
|
129
|
+
if (!nodeAfter || !wrapperNames.includes(nodeAfter.type.name)) return null;
|
|
130
|
+
const items = [];
|
|
131
|
+
nodeAfter.forEach((child) => {
|
|
132
|
+
items.push(child);
|
|
133
|
+
});
|
|
134
|
+
if (items.length === 0) return null;
|
|
135
|
+
return {
|
|
136
|
+
listItemDepth,
|
|
137
|
+
nestedList: nodeAfter,
|
|
138
|
+
nestedListPos: $from.after(),
|
|
139
|
+
insertPos: $from.after(listItemDepth),
|
|
140
|
+
items
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
//#endregion
|
|
144
|
+
//#region src/helpers/hoistBranchingNestedList.ts
|
|
145
|
+
/**
|
|
146
|
+
* Hoists all list items from a branching nested list after the cursor into the parent list.
|
|
147
|
+
*
|
|
148
|
+
* Use this when `joinForward` cannot restructure a nested list that contains list items
|
|
149
|
+
* with sublists (see issue #6906).
|
|
150
|
+
*
|
|
151
|
+
* @param state - The editor state to transform.
|
|
152
|
+
* @param dispatch - Optional dispatch function for the transaction.
|
|
153
|
+
* @param itemName - The list item node name (for example `listItem` or `taskItem`).
|
|
154
|
+
* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).
|
|
155
|
+
* @returns `true` when the nested list was hoisted, otherwise `false`.
|
|
156
|
+
*
|
|
157
|
+
* @example
|
|
158
|
+
* ```ts
|
|
159
|
+
* // Cursor at the end of "Item 1" before a nested list with branching items.
|
|
160
|
+
* hoistBranchingNestedList(editor.state, editor.view.dispatch, 'listItem', [
|
|
161
|
+
* 'bulletList',
|
|
162
|
+
* 'orderedList',
|
|
163
|
+
* ])
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
const hoistBranchingNestedList = (state, dispatch, itemName, wrapperNames) => {
|
|
167
|
+
const context = getBranchingNestedListAtCursor(state, itemName, wrapperNames);
|
|
168
|
+
if (!context) return false;
|
|
169
|
+
const { selection } = state;
|
|
170
|
+
const { nestedList, nestedListPos, insertPos, items } = context;
|
|
171
|
+
const tr = state.tr;
|
|
172
|
+
tr.delete(nestedListPos, nestedListPos + nestedList.nodeSize);
|
|
173
|
+
const mappedInsertPos = tr.mapping.map(insertPos);
|
|
174
|
+
tr.insert(mappedInsertPos, Fragment.from(items));
|
|
175
|
+
tr.setSelection(selection.map(tr.doc, tr.mapping));
|
|
176
|
+
if (dispatch) dispatch(tr);
|
|
177
|
+
return true;
|
|
178
|
+
};
|
|
179
|
+
//#endregion
|
|
180
|
+
//#region src/helpers/handleDeleteBranchingNestedList.ts
|
|
181
|
+
/**
|
|
182
|
+
* Handles Delete for a list item when a branching nested sublist follows the cursor.
|
|
183
|
+
*
|
|
184
|
+
* @param editor - The editor instance whose state should be updated.
|
|
185
|
+
* @param itemName - The list item node name (for example `listItem` or `taskItem`).
|
|
186
|
+
* @param wrapperNames - List wrapper node names (for example `bulletList` and `orderedList`).
|
|
187
|
+
* @returns `true` when the nested list was hoisted, otherwise `false`.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* ```ts
|
|
191
|
+
* Delete: () =>
|
|
192
|
+
* handleDeleteBranchingNestedList(editor, 'listItem', ['bulletList', 'orderedList']),
|
|
193
|
+
* ```
|
|
194
|
+
*/
|
|
195
|
+
const handleDeleteBranchingNestedList = (editor, itemName, wrapperNames) => {
|
|
196
|
+
return hoistBranchingNestedList(editor.state, editor.view.dispatch, itemName, wrapperNames);
|
|
197
|
+
};
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/helpers/createBranchingListDeleteKeymap.ts
|
|
200
|
+
/**
|
|
201
|
+
* Creates a high-priority keymap extension that handles Delete for branching nested lists.
|
|
202
|
+
* Kept separate from the list item node so Enter/Tab shortcuts keep their default priority.
|
|
203
|
+
*/
|
|
204
|
+
const createBranchingListDeleteKeymap = (itemName, wrapperNames) => {
|
|
205
|
+
return Extension.create({
|
|
206
|
+
name: `${itemName}BranchingDeleteKeymap`,
|
|
207
|
+
priority: 101,
|
|
208
|
+
addKeyboardShortcuts() {
|
|
209
|
+
const handleDelete = () => handleDeleteBranchingNestedList(this.editor, itemName, wrapperNames);
|
|
210
|
+
return {
|
|
211
|
+
Delete: handleDelete,
|
|
212
|
+
"Mod-Delete": handleDelete
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
});
|
|
216
|
+
};
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/ordered-list/roman.ts
|
|
219
|
+
const ROMAN_NUMERALS = [
|
|
220
|
+
[1e3, "m"],
|
|
221
|
+
[900, "cm"],
|
|
222
|
+
[500, "d"],
|
|
223
|
+
[400, "cd"],
|
|
224
|
+
[100, "c"],
|
|
225
|
+
[90, "xc"],
|
|
226
|
+
[50, "l"],
|
|
227
|
+
[40, "xl"],
|
|
228
|
+
[10, "x"],
|
|
229
|
+
[9, "ix"],
|
|
230
|
+
[5, "v"],
|
|
231
|
+
[4, "iv"],
|
|
232
|
+
[1, "i"]
|
|
233
|
+
];
|
|
234
|
+
const ALPHA_NUMERALS = "abcdefghijklmnopqrstuvwxyz";
|
|
235
|
+
/**
|
|
236
|
+
* Marker segment for ordered list lines: numeric, roman, or 1–2 letter alpha.
|
|
237
|
+
* Roman is matched before alpha so "iii" is roman; invalid romans like "aa" fall through to alpha.
|
|
238
|
+
*/
|
|
239
|
+
const ORDERED_LIST_MARKER_PATTERN = String.raw`\d+|[ivxlcdmIVXLCDM]+|${"[a-zA-Z]{1,2}"}`;
|
|
240
|
+
/**
|
|
241
|
+
* Convert a number to lowercase roman numerals.
|
|
242
|
+
* @example toRoman(1) // 'i'
|
|
243
|
+
* @example toRoman(4) // 'iv'
|
|
244
|
+
*/
|
|
245
|
+
function toRoman(num) {
|
|
246
|
+
let remaining = num;
|
|
247
|
+
let result = "";
|
|
248
|
+
for (const [value, numeral] of ROMAN_NUMERALS) while (remaining >= value) {
|
|
249
|
+
result += numeral;
|
|
250
|
+
remaining -= value;
|
|
251
|
+
}
|
|
252
|
+
return result;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Convert a number to uppercase roman numerals.
|
|
256
|
+
* @example toRomanUpper(1) // 'I'
|
|
257
|
+
* @example toRomanUpper(4) // 'IV'
|
|
258
|
+
*/
|
|
259
|
+
function toRomanUpper(num) {
|
|
260
|
+
return toRoman(num).toUpperCase();
|
|
261
|
+
}
|
|
262
|
+
function fromRoman(roman) {
|
|
263
|
+
const lower = roman.toLowerCase();
|
|
264
|
+
let index = 0;
|
|
265
|
+
let result = 0;
|
|
266
|
+
while (index < lower.length) {
|
|
267
|
+
let matched = false;
|
|
268
|
+
for (const [value, numeral] of ROMAN_NUMERALS) if (lower.startsWith(numeral, index)) {
|
|
269
|
+
result += value;
|
|
270
|
+
index += numeral.length;
|
|
271
|
+
matched = true;
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
if (!matched) return 0;
|
|
275
|
+
}
|
|
276
|
+
return result;
|
|
277
|
+
}
|
|
278
|
+
function isValidRoman(marker) {
|
|
279
|
+
if (!/^[ivxlcdmIVXLCDM]+$/.test(marker)) return false;
|
|
280
|
+
const value = fromRoman(marker);
|
|
281
|
+
if (value <= 0) return false;
|
|
282
|
+
return (marker === marker.toLowerCase() ? toRoman(value) : toRomanUpper(value)) === marker;
|
|
283
|
+
}
|
|
284
|
+
function fromAlpha(marker) {
|
|
285
|
+
const lower = marker.toLowerCase();
|
|
286
|
+
if (lower.length === 1) return lower.charCodeAt(0) - "a".charCodeAt(0) + 1;
|
|
287
|
+
if (lower.length === 2) {
|
|
288
|
+
const first = lower.charCodeAt(0) - "a".charCodeAt(0);
|
|
289
|
+
const second = lower.charCodeAt(1) - "a".charCodeAt(0);
|
|
290
|
+
return (first + 1) * 26 + second + 1;
|
|
291
|
+
}
|
|
292
|
+
return 0;
|
|
293
|
+
}
|
|
294
|
+
function toRomanAlpha(num) {
|
|
295
|
+
if (num <= 26) return ALPHA_NUMERALS[num - 1];
|
|
296
|
+
const first = Math.floor((num - 1) / 26) - 1;
|
|
297
|
+
const second = (num - 1) % 26;
|
|
298
|
+
if (first < 0) return ALPHA_NUMERALS[second];
|
|
299
|
+
return ALPHA_NUMERALS[first] + ALPHA_NUMERALS[second];
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Extract the list marker type from a marker string.
|
|
303
|
+
* Supports "1", "a", "A", "i", "I" marker styles.
|
|
304
|
+
*
|
|
305
|
+
* @param marker The text content of the list marker (e.g. "a", "1", "iii", "b")
|
|
306
|
+
* @returns The normalized type string, or undefined for default numeric type
|
|
307
|
+
*/
|
|
308
|
+
function detectMarkerType(marker) {
|
|
309
|
+
if (!marker || /^\d+$/.test(marker)) return;
|
|
310
|
+
if (isValidRoman(marker)) return marker === marker.toLowerCase() ? "i" : "I";
|
|
311
|
+
if (/^[a-z]{1,2}$/.test(marker)) return "a";
|
|
312
|
+
if (/^[A-Z]{1,2}$/.test(marker)) return "A";
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Convert a list marker string to its numeric start position.
|
|
316
|
+
*
|
|
317
|
+
* @param marker The text content of the list marker (e.g. "3", "b", "II")
|
|
318
|
+
* @returns The 1-based start value for the ordered list
|
|
319
|
+
*/
|
|
320
|
+
function markerToStart(marker) {
|
|
321
|
+
if (/^\d+$/.test(marker)) return parseInt(marker, 10);
|
|
322
|
+
const type = detectMarkerType(marker);
|
|
323
|
+
if (type === "i" || type === "I") return fromRoman(marker);
|
|
324
|
+
if (type === "a" || type === "A") {
|
|
325
|
+
const start = fromAlpha(marker);
|
|
326
|
+
return start > 0 ? start : 1;
|
|
327
|
+
}
|
|
328
|
+
const parsed = parseInt(marker, 10);
|
|
329
|
+
return Number.isNaN(parsed) ? 1 : parsed;
|
|
330
|
+
}
|
|
331
|
+
function startToMarker(type, start) {
|
|
332
|
+
if (type === "numeric") return String(start);
|
|
333
|
+
switch (type) {
|
|
334
|
+
case "a": return toRomanAlpha(start);
|
|
335
|
+
case "A": return toRomanAlpha(start).toUpperCase();
|
|
336
|
+
case "i": return toRoman(start);
|
|
337
|
+
case "I": return toRomanUpper(start);
|
|
338
|
+
default: return String(start);
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Returns true when all markers share the same style and increment by 1.
|
|
343
|
+
* Style is inferred from the first marker so ambiguous letters (e.g. "c", "i")
|
|
344
|
+
* are not re-classified differently on later lines.
|
|
345
|
+
*/
|
|
346
|
+
function areOrderedListMarkersSequential(markers) {
|
|
347
|
+
var _detectMarkerType;
|
|
348
|
+
if (markers.length === 0) return false;
|
|
349
|
+
const firstType = (_detectMarkerType = detectMarkerType(markers[0])) !== null && _detectMarkerType !== void 0 ? _detectMarkerType : "numeric";
|
|
350
|
+
const firstStart = markerToStart(markers[0]);
|
|
351
|
+
if (firstStart < 1) return false;
|
|
352
|
+
for (let i = 0; i < markers.length; i++) {
|
|
353
|
+
const expected = startToMarker(firstType, firstStart + i);
|
|
354
|
+
if (markers[i] !== expected) return false;
|
|
355
|
+
}
|
|
356
|
+
return true;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Parse a list marker into HTML ordered-list attrs (type + start).
|
|
360
|
+
*/
|
|
361
|
+
function parseListMarker(marker) {
|
|
362
|
+
return {
|
|
363
|
+
type: detectMarkerType(marker),
|
|
364
|
+
start: markerToStart(marker)
|
|
365
|
+
};
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* Build orderedList node attrs from the first list item marker.
|
|
369
|
+
*/
|
|
370
|
+
function buildOrderedListAttrsFromMarker(marker) {
|
|
371
|
+
const { type, start } = parseListMarker(marker);
|
|
372
|
+
const attrs = {};
|
|
373
|
+
if (type) attrs.type = type;
|
|
374
|
+
if (start !== 1) attrs.start = start;
|
|
375
|
+
return attrs;
|
|
376
|
+
}
|
|
377
|
+
/**
|
|
378
|
+
* Returns the list marker prefix for a given item at a given index.
|
|
379
|
+
*
|
|
380
|
+
* @param type The list type attribute (e.g. "a", "A", "i", "I", null/undefined for default)
|
|
381
|
+
* @param index The zero-based index of the list item
|
|
382
|
+
* @param separator The separator to use (default: ". ")
|
|
383
|
+
* @returns The marker string (e.g. "a. ", "I. ", "1. ")
|
|
384
|
+
*/
|
|
385
|
+
function getListMarker(type, index, separator = ". ") {
|
|
386
|
+
const position = index + 1;
|
|
387
|
+
if (!type || type === "1") return `${position}${separator}`;
|
|
388
|
+
switch (type) {
|
|
389
|
+
case "a": return `${toRomanAlpha(position)}${separator}`;
|
|
390
|
+
case "A": return `${toRomanAlpha(position).toUpperCase()}${separator}`;
|
|
391
|
+
case "i": return `${toRoman(position)}${separator}`;
|
|
392
|
+
case "I": return `${toRomanUpper(position)}${separator}`;
|
|
393
|
+
default: return `${position}${separator}`;
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
//#endregion
|
|
397
|
+
//#region src/item/list-item.ts
|
|
398
|
+
function isSameLineOrderedListToken(token) {
|
|
399
|
+
var _token$tokens, _token$tokens2;
|
|
400
|
+
const nestedToken = (_token$tokens = token.tokens) === null || _token$tokens === void 0 ? void 0 : _token$tokens[0];
|
|
401
|
+
return Boolean(token.text && ((_token$tokens2 = token.tokens) === null || _token$tokens2 === void 0 ? void 0 : _token$tokens2.length) === 1 && (nestedToken === null || nestedToken === void 0 ? void 0 : nestedToken.type) === "list" && nestedToken.ordered && nestedToken.raw === token.text);
|
|
402
|
+
}
|
|
403
|
+
function parseSameLineOrderedListText(text, helpers) {
|
|
404
|
+
if (helpers.tokenizeInline) return helpers.parseInline(helpers.tokenizeInline(text));
|
|
405
|
+
return helpers.parseInline([{
|
|
406
|
+
type: "text",
|
|
407
|
+
raw: text,
|
|
408
|
+
text
|
|
409
|
+
}]);
|
|
410
|
+
}
|
|
411
|
+
/**
|
|
412
|
+
* This extension allows you to create list items.
|
|
413
|
+
* @see https://www.tiptap.dev/api/nodes/list-item
|
|
414
|
+
*/
|
|
415
|
+
const ListItem = Node.create({
|
|
416
|
+
name: "listItem",
|
|
417
|
+
addOptions() {
|
|
418
|
+
return {
|
|
419
|
+
HTMLAttributes: {},
|
|
420
|
+
bulletListTypeName: "bulletList",
|
|
421
|
+
orderedListTypeName: "orderedList"
|
|
422
|
+
};
|
|
423
|
+
},
|
|
424
|
+
content: "paragraph block*",
|
|
425
|
+
defining: true,
|
|
426
|
+
parseHTML() {
|
|
427
|
+
return [{ tag: "li" }];
|
|
428
|
+
},
|
|
429
|
+
renderHTML({ HTMLAttributes }) {
|
|
430
|
+
return [
|
|
431
|
+
"li",
|
|
432
|
+
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes),
|
|
433
|
+
0
|
|
434
|
+
];
|
|
435
|
+
},
|
|
436
|
+
markdownTokenName: "list_item",
|
|
437
|
+
parseMarkdown: (token, helpers) => {
|
|
438
|
+
var _helpers$parseBlockCh;
|
|
439
|
+
if (token.type !== "list_item") return [];
|
|
440
|
+
const parseBlockChildren = (_helpers$parseBlockCh = helpers.parseBlockChildren) !== null && _helpers$parseBlockCh !== void 0 ? _helpers$parseBlockCh : helpers.parseChildren;
|
|
441
|
+
let content = [];
|
|
442
|
+
if (token.tokens && token.tokens.length > 0) {
|
|
443
|
+
if (isSameLineOrderedListToken(token)) return {
|
|
444
|
+
type: "listItem",
|
|
445
|
+
content: [{
|
|
446
|
+
type: "paragraph",
|
|
447
|
+
content: parseSameLineOrderedListText(token.text || "", helpers)
|
|
448
|
+
}]
|
|
449
|
+
};
|
|
450
|
+
if (token.tokens.some((t) => t.type === "paragraph")) content = parseBlockChildren(token.tokens);
|
|
451
|
+
else {
|
|
452
|
+
const firstToken = token.tokens[0];
|
|
453
|
+
if (firstToken && firstToken.type === "text" && firstToken.tokens && firstToken.tokens.length > 0) {
|
|
454
|
+
content = [{
|
|
455
|
+
type: "paragraph",
|
|
456
|
+
content: helpers.parseInline(firstToken.tokens)
|
|
457
|
+
}];
|
|
458
|
+
if (token.tokens.length > 1) {
|
|
459
|
+
const additionalContent = parseBlockChildren(token.tokens.slice(1));
|
|
460
|
+
content.push(...additionalContent);
|
|
461
|
+
}
|
|
462
|
+
} else content = parseBlockChildren(token.tokens);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
if (content.length === 0) content = [{
|
|
466
|
+
type: "paragraph",
|
|
467
|
+
content: []
|
|
468
|
+
}];
|
|
469
|
+
return {
|
|
470
|
+
type: "listItem",
|
|
471
|
+
content
|
|
472
|
+
};
|
|
473
|
+
},
|
|
474
|
+
renderMarkdown: (node, h, ctx) => {
|
|
475
|
+
return renderNestedMarkdownContent(node, h, (context) => {
|
|
476
|
+
if (context.parentType === "bulletList") return "- ";
|
|
477
|
+
if (context.parentType === "orderedList") {
|
|
478
|
+
var _context$meta, _context$meta2;
|
|
479
|
+
const start = ((_context$meta = context.meta) === null || _context$meta === void 0 || (_context$meta = _context$meta.parentAttrs) === null || _context$meta === void 0 ? void 0 : _context$meta.start) || 1;
|
|
480
|
+
return getListMarker((_context$meta2 = context.meta) === null || _context$meta2 === void 0 || (_context$meta2 = _context$meta2.parentAttrs) === null || _context$meta2 === void 0 ? void 0 : _context$meta2.type, start - 1 + (context.index || 0), ". ");
|
|
481
|
+
}
|
|
482
|
+
return "- ";
|
|
483
|
+
}, ctx, { alignNestedToPrefix: (ctx === null || ctx === void 0 ? void 0 : ctx.parentType) === "orderedList" });
|
|
484
|
+
},
|
|
485
|
+
addExtensions() {
|
|
486
|
+
return [createBranchingListDeleteKeymap(this.name, [this.options.bulletListTypeName, this.options.orderedListTypeName])];
|
|
487
|
+
},
|
|
488
|
+
addKeyboardShortcuts() {
|
|
489
|
+
return {
|
|
490
|
+
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
491
|
+
Tab: () => this.editor.commands.sinkListItem(this.name),
|
|
492
|
+
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
493
|
+
};
|
|
494
|
+
}
|
|
495
|
+
});
|
|
496
|
+
//#endregion
|
|
497
|
+
//#region src/keymap/listHelpers/findListItemPos.ts
|
|
498
|
+
const findListItemPos = (typeOrName, state) => {
|
|
499
|
+
const { $from } = state.selection;
|
|
500
|
+
const nodeType = getNodeType(typeOrName, state.schema);
|
|
501
|
+
let currentNode = null;
|
|
502
|
+
let currentDepth = $from.depth;
|
|
503
|
+
let currentPos = $from.pos;
|
|
504
|
+
let targetDepth = null;
|
|
505
|
+
while (currentDepth > 0 && targetDepth === null) {
|
|
506
|
+
currentNode = $from.node(currentDepth);
|
|
507
|
+
if (currentNode.type === nodeType) targetDepth = currentDepth;
|
|
508
|
+
else {
|
|
509
|
+
currentDepth -= 1;
|
|
510
|
+
currentPos -= 1;
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
if (targetDepth === null) return null;
|
|
514
|
+
return {
|
|
515
|
+
$pos: state.doc.resolve(currentPos),
|
|
516
|
+
depth: targetDepth
|
|
517
|
+
};
|
|
518
|
+
};
|
|
519
|
+
//#endregion
|
|
520
|
+
//#region src/keymap/listHelpers/getNextListDepth.ts
|
|
521
|
+
const getNextListDepth = (typeOrName, state) => {
|
|
522
|
+
const listItemPos = findListItemPos(typeOrName, state);
|
|
523
|
+
if (!listItemPos) return false;
|
|
524
|
+
const [, depth] = getNodeAtPosition(state, typeOrName, listItemPos.$pos.pos + 4);
|
|
525
|
+
return depth;
|
|
526
|
+
};
|
|
527
|
+
//#endregion
|
|
528
|
+
//#region src/keymap/listHelpers/hasListBefore.ts
|
|
529
|
+
const hasListBefore = (editorState, name, parentListTypes) => {
|
|
530
|
+
const { $anchor } = editorState.selection;
|
|
531
|
+
const previousNodePos = Math.max(0, $anchor.pos - 2);
|
|
532
|
+
const previousNode = editorState.doc.resolve(previousNodePos).node();
|
|
533
|
+
if (!previousNode || !parentListTypes.includes(previousNode.type.name)) return false;
|
|
534
|
+
return true;
|
|
535
|
+
};
|
|
536
|
+
//#endregion
|
|
537
|
+
//#region src/keymap/listHelpers/handleBackspace.ts
|
|
538
|
+
const handleBackspace = (editor, name, parentListTypes) => {
|
|
539
|
+
if (editor.commands.undoInputRule()) return true;
|
|
540
|
+
if (editor.state.selection.from !== editor.state.selection.to) return false;
|
|
541
|
+
if (!isNodeActive(editor.state, name) && hasListBefore(editor.state, name, parentListTypes)) {
|
|
542
|
+
const { $anchor } = editor.state.selection;
|
|
543
|
+
const $listPos = editor.state.doc.resolve($anchor.before() - 1);
|
|
544
|
+
const listDescendants = [];
|
|
545
|
+
$listPos.node().descendants((node, pos) => {
|
|
546
|
+
if (node.type.name === name) listDescendants.push({
|
|
547
|
+
node,
|
|
548
|
+
pos
|
|
549
|
+
});
|
|
550
|
+
});
|
|
551
|
+
const lastItem = listDescendants.at(-1);
|
|
552
|
+
if (!lastItem) return false;
|
|
553
|
+
const $lastItemPos = editor.state.doc.resolve($listPos.start() + lastItem.pos + 1);
|
|
554
|
+
return editor.chain().cut({
|
|
555
|
+
from: $anchor.start() - 1,
|
|
556
|
+
to: $anchor.end() + 1
|
|
557
|
+
}, $lastItemPos.end()).joinForward().run();
|
|
558
|
+
}
|
|
559
|
+
if (!isNodeActive(editor.state, name)) return false;
|
|
560
|
+
if (!isAtStartOfNode(editor.state)) return false;
|
|
561
|
+
const { $from } = editor.state.selection;
|
|
562
|
+
const itemDepth = $from.depth - 1;
|
|
563
|
+
if ($from.node(itemDepth).type !== editor.schema.nodes[name] || $from.index(itemDepth) !== 0) return false;
|
|
564
|
+
return editor.chain().liftListItem(name).run();
|
|
565
|
+
};
|
|
566
|
+
//#endregion
|
|
567
|
+
//#region src/keymap/listHelpers/nextListIsDeeper.ts
|
|
568
|
+
const nextListIsDeeper = (typeOrName, state) => {
|
|
569
|
+
const listDepth = getNextListDepth(typeOrName, state);
|
|
570
|
+
const listItemPos = findListItemPos(typeOrName, state);
|
|
571
|
+
if (!listItemPos || !listDepth) return false;
|
|
572
|
+
if (listDepth > listItemPos.depth) return true;
|
|
573
|
+
return false;
|
|
574
|
+
};
|
|
575
|
+
//#endregion
|
|
576
|
+
//#region src/keymap/listHelpers/nextListIsHigher.ts
|
|
577
|
+
const nextListIsHigher = (typeOrName, state) => {
|
|
578
|
+
const listDepth = getNextListDepth(typeOrName, state);
|
|
579
|
+
const listItemPos = findListItemPos(typeOrName, state);
|
|
580
|
+
if (!listItemPos || !listDepth) return false;
|
|
581
|
+
if (listDepth < listItemPos.depth) return true;
|
|
582
|
+
return false;
|
|
583
|
+
};
|
|
584
|
+
//#endregion
|
|
585
|
+
//#region src/keymap/listHelpers/handleDelete.ts
|
|
586
|
+
const handleDelete = (editor, name) => {
|
|
587
|
+
if (!isNodeActive(editor.state, name)) return false;
|
|
588
|
+
if (!isAtEndOfNode(editor.state, name)) return false;
|
|
589
|
+
const { selection } = editor.state;
|
|
590
|
+
const { $from, $to } = selection;
|
|
591
|
+
if (!selection.empty && $from.sameParent($to)) return false;
|
|
592
|
+
if (nextListIsDeeper(name, editor.state)) return editor.chain().focus(editor.state.selection.from + 4).lift(name).joinBackward().run();
|
|
593
|
+
if (nextListIsHigher(name, editor.state)) return editor.chain().joinForward().joinBackward().run();
|
|
594
|
+
return editor.commands.joinItemForward();
|
|
595
|
+
};
|
|
596
|
+
//#endregion
|
|
597
|
+
//#region src/keymap/listHelpers/handleTab.ts
|
|
598
|
+
const handleTab = (editor, name, parentListTypes) => {
|
|
599
|
+
const { state } = editor;
|
|
600
|
+
const { selection } = state;
|
|
601
|
+
if (!selection.empty) return false;
|
|
602
|
+
const { $from } = selection;
|
|
603
|
+
if ($from.parentOffset !== 0) return false;
|
|
604
|
+
if (!$from.parent.isTextblock) return false;
|
|
605
|
+
if (isNodeActive(state, name)) return false;
|
|
606
|
+
const previous = getPreviousBlockSibling($from);
|
|
607
|
+
if (!previous || !parentListTypes.includes(previous.type.name)) return false;
|
|
608
|
+
const lastItem = previous.lastChild;
|
|
609
|
+
if (!lastItem || lastItem.type.name !== name) return false;
|
|
610
|
+
const block = $from.parent;
|
|
611
|
+
if (!lastItem.canReplace(lastItem.childCount, lastItem.childCount, Fragment.from(block))) return false;
|
|
612
|
+
const blockStart = $from.before();
|
|
613
|
+
const blockEnd = $from.after();
|
|
614
|
+
const insideLastItemEnd = blockStart - 2;
|
|
615
|
+
return editor.commands.command(({ tr, dispatch }) => {
|
|
616
|
+
if (dispatch) {
|
|
617
|
+
tr.delete(blockStart, blockEnd).insert(insideLastItemEnd, Fragment.from(block));
|
|
618
|
+
tr.setSelection(TextSelection.create(tr.doc, insideLastItemEnd + 1));
|
|
619
|
+
tr.scrollIntoView();
|
|
620
|
+
}
|
|
621
|
+
return true;
|
|
622
|
+
});
|
|
623
|
+
};
|
|
624
|
+
//#endregion
|
|
625
|
+
//#region src/keymap/listHelpers/hasListItemAfter.ts
|
|
626
|
+
const hasListItemAfter = (typeOrName, state) => {
|
|
627
|
+
var _$targetPos$nodeAfter;
|
|
628
|
+
const { $anchor } = state.selection;
|
|
629
|
+
const $targetPos = state.doc.resolve($anchor.pos - $anchor.parentOffset - 2);
|
|
630
|
+
if ($targetPos.index() === $targetPos.parent.childCount - 1) return false;
|
|
631
|
+
if (((_$targetPos$nodeAfter = $targetPos.nodeAfter) === null || _$targetPos$nodeAfter === void 0 ? void 0 : _$targetPos$nodeAfter.type.name) !== typeOrName) return false;
|
|
632
|
+
return true;
|
|
633
|
+
};
|
|
634
|
+
//#endregion
|
|
635
|
+
//#region src/keymap/listHelpers/hasListItemBefore.ts
|
|
636
|
+
const hasListItemBefore = (typeOrName, state) => {
|
|
637
|
+
var _$targetPos$nodeBefor;
|
|
638
|
+
const { $anchor } = state.selection;
|
|
639
|
+
const $targetPos = state.doc.resolve($anchor.pos - 2);
|
|
640
|
+
if ($targetPos.index() === 0) return false;
|
|
641
|
+
if (((_$targetPos$nodeBefor = $targetPos.nodeBefore) === null || _$targetPos$nodeBefor === void 0 ? void 0 : _$targetPos$nodeBefor.type.name) !== typeOrName) return false;
|
|
642
|
+
return true;
|
|
643
|
+
};
|
|
644
|
+
//#endregion
|
|
645
|
+
//#region src/keymap/listHelpers/listItemHasSubList.ts
|
|
646
|
+
const listItemHasSubList = (typeOrName, state, node) => {
|
|
647
|
+
if (!node) return false;
|
|
648
|
+
const nodeType = getNodeType(typeOrName, state.schema);
|
|
649
|
+
let hasSubList = false;
|
|
650
|
+
node.descendants((child) => {
|
|
651
|
+
if (child.type === nodeType) hasSubList = true;
|
|
652
|
+
});
|
|
653
|
+
return hasSubList;
|
|
654
|
+
};
|
|
655
|
+
//#endregion
|
|
656
|
+
//#region src/keymap/listHelpers/index.ts
|
|
657
|
+
var listHelpers_exports = /* @__PURE__ */ __exportAll({
|
|
658
|
+
findListItemPos: () => findListItemPos,
|
|
659
|
+
getNextListDepth: () => getNextListDepth,
|
|
660
|
+
handleBackspace: () => handleBackspace,
|
|
661
|
+
handleDelete: () => handleDelete,
|
|
662
|
+
handleTab: () => handleTab,
|
|
663
|
+
hasListBefore: () => hasListBefore,
|
|
664
|
+
hasListItemAfter: () => hasListItemAfter,
|
|
665
|
+
hasListItemBefore: () => hasListItemBefore,
|
|
666
|
+
listItemHasSubList: () => listItemHasSubList,
|
|
667
|
+
nextListIsDeeper: () => nextListIsDeeper,
|
|
668
|
+
nextListIsHigher: () => nextListIsHigher
|
|
669
|
+
});
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/keymap/list-keymap.ts
|
|
672
|
+
/**
|
|
673
|
+
* This extension registers custom keymaps to change the behaviour of the backspace and delete keys.
|
|
674
|
+
* By default Prosemirror keyhandling will always lift or sink items so paragraphs are joined into
|
|
675
|
+
* the adjacent or previous list item. This extension will prevent this behaviour and instead will
|
|
676
|
+
* try to join paragraphs from two list items into a single list item.
|
|
677
|
+
* @see https://www.tiptap.dev/api/extensions/list-keymap
|
|
678
|
+
*/
|
|
679
|
+
const ListKeymap = Extension.create({
|
|
680
|
+
name: "listKeymap",
|
|
681
|
+
addOptions() {
|
|
682
|
+
return { listTypes: [{
|
|
683
|
+
itemName: "listItem",
|
|
684
|
+
wrapperNames: ["bulletList", "orderedList"]
|
|
685
|
+
}, {
|
|
686
|
+
itemName: "taskItem",
|
|
687
|
+
wrapperNames: ["taskList"]
|
|
688
|
+
}] };
|
|
689
|
+
},
|
|
690
|
+
addKeyboardShortcuts() {
|
|
691
|
+
return {
|
|
692
|
+
Delete: ({ editor }) => {
|
|
693
|
+
let handled = false;
|
|
694
|
+
this.options.listTypes.forEach(({ itemName }) => {
|
|
695
|
+
if (editor.state.schema.nodes[itemName] === void 0) return;
|
|
696
|
+
if (handleDelete(editor, itemName)) handled = true;
|
|
697
|
+
});
|
|
698
|
+
return handled;
|
|
699
|
+
},
|
|
700
|
+
"Mod-Delete": ({ editor }) => {
|
|
701
|
+
let handled = false;
|
|
702
|
+
this.options.listTypes.forEach(({ itemName }) => {
|
|
703
|
+
if (editor.state.schema.nodes[itemName] === void 0) return;
|
|
704
|
+
if (handleDelete(editor, itemName)) handled = true;
|
|
705
|
+
});
|
|
706
|
+
return handled;
|
|
707
|
+
},
|
|
708
|
+
Backspace: ({ editor }) => {
|
|
709
|
+
let handled = false;
|
|
710
|
+
this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
|
|
711
|
+
if (editor.state.schema.nodes[itemName] === void 0) return;
|
|
712
|
+
if (handleBackspace(editor, itemName, wrapperNames)) handled = true;
|
|
713
|
+
});
|
|
714
|
+
return handled;
|
|
715
|
+
},
|
|
716
|
+
"Mod-Backspace": ({ editor }) => {
|
|
717
|
+
let handled = false;
|
|
718
|
+
this.options.listTypes.forEach(({ itemName, wrapperNames }) => {
|
|
719
|
+
if (editor.state.schema.nodes[itemName] === void 0) return;
|
|
720
|
+
if (handleBackspace(editor, itemName, wrapperNames)) handled = true;
|
|
721
|
+
});
|
|
722
|
+
return handled;
|
|
723
|
+
},
|
|
724
|
+
Tab: ({ editor }) => {
|
|
725
|
+
for (const { itemName, wrapperNames } of this.options.listTypes) {
|
|
726
|
+
if (editor.state.schema.nodes[itemName] === void 0) continue;
|
|
727
|
+
if (handleTab(editor, itemName, wrapperNames)) return true;
|
|
728
|
+
}
|
|
729
|
+
return false;
|
|
730
|
+
}
|
|
731
|
+
};
|
|
732
|
+
}
|
|
733
|
+
});
|
|
734
|
+
//#endregion
|
|
735
|
+
//#region src/ordered-list/utils.ts
|
|
736
|
+
/**
|
|
737
|
+
* Matches an ordered list item line with optional leading whitespace.
|
|
738
|
+
* Captures: (1) indentation spaces, (2) item marker (number, letter, or roman numeral),
|
|
739
|
+
* (3) separator (. or )), (4) content after marker
|
|
740
|
+
*
|
|
741
|
+
* Examples: "1. Item", " a) Nested item", " I. Roman item", "iii. Another", "aa. Item 27"
|
|
742
|
+
*/
|
|
743
|
+
const ORDERED_LIST_ITEM_REGEX = new RegExp(`^(\\s*)(${ORDERED_LIST_MARKER_PATTERN})([.)])\\s+(.*)$`);
|
|
744
|
+
/**
|
|
745
|
+
* Matches any line that starts with whitespace (indented content).
|
|
746
|
+
* Used to identify continuation content that belongs to a list item.
|
|
747
|
+
*/
|
|
748
|
+
const INDENTED_LINE_REGEX = /^\s/;
|
|
749
|
+
/**
|
|
750
|
+
* This are blocks that can interrupt a paragraph, so a line starting with one of
|
|
751
|
+
* them can never be lazy continuation text of a list item
|
|
752
|
+
*/
|
|
753
|
+
const PARAGRAPH_INTERRUPTERS = {
|
|
754
|
+
heading: /^#{1,6}(?:\s|$)/,
|
|
755
|
+
bulletItem: /^[-+*]\s+/,
|
|
756
|
+
codeFence: /^(?:```|~~~)/,
|
|
757
|
+
blockMath: /^\$\$/,
|
|
758
|
+
thematicBreak: /^(?:(?:-[ \t]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})$/
|
|
759
|
+
};
|
|
760
|
+
function isOrderedListMarkerLine(line) {
|
|
761
|
+
return ORDERED_LIST_ITEM_REGEX.test(line.trimStart());
|
|
762
|
+
}
|
|
763
|
+
function isBlockContentLine(line) {
|
|
764
|
+
const trimmedLine = line.trimStart();
|
|
765
|
+
return PARAGRAPH_INTERRUPTERS.bulletItem.test(trimmedLine) || isOrderedListMarkerLine(trimmedLine) || PARAGRAPH_INTERRUPTERS.heading.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.thematicBreak.test(trimmedLine) && !trimmedLine.startsWith("-") || /^>\s?/.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.codeFence.test(trimmedLine) || PARAGRAPH_INTERRUPTERS.blockMath.test(trimmedLine);
|
|
766
|
+
}
|
|
767
|
+
function interruptsLazyContinuation(line) {
|
|
768
|
+
return Object.values(PARAGRAPH_INTERRUPTERS).some((pattern) => pattern.test(line));
|
|
769
|
+
}
|
|
770
|
+
function splitItemContent(contentLines) {
|
|
771
|
+
const paragraphLines = [];
|
|
772
|
+
const blockLines = [];
|
|
773
|
+
let reachedBlockBoundary = false;
|
|
774
|
+
contentLines.forEach((line) => {
|
|
775
|
+
if (reachedBlockBoundary) {
|
|
776
|
+
blockLines.push(line);
|
|
777
|
+
return;
|
|
778
|
+
}
|
|
779
|
+
if (line.trim() === "") {
|
|
780
|
+
reachedBlockBoundary = true;
|
|
781
|
+
blockLines.push(line);
|
|
782
|
+
return;
|
|
783
|
+
}
|
|
784
|
+
if (paragraphLines.length > 0 && isBlockContentLine(line)) {
|
|
785
|
+
reachedBlockBoundary = true;
|
|
786
|
+
blockLines.push(line);
|
|
787
|
+
return;
|
|
788
|
+
}
|
|
789
|
+
paragraphLines.push(line);
|
|
790
|
+
});
|
|
791
|
+
return {
|
|
792
|
+
paragraphLines,
|
|
793
|
+
blockLines
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
/**
|
|
797
|
+
* Collects all ordered list items from lines, parsing them into a flat array
|
|
798
|
+
* with indentation information. Stops collecting continuation content when
|
|
799
|
+
* encountering nested list items, allowing them to be processed separately.
|
|
800
|
+
*
|
|
801
|
+
* @param lines - Array of source lines to parse
|
|
802
|
+
* @returns Tuple of [listItems array, number of lines consumed]
|
|
803
|
+
*/
|
|
804
|
+
function collectOrderedListItems(lines) {
|
|
805
|
+
const listItems = [];
|
|
806
|
+
let currentLineIndex = 0;
|
|
807
|
+
let consumed = 0;
|
|
808
|
+
while (currentLineIndex < lines.length) {
|
|
809
|
+
const line = lines[currentLineIndex];
|
|
810
|
+
const match = line.match(ORDERED_LIST_ITEM_REGEX);
|
|
811
|
+
if (!match) break;
|
|
812
|
+
const [, indent, marker, _separator, content] = match;
|
|
813
|
+
const indentLevel = indent.length;
|
|
814
|
+
const number = parseInt(marker, 10);
|
|
815
|
+
const markerType = isNaN(number) ? detectMarkerType(marker) : void 0;
|
|
816
|
+
const itemNumber = isNaN(number) ? markerToStart(marker) : number;
|
|
817
|
+
const itemContentLines = [content];
|
|
818
|
+
let nextLineIndex = currentLineIndex + 1;
|
|
819
|
+
const itemLines = [line];
|
|
820
|
+
let sawBlankLine = false;
|
|
821
|
+
while (nextLineIndex < lines.length) {
|
|
822
|
+
const nextLine = lines[nextLineIndex];
|
|
823
|
+
if (nextLine.match(ORDERED_LIST_ITEM_REGEX)) break;
|
|
824
|
+
if (nextLine.trim() === "") {
|
|
825
|
+
itemLines.push(nextLine);
|
|
826
|
+
itemContentLines.push("");
|
|
827
|
+
sawBlankLine = true;
|
|
828
|
+
nextLineIndex += 1;
|
|
829
|
+
} else if (nextLine.match(INDENTED_LINE_REGEX)) {
|
|
830
|
+
const leadingWhitespace = nextLine.length - nextLine.trimStart().length;
|
|
831
|
+
const contentIndent = indentLevel + marker.length + 1;
|
|
832
|
+
itemLines.push(nextLine);
|
|
833
|
+
itemContentLines.push(nextLine.slice(Math.min(leadingWhitespace, contentIndent)));
|
|
834
|
+
nextLineIndex += 1;
|
|
835
|
+
} else {
|
|
836
|
+
if (sawBlankLine || interruptsLazyContinuation(nextLine)) break;
|
|
837
|
+
itemLines.push(nextLine);
|
|
838
|
+
itemContentLines.push(nextLine);
|
|
839
|
+
nextLineIndex += 1;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
listItems.push({
|
|
843
|
+
indent: indentLevel,
|
|
844
|
+
number: itemNumber,
|
|
845
|
+
type: markerType,
|
|
846
|
+
content: itemContentLines.join("\n").trim(),
|
|
847
|
+
contentLines: itemContentLines,
|
|
848
|
+
raw: itemLines.join("\n")
|
|
849
|
+
});
|
|
850
|
+
consumed = nextLineIndex;
|
|
851
|
+
currentLineIndex = nextLineIndex;
|
|
852
|
+
}
|
|
853
|
+
return [listItems, consumed];
|
|
854
|
+
}
|
|
855
|
+
const PLAIN_TEXT_ORDERED_LIST_LINE_REGEX = new RegExp(`^(${ORDERED_LIST_MARKER_PATTERN})([.)])\\s+(.+)$`);
|
|
856
|
+
/**
|
|
857
|
+
* Parse plain-text pasted ordered list lines into JSONContent, or null if not a typed list.
|
|
858
|
+
*/
|
|
859
|
+
function parsePlainTextOrderedListPaste(text) {
|
|
860
|
+
const lines = text.split("\n").filter((l) => l.trim().length > 0);
|
|
861
|
+
if (lines.length === 0) return null;
|
|
862
|
+
const parsedItems = [];
|
|
863
|
+
for (const line of lines) {
|
|
864
|
+
const match = line.trim().match(PLAIN_TEXT_ORDERED_LIST_LINE_REGEX);
|
|
865
|
+
if (!match) return null;
|
|
866
|
+
parsedItems.push({
|
|
867
|
+
marker: match[1],
|
|
868
|
+
content: match[3]
|
|
869
|
+
});
|
|
870
|
+
}
|
|
871
|
+
if (!areOrderedListMarkersSequential(parsedItems.map((item) => item.marker))) return null;
|
|
872
|
+
return {
|
|
873
|
+
type: "orderedList",
|
|
874
|
+
attrs: buildOrderedListAttrsFromMarker(parsedItems[0].marker),
|
|
875
|
+
content: parsedItems.map((item) => ({
|
|
876
|
+
type: "listItem",
|
|
877
|
+
content: [{
|
|
878
|
+
type: "paragraph",
|
|
879
|
+
content: [{
|
|
880
|
+
type: "text",
|
|
881
|
+
text: item.content
|
|
882
|
+
}]
|
|
883
|
+
}]
|
|
884
|
+
}))
|
|
885
|
+
};
|
|
886
|
+
}
|
|
887
|
+
/**
|
|
888
|
+
* Recursively builds a nested structure from a flat array of list items
|
|
889
|
+
* based on their indentation levels. Creates proper markdown tokens with
|
|
890
|
+
* nested lists where appropriate.
|
|
891
|
+
*
|
|
892
|
+
* @param items - Flat array of list items with indentation info
|
|
893
|
+
* @param baseIndent - The indentation level to process at this recursion level
|
|
894
|
+
* @param lexer - Markdown lexer for parsing inline and block content
|
|
895
|
+
* @returns Array of list_item tokens with proper nesting
|
|
896
|
+
*/
|
|
897
|
+
function buildNestedStructure(items, baseIndent, lexer) {
|
|
898
|
+
const result = [];
|
|
899
|
+
let currentIndex = 0;
|
|
900
|
+
while (currentIndex < items.length) {
|
|
901
|
+
const item = items[currentIndex];
|
|
902
|
+
if (item.indent === baseIndent) {
|
|
903
|
+
const { paragraphLines, blockLines } = splitItemContent(item.contentLines);
|
|
904
|
+
const mainText = paragraphLines.join("\n").trim();
|
|
905
|
+
const tokens = [];
|
|
906
|
+
if (mainText) tokens.push({
|
|
907
|
+
type: "paragraph",
|
|
908
|
+
raw: mainText,
|
|
909
|
+
tokens: lexer.inlineTokens(mainText)
|
|
910
|
+
});
|
|
911
|
+
const additionalContent = blockLines.join("\n").trim();
|
|
912
|
+
if (additionalContent) {
|
|
913
|
+
const blockTokens = lexer.blockTokens(additionalContent);
|
|
914
|
+
tokens.push(...blockTokens);
|
|
915
|
+
}
|
|
916
|
+
let lookAheadIndex = currentIndex + 1;
|
|
917
|
+
const nestedItems = [];
|
|
918
|
+
while (lookAheadIndex < items.length && items[lookAheadIndex].indent > baseIndent) {
|
|
919
|
+
nestedItems.push(items[lookAheadIndex]);
|
|
920
|
+
lookAheadIndex += 1;
|
|
921
|
+
}
|
|
922
|
+
if (nestedItems.length > 0) {
|
|
923
|
+
const nestedListItems = buildNestedStructure(nestedItems, Math.min(...nestedItems.map((nestedItem) => nestedItem.indent)), lexer);
|
|
924
|
+
tokens.push({
|
|
925
|
+
type: "list",
|
|
926
|
+
ordered: true,
|
|
927
|
+
start: nestedItems[0].number,
|
|
928
|
+
typeMarker: nestedItems[0].type,
|
|
929
|
+
items: nestedListItems,
|
|
930
|
+
raw: nestedItems.map((nestedItem) => nestedItem.raw).join("\n")
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
result.push({
|
|
934
|
+
type: "list_item",
|
|
935
|
+
raw: item.raw,
|
|
936
|
+
tokens
|
|
937
|
+
});
|
|
938
|
+
currentIndex = lookAheadIndex;
|
|
939
|
+
} else currentIndex += 1;
|
|
940
|
+
}
|
|
941
|
+
return result;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Parses markdown list item tokens into Tiptap JSONContent structure,
|
|
945
|
+
* ensuring text content is properly wrapped in paragraph nodes.
|
|
946
|
+
*
|
|
947
|
+
* @param items - Array of markdown tokens representing list items
|
|
948
|
+
* @param helpers - Markdown parse helpers for recursive parsing
|
|
949
|
+
* @returns Array of listItem JSONContent nodes
|
|
950
|
+
*/
|
|
951
|
+
function parseListItems(items, helpers) {
|
|
952
|
+
return items.map((item) => {
|
|
953
|
+
if (item.type !== "list_item") return helpers.parseChildren([item])[0];
|
|
954
|
+
const content = [];
|
|
955
|
+
if (item.tokens && item.tokens.length > 0) item.tokens.forEach((itemToken) => {
|
|
956
|
+
if (itemToken.type === "paragraph" || itemToken.type === "list" || itemToken.type === "blockquote" || itemToken.type === "code") content.push(...helpers.parseChildren([itemToken]));
|
|
957
|
+
else if (itemToken.type === "text" && itemToken.tokens) {
|
|
958
|
+
const inlineContent = helpers.parseChildren([itemToken]);
|
|
959
|
+
content.push({
|
|
960
|
+
type: "paragraph",
|
|
961
|
+
content: inlineContent
|
|
962
|
+
});
|
|
963
|
+
} else {
|
|
964
|
+
const parsed = helpers.parseChildren([itemToken]);
|
|
965
|
+
if (parsed.length > 0) content.push(...parsed);
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
return {
|
|
969
|
+
type: "listItem",
|
|
970
|
+
content
|
|
971
|
+
};
|
|
972
|
+
});
|
|
973
|
+
}
|
|
974
|
+
//#endregion
|
|
975
|
+
//#region src/ordered-list/collectOrderedListItemsFromSource.ts
|
|
976
|
+
const ORDERED_LIST_SCAN_WINDOW = 64;
|
|
977
|
+
function takeLines(source, max) {
|
|
978
|
+
const lines = [];
|
|
979
|
+
let start = 0;
|
|
980
|
+
while (lines.length < max) {
|
|
981
|
+
const lineEnd = source.indexOf("\n", start);
|
|
982
|
+
if (lineEnd === -1) {
|
|
983
|
+
lines.push(source.slice(start));
|
|
984
|
+
return lines;
|
|
985
|
+
}
|
|
986
|
+
lines.push(source.slice(start, lineEnd));
|
|
987
|
+
start = lineEnd + 1;
|
|
988
|
+
}
|
|
989
|
+
return lines;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
* Collect ordered list items from the start of `source`, reading only the lines the list needs.
|
|
993
|
+
*
|
|
994
|
+
* @param source Markdown beginning at a block boundary.
|
|
995
|
+
* @returns The items, how many lines they consumed, and the lines that were read.
|
|
996
|
+
* @example
|
|
997
|
+
* collectOrderedListItemsFromSource('1. one\n2. two\n\nAfter')
|
|
998
|
+
* // → [[item, item], 3, ['1. one', '2. two', '', 'After']]
|
|
999
|
+
*/
|
|
1000
|
+
function collectOrderedListItemsFromSource(source) {
|
|
1001
|
+
const firstLineEnd = source.indexOf("\n");
|
|
1002
|
+
const firstLine = firstLineEnd === -1 ? source : source.slice(0, firstLineEnd);
|
|
1003
|
+
if (!ORDERED_LIST_ITEM_REGEX.test(firstLine)) return [
|
|
1004
|
+
[],
|
|
1005
|
+
0,
|
|
1006
|
+
[]
|
|
1007
|
+
];
|
|
1008
|
+
let windowSize = ORDERED_LIST_SCAN_WINDOW;
|
|
1009
|
+
let lines = takeLines(source, windowSize);
|
|
1010
|
+
let collected = collectOrderedListItems(lines);
|
|
1011
|
+
while (collected[1] === lines.length && lines.length === windowSize) {
|
|
1012
|
+
windowSize *= 2;
|
|
1013
|
+
lines = takeLines(source, windowSize);
|
|
1014
|
+
collected = collectOrderedListItems(lines);
|
|
1015
|
+
}
|
|
1016
|
+
return [
|
|
1017
|
+
collected[0],
|
|
1018
|
+
collected[1],
|
|
1019
|
+
lines
|
|
1020
|
+
];
|
|
1021
|
+
}
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/ordered-list/ordered-list.ts
|
|
1024
|
+
const ListItemName = "listItem";
|
|
1025
|
+
const TextStyleName = "textStyle";
|
|
1026
|
+
/**
|
|
1027
|
+
* Matches an ordered list to a 1. on input (or any number followed by a dot).
|
|
1028
|
+
*/
|
|
1029
|
+
const orderedListInputRegex = /^(\d+)\.\s$/;
|
|
1030
|
+
/**
|
|
1031
|
+
* Maps CSS list-style-type values to HTML type attribute values.
|
|
1032
|
+
* Google Docs and Word often use CSS instead of the HTML type attribute.
|
|
1033
|
+
*/
|
|
1034
|
+
function cssListStyleTypeToHtmlType(style) {
|
|
1035
|
+
const match = style.match(/list-style-type\s*:\s*([^;]+)/i);
|
|
1036
|
+
if (!match) return null;
|
|
1037
|
+
switch (match[1].trim().toLowerCase()) {
|
|
1038
|
+
case "upper-roman": return "I";
|
|
1039
|
+
case "lower-roman": return "i";
|
|
1040
|
+
case "upper-alpha":
|
|
1041
|
+
case "upper-latin": return "A";
|
|
1042
|
+
case "lower-alpha":
|
|
1043
|
+
case "lower-latin": return "a";
|
|
1044
|
+
default: return null;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
/**
|
|
1048
|
+
* This extension allows you to create ordered lists.
|
|
1049
|
+
* This requires the ListItem extension
|
|
1050
|
+
* @see https://www.tiptap.dev/api/nodes/ordered-list
|
|
1051
|
+
* @see https://www.tiptap.dev/api/nodes/list-item
|
|
1052
|
+
*/
|
|
1053
|
+
const OrderedList = Node.create({
|
|
1054
|
+
name: "orderedList",
|
|
1055
|
+
addOptions() {
|
|
1056
|
+
return {
|
|
1057
|
+
itemTypeName: "listItem",
|
|
1058
|
+
HTMLAttributes: {},
|
|
1059
|
+
keepMarks: false,
|
|
1060
|
+
keepAttributes: false
|
|
1061
|
+
};
|
|
1062
|
+
},
|
|
1063
|
+
group: "block list",
|
|
1064
|
+
content() {
|
|
1065
|
+
return `${this.options.itemTypeName}+`;
|
|
1066
|
+
},
|
|
1067
|
+
addAttributes() {
|
|
1068
|
+
return {
|
|
1069
|
+
start: {
|
|
1070
|
+
default: 1,
|
|
1071
|
+
parseHTML: (element) => {
|
|
1072
|
+
return element.hasAttribute("start") ? parseInt(element.getAttribute("start") || "", 10) : 1;
|
|
1073
|
+
}
|
|
1074
|
+
},
|
|
1075
|
+
type: {
|
|
1076
|
+
default: null,
|
|
1077
|
+
parseHTML: (element) => {
|
|
1078
|
+
const htmlType = element.getAttribute("type");
|
|
1079
|
+
if (htmlType) return htmlType;
|
|
1080
|
+
const style = element.getAttribute("style");
|
|
1081
|
+
if (style) {
|
|
1082
|
+
const mappedFromOl = cssListStyleTypeToHtmlType(style);
|
|
1083
|
+
if (mappedFromOl) return mappedFromOl;
|
|
1084
|
+
}
|
|
1085
|
+
const firstLi = element.querySelector("li");
|
|
1086
|
+
if (firstLi) {
|
|
1087
|
+
const liStyle = firstLi.getAttribute("style");
|
|
1088
|
+
if (liStyle) {
|
|
1089
|
+
const mappedFromLi = cssListStyleTypeToHtmlType(liStyle);
|
|
1090
|
+
if (mappedFromLi) return mappedFromLi;
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
return null;
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
};
|
|
1097
|
+
},
|
|
1098
|
+
parseHTML() {
|
|
1099
|
+
return [{ tag: "ol" }];
|
|
1100
|
+
},
|
|
1101
|
+
renderHTML({ HTMLAttributes }) {
|
|
1102
|
+
const { start, type, ...attributesWithoutType } = HTMLAttributes;
|
|
1103
|
+
const attrs = mergeAttributes(this.options.HTMLAttributes, attributesWithoutType);
|
|
1104
|
+
if (start !== 1) attrs.start = start;
|
|
1105
|
+
if (type && type !== "1") attrs.type = type;
|
|
1106
|
+
return [
|
|
1107
|
+
"ol",
|
|
1108
|
+
attrs,
|
|
1109
|
+
0
|
|
1110
|
+
];
|
|
1111
|
+
},
|
|
1112
|
+
markdownTokenName: "list",
|
|
1113
|
+
parseMarkdown: (token, helpers) => {
|
|
1114
|
+
if (token.type !== "list" || !token.ordered) return [];
|
|
1115
|
+
const startValue = token.start || 1;
|
|
1116
|
+
const typeValue = token.typeMarker;
|
|
1117
|
+
const content = token.items ? parseListItems(token.items, helpers) : [];
|
|
1118
|
+
const attrs = {};
|
|
1119
|
+
if (startValue !== 1) attrs.start = startValue;
|
|
1120
|
+
if (typeValue) attrs.type = typeValue;
|
|
1121
|
+
if (Object.keys(attrs).length > 0) return {
|
|
1122
|
+
type: "orderedList",
|
|
1123
|
+
attrs,
|
|
1124
|
+
content
|
|
1125
|
+
};
|
|
1126
|
+
return {
|
|
1127
|
+
type: "orderedList",
|
|
1128
|
+
content
|
|
1129
|
+
};
|
|
1130
|
+
},
|
|
1131
|
+
renderMarkdown: (node, h) => {
|
|
1132
|
+
if (!node.content) return "";
|
|
1133
|
+
return h.renderChildren(node.content, "\n");
|
|
1134
|
+
},
|
|
1135
|
+
markdownTokenizer: {
|
|
1136
|
+
name: "orderedList",
|
|
1137
|
+
level: "block",
|
|
1138
|
+
start: () => -1,
|
|
1139
|
+
tokenize: (src, _tokens, lexer) => {
|
|
1140
|
+
var _listItems$, _listItems$2;
|
|
1141
|
+
const [listItems, consumed, lines] = collectOrderedListItemsFromSource(src);
|
|
1142
|
+
if (listItems.length === 0) return;
|
|
1143
|
+
const items = buildNestedStructure(listItems, listItems[0].indent, lexer);
|
|
1144
|
+
if (items.length === 0) return;
|
|
1145
|
+
return {
|
|
1146
|
+
type: "list",
|
|
1147
|
+
ordered: true,
|
|
1148
|
+
start: ((_listItems$ = listItems[0]) === null || _listItems$ === void 0 ? void 0 : _listItems$.number) || 1,
|
|
1149
|
+
typeMarker: (_listItems$2 = listItems[0]) === null || _listItems$2 === void 0 ? void 0 : _listItems$2.type,
|
|
1150
|
+
items,
|
|
1151
|
+
raw: lines.slice(0, consumed).join("\n")
|
|
1152
|
+
};
|
|
1153
|
+
}
|
|
1154
|
+
},
|
|
1155
|
+
markdownOptions: { indentsContent: true },
|
|
1156
|
+
addCommands() {
|
|
1157
|
+
return { toggleOrderedList: () => ({ commands, chain }) => {
|
|
1158
|
+
if (this.options.keepAttributes) return chain().toggleList(this.name, this.options.itemTypeName, this.options.keepMarks).updateAttributes(ListItemName, this.editor.getAttributes(TextStyleName)).run();
|
|
1159
|
+
return commands.toggleList(this.name, this.options.itemTypeName, this.options.keepMarks);
|
|
1160
|
+
} };
|
|
1161
|
+
},
|
|
1162
|
+
addKeyboardShortcuts() {
|
|
1163
|
+
return { "Mod-Shift-7": () => this.editor.commands.toggleOrderedList() };
|
|
1164
|
+
},
|
|
1165
|
+
addProseMirrorPlugins() {
|
|
1166
|
+
return [new Plugin({ props: { handlePaste: (view, event) => {
|
|
1167
|
+
var _event$clipboardData, _event$clipboardData2;
|
|
1168
|
+
const html = (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData("text/html");
|
|
1169
|
+
if (html === null || html === void 0 ? void 0 : html.trim()) return false;
|
|
1170
|
+
const text = (_event$clipboardData2 = event.clipboardData) === null || _event$clipboardData2 === void 0 ? void 0 : _event$clipboardData2.getData("text/plain");
|
|
1171
|
+
if (!text) return false;
|
|
1172
|
+
const orderedListContent = parsePlainTextOrderedListPaste(text);
|
|
1173
|
+
if (!orderedListContent) return false;
|
|
1174
|
+
try {
|
|
1175
|
+
const orderedListNode = view.state.schema.nodeFromJSON(orderedListContent);
|
|
1176
|
+
const tr = view.state.tr.replaceSelectionWith(orderedListNode);
|
|
1177
|
+
view.dispatch(tr);
|
|
1178
|
+
return true;
|
|
1179
|
+
} catch {
|
|
1180
|
+
return false;
|
|
1181
|
+
}
|
|
1182
|
+
} } })];
|
|
1183
|
+
},
|
|
1184
|
+
addInputRules() {
|
|
1185
|
+
const joinPredicate = (match, node) => {
|
|
1186
|
+
return (!node.attrs.type || node.attrs.type === "1") && node.childCount + node.attrs.start === +match[1];
|
|
1187
|
+
};
|
|
1188
|
+
let inputRule = wrappingInputRule({
|
|
1189
|
+
find: orderedListInputRegex,
|
|
1190
|
+
type: this.type,
|
|
1191
|
+
getAttributes: (match) => ({ start: +match[1] }),
|
|
1192
|
+
joinPredicate
|
|
1193
|
+
});
|
|
1194
|
+
if (this.options.keepMarks || this.options.keepAttributes) inputRule = wrappingInputRule({
|
|
1195
|
+
find: orderedListInputRegex,
|
|
1196
|
+
type: this.type,
|
|
1197
|
+
keepMarks: this.options.keepMarks,
|
|
1198
|
+
keepAttributes: this.options.keepAttributes,
|
|
1199
|
+
getAttributes: (match) => ({
|
|
1200
|
+
start: +match[1],
|
|
1201
|
+
...this.editor.getAttributes(TextStyleName)
|
|
1202
|
+
}),
|
|
1203
|
+
joinPredicate,
|
|
1204
|
+
editor: this.editor
|
|
1205
|
+
});
|
|
1206
|
+
return [inputRule];
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
//#endregion
|
|
1210
|
+
//#region src/task-item/task-item.ts
|
|
1211
|
+
/**
|
|
1212
|
+
* Matches a task item to a - [ ] on input.
|
|
1213
|
+
*/
|
|
1214
|
+
const inputRegex = /^\s*(\[([( |x])?\])\s$/;
|
|
1215
|
+
/**
|
|
1216
|
+
* Hides the checkbox label visually while keeping it in the accessibility tree.
|
|
1217
|
+
*/
|
|
1218
|
+
const visuallyHiddenStyle = "position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0";
|
|
1219
|
+
const getCheckboxLabel = (node, checked, a11y) => {
|
|
1220
|
+
var _a11y$checkboxLabel;
|
|
1221
|
+
return (a11y === null || a11y === void 0 || (_a11y$checkboxLabel = a11y.checkboxLabel) === null || _a11y$checkboxLabel === void 0 ? void 0 : _a11y$checkboxLabel.call(a11y, node, checked)) || `Task item checkbox for ${node.textContent || "empty task item"}`;
|
|
1222
|
+
};
|
|
1223
|
+
/**
|
|
1224
|
+
* This extension allows you to create task items.
|
|
1225
|
+
* @see https://www.tiptap.dev/api/nodes/task-item
|
|
1226
|
+
*/
|
|
1227
|
+
const TaskItem = Node.create({
|
|
1228
|
+
name: "taskItem",
|
|
1229
|
+
addOptions() {
|
|
1230
|
+
return {
|
|
1231
|
+
nested: false,
|
|
1232
|
+
HTMLAttributes: {},
|
|
1233
|
+
taskListTypeName: "taskList",
|
|
1234
|
+
a11y: void 0
|
|
1235
|
+
};
|
|
1236
|
+
},
|
|
1237
|
+
content() {
|
|
1238
|
+
return this.options.nested ? "paragraph block*" : "paragraph+";
|
|
1239
|
+
},
|
|
1240
|
+
defining: true,
|
|
1241
|
+
addAttributes() {
|
|
1242
|
+
return { checked: {
|
|
1243
|
+
default: false,
|
|
1244
|
+
keepOnSplit: false,
|
|
1245
|
+
parseHTML: (element) => {
|
|
1246
|
+
const dataChecked = element.getAttribute("data-checked");
|
|
1247
|
+
return dataChecked === "" || dataChecked === "true";
|
|
1248
|
+
},
|
|
1249
|
+
renderHTML: (attributes) => ({ "data-checked": attributes.checked })
|
|
1250
|
+
} };
|
|
1251
|
+
},
|
|
1252
|
+
parseHTML() {
|
|
1253
|
+
return [{
|
|
1254
|
+
tag: `li[data-type="${this.name}"]`,
|
|
1255
|
+
priority: 51,
|
|
1256
|
+
contentElement: (element) => {
|
|
1257
|
+
var _element$querySelecto;
|
|
1258
|
+
return (_element$querySelecto = element.querySelector("div")) !== null && _element$querySelecto !== void 0 ? _element$querySelecto : element;
|
|
1259
|
+
}
|
|
1260
|
+
}];
|
|
1261
|
+
},
|
|
1262
|
+
renderHTML({ node, HTMLAttributes }) {
|
|
1263
|
+
return [
|
|
1264
|
+
"li",
|
|
1265
|
+
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }),
|
|
1266
|
+
[
|
|
1267
|
+
"label",
|
|
1268
|
+
["input", {
|
|
1269
|
+
type: "checkbox",
|
|
1270
|
+
checked: node.attrs.checked ? "checked" : null
|
|
1271
|
+
}],
|
|
1272
|
+
["span"]
|
|
1273
|
+
],
|
|
1274
|
+
["div", 0]
|
|
1275
|
+
];
|
|
1276
|
+
},
|
|
1277
|
+
parseMarkdown: (token, h) => {
|
|
1278
|
+
const content = [];
|
|
1279
|
+
if (token.tokens && token.tokens.length > 0) content.push(h.createNode("paragraph", {}, h.parseInline(token.tokens)));
|
|
1280
|
+
else if (token.text) content.push(h.createNode("paragraph", {}, [h.createNode("text", { text: token.text })]));
|
|
1281
|
+
else content.push(h.createNode("paragraph", {}, []));
|
|
1282
|
+
if (token.nestedTokens && token.nestedTokens.length > 0) {
|
|
1283
|
+
const nestedContent = h.parseChildren(token.nestedTokens);
|
|
1284
|
+
content.push(...nestedContent);
|
|
1285
|
+
}
|
|
1286
|
+
return h.createNode("taskItem", { checked: token.checked || false }, content);
|
|
1287
|
+
},
|
|
1288
|
+
renderMarkdown: (node, h) => {
|
|
1289
|
+
var _node$attrs;
|
|
1290
|
+
const prefix = `- [${((_node$attrs = node.attrs) === null || _node$attrs === void 0 ? void 0 : _node$attrs.checked) ? "x" : " "}] `;
|
|
1291
|
+
return renderNestedMarkdownContent(node, h, prefix);
|
|
1292
|
+
},
|
|
1293
|
+
addExtensions() {
|
|
1294
|
+
if (!this.options.nested) return [];
|
|
1295
|
+
return [createBranchingListDeleteKeymap(this.name, [this.options.taskListTypeName])];
|
|
1296
|
+
},
|
|
1297
|
+
addKeyboardShortcuts() {
|
|
1298
|
+
const shortcuts = {
|
|
1299
|
+
Enter: () => this.editor.commands.splitListItem(this.name),
|
|
1300
|
+
"Shift-Tab": () => this.editor.commands.liftListItem(this.name)
|
|
1301
|
+
};
|
|
1302
|
+
if (!this.options.nested) return shortcuts;
|
|
1303
|
+
return {
|
|
1304
|
+
...shortcuts,
|
|
1305
|
+
Tab: () => this.editor.commands.sinkListItem(this.name)
|
|
1306
|
+
};
|
|
1307
|
+
},
|
|
1308
|
+
addNodeView() {
|
|
1309
|
+
return ({ node, HTMLAttributes, getPos, editor }) => {
|
|
1310
|
+
const listItem = document.createElement("li");
|
|
1311
|
+
const checkboxWrapper = document.createElement("label");
|
|
1312
|
+
const checkboxStyler = document.createElement("span");
|
|
1313
|
+
const checkbox = document.createElement("input");
|
|
1314
|
+
const content = document.createElement("div");
|
|
1315
|
+
checkboxStyler.style.cssText = visuallyHiddenStyle;
|
|
1316
|
+
const updateA11Y = (currentNode) => {
|
|
1317
|
+
const label = getCheckboxLabel(currentNode, currentNode.attrs.checked, this.options.a11y);
|
|
1318
|
+
checkbox.setAttribute("aria-label", label);
|
|
1319
|
+
checkboxStyler.textContent = label;
|
|
1320
|
+
};
|
|
1321
|
+
updateA11Y(node);
|
|
1322
|
+
checkboxWrapper.contentEditable = "false";
|
|
1323
|
+
checkbox.type = "checkbox";
|
|
1324
|
+
checkbox.addEventListener("mousedown", (event) => event.preventDefault());
|
|
1325
|
+
checkbox.addEventListener("change", (event) => {
|
|
1326
|
+
if (!editor.isEditable && !this.options.onReadOnlyChecked) {
|
|
1327
|
+
checkbox.checked = !checkbox.checked;
|
|
1328
|
+
return;
|
|
1329
|
+
}
|
|
1330
|
+
const { checked } = event.target;
|
|
1331
|
+
if (editor.isEditable && typeof getPos === "function") editor.chain().focus(void 0, { scrollIntoView: false }).command(({ tr }) => {
|
|
1332
|
+
const position = getPos();
|
|
1333
|
+
if (typeof position !== "number") return false;
|
|
1334
|
+
const currentNode = tr.doc.nodeAt(position);
|
|
1335
|
+
tr.setNodeMarkup(position, void 0, {
|
|
1336
|
+
...currentNode === null || currentNode === void 0 ? void 0 : currentNode.attrs,
|
|
1337
|
+
checked
|
|
1338
|
+
});
|
|
1339
|
+
return true;
|
|
1340
|
+
}).run();
|
|
1341
|
+
if (!editor.isEditable && this.options.onReadOnlyChecked) {
|
|
1342
|
+
if (!this.options.onReadOnlyChecked(node, checked)) checkbox.checked = !checkbox.checked;
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
Object.entries(this.options.HTMLAttributes).forEach(([key, value]) => {
|
|
1346
|
+
listItem.setAttribute(key, value);
|
|
1347
|
+
});
|
|
1348
|
+
listItem.dataset.checked = node.attrs.checked;
|
|
1349
|
+
checkbox.checked = node.attrs.checked;
|
|
1350
|
+
checkboxWrapper.append(checkbox, checkboxStyler);
|
|
1351
|
+
listItem.append(checkboxWrapper, content);
|
|
1352
|
+
Object.entries(HTMLAttributes).forEach(([key, value]) => {
|
|
1353
|
+
listItem.setAttribute(key, value);
|
|
1354
|
+
});
|
|
1355
|
+
let prevRenderedAttributeKeys = new Set(Object.keys(HTMLAttributes));
|
|
1356
|
+
return {
|
|
1357
|
+
dom: listItem,
|
|
1358
|
+
contentDOM: content,
|
|
1359
|
+
update: (updatedNode) => {
|
|
1360
|
+
if (updatedNode.type !== this.type) return false;
|
|
1361
|
+
listItem.dataset.checked = updatedNode.attrs.checked;
|
|
1362
|
+
checkbox.checked = updatedNode.attrs.checked;
|
|
1363
|
+
updateA11Y(updatedNode);
|
|
1364
|
+
const extensionAttributes = editor.extensionManager.attributes;
|
|
1365
|
+
const newHTMLAttributes = getRenderedAttributes(updatedNode, extensionAttributes);
|
|
1366
|
+
const newKeys = new Set(Object.keys(newHTMLAttributes));
|
|
1367
|
+
const staticAttrs = this.options.HTMLAttributes;
|
|
1368
|
+
prevRenderedAttributeKeys.forEach((key) => {
|
|
1369
|
+
if (!newKeys.has(key)) {
|
|
1370
|
+
if (key in staticAttrs) listItem.setAttribute(key, staticAttrs[key]);
|
|
1371
|
+
else listItem.removeAttribute(key);
|
|
1372
|
+
}
|
|
1373
|
+
});
|
|
1374
|
+
Object.entries(newHTMLAttributes).forEach(([key, value]) => {
|
|
1375
|
+
if (value === null || value === void 0) {
|
|
1376
|
+
if (key in staticAttrs) listItem.setAttribute(key, staticAttrs[key]);
|
|
1377
|
+
else listItem.removeAttribute(key);
|
|
1378
|
+
} else listItem.setAttribute(key, value);
|
|
1379
|
+
});
|
|
1380
|
+
prevRenderedAttributeKeys = newKeys;
|
|
1381
|
+
return true;
|
|
1382
|
+
}
|
|
1383
|
+
};
|
|
1384
|
+
};
|
|
1385
|
+
},
|
|
1386
|
+
addInputRules() {
|
|
1387
|
+
return [wrappingInputRule({
|
|
1388
|
+
find: inputRegex,
|
|
1389
|
+
type: this.type,
|
|
1390
|
+
getAttributes: (match) => ({ checked: match[match.length - 1] === "x" })
|
|
1391
|
+
})];
|
|
1392
|
+
}
|
|
1393
|
+
});
|
|
1394
|
+
//#endregion
|
|
1395
|
+
//#region src/task-list/task-list.ts
|
|
1396
|
+
/**
|
|
1397
|
+
* This extension allows you to create task lists.
|
|
1398
|
+
* @see https://www.tiptap.dev/api/nodes/task-list
|
|
1399
|
+
*/
|
|
1400
|
+
const TaskList = Node.create({
|
|
1401
|
+
name: "taskList",
|
|
1402
|
+
addOptions() {
|
|
1403
|
+
return {
|
|
1404
|
+
itemTypeName: "taskItem",
|
|
1405
|
+
HTMLAttributes: {}
|
|
1406
|
+
};
|
|
1407
|
+
},
|
|
1408
|
+
group: "block list",
|
|
1409
|
+
content() {
|
|
1410
|
+
return `${this.options.itemTypeName}+`;
|
|
1411
|
+
},
|
|
1412
|
+
parseHTML() {
|
|
1413
|
+
return [{
|
|
1414
|
+
tag: `ul[data-type="${this.name}"]`,
|
|
1415
|
+
priority: 51
|
|
1416
|
+
}];
|
|
1417
|
+
},
|
|
1418
|
+
renderHTML({ HTMLAttributes }) {
|
|
1419
|
+
return [
|
|
1420
|
+
"ul",
|
|
1421
|
+
mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, { "data-type": this.name }),
|
|
1422
|
+
0
|
|
1423
|
+
];
|
|
1424
|
+
},
|
|
1425
|
+
parseMarkdown: (token, h) => {
|
|
1426
|
+
return h.createNode("taskList", {}, h.parseChildren(token.items || []));
|
|
1427
|
+
},
|
|
1428
|
+
renderMarkdown: (node, h) => {
|
|
1429
|
+
if (!node.content) return "";
|
|
1430
|
+
return h.renderChildren(node.content, "\n");
|
|
1431
|
+
},
|
|
1432
|
+
markdownTokenizer: {
|
|
1433
|
+
name: "taskList",
|
|
1434
|
+
level: "block",
|
|
1435
|
+
start(src) {
|
|
1436
|
+
var _src$match;
|
|
1437
|
+
const index = (_src$match = src.match(/^\s*[-+*]\s+\[([ xX])\]\s+/)) === null || _src$match === void 0 ? void 0 : _src$match.index;
|
|
1438
|
+
return index !== void 0 ? index : -1;
|
|
1439
|
+
},
|
|
1440
|
+
tokenize(src, tokens, lexer) {
|
|
1441
|
+
const parseTaskListContent = (content) => {
|
|
1442
|
+
const nestedResult = parseIndentedBlocks(content, {
|
|
1443
|
+
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1444
|
+
extractItemData: (match) => ({
|
|
1445
|
+
indentLevel: match[1].length,
|
|
1446
|
+
mainContent: match[4],
|
|
1447
|
+
checked: match[3].toLowerCase() === "x"
|
|
1448
|
+
}),
|
|
1449
|
+
createToken: (data, nestedTokens) => ({
|
|
1450
|
+
type: "taskItem",
|
|
1451
|
+
raw: "",
|
|
1452
|
+
mainContent: data.mainContent,
|
|
1453
|
+
indentLevel: data.indentLevel,
|
|
1454
|
+
checked: data.checked,
|
|
1455
|
+
text: data.mainContent,
|
|
1456
|
+
tokens: lexer.inlineTokens(data.mainContent),
|
|
1457
|
+
nestedTokens
|
|
1458
|
+
}),
|
|
1459
|
+
customNestedParser: parseTaskListContent
|
|
1460
|
+
}, lexer);
|
|
1461
|
+
if (nestedResult) {
|
|
1462
|
+
const taskListToken = {
|
|
1463
|
+
type: "taskList",
|
|
1464
|
+
raw: nestedResult.raw,
|
|
1465
|
+
items: nestedResult.items
|
|
1466
|
+
};
|
|
1467
|
+
const remainder = content.slice(nestedResult.raw.length);
|
|
1468
|
+
if (remainder.trim()) return [taskListToken, ...lexer.blockTokens(remainder)];
|
|
1469
|
+
return [taskListToken];
|
|
1470
|
+
}
|
|
1471
|
+
return lexer.blockTokens(content);
|
|
1472
|
+
};
|
|
1473
|
+
const result = parseIndentedBlocks(src, {
|
|
1474
|
+
itemPattern: /^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,
|
|
1475
|
+
extractItemData: (match) => ({
|
|
1476
|
+
indentLevel: match[1].length,
|
|
1477
|
+
mainContent: match[4],
|
|
1478
|
+
checked: match[3].toLowerCase() === "x"
|
|
1479
|
+
}),
|
|
1480
|
+
createToken: (data, nestedTokens) => ({
|
|
1481
|
+
type: "taskItem",
|
|
1482
|
+
raw: "",
|
|
1483
|
+
mainContent: data.mainContent,
|
|
1484
|
+
indentLevel: data.indentLevel,
|
|
1485
|
+
checked: data.checked,
|
|
1486
|
+
text: data.mainContent,
|
|
1487
|
+
tokens: lexer.inlineTokens(data.mainContent),
|
|
1488
|
+
nestedTokens
|
|
1489
|
+
}),
|
|
1490
|
+
customNestedParser: parseTaskListContent
|
|
1491
|
+
}, lexer);
|
|
1492
|
+
if (!result) return;
|
|
1493
|
+
return {
|
|
1494
|
+
type: "taskList",
|
|
1495
|
+
raw: result.raw,
|
|
1496
|
+
items: result.items
|
|
1497
|
+
};
|
|
1498
|
+
}
|
|
1499
|
+
},
|
|
1500
|
+
markdownOptions: { indentsContent: true },
|
|
1501
|
+
addCommands() {
|
|
1502
|
+
return { toggleTaskList: () => ({ commands }) => {
|
|
1503
|
+
return commands.toggleList(this.name, this.options.itemTypeName);
|
|
1504
|
+
} };
|
|
1505
|
+
},
|
|
1506
|
+
addKeyboardShortcuts() {
|
|
1507
|
+
return { "Mod-Shift-9": () => this.editor.commands.toggleTaskList() };
|
|
1508
|
+
}
|
|
1509
|
+
});
|
|
1510
|
+
//#endregion
|
|
1511
|
+
//#region src/kit/index.ts
|
|
1512
|
+
/**
|
|
1513
|
+
* The table kit is a collection of table editor extensions.
|
|
1514
|
+
*
|
|
1515
|
+
* It’s a good starting point for building your own table in Tiptap.
|
|
1516
|
+
*/
|
|
1517
|
+
const ListKit = Extension.create({
|
|
1518
|
+
name: "listKit",
|
|
1519
|
+
addExtensions() {
|
|
1520
|
+
const extensions = [];
|
|
1521
|
+
if (this.options.bulletList !== false) extensions.push(BulletList.configure(this.options.bulletList));
|
|
1522
|
+
if (this.options.listItem !== false) extensions.push(ListItem.configure(this.options.listItem));
|
|
1523
|
+
if (this.options.listKeymap !== false) extensions.push(ListKeymap.configure(this.options.listKeymap));
|
|
1524
|
+
if (this.options.orderedList !== false) extensions.push(OrderedList.configure(this.options.orderedList));
|
|
1525
|
+
if (this.options.taskItem !== false) extensions.push(TaskItem.configure(this.options.taskItem));
|
|
1526
|
+
if (this.options.taskList !== false) extensions.push(TaskList.configure(this.options.taskList));
|
|
1527
|
+
return extensions;
|
|
1528
|
+
}
|
|
1529
|
+
});
|
|
1530
|
+
//#endregion
|
|
1531
|
+
export { BulletList, ListItem, ListKeymap, ListKit, ORDERED_LIST_MARKER_PATTERN, OrderedList, TaskItem, TaskList, areOrderedListMarkersSequential, buildOrderedListAttrsFromMarker, bulletListInputRegex, detectMarkerType, getListMarker, inputRegex, listHelpers_exports as listHelpers, markerToStart, orderedListInputRegex, parseListMarker, parsePlainTextOrderedListPaste, toRoman, toRomanUpper };
|
|
1532
|
+
|
|
1533
|
+
//# sourceMappingURL=index.js.map
|