@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,237 @@
|
|
|
1
|
+
import type { Editor as TiptapEditor } from "@tiptap/core";
|
|
2
|
+
import { useEditorState } from "@tiptap/react";
|
|
3
|
+
import { NodeSelection } from "@tiptap/pm/state";
|
|
4
|
+
import { AlignCenter, AlignJustify, AlignLeft, AlignRight, ArrowDown, ArrowUp, ChevronRight, Copy, Trash2 } from "lucide-react";
|
|
5
|
+
import { Component, useEffect, useId, useState, useSyncExternalStore, type ReactNode } from "react";
|
|
6
|
+
import { CORE_BLOCK_STYLES, normalizeAnchor, normalizeClassName, type Device, type StylePresets } from "@ecomcx/ecomweb-content";
|
|
7
|
+
import { StylePanel } from "./stylepanel";
|
|
8
|
+
import { blockPanels, onBlockPanelsChange } from "./panels";
|
|
9
|
+
import { BlockAttributesForm, pluginBlockInfo } from "./blocks";
|
|
10
|
+
import { blockInfo } from "./blockMeta";
|
|
11
|
+
import { currentBlock, parentBlock, setBlockAttrs, type BlockRef } from "./blockops";
|
|
12
|
+
import { runBlockAction } from "./handle";
|
|
13
|
+
import { viLabels, type EditorLabels } from "./labels";
|
|
14
|
+
import { LAYOUT_TYPES, LayoutSettings } from "./layoutUi";
|
|
15
|
+
import { labelsOf } from "./nodes";
|
|
16
|
+
import { cx } from "./util";
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Tab "Khối": cài đặt của khối đang chọn, đường dẫn khối cha (bấm để chọn khối cha),
|
|
20
|
+
* thao tác lên / xuống / nhân bản / xoá. Khi đang hiện, form cài đặt trong khối plugin và thanh cài đặt nổi được ẩn (tránh lặp).
|
|
21
|
+
* Ứng dụng đặt component này ở thanh bên, truyền đối tượng TipTap nhận từ `onReady` của Editor.
|
|
22
|
+
*/
|
|
23
|
+
export function BlockInspector({ editor, labels, device: deviceProp, onDeviceChange, presets, blockStyles }: {
|
|
24
|
+
editor: TiptapEditor; labels?: Partial<EditorLabels>;
|
|
25
|
+
/** Khổ màn hình đang sửa trong tab Kiểu dáng — ứng dụng truyền vào để đồng bộ với khung xem trực tiếp. */
|
|
26
|
+
device?: Device; onDeviceChange?(d: Device): void;
|
|
27
|
+
/** Preset kiểu dáng của theme (tab Kiểu dáng dùng thay danh sách mặc định). */
|
|
28
|
+
presets?: StylePresets;
|
|
29
|
+
/** Biến thể kiểu của theme theo loại khối (theme.json › blockStyles, nhãn đã dịch) — thêm vào biến thể có sẵn của lõi. */
|
|
30
|
+
blockStyles?: Record<string, Array<{ name: string; label: string }>>;
|
|
31
|
+
}) {
|
|
32
|
+
const t = { ...viLabels, ...labelsOf(editor), ...labels };
|
|
33
|
+
const panels = useSyncExternalStore(onBlockPanelsChange, blockPanels);
|
|
34
|
+
const [tab, setTab] = useState<"settings" | "style">("settings");
|
|
35
|
+
const [ownDevice, setOwnDevice] = useState<Device>("base");
|
|
36
|
+
const device = deviceProp ?? ownDevice;
|
|
37
|
+
const changeDevice = (d: Device) => { setOwnDevice(d); onDeviceChange?.(d); };
|
|
38
|
+
// Kéo khoảng đệm trên khung ghi vào khổ đang sửa
|
|
39
|
+
useEffect(() => { (editor.storage as any).cmsEditorContext.device = device; }, [editor, device]);
|
|
40
|
+
|
|
41
|
+
// Báo cho trình soạn biết đang có tab "Khối" (ẩn form trong khối + thanh nổi); giao dịch rỗng để các khung vẽ lại
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const ctx = (editor.storage as any).cmsEditorContext;
|
|
44
|
+
ctx.inspector = (ctx.inspector ?? 0) + 1;
|
|
45
|
+
const ping = () => { if (!editor.isDestroyed) editor.view.dispatch(editor.state.tr.setMeta("cmsInspector", true)); };
|
|
46
|
+
ping();
|
|
47
|
+
return () => { ctx.inspector -= 1; ping(); };
|
|
48
|
+
}, [editor]);
|
|
49
|
+
|
|
50
|
+
const state = useEditorState({
|
|
51
|
+
editor,
|
|
52
|
+
selector: ({ editor: e }) => {
|
|
53
|
+
const block = currentBlock(e.state);
|
|
54
|
+
if (!block) return null;
|
|
55
|
+
const chain: BlockRef[] = [block];
|
|
56
|
+
for (let p = parentBlock(e.state.doc, block); p; p = parentBlock(e.state.doc, p)) chain.unshift(p);
|
|
57
|
+
const $p = e.state.doc.resolve(block.pos);
|
|
58
|
+
return { block, chain, index: $p.index(), count: $p.parent.childCount };
|
|
59
|
+
},
|
|
60
|
+
equalityFn: (a, b) => a?.block.pos === b?.block.pos && a?.block.node === b?.block.node && a?.chain.length === b?.chain.length && a?.count === b?.count,
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
if (!state) return <div className="cms-ed-inspector"><p className="cms-ed-inspector-empty">{t.inspectorEmpty}</p></div>;
|
|
64
|
+
const { block, chain, index, count } = state;
|
|
65
|
+
const info = blockInfo(block.node.type.name, t);
|
|
66
|
+
const select = (b: BlockRef) => { editor.view.dispatch(editor.state.tr.setSelection(NodeSelection.create(editor.state.doc, b.pos)).scrollIntoView()); };
|
|
67
|
+
|
|
68
|
+
return (
|
|
69
|
+
<div className="cms-ed-inspector">
|
|
70
|
+
{chain.length > 1 && (
|
|
71
|
+
<nav className="cms-ed-crumbs" aria-label={t.blockOptions}>
|
|
72
|
+
{chain.map((b, i) => {
|
|
73
|
+
const label = blockInfo(b.node.type.name, t).title;
|
|
74
|
+
return (
|
|
75
|
+
<span key={b.pos} className="cms-ed-crumb">
|
|
76
|
+
{i > 0 && <ChevronRight size={12} aria-hidden />}
|
|
77
|
+
{i < chain.length - 1 ? <button type="button" onClick={() => select(b)}>{label}</button> : <span aria-current="true">{label}</span>}
|
|
78
|
+
</span>
|
|
79
|
+
);
|
|
80
|
+
})}
|
|
81
|
+
</nav>
|
|
82
|
+
)}
|
|
83
|
+
<div className="cms-ed-inspector-head">
|
|
84
|
+
<span className="cms-ed-inspector-icon"><info.icon size={18} /></span>
|
|
85
|
+
<div>
|
|
86
|
+
<div className="cms-ed-inspector-title">{info.title}</div>
|
|
87
|
+
{info.description && <div className="cms-ed-inspector-desc">{info.description}</div>}
|
|
88
|
+
</div>
|
|
89
|
+
</div>
|
|
90
|
+
<div className="cms-ed-inspector-tabs" role="tablist" aria-label={info.title}>
|
|
91
|
+
{(["settings", "style"] as const).map((k) => (
|
|
92
|
+
<button key={k} type="button" role="tab" aria-selected={tab === k} className={cx(tab === k && "is-active")} onClick={() => setTab(k)}>
|
|
93
|
+
{k === "settings" ? t.settingsTab : t.styleTab}
|
|
94
|
+
</button>
|
|
95
|
+
))}
|
|
96
|
+
</div>
|
|
97
|
+
{tab === "style" ? (
|
|
98
|
+
<div className="cms-ed-inspector-body" role="tabpanel">
|
|
99
|
+
<StylePanel style={block.node.attrs.style} t={t} device={device} onDeviceChange={changeDevice} presets={presets}
|
|
100
|
+
variants={[...(CORE_BLOCK_STYLES[block.node.type.name] ?? []).map((name) => ({ name, label: (t as Record<string, string>)[`variant_${name}`] ?? name })),
|
|
101
|
+
...(blockStyles?.[block.node.type.name] ?? [])]}
|
|
102
|
+
variant={block.node.attrs.blockStyle} onVariantChange={(v) => { const tr = setBlockAttrs(editor.state, block.pos, { blockStyle: v }); if (tr) editor.view.dispatch(tr); }}
|
|
103
|
+
onChange={(style) => { const tr = setBlockAttrs(editor.state, block.pos, { style }); if (tr) editor.view.dispatch(tr); }} />
|
|
104
|
+
</div>
|
|
105
|
+
) : <>
|
|
106
|
+
<div className="cms-ed-inspector-body" role="tabpanel">
|
|
107
|
+
<Settings editor={editor} block={block} t={t} />
|
|
108
|
+
</div>
|
|
109
|
+
<Advanced key={block.pos} attrs={block.node.attrs} t={t} set={(a) => { const tr = setBlockAttrs(editor.state, block.pos, a); if (tr) editor.view.dispatch(tr); }} />
|
|
110
|
+
{panels.filter((p) => !p.blocks || p.blocks.includes(block.node.type.name)).map((p) => (
|
|
111
|
+
<section key={p.id} className="cms-ed-inspector-panel" aria-label={p.title}>
|
|
112
|
+
<h4>{p.title}</h4>
|
|
113
|
+
<PanelBoundary name={p.id}>
|
|
114
|
+
<p.component type={block.node.type.name} attrs={block.node.attrs}
|
|
115
|
+
setAttrs={(a) => { const tr = setBlockAttrs(editor.state, block.pos, a); if (tr) editor.view.dispatch(tr); }} />
|
|
116
|
+
</PanelBoundary>
|
|
117
|
+
</section>
|
|
118
|
+
))}
|
|
119
|
+
</>}
|
|
120
|
+
<div className="cms-ed-inspector-actions" role="group" aria-label={t.blockActions}>
|
|
121
|
+
<button type="button" disabled={index === 0} onClick={() => runBlockAction(editor, "up", block)}><ArrowUp size={14} /> {t.moveUp}</button>
|
|
122
|
+
<button type="button" disabled={index >= count - 1} onClick={() => runBlockAction(editor, "down", block)}><ArrowDown size={14} /> {t.moveDown}</button>
|
|
123
|
+
<button type="button" onClick={() => runBlockAction(editor, "duplicate", block)}><Copy size={14} /> {t.duplicate}</button>
|
|
124
|
+
<button type="button" className="is-danger" onClick={() => runBlockAction(editor, "delete", block)}><Trash2 size={14} /> {t.deleteBlock}</button>
|
|
125
|
+
</div>
|
|
126
|
+
</div>
|
|
127
|
+
);
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Nâng cao: neo HTML (id) và class CSS riêng — lưu khi rời ô, giá trị sai báo đỏ. */
|
|
131
|
+
function Advanced({ attrs, t, set }: { attrs: Record<string, any>; t: EditorLabels; set(a: Record<string, unknown>): void }) {
|
|
132
|
+
const [anchor, setAnchor] = useState(attrs.anchor ?? "");
|
|
133
|
+
const [cls, setCls] = useState(attrs.className ?? "");
|
|
134
|
+
const anchorBad = anchor.trim() !== "" && !normalizeAnchor(anchor);
|
|
135
|
+
return (
|
|
136
|
+
<details className="cms-ed-inspector-panel cms-ed-advanced">
|
|
137
|
+
<summary>{t.advanced}</summary>
|
|
138
|
+
<Field label={t.anchor}>{(id) => <>
|
|
139
|
+
<input id={id} value={anchor} aria-invalid={anchorBad || undefined} className={cx(anchorBad && "is-invalid")} placeholder="bang-gia"
|
|
140
|
+
onChange={(e) => setAnchor(e.target.value)} onBlur={() => { if (!anchorBad) set({ anchor: normalizeAnchor(anchor) ?? null }); }} />
|
|
141
|
+
<small>{t.anchorHint}</small>
|
|
142
|
+
</>}</Field>
|
|
143
|
+
<Field label={t.cssClass}>{(id) => <>
|
|
144
|
+
<input id={id} value={cls} placeholder="hero highlight" onChange={(e) => setCls(e.target.value)}
|
|
145
|
+
onBlur={() => { const v = normalizeClassName(cls) ?? null; setCls(v ?? ""); set({ className: v }); }} />
|
|
146
|
+
<small>{t.cssClassHint}</small>
|
|
147
|
+
</>}</Field>
|
|
148
|
+
</details>
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
/** Panel của plugin lỗi chỉ ẩn panel đó, không làm hỏng tab "Khối". */
|
|
153
|
+
class PanelBoundary extends Component<{ name: string; children: ReactNode }, { error: boolean }> {
|
|
154
|
+
state = { error: false };
|
|
155
|
+
static getDerivedStateFromError() { return { error: true }; }
|
|
156
|
+
componentDidCatch(e: unknown) { console.error(`[cms-editor] panel ${this.props.name}:`, e); }
|
|
157
|
+
render() { return this.state.error ? null : this.props.children; }
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
function Field({ label, children }: { label: string; children: (id: string) => ReactNode }) {
|
|
161
|
+
const id = useId();
|
|
162
|
+
return <div className="cms-ed-ifield"><label htmlFor={id}>{label}</label>{children(id)}</div>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
function Segmented<T extends string | number>({ label, value, options, onChange }: { label: string; value: T | null; options: Array<[T, ReactNode, string]>; onChange(v: T): void }) {
|
|
166
|
+
return (
|
|
167
|
+
<div className="cms-ed-ifield">
|
|
168
|
+
<span>{label}</span>
|
|
169
|
+
<span role="group" aria-label={label} className="cms-ed-seg">
|
|
170
|
+
{options.map(([v, content, title]) => (
|
|
171
|
+
<button key={String(v)} type="button" title={title} aria-label={title} aria-pressed={value === v} className={cx("cms-ed-seg-btn", value === v && "is-active")} onClick={() => onChange(v)}>{content}</button>
|
|
172
|
+
))}
|
|
173
|
+
</span>
|
|
174
|
+
</div>
|
|
175
|
+
);
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/** Cài đặt theo loại khối. */
|
|
179
|
+
function Settings({ editor, block, t }: { editor: TiptapEditor; block: BlockRef; t: EditorLabels }) {
|
|
180
|
+
const { pos, node } = block;
|
|
181
|
+
const type = node.type.name;
|
|
182
|
+
const a = node.attrs as Record<string, any>;
|
|
183
|
+
const set = (attrs: Record<string, unknown>) => {
|
|
184
|
+
const tr = setBlockAttrs(editor.state, pos, attrs);
|
|
185
|
+
if (tr) editor.view.dispatch(tr);
|
|
186
|
+
};
|
|
187
|
+
const text = (key: string, label: string, opts: { area?: boolean; number?: boolean } = {}) => (
|
|
188
|
+
<Field label={label}>{(id) => opts.area
|
|
189
|
+
? <textarea id={id} rows={3} value={a[key] ?? ""} onChange={(e) => set({ [key]: e.target.value || null })} />
|
|
190
|
+
: <input id={id} type={opts.number ? "number" : "text"} value={a[key] ?? ""} onChange={(e) => set({ [key]: e.target.value === "" ? null : opts.number ? Number(e.target.value) : e.target.value })} />}
|
|
191
|
+
</Field>
|
|
192
|
+
);
|
|
193
|
+
const check = (key: string, label: string, def: boolean) => (
|
|
194
|
+
<label className="cms-ed-check"><input type="checkbox" checked={a[key] ?? def} onChange={(e) => set({ [key]: e.target.checked })} /> {label}</label>
|
|
195
|
+
);
|
|
196
|
+
const align = (
|
|
197
|
+
<Segmented label={t.textAlign} value={a.textAlign ?? "left"} onChange={(v) => set({ textAlign: v === "left" ? null : v })} options={[
|
|
198
|
+
["left", <AlignLeft size={14} />, t.alignLeft], ["center", <AlignCenter size={14} />, t.alignCenter], ["right", <AlignRight size={14} />, t.alignRight], ["justify", <AlignJustify size={14} />, t.alignJustify]]} />
|
|
199
|
+
);
|
|
200
|
+
|
|
201
|
+
if (LAYOUT_TYPES.has(type)) return <div className="cms-ed-inspector-layout"><LayoutSettings editor={editor} pos={pos} node={node} t={t} /></div>;
|
|
202
|
+
const plugin = pluginBlockInfo(type);
|
|
203
|
+
if (plugin) return <BlockAttributesForm def={plugin.def} attrs={a} setAttrs={set} t={plugin.translate} stacked />;
|
|
204
|
+
switch (type) {
|
|
205
|
+
case "paragraph": return align;
|
|
206
|
+
case "heading": return <>
|
|
207
|
+
<Segmented label={t.headingLevel} value={a.level ?? 2} onChange={(v) => set({ level: v })} options={[[2, "H2", "H2"], [3, "H3", "H3"], [4, "H4", "H4"]]} />
|
|
208
|
+
{align}
|
|
209
|
+
</>;
|
|
210
|
+
case "orderedList": return text("start", t.listStart, { number: true });
|
|
211
|
+
case "codeBlock": return text("language", t.codeLanguage);
|
|
212
|
+
case "image": return <>
|
|
213
|
+
{text("alt", t.alt, { area: true })}
|
|
214
|
+
{text("caption", t.caption)}
|
|
215
|
+
<Segmented label={t.size} value={a.align ?? "none"} onChange={(v) => set({ align: v === "none" ? null : v })} options={[
|
|
216
|
+
["left", <AlignLeft size={14} />, t.floatLeft], ["none", <AlignCenter size={14} />, t.center], ["right", <AlignRight size={14} />, t.floatRight], ["wide", "↔", t.wide]]} />
|
|
217
|
+
</>;
|
|
218
|
+
case "gallery": return <>
|
|
219
|
+
<Segmented label={t.columns.replace(/:$/, "")} value={a.columns ?? 3} onChange={(v) => set({ columns: v })} options={[2, 3, 4, 5].map((n) => [n, String(n), String(n)] as [number, ReactNode, string])} />
|
|
220
|
+
{text("caption", t.caption)}
|
|
221
|
+
</>;
|
|
222
|
+
case "video": case "audio": return text("caption", t.caption);
|
|
223
|
+
case "file": return <>{text("caption", t.caption)}{check("embed", t.showPdf, true)}{check("download", t.allowDownload, false)}</>;
|
|
224
|
+
case "youtube": return text("start", t.startAt, { number: true });
|
|
225
|
+
case "table": return <>
|
|
226
|
+
{check("footer", t.footerRow, false)}
|
|
227
|
+
{check("fixed", t.fixedLayout, false)}
|
|
228
|
+
<div className="cms-ed-inspector-row">
|
|
229
|
+
{([[t.addRow, () => editor.chain().focus().addRowAfter().run()], [t.addCol, () => editor.chain().focus().addColumnAfter().run()],
|
|
230
|
+
[t.delRow, () => editor.chain().focus().deleteRow().run()], [t.delCol, () => editor.chain().focus().deleteColumn().run()]] as const)
|
|
231
|
+
.map(([l, f]) => <button key={l} type="button" className="cms-ed-text-btn" onClick={f}>{l}</button>)}
|
|
232
|
+
</div>
|
|
233
|
+
</>;
|
|
234
|
+
default: return <p className="cms-ed-inspector-empty">{t.noSettings}</p>;
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
package/src/labels.ts
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
/** Chữ giao diện của trình soạn. Truyền labels={enLabels} hoặc ghi đè từng chữ. */
|
|
2
|
+
export const viLabels = {
|
|
3
|
+
heading: "Tiêu đề", taskList: "Danh sách việc", columnsBlock: "Bộ cột", column: "Cột",
|
|
4
|
+
inspectorEmpty: "Chọn một khối trong bài để xem cài đặt của nó.", noSettings: "Khối này không có cài đặt riêng.", blockActions: "Thao tác",
|
|
5
|
+
textAlign: "Căn chữ", alignJustify: "Căn đều", headingLevel: "Cấp tiêu đề", showPdf: "Hiện PDF ngay trong trang", allowDownload: "Cho tải xuống",
|
|
6
|
+
startAt: "Bắt đầu từ giây", codeLanguage: "Ngôn ngữ (vd js, php)", listStart: "Bắt đầu từ số",
|
|
7
|
+
inserter: "Thêm khối", searchBlocks: "Tìm khối…", noBlocks: "Không có khối phù hợp", dragToInsert: "Bấm để chèn dưới khối đang chọn, hoặc kéo vào bài",
|
|
8
|
+
groupText: "Văn bản", groupMedia: "Media", groupDesign: "Bố cục", groupEmbed: "Nhúng", groupWidgets: "Tiện ích", groupTheme: "Giao diện", groupPlugin: "Plugin",
|
|
9
|
+
outline: "Cấu trúc", outlineEmpty: "Bài chưa có khối nào", outlineHint: "Bấm để chọn khối, kéo để đổi chỗ",
|
|
10
|
+
columns2: "2 cột", columns3: "3 cột", columnsHint: "Chia nội dung thành cột", group: "Nhóm", groupHint: "Khung bao nhiều khối (nền, khoảng đệm)",
|
|
11
|
+
callout: "Hộp lưu ý", calloutHint: "Thông tin, cảnh báo…", button: "Nút", buttonHint: "Nút liên kết", buttonEmpty: "Nút", buttonText: "Chữ trên nút", buttonUrl: "Liên kết",
|
|
12
|
+
embed: "Nhúng", embedHint: "YouTube, Vimeo, Spotify, TikTok, X…", embedUrl: "Đường dẫn (YouTube, Vimeo, Spotify, TikTok, X, Instagram…)",
|
|
13
|
+
embedUnsupported: "Không nhúng được — website hiện thành liên kết", edit: "Sửa", blockSettings: "Cài đặt khối", layout: "Bố cục",
|
|
14
|
+
addColumn: "+ cột", removeColumn: "− cột", vAlign: "Căn dọc", vTop: "Trên", vCenter: "Giữa", vBottom: "Dưới", stack: "Xếp dọc trên điện thoại",
|
|
15
|
+
background: "Nền", textColor: "Chữ", noColor: "Bỏ màu", padding: "Khoảng đệm", padNone: "Không", padSmall: "Nhỏ", padMedium: "Vừa", padLarge: "Lớn",
|
|
16
|
+
tone: "Kiểu", toneInfo: "Thông tin", toneSuccess: "Thành công", toneWarning: "Cảnh báo", toneDanger: "Nguy hiểm", calloutTitle: "Tiêu đề hộp",
|
|
17
|
+
variant: "Kiểu nút", variantPrimary: "Chính", variantSecondary: "Phụ", variantOutline: "Viền",
|
|
18
|
+
blockToolbar: "Thanh công cụ khối", transformTo: "đổi loại khối", moreOptions: "Tuỳ chọn khác", insertBefore: "Thêm khối phía trên",
|
|
19
|
+
listIndent: "Thụt lề danh sách", indent: "Thụt vào", outdent: "Thụt ra", formatting: "Định dạng chữ", headerRow: "Hàng tiêu đề",
|
|
20
|
+
blockVariant: "Biến thể", variant_default: "Mặc định", variant_stripes: "Sọc", variant_rounded: "Bo góc", variant_circle: "Tròn", variant_plain: "Trơn",
|
|
21
|
+
variant_dots: "Chấm", variant_wide: "Đậm", variant_pill: "Bo tròn", variant_card: "Thẻ", advanced: "Nâng cao", anchor: "Neo HTML", anchorHint: "Liên kết tới khối bằng #neo (chữ, số, gạch ngang)",
|
|
22
|
+
cssClass: "Class CSS riêng", cssClassHint: "Tối đa 5 class, cách nhau bởi dấu cách",
|
|
23
|
+
settingsTab: "Cài đặt", styleTab: "Kiểu dáng", device: "Khổ màn hình", device_base: "Máy tính", device_tablet: "Máy tính bảng", device_mobile: "Điện thoại",
|
|
24
|
+
inherited: "Đang dùng", default: "Mặc định", custom: "tuỳ chỉnh", customColor: "màu tuỳ chỉnh", resetAll: "Đặt lại tất cả", none: "Không",
|
|
25
|
+
linkSides: "Một giá trị cho cả 4 cạnh", unlinkSides: "Chỉnh từng cạnh", side_top: "Trên", side_right: "Phải", side_bottom: "Dưới", side_left: "Trái",
|
|
26
|
+
resizeColumns: "Kéo để đổi độ rộng cột", dragPadding: "Kéo để đổi khoảng đệm",
|
|
27
|
+
style_typography: "Kiểu chữ", style_fontFamily: "Phông chữ", style_fontSize: "Cỡ chữ", style_appearance: "Giao diện", style_lineHeight: "Giãn dòng",
|
|
28
|
+
style_letterSpacing: "Giãn cách ký tự", style_decoration: "Trang trí", style_transform: "Viết hoa chữ cái", style_textAlign: "Căn chữ",
|
|
29
|
+
style_color: "Màu", style_text: "Chữ", style_background: "Nền", style_spacing: "Kích thước & khoảng cách", style_padding: "Khoảng đệm (padding)",
|
|
30
|
+
style_margin: "Lề ngoài (margin)", style_gap: "Khoảng cách giữa khối con", style_width: "Chiều rộng", style_maxWidth: "Rộng tối đa", style_minHeight: "Cao tối thiểu",
|
|
31
|
+
style_border: "Viền & bo góc", style_borderWidth: "Độ dày viền", style_borderStyle: "Kiểu viền", style_borderColor: "Màu viền", style_radius: "Bo góc",
|
|
32
|
+
style_visibility: "Hiển thị", style_hide: "Ẩn theo khổ màn hình", hide_desktop: "Ẩn trên máy tính", hide_tablet: "Ẩn trên máy tính bảng", hide_mobile: "Ẩn trên điện thoại",
|
|
33
|
+
font_body: "Chữ thân bài", font_heading: "Chữ tiêu đề", font_mono: "Chữ đều (mono)", italicSuffix: "nghiêng",
|
|
34
|
+
weight_300: "Mảnh", weight_400: "Thường", weight_500: "Vừa", weight_600: "Đậm vừa", weight_700: "Đậm", weight_800: "Rất đậm", weight_900: "Đen",
|
|
35
|
+
underlineText: "Gạch chân", strikeText: "Gạch ngang", upper: "VIẾT HOA", lower: "viết thường", capitalize: "Viết Hoa Đầu Từ",
|
|
36
|
+
border_solid: "Liền", border_dashed: "Gạch", border_dotted: "Chấm",
|
|
37
|
+
preformattedBlock: "Văn bản định dạng sẵn", tableHint: "Chọn số cột × số hàng", tableCols: "Số cột", tableRows: "Số hàng", footerRow: "Hàng chân bảng", fixedLayout: "Cố định độ rộng cột", tabBlocks: "Khối", tabPatterns: "Mẫu", noPatterns: "Không có mẫu phù hợp", cat_mine: "Mẫu của tôi", syncedPattern: "Mẫu đồng bộ", syncedBadge: "Đồng bộ", syncedLoading: "Đang tải mẫu…", syncedMissing: "Mẫu không còn (đã xoá hoặc chưa xuất bản)", syncedEdit: "Sửa mẫu gốc", syncedDetach: "Tách ra", createPattern: "Tạo mẫu", cat_hero: "Ảnh bìa & giới thiệu", cat_features: "Tính năng", cat_cta: "Kêu gọi hành động",
|
|
38
|
+
cat_pricing: "Bảng giá", cat_testimonials: "Cảm nhận", cat_faq: "Hỏi đáp", cat_team: "Đội ngũ", cat_contact: "Liên hệ", cat_text: "Nội dung", cat_gallery: "Thư viện ảnh", cat_header: "Đầu trang", cat_footer: "Chân trang",
|
|
39
|
+
stats: "Thống kê nội dung", words: "{n} từ", chars: "{n} ký tự", readingTime: "~{n} phút đọc",
|
|
40
|
+
editorLabel: "Nội dung bài viết", apply: "Áp dụng", insert: "Chèn", cancel: "Huỷ", removeLink: "Gỡ liên kết", linkNewTab: "Mở trong tab mới",
|
|
41
|
+
blockOptions: "Tuỳ chọn khối (kéo để di chuyển)", addBelow: "Thêm khối bên dưới", moveUp: "Lên trên", moveDown: "Xuống dưới",
|
|
42
|
+
duplicate: "Nhân bản", deleteBlock: "Xoá khối", selectParent: "Chọn khối cha",
|
|
43
|
+
placeholder: "Gõ “/” để chèn ảnh, bảng, tiêu đề… hoặc bắt đầu viết",
|
|
44
|
+
unknownBlock: "Khối không xác định", unknownBlockHint: "— plugin tạo khối này chưa bật; dữ liệu được giữ nguyên",
|
|
45
|
+
headingPlaceholder: "Tiêu đề",
|
|
46
|
+
undo: "Hoàn tác (⌘Z)", redo: "Làm lại (⌘⇧Z)",
|
|
47
|
+
paragraph: "Đoạn văn", paragraphHint: "Văn bản thường",
|
|
48
|
+
h2: "Tiêu đề lớn", h3: "Tiêu đề vừa", h4: "Tiêu đề nhỏ",
|
|
49
|
+
bulletList: "Danh sách", bulletListHint: "Gạch đầu dòng", orderedList: "Danh sách số",
|
|
50
|
+
quote: "Trích dẫn", codeBlock: "Khối mã",
|
|
51
|
+
image: "Ảnh", imageHint: "Từ thư viện media", gallery: "Bộ sưu tập ảnh", galleryHint: "Nhiều ảnh dạng lưới",
|
|
52
|
+
video: "Video", videoHint: "Tải lên hoặc từ thư viện", audio: "Âm thanh", audioHint: "MP3, WAV",
|
|
53
|
+
file: "Tệp tải xuống", fileHint: "PDF, Word, Excel…",
|
|
54
|
+
table: "Bảng", youtube: "Video YouTube", youtubeHint: "Dán link", youtubePrompt: "Link YouTube",
|
|
55
|
+
hr: "Đường kẻ", hrHint: "Phân cách", shortcode: "Shortcode", shortcodePrompt: "Tên shortcode (vd: contact-form)",
|
|
56
|
+
imageUrlPrompt: "Địa chỉ (URL)",
|
|
57
|
+
bold: "Đậm (⌘B)", italic: "Nghiêng (⌘I)", underline: "Gạch chân (⌘U)", strike: "Gạch ngang", code: "Mã", link: "Liên kết (⌘K)",
|
|
58
|
+
linkPrompt: "Địa chỉ liên kết",
|
|
59
|
+
alignLeft: "Căn trái", alignCenter: "Căn giữa", alignRight: "Căn phải",
|
|
60
|
+
insertImage: "Chèn ảnh", insertTable: "Chèn bảng", insertVideo: "Chèn video YouTube",
|
|
61
|
+
addRow: "+ hàng", addCol: "+ cột", delRow: "− hàng", delCol: "− cột", delTable: "Xoá bảng",
|
|
62
|
+
slashHint: "Gõ / để chèn nhanh", noCommand: "Không có lệnh phù hợp",
|
|
63
|
+
size: "Cỡ ảnh", sizeMedium: "Vừa (300px)", sizeMediumLarge: "Lớn vừa (768px)", sizeLarge: "Lớn (1024px)", sizeFull: "Gốc",
|
|
64
|
+
floatLeft: "Căn trái (chữ bao quanh)", floatRight: "Căn phải (chữ bao quanh)", center: "Giữa", wide: "Rộng / tràn khung",
|
|
65
|
+
alt: "Alt", altPrompt: "Mô tả ảnh (alt) cho người khiếm thị và SEO", caption: "Chú thích", captionPrompt: "Chú thích hiển thị dưới ảnh",
|
|
66
|
+
replace: "Thay ảnh", resetSize: "Cỡ gốc", columns: "Số cột:", galleryLabel: "Bộ sưu tập · {n} ảnh", videoLabel: "Video", audioLabel: "Âm thanh", fileLabel: "Tệp",
|
|
67
|
+
};
|
|
68
|
+
export type EditorLabels = typeof viLabels;
|
|
69
|
+
|
|
70
|
+
export const enLabels: EditorLabels = {
|
|
71
|
+
heading: "Heading", taskList: "Task list", columnsBlock: "Columns", column: "Column",
|
|
72
|
+
inspectorEmpty: "Select a block in the post to see its settings.", noSettings: "This block has no settings of its own.", blockActions: "Actions",
|
|
73
|
+
textAlign: "Text alignment", alignJustify: "Justify", headingLevel: "Heading level", showPdf: "Show the PDF in the page", allowDownload: "Allow download",
|
|
74
|
+
startAt: "Start at second", codeLanguage: "Language (e.g. js, php)", listStart: "Start at number",
|
|
75
|
+
inserter: "Add block", searchBlocks: "Search blocks…", noBlocks: "No matching blocks", dragToInsert: "Click to insert below the selected block, or drag into the post",
|
|
76
|
+
groupText: "Text", groupMedia: "Media", groupDesign: "Design", groupEmbed: "Embeds", groupWidgets: "Widgets", groupTheme: "Theme", groupPlugin: "Plugins",
|
|
77
|
+
outline: "Outline", outlineEmpty: "The post has no blocks yet", outlineHint: "Click to select a block, drag to move it",
|
|
78
|
+
columns2: "2 columns", columns3: "3 columns", columnsHint: "Split content into columns", group: "Group", groupHint: "Box around blocks (background, padding)",
|
|
79
|
+
callout: "Callout", calloutHint: "Info, warning…", button: "Button", buttonHint: "Link button", buttonEmpty: "Button", buttonText: "Button text", buttonUrl: "Link",
|
|
80
|
+
embed: "Embed", embedHint: "YouTube, Vimeo, Spotify, TikTok, X…", embedUrl: "URL (YouTube, Vimeo, Spotify, TikTok, X, Instagram…)",
|
|
81
|
+
embedUnsupported: "Cannot embed — shown as a link on the website", edit: "Edit", blockSettings: "Block settings", layout: "Layout",
|
|
82
|
+
addColumn: "+ column", removeColumn: "− column", vAlign: "Vertical align", vTop: "Top", vCenter: "Middle", vBottom: "Bottom", stack: "Stack on mobile",
|
|
83
|
+
background: "Background", textColor: "Text", noColor: "Clear", padding: "Padding", padNone: "None", padSmall: "Small", padMedium: "Medium", padLarge: "Large",
|
|
84
|
+
tone: "Style", toneInfo: "Info", toneSuccess: "Success", toneWarning: "Warning", toneDanger: "Danger", calloutTitle: "Callout title",
|
|
85
|
+
variant: "Button style", variantPrimary: "Primary", variantSecondary: "Secondary", variantOutline: "Outline",
|
|
86
|
+
blockToolbar: "Block toolbar", transformTo: "change block type", moreOptions: "More options", insertBefore: "Add block above",
|
|
87
|
+
listIndent: "List indentation", indent: "Indent", outdent: "Outdent", formatting: "Formatting", headerRow: "Header row",
|
|
88
|
+
blockVariant: "Variant", variant_default: "Default", variant_stripes: "Stripes", variant_rounded: "Rounded", variant_circle: "Circle", variant_plain: "Plain",
|
|
89
|
+
variant_dots: "Dots", variant_wide: "Wide", variant_pill: "Pill", variant_card: "Card", advanced: "Advanced", anchor: "HTML anchor", anchorHint: "Link to this block with #anchor (letters, digits, hyphens)",
|
|
90
|
+
cssClass: "Additional CSS class", cssClassHint: "Up to 5 classes, separated by spaces",
|
|
91
|
+
settingsTab: "Settings", styleTab: "Styles", device: "Device", device_base: "Desktop", device_tablet: "Tablet", device_mobile: "Mobile",
|
|
92
|
+
inherited: "Using", default: "Default", custom: "custom", customColor: "custom color", resetAll: "Reset all", none: "None",
|
|
93
|
+
linkSides: "One value for all 4 sides", unlinkSides: "Edit each side", side_top: "Top", side_right: "Right", side_bottom: "Bottom", side_left: "Left",
|
|
94
|
+
resizeColumns: "Drag to resize columns", dragPadding: "Drag to change padding",
|
|
95
|
+
style_typography: "Typography", style_fontFamily: "Font", style_fontSize: "Font size", style_appearance: "Appearance", style_lineHeight: "Line height",
|
|
96
|
+
style_letterSpacing: "Letter spacing", style_decoration: "Decoration", style_transform: "Letter case", style_textAlign: "Text align",
|
|
97
|
+
style_color: "Color", style_text: "Text", style_background: "Background", style_spacing: "Dimensions & spacing", style_padding: "Padding",
|
|
98
|
+
style_margin: "Margin", style_gap: "Block spacing", style_width: "Width", style_maxWidth: "Max width", style_minHeight: "Min height",
|
|
99
|
+
style_border: "Border & radius", style_borderWidth: "Border width", style_borderStyle: "Border style", style_borderColor: "Border color", style_radius: "Radius",
|
|
100
|
+
style_visibility: "Visibility", style_hide: "Hide per device", hide_desktop: "Hide on desktop", hide_tablet: "Hide on tablet", hide_mobile: "Hide on mobile",
|
|
101
|
+
font_body: "Body font", font_heading: "Heading font", font_mono: "Monospace", italicSuffix: "italic",
|
|
102
|
+
weight_300: "Light", weight_400: "Regular", weight_500: "Medium", weight_600: "Semibold", weight_700: "Bold", weight_800: "Extra bold", weight_900: "Black",
|
|
103
|
+
underlineText: "Underline", strikeText: "Strikethrough", upper: "UPPERCASE", lower: "lowercase", capitalize: "Capitalize",
|
|
104
|
+
border_solid: "Solid", border_dashed: "Dashed", border_dotted: "Dotted",
|
|
105
|
+
preformattedBlock: "Preformatted", tableHint: "Choose columns × rows", tableCols: "Columns", tableRows: "Rows", footerRow: "Footer row", fixedLayout: "Fixed column widths", tabBlocks: "Blocks", tabPatterns: "Patterns", noPatterns: "No matching patterns", cat_mine: "My patterns", syncedPattern: "Synced pattern", syncedBadge: "Synced", syncedLoading: "Loading pattern…", syncedMissing: "Pattern not available (deleted or unpublished)", syncedEdit: "Edit original", syncedDetach: "Detach", createPattern: "Create pattern", cat_hero: "Hero", cat_features: "Features", cat_cta: "Call to action",
|
|
106
|
+
cat_pricing: "Pricing", cat_testimonials: "Testimonials", cat_faq: "FAQ", cat_team: "Team", cat_contact: "Contact", cat_text: "Text", cat_gallery: "Gallery", cat_header: "Header", cat_footer: "Footer",
|
|
107
|
+
stats: "Content statistics", words: "{n} words", chars: "{n} characters", readingTime: "~{n} min read",
|
|
108
|
+
editorLabel: "Post content", apply: "Apply", insert: "Insert", cancel: "Cancel", removeLink: "Remove link", linkNewTab: "Open in new tab",
|
|
109
|
+
blockOptions: "Block options (drag to move)", addBelow: "Add block below", moveUp: "Move up", moveDown: "Move down",
|
|
110
|
+
duplicate: "Duplicate", deleteBlock: "Delete block", selectParent: "Select parent block",
|
|
111
|
+
placeholder: "Type “/” to insert images, tables, headings… or start writing",
|
|
112
|
+
unknownBlock: "Unknown block", unknownBlockHint: "— the plugin that made this block is not active; its data is kept",
|
|
113
|
+
headingPlaceholder: "Heading",
|
|
114
|
+
undo: "Undo (⌘Z)", redo: "Redo (⌘⇧Z)",
|
|
115
|
+
paragraph: "Paragraph", paragraphHint: "Plain text",
|
|
116
|
+
h2: "Large heading", h3: "Medium heading", h4: "Small heading",
|
|
117
|
+
bulletList: "Bulleted list", bulletListHint: "Bullets", orderedList: "Numbered list",
|
|
118
|
+
quote: "Quote", codeBlock: "Code block",
|
|
119
|
+
image: "Image", imageHint: "From media library", gallery: "Gallery", galleryHint: "Grid of images",
|
|
120
|
+
video: "Video", videoHint: "Upload or from library", audio: "Audio", audioHint: "MP3, WAV",
|
|
121
|
+
file: "Download file", fileHint: "PDF, Word, Excel…",
|
|
122
|
+
table: "Table", youtube: "YouTube video", youtubeHint: "Paste a link", youtubePrompt: "YouTube link",
|
|
123
|
+
hr: "Divider", hrHint: "Separator", shortcode: "Shortcode", shortcodePrompt: "Shortcode name (e.g. contact-form)",
|
|
124
|
+
imageUrlPrompt: "URL",
|
|
125
|
+
bold: "Bold (⌘B)", italic: "Italic (⌘I)", underline: "Underline (⌘U)", strike: "Strikethrough", code: "Code", link: "Link (⌘K)",
|
|
126
|
+
linkPrompt: "Link URL",
|
|
127
|
+
alignLeft: "Align left", alignCenter: "Align center", alignRight: "Align right",
|
|
128
|
+
insertImage: "Insert image", insertTable: "Insert table", insertVideo: "Insert YouTube video",
|
|
129
|
+
addRow: "+ row", addCol: "+ column", delRow: "− row", delCol: "− column", delTable: "Delete table",
|
|
130
|
+
slashHint: "Type / for quick insert", noCommand: "No matching command",
|
|
131
|
+
size: "Image size", sizeMedium: "Medium (300px)", sizeMediumLarge: "Medium large (768px)", sizeLarge: "Large (1024px)", sizeFull: "Full",
|
|
132
|
+
floatLeft: "Float left", floatRight: "Float right", center: "Center", wide: "Wide",
|
|
133
|
+
alt: "Alt", altPrompt: "Image description (alt) for screen readers and SEO", caption: "Caption", captionPrompt: "Caption shown under the image",
|
|
134
|
+
replace: "Replace", resetSize: "Original size", columns: "Columns:", galleryLabel: "Gallery · {n} images", videoLabel: "Video", audioLabel: "Audio", fileLabel: "File",
|
|
135
|
+
};
|
package/src/layout.tsx
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Node, mergeAttributes, type Editor } from "@tiptap/core";
|
|
2
|
+
import { NodeViewWrapper, ReactNodeViewRenderer, type ReactNodeViewProps } from "@tiptap/react";
|
|
3
|
+
import { embedInfo } from "@ecomcx/ecomweb-content";
|
|
4
|
+
import { ExternalLink, Link2 } from "lucide-react";
|
|
5
|
+
import { markContainer } from "./blockops";
|
|
6
|
+
import { labelsOf } from "./nodes";
|
|
7
|
+
import { cx } from "./util";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Khối bố cục — khớp CORE_NODES của @ecomcx/ecomweb-content 1.2: cột (columns > column), nhóm, hộp lưu ý, nút, nhúng theo đường dẫn.
|
|
11
|
+
* Cột / nhóm / hộp lưu ý chứa khối khác (khối con có tay kéo + menu riêng); nút và nhúng là khối nguyên, sửa qua thanh cài đặt.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Thuộc tính của khối: trong HTML của trình soạn gộp thành một `data-attrs` (JSON) → sao chép / dán / kéo khối giữ đủ dữ liệu.
|
|
16
|
+
*/
|
|
17
|
+
function attrs(defs: Record<string, unknown>) {
|
|
18
|
+
return Object.fromEntries(Object.entries(defs).map(([k, def]) => [k, {
|
|
19
|
+
default: def,
|
|
20
|
+
renderHTML: () => ({}),
|
|
21
|
+
parseHTML: (el: HTMLElement) => { try { const v = JSON.parse(el.getAttribute("data-attrs") ?? "{}")[k]; return v === undefined ? def : v; } catch { return def; } },
|
|
22
|
+
}]));
|
|
23
|
+
}
|
|
24
|
+
const dataAttrs = (a: Record<string, unknown>) => ({ "data-attrs": JSON.stringify(Object.fromEntries(Object.entries(a).filter(([, v]) => v != null))) });
|
|
25
|
+
|
|
26
|
+
/** Màu người viết chọn: chỉ nhận dạng màu CSS (giống renderer của website). */
|
|
27
|
+
const COLOR = /^(#[0-9a-f]{3,8}|(?:rgb|hsl)a?\([\d\s.,%deg/]+\)|[a-z]{3,20}|var\(--[\w-]+\))$/i;
|
|
28
|
+
export const safeColor = (v: unknown) => (typeof v === "string" && COLOR.test(v.trim()) ? v.trim() : null);
|
|
29
|
+
const PADDING: Record<string, string> = { none: "0", small: "12px", medium: "24px", large: "48px" };
|
|
30
|
+
|
|
31
|
+
export const Columns = Node.create({
|
|
32
|
+
name: "columns",
|
|
33
|
+
group: "block",
|
|
34
|
+
content: "column{2,4}",
|
|
35
|
+
defining: true,
|
|
36
|
+
isolating: true,
|
|
37
|
+
addAttributes: () => attrs({ verticalAlign: null, stack: true }),
|
|
38
|
+
parseHTML: () => [{ tag: "div[data-columns]" }],
|
|
39
|
+
renderHTML: ({ node, HTMLAttributes }) => ["div", mergeAttributes(HTMLAttributes, { "data-columns": "", ...dataAttrs(node.attrs), class: cx("cms-ed-columns ecx-columns", node.attrs.verticalAlign && `is-${node.attrs.verticalAlign}`) }), 0],
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const Column = Node.create({
|
|
43
|
+
name: "column",
|
|
44
|
+
content: "block+",
|
|
45
|
+
isolating: true,
|
|
46
|
+
defining: true,
|
|
47
|
+
addAttributes: () => attrs({ width: null }),
|
|
48
|
+
parseHTML: () => [{ tag: "div[data-column]" }],
|
|
49
|
+
renderHTML: ({ node, HTMLAttributes }) => ["div", mergeAttributes(HTMLAttributes, { "data-column": "", ...dataAttrs(node.attrs), class: "cms-ed-column ecx-column", style: `flex: ${Number(node.attrs.width) > 0 ? node.attrs.width : 1} 1 0` }), 0],
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
export const Group = Node.create({
|
|
53
|
+
name: "group",
|
|
54
|
+
group: "block",
|
|
55
|
+
content: "block+",
|
|
56
|
+
defining: true,
|
|
57
|
+
addAttributes: () => attrs({ background: null, textColor: null, padding: "medium" }),
|
|
58
|
+
parseHTML: () => [{ tag: "div[data-group]" }],
|
|
59
|
+
renderHTML: ({ node, HTMLAttributes }) => {
|
|
60
|
+
// Kiểu dáng khối (attrs.style) đặt padding / màu thì bỏ giá trị inline tương ứng (inline luôn thắng class)
|
|
61
|
+
const own = (node.attrs.style ?? {}) as { padding?: unknown; color?: { text?: unknown; background?: unknown } };
|
|
62
|
+
const bg = own.color?.background ? null : safeColor(node.attrs.background), fg = own.color?.text ? null : safeColor(node.attrs.textColor);
|
|
63
|
+
const style = [bg && `background: ${bg}`, fg && `color: ${fg}`, !own.padding && `padding: ${PADDING[node.attrs.padding] ?? PADDING.medium}`].filter(Boolean).join("; ");
|
|
64
|
+
return ["div", mergeAttributes(HTMLAttributes, { "data-group": "", ...dataAttrs(node.attrs), class: cx("cms-ed-group ecx-group", bg && "has-bg"), style }), 0];
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export const Callout = Node.create({
|
|
69
|
+
name: "callout",
|
|
70
|
+
group: "block",
|
|
71
|
+
content: "block+",
|
|
72
|
+
defining: true,
|
|
73
|
+
addAttributes: () => attrs({ tone: "info", title: null }),
|
|
74
|
+
parseHTML: () => [{ tag: "div[data-callout]" }],
|
|
75
|
+
renderHTML: ({ node, HTMLAttributes }) => ["div", mergeAttributes(HTMLAttributes, { "data-callout": "", ...dataAttrs(node.attrs), "data-tone": node.attrs.tone ?? "info", class: "cms-ed-callout ecx-callout", role: "note" },
|
|
76
|
+
node.attrs.title ? { "data-title": node.attrs.title } : {}), 0],
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
function ButtonView({ node, selected, editor }: ReactNodeViewProps) {
|
|
80
|
+
const t = labelsOf(editor);
|
|
81
|
+
const a = node.attrs;
|
|
82
|
+
return (
|
|
83
|
+
<NodeViewWrapper className={cx("cms-ed-button-wrap", a.align && `is-${a.align}`, selected && "is-selected")} data-drag-handle>
|
|
84
|
+
<span className={cx("cms-ed-button", `is-${a.variant ?? "primary"}`)}>{a.text || t.buttonEmpty}</span>
|
|
85
|
+
{a.href && <span className="cms-ed-button-href"><Link2 size={11} /> {a.href}</span>}
|
|
86
|
+
</NodeViewWrapper>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export const ButtonNode = Node.create({
|
|
91
|
+
name: "button",
|
|
92
|
+
group: "block",
|
|
93
|
+
atom: true,
|
|
94
|
+
draggable: true,
|
|
95
|
+
selectable: true,
|
|
96
|
+
addAttributes: () => attrs({ text: null, href: null, target: null, rel: null, variant: "primary", align: null }),
|
|
97
|
+
parseHTML: () => [{ tag: "div[data-button]" }],
|
|
98
|
+
renderHTML: ({ node }) => ["div", { "data-button": "", ...dataAttrs(node.attrs) }],
|
|
99
|
+
addNodeView: () => ReactNodeViewRenderer(ButtonView),
|
|
100
|
+
});
|
|
101
|
+
|
|
102
|
+
function EmbedView({ node, selected, editor }: ReactNodeViewProps) {
|
|
103
|
+
const t = labelsOf(editor);
|
|
104
|
+
const info = embedInfo(node.attrs.url);
|
|
105
|
+
return (
|
|
106
|
+
<NodeViewWrapper className={cx("cms-ed-block", "cms-ed-embed", selected && "is-selected")} data-drag-handle>
|
|
107
|
+
<div className="cms-ed-block-label">{info ? info.title : t.embed}</div>
|
|
108
|
+
{info ? (
|
|
109
|
+
<div className="cms-ed-embed-frame" style={info.aspect ? { aspectRatio: String(info.aspect), maxWidth: info.maxWidth } : { height: info.height, maxWidth: info.maxWidth }}>
|
|
110
|
+
<iframe src={info.src} title={node.attrs.caption || info.title} loading="lazy" referrerPolicy="strict-origin-when-cross-origin" tabIndex={-1} />
|
|
111
|
+
{/* Lớp phủ: bấm chọn khối thay vì chạy khung nhúng trong lúc soạn */}
|
|
112
|
+
<span className="cms-ed-embed-cover" />
|
|
113
|
+
</div>
|
|
114
|
+
) : (
|
|
115
|
+
<div className="cms-ed-embed-unknown"><ExternalLink size={14} /> <span>{node.attrs.url || "—"}</span> <small>{t.embedUnsupported}</small></div>
|
|
116
|
+
)}
|
|
117
|
+
{node.attrs.caption && <div className="cms-ed-embed-caption">{node.attrs.caption}</div>}
|
|
118
|
+
</NodeViewWrapper>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export const EmbedNode = Node.create({
|
|
123
|
+
name: "embed",
|
|
124
|
+
group: "block",
|
|
125
|
+
atom: true,
|
|
126
|
+
draggable: true,
|
|
127
|
+
selectable: true,
|
|
128
|
+
addAttributes: () => attrs({ url: null, caption: null }),
|
|
129
|
+
parseHTML: () => [{ tag: "div[data-embed]" }],
|
|
130
|
+
renderHTML: ({ node }) => ["div", { "data-embed": "", ...dataAttrs(node.attrs) }],
|
|
131
|
+
addNodeView: () => ReactNodeViewRenderer(EmbedView),
|
|
132
|
+
});
|
|
133
|
+
|
|
134
|
+
// Khối con trong cột / nhóm / hộp lưu ý có tay kéo + menu riêng
|
|
135
|
+
for (const name of ["column", "group", "callout"]) markContainer(name);
|
|
136
|
+
|
|
137
|
+
export const layoutExtensions = () => [Columns, Column, Group, Callout, ButtonNode, EmbedNode];
|
|
138
|
+
|
|
139
|
+
/** Cột rỗng (một đoạn văn trống). */
|
|
140
|
+
export const emptyColumn = (width: number | null = null) => ({ type: "column", attrs: { width }, content: [{ type: "paragraph" }] });
|
|
141
|
+
|
|
142
|
+
/** Đổi số cột: thêm cột trống vào cuối, hoặc bỏ cột cuối (nội dung của nó dồn sang cột liền trước). Độ rộng về chia đều. */
|
|
143
|
+
export function setColumnCount(editor: Editor, pos: number, count: number) {
|
|
144
|
+
const node = editor.state.doc.nodeAt(pos);
|
|
145
|
+
if (!node || node.type.name !== "columns" || count < 2 || count > 4 || count === node.childCount) return false;
|
|
146
|
+
const { schema } = editor.state;
|
|
147
|
+
const cols = Array.from({ length: node.childCount }, (_, i) => node.child(i).type.create({ width: null }, node.child(i).content));
|
|
148
|
+
while (cols.length < count) cols.push(schema.nodeFromJSON(emptyColumn()));
|
|
149
|
+
while (cols.length > count) {
|
|
150
|
+
const last = cols.pop()!, prev = cols.pop()!;
|
|
151
|
+
const empty = last.childCount === 1 && last.firstChild!.isTextblock && last.firstChild!.content.size === 0;
|
|
152
|
+
cols.push(empty ? prev : prev.type.create(prev.attrs, prev.content.append(last.content)));
|
|
153
|
+
}
|
|
154
|
+
editor.view.dispatch(editor.state.tr.replaceWith(pos, pos + node.nodeSize, node.type.create(node.attrs, cols)));
|
|
155
|
+
return true;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/** Đặt độ rộng các cột theo tỉ lệ (vd [33, 67]). */
|
|
159
|
+
export function setColumnWidths(editor: Editor, pos: number, widths: number[]) {
|
|
160
|
+
const node = editor.state.doc.nodeAt(pos);
|
|
161
|
+
if (!node || node.type.name !== "columns" || widths.length !== node.childCount) return false;
|
|
162
|
+
const tr = editor.state.tr;
|
|
163
|
+
let p = pos + 1;
|
|
164
|
+
node.forEach((col, _off, i) => { tr.setNodeMarkup(p, undefined, { ...col.attrs, width: widths[i] }); p += col.nodeSize; });
|
|
165
|
+
editor.view.dispatch(tr);
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** Bố cục có sẵn theo số cột. */
|
|
170
|
+
export const COLUMN_PRESETS: Record<number, number[][]> = {
|
|
171
|
+
2: [[50, 50], [33, 67], [67, 33], [25, 75], [75, 25]],
|
|
172
|
+
3: [[33, 33, 33], [25, 50, 25], [50, 25, 25], [25, 25, 50]],
|
|
173
|
+
4: [[25, 25, 25, 25]],
|
|
174
|
+
};
|