@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,185 @@
|
|
|
1
|
+
import { defineConfig } from 'vitepress'
|
|
2
|
+
import path from 'path'
|
|
3
|
+
import fs from 'fs'
|
|
4
|
+
|
|
5
|
+
const getMenuList = () => {
|
|
6
|
+
const items = fs.readdirSync(path.resolve(__dirname, '../../src/editor/menu/built-in'))
|
|
7
|
+
const folderNames: string[] = []
|
|
8
|
+
for (const item of items) {
|
|
9
|
+
const itemPath = path.join(path.resolve(__dirname, '../../src/editor/menu/built-in'), item)
|
|
10
|
+
const stats = fs.statSync(itemPath)
|
|
11
|
+
if (stats.isDirectory()) {
|
|
12
|
+
folderNames.push(item)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
const menuNames: string[] = []
|
|
16
|
+
folderNames.forEach(item => {
|
|
17
|
+
const list = fs.readdirSync(path.resolve(__dirname, `../../src/editor/menu/built-in/${item}`))
|
|
18
|
+
for (const el of list) {
|
|
19
|
+
if (el.endsWith('.tsx')) {
|
|
20
|
+
const lastIndex = el.lastIndexOf('.tsx')
|
|
21
|
+
const name = el.substring(0, lastIndex)
|
|
22
|
+
menuNames.push(name)
|
|
23
|
+
//创建内置菜单的md文件
|
|
24
|
+
const docPath = path.join(path.resolve(__dirname, '../../docs/menus/built-in'), `${name}.md`)
|
|
25
|
+
if (!fs.existsSync(docPath)) {
|
|
26
|
+
fs.writeFileSync(docPath, '', { encoding: 'utf-8' })
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
})
|
|
31
|
+
return menuNames
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
base: '/docs/kaitify-react/',
|
|
36
|
+
title: 'kaitify-react',
|
|
37
|
+
description: '一个基于@kaitify/core开发的react富文本编辑器核心库',
|
|
38
|
+
lastUpdated: true,
|
|
39
|
+
cleanUrls: true,
|
|
40
|
+
head: [
|
|
41
|
+
['link', { rel: 'icon', type: 'image/png', href: 'https://www.so-better.cn/docs/kaitify-core/logo.png' }],
|
|
42
|
+
['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no' }]
|
|
43
|
+
],
|
|
44
|
+
outDir: 'kaitify-react',
|
|
45
|
+
themeConfig: {
|
|
46
|
+
logo: {
|
|
47
|
+
src: 'https://www.so-better.cn/docs/kaitify-core/logo.png'
|
|
48
|
+
},
|
|
49
|
+
outline: {
|
|
50
|
+
label: '本页目录',
|
|
51
|
+
level: [2, 5]
|
|
52
|
+
},
|
|
53
|
+
nav: [
|
|
54
|
+
{ text: '指南', link: '/guide/introduction', activeMatch: '/guide' },
|
|
55
|
+
{ text: '内置菜单', link: '/menus/introduction', activeMatch: '/menus' },
|
|
56
|
+
{
|
|
57
|
+
text: '在线体验',
|
|
58
|
+
link: 'https://www.so-better.cn/run?lib=kaitify-react',
|
|
59
|
+
target: '_blank'
|
|
60
|
+
},
|
|
61
|
+
{ text: '更新日志', link: '/changelog' }
|
|
62
|
+
],
|
|
63
|
+
sidebar: {
|
|
64
|
+
'/guide': [
|
|
65
|
+
{
|
|
66
|
+
text: '开始使用',
|
|
67
|
+
items: [
|
|
68
|
+
{
|
|
69
|
+
text: '简介',
|
|
70
|
+
link: '/guide/introduction'
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
text: '安装',
|
|
74
|
+
link: '/guide/install'
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
text: '快速上手',
|
|
78
|
+
link: '/guide/quick-start'
|
|
79
|
+
}
|
|
80
|
+
]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
text: '组件',
|
|
84
|
+
items: [
|
|
85
|
+
{
|
|
86
|
+
text: 'Wrapper',
|
|
87
|
+
link: '/guide/wrapper'
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
text: 'Bubble',
|
|
91
|
+
link: '/guide/bubble'
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
text: 'Menu',
|
|
95
|
+
link: '/guide/menu'
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
text: 'Divider',
|
|
99
|
+
link: '/guide/divider'
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
text: 'Tabs',
|
|
103
|
+
link: '/guide/tabs'
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
text: 'Checkbox',
|
|
107
|
+
link: '/guide/checkbox'
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
text: 'Icon',
|
|
111
|
+
link: '/guide/icon'
|
|
112
|
+
}
|
|
113
|
+
]
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
text: '其他',
|
|
117
|
+
items: [
|
|
118
|
+
{
|
|
119
|
+
text: '菜单快捷键',
|
|
120
|
+
link: '/guide/shortcut'
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
text: '国际化支持',
|
|
124
|
+
link: '/guide/locale'
|
|
125
|
+
}
|
|
126
|
+
]
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
'/menus': [
|
|
130
|
+
{
|
|
131
|
+
text: '开始使用',
|
|
132
|
+
items: [
|
|
133
|
+
{
|
|
134
|
+
text: '简介',
|
|
135
|
+
link: '/menus/introduction'
|
|
136
|
+
}
|
|
137
|
+
]
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
text: '内置菜单',
|
|
141
|
+
items: getMenuList().map(name => {
|
|
142
|
+
return {
|
|
143
|
+
text: name,
|
|
144
|
+
link: `/menus/built-in/${name}`
|
|
145
|
+
}
|
|
146
|
+
})
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
},
|
|
150
|
+
socialLinks: [
|
|
151
|
+
{ icon: 'npm', link: 'https://www.npmjs.com/package/@kaitify/react' },
|
|
152
|
+
{ icon: 'gitee', link: 'https://gitee.com/so-better/kaitify-react' },
|
|
153
|
+
{ icon: 'github', link: 'https://github.com/so-better/kaitify-react' }
|
|
154
|
+
],
|
|
155
|
+
search: { provider: 'local' },
|
|
156
|
+
lastUpdated: {
|
|
157
|
+
text: '上次更新'
|
|
158
|
+
},
|
|
159
|
+
docFooter: {
|
|
160
|
+
prev: 'Prev',
|
|
161
|
+
next: 'Next'
|
|
162
|
+
},
|
|
163
|
+
darkModeSwitchTitle: '切换到深色模式',
|
|
164
|
+
lightModeSwitchTitle: '切换到浅色模式',
|
|
165
|
+
darkModeSwitchLabel: '主题风格切换',
|
|
166
|
+
sidebarMenuLabel: '菜单目录',
|
|
167
|
+
returnToTopLabel: '返回顶部',
|
|
168
|
+
externalLinkIcon: true
|
|
169
|
+
},
|
|
170
|
+
markdown: {
|
|
171
|
+
image: {
|
|
172
|
+
lazyLoading: true
|
|
173
|
+
},
|
|
174
|
+
theme: {
|
|
175
|
+
dark: 'github-dark',
|
|
176
|
+
light: 'github-light'
|
|
177
|
+
},
|
|
178
|
+
codeCopyButtonTitle: '复制代码'
|
|
179
|
+
},
|
|
180
|
+
vite: {
|
|
181
|
+
server: {
|
|
182
|
+
port: 5401
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
})
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--vp-home-hero-name-background: linear-gradient(120deg, #8b1bbf 20%, #308af3);
|
|
3
|
+
--vp-home-hero-name-color: transparent;
|
|
4
|
+
--vp-c-indigo-1: #1269cd;
|
|
5
|
+
--vp-c-indigo-2: #1e79e1;
|
|
6
|
+
--vp-c-indigo-3: #308af3;
|
|
7
|
+
|
|
8
|
+
--vp-code-block-bg: #f7f8fa;
|
|
9
|
+
|
|
10
|
+
h5 > .VPBadge.danger {
|
|
11
|
+
font-family: var(--vp-font-family-mono);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&.dark {
|
|
15
|
+
--vp-code-block-bg: #1f1f22;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Bubble 气泡栏
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Bubble 气泡栏
|
|
6
|
+
|
|
7
|
+
`Bubble` 组件是 `kaitify-react` 的内置组件,必须放置在 `Wrapper` 组件的 `children` 中
|
|
8
|
+
|
|
9
|
+
## Props 参数
|
|
10
|
+
|
|
11
|
+
##### visible <Badge type="danger" text="boolean" />
|
|
12
|
+
|
|
13
|
+
是否显示气泡栏,默认为 `false`
|
|
14
|
+
|
|
15
|
+
##### match <Badge type="danger" text="KNodeMatchOptionType" />
|
|
16
|
+
|
|
17
|
+
指定气泡栏出现的位置条件,每次更新气泡位置时会判断光标是否在符合条件的节点下,如果符合则根据该节点的真实 `dom` 进行定位,否则只根据光标位置进行定位
|
|
18
|
+
|
|
19
|
+
关于该属性的释义,同 [kaitify 中的 Editor 的 getMatchNodeBySelection 方法中的入参](https://www.so-better.cn/docs/kaitify-core/apis/editor-function#getmatchnodebyselection)
|
|
20
|
+
|
|
21
|
+
##### hideOnMousedown <Badge type="danger" text="boolean" />
|
|
22
|
+
|
|
23
|
+
鼠标在编辑器内按下时是否隐藏气泡栏,默认为 `false`,如果该值为 `true`,在鼠标按下时即使 `visible` 属性是 `true`,也无法显示气泡栏
|
|
24
|
+
|
|
25
|
+
##### children <Badge type="danger" text="ReactNode" />
|
|
26
|
+
|
|
27
|
+
气泡栏的子组件
|
|
28
|
+
|
|
29
|
+
##### style <Badge type="danger" text="CSSProperties" />
|
|
30
|
+
|
|
31
|
+
气泡栏的样式
|
|
32
|
+
|
|
33
|
+
##### className <Badge type="danger" text="string" />
|
|
34
|
+
|
|
35
|
+
气泡栏的样式类
|
|
36
|
+
|
|
37
|
+
##### onShow <Badge type="danger" text="(el: Element) => void" />
|
|
38
|
+
|
|
39
|
+
气泡栏显示前触发的事件
|
|
40
|
+
|
|
41
|
+
##### onShowing <Badge type="danger" text="(el: Element) => void" />
|
|
42
|
+
|
|
43
|
+
气泡栏显示时触发的事件
|
|
44
|
+
|
|
45
|
+
##### onShown <Badge type="danger" text="(el: Element) => void" />
|
|
46
|
+
|
|
47
|
+
气泡栏显示后触发的事件
|
|
48
|
+
|
|
49
|
+
##### onHide <Badge type="danger" text="(el: Element) => void" />
|
|
50
|
+
|
|
51
|
+
气泡栏隐藏前触发的事件
|
|
52
|
+
|
|
53
|
+
##### onHiding <Badge type="danger" text="(el: Element) => void" />
|
|
54
|
+
|
|
55
|
+
气泡栏隐藏时触发的事件
|
|
56
|
+
|
|
57
|
+
##### onHidden <Badge type="danger" text="(el: Element) => void" />
|
|
58
|
+
|
|
59
|
+
气泡栏隐藏后触发的事件
|
|
60
|
+
|
|
61
|
+
## API 组件属性/方法
|
|
62
|
+
|
|
63
|
+
`Bubble` 提供了部分属性/方法可以通过组件实例来调用
|
|
64
|
+
|
|
65
|
+
##### elRef <Badge type="danger" text="React.MutableRefObject<HTMLDivElement | null>" />
|
|
66
|
+
|
|
67
|
+
获取组件实例即气泡栏的 `dom` 元素
|
|
68
|
+
|
|
69
|
+
##### popperInstance <Badge type="danger" text="React.MutableRefObject<Instance | null>" />
|
|
70
|
+
|
|
71
|
+
`popperjs` 创建的浮层实例对象
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Checkbox 复选框
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Checkbox 复选框
|
|
6
|
+
|
|
7
|
+
`Checkbox` 组件是 `kaitify-react` 的一个 `UI` 组件,该组件与编辑器具体的功能无关,它一般用于带浮层的菜单中,用来进行勾选
|
|
8
|
+
|
|
9
|
+
## 基本使用
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { useState } from 'react'
|
|
13
|
+
import { Checkbox } from '@kaitify/react'
|
|
14
|
+
|
|
15
|
+
export default function App() {
|
|
16
|
+
const [checked, setChecked] = useState(false)
|
|
17
|
+
|
|
18
|
+
return <Checkbox label='我是复选框' checked={checked} onChange={setChecked} />
|
|
19
|
+
}
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Props 参数
|
|
23
|
+
|
|
24
|
+
##### checked <Badge type="danger" text="boolean" />
|
|
25
|
+
|
|
26
|
+
复选框的值
|
|
27
|
+
|
|
28
|
+
##### onChange <Badge type="danger" text="(checked: boolean) => void" />
|
|
29
|
+
|
|
30
|
+
复选框选择事件
|
|
31
|
+
|
|
32
|
+
##### disabled <Badge type="danger" text="boolean" />
|
|
33
|
+
|
|
34
|
+
复选框是否禁用
|
|
35
|
+
|
|
36
|
+
##### label <Badge type="danger" text="string" />
|
|
37
|
+
|
|
38
|
+
复选框右侧显示的文字内容
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Divider 菜单分隔线
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Divider 菜单分隔线
|
|
6
|
+
|
|
7
|
+
`Divider` 组件是 `kaitify-react` 的一个 `UI` 组件,该组件与编辑器具体的功能无关,它仅仅是为了排列多个 `Menu` 组件时,能够更好的为 `Menu` 组件划区
|
|
8
|
+
|
|
9
|
+
因此,`Divider` 组件是放置在 `Menu` 组件之间的
|
|
10
|
+
|
|
11
|
+
## 基本使用
|
|
12
|
+
|
|
13
|
+
```tsx
|
|
14
|
+
import { useState } from 'react'
|
|
15
|
+
import { Wrapper, Menu, Divider } from '@kaitify/react'
|
|
16
|
+
|
|
17
|
+
export default function App() {
|
|
18
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
19
|
+
return (
|
|
20
|
+
<Wrapper
|
|
21
|
+
value={content}
|
|
22
|
+
onChange={v => setContent(v)}
|
|
23
|
+
placeholder='输入正文内容...'
|
|
24
|
+
before={
|
|
25
|
+
<>
|
|
26
|
+
<Menu>菜单1</Menu>
|
|
27
|
+
<Menu>菜单2</Menu>
|
|
28
|
+
<Menu>菜单3</Menu>
|
|
29
|
+
<Divider />
|
|
30
|
+
<Menu>菜单4</Menu>
|
|
31
|
+
<Menu>菜单5</Menu>
|
|
32
|
+
<Menu>菜单6</Menu>
|
|
33
|
+
<Divider />
|
|
34
|
+
<Menu>菜单7</Menu>
|
|
35
|
+
<Menu>菜单8</Menu>
|
|
36
|
+
</>
|
|
37
|
+
}
|
|
38
|
+
></Wrapper>
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
```
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Icon 图标
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Icon 图标
|
|
6
|
+
|
|
7
|
+
`Icon` 组件是 `kaitify-react` 的一个 `UI` 组件,通过该组件你可以在你想要的地方展示不同的图标
|
|
8
|
+
|
|
9
|
+
## 基本使用
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Icon } from '@kaitify/react'
|
|
13
|
+
export default function App() {
|
|
14
|
+
return <Icon name='solar:home-bold-duotone' />
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Props 参数
|
|
19
|
+
|
|
20
|
+
##### name <Badge type="danger" text="string" />
|
|
21
|
+
|
|
22
|
+
图标的值,目前仅支持 `kaitify` 内置图标(暂不对外提供具体的使用)和 `@iconify/react` 图标,可在[https://icon-sets.iconify.design/](https://icon-sets.iconify.design/)上查找你想用的图标并复制其 `name` 使用
|
|
23
|
+
|
|
24
|
+
##### size <Badge type="danger" text="string | number" />
|
|
25
|
+
|
|
26
|
+
图标的大小,如果是数字默认单位为 `px`,默认图标大小为父元素的字体大小
|
|
27
|
+
|
|
28
|
+
##### style <Badge type="danger" text="CSSProperties" />
|
|
29
|
+
|
|
30
|
+
图标的额外样式
|
|
31
|
+
|
|
32
|
+
##### className <Badge type="danger" text="string" />
|
|
33
|
+
|
|
34
|
+
图标的样式类
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 安装
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 安装
|
|
6
|
+
|
|
7
|
+
## 下载 kaitify-react 本地到使用
|
|
8
|
+
|
|
9
|
+
- 下载地址:[kaitify-react](https://registry.npmmirror.com/@kaitify/react/download/@kaitify/react-0.0.1-beta.1.tgz)
|
|
10
|
+
- 下载完成后最终解压得到一个 package 文件夹,进入 package 文件夹后,将 package 目录下的整个 lib 目录拷贝到你的项目下
|
|
11
|
+
- 在 html 页面中引入 js
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<!-- 使用全局构建版本 -->
|
|
15
|
+
<script src="lib/kaitify-react.umd.js" type="text/javascript"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```html
|
|
19
|
+
<!-- 使用es模块构建版本 -->
|
|
20
|
+
<script type="module">
|
|
21
|
+
import { Wrapper } from 'lib/kaitify-react.es.js'
|
|
22
|
+
</script>
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 通过 CDN 使用 kaitify-react
|
|
26
|
+
|
|
27
|
+
你可以借助 `script` 标签直接通过 CDN 来使用 `kaitify-react`
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<!-- 引入固定版本的kaitify -->
|
|
31
|
+
<script src="https://unpkg.com/@kaitify/react@0.0.1-beta.1/lib/kaitify-react.umd.js"></script>
|
|
32
|
+
<!-- 始终引入最新的kaitify -->
|
|
33
|
+
<script src="https://unpkg.com/@kaitify/react/lib/kaitify-react.umd.js"></script>
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<!-- 使用CDN上的es模块构建版本 -->
|
|
38
|
+
<script type="module">
|
|
39
|
+
import { Wrapper } from 'https://unpkg.com/@kaitify/react/lib/kaitify-react.es.js'
|
|
40
|
+
</script>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## 通过 npm/yarn/pnpm 安装 kaitify-react
|
|
44
|
+
|
|
45
|
+
> 假设你已了解关于 html、css 和 javascript 的中级知识,并且对于 npm,es6,webpack 已经有了足够的了解,我们更推荐这类安装方式
|
|
46
|
+
|
|
47
|
+
::: code-group
|
|
48
|
+
|
|
49
|
+
```bash [npm]
|
|
50
|
+
npm install @kaitify/react
|
|
51
|
+
|
|
52
|
+
# 安装指定版本
|
|
53
|
+
npm install @kaitify/react@0.0.1-beta.1
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```bash [yarn]
|
|
57
|
+
yarn install @kaitify/react
|
|
58
|
+
|
|
59
|
+
# 安装指定版本
|
|
60
|
+
yarn install @kaitify/react@0.0.1-beta.1
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
```bash [pnpm]
|
|
64
|
+
pnpm install @kaitify/react
|
|
65
|
+
|
|
66
|
+
# 安装指定版本
|
|
67
|
+
pnpm install @kaitify/react@0.0.1-beta.1
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
:::
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 简介
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 简介
|
|
6
|
+
|
|
7
|
+
## 前言
|
|
8
|
+
|
|
9
|
+
`kaitify-react` 是一套基于 `kaitify` 富文本编辑器核心库进行开发和设计的富文本编辑器,使用 `React` 框架作视图渲染,并提供相关的组件供开发者使用
|
|
10
|
+
|
|
11
|
+
本文档不再对 `kaitify` 进行赘述,关于编辑器底层的核心理念,在 `kaitify` 文档中都有讲述,如果你对 `kaitify` 有兴趣,可以访问 [@kaitify/core 文档](https://www.so-better.cn/docs/kaitify-core/),获取进一步的了解
|
|
12
|
+
|
|
13
|
+
## 结合 React
|
|
14
|
+
|
|
15
|
+
`kaitify` 是一个基于原生 `js` 的富文本编辑器核心库,在 `React` 项目中进行使用的话,可能需要进行一些组件的封装,并且需要为更好地与 `React` 结合而进行开发与设计
|
|
16
|
+
|
|
17
|
+
`kaitify-react` 的目的就是为了帮助开发者解决这一问题,减少一些基本工作,同时提供了可以直接拿来使用的必要组件,并且设计了一套基本的 `UI` 样式
|
|
18
|
+
|
|
19
|
+
`kaitify-react` 最低支持的 react 版本是 react 18
|
|
20
|
+
|
|
21
|
+
## 视图渲染
|
|
22
|
+
|
|
23
|
+
`kaitify` 的视图渲染采用完全原生 `js` 的写法,我们称之为 `js-render`,而在 `kaitify-react` 中,我们自定义了视图渲染的逻辑,采用 `React` 的 `ReactNode` 来作视图渲染
|
|
24
|
+
|
|
25
|
+
因此编辑器本身不关心视图如何进行渲染,只需要专注于内部逻辑的处理,视图渲染的部分我们完全交给 `React` 去处理
|
|
26
|
+
|
|
27
|
+
> [!TIP] 怎么样?
|
|
28
|
+
> 接下来去更详细地了解 `kaitify-react` 是怎么使用的吧~
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: 国际化支持
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 国际化支持
|
|
6
|
+
|
|
7
|
+
`kaitify-react` 默认为中文环境,即显示的相关文字都是中文
|
|
8
|
+
|
|
9
|
+
同时支持英文和日语、韩语环境,即显示的相关文字都是英文、日语、韩语
|
|
10
|
+
|
|
11
|
+
## 中文环境
|
|
12
|
+
|
|
13
|
+
`Wrapper` 组件的 `locale` 属性设置为 `zh-CN` 或者不设置
|
|
14
|
+
|
|
15
|
+
```tsx
|
|
16
|
+
import { useState } from 'react'
|
|
17
|
+
import { Wrapper } from '@kaitify/react'
|
|
18
|
+
|
|
19
|
+
export default function App() {
|
|
20
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
21
|
+
return <Wrapper locale='zh-CN' value={content} onChange={v => setContent(v)} placeholder='输入正文内容...'></Wrapper>
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 英文环境
|
|
26
|
+
|
|
27
|
+
`Wrapper` 组件的 `locale` 属性设置为 `en-US`
|
|
28
|
+
|
|
29
|
+
```tsx
|
|
30
|
+
import { useState } from 'react'
|
|
31
|
+
import { Wrapper } from '@kaitify/react'
|
|
32
|
+
|
|
33
|
+
export default function App() {
|
|
34
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
35
|
+
return <Wrapper locale='en-US' value={content} onChange={v => setContent(v)} placeholder='输入正文内容...'></Wrapper>
|
|
36
|
+
}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 韩语环境
|
|
40
|
+
|
|
41
|
+
`Wrapper` 组件的 `locale` 属性设置为 `ko-KR`
|
|
42
|
+
|
|
43
|
+
```tsx
|
|
44
|
+
import { useState } from 'react'
|
|
45
|
+
import { Wrapper } from '@kaitify/react'
|
|
46
|
+
|
|
47
|
+
export default function App() {
|
|
48
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
49
|
+
return <Wrapper locale='ko-KR' value={content} onChange={v => setContent(v)} placeholder='输入正文内容...'></Wrapper>
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## 日语环境
|
|
54
|
+
|
|
55
|
+
`Wrapper` 组件的 `locale` 属性设置为 `ja-JP`
|
|
56
|
+
|
|
57
|
+
```tsx
|
|
58
|
+
import { useState } from 'react'
|
|
59
|
+
import { Wrapper } from '@kaitify/react'
|
|
60
|
+
|
|
61
|
+
export default function App() {
|
|
62
|
+
const [content, setContent] = useState('<p>hello</p>')
|
|
63
|
+
return <Wrapper locale='ja-JP' value={content} onChange={v => setContent(v)} placeholder='输入正文内容...'></Wrapper>
|
|
64
|
+
}
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
编辑器自身可能体现不出来中英文环境的差别,`kaitify-react` 提供了内置的 `Menu`,当设置 `locale` 为 `en-US` 后,这些内置 `Menu` 中的汉字都会转为英文,其他语言同理
|