{"name":"@aomao/plugin-fontsize","version":"2.6.1","main":"dist/index.ts","module":"dist/index.esm.js","typings":"dist/index.d.ts","author":{"name":"me@yanmao.cc"},"license":"MIT","homepage":"https://github.com/yanmao-cc/am-editor#readme","repository":{"type":"git","url":"git+https://github.com/yanmao-cc/am-editor.git"},"bugs":{"url":"https://github.com/yanmao-cc/am-editor/issues"},"dependencies":{"@aomao/engine":"^2.6.1","@babel/runtime":"^7.13.10"},"gitHead":"448e33810fa13fbd32431b462e7f02ece09cb4a9","description":"字体大小插件","_id":"@aomao/plugin-fontsize@2.6.1","_nodeVersion":"14.18.1","_npmVersion":"lerna/3.22.1/node@v14.18.1+x64 (win32)","dist":{"integrity":"sha512-1I+InwOnqBLVY31tIzwo4UXN6wLRZXH5RmY71bpsiVraCmrTBojCiQzOW/XDbJ/ferAvYpRjdoGYIEOgnYEjQA==","shasum":"c5a4e365e30bf84e6095e418f7af032a254059a8","tarball":"http://registry-npm.ywwl.com/@aomao/plugin-fontsize/download/@aomao/plugin-fontsize-2.6.1.tgz","fileCount":7,"unpackedSize":17064,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCGCq40bP8Jltq9rdKjDzENn8Hdy7EFy0/8jAfMIfNsUgIhAIWDmk4ylqhwd7KgVsU5G4xQaheTHs2ksbggIum0g8y+"}],"size":5073,"noattachment":false,"key":"/@aomao/plugin-fontsize/-/@aomao/plugin-fontsize-2.6.1.tgz"},"_npmUser":{"name":"aomao","email":"me@yanmao.cc"},"directories":{},"maintainers":[{"name":"aomao","email":"me@yanmao.cc"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-fontsize_2.6.1_1635965474871_0.8964600078168474"},"_hasShrinkwrap":false,"readme":"# @aomao/plugin-fontsize\n\n字体大小插件\n\n## 安装\n\n```bash\n$ yarn add @aomao/plugin-fontsize\n```\n\n添加到引擎\n\n```ts\nimport Engine, { EngineInterface } from '@aomao/engine';\nimport Fontsize from '@aomao/plugin-fontsize';\n\nnew Engine(...,{ plugins:[Fontsize] })\n```\n\n## 可选项\n\n### 粘贴过滤自定义字体大小\n\n支持过滤不符合自定义的字体大小\n\n```ts\n/**\n * @param fontSize 当前字体大小\n * @returns 返回 string 修改当前值，false 移除，true 保留\n * */\nfilter?: (fontSize: string) => string | boolean\n//配置\nnew Engine(...,{\n    config:{\n        [Fontsize.pluginName]: {\n            //配置粘贴后需要过滤的字体大小\n            filter: (fontSize: string) => {\n                return [\"12px\",\"13px\",\"14px\",\"15px\",\"16px\",\"19px\",\"22px\",\"24px\",\"29px\",\"32px\",\"40px\",\"48px\"].indexOf(fontSize) > -1\n            }\n        }\n    }\n}\n```\n\n### 默认字体大小\n\n```ts\ndefaultSize?:string //默认为14px\n```\n\n### 快捷键\n\n默认无快捷键\n\n```ts\n//快捷键，key 组合键，args，执行参数，[size,defaultSize?] ， size 必须，defaultSize 可选\nhotkey?:{key:string,args:Array<string>};//默认无\n\n//使用配置\nnew Engine(...,{\n    config:{\n        \"fontsize\":{\n            //修改快捷键\n            hotkey:{\n                key:\"mod+b\",\n                args:[\"12px\",\"14px\"]\n            }\n        }\n    }\n })\n```\n\n## 命令\n\n```ts\n//size：更改的字体大小，defaultSize：保持的默认字体大小，在没有传入 defaultSize 或者 size 与 defaultSize 值不同时执行前景色修改\nengine.command.execute('fontsize', size, defaultSize);\n//使用 command 执行查询当前状态，返回 Array<string> | undefined，当前光标所在处字体大小值集合\nengine.command.queryState('fontsize');\n```\n","publish_time":1635965475021,"_cnpm_publish_time":1635965475021,"dist-tags":{"latest":"2.10.0"}}