feat: npm 构建
This commit is contained in:
parent
d862406707
commit
86949db8fd
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -76,7 +76,7 @@
|
|||
Gitee地址
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://blog.csdn.net/yanxiaomu" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
CSDN账号
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><div><div class="home-wrapper"><div><img src="/cnchar/assets/img/logo.6cd28633.png" alt srcset class="logo"></div> <div class="title">cnchar</div> <div class="desc">功能全面、多端支持的汉字拼音笔画js库</div> <div class="test"><div class="test-input el-input"><!----><input type="text" autocomplete="off" placeholder="输入一些汉字试试" class="el-input__inner"><!----><!----><!----><!----></div> <div class="show-area" style="display:none;"><div> <span class="split">|</span> 共笔</div> <div>繁体: <span class="split">|</span> 火星文: </div> <div>笔顺: </div> <div id="draw-area"></div></div></div> <div class="start-w"><button type="button" class="el-button el-button--primary"><!----><!----><span>开始 <i class="ei-location-arrow"></i></span></button> <button type="button" class="el-button el-button--primary"><!----><!----><span>运行 <i class="ei-play"></i></span></button></div> <div class="feature-w"><div class="f-i"><div class="f-t"><i class="ei-rocket"></i>功能全面</div> <div class="f-des">拼音/笔画数</div> <div class="f-des">多音字词</div> <div class="f-des">繁体字/火星文</div> <div class="f-des">汉字笔顺/偏旁部首</div> <div class="f-des">多种模式绘制汉字</div> <div class="f-des">汉字推算/拼音排序</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-tablet"></i>多端支持</div> <div class="f-des">浏览器</div> <div class="f-des">nodejs</div> <div class="f-des">小程序/小游戏</div> <div class="f-des">ReactNative/Weex/Uniapp/Electron</div> <div class="f-des">webpack</div> <div class="f-des">typescript支持</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-cubes"></i>按需取用</div> <div class="f-des">支持自定义数据</div> <div class="f-des">功能分包</div> <div class="f-des">体积小巧</div> <div class="f-des">简单易用</div> <div class="f-des">npm</div> <div class="f-des">cdn</div> <div class="f-des">...</div></div></div> <div class="copy-right">MIT Licensed | Copyright © 2020 present <a href="https://www.github.com/theajack" target="view_window">theajack</a></div></div></div></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><div><div class="home-wrapper"><div><img src="/cnchar/assets/img/logo.6cd28633.png" alt srcset class="logo"></div> <div class="title">cnchar</div> <div class="desc">功能全面、多端支持的汉字拼音笔画js库</div> <div class="test"><div class="test-input el-input"><!----><input type="text" autocomplete="off" placeholder="输入一些汉字试试" class="el-input__inner"><!----><!----><!----><!----></div> <div class="show-area" style="display:none;"><div> <span class="split">|</span> 共笔</div> <div>繁体: <span class="split">|</span> 火星文: </div> <div>笔顺: </div> <div id="draw-area"></div></div></div> <div class="start-w"><button type="button" class="el-button el-button--primary"><!----><!----><span>开始 <i class="ei-location-arrow"></i></span></button> <button type="button" class="el-button el-button--primary"><!----><!----><span>运行 <i class="ei-play"></i></span></button></div> <div class="feature-w"><div class="f-i"><div class="f-t"><i class="ei-rocket"></i>功能全面</div> <div class="f-des">拼音/笔画数</div> <div class="f-des">多音字词</div> <div class="f-des">繁体字/火星文</div> <div class="f-des">汉字笔顺/偏旁部首</div> <div class="f-des">多种模式绘制汉字</div> <div class="f-des">汉字推算/拼音排序</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-tablet"></i>多端支持</div> <div class="f-des">浏览器</div> <div class="f-des">nodejs</div> <div class="f-des">小程序/小游戏</div> <div class="f-des">ReactNative/Weex/Uniapp/Electron</div> <div class="f-des">webpack</div> <div class="f-des">typescript开发</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-cubes"></i>按需取用</div> <div class="f-des">支持自定义数据</div> <div class="f-des">功能分包</div> <div class="f-des">体积小巧</div> <div class="f-des">简单易用</div> <div class="f-des">npm</div> <div class="f-des">cdn</div> <div class="f-des">...</div></div></div> <div class="copy-right">MIT Licensed | Copyright © 2020 present <a href="https://www.github.com/theajack" target="view_window">theajack</a></div></div></div></div> <footer class="page-edit"><!----> <!----></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/assets/js/app.3d5a33c2.js" defer></script><script src="/cnchar/assets/js/2.2bb98858.js" defer></script><script src="/cnchar/assets/js/8.f01c3380.js" defer></script><script src="/cnchar/assets/js/4.dec2fc6b.js" defer></script>
|
||||
<script>
|
||||
var _mtac = {};
|
||||
|
|
|
@ -91,7 +91,7 @@ Use the script tag to use:
|
|||
16. Support **Range radicals** query function
|
||||
17. **Small size**, min version is only 46 kb, zip version is 34 kb(contains a large number of Chinese Pinyin dictionaries)
|
||||
18. **Multi-end available**, can be used in**browser, nodejs, applet / mini-game, ReactNative / Weex / Uniapp / Electron, webpack**..., supports all environments where js can run
|
||||
19. **typescript support**, support calling in typescript
|
||||
19. **typescript**, the main library and all plug-in libraries are developed using typescript
|
||||
20. Rich configuration, split into 7 libraries according to function
|
||||
21. Support **custom** pinyin strokes and other data, use more flexible
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
const gulp = require('gulp');
|
||||
const rename = require('gulp-rename');
|
||||
const fs = require('fs');
|
||||
const util = require('./tool');
|
||||
const toc = require('gulp-markdown-toc');
|
||||
const version = require('../package.json').version;
|
||||
|
||||
|
@ -127,14 +126,4 @@ function copyLatest () {
|
|||
.pipe(gulp.dest('npm/packages/hanzi-util-base'));
|
||||
}
|
||||
|
||||
function modMinJs () {
|
||||
var file = 'npm/disable-devtool.min.js';
|
||||
util.read(file, (code) => {
|
||||
util.write(file, code.replace(/[a-z]\){/i, (str) => {
|
||||
const n = str[0];
|
||||
return `${str}var _f=${n};${n}=function(){return _f().default};`;
|
||||
}));
|
||||
});
|
||||
}
|
||||
|
||||
task();
|
|
@ -1,4 +1,8 @@
|
|||
### 本地运行注意事项
|
||||
|
||||
1. 进入 src/cnchar-types 目录 运行 npm link 命令
|
||||
2. 进入 src/cnchar 目录 运行 npm link cnchar-types 命令
|
||||
2. 进入 src/cnchar 目录 运行 npm link cnchar-types 命令
|
||||
|
||||
### npm run test
|
||||
1. npm run test:npm: 需要先build之后测试 npm 包
|
||||
2. npm run test:直接测试 ts 源代码,需要 npm install -g typescript 全局安装ts
|
|
@ -125,6 +125,7 @@
|
|||
6. 歇后语没有查询到默认返回空数组
|
||||
7. 修复小程序下json文件为数组加载不到的问题
|
||||
|
||||
## 2.2.9
|
||||
1. 增加 免 和 倘 的默认读音
|
||||
2. 增加 重来 词组
|
||||
## 3.0.0
|
||||
1. typescript 重写,主库及所有插件库使用ts重写
|
||||
2. 增加 免 和 倘 的默认读音
|
||||
3. 增加 重来 词组
|
File diff suppressed because one or more lines are too long
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-all",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.all.min.js",
|
||||
"unpkg": "cnchar.all.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar",
|
||||
"version": "2.2.8",
|
||||
"version": "2.2.8-beta2",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.min.js",
|
||||
"scripts": {},
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^0.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-draw",
|
||||
"version": "2.2.8",
|
||||
"version": "2.2.8-beta2",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.draw.min.js",
|
||||
"unpkg": "cnchar.draw.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^0.0.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hanzi-util-base",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "hanzi.base.min.js",
|
||||
"unpkg": "hanzi.base.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hanzi-util",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "hanzi.util.min.js",
|
||||
"unpkg": "hanzi.util.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-idiom",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.idiom.min.js",
|
||||
"unpkg": "cnchar.idiom.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-order",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.order.min.js",
|
||||
"unpkg": "cnchar.order.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-poly",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.poly.min.js",
|
||||
"unpkg": "cnchar.poly.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-radical",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.radical.min.js",
|
||||
"unpkg": "cnchar.radical.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-trad",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.trad.min.js",
|
||||
"unpkg": "cnchar.trad.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -186,7 +186,7 @@ import cnchar from 'cnchar';
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-xhy",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.xhy.min.js",
|
||||
"unpkg": "cnchar.xhy.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "index.html",
|
||||
"author": "theajack <contact@theajack.com>",
|
||||
|
@ -33,10 +33,9 @@
|
|||
"build:npm": "node ./helper/build-npm.js",
|
||||
"start": "webpack-dev-server --open --config webpack-config/dev.js",
|
||||
"dev": "webpack-dev-server --open --config webpack-config/dev.js",
|
||||
"publish": "npm publish npm/cnchar && npm publish npm/order && npm publish npm/poly && npm publish npm/trad && npm publish npm/draw && npm publish npm/idiom && npm publish npm/xhy && npm publish npm/radical && npm publish npm/all && npm publish npm/hanzi-util-base && npm publish npm/hanzi-util",
|
||||
"publish": "npm publish src/cnchar-types && npm publish npm/packages/cnchar && npm publish npm/packages/order && npm publish npm/packages/poly && npm publish npm/packages/trad && npm publish npm/packages/draw && npm publish npm/packages/idiom && npm publish npm/packages/xhy && npm publish npm/packages/radical && npm publish npm/packages/cnchar-all && npm publish npm/packages/hanzi-util-base && npm publish npm/packages/hanzi-util",
|
||||
"lint": "eslint src --ext js",
|
||||
"test": "node test",
|
||||
"test:npm": "node test npm",
|
||||
"test": "node test npm",
|
||||
"dev:docs": "vuepress dev vuepress",
|
||||
"build:docs": "bash helper/build-docs.sh",
|
||||
"build:docs-win": "vuepress build vuepress && node ./helper/build-docs.js"
|
||||
|
|
|
@ -33,6 +33,9 @@ import '../src/cnchar/plugin/radical';
|
|||
|
||||
console.log(cnchar);
|
||||
|
||||
console.log(cnchar.orderToWord(['横', '撇', '捺'], 'array'));
|
||||
console.log(cnchar.orderToWord(['横', '撇', '捺'], 'start'));
|
||||
console.log(cnchar.orderToWord(['横', '撇', '捺'], 'start', 'simple'));
|
||||
// import './plugin/draw'
|
||||
// console.log('1',cnchar)
|
||||
console.log(cnchar.stroke('一个', 'order'));
|
||||
|
@ -81,37 +84,37 @@ console.log(cnchar.xhy('上晃下摇', 'fuzzy', 'answer', 'second')); // ['醉
|
|||
// // 返回数组
|
||||
// console.log(cnchar.radical('你好呀', 'array')); // ["亻", "女", "口"]
|
||||
// window.keys = Object.keys(spell);
|
||||
|
||||
// cncharDraw('你好', {
|
||||
// type: cncharDraw.TYPE.NORMAL,
|
||||
// el: '#drawArea',
|
||||
// style: {
|
||||
// radicalColor: '#44f',
|
||||
// backgroundColor: '#ccc'
|
||||
// },
|
||||
// animation: {
|
||||
// animateComplete () {
|
||||
// console.log('animateComplete');
|
||||
// },
|
||||
// loopAnimate: true,
|
||||
// autoAnimate: false, // false 时点击出发animate 只能触发一次
|
||||
// // stepByStep: false
|
||||
// },
|
||||
// test: {
|
||||
// onTestStatus (d) {
|
||||
// console.log(d);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// cnchar.draw('中国', {
|
||||
// type: cnchar.draw.TYPE.TEST,
|
||||
// style: {
|
||||
// radicalColor: '#44f',
|
||||
// backgroundColor: '#eee',
|
||||
// length: 100,
|
||||
cnchar.draw('你好九', {});
|
||||
cnchar.draw('你好九', {
|
||||
type: cnchar.draw.TYPE.STROKE,
|
||||
el: '#drawArea',
|
||||
style: {
|
||||
radicalColor: '#44f',
|
||||
backgroundColor: '#ccc'
|
||||
},
|
||||
animation: {
|
||||
animateComplete () {
|
||||
console.log('animateComplete');
|
||||
},
|
||||
loopAnimate: true,
|
||||
autoAnimate: false, // false 时点击出发animate 只能触发一次
|
||||
// stepByStep: false
|
||||
},
|
||||
test: {
|
||||
onTestStatus (d: any) {
|
||||
console.log(d);
|
||||
}
|
||||
}
|
||||
});
|
||||
cnchar.draw('中国', {
|
||||
type: cnchar.draw.TYPE.TEST,
|
||||
style: {
|
||||
radicalColor: '#44f',
|
||||
backgroundColor: '#eee',
|
||||
length: 100,
|
||||
|
||||
// },
|
||||
// });
|
||||
},
|
||||
});
|
||||
|
||||
// cnchar.draw('你好', {
|
||||
// type: cnchar.draw.TYPE.ANIMATION,
|
||||
|
|
|
@ -34,7 +34,9 @@ export declare type TypeValueObject = {
|
|||
};
|
||||
|
||||
export declare interface ISpell {(sentence: string, ...args: Array<SpellArg>): string | Array<any>;}
|
||||
|
||||
declare interface IStroke {(sentence: string, ...args: Array<StrokeArg>): number | Array<any>;}
|
||||
|
||||
export interface ICnChar {
|
||||
spell: ISpell;
|
||||
stroke: IStroke;
|
||||
|
@ -78,6 +80,7 @@ export interface ICnChar {
|
|||
spell: ISpell;
|
||||
stroke: IStroke;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
declare global {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
{
|
||||
"name": "cnchar-types",
|
||||
"version": "0.0.1",
|
||||
"version": "0.0.2",
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-types",
|
||||
"version": "2.2.8",
|
||||
"version": "0.0.2",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "index.js",
|
||||
"scripts": {},
|
||||
|
@ -24,4 +24,4 @@
|
|||
"url": "https://github.com/theajack/cnchar/issues"
|
||||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
import {IComplete, IWriter} from './index';
|
||||
import {IComplete, IWriter, IWriterOptionWithoutText} from './index';
|
||||
import {Json} from '../../main/common';
|
||||
import {ICnChar} from '../../main';
|
||||
|
||||
export declare type TDrawType = 'normal' | 'animation' | 'stroke' | 'test';
|
||||
export declare type TDrawTypeUpperCase = 'NORMAL' | 'ANIMATION' | 'STROKE' | 'TEST';
|
||||
export declare type TTestStatusType = 'mistake' | 'correct' | 'complete';
|
||||
|
||||
export declare interface ITestStatusData {
|
||||
|
@ -103,7 +104,7 @@ export declare interface ICloneSvg{
|
|||
}
|
||||
|
||||
export declare interface IDraw {
|
||||
(text: string, options: IDrawOption): IWriter | null;
|
||||
(text: string, options: IWriterOptionWithoutText): IWriter | null;
|
||||
TYPE: Json<TDrawType>;
|
||||
TEST_STATUS: Json<TTestStatusType>;
|
||||
init?(cnchar?: ICnChar): void;
|
||||
|
@ -115,7 +116,7 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
declare module '../../main/index' {
|
||||
declare module '../../main' {
|
||||
interface ICnChar {
|
||||
draw: IDraw;
|
||||
}
|
||||
|
|
|
@ -13,12 +13,14 @@ export default class HanziWriter {
|
|||
onMistake (strokeData: ITestStatusData): void;
|
||||
onCorrectStroke (strokeData: ITestStatusData): void;
|
||||
onComplete (strokeData: ITestStatusData): void;
|
||||
});
|
||||
}): void;
|
||||
hideCharacter(): void;
|
||||
animateCharacter(option: {
|
||||
onComplete(): void;
|
||||
}): void;
|
||||
static create(node: Node, text: string, option: IDrawOption): HanziWriter;
|
||||
static loadCharacterData(str: string): Promise<ICharData>;
|
||||
static getScalingTransform(width?: number, height?: number, padding?: number);
|
||||
static getScalingTransform(width?: number, height?: number, padding?: number): {
|
||||
transform: string
|
||||
};
|
||||
}
|
|
@ -10,9 +10,8 @@ import {
|
|||
import HanziWriter from './hanzi-writer';
|
||||
|
||||
export declare interface IComplete {(end?: boolean): void;}
|
||||
export declare interface IWriterOption {
|
||||
export declare interface IWriterOptionWithoutText {
|
||||
el?: string | HTMLElement;
|
||||
text?: string;
|
||||
clear?: boolean;
|
||||
type?: TDrawType;
|
||||
style?: IDrawStyleOption,
|
||||
|
@ -21,6 +20,9 @@ export declare interface IWriterOption {
|
|||
stroke?: IDrawStrokeOption,
|
||||
test?: IDrawTestOption,
|
||||
}
|
||||
export declare interface IWriterOption extends IWriterOptionWithoutText {
|
||||
text?: string;
|
||||
}
|
||||
export declare interface IWriter {
|
||||
option: IDrawOption;
|
||||
el: HTMLElement;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-all",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.all.min.js",
|
||||
"unpkg": "cnchar.all.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hanzi-util-base",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "hanzi.base.min.js",
|
||||
"unpkg": "hanzi.base.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "hanzi-util",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "hanzi.util.min.js",
|
||||
"unpkg": "hanzi.util.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.min.js",
|
||||
"scripts": {},
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1 +1 @@
|
|||
export default '2.2.8';
|
||||
export default '3.0.0';
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-draw",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.draw.min.js",
|
||||
"unpkg": "cnchar.draw.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -46,6 +46,7 @@ function renderFanningStrokes ({
|
|||
const group: SVGGElement = document.createElementNS('http://www.w3.org/2000/svg', 'g');
|
||||
|
||||
const transformData = HanziWriter.getScalingTransform(width, width, option.padding);
|
||||
console.log(transformData);
|
||||
group.setAttributeNS(null, 'transform', transformData.transform);
|
||||
svg.appendChild(group);
|
||||
for (let i = 0; i <= current; i++) {
|
||||
|
|
|
@ -204,7 +204,7 @@ export class Writer implements IWriter {
|
|||
}
|
||||
}
|
||||
|
||||
const draw: IDraw = (text: string = '', options: IDrawOption = {}): IWriter | null => {
|
||||
const draw: IDraw = (text: string = '', options: IWriterOption = {}): IWriter | null => {
|
||||
if (typeof window === 'undefined') {
|
||||
console.error('Draw 方法仅支持在浏览器环境下使用');
|
||||
return null;
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-idiom",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.idiom.min.js",
|
||||
"unpkg": "cnchar.idiom.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -25,7 +25,6 @@ const orderToWord = ((
|
|||
input: string | Array<OrderName>,
|
||||
...args: Array<OrderToWordArg>
|
||||
): string | Array<string> => {
|
||||
args = args.splice(1);
|
||||
if (typeof input === 'string') {
|
||||
input = input.split(' ') as Array<OrderName>;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-order",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.order.min.js",
|
||||
"unpkg": "cnchar.order.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-poly",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.poly.min.js",
|
||||
"unpkg": "cnchar.poly.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-radical",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.radical.min.js",
|
||||
"unpkg": "cnchar.radical.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-trad",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.trad.min.js",
|
||||
"unpkg": "cnchar.trad.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "cnchar-xhy",
|
||||
"version": "2.2.8",
|
||||
"version": "3.0.0",
|
||||
"description": "功能全面、多端支持的汉字拼音笔画js库,支持多音字、繁体字、火星文",
|
||||
"main": "cnchar.xhy.min.js",
|
||||
"unpkg": "cnchar.xhy.min.js",
|
||||
|
@ -27,6 +27,6 @@
|
|||
},
|
||||
"homepage": "https://www.theajack.com/cnchar/",
|
||||
"dependencies": {
|
||||
"cnchar-types": "^2.2.8"
|
||||
"cnchar-types": "^3.0.0"
|
||||
}
|
||||
}
|
|
@ -1,29 +1,30 @@
|
|||
let order, trad, poly, idiom, xhy, radical, cnchar;
|
||||
|
||||
if (process.argv[2] === 'npm') {
|
||||
cnchar = require('../npm/cnchar');
|
||||
order = require('../npm/order');
|
||||
trad = require('../npm/trad');
|
||||
poly = require('../npm/poly');
|
||||
idiom = require('../npm/idiom');
|
||||
xhy = require('../npm/xhy');
|
||||
radical = require('../npm/radical');
|
||||
cnchar = require('../npm/packages/cnchar');
|
||||
order = require('../npm/packages/order');
|
||||
trad = require('../npm/packages/trad');
|
||||
poly = require('../npm/packages/poly');
|
||||
idiom = require('../npm/packages/idiom');
|
||||
xhy = require('../npm/packages/xhy');
|
||||
radical = require('../npm/packages/radical');
|
||||
console.log('****TEST NPM****');
|
||||
} else {
|
||||
cnchar = require('../src/main/index');
|
||||
order = require('../src/plugin/order');
|
||||
trad = require('../src/plugin/trad');
|
||||
poly = require('../src/plugin/poly');
|
||||
idiom = require('../src/plugin/idiom');
|
||||
xhy = require('../src/plugin/xhy');
|
||||
radical = require('../src/plugin/radical');
|
||||
console.log('****TEST SRC****');
|
||||
throw new Error('ts 暂不支持node test 请先build之后再测试');
|
||||
// cnchar = require('../src/cnchar/main/index');
|
||||
// order = require('../src/cnchar/plugin/order');
|
||||
// trad = require('../src/cnchar/plugin/trad');
|
||||
// poly = require('../src/cnchar/plugin/poly');
|
||||
// idiom = require('../src/cnchar/plugin/idiom');
|
||||
// xhy = require('../src/cnchar/plugin/xhy');
|
||||
// radical = require('../src/cnchar/plugin/radical');
|
||||
// console.log('****TEST SRC****');
|
||||
}
|
||||
console.log();
|
||||
|
||||
cnchar.use(order, trad, poly, idiom, xhy, radical);
|
||||
|
||||
let config = require('./test.config');
|
||||
const config = require('./test.config');
|
||||
|
||||
const startTest = require('./test');
|
||||
|
||||
|
|
|
@ -7,24 +7,24 @@
|
|||
// var radical = require('./radical/index');
|
||||
|
||||
var cnchar = require('../../npm/packages/cnchar/cnchar.min.js');
|
||||
// var poly = require('../../npm/packages/poly/cnchar.poly.min.js');
|
||||
// var order = require('../../npm/packages/order/cnchar.order.min.js');
|
||||
// var trad = require('../../npm/packages/trad/cnchar.trad.min.js');
|
||||
// var idiom = require('../../npm/packages/idiom/cnchar.idiom.min.js');
|
||||
// var xhy = require('../../npm/packages/xhy/cnchar.xhy.min.js');
|
||||
// var radical = require('../../npm/packages/radical/cnchar.radical.min.js');
|
||||
// console.log(cnchar);
|
||||
var poly = require('../../npm/packages/poly/cnchar.poly.min.js');
|
||||
var order = require('../../npm/packages/order/cnchar.order.min.js');
|
||||
var trad = require('../../npm/packages/trad/cnchar.trad.min.js');
|
||||
var idiom = require('../../npm/packages/idiom/cnchar.idiom.min.js');
|
||||
var xhy = require('../../npm/packages/xhy/cnchar.xhy.min.js');
|
||||
var radical = require('../../npm/packages/radical/cnchar.radical.min.js');
|
||||
console.log(cnchar.use);
|
||||
// debugger;
|
||||
|
||||
// cnchar.use(order, trad, poly, idiom, xhy, radical);
|
||||
// console.log(cnchar.stroke('一个', 'order'));
|
||||
// console.log(cnchar.stroke('長城', 'count', 'order', 'name'));
|
||||
// console.log(cnchar.orderToWord(['横', '撇', '捺']));
|
||||
// console.log('美好的地方'.spell('tone'));
|
||||
// console.log('长大了'.spell());
|
||||
// console.log('长大了'.spell('poly'));
|
||||
// console.log(cnchar.strokeToWord(25, 'simple'));
|
||||
// console.log(cnchar.idiom(['五', '', '十', '']));
|
||||
// console.log(cnchar.xhy('大水冲了龙王庙'));
|
||||
// console.log(cnchar.radical('你好呀'));
|
||||
cnchar.use(order, trad, poly, idiom, xhy, radical);
|
||||
console.log(cnchar.stroke('一个', 'order'));
|
||||
console.log(cnchar.stroke('長城', 'count', 'order', 'name'));
|
||||
console.log(cnchar.orderToWord(['横', '撇', '捺']));
|
||||
console.log('美好的地方'.spell('tone'));
|
||||
console.log('长大了'.spell());
|
||||
console.log('长大了'.spell('poly'));
|
||||
console.log(cnchar.strokeToWord(25, 'simple'));
|
||||
console.log(cnchar.idiom(['五', '', '十', '']));
|
||||
console.log(cnchar.xhy('大水冲了龙王庙'));
|
||||
console.log(cnchar.radical('你好呀'));
|
||||
// module.exports = cnchar
|
|
@ -36,7 +36,7 @@
|
|||
<div class='f-des'>小程序/小游戏</div>
|
||||
<div class='f-des'>ReactNative/Weex/Uniapp/Electron</div>
|
||||
<div class='f-des'>webpack</div>
|
||||
<div class='f-des'>typescript支持</div>
|
||||
<div class='f-des'>typescript开发</div>
|
||||
<div class='f-des'>...</div>
|
||||
</div>
|
||||
<div class='f-i'>
|
||||
|
|
|
@ -50,7 +50,7 @@ sidebarDepth: 0 //吐槽:这里设置0无效!只能设置1或2!
|
|||
16. 提供汉字工具方法,方便开发者更便捷高效地 **操作拼音和汉字**
|
||||
17. **体积小**,min 版本仅 46 kb,zip 版本 34 kb (含有大量汉字拼音字典)
|
||||
18. **多端可用**,可用于 **浏览器、nodejs、小程序/小游戏、ReactNative/Weex/Uniapp/Electron、webpack**...,支持所有 js 能运行的环境
|
||||
19. **typescript支持**,支持在typescript中调用
|
||||
19. **typescript开发**,主库及所有插件库均使用typescript开发
|
||||
20. 丰富的配置,按功能拆分成7个库按需取用
|
||||
21. 支持**自定义**拼音笔画等数据,使用更灵活
|
||||
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -76,7 +76,7 @@
|
|||
Gitee地址
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li><li class="dropdown-item"><!----> <a href="https://blog.csdn.net/yanxiaomu" target="_blank" rel="noopener noreferrer" class="nav-link external">
|
||||
CSDN账号
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><div><div class="home-wrapper"><div><img src="/cnchar/v2/assets/img/logo.6cd28633.png" alt srcset class="logo"></div> <div class="title">cnchar</div> <div class="desc">功能全面、多端支持的汉字拼音笔画js库</div> <div class="test"><div class="test-input el-input"><!----><input type="text" autocomplete="off" placeholder="输入一些汉字试试" class="el-input__inner"><!----><!----><!----><!----></div> <div class="show-area" style="display:none;"><div> <span class="split">|</span> 共笔</div> <div>繁体: <span class="split">|</span> 火星文: </div> <div>笔顺: </div> <div id="draw-area"></div></div></div> <div class="start-w"><button type="button" class="el-button el-button--primary"><!----><!----><span>开始 <i class="ei-location-arrow"></i></span></button> <button type="button" class="el-button el-button--primary"><!----><!----><span>运行 <i class="ei-play"></i></span></button></div> <div class="feature-w"><div class="f-i"><div class="f-t"><i class="ei-rocket"></i>功能全面</div> <div class="f-des">拼音/笔画数</div> <div class="f-des">多音字词</div> <div class="f-des">繁体字/火星文</div> <div class="f-des">汉字笔顺/偏旁部首</div> <div class="f-des">多种模式绘制汉字</div> <div class="f-des">汉字推算/拼音排序</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-tablet"></i>多端支持</div> <div class="f-des">浏览器</div> <div class="f-des">nodejs</div> <div class="f-des">小程序/小游戏</div> <div class="f-des">ReactNative/Weex/Uniapp/Electron</div> <div class="f-des">webpack</div> <div class="f-des">typescript支持</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-cubes"></i>按需取用</div> <div class="f-des">支持自定义数据</div> <div class="f-des">功能分包</div> <div class="f-des">体积小巧</div> <div class="f-des">简单易用</div> <div class="f-des">npm</div> <div class="f-des">cdn</div> <div class="f-des">...</div></div></div> <div class="copy-right">MIT Licensed | Copyright © 2020 present <a href="https://www.github.com/theajack" target="view_window">theajack</a></div></div></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/14/2020, 1:02:43 AM</span></div></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg></a></li></ul></div></div> <!----></nav> <!----> </aside> <main class="page"> <div class="theme-default-content content__default"><div><div class="home-wrapper"><div><img src="/cnchar/v2/assets/img/logo.6cd28633.png" alt srcset class="logo"></div> <div class="title">cnchar</div> <div class="desc">功能全面、多端支持的汉字拼音笔画js库</div> <div class="test"><div class="test-input el-input"><!----><input type="text" autocomplete="off" placeholder="输入一些汉字试试" class="el-input__inner"><!----><!----><!----><!----></div> <div class="show-area" style="display:none;"><div> <span class="split">|</span> 共笔</div> <div>繁体: <span class="split">|</span> 火星文: </div> <div>笔顺: </div> <div id="draw-area"></div></div></div> <div class="start-w"><button type="button" class="el-button el-button--primary"><!----><!----><span>开始 <i class="ei-location-arrow"></i></span></button> <button type="button" class="el-button el-button--primary"><!----><!----><span>运行 <i class="ei-play"></i></span></button></div> <div class="feature-w"><div class="f-i"><div class="f-t"><i class="ei-rocket"></i>功能全面</div> <div class="f-des">拼音/笔画数</div> <div class="f-des">多音字词</div> <div class="f-des">繁体字/火星文</div> <div class="f-des">汉字笔顺/偏旁部首</div> <div class="f-des">多种模式绘制汉字</div> <div class="f-des">汉字推算/拼音排序</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-tablet"></i>多端支持</div> <div class="f-des">浏览器</div> <div class="f-des">nodejs</div> <div class="f-des">小程序/小游戏</div> <div class="f-des">ReactNative/Weex/Uniapp/Electron</div> <div class="f-des">webpack</div> <div class="f-des">typescript开发</div> <div class="f-des">...</div></div> <div class="f-i"><div class="f-t"><i class="ei-cubes"></i>按需取用</div> <div class="f-des">支持自定义数据</div> <div class="f-des">功能分包</div> <div class="f-des">体积小巧</div> <div class="f-des">简单易用</div> <div class="f-des">npm</div> <div class="f-des">cdn</div> <div class="f-des">...</div></div></div> <div class="copy-right">MIT Licensed | Copyright © 2020 present <a href="https://www.github.com/theajack" target="view_window">theajack</a></div></div></div></div> <footer class="page-edit"><!----> <div class="last-updated"><span class="prefix">最后更新于:</span> <span class="time">4/14/2020, 1:02:43 AM</span></div></footer> <!----> </main></div><div class="global-ui"><!----><div></div></div></div>
|
||||
<script src="/cnchar/v2/assets/js/app.c32cd789.js" defer></script><script src="/cnchar/v2/assets/js/2.2bb98858.js" defer></script><script src="/cnchar/v2/assets/js/8.6e193aef.js" defer></script><script src="/cnchar/v2/assets/js/4.e922f897.js" defer></script>
|
||||
<script>
|
||||
var _mtac = {};
|
||||
|
|
|
@ -28,8 +28,7 @@ module.exports = {
|
|||
filename: 'cnchar.min.js',
|
||||
library: 'cnchar',
|
||||
libraryTarget: 'umd',
|
||||
// umdNamedDefine: true,
|
||||
// globalObject: 'this',
|
||||
globalObject: 'this',
|
||||
libraryExport: 'default',
|
||||
},
|
||||
resolve: {
|
||||
|
|
|
@ -23,19 +23,22 @@ const path = require('path');
|
|||
module.exports = (env) => {
|
||||
const plugin = env.pluginname;
|
||||
let dir = `plugin/${plugin}`;
|
||||
let npmDir = plugin;
|
||||
if (plugin === 'all') {
|
||||
dir = 'alias/cnchar-all';
|
||||
npmDir = 'cnchar-all';
|
||||
}
|
||||
return {
|
||||
mode: 'production',
|
||||
entry: path.resolve('./', `src/cnchar/${dir}/index.ts`),
|
||||
output: {
|
||||
path: path.resolve('./', 'npm/packages/' + plugin),
|
||||
path: path.resolve('./', 'npm/packages/' + npmDir),
|
||||
filename: 'cnchar.' + plugin + '.min.js',
|
||||
library: 'cnchar' + plugin[0].toUpperCase() + plugin.substr(1),
|
||||
// umdNamedDefine: true,
|
||||
libraryTarget: 'umd',
|
||||
umdNamedDefine: true,
|
||||
globalObject: 'this'
|
||||
globalObject: 'this',
|
||||
libraryExport: 'default',
|
||||
},
|
||||
resolve: {
|
||||
extensions: [ '.tsx', '.ts', '.js' ]
|
||||
|
|
Loading…
Reference in New Issue