Row height plugin
$ yarn add @aomao/plugin-line-height
Add to engine
import Engine, {EngineInterface} from'@aomao/engine';import Lineheight from'@aomao/plugin-line-height';new Engine(...,{ plugins:[Lineheight] })
Supports filtering the row height that does not meet the custom
/*** @param lineHeight current line height* @returns returns string to modify the current value, false is removed, true is retained* */filter?: (lineHeight: string) => string | boolean//Configurationnew Engine(...,{config:{[LineHeihgt.pluginName]: {//Configure the row height to be filtered after pastingfilter: (lineHeight: string) => {if(lineHeight === "14px") return "1"if(lineHeight === "16px") return "1.15"if(lineHeight === "21px") return "1.5"if(lineHeight === "28px") return "2"if(lineHeight === "35px") return "2.5"if(lineHeight === "42px") return "3"return ["1","1.15","1.5","2","2.5","3"].indexOf(lineHeight)> -1}}}}
No shortcut keys by default
//Shortcut keys, key combination keys, args, execution parameters, [lineHeight], lineHeight are optional, delete the line height at the current cursor position without passing a valuehotkey?:{key:string,args:Array<string>};//default none//Use configurationnew Engine(...,{config:{"line-height":{//Modify shortcut keyshotkey:{key:"mod+b",args:["2"]}}}})
//lineHeight: changed line heightengine.command.execute('line-height', lineHeight);//Use command to query the current state, return Array<string> | undefined, the set of high values at the current cursor positionengine.command.queryState('line-height');