feat: 2.2.3 修复draw库的一个bug

This commit is contained in:
tackchen 2020-07-07 19:08:30 +08:00
parent 4dd438c03e
commit 14a1b8dd5d
22 changed files with 88 additions and 52 deletions

View File

@ -96,4 +96,7 @@
3. 修复构建npm的bug
## 2.2.2
1. 增加几个多音字的默认读音
1. 增加几个多音字的默认读音
## 2.2.3
1. 修复draw库不同绘制实例样式会干扰的bug

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-all",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.all.min.js",
@ -27,12 +27,12 @@
},
"homepage": "https://www.theajack.com/cnchar/",
"dependencies": {
"cnchar": "^2.2.2",
"cnchar-order": "^2.2.2",
"cnchar-poly": "^2.2.2",
"cnchar-trad": "^2.2.2",
"cnchar-draw": "^2.2.2",
"cnchar-idiom": "^2.2.2",
"cnchar-xhy": "^2.2.2"
"cnchar": "^2.2.3",
"cnchar-order": "^2.2.3",
"cnchar-poly": "^2.2.3",
"cnchar-trad": "^2.2.3",
"cnchar-draw": "^2.2.3",
"cnchar-idiom": "^2.2.3",
"cnchar-xhy": "^2.2.3"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "cnchar",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"scripts": {},

View File

@ -1,3 +1,3 @@
"use strict";
module.exports = '2.2.2';
module.exports = '2.2.3';

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-draw",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.draw.min.js",

View File

@ -103,15 +103,14 @@ var Writer = /*#__PURE__*/function () {
lineHTML = _buildLinesStr.lineHTML,
border = _buildLinesStr.border;
svg.setAttribute('width', this.option.width);
svg.setAttribute('height', this.option.height);
if (border) {
svg.style.border = border;
}
var cloneSvg = function cloneSvg(option) {
var node = svg.cloneNode();
node.setAttribute('width', _this.option.width);
node.setAttribute('height', _this.option.height);
if (border) {
node.style.border = border;
}
if (lineHTML) {
node.innerHTML = lineHTML;

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "hanzi-util-base",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "hanzi.base.min.js",
@ -27,6 +27,6 @@
},
"homepage": "https://www.theajack.com/cnchar/",
"dependencies": {
"cnchar": "^2.2.2"
"cnchar": "^2.2.3"
}
}

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "hanzi-util",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "hanzi.util.min.js",
@ -27,6 +27,6 @@
},
"homepage": "https://www.theajack.com/cnchar/",
"dependencies": {
"cnchar-all": "^2.2.2"
"cnchar-all": "^2.2.3"
}
}

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-idiom",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.idiom.min.js",

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-order",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.order.min.js",

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-poly",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.poly.min.js",

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-trad",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.trad.min.js",

View File

@ -1,6 +1,6 @@
{
"name": "cnchar-xhy",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.js",
"unpkg": "cnchar.xhy.min.js",

View File

@ -1,6 +1,6 @@
{
"name": "cnchar",
"version": "2.2.2",
"version": "2.2.3",
"description": "功能全面、多端支持的汉字拼音笔画js库支持多音字、繁体字、火星文",
"main": "index.html",
"author": "theajack <contact@theajack.com>",

View File

@ -9,11 +9,13 @@ import '../src/plugin/xhy';
// import spell from '../src/main/spell-dict-jian.json';
// // import cncharDraw from '../src/plugin/draw';
// // import cnchar from '../npm/cnchar';
// // import '../npm/order';
// // import '../npm/trad';
// // import '../npm/poly';
// // import cncharDraw from '../npm/draw';
// import cnchar from '../npm/cnchar';
// import '../npm/order';
// import '../npm/trad';
// import '../npm/poly';
// import '../npm/draw';
// import '../npm/idiom';
// import '../npm/xhy';
// // import './plugin/draw'
// // console.log('1',cnchar)
@ -49,13 +51,45 @@ import '../src/plugin/xhy';
// }
// }
// });
// cncharDraw('你好', {
// type: cncharDraw.TYPE.STROKE,
// style: {
// radicalColor: '#44f',
// backgroundColor: '#eee'
// },
// });
cnchar.draw('中国', {
type: cnchar.draw.TYPE.NORMAL,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 100,
},
});
cnchar.draw('你好', {
type: cnchar.draw.TYPE.STROKE,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 60,
},
});
cnchar.draw('中国', {
type: cnchar.draw.TYPE.TEST,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 100,
},
});
cnchar.draw('你好', {
type: cnchar.draw.TYPE.ANIMATION,
style: {
radicalColor: '#44f',
backgroundColor: '#eee',
length: 120,
},
});
window.cnchar = cnchar;
export default cnchar;

View File

@ -1 +1 @@
module.exports = '2.2.2';
module.exports = '2.2.3';

View File

@ -47,13 +47,13 @@ class Writer {
}
init () {
let {lineHTML, border} = buildLinesStr(this.option);
svg.setAttribute('width', this.option.width);
svg.setAttribute('height', this.option.height);
if (border) {
svg.style.border = border;
}
let cloneSvg = (option) => {
let node = svg.cloneNode();
node.setAttribute('width', this.option.width);
node.setAttribute('height', this.option.height);
if (border) {
node.style.border = border;
}
if (lineHTML) {
node.innerHTML = lineHTML;
}