efront 4.0.58 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,237 @@
1
+ - zh-CN: 未没找到匹配的资源:$1
2
+ en: "No matching resources found: $1"
3
+
4
+ - zh-CN: 检查到$1可以正常访问
5
+ en: Checked that $1 can be accessed normally
6
+
7
+ - zh-CN: 服务器地址:$1
8
+ en: "Server address: $1"
9
+
10
+ - zh-CN: 正常访问
11
+ en: Normal access
12
+
13
+ - zh-CN: 端口被占用
14
+ en: Port is occupied
15
+
16
+ - zh-CN: 没有权限
17
+ en: No permission
18
+
19
+ - zh-CN: 端口打开失败
20
+ en: Port opening failed
21
+
22
+ - zh-CN: HTTPS端口正在使用默认证书,请不要在生产环境使用此功能!
23
+ en: "HTTPS port is using default certificate, please do not use this feature in production environment!"
24
+
25
+ - zh-CN: 没有找到指定的全局变量
26
+ en: The specified global variable was not found
27
+
28
+ - zh-CN: 在以上 $1 个文件中找到了指定的全局变量
29
+ en: Found the specified global variable in the $1 file above
30
+
31
+ - zh-CN: 正在查找
32
+ en: Finding
33
+
34
+ - zh-CN: "路径不正在:"
35
+ en: "Path not in progress:"
36
+
37
+ - zh-CN: "处理完成:$1\r\n => $2"
38
+ en: "Processing completed: $1\r\n => $2"
39
+
40
+ - zh-CN: 请输入目标路径!
41
+ en: Please enter the target path!
42
+
43
+ - zh-CN: 请输入网络路径!
44
+ en: Please enter the network path!
45
+
46
+ - zh-CN: 无法确定文件名
47
+ en: Unable to determine file name
48
+
49
+ - zh-CN: 完成:
50
+ en: "Complete:"
51
+
52
+ - zh-CN: 服务器忙,请稍后再试!
53
+ en: "The server is busy, please try again later!"
54
+
55
+ - zh-CN: 重试
56
+ en: retry
57
+
58
+ - zh-CN: $1秒后再试
59
+ en: Try again in $1 second
60
+
61
+ - zh-CN: $1分钟后再试
62
+ en: Try again in $1 minute
63
+
64
+ - zh-CN: $1小时后再试
65
+ en: Try again in $1 hour
66
+
67
+ - zh-CN: 过几天再试
68
+ en: Try again in a few days
69
+
70
+ - zh-CN: 操作过于频繁,请$1
71
+ en: "Operation too frequent, please $1"
72
+
73
+ - zh-CN: 禁止访问!
74
+ en: Access prohibited!
75
+
76
+ - zh-CN: 检查到未知环境变量
77
+ en: Unknown environment variable detected
78
+
79
+ - zh-CN: 发现重名配置
80
+ en: Found duplicate name configuration
81
+
82
+ - zh-CN: 注册表操作暂不支持当前操作系统!
83
+ en: Registry operation currently does not support the current operating system!
84
+
85
+ - zh-CN: 注册表操作不支持$1
86
+ en: Registry operation does not support $1
87
+
88
+ - zh-CN: 注册表操作不支持此项 $1
89
+ en: Registry operation does not support this key $1
90
+
91
+ - zh-CN: 启动失败
92
+ en: Start failed
93
+
94
+ - zh-CN: 格式错误
95
+ en: Format error
96
+
97
+ - zh-CN: 代码结构异常!
98
+ en: Code structure exception!
99
+
100
+ - zh-CN: 缺少from语句
101
+ en: Missing from statement
102
+
103
+ - zh-CN: 缺少导入路径!
104
+ en: Missing import path!
105
+
106
+ - zh-CN: 缺少导出名!
107
+ en: Lack of guidance!
108
+
109
+ - zh-CN: 标记不匹配
110
+ en: Tag mismatch
111
+
112
+ - zh-CN: 类型不支持
113
+ en: Type not supported
114
+
115
+ - zh-CN: 参数异常!
116
+ en: Parameter exception!
117
+
118
+ - zh-CN: "range参数错误:"
119
+ en: "Range parameter error:"
120
+
121
+ - zh-CN: each参数异常!
122
+ en: Abnormal each parameter!
123
+
124
+ - zh-CN: 结构异常
125
+ en: Structural abnormalities
126
+
127
+ - zh-CN: 请指定输出路径!
128
+ en: Please specify the output path!
129
+
130
+ - zh-CN: 输出路径已存在,并且不是文件夹!
131
+ en: The output path already exists and is not a folder!
132
+
133
+ - zh-CN: 正在重写ASM
134
+ en: Rewriting ASM
135
+
136
+ - zh-CN: 正在导出组件
137
+ en: Exporting components
138
+
139
+ - zh-CN: 正在编译项目
140
+ en: Compiling project
141
+
142
+ - zh-CN: 项目内未发面主页面
143
+ en: Unpublished homepage within the project
144
+
145
+ - zh-CN: 启动自动刷新服务失败!
146
+ en: Failed to start automatic refresh service!
147
+
148
+ - zh-CN: 编译异常
149
+ en: Compilation exception
150
+
151
+ - zh-CN: 正在合成
152
+ en: Synthesizing
153
+
154
+ - zh-CN: 在 $1 中检测到可能不存在的外部变量:
155
+ en: "Detected external variables that may not exist in $1:"
156
+
157
+ - zh-CN: "压缩($1/$2):"
158
+ en: "Compression ($1/$2):"
159
+
160
+ - zh-CN: 存在环形引用:$1
161
+ en: "There is a circular reference: $1"
162
+
163
+ - zh-CN: 没有可导出的文件!
164
+ en: There are no files to export!
165
+
166
+ - zh-CN: 缺少变量:
167
+ en: "Missing variable:"
168
+
169
+ - zh-CN: 缺少常量:
170
+ en: "Missing constant:"
171
+
172
+ - zh-CN: watch功能在当前操作系统可能无法使用!
173
+ en: The watch function may not be available on the current operating system!
174
+
175
+ - zh-CN: 正在写入文件..
176
+ en: Writing file
177
+
178
+ - zh-CN: 请不要在非发布目录写文件!
179
+ en: Please do not write files in non published directories!
180
+
181
+ - zh-CN: 请不要将文件写入非发布目录!
182
+ en: Please do not write files to non publishing directories!
183
+
184
+ - zh-CN: 十进制
185
+ en: Decimal system
186
+
187
+ - zh-CN: 十六进制
188
+ en: Hexadecimal
189
+
190
+ - zh-CN: 二进制
191
+ en: Binary
192
+
193
+ - zh-CN: 八进制
194
+ en: Octal
195
+
196
+ - zh-CN: 三十六进制
197
+ en: Thirty six base
198
+
199
+ - zh-CN: 浮点数机器码
200
+ en: Floating point machine code
201
+
202
+ - zh-CN: 双精度机器码
203
+ en: Double precision machine code
204
+
205
+ - zh-CN: 数值换算
206
+ en: Numerical conversion
207
+
208
+ - zh-CN: 检查utf8
209
+ en: Check utf8
210
+
211
+ - zh-CN: 检查gbk
212
+ en: Check gbk
213
+
214
+ - zh-CN: 要检查的字符集区间(双字节以内)
215
+ en: Character set interval to check (within double bytes)
216
+
217
+ - zh-CN: 编码
218
+ en: coding
219
+
220
+ - zh-CN: 识别为unicode后的字符
221
+ en: Characters recognized as unicode
222
+
223
+ - zh-CN: 识别为gbk后的字符
224
+ en: Characters recognized as gbk
225
+
226
+ - zh-CN: 正在生成报告
227
+ en: Generating report
228
+
229
+ - zh-CN: 从网络下载文件,类似unix中的wget
230
+ en: "Download files from the network, similar to wget in Unix"
231
+
232
+ - zh-CN: 输入内容..
233
+ en: Input content
234
+
1
235
  - zh-CN: readme.md
