{"name":"@aomao/plugin-fontsize","version":"2.7.2","main":"dist/index.js","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.7.2","@babel/runtime":"^7.13.10"},"gitHead":"3cbadcf72a1675dd95a81e48c97d3d830965bf49","description":"字体大小插件","_id":"@aomao/plugin-fontsize@2.7.2","_nodeVersion":"16.13.1","_npmVersion":"lerna/3.22.1/node@v16.13.1+x64 (win32)","dist":{"integrity":"sha512-y1QDYrx5yXhO+RvBh4j8xn0qI4RxQ7EBC1BFSvacZpuDNC7pFhNGWNRRDaWVGW/kPYVVWb1smn5cBG4mXROYZA==","shasum":"92733fbf52a8f5af68ffad8765446e09711d9215","tarball":"http://registry-npm.ywwl.com/@aomao/plugin-fontsize/download/@aomao/plugin-fontsize-2.7.2.tgz","fileCount":7,"unpackedSize":17122,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhy1KsCRA9TVsSAnZWagAAe/8P/3H4h96eB3W3kfFzBfpQ\nZpIP5vqXMUfFo4uTsy/SmofNlrFm2VaRDKIt58glZE32eBVFXjwrFO+/NI70\nkpagqhZNLNyNZbjffCWmJQwJKsH4ciFH6tzxdGrufkPhtYecgLGCAkrv3wfa\n3NAwxV79qt5d++oA445HXb63SJjiOkD0dIqIcANc6DHCxIe5Mx8NdCcUFJgr\nPeBOYnh64X5qLkPFw1EO/UYfTt6xVEjJgVDgsWFHTL3249w15Gq8ovqFjZ1c\nJxf/sPFDF2Urm3EVTrNLHbHgw+HytnR2eEaKJbZAczKAoL43lpheBExiHv6O\nJFyIDxX5S/PScbeTbA791T1dMSuYRVS7EOPmC/Gbxv7wGtQr1SlFL1/c4Mct\nJZdsLVDB79sb7gJei2ZmeLHMqQ28cUhWB8E7Tqbj+JWedG+Uc07eUNX3XwUy\nsBfldauUa0CLrRuCHi1NlSYAJfXhTgh1pxK5NIG1ZTTla08McbMOjtGTJJyy\nnEq4Q5MidLZRt2W8m3WuVcLGJ/55/xfr5GVD2qiCA41aL+RDjoBNynoF+rC9\nuJ+EOCyz2W0XI7qXJZIGqKgJxXYPmQJ+AwwzknsFBmkFyKxIr4weJeskaVN/\nIrgyVWXcm7nyECJRX3VcXloV4a5z0pxoAp3rKm8B/IGtrAShVAOEZluoDAe2\n37Qm\r\n=4bOT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDt+TsmRKlFIOXGL9Gi+8NYS4/CqHnkicAiIF4LvBlMNwIgPujhtCYYA8dkqbSxWJdZshJ97hVhbCIcWca5g8SgBBs="}],"size":5085,"noattachment":false,"key":"/@aomao/plugin-fontsize/-/@aomao/plugin-fontsize-2.7.2.tgz"},"_npmUser":{"name":"aomao","email":"me@aomao.com"},"directories":{},"maintainers":[{"name":"aomao","email":"me@aomao.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/plugin-fontsize_2.7.2_1640714924074_0.10010652413851395"},"_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":1640714924431,"_cnpm_publish_time":1640714924431,"dist-tags":{"latest":"2.10.0"}}