Skip to content

Commit

Permalink
chore: Upgrade mini-program-iconfont-cli to 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
fwh1990 committed Sep 14, 2021
1 parent 0318e5d commit a67dd4d
Show file tree
Hide file tree
Showing 11 changed files with 153 additions and 20 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 2.0.1
升级 mini-program-iconfont-cli 到 [ 0.55 -> 0.6.1 ]

# 2.0.0
更新 alipay 为 ali

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "remax-iconfont-cli",
"version": "2.0.0",
"version": "2.0.1",
"main": "index.js",
"repository": "[email protected]:iconfont-cli/remax-iconfont-cli.git",
"author": "范文华 <[email protected]>",
Expand All @@ -17,7 +17,7 @@
"colors": "^1.4.0",
"fs-extra": "^9.0.0",
"iconfont-parser": "^1.0.0",
"mini-program-iconfont-cli": "0.5.5",
"mini-program-iconfont-cli": "0.6.1",
"minimist": "^1.2.5",
"mkdirp": "^1.0.4"
},
Expand Down
6 changes: 3 additions & 3 deletions snapshots/iconfont-js/ali/ali.axml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions snapshots/iconfont-js/ali/ali.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Component({
size: 14,
},
data: {
colors: '',
quot: '"',
svgSize: 14,
isStr: true,
Expand All @@ -16,6 +17,7 @@ Component({
const color = this.props.color;

this.setData({
colors: this.fixColor(color),
isStr: typeof color === 'string',
});

Expand All @@ -31,6 +33,7 @@ Component({

if (color !== prevProps.color) {
this.setData({
colors: this.fixColor(color),
isStr: typeof color === 'string',
});
}
Expand All @@ -41,4 +44,34 @@ Component({
});
}
},
methods: {
fixColor: function() {
var color = this.props.color;
var hex2rgb = this.hex2rgb;

if (typeof color === 'string') {
return color.indexOf('#') === 0 ? hex2rgb(color) : color;
}

return color.map(function (item) {
return item.indexOf('#') === 0 ? hex2rgb(item) : item;
});
},
hex2rgb: function(hex) {
var rgb = [];

hex = hex.substr(1);

if (hex.length === 3) {
hex = hex.replace(/(.)/g, '$1$1');
}

hex.replace(/../g, function(color) {
rgb.push(parseInt(color, 0x10));
return color;
});

return 'rgb(' + rgb.join(',') + ')';
}
}
});
32 changes: 32 additions & 0 deletions snapshots/iconfont-js/toutiao/toutiao.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Component({
value: '',
observer: function(color) {
this.setData({
colors: this.fixColor(),
isStr: typeof color === 'string',
});
}
Expand All @@ -25,8 +26,39 @@ Component({
},
},
data: {
colors: '',
svgSize: 14 / 750 * tt.getSystemInfoSync().windowWidth,
quot: '"',
isStr: true,
},
methods: {
fixColor: function() {
var color = this.data.color;
var hex2rgb = this.hex2rgb;

if (typeof color === 'string') {
return color.indexOf('#') === 0 ? hex2rgb(color) : color;
}

return color.map(function (item) {
return item.indexOf('#') === 0 ? hex2rgb(item) : item;
});
},
hex2rgb: function(hex) {
var rgb = [];

hex = hex.substr(1);

if (hex.length === 3) {
hex = hex.replace(/(.)/g, '$1$1');
}

hex.replace(/../g, function(color) {
rgb.push(parseInt(color, 0x10));
return color;
});

return 'rgb(' + rgb.join(',') + ')';
}
}
});
6 changes: 3 additions & 3 deletions snapshots/iconfont-js/toutiao/toutiao.ttml

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions snapshots/iconfont-ts/ali/ali.axml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions snapshots/iconfont-ts/ali/ali.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Component({
size: 20,
},
data: {
colors: '',
quot: '"',
svgSize: 20,
isStr: true,
Expand All @@ -16,6 +17,7 @@ Component({
const color = this.props.color;

this.setData({
colors: this.fixColor(color),
isStr: typeof color === 'string',
});

Expand All @@ -31,6 +33,7 @@ Component({

if (color !== prevProps.color) {
this.setData({
colors: this.fixColor(color),
isStr: typeof color === 'string',
});
}
Expand All @@ -41,4 +44,34 @@ Component({
});
}
},
methods: {
fixColor: function() {
var color = this.props.color;
var hex2rgb = this.hex2rgb;

if (typeof color === 'string') {
return color.indexOf('#') === 0 ? hex2rgb(color) : color;
}

return color.map(function (item) {
return item.indexOf('#') === 0 ? hex2rgb(item) : item;
});
},
hex2rgb: function(hex) {
var rgb = [];

hex = hex.substr(1);

if (hex.length === 3) {
hex = hex.replace(/(.)/g, '$1$1');
}

hex.replace(/../g, function(color) {
rgb.push(parseInt(color, 0x10));
return color;
});

return 'rgb(' + rgb.join(',') + ')';
}
}
});
32 changes: 32 additions & 0 deletions snapshots/iconfont-ts/toutiao/toutiao.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Component({
value: '',
observer: function(color) {
this.setData({
colors: this.fixColor(),
isStr: typeof color === 'string',
});
}
Expand All @@ -25,8 +26,39 @@ Component({
},
},
data: {
colors: '',
svgSize: 20,
quot: '"',
isStr: true,
},
methods: {
fixColor: function() {
var color = this.data.color;
var hex2rgb = this.hex2rgb;

if (typeof color === 'string') {
return color.indexOf('#') === 0 ? hex2rgb(color) : color;
}

return color.map(function (item) {
return item.indexOf('#') === 0 ? hex2rgb(item) : item;
});
},
hex2rgb: function(hex) {
var rgb = [];

hex = hex.substr(1);

if (hex.length === 3) {
hex = hex.replace(/(.)/g, '$1$1');
}

hex.replace(/../g, function(color) {
rgb.push(parseInt(color, 0x10));
return color;
});

return 'rgb(' + rgb.join(',') + ')';
}
}
});
6 changes: 3 additions & 3 deletions snapshots/iconfont-ts/toutiao/toutiao.ttml

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -212,16 +212,16 @@ make-error@^1.1.1:
resolved "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==

mini-program-iconfont-cli@0.5.5:
version "0.5.5"
resolved "https://registry.npmjs.org/mini-program-iconfont-cli/-/mini-program-iconfont-cli-0.5.5.tgz#6752c2efdf5a51d81ccb8868884c65dfd7231588"
integrity sha512-iIExmzdEJg1BP9R04wUTnP10zJPlrd0KoScdPjhqBRhlqjjLZ5iLMj6/VkFJXwduRoK3VGoAwEwHAzU4M57xtw==
mini-program-iconfont-cli@0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/mini-program-iconfont-cli/-/mini-program-iconfont-cli-0.6.1.tgz#61d08cf05bf5a51c82a75c4afcf77224e20ed06c"
integrity sha512-69FsU+tSevwmHBiL55535Hfh1q0ciRpNyYtiTBZw2bvw9lvW3N/SCTg395P0rkisWMqf1Ki9VYIWeaONvNWy2Q==
dependencies:
axios "^0.19.0"
colors "^1.3.3"
fs-extra "^8.1.0"
glob "^7.1.4"
minimist "^1.2.0"
minimist "^1.2.5"
mkdirp "^0.5.1"
tslib "^1.10.0"
xml2js "^0.4.19"
Expand All @@ -233,7 +233,7 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

minimist@^1.2.0, minimist@^1.2.5:
minimist@^1.2.5:
version "1.2.5"
resolved "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
Expand Down

0 comments on commit a67dd4d

Please sign in to comment.