1.0.1 • Published 9 months ago

@xiehy/plugin-picture-hollow v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@xiehy/plugin-picture-hollow

图片挖空插件

安装

$ yarn add @xiehy/plugin-picture-hollow

添加到引擎

import Engine, { EngineInterface } from '@xiehy/engine';
import PictureHollow from '@xiehy/plugin-picture-hollow';

new Engine(...,{ plugins:[PictureHollow] })

可选项

移除

移除样式命令,或提供方法。默认为 removeformat ,需要添加 @xiehy/plugin-removeformat 插件

removeCommand?:string | ((range:RangeInterface) => void);

绘制

如何绘制 block 节点,返回 false,不执行内置绘制,包括不复制 block 节点的 css 样式

/**
 * @param currentBlock 当前需要绘制的节点
 * @param block 需要被复制格式的节点
 * */
paintBlock?:(currentBlock:NodeInterface,block:NodeInterface) => boolean | void

命令

//使用 command 执行插件
engine.command.execute('pictureHollow');
//使用 command 执行查询当前状态,返回 boolean
engine.command.queryState('pictureHollow');
1.0.1

9 months ago

1.0.0

9 months ago