{"name":"@aomao/plugin-fontsize","version":"2.6.21","main":"dist/index.ts","module":"dist/index.esm.js","typings":"dist/index.d.ts","author":{"name":"me@aomao.com"},"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.21","@babel/runtime":"^7.13.10"},"gitHead":"2373d36786bddb25be26a642d7740028dab93f21","description":"字体大小插件","_id":"@aomao/plugin-fontsize@2.6.21","_nodeVersion":"12.18.4","_npmVersion":"lerna/3.22.1/node@v12.18.4+x64 (win32)","dist":{"integrity":"sha512-VIakSFH2pIO95bdz+tk118bk0B1CqLMwSxVMCBun9eb7+SHguc1l2Z55cqmlUFfe7yjOdpdmLsZGDYCmZrrlHw==","shasum":"0a66e69947bae6fc72def6b61cba3e22e2f850c3","tarball":"http://registry-npm.ywwl.com/@aomao/plugin-fontsize/download/@aomao/plugin-fontsize-2.6.21.tgz","fileCount":7,"unpackedSize":17066,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvfcXCRA9TVsSAnZWagAAyDsP/jGhBSO9I05UG28K3xxG\nCYwf9TeCZv9NEFvGiFv9tmsEzpaUkxcdlk7u5z/0cDQNCK/7TNz3H5S2ENwJ\nKeGS1gBG9ICJAWl0hEpHRoBM5Cdlk4ts3PZV76UUmv4NOetz8QD6wzHWJ4Sw\nKPUK4b0TOU7wzOvM4oyTjyfB7jFASI3bgsdPkec8ZWayG8DE5/daCu8LEi3w\nFGp9ruvp6/NaC/wPrCRE8eg/rKtBown8juhqzFb6/GeCPybYoaUJLyPqsfz+\n8x6tzZVC0X9qo5f8KWVZ8xvsIla48adcFOh+OW2L4KzEGpOZGx1Q2tKA/IKi\nT4bDdWW7sg8/UKMp7OOS5UnO+CwHqO0it+U8l9pseUKjhLo14MRPClYz8VzN\nyI4BzYXkysjgfZsnUOiHOrJz3mkKUHrZBuRORzDlMbRHG26IkqwWazhVGgFb\nhTxfKerkd4Ata90L3zRFtGzoZgWF30k5U7IoIfXKY56s0ypqFeQGCH80and4\nGRP4tZSiSmEV7nTOKAvvnt8yeZkAnJX/V4LcXRpqSnYkCjt8BCXQsHpiyEjl\nf+Nu41dGzvjs5zgbXiOJONFaiT8eTKghCdm+XJrtki3SUkarvvTbwI9BrjdS\nnf6HYhM7pWw2QQoaJ+ZGUgXGlO+LfiYzl9fNn9aNuGd8rRhQSVrs9UflsqdO\nDPNK\r\n=7wvi\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCgmp51k+2ecTsfq7nVoaAabDx1hZnJoKRX04llGPfYfQIgPdYZLhPJclSJdfmmWEmmGKTeVRTpcVYOrMEyyppv/hA="}],"size":5075,"noattachment":false,"key":"/@aomao/plugin-fontsize/-/@aomao/plugin-fontsize-2.6.21.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.21_1639839511263_0.8698855193284156"},"_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":1639839511420,"_cnpm_publish_time":1639839511420,"dist-tags":{"latest":"2.10.0"}}