@kaitify/react 0.0.1-beta.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/LICENSE +21 -0
- package/README.md +3 -0
- package/docs/.vitepress/cache/deps/_metadata.json +52 -0
- package/docs/.vitepress/cache/deps/chunk-Q2AYPHVK.js +9719 -0
- package/docs/.vitepress/cache/deps/chunk-Q2AYPHVK.js.map +7 -0
- package/docs/.vitepress/cache/deps/chunk-QAXAIFA7.js +12705 -0
- package/docs/.vitepress/cache/deps/chunk-QAXAIFA7.js.map +7 -0
- package/docs/.vitepress/cache/deps/package.json +3 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js +4505 -0
- package/docs/.vitepress/cache/deps/vitepress___@vue_devtools-api.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js +583 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_core.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js +1145 -0
- package/docs/.vitepress/cache/deps/vitepress___@vueuse_integrations_useFocusTrap.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js +1665 -0
- package/docs/.vitepress/cache/deps/vitepress___mark__js_src_vanilla__js.js.map +7 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js +1813 -0
- package/docs/.vitepress/cache/deps/vitepress___minisearch.js.map +7 -0
- package/docs/.vitepress/cache/deps/vue.js +343 -0
- package/docs/.vitepress/cache/deps/vue.js.map +7 -0
- package/docs/.vitepress/config.ts +185 -0
- package/docs/.vitepress/global.d.ts +1 -0
- package/docs/.vitepress/theme/index.ts +6 -0
- package/docs/.vitepress/theme/style.less +17 -0
- package/docs/.vitepress/tsconfig.json +12 -0
- package/docs/changelog.md +10 -0
- package/docs/guide/bubble.md +71 -0
- package/docs/guide/checkbox.md +38 -0
- package/docs/guide/divider.md +41 -0
- package/docs/guide/icon.md +34 -0
- package/docs/guide/install.md +70 -0
- package/docs/guide/introduction.md +28 -0
- package/docs/guide/locale.md +67 -0
- package/docs/guide/menu.md +112 -0
- package/docs/guide/quick-start.md +76 -0
- package/docs/guide/shortcut.md +77 -0
- package/docs/guide/tabs.md +42 -0
- package/docs/guide/wrapper.md +303 -0
- package/docs/index.md +41 -0
- package/docs/menus/built-in/align-center.md +29 -0
- package/docs/menus/built-in/align-justify.md +29 -0
- package/docs/menus/built-in/align-left.md +29 -0
- package/docs/menus/built-in/align-right.md +29 -0
- package/docs/menus/built-in/attachment.md +41 -0
- package/docs/menus/built-in/back-color.md +33 -0
- package/docs/menus/built-in/blockquote.md +29 -0
- package/docs/menus/built-in/bold.md +29 -0
- package/docs/menus/built-in/clear-format.md +29 -0
- package/docs/menus/built-in/code-block-languages.md +37 -0
- package/docs/menus/built-in/code-block.md +29 -0
- package/docs/menus/built-in/code.md +29 -0
- package/docs/menus/built-in/color.md +33 -0
- package/docs/menus/built-in/decrease-indent.md +29 -0
- package/docs/menus/built-in/emoji.md +35 -0
- package/docs/menus/built-in/font-family.md +44 -0
- package/docs/menus/built-in/font-size.md +44 -0
- package/docs/menus/built-in/full-screen.md +39 -0
- package/docs/menus/built-in/heading.md +66 -0
- package/docs/menus/built-in/horizontal.md +29 -0
- package/docs/menus/built-in/image.md +41 -0
- package/docs/menus/built-in/increase-indent.md +29 -0
- package/docs/menus/built-in/italic.md +29 -0
- package/docs/menus/built-in/line-height.md +44 -0
- package/docs/menus/built-in/link-unset.md +29 -0
- package/docs/menus/built-in/link.md +29 -0
- package/docs/menus/built-in/math.md +29 -0
- package/docs/menus/built-in/ordered-list.md +29 -0
- package/docs/menus/built-in/redo.md +25 -0
- package/docs/menus/built-in/strikethrough.md +29 -0
- package/docs/menus/built-in/subscript.md +29 -0
- package/docs/menus/built-in/superscript.md +29 -0
- package/docs/menus/built-in/table-add-column.md +33 -0
- package/docs/menus/built-in/table-add-row.md +33 -0
- package/docs/menus/built-in/table-delete-column.md +29 -0
- package/docs/menus/built-in/table-delete-row.md +29 -0
- package/docs/menus/built-in/table-merge-cell.md +33 -0
- package/docs/menus/built-in/table-unset.md +29 -0
- package/docs/menus/built-in/table.md +37 -0
- package/docs/menus/built-in/task.md +29 -0
- package/docs/menus/built-in/underline.md +29 -0
- package/docs/menus/built-in/undo.md +25 -0
- package/docs/menus/built-in/unordered-list.md +29 -0
- package/docs/menus/built-in/video-controls.md +29 -0
- package/docs/menus/built-in/video-loop.md +29 -0
- package/docs/menus/built-in/video-muted.md +29 -0
- package/docs/menus/built-in/video.md +41 -0
- package/docs/menus/built-in/wrap-down.md +33 -0
- package/docs/menus/built-in/wrap-up.md +33 -0
- package/docs/menus/introduction.md +27 -0
- package/examples/App.tsx +179 -0
- package/examples/main.tsx +9 -0
- package/examples/style.less +21 -0
- package/index.html +13 -0
- package/lib/core/button/button.d.ts +5 -0
- package/lib/core/button/index.d.ts +3 -0
- package/lib/core/button/props.d.ts +38 -0
- package/lib/core/checkbox/checkbox.d.ts +5 -0
- package/lib/core/checkbox/index.d.ts +3 -0
- package/lib/core/checkbox/props.d.ts +21 -0
- package/lib/core/divider/divider.d.ts +4 -0
- package/lib/core/divider/index.d.ts +2 -0
- package/lib/core/icon/icon.d.ts +5 -0
- package/lib/core/icon/index.d.ts +3 -0
- package/lib/core/icon/props.d.ts +22 -0
- package/lib/core/popover/index.d.ts +3 -0
- package/lib/core/popover/popover.d.ts +7 -0
- package/lib/core/popover/props.d.ts +94 -0
- package/lib/core/tabs/index.d.ts +3 -0
- package/lib/core/tabs/props.d.ts +21 -0
- package/lib/core/tabs/tabs.d.ts +2 -0
- package/lib/core/teleport/index.d.ts +3 -0
- package/lib/core/teleport/props.d.ts +11 -0
- package/lib/core/teleport/teleport.d.ts +5 -0
- package/lib/editor/bubble/bubble.d.ts +6 -0
- package/lib/editor/bubble/index.d.ts +3 -0
- package/lib/editor/bubble/props.d.ts +63 -0
- package/lib/editor/menu/built-in/align-center/align-center.d.ts +2 -0
- package/lib/editor/menu/built-in/align-center/index.d.ts +3 -0
- package/lib/editor/menu/built-in/align-center/props.d.ts +10 -0
- package/lib/editor/menu/built-in/align-justify/align-justify.d.ts +2 -0
- package/lib/editor/menu/built-in/align-justify/index.d.ts +3 -0
- package/lib/editor/menu/built-in/align-justify/props.d.ts +10 -0
- package/lib/editor/menu/built-in/align-left/align-left.d.ts +2 -0
- package/lib/editor/menu/built-in/align-left/index.d.ts +3 -0
- package/lib/editor/menu/built-in/align-left/props.d.ts +10 -0
- package/lib/editor/menu/built-in/align-right/align-right.d.ts +2 -0
- package/lib/editor/menu/built-in/align-right/index.d.ts +3 -0
- package/lib/editor/menu/built-in/align-right/props.d.ts +10 -0
- package/lib/editor/menu/built-in/attachment/attachment.d.ts +2 -0
- package/lib/editor/menu/built-in/attachment/index.d.ts +3 -0
- package/lib/editor/menu/built-in/attachment/props.d.ts +26 -0
- package/lib/editor/menu/built-in/back-color/back-color.d.ts +2 -0
- package/lib/editor/menu/built-in/back-color/index.d.ts +3 -0
- package/lib/editor/menu/built-in/back-color/props.d.ts +15 -0
- package/lib/editor/menu/built-in/blockquote/blockquote.d.ts +2 -0
- package/lib/editor/menu/built-in/blockquote/index.d.ts +3 -0
- package/lib/editor/menu/built-in/blockquote/props.d.ts +10 -0
- package/lib/editor/menu/built-in/bold/bold.d.ts +2 -0
- package/lib/editor/menu/built-in/bold/index.d.ts +3 -0
- package/lib/editor/menu/built-in/bold/props.d.ts +10 -0
- package/lib/editor/menu/built-in/clear-format/clear-format.d.ts +2 -0
- package/lib/editor/menu/built-in/clear-format/index.d.ts +3 -0
- package/lib/editor/menu/built-in/clear-format/props.d.ts +10 -0
- package/lib/editor/menu/built-in/code/code.d.ts +2 -0
- package/lib/editor/menu/built-in/code/index.d.ts +3 -0
- package/lib/editor/menu/built-in/code/props.d.ts +10 -0
- package/lib/editor/menu/built-in/code-block/code-block-languages.d.ts +2 -0
- package/lib/editor/menu/built-in/code-block/code-block.d.ts +2 -0
- package/lib/editor/menu/built-in/code-block/index.d.ts +4 -0
- package/lib/editor/menu/built-in/code-block/props.d.ts +32 -0
- package/lib/editor/menu/built-in/color/color.d.ts +2 -0
- package/lib/editor/menu/built-in/color/index.d.ts +3 -0
- package/lib/editor/menu/built-in/color/props.d.ts +15 -0
- package/lib/editor/menu/built-in/decrease-indent/decrease-indent.d.ts +2 -0
- package/lib/editor/menu/built-in/decrease-indent/index.d.ts +3 -0
- package/lib/editor/menu/built-in/decrease-indent/props.d.ts +10 -0
- package/lib/editor/menu/built-in/emoji/emoji.d.ts +2 -0
- package/lib/editor/menu/built-in/emoji/index.d.ts +3 -0
- package/lib/editor/menu/built-in/emoji/props.d.ts +15 -0
- package/lib/editor/menu/built-in/font-family/font-family.d.ts +2 -0
- package/lib/editor/menu/built-in/font-family/index.d.ts +3 -0
- package/lib/editor/menu/built-in/font-family/props.d.ts +21 -0
- package/lib/editor/menu/built-in/font-size/font-size.d.ts +2 -0
- package/lib/editor/menu/built-in/font-size/index.d.ts +3 -0
- package/lib/editor/menu/built-in/font-size/props.d.ts +21 -0
- package/lib/editor/menu/built-in/full-screen/full-screen.d.ts +2 -0
- package/lib/editor/menu/built-in/full-screen/index.d.ts +3 -0
- package/lib/editor/menu/built-in/full-screen/props.d.ts +18 -0
- package/lib/editor/menu/built-in/heading/heading.d.ts +2 -0
- package/lib/editor/menu/built-in/heading/index.d.ts +3 -0
- package/lib/editor/menu/built-in/heading/props.d.ts +21 -0
- package/lib/editor/menu/built-in/horizontal/horizontal.d.ts +2 -0
- package/lib/editor/menu/built-in/horizontal/index.d.ts +3 -0
- package/lib/editor/menu/built-in/horizontal/props.d.ts +10 -0
- package/lib/editor/menu/built-in/image/image.d.ts +2 -0
- package/lib/editor/menu/built-in/image/index.d.ts +3 -0
- package/lib/editor/menu/built-in/image/props.d.ts +26 -0
- package/lib/editor/menu/built-in/increase-indent/increase-indent.d.ts +2 -0
- package/lib/editor/menu/built-in/increase-indent/index.d.ts +3 -0
- package/lib/editor/menu/built-in/increase-indent/props.d.ts +10 -0
- package/lib/editor/menu/built-in/index.d.ts +38 -0
- package/lib/editor/menu/built-in/italic/index.d.ts +3 -0
- package/lib/editor/menu/built-in/italic/italic.d.ts +2 -0
- package/lib/editor/menu/built-in/italic/props.d.ts +10 -0
- package/lib/editor/menu/built-in/line-height/index.d.ts +3 -0
- package/lib/editor/menu/built-in/line-height/line-height.d.ts +2 -0
- package/lib/editor/menu/built-in/line-height/props.d.ts +21 -0
- package/lib/editor/menu/built-in/link/index.d.ts +4 -0
- package/lib/editor/menu/built-in/link/link-unset.d.ts +2 -0
- package/lib/editor/menu/built-in/link/link.d.ts +2 -0
- package/lib/editor/menu/built-in/link/props.d.ts +21 -0
- package/lib/editor/menu/built-in/math/index.d.ts +3 -0
- package/lib/editor/menu/built-in/math/math.d.ts +2 -0
- package/lib/editor/menu/built-in/math/props.d.ts +11 -0
- package/lib/editor/menu/built-in/ordered-list/index.d.ts +3 -0
- package/lib/editor/menu/built-in/ordered-list/ordered-list.d.ts +2 -0
- package/lib/editor/menu/built-in/ordered-list/props.d.ts +11 -0
- package/lib/editor/menu/built-in/redo/index.d.ts +3 -0
- package/lib/editor/menu/built-in/redo/props.d.ts +6 -0
- package/lib/editor/menu/built-in/redo/redo.d.ts +2 -0
- package/lib/editor/menu/built-in/strikethrough/index.d.ts +3 -0
- package/lib/editor/menu/built-in/strikethrough/props.d.ts +10 -0
- package/lib/editor/menu/built-in/strikethrough/strikethrough.d.ts +2 -0
- package/lib/editor/menu/built-in/subscript/index.d.ts +3 -0
- package/lib/editor/menu/built-in/subscript/props.d.ts +10 -0
- package/lib/editor/menu/built-in/subscript/subscript.d.ts +2 -0
- package/lib/editor/menu/built-in/superscript/index.d.ts +3 -0
- package/lib/editor/menu/built-in/superscript/props.d.ts +10 -0
- package/lib/editor/menu/built-in/superscript/superscript.d.ts +2 -0
- package/lib/editor/menu/built-in/table/index.d.ts +9 -0
- package/lib/editor/menu/built-in/table/props.d.ts +97 -0
- package/lib/editor/menu/built-in/table/table-add-column.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table-add-row.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table-delete-column.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table-delete-row.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table-merge-cell.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table-unset.d.ts +2 -0
- package/lib/editor/menu/built-in/table/table.d.ts +2 -0
- package/lib/editor/menu/built-in/task/index.d.ts +3 -0
- package/lib/editor/menu/built-in/task/props.d.ts +10 -0
- package/lib/editor/menu/built-in/task/task.d.ts +2 -0
- package/lib/editor/menu/built-in/underline/index.d.ts +3 -0
- package/lib/editor/menu/built-in/underline/props.d.ts +10 -0
- package/lib/editor/menu/built-in/underline/underline.d.ts +2 -0
- package/lib/editor/menu/built-in/undo/index.d.ts +3 -0
- package/lib/editor/menu/built-in/undo/props.d.ts +6 -0
- package/lib/editor/menu/built-in/undo/undo.d.ts +2 -0
- package/lib/editor/menu/built-in/unordered-list/index.d.ts +3 -0
- package/lib/editor/menu/built-in/unordered-list/props.d.ts +11 -0
- package/lib/editor/menu/built-in/unordered-list/unordered-list.d.ts +2 -0
- package/lib/editor/menu/built-in/video/index.d.ts +6 -0
- package/lib/editor/menu/built-in/video/props.d.ts +56 -0
- package/lib/editor/menu/built-in/video/video-controls.d.ts +2 -0
- package/lib/editor/menu/built-in/video/video-loop.d.ts +2 -0
- package/lib/editor/menu/built-in/video/video-muted.d.ts +2 -0
- package/lib/editor/menu/built-in/video/video.d.ts +2 -0
- package/lib/editor/menu/built-in/wrap-down/index.d.ts +3 -0
- package/lib/editor/menu/built-in/wrap-down/props.d.ts +15 -0
- package/lib/editor/menu/built-in/wrap-down/wrap-down.d.ts +2 -0
- package/lib/editor/menu/built-in/wrap-up/index.d.ts +3 -0
- package/lib/editor/menu/built-in/wrap-up/props.d.ts +15 -0
- package/lib/editor/menu/built-in/wrap-up/wrap-up.d.ts +2 -0
- package/lib/editor/menu/index.d.ts +4 -0
- package/lib/editor/menu/menu.d.ts +6 -0
- package/lib/editor/menu/props.d.ts +89 -0
- package/lib/editor/wrapper/index.d.ts +3 -0
- package/lib/editor/wrapper/props.d.ts +206 -0
- package/lib/editor/wrapper/render.d.ts +18 -0
- package/lib/editor/wrapper/wrapper.d.ts +6 -0
- package/lib/hooks/index.d.ts +1 -0
- package/lib/hooks/use-editor.d.ts +32 -0
- package/lib/index.d.ts +9 -0
- package/lib/kaitify-react.es.js +47868 -0
- package/lib/kaitify-react.umd.js +30 -0
- package/lib/locale/en-us.d.ts +31 -0
- package/lib/locale/index.d.ts +2 -0
- package/lib/locale/ja-jp.d.ts +31 -0
- package/lib/locale/ko-kr.d.ts +31 -0
- package/package.json +56 -0
- package/src/core/button/button.tsx +29 -0
- package/src/core/button/index.ts +3 -0
- package/src/core/button/props.ts +39 -0
- package/src/core/button/style.module.less +57 -0
- package/src/core/checkbox/checkbox.tsx +39 -0
- package/src/core/checkbox/index.ts +3 -0
- package/src/core/checkbox/props.ts +21 -0
- package/src/core/checkbox/style.module.less +99 -0
- package/src/core/divider/divider.tsx +17 -0
- package/src/core/divider/index.ts +2 -0
- package/src/core/divider/style.module.less +12 -0
- package/src/core/icon/icon.tsx +14 -0
- package/src/core/icon/index.ts +3 -0
- package/src/core/icon/props.ts +23 -0
- package/src/core/icon/style.module.less +19 -0
- package/src/core/popover/index.ts +3 -0
- package/src/core/popover/popover.tsx +286 -0
- package/src/core/popover/props.ts +97 -0
- package/src/core/popover/style.module.less +247 -0
- package/src/core/tabs/index.ts +3 -0
- package/src/core/tabs/props.ts +19 -0
- package/src/core/tabs/style.module.less +62 -0
- package/src/core/tabs/tabs.tsx +35 -0
- package/src/core/teleport/index.ts +3 -0
- package/src/core/teleport/props.ts +12 -0
- package/src/core/teleport/teleport.tsx +23 -0
- package/src/editor/bubble/bubble.tsx +244 -0
- package/src/editor/bubble/index.ts +3 -0
- package/src/editor/bubble/props.ts +65 -0
- package/src/editor/bubble/style.module.less +33 -0
- package/src/editor/menu/built-in/align-center/align-center.tsx +37 -0
- package/src/editor/menu/built-in/align-center/index.ts +3 -0
- package/src/editor/menu/built-in/align-center/props.ts +10 -0
- package/src/editor/menu/built-in/align-justify/align-justify.tsx +37 -0
- package/src/editor/menu/built-in/align-justify/index.ts +3 -0
- package/src/editor/menu/built-in/align-justify/props.ts +10 -0
- package/src/editor/menu/built-in/align-left/align-left.tsx +37 -0
- package/src/editor/menu/built-in/align-left/index.ts +3 -0
- package/src/editor/menu/built-in/align-left/props.ts +10 -0
- package/src/editor/menu/built-in/align-right/align-right.tsx +37 -0
- package/src/editor/menu/built-in/align-right/index.ts +3 -0
- package/src/editor/menu/built-in/align-right/props.ts +10 -0
- package/src/editor/menu/built-in/attachment/attachment.tsx +190 -0
- package/src/editor/menu/built-in/attachment/index.ts +3 -0
- package/src/editor/menu/built-in/attachment/props.ts +27 -0
- package/src/editor/menu/built-in/attachment/style.module.less +138 -0
- package/src/editor/menu/built-in/back-color/back-color.tsx +97 -0
- package/src/editor/menu/built-in/back-color/index.ts +3 -0
- package/src/editor/menu/built-in/back-color/props.ts +16 -0
- package/src/editor/menu/built-in/back-color/style.module.less +62 -0
- package/src/editor/menu/built-in/blockquote/blockquote.tsx +36 -0
- package/src/editor/menu/built-in/blockquote/index.ts +3 -0
- package/src/editor/menu/built-in/blockquote/props.ts +10 -0
- package/src/editor/menu/built-in/bold/bold.tsx +45 -0
- package/src/editor/menu/built-in/bold/index.ts +3 -0
- package/src/editor/menu/built-in/bold/props.ts +10 -0
- package/src/editor/menu/built-in/clear-format/clear-format.tsx +28 -0
- package/src/editor/menu/built-in/clear-format/index.ts +3 -0
- package/src/editor/menu/built-in/clear-format/props.ts +10 -0
- package/src/editor/menu/built-in/code/code.tsx +49 -0
- package/src/editor/menu/built-in/code/index.ts +3 -0
- package/src/editor/menu/built-in/code/props.ts +10 -0
- package/src/editor/menu/built-in/code-block/code-block-languages.tsx +73 -0
- package/src/editor/menu/built-in/code-block/code-block.tsx +36 -0
- package/src/editor/menu/built-in/code-block/index.ts +4 -0
- package/src/editor/menu/built-in/code-block/props.ts +32 -0
- package/src/editor/menu/built-in/color/color.tsx +96 -0
- package/src/editor/menu/built-in/color/index.ts +3 -0
- package/src/editor/menu/built-in/color/props.ts +16 -0
- package/src/editor/menu/built-in/color/style.module.less +62 -0
- package/src/editor/menu/built-in/decrease-indent/decrease-indent.tsx +31 -0
- package/src/editor/menu/built-in/decrease-indent/index.ts +3 -0
- package/src/editor/menu/built-in/decrease-indent/props.ts +10 -0
- package/src/editor/menu/built-in/emoji/emoji.tsx +143 -0
- package/src/editor/menu/built-in/emoji/index.ts +3 -0
- package/src/editor/menu/built-in/emoji/props.ts +16 -0
- package/src/editor/menu/built-in/emoji/style.module.less +26 -0
- package/src/editor/menu/built-in/font-family/font-family.tsx +99 -0
- package/src/editor/menu/built-in/font-family/index.ts +3 -0
- package/src/editor/menu/built-in/font-family/props.ts +20 -0
- package/src/editor/menu/built-in/font-size/font-size.tsx +110 -0
- package/src/editor/menu/built-in/font-size/index.ts +3 -0
- package/src/editor/menu/built-in/font-size/props.ts +20 -0
- package/src/editor/menu/built-in/full-screen/full-screen.tsx +66 -0
- package/src/editor/menu/built-in/full-screen/index.ts +3 -0
- package/src/editor/menu/built-in/full-screen/props.ts +18 -0
- package/src/editor/menu/built-in/heading/heading.tsx +101 -0
- package/src/editor/menu/built-in/heading/index.ts +3 -0
- package/src/editor/menu/built-in/heading/props.ts +20 -0
- package/src/editor/menu/built-in/horizontal/horizontal.tsx +40 -0
- package/src/editor/menu/built-in/horizontal/index.ts +3 -0
- package/src/editor/menu/built-in/horizontal/props.ts +10 -0
- package/src/editor/menu/built-in/image/image.tsx +189 -0
- package/src/editor/menu/built-in/image/index.ts +3 -0
- package/src/editor/menu/built-in/image/props.ts +27 -0
- package/src/editor/menu/built-in/image/style.module.less +138 -0
- package/src/editor/menu/built-in/increase-indent/increase-indent.tsx +31 -0
- package/src/editor/menu/built-in/increase-indent/index.ts +3 -0
- package/src/editor/menu/built-in/increase-indent/props.ts +10 -0
- package/src/editor/menu/built-in/index.ts +38 -0
- package/src/editor/menu/built-in/italic/index.ts +3 -0
- package/src/editor/menu/built-in/italic/italic.tsx +45 -0
- package/src/editor/menu/built-in/italic/props.ts +10 -0
- package/src/editor/menu/built-in/line-height/index.ts +3 -0
- package/src/editor/menu/built-in/line-height/line-height.tsx +81 -0
- package/src/editor/menu/built-in/line-height/props.ts +20 -0
- package/src/editor/menu/built-in/link/index.ts +4 -0
- package/src/editor/menu/built-in/link/link-unset.tsx +30 -0
- package/src/editor/menu/built-in/link/link.tsx +147 -0
- package/src/editor/menu/built-in/link/props.ts +23 -0
- package/src/editor/menu/built-in/link/style.module.less +51 -0
- package/src/editor/menu/built-in/math/index.ts +3 -0
- package/src/editor/menu/built-in/math/math.tsx +98 -0
- package/src/editor/menu/built-in/math/props.ts +12 -0
- package/src/editor/menu/built-in/math/style.module.less +54 -0
- package/src/editor/menu/built-in/ordered-list/index.ts +3 -0
- package/src/editor/menu/built-in/ordered-list/ordered-list.tsx +85 -0
- package/src/editor/menu/built-in/ordered-list/props.ts +12 -0
- package/src/editor/menu/built-in/ordered-list/style.module.less +16 -0
- package/src/editor/menu/built-in/redo/index.ts +3 -0
- package/src/editor/menu/built-in/redo/props.ts +6 -0
- package/src/editor/menu/built-in/redo/redo.tsx +30 -0
- package/src/editor/menu/built-in/strikethrough/index.ts +3 -0
- package/src/editor/menu/built-in/strikethrough/props.ts +10 -0
- package/src/editor/menu/built-in/strikethrough/strikethrough.tsx +45 -0
- package/src/editor/menu/built-in/subscript/index.ts +3 -0
- package/src/editor/menu/built-in/subscript/props.ts +10 -0
- package/src/editor/menu/built-in/subscript/subscript.tsx +45 -0
- package/src/editor/menu/built-in/superscript/index.ts +3 -0
- package/src/editor/menu/built-in/superscript/props.ts +10 -0
- package/src/editor/menu/built-in/superscript/superscript.tsx +45 -0
- package/src/editor/menu/built-in/table/index.ts +9 -0
- package/src/editor/menu/built-in/table/props.ts +105 -0
- package/src/editor/menu/built-in/table/style.module.less +63 -0
- package/src/editor/menu/built-in/table/table-add-column.tsx +31 -0
- package/src/editor/menu/built-in/table/table-add-row.tsx +31 -0
- package/src/editor/menu/built-in/table/table-delete-column.tsx +31 -0
- package/src/editor/menu/built-in/table/table-delete-row.tsx +31 -0
- package/src/editor/menu/built-in/table/table-merge-cell.tsx +34 -0
- package/src/editor/menu/built-in/table/table-unset.tsx +31 -0
- package/src/editor/menu/built-in/table/table.tsx +144 -0
- package/src/editor/menu/built-in/task/index.ts +3 -0
- package/src/editor/menu/built-in/task/props.ts +10 -0
- package/src/editor/menu/built-in/task/task.tsx +36 -0
- package/src/editor/menu/built-in/underline/index.ts +3 -0
- package/src/editor/menu/built-in/underline/props.ts +10 -0
- package/src/editor/menu/built-in/underline/underline.tsx +46 -0
- package/src/editor/menu/built-in/undo/index.ts +3 -0
- package/src/editor/menu/built-in/undo/props.ts +6 -0
- package/src/editor/menu/built-in/undo/undo.tsx +31 -0
- package/src/editor/menu/built-in/unordered-list/index.ts +3 -0
- package/src/editor/menu/built-in/unordered-list/props.ts +12 -0
- package/src/editor/menu/built-in/unordered-list/style.module.less +16 -0
- package/src/editor/menu/built-in/unordered-list/unordered-list.tsx +85 -0
- package/src/editor/menu/built-in/video/index.ts +6 -0
- package/src/editor/menu/built-in/video/props.ts +60 -0
- package/src/editor/menu/built-in/video/style.module.less +92 -0
- package/src/editor/menu/built-in/video/video-controls.tsx +44 -0
- package/src/editor/menu/built-in/video/video-loop.tsx +47 -0
- package/src/editor/menu/built-in/video/video-muted.tsx +48 -0
- package/src/editor/menu/built-in/video/video.tsx +138 -0
- package/src/editor/menu/built-in/wrap-down/index.ts +3 -0
- package/src/editor/menu/built-in/wrap-down/props.ts +16 -0
- package/src/editor/menu/built-in/wrap-down/wrap-down.tsx +49 -0
- package/src/editor/menu/built-in/wrap-up/index.ts +3 -0
- package/src/editor/menu/built-in/wrap-up/props.ts +16 -0
- package/src/editor/menu/built-in/wrap-up/wrap-up.tsx +52 -0
- package/src/editor/menu/index.ts +4 -0
- package/src/editor/menu/menu.tsx +176 -0
- package/src/editor/menu/props.ts +90 -0
- package/src/editor/menu/style.module.less +80 -0
- package/src/editor/wrapper/index.ts +3 -0
- package/src/editor/wrapper/props.ts +209 -0
- package/src/editor/wrapper/render.ts +79 -0
- package/src/editor/wrapper/style.module.less +10 -0
- package/src/editor/wrapper/wrapper.tsx +220 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/use-editor.ts +47 -0
- package/src/iconfont/iconfont.css +247 -0
- package/src/iconfont/iconfont.ttf +0 -0
- package/src/iconfont/iconfont.woff +0 -0
- package/src/index.ts +20 -0
- package/src/locale/en-us.ts +30 -0
- package/src/locale/index.ts +18 -0
- package/src/locale/ja-jp.ts +30 -0
- package/src/locale/ko-kr.ts +30 -0
- package/src/var.less +19 -0
- package/tsconfig.json +32 -0
- package/tsconfig.node.json +11 -0
- package/vite-env.d.ts +5 -0
- package/vite.config.ts +58 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: underline 下划线
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# underline 下划线
|
|
6
|
+
|
|
7
|
+
设置/取消文本下划线
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, UnderlineMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<UnderlineMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
28
|
+
|
|
29
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: undo 撤销
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# undo 撤销
|
|
6
|
+
|
|
7
|
+
执行撤销操作
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, UndoMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<UndoMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: unordered-list 无序列表
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# unordered-list 无序列表
|
|
6
|
+
|
|
7
|
+
插入无序列表
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, UnorderedListMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<UnorderedListMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### popoverProps <Badge type="danger" text="Omit<NonNullable<MenuPropsType['popoverProps']>, 'onShow' | 'onShowing' | 'onShown' | 'onHide' | 'onHiding' | 'onHidden'>" />
|
|
28
|
+
|
|
29
|
+
浮层属性配置,参考 `Menu` 的 `popoverProps` 属性
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: video-controls 视频显示器控制
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# video-controls 视频显示器控制
|
|
6
|
+
|
|
7
|
+
设置/取消视频的显示器
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, VideoControlsMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<VideoControlsMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
28
|
+
|
|
29
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: video-loop 视频循环控制
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# video-loop 视频循环控制
|
|
6
|
+
|
|
7
|
+
设置/取消视频的循环
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, VideoLoopMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<VideoLoopMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
28
|
+
|
|
29
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: video-muted 视频静音控制
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# video-muted 视频静音控制
|
|
6
|
+
|
|
7
|
+
设置/取消视频的静音
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, VideoMutedMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<VideoMutedMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
28
|
+
|
|
29
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: video 视频
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# video 视频
|
|
6
|
+
|
|
7
|
+
插入视频
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, VideoMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<VideoMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### tabs <Badge type="danger" text="{ data: ('remote' | 'upload')[]; default: 'remote' | 'upload'}" />
|
|
28
|
+
|
|
29
|
+
配置浮层内的选项卡,目前支持 `upload`(本地上传)和 `remote`(远程视频),`data` 表示选项卡的数据,`default` 表示默认展示的选项卡
|
|
30
|
+
|
|
31
|
+
##### popoverProps <Badge type="danger" text="Omit<NonNullable<MenuPropsType['popoverProps']>, 'onShow' | 'onShowing' | 'onShown' | 'onHide' | 'onHiding' | 'onHidden'>" />
|
|
32
|
+
|
|
33
|
+
浮层属性配置,参考 `Menu` 的 `popoverProps` 属性
|
|
34
|
+
|
|
35
|
+
##### width <Badge type="danger" text="string | number" />
|
|
36
|
+
|
|
37
|
+
初始视频宽度
|
|
38
|
+
|
|
39
|
+
##### customUpload <Badge type="danger" text="(file: File) => string | Promise<string>" />
|
|
40
|
+
|
|
41
|
+
自定义本地视频上传的方法,该方法返回一个字符串值,表示上传后的视频文件地址,回调参数为 `File` 文件,如果不设置该方法,视频默认以 `base64` 字符串的形式插入编辑器中
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: wrap-down 向下换行
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# wrap-down 向下换行
|
|
6
|
+
|
|
7
|
+
在匹配的节点位置向下换行
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, WrapDownMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<WrapDownMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### match <Badge type="danger" text="KNodeMatchOptionType" />
|
|
28
|
+
|
|
29
|
+
匹配相关的节点,如果匹配上了,则会在点击菜单时向下换行,关于该属性的释义,同 [kaitify 中的 Editor 的 getMatchNodeBySelection 方法中的入参](https://www.so-better.cn/docs/kaitify-core/apis/editor-function#getmatchnodebyselection)
|
|
30
|
+
|
|
31
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
32
|
+
|
|
33
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: wrap-up 向上换行
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# wrap-up 向上换行
|
|
6
|
+
|
|
7
|
+
在匹配的节点位置向上换行
|
|
8
|
+
|
|
9
|
+
## 使用方法
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Wrapper, WrapUpMenu } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
17
|
+
return <Wrapper value={content} onChange={v => setContent(v)} before={<WrapUpMenu />}></Wrapper>
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Props 参数
|
|
22
|
+
|
|
23
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
24
|
+
|
|
25
|
+
是否禁用该菜单,默认为 `false`
|
|
26
|
+
|
|
27
|
+
##### match <Badge type="danger" text="KNodeMatchOptionType" />
|
|
28
|
+
|
|
29
|
+
匹配相关的节点,如果匹配上了,则会在点击菜单时向上换行,关于该属性的释义,同 [kaitify 中的 Editor 的 getMatchNodeBySelection 方法中的入参](https://www.so-better.cn/docs/kaitify-core/apis/editor-function#getmatchnodebyselection)
|
|
30
|
+
|
|
31
|
+
##### shortcut <Badge type="danger" text="(e: KeyboardEvent) => boolean" />
|
|
32
|
+
|
|
33
|
+
菜单快捷键实现,继承自 `Menu` 组件的同名属性,具体使用可参考 [Menu 组件的 shortcut](/guide/menu#shortcut)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 简介
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 简介
|
|
6
|
+
|
|
7
|
+
## 基本介绍
|
|
8
|
+
|
|
9
|
+
内置菜单是 `kaitify-react` 内部使用 `Menu` 组件封装的一系列具有实际操作功能的菜单组件,每一个内置菜单的操作都是已经实现完成的了
|
|
10
|
+
|
|
11
|
+
内置菜单已经定义好了菜单各种情况下的状态,无需我们去关心什么时候该禁用、什么时候该激活,你可以直接拿来使用
|
|
12
|
+
|
|
13
|
+
除此之外,这些菜单也会提供一些参数让你可以进行灵活配置
|
|
14
|
+
|
|
15
|
+
## 使用示例
|
|
16
|
+
|
|
17
|
+
以加粗菜单为例:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
import { useState } from 'react'
|
|
21
|
+
import { Wrapper, BoldMenu } from '@kaitify/react'
|
|
22
|
+
|
|
23
|
+
export default function App() {
|
|
24
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
25
|
+
return <Wrapper value={content} onChange={v => setContent(v)} placeholder='输入正文内容...' before={<BoldMenu />}></Wrapper>
|
|
26
|
+
}
|
|
27
|
+
```
|
package/examples/App.tsx
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { useMemo, useState } from 'react'
|
|
2
|
+
import { Wrapper as EditorWrapper, BoldMenu, AlignLeftMenu, AlignCenterMenu, AlignRightMenu, AlignJustifyMenu, AttachmentMenu, BackColorMenu, BlockquoteMenu, CodeMenu, CodeBlockMenu, ColorMenu, FontFamilyMenu, FontSizeMenu, HeadingMenu, RedoMenu, UndoMenu, HorizontalMenu, ImageMenu, IncreaseIndentMenu, DecreaseIndentMenu, ItalicMenu, LineHeightMenu, LinkMenu, OrderedListMenu, UnorderedListMenu, MathMenu, StrikethroughMenu, SubscriptMenu, SuperscriptMenu, TableMenu, UnderlineMenu, VideoMenu, TaskMenu, ClearFormatMenu, Divider, FullScreenMenu, EmojiMenu, Editor, StateType, KNodeMatchOptionType, Bubble, VideoControlsMenu, VideoMutedMenu, VideoLoopMenu, WrapUpMenu, CodeBlockLanguagesMenu, WrapDownMenu, LinkUnsetMenu, TableAddRowMenu, TableDeleteRowMenu, TableAddColumnMenu, TableDeleteColumnMenu, TableMergeCellMenu, TableUnsetMenu } from '../src/index'
|
|
3
|
+
import './style.less'
|
|
4
|
+
|
|
5
|
+
export default function App() {
|
|
6
|
+
const [content, setContent] = useState(
|
|
7
|
+
'<p kaitify-node="91"><span kaitify-node="92" style="font-weight: bold; font-size: 18px;">Publications</span></p ><p kaitify-node="93" style="line-height: 2.5;"><span kaitify-node="94" style="font-size: 14px; font-weight: bold;">Lastest metaRLK article</span><span kaitify-node="95"> </span></p ><p kaitify-node="96" style="line-height: 2;"><span kaitify-node="98">Curation, nomenclature, and topological classification of receptor like kinases from 528 plant species for novel domain discovery and functional inference[J]. Molecular Plant, 2024, 17(4): 658-671. </span></p><p kaitify-node="91"><span kaitify-node="92" style="font-weight: bold; font-size: 18px;">Publications</span></p ><p kaitify-node="93" style="line-height: 2.5;"><span kaitify-node="94" style="font-size: 14px; font-weight: bold;">Lastest metaRLK article</span><span kaitify-node="95"> </span></p ><p kaitify-node="96" style="line-height: 2;"><span kaitify-node="98">Curation, nomenclature, and topological classification of receptor like kinases from 528 plant species for novel domain discovery and functional inference[J]. Molecular Plant, 2024, 17(4): 658-671. </span></p>'
|
|
8
|
+
)
|
|
9
|
+
const [show, setShow] = useState(true)
|
|
10
|
+
const [dark, setDark] = useState(false)
|
|
11
|
+
const [disabled] = useState(false)
|
|
12
|
+
const [state, setState] = useState<StateType | undefined>(undefined)
|
|
13
|
+
|
|
14
|
+
const shouldBubble = useMemo<{ visible: boolean; match?: KNodeMatchOptionType; type?: number }>(() => {
|
|
15
|
+
if (!!state?.editor.value?.commands.getVideo?.()) {
|
|
16
|
+
return { visible: true, match: { tag: 'video' }, type: 0 }
|
|
17
|
+
}
|
|
18
|
+
if (!!state?.editor.value?.commands.getCodeBlock?.()) {
|
|
19
|
+
return { visible: true, match: { tag: 'pre' }, type: 1 }
|
|
20
|
+
}
|
|
21
|
+
if (!!state?.editor.value?.getFocusNodesBySelection('text').length) {
|
|
22
|
+
return { visible: true, match: undefined, type: 2 }
|
|
23
|
+
}
|
|
24
|
+
if (!!state?.editor.value?.commands.getLink?.()) {
|
|
25
|
+
return { visible: true, match: { tag: 'a' }, type: 3 }
|
|
26
|
+
}
|
|
27
|
+
if (!!state?.editor.value?.commands.getTable?.()) {
|
|
28
|
+
return { visible: true, match: { tag: 'table' }, type: 4 }
|
|
29
|
+
}
|
|
30
|
+
return { visible: false }
|
|
31
|
+
}, [state?.editor])
|
|
32
|
+
|
|
33
|
+
const onCreated = async (editor: Editor) => {
|
|
34
|
+
console.log(editor.selection)
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
<>
|
|
39
|
+
<div style={{ padding: 10 }}>
|
|
40
|
+
<div style={{ padding: 5 }}>
|
|
41
|
+
<button onClick={() => setDark(!dark)}>深色/浅色主题</button>
|
|
42
|
+
<button onClick={() => setShow(!show)}>显示/隐藏编辑器</button>
|
|
43
|
+
<button
|
|
44
|
+
onClick={() => {
|
|
45
|
+
console.log(state?.editor.value?.getHTML())
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
获取HTML
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
<div id='area'>
|
|
52
|
+
<div id='before' style={{ display: 'flex', justifyContent: 'flex-start', alignItems: 'center', flexWrap: 'wrap', height: 100, background: dark ? '#1b1b1f' : '#fff' }}></div>
|
|
53
|
+
{show && (
|
|
54
|
+
<EditorWrapper
|
|
55
|
+
autofocus
|
|
56
|
+
ref={v => setState(v?.state)}
|
|
57
|
+
locale='zh-CN'
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
dark={dark}
|
|
60
|
+
style={{ width: '100%', height: 500 }}
|
|
61
|
+
allow-paste-html
|
|
62
|
+
placeholder='输入正文内容...'
|
|
63
|
+
value={content}
|
|
64
|
+
onChange={setContent}
|
|
65
|
+
onCreated={onCreated}
|
|
66
|
+
appendBeforeTo={'#before'}
|
|
67
|
+
before={
|
|
68
|
+
<>
|
|
69
|
+
<UndoMenu />
|
|
70
|
+
<RedoMenu />
|
|
71
|
+
<Divider />
|
|
72
|
+
<EmojiMenu />
|
|
73
|
+
<DecreaseIndentMenu />
|
|
74
|
+
<IncreaseIndentMenu />
|
|
75
|
+
<Divider />
|
|
76
|
+
<ClearFormatMenu />
|
|
77
|
+
<BoldMenu />
|
|
78
|
+
<ItalicMenu />
|
|
79
|
+
<StrikethroughMenu />
|
|
80
|
+
<SubscriptMenu />
|
|
81
|
+
<SuperscriptMenu />
|
|
82
|
+
<UnderlineMenu />
|
|
83
|
+
<CodeMenu />
|
|
84
|
+
<Divider />
|
|
85
|
+
<ColorMenu />
|
|
86
|
+
<BackColorMenu />
|
|
87
|
+
<FontFamilyMenu />
|
|
88
|
+
<FontSizeMenu />
|
|
89
|
+
<Divider />
|
|
90
|
+
<HeadingMenu popoverProps={{ trigger: 'hover' }} shortcut={{ 1: (e: KeyboardEvent) => e.key == '1' && e.metaKey }} />
|
|
91
|
+
<LineHeightMenu />
|
|
92
|
+
<OrderedListMenu />
|
|
93
|
+
<UnorderedListMenu />
|
|
94
|
+
<TaskMenu />
|
|
95
|
+
<Divider />
|
|
96
|
+
<AlignLeftMenu />
|
|
97
|
+
<AlignCenterMenu shortcut={e => e.key == 'b' && e.metaKey} />
|
|
98
|
+
<AlignRightMenu />
|
|
99
|
+
<AlignJustifyMenu />
|
|
100
|
+
<Divider />
|
|
101
|
+
<BlockquoteMenu />
|
|
102
|
+
<CodeBlockMenu />
|
|
103
|
+
<HorizontalMenu />
|
|
104
|
+
<LinkMenu />
|
|
105
|
+
<AttachmentMenu popoverProps={{ zIndex: 100, arrow: true }} />
|
|
106
|
+
<ImageMenu tabs={{ data: ['remote', 'upload'], default: 'upload' }} />
|
|
107
|
+
<VideoMenu tabs={{ data: ['remote', 'upload'], default: 'upload' }} popoverProps={{ zIndex: 100, arrow: true }} />
|
|
108
|
+
<MathMenu />
|
|
109
|
+
<TableMenu />
|
|
110
|
+
<FullScreenMenu target='#area' zIndex={2} />
|
|
111
|
+
</>
|
|
112
|
+
}
|
|
113
|
+
after={<>总字数:{state?.editor.value?.getContent().length ?? 0}</>}
|
|
114
|
+
>
|
|
115
|
+
<Bubble visible={shouldBubble.visible} match={shouldBubble.match} style={{ padding: 5 }}>
|
|
116
|
+
{shouldBubble.type === 0 && (
|
|
117
|
+
<>
|
|
118
|
+
<VideoControlsMenu />
|
|
119
|
+
<VideoMutedMenu />
|
|
120
|
+
<VideoLoopMenu />
|
|
121
|
+
</>
|
|
122
|
+
)}
|
|
123
|
+
{shouldBubble.type === 1 && (
|
|
124
|
+
<>
|
|
125
|
+
<WrapUpMenu match={{ tag: 'pre' }} />
|
|
126
|
+
<Divider />
|
|
127
|
+
<CodeBlockLanguagesMenu />
|
|
128
|
+
<Divider />
|
|
129
|
+
<WrapDownMenu match={{ tag: 'pre' }} />
|
|
130
|
+
</>
|
|
131
|
+
)}
|
|
132
|
+
{shouldBubble.type === 2 && (
|
|
133
|
+
<>
|
|
134
|
+
<ClearFormatMenu />
|
|
135
|
+
<EmojiMenu />
|
|
136
|
+
<BoldMenu />
|
|
137
|
+
<ItalicMenu />
|
|
138
|
+
<StrikethroughMenu />
|
|
139
|
+
<SubscriptMenu />
|
|
140
|
+
<SuperscriptMenu />
|
|
141
|
+
<UnderlineMenu />
|
|
142
|
+
<Divider />
|
|
143
|
+
<ColorMenu />
|
|
144
|
+
<BackColorMenu />
|
|
145
|
+
<CodeMenu />
|
|
146
|
+
<FontFamilyMenu />
|
|
147
|
+
<FontSizeMenu />
|
|
148
|
+
</>
|
|
149
|
+
)}
|
|
150
|
+
{shouldBubble.type === 3 && <LinkUnsetMenu />}
|
|
151
|
+
{shouldBubble.type === 4 && (
|
|
152
|
+
<>
|
|
153
|
+
<WrapUpMenu match={{ tag: 'table' }} />
|
|
154
|
+
<Divider />
|
|
155
|
+
<TableAddRowMenu type='top' />
|
|
156
|
+
<TableAddRowMenu type='bottom' />
|
|
157
|
+
<TableDeleteRowMenu />
|
|
158
|
+
<TableAddColumnMenu type='left' />
|
|
159
|
+
<TableAddColumnMenu type='right' />
|
|
160
|
+
<TableDeleteColumnMenu />
|
|
161
|
+
<Divider />
|
|
162
|
+
<TableMergeCellMenu direction='left' />
|
|
163
|
+
<TableMergeCellMenu direction='right' />
|
|
164
|
+
<TableMergeCellMenu direction='top' />
|
|
165
|
+
<TableMergeCellMenu direction='bottom' />
|
|
166
|
+
<Divider />
|
|
167
|
+
<TableUnsetMenu />
|
|
168
|
+
<Divider />
|
|
169
|
+
<WrapDownMenu match={{ tag: 'table' }} />
|
|
170
|
+
</>
|
|
171
|
+
)}
|
|
172
|
+
</Bubble>
|
|
173
|
+
</EditorWrapper>
|
|
174
|
+
)}
|
|
175
|
+
</div>
|
|
176
|
+
</div>
|
|
177
|
+
</>
|
|
178
|
+
)
|
|
179
|
+
}
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="https://www.so-better.cn/docs/kaitify-core/logo.png" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>基于@kaitify/core开发的react富文本编辑器核心库</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/examples/main.tsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CSSProperties, ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* 按钮组件的属性类型
|
|
4
|
+
*/
|
|
5
|
+
export type ButtonPropsType = {
|
|
6
|
+
/**
|
|
7
|
+
* 是否禁用
|
|
8
|
+
*/
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
/**
|
|
11
|
+
* 是否激活
|
|
12
|
+
*/
|
|
13
|
+
active?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* 是否块级展示
|
|
16
|
+
*/
|
|
17
|
+
block?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* 是否更大的按钮
|
|
20
|
+
*/
|
|
21
|
+
large?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* 默认插槽
|
|
24
|
+
*/
|
|
25
|
+
children?: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* 样式
|
|
28
|
+
*/
|
|
29
|
+
style?: CSSProperties;
|
|
30
|
+
/**
|
|
31
|
+
* 样式类
|
|
32
|
+
*/
|
|
33
|
+
className?: string;
|
|
34
|
+
/**
|
|
35
|
+
* 点击
|
|
36
|
+
*/
|
|
37
|
+
onClick?: React.MouseEventHandler<HTMLButtonElement>;
|
|
38
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 复选框组件属性类型
|
|
3
|
+
*/
|
|
4
|
+
export type CheckboxPropsType = {
|
|
5
|
+
/**
|
|
6
|
+
* 是否选中
|
|
7
|
+
*/
|
|
8
|
+
checked?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* 复选框选择事件
|
|
11
|
+
*/
|
|
12
|
+
onChange?: (checked: boolean) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 是否禁用
|
|
15
|
+
*/
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* label文字
|
|
19
|
+
*/
|
|
20
|
+
label?: string;
|
|
21
|
+
};
|