2
236
  en: readme-en.md
3
237
 
@@ -152,10 +386,10 @@
152
386
  en: "Translation:"
153
387
 
154
388
  - zh-CN: "跳过了缺少参数的请求:$1 $2 $3\r\n缺少参数:$4"
155
- en:
389
+ en: "Skipped request $1 $2 $3 \r\n Missing parameters $4"
156
390
 
157
391
  - zh-CN: ", 可能的取值有 $1"
158
- en: Possible values are $1
392
+ en: ", possible values are $1"
159
393
 
160
394
  - zh-CN: 修改国际化参数
161
395
  en: Modify internationalization parameters
@@ -281,7 +515,7 @@
281
515
  en: Api with the same id set multiple times:%c $1
282
516
 
283
517
  - zh-CN: 跳过了缺少参数的请求:$1 $2 $3\r\n缺少参数:$4
284
- en:
518
+ en: Skipped request $1 $2 $3 Missing parameter $4
285
519
 
286
520
  - zh-CN: 没有找到对应的接口 id $1.
287
521
  en: No corresponding interface id $1 was found
@@ -311,7 +545,7 @@
311
545
  en: "The command syntax that can be used for $1 is:"
312
546
 
313
547
  - zh-CN: 其中
314
- en: among
548
+ en: among them
315
549
 
