{"name":"@aomao/plugin-fontsize","version":"2.3.0","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/itellyou-com/am-editor#readme","repository":{"type":"git","url":"git+https://github.com/itellyou-com/am-editor.git"},"bugs":{"url":"https://github.com/itellyou-com/am-editor/issues"},"dependencies":{"@aomao/engine":"^2.3.0","@babel/runtime":"^7.13.10"},"gitHead":"56bc28a4b572f8afb3c5c74108171697215d798e","description":"字体大小插件","_id":"@aomao/plugin-fontsize@2.3.0","_nodeVersion":"12.18.4","_npmVersion":"lerna/4.0.0/node@v12.18.4+x64 (win32)","dist":{"integrity":"sha512-2hlcyCHKS8XrChEg2tCmccXIbeSy2g2W3DBcVO2pdh3naflovgeXz6qEyenLPfeAL7Bg/puRoCw0L5UcMdXQww==","shasum":"c0c76e356d6f5bf0aeadf318e7518460118fc179","tarball":"http://registry-npm.ywwl.com/@aomao/plugin-fontsize/download/@aomao/plugin-fontsize-2.3.0.tgz","fileCount":7,"unpackedSize":16715,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg+qWUCRA9TVsSAnZWagAAA2AP/1KOkQUDfkH6En3RyTzd\nVfH+MFN+DVgwsC571oRn9+Sh+rdXspLx31fG5QGx3p0vHtuUrAxgtCquRAYJ\nwphY+qcLZEg/lCumbz4MA/HAEOYRDG+rnedClhHqRYM9yxwdDSkUhbhoBWqE\n9pTvuLZYJTaP/zAU5GaG4ukB9RUbNHROg1vAQWI9X+8D8fCwRsOdyoHd567i\n5YGwco4GB5ZtuXPVOiWdBhdtKH2gso91gsPLNxOrLz6CIWRDJPbmo+9d9+Cf\ni0X5lQtKLXpPyzz2Dl7Sivo8WMTY+Ldil74bseVDZGEPH7JH+lJTm7aD443V\niVPA2rrVJnvnRnXcFAYn0usc1yJQA9DsOpiSka1yWzOp9WqwO17tVAlCBYsl\njU9tWUP8rSCMCOjFA1D8DqGMecSvunmr03zDizGciqhhuchyCbCuLECNz5KB\nrRF0f0AJhYNceRe7v1EPRnyiw4/yvwOF4JXEqiTwXcKTnOhK6YW/W2E1TuyU\nBUxpxUpAyA0YPtjheK0ldYNKGEZg3x4HeUlZ9mcDzcJ8c16klXK175vZGDRA\nXK2D9kdiisxAic5jHTp+/+7qgPkLKh0ohHnuHkZe0KO9mBgzlDQyZgvEsiva\n9wtyxz2FrHhMTyMCAZHZTlhOB5vE31DJPjM1mKEc90rMS9HlervRCE4wCPeX\ndpfr\r\n=D0Nf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBGrKMUPipqVxoxuJm3U1MHnMIxBSZF953UAsw9AltHvAiEAvBUGfJ5WJL06k4m3qc+McorN7qAApCoWfxvtVhY7Edk="}],"size":4993,"noattachment":false,"key":"/@aomao/plugin-fontsize/-/@aomao/plugin-fontsize-2.3.0.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.3.0_1627039124133_0.5659709306021536"},"_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":1627039124296,"_cnpm_publish_time":1627039124296,"dist-tags":{"latest":"2.10.0"}}