@haklex/rich-ext-tldraw
v0.0.42
Published
Tldraw whiteboard extension
Readme
@haklex/rich-ext-tldraw
Tldraw 白板扩展。
安装
pnpm add @haklex/rich-ext-tldraw @haklex/rich-editor tldraw导出
// 节点
export { TldrawNode } from './TldrawNode'
export { $createTldrawNode, $isTldrawNode } from './TldrawNode'
export type { SerializedTldrawNode } from './TldrawNode'
// 插件
export { TldrawPlugin, INSERT_TLDRAW_COMMAND } from './TldrawPlugin'
// 渲染器
export { TldrawStaticRenderer } from './TldrawStaticRenderer'
export type { TldrawStaticRendererProps } from './TldrawStaticRenderer'
export { TldrawEditRenderer } from './TldrawEditRenderer'
export type { TldrawEditRendererProps } from './TldrawEditRenderer'
// 上下文
export { TldrawConfigProvider, useTldrawConfig } from './TldrawConfigContext'
export type { TldrawConfig } from './TldrawConfigContext'
// 向后兼容
export { TldrawStaticRenderer as TldrawRenderer } from './TldrawStaticRenderer'
export type { TldrawStaticRendererProps as TldrawRendererProps } from './TldrawStaticRenderer'使用
import { TldrawPlugin, TldrawNode } from '@haklex/rich-ext-tldraw'
import { RichEditor } from '@haklex/rich-editor'
<RichEditor extraNodes={[TldrawNode]}>
<TldrawPlugin />
</RichEditor>依赖
{
"@haklex/rich-editor": "workspace:*",
"tldraw": "^3.0.0"
}License
MIT