316
550
  - zh-CN: 请指定输出文件名!
317
551
  en: Please specify the output file name!
@@ -648,8 +648,8 @@ var removeImport = function (c, i, code) {
648
648
  var { used, envs, vars } = code;
649
649
  if (next && next.type !== QUOTED) {
650
650
  var [dec, map, o] = getDeclared(c.next);
651
- if (!o) throw new Error("代码结构异常!");
652
- if (o.type !== STRAP || o.text !== 'from') throw new Error("缺少from语句");
651
+ if (!o) throw new Error(i18n`代码结构异常!`);
652
+ if (o.type !== STRAP || o.text !== 'from') throw new Error(i18n`缺少from语句`);
653
653
  var oi = code.indexOf(o, i);
654
654
  }
655
655
  else code.splice(i, 1), o = c, oi = i - 1;
@@ -666,7 +666,7 @@ var removeImport = function (c, i, code) {
666
666
  splice(code, ni, 1);
667
667
  n = n.next;
668
668
  }
669
- if (!n || n.type !== QUOTED) throw new Error("缺少导入路径!");
669
+ if (!n || n.type !== QUOTED) throw new Error(i18n`缺少导入路径!`);
670
670
  var ns = skipAssignment(n);
671
671
  var nsi = ns ? code.indexOf(ns, i) : code.length;
672
672
  var q = scan(`require()`);
@@ -748,7 +748,7 @@ var removeExport = function (c, i, code) {
748
748
  var n = o.next;
749
749
  if (n && n.type === STRAP && n.text === 'as') {
750
750
  var nn = n.next;
751
- if (!nn) throw new Error("缺少导出名!");
751
+ if (!nn) throw new Error(i18n`缺少导出名!`);
752
752
  prop = nn.text;
753
753
  o = nn;
754
754
  n = o.next;
@@ -766,7 +766,7 @@ var removeExport = function (c, i, code) {
766
766
  }
767
767
  return;
768
768
  }
769
- if (n.type !== STRAP) throw new Error("代码结构异常!");
769
+ if (n.type !== STRAP) throw new Error(i18n`代码结构异常!`);
770
770
  if (n.text === 'default') {
771
771
  n.text = '=';
772
772
  n.type = STAMP;
@@ -523,7 +523,7 @@ class Program {
523
523
  pop_parents();
524
524
  continue;
525
525
  }
526
- if (this.scope_leave[m]) console.warn("标记不匹配", queue.entry, m, "queue:", `${queue.row}:${queue.col}`, "position:", `${row}:${index - colstart}\r\n`, text.slice(queue.start, index));
526
+ if (this.scope_leave[m]) console.warn(i18n`标记不匹配`, queue.entry, m, "queue:", `${queue.row}:${queue.col}`, "position:", `${row}:${index - colstart}\r\n`, text.slice(queue.start, index));
527
527
  if (this.stamp_reg.test(m)) {
528
528
  save(STAMP);
529
529
  }
@@ -9,7 +9,7 @@ var createRefId = function (o) {
9
9
  if (o.type === SCOPED) {
10
10
  if (o.entry !== '[') break;
11
11
  var t = o.last;
12
- if (!t) throw new Error("格式错误");
12
+ if (!t) throw new Error(i18n`格式错误`);
13
13
  if (t.type === QUOTED) {
14
14
  if (!t.length) {
15
15
  if (/\.|^#/.test(t.text)) {
@@ -201,7 +201,7 @@ function scan(text, type = "js", lastIndex = 0) {
201
201
  program = type;
202
202
  }
203
203
  else {
204
- console.log("类型不支持", type)
204
+ console.log(i18n`类型不支持`, type)
205
205
  }
206
206
  break;
207
207
  }
@@ -1073,6 +1073,7 @@ var getblock = function (body, cx) {
1073
1073
  while (o) {
1074
1074
  cx = skipAssignment(body, cx);
1075
1075
  var o = body[cx];
1076
+ if (o && o.prev && o.prev.type === LABEL) continue;
1076
1077
  if (!o || o.type !== STAMP || o.text !== ',') break;
1077
1078
  cx++;
1078
1079
  }
@@ -131,4 +131,5 @@ test("predef[key[1]](r.slice(key[0].length).trim())", '_ = key[1]; _0 = key[0].l
131
131
  test("predef[key[1]](r.slice())(r.slice())", '_ = key[1]; _0 = r.slice(); _ = predef[_](_0); _0 = r.slice(); _(_0)');
132
132
  test("predef[key[1]][key[2]][key[3]]", '_ = key[1]; _ = predef[_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _[_0]');
133
133
  test("[key[1]][key[2]][key[3]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _[_0]');
134
- test("[key[1]][key[2]]+[key[3]][key[4]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _0 = [_0]; _1 = key[4]; _ + _0[_1]');
134
+ test("[key[1]][key[2]]+[key[3]][key[4]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _0 = key[3]; _0 = [_0]; _1 = key[4]; _ + _0[_1]');
135
+ test("if(a)a:{break a}", "if (!a) return [2, 0]; return [1, 0];\r\n return [1, 0]", true);
@@ -3,7 +3,7 @@ var createString = function (a) {
3
3
  a.autospace = false;
4
4
  return _createString(a);
5
5
  };
6
- class Richarg extends Program {
6
+ class 素玉 extends Program {
7
7
  straps = ["and"];
8
8
  stamps = ',:;>+~&!/'.split("");
9
9
  quotes = this.quotes.slice(0, 2).concat();
@@ -11,7 +11,7 @@ class Richarg extends Program {
11
11
  scopes = [["(", ")"], ["{", "}"]];
12
12
  }
13
13
 
14
- var rarg = new Richarg;
14
+ var rarg = new 素玉;
15
15
  rarg.quotes.push(["url(", ")"]);
16
16
  var numberReg = /((?:[\+\-]+)?(?:\d+(?:\.\d*)?|\.\d+))(?:\s*(px|%|pt|pc|in|cm|mm|r?em|deg|rad|vw|vh|%))?/;
17
17
  var replaceHReg = new RegExp(numberReg.source + /\s*([\/\*])\s*/.source + numberReg.source, 'gi');
@@ -125,7 +125,7 @@ var createArgMap = function (args, split = ',', equal = ':') {
125
125
  var args = [];
126
126
  while (o) {
127
127
  if (!(o.type & (PROPERTY | EXPRESS))) {
128
- throw new Error("参数异常!");
128
+ throw new Error(i18n`参数异常!`);
129
129
  }
130
130
  var k = o.text;
131
131
  args.push(k);
@@ -174,7 +174,7 @@ macros.range = function () {
174
174
  }
175
175
  return result;
176
176
  }
177
- throw new Error("range参数错误:" + arguments);
177
+ throw new Error(i18n`range参数错误:` + arguments);
178
178
  };
179
179
  macros.extract = function (list, index) {
180
180
  if (typeof list === 'string') list = list.split(',');
@@ -223,10 +223,10 @@ macros.grayluma = wrapColor(color.grayluma);
223
223
  macros.fade = wrapColor(color.fade);
224
224
  macros.each = function (list, body) {
225
225
  var match = /^(?:\s*[#\.]?\(([\s\S]*?)\))?\s*\{([\s\S]*)\}$/.exec(body);
226
- if (!match) throw new Error("each参数异常!");
226
+ if (!match) throw new Error(i18n`each参数异常!`);
227
227
  var [_, args, content] = match;
228
228
  if (!content) return;
229
- content = richcss(content);
229
+ content = 素馨(content);
230
230
  if (args) args = args.split(",").map(a => a.trim());
231
231
  else args = [];
232
232
  if (args.length < 1) args.push("@value");
@@ -274,7 +274,7 @@ macros.each = function (list, body) {
274
274
  };
275
275
 
276
276
 
277
- class Richcss extends Program {
277
+ class 素心 extends Program {
278
278
  straps = ["and"];
279
279
  stamps = `;:,>+~&!/`.split("");
280
280
  quotes = rarg.quotes;
@@ -284,7 +284,7 @@ class Richcss extends Program {
284
284
 
285
285
  var presets = /^@(media|keyframes|layer|import|namespace|page|property|suppports|font-face|document|counter-style|charset|color-profile|container|font-feature-values|font-palette-values)(\s|\(|$)/i;
286
286
 
287
- Richcss.prototype.setType = function (o) {
287
+ 素心.prototype.setType = function (o) {
288
288
  var p = o.prev;
289
289
  if (o.type !== SCOPED) {
290
290
  if (!p || p.type === STAMP && p.text === ";" || p.type === SCOPED && p.entry === '{') {
@@ -309,7 +309,7 @@ Richcss.prototype.setType = function (o) {
309
309
  }
310
310
  };
311
311
 
312
- Richcss.prototype.createScoped = function (code) {
312
+ 素心.prototype.createScoped = function (code) {
313
313
  var setVarsUsed = function (s) {
314
314
  var vars = null, used = null;
315
315
  for (var cx = s.length - 1; cx >= 0; cx--) {
@@ -336,7 +336,7 @@ Richcss.prototype.createScoped = function (code) {
336
336
  if (o && (o.type & (SPACE | COMMENT) || o.type === STAMP && o.text === ';')) continue;
337
337
  if (o.type !== PROPERTY) {
338
338
  console.log(createString([o]), o.type, createString(code))
339
- throw new Error("结构异常");
339
+ throw new Error(i18n`结构异常`);
340
340
  }
341
341
  var p = [], v = [];
342
342
  while (o && (o.type !== SCOPED || o.entry !== "{")) {
@@ -383,7 +383,7 @@ Richcss.prototype.createScoped = function (code) {
383
383
  };
384
384
  return run(code);
385
385
  };
386
- Richcss.prototype.createString = createString;
386
+ 素心.prototype.createString = createString;
387
387
  var getFromScopeList = function (name, varsList, value = name) {
388
388
  name = name.replace(/^@\{\s*(\S*)\s*\}$/g, '@$1');
389
389
  var queue = [];
@@ -398,7 +398,8 @@ var getFromScopeList = function (name, varsList, value = name) {
398
398
  }
399
399
  }
400
400
  return value;
401
- }
401
+ };
402
+ var removeSelectorSpace = a => a.trim().replace(/\s*([\+~\>])\s*/g, "$1");
402
403
  var fixBase = function (b, a) {
403
404
  return a.split(/,\s*/).map(a => {
404
405
  if (presets.test(a)) a = `@{${a}}`;
@@ -411,7 +412,7 @@ var fixBase = function (b, a) {
411
412
  return b;
412
413
  });
413
414
  if (!replaced) {
414
- if (/^[>~+]/.test(a)) {
415
+ if (/^[\>~\+]/.test(a) || /[\>~\+]$/.test(b)) {
415
416
  a1 = b + a;
416
417
  }
417
418
  else a1 = b + " " + a;
@@ -421,6 +422,7 @@ var fixBase = function (b, a) {
421
422
  }).join(",");
422
423
  }
423
424
  function evalscoped(scoped, base = '') {
425
+ base = removeSelectorSpace(base);
424
426
  var smaps = scoped.maps;
425
427
  var root = smaps[":root"], scope = smaps[":scope"];
426
428
  var vars = extend(Object.create(null), scoped.vars);
@@ -530,6 +532,7 @@ function evalscoped(scoped, base = '') {
530
532
  if (p.isMethod) continue;
531
533
  if (p.used) {
532
534
  k = calcvars(k);
535
+ k = removeSelectorSpace(k);
533
536
  if (base && !p.rooted) p.base = fixBase(base, k);
534
537
  else p.base = presets.test(k) ? `@{${k}}` : k;
535
538
  if (p.vars) vlist.push(p.vars);
@@ -561,8 +564,8 @@ function evalscoped(scoped, base = '') {
561
564
  return result;
562
565
  }
563
566
  var rcss = null;
564
- function richcss(text, scopeName, compress) {
565
- if (!rcss) rcss = new Richcss;
567
+ function 素馨(text, scopeName, compress) {
568
+ if (!rcss) rcss = new 素心;
566
569
  rcss.debug = true;
567
570
  var code = scanner2(text, rcss);
568
571
  var { scoped } = code;
@@ -1,5 +1,5 @@
1
1
  var test = function (data, expect) {
2
- assert(richcss(data), expect);
2
+ assert(素馨(data), expect);
3
3
  };
4
4
  test(`&{--a:1;a{opacity:--a}}`, `a{opacity:1;}`);
5
5
  test(`:root{--a:1}a{opacity:--a}`, `a{opacity:1;}`);
@@ -54,12 +54,15 @@ test(`b{a:darken(#6cd205, 20%)}`, `b{a:#58be00;}`);
54
54
  test(`b{a:darken(#7ff,10%)}`, `b{a:#6df5f5;}`);
55
55
 
56
56
  test(`:not(a):not(b){c:d}`, `:not(a):not(b){c:d;}`);
57
- assert(richcss(`:not(a):not(b){c:d}`, 'abc'), `abc :not(a):not(b){c:d;}`);
58
- assert(richcss(`&:not(a):not(b){c:d}`, 'abc'), `abc:not(a):not(b){c:d;}`);
59
- assert(richcss(`:scope{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
60
- assert(richcss(`:root{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
61
- assert(richcss(`&{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
62
- assert(richcss(`:root>a{&:not(a):not(b){c:d}}`, '.abc-'), `.abc->a:not(a):not(b){c:d;}`);
63
- assert(richcss(`a>:root{&:not(a):not(b){c:d}}`, '.abc-'), `a>.abc-:not(a):not(b){c:d;}`);
57
+ test(`a>{b{a:b}}`, `a>b{a:b;}`);
58
+ test(`a >{b{a:b}}`, `a>b{a:b;}`);
59
+ test(`a{>b{a:b}}`, `a>b{a:b;}`);
60
+ assert(素馨(`:not(a):not(b){c:d}`, 'abc'), `abc :not(a):not(b){c:d;}`);
61
+ assert(素馨(`&:not(a):not(b){c:d}`, 'abc'), `abc:not(a):not(b){c:d;}`);
62
+ assert(素馨(`:scope{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
63
+ assert(素馨(`:root{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
64
+ assert(素馨(`&{&:not(a):not(b){c:d}}`, 'abc'), `abc:not(a):not(b){c:d;}`);
65
+ assert(素馨(`:root>a{&:not(a):not(b){c:d}}`, '.abc-'), `.abc->a:not(a):not(b){c:d;}`);
66
+ assert(素馨(`a>:root{&:not(a):not(b){c:d}}`, '.abc-'), `a>.abc-:not(a):not(b){c:d;}`);
64
67
 
65
- assert(richcss(`.a (){ &:after{abc:1}} .b{.a();}`, '.abc-'), `.abc- .b:after{abc:1;}`);
68
+ assert(素馨(`.a (){ &:after{abc:1}} .b{.a();}`, '.abc-'), `.abc- .b:after{abc:1;}`);
@@ -1,3 +1,4 @@
1
+ console.error("图标组件的服务端已从efront移除,请勿使用!");
1
2
  var setBackGround, icon, icn;
2
3
  var binaryImagePathReg = /^https?\:|\.(?:png|gif|bmp|jpe?g)$/i;
3
4
  if (/MSIE\s*[2-8]/.test(navigator.userAgent)) {
@@ -9,3 +9,5 @@
9
9
  3.x With a self built grammar parser, `efront` no longer relies on `esprima`, `esmangle`, and `escodegen`. The self compilation time has gradually decreased from the original 10 minute Github workflow to about 2 minutes.
10
10
 
11
11
  4.0 No longer relying on `typescript` (nearly 170000 lines of source code), the compilation speed has increased by four times, the memory usage has been reduced to 1/8 of the original, and the self compilation time on GitHub has also been reduced to about 15 seconds.
12
+
13
+ 4.1 No longer relying on `less-node` or `pngjs`, while the `less-node` is replaced with [suxin](https://www.npmjs.com/package/suxin) from `efront`.
@@ -362,7 +362,7 @@
362
362
  if (v === false) alert(i18n`暂不支持翻译其他语言`, 'warn');
363
363
  },
364
364
  test(a) {
365
- return /[\u3400-\ufad9\u{20000}-\u{2a6d6}\u{2fa1d}]/u.test(a.text);
365
+ return !!a.fanyi || /[\u3400-\ufad9\u{20000}-\u{2a6d6}\u{2fa1d}]/u.test(a.text);
366
366
  }
367
367
  }
368
368
  ]
@@ -6,37 +6,37 @@
6
6
  var _value = 0;
7
7
  var parseFloat = (a, b) => new BigNumber(a, b);
8
8
  var value = {
9
- get 十进制() {
9
+ get [i18n`十进制`]() {
10
10
  return _value;
11
11
  },
12
- set 十进制(v) {
12
+ set [i18n`十进制`](v) {
13
13
  _value = parseFloat(v)
14
14
  },
15
- get 十六进制() {
15
+ get [i18n`十六进制`]() {
16
16
  return _value.toString(16);
17
17
  },
18
- set 十六进制(v) {
18
+ set [i18n`十六进制`](v) {
19
19
  _value = parseFloat(v, 16);
20
20
  },
21
- get 二进制() {
21
+ get [i18n`二进制`]() {
22
22
  return _value.toString(2);
23
23
  },
24
- set 二进制(v) {
24
+ set [i18n`二进制`](v) {
25
25
  _value = parseFloat(v, 2);
26
26
  },
27
- get 八进制() {
27
+ get [i18n`八进制`]() {
28
28
  return _value.toString(8)
29
29
  },
30
- set 八进制(v) {
30
+ set [i18n`八进制`](v) {
31
31
  _value = parseFloat(v, 8)
32
32
  },
33
- get 三十六进制() {
33
+ get [i18n`三十六进制`]() {
34
34
  return _value.toString(36);
35
35
  },
36
- set 三十六进制(v) {
36
+ set [i18n`三十六进制`](v) {
37
37
  _value = parseFloat(v, 36);
38
38
  },
39
- get 浮点数机器码() {
39
+ get [i18n`浮点数机器码`]() {
40
40
  var v = +_value;
41
41
  var s = /^-/.test(v);
42
42
  if (s) v = -v;
@@ -46,7 +46,7 @@
46
46
  v = s << 31 | i << 23 | v & 0x7fffff;
47
47
  return [v >> 24 & 0xff, v >> 16 & 0xff, v >> 8 & 0xff, v & 0xff].map(hex).join('');
48
48
  },
49
- set 浮点数机器码(v) {
49
+ set [i18n`浮点数机器码`](v) {
50
50
  v = parseInt(v, 16);
51
51
  var s = v >> 31;
52
52
  var i = v >> 23 & 0xff;
@@ -56,7 +56,7 @@
56
56
  if (s) v = -v;
57
57
  _value = v;
58
58
  },
59
- get 双精度机器码() {
59
+ get [i18n`双精度机器码`]() {
60
60
  var s = /^-/.test(_value);
61
61
  var v = window.parseFloat(_value);
62
62
  if (s) v = -v;
@@ -72,7 +72,7 @@
72
72
  v >> 8 & 0xff, v & 0xff
73
73
  ].map(hex).join('');
74
74
  },
75
- set 双精度机器码(v) {
75
+ set [i18n`双精度机器码`](v) {
76
76
  var s = parseInt(v[0], 16) >> 3;
77
77
  var i = parseInt(v.slice(0, 3), 16) & 0x7ff;
78
78
  v = parseInt(v.slice(3), 16);
@@ -9,3 +9,5 @@
9
9
  3.x版本 `efront`拥有自建的语法解析器,不再依赖`esprima`、`esmangle`、`escodegen`,自我编译耗时由原来的10分钟github工作流,逐步减少到2分钟左右。
10
10
 
11
11
  4.0版本 不再依赖`typescipt`(近17万行源码),编译速度再次提升4倍,占用内存减少到原来的1/8,github上自我编译时间也减少到15秒左右。
12
+
13
+ 4.1版本 不再依赖`less-node`和`pngjs`,其中`less-node` 由`efront`自建的css工具[素馨](https://www.npmjs.com/package/suxin)代替。
@@ -200,7 +200,7 @@
200
200
  var cssWrap = `css-` + +new Date;
201
201
  if (scope.doc.test.indexOf(lessName) >= 0) {
202
202
  lessData = await cross("get", "./components:" + modName + ".less");
203
- lessData = compile$richcss(lessData.responseText, "." + cssWrap);
203
+ lessData = compile$素馨(lessData.responseText, "." + cssWrap);
204
204
  if (code.isExpressQueue()) {
205
205
  codetext = `return cless(${codetext},\`${lessData}\`,"${cssWrap}")`;
206
206
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.0.58",
3
+ "version": "4.1.0",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {