efront 4.35.3 → 4.35.4

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.
@@ -40,6 +40,9 @@
40
40
  - zh-CN: 禁用
41
41
  en: Disable
42
42
 
43
+ - zh-CN: 代码结构错误
44
+ en: Code structure error
45
+
43
46
  - zh-CN: 复制失败!
44
47
  en: Copy failed!
45
48
 
@@ -54,6 +54,32 @@ class Table extends Array {
54
54
  });
55
55
  this.update();
56
56
  }
57
+ clone() {
58
+ var t = new Table;
59
+ t.fields = this.fields;
60
+ t.source = this.source;
61
+ t.searchFields = this.searchFields;
62
+ t.summaryFields = this.summaryFields;
63
+ return t;
64
+ }
65
+ toSorted(field) {
66
+ var t = this.clone();
67
+ t.sort(field);
68
+ return t;
69
+ }
70
+ toReversed() {
71
+ var t = this.clone();
72
+ t.length = this.length;
73
+ for (var cx = 0, dx = this.length; cx < dx; cx++) {
74
+ t[dx - cx] = this[cx];
75
+ }
76
+ return t;
77
+ }
78
+ toSpliced() {
79
+ var t = this.clone();
80
+ t.splice.apply(t, arguments);
81
+ return t;
82
+ }
57
83
  unsort() {
58
84
  this.sorted = null;
59
85
  this.update();
@@ -0,0 +1,24 @@
1
+ if (RegExp.escape) return RegExp.escape;
2
+ var tnvfr = 'tnvfr';
3
+ var replaceFirst = function (m) {
4
+ return "\\x" + m.charCodeAt().toString(16)
5
+ }
6
+ // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Lexical_grammar#white_space
7
+ // https://util.unicode.org/UnicodeJsps/list-unicodeset.jsp?a=%5Cp%7BGeneral_Category%3DSpace_Separator%7D
8
+ var syntaxReg = /(^[0-9a-fA-F])|([\^\$\\\.\*\+\?\(\)\[\]\{\}\|\/])|([,\-\=\<\>#\&\!%\:;@~'`"\x20\xa0])|([\u0009-\u000d])|([\ud800-\udfff\ufeff\u2028\u2029\u1680\u2000-\u200a\u202f\u205f\u3000])/g;
9
+ var replaceSynax = function (_, z, a, b, c, d) {
10
+ if (z) return replaceFirst(z);
11
+ if (a) return "\\" + a;
12
+ if (b) return "\\x" + b.charCodeAt().toString(16);
13
+ if (c) return "\\" + tnvfr.charAt(c.charCodeAt() - 9);
14
+ if (d) {
15
+ d = d.charCodeAt();
16
+ if (d <= 0xff) return "\\u00" + d.toString(16);
17
+ return "\\u" + d.toString(16);
18
+ }
19
+ return _;
20
+ }
21
+ function escapeRegExp(string) {
22
+ return string.replace(syntaxReg, replaceSynax)
23
+
24
+ }
@@ -0,0 +1,35 @@
1
+ var escape = RegExp.escape;
2
+ delete RegExp.escape;
3
+ var escapeRegExp = require("./escapeRegExp");
4
+ var test = function (a) {
5
+ assert(escapeRegExp(a), escape(a))
6
+ };
7
+
8
+ test('0')
9
+ test('9')
10
+ test('a')
11
+ test('b')
12
+ test('c')
13
+ test('d')
14
+ test('e')
15
+ test('f')
16
+ test('foo')
17
+ test(' ');
18
+ test('\u00a0')
19
+ test('\u0085')
20
+ test('\ufeff')
21
+ test('\ufffe')
22
+ test('\u8fff')
23
+ test('\u8fff')
24
+ test('\u1680')
25
+ test('\u2000')
26
+ test('\u2009')
27
+ test('\u0009')
28
+ test('\u0008')
29
+ test('\u000d')
30
+ test('\u202f')
31
+ test('\u2028')
32
+ test('\u2029')
33
+ test('\u3000')
34
+ test('\u2000')
35
+ test('\u1680')
@@ -3,6 +3,7 @@ var mo3 = (o, args) => args.length === 1 ? args[0] + `<ms>${o}</ms>` : args.join
3
3
  var ms = s => `<ms>${s}</ms>`;
4
4
  var mroot = (d, z) => `<mroot>${d}${z}</mroot>`;
5
5
  var msqrt = a => `<msqrt>${a}</msqrt>`;
6
+ var mdot = a => `<mover><mn>${a}</mn><ms>・</ms></mover>`;
6
7
  var mi = s => `<mi>${s}</mi>`;
7
8
  var mn = s => `<mn>${s}</mn>`;
8
9
  var mi2 = (s, a, n) => {
@@ -69,6 +70,31 @@ var 三角函数 = {
69
70
  return mi2("arccsc", a, n);
70
71
  },
71
72
  };
73
+ var roman = {
74
+ I: 1, V: 5, X: 10, L: 50, C: 100, D: 500, M: 1000
75
+ };
76
+ var toRoman = function (n) {
77
+ if (n > 3888 || (n | 0) !== n || n < 1) return `<mo>(</mo><ms>Roman</ms><mo>,</mo><mn>${n}</mn><mo>)</mo>`;
78
+ var [a = 0, b = 0, c = 0, d = 0] = n.toString().split("").reverse();
79
+ a = ["", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"][a];
80
+ b = ["", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC"][b];
81
+ c = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM"][c];
82
+ d = ["", "M", "MM", "MMM"][d];
83
+ return d + c + b + a;
84
+ };
85
+ var circles = "①②③④⑤⑥⑦⑧⑨⑩";
86
+
87
+ var tabs = {
88
+ roman(...args) {
89
+ return "&nbsp;&nbsp;" + args
90
+ .map(toRoman)
91
+ .map(a => `<mn>${a}</mn>`)
92
+ .join('<ms>&ensp;</ms>');
93
+ },
94
+ circle(...args) {
95
+ return args.map(n => circles.charAt(n - 1)).map(a => `<mn>${a}</mn>`).join('');
96
+ }
97
+ }
72
98
 
73
99
  var funcmap = {
74
100
  "+"(...args) {
@@ -86,6 +112,12 @@ var funcmap = {
86
112
  "*"(...args) {
87
113
  return args.join("");
88
114
  },
115
+ ">="(...args) {
116
+ return mo3("≥", args);
117
+ },
118
+ "<="(...args) {
119
+ return mo3("≤", args);
120
+ },
89
121
  "vector"(name, ...args) {
90
122
  name = `<mover>${name}<mo>→</mo></mover>`;
91
123
  if (args.length) {
@@ -122,6 +154,9 @@ var funcmap = {
122
154
  },
123
155
  sigma: series,
124
156
  series,
157
+ group(...args) {
158
+ return `<mo>{</mo><mtable><mtr><mtd>${args.join("</mtd></mtr><mtr><mtd>")}</mtd></mtr></mtable>`
159
+ },
125
160
  '!='(...args) {
126
161
  return mo3("≉", args);
127
162
  },
@@ -189,6 +224,9 @@ var puncmap = {
189
224
  "_"(a, ...args) {
190
225
  return qt(msub, a, args);
191
226
  },
227
+ corner(name) {
228
+ return mo2("∠", name);
229
+ },
192
230
 
193
231
  // "积分": "∫",
194
232
  // "summa": "∫",
@@ -256,6 +294,9 @@ var br = function () {
256
294
  };
257
295
  function toString(obj, p, deep) {
258
296
  if (obj instanceof Array) {
297
+ if (deep == 1 && obj.length === 2 && obj[1].tab) {
298
+ return toString(obj[0], 0, deep) +"</mtd><mtd>"+ obj.slice(1, obj.length).map(a => toString(a, 0, 0)).join("</mtd><mtd>");
299
+ }
259
300
  deep++;
260
301
  var args = obj.map(a => toString(a, deep > 1 ? 0 : p, deep));
261
302
  deep--;
@@ -277,6 +318,35 @@ function toString(obj, p, deep) {
277
318
  for (var k in obj) break;
278
319
  if (!k) return '';
279
320
  var origin = obj[k];
321
+ if (k === '..') {
322
+ var [prefix, rep, dots, e] = origin;
323
+ prefix = String(prefix);
324
+ if (typeof rep === 'number') rep = String(rep);
325
+ if (rep && !/\./.test(prefix)) prefix += '.';
326
+ if (typeof e === 'number') e = String(e);
327
+ if (!rep) rep = '';
328
+ else if (rep.length === 1) {
329
+ rep = mdot(rep);
330
+ }
331
+ else if (rep.length >= 2) {
332
+ rep = mdot(rep.charAt(0)) + mn(rep.slice(1, rep.length - 1)) + mdot(rep.charAt(rep.length - 1));
333
+ }
334
+ else rep = mn(rep);
335
+ if (dots) dots = mn(dots);
336
+ else dots = '';
337
+ if (e) e = `<mo>×</mo><msup><mn>10</mn><mn>${e}</mn></msup>`;
338
+ else e = '';
339
+ prefix = mn(prefix);
340
+ return mrow([prefix, rep, dots, e].join(''), e ? p >= pmap["*"] : false, deep);
341
+ }
342
+ if (k === 'tab') {
343
+ k = origin.shift();
344
+ if (!origin.length || !(k in tabs)) {
345
+ var args = origin.map(a => toString(a, 0, deep));
346
+ return mrow(`<ms>(</ms>${k}${args.length ? "<ms>,</ms>" + args.join('<ms>,</ms>') : ''}<ms>)</ms>`, -1, deep);
347
+ }
348
+ return mrow(tabs[k](...origin), -1, deep);
349
+ }
280
350
  if (k in 三角函数) {
281
351
  var args = origin.map(a => toString(a, pmap["*"], 0));
282
352
  obj = 三角函数[k](...args);
@@ -296,6 +366,7 @@ function toString(obj, p, deep) {
296
366
  return mrow(`<mi>${希腊[k] || k}</mi>${mrow(args instanceof Array ? args.join('<mo>,</mo>') : args, true)}`, false, deep);
297
367
  }
298
368
  if (args instanceof Array) {
369
+
299
370
  if (k === '*') {
300
371
  var allnum = true;
301
372
  var bx = 1;
@@ -1,4 +1,6 @@
1
1
  # 数学公式生成工具
2
+ 在2023年及以后的浏览器(Chrome109, Firefox1, Safari5.1, ...)中可用
3
+ 受支持的浏览器参考 [https://developer.mozilla.org/zh-CN/docs/Web/MathML](https://developer.mozilla.org/zh-CN/docs/Web/MathML)
2
4
  使用方法有如下两种:
3
5
  1. 直接传入解析结构
4
6
  ```javascript
@@ -252,6 +254,90 @@ series(公式主体,n=1,+Infinity)
252
254
  H[+], O[2-]
253
255
  ```
254
256
 
257
+ * 无限小数
258
+ ```mathscript
259
+ // 循环节
260
+ 0.3.;// 三分之一
261
+ 0.142857.;// 七分之一
262
+ 0.142.857142.;//七分之一
263
+ 0.142.857142;//七分之一
264
+ ```
265
+ ```math
266
+ 0.3.;// 三分之一
267
+ 0.142857.;// 七分之一
268
+ 0.142.857142.;//七分之一
269
+ 0.142.857142;//七分之一
270
+ ```
271
+ ```mathscript
272
+ // 省略号,如果末尾出现多于一个小数点,这些小数点将被追加到数值结尾
273
+ 0.3...
274
+ 3444..
275
+ 66....
276
+ ```
277
+ ```math
278
+ 0.3...
279
+ 3444..
280
+ 66....
281
+ ```
282
+ * 科学计数法
283
+ ```mathscript
284
+ 1e3;
285
+ 1e-3;
286
+ 1.3.e3;
287
+ a*1.3e3
288
+ ```
289
+ ```math
290
+ 1e3;
291
+ 1e-3;
292
+ 1.3.e3;
293
+ a*1.3e3
294
+ ```
295
+ * 方程组
296
+ ```mathscript
297
+ group(
298
+ a+1=b;
299
+ a+b=3;
300
+ )
301
+ ```
302
+ ```math
303
+ group(
304
+ a+1=b,
305
+ a+b**2=3
306
+ )
307
+ ```
308
+ * 标号
309
+ ```mathscript
310
+ tab(1); // 带小括号的数字
311
+ tab(circle,1,2,3,10); // 带圆圈的数字
312
+ tab(roman,1); //罗马数字
313
+ tab(roman,3888); //罗马数字
314
+ group(// 方程组中使用
315
+ x+y=10 tab(circle,1),
316
+ x*y=25 tab(circle,2)
317
+ )
318
+ ```
319
+ ```math
320
+ tab(1);
321
+ tab(circle,1,2,3,10);
322
+ tab(roman,1);
323
+ tab(roman,3888);
324
+ group(
325
+ x+y=10 tab(circle,1),
326
+ x*y=25 tab(circle,2)
327
+ )
328
+ ```
329
+ * 角
330
+ ```mathscript
331
+ corner(1);
332
+ corner(A);
333
+ corner(BAC);
334
+ ```
335
+ ```math
336
+ corner(1);
337
+ corner(A);
338
+ corner(BAC);
339
+ ```
340
+
255
341
  ## 希腊字母对照表如下
256
342
  按此表中的英文单词命名的变量将自动转换为希腊字母
257
343
  ```javascript
@@ -2,7 +2,7 @@ var spaceDefined = [
2
2
  "\\u0002",
3
3
  "\\b-\\r",// "\\b"/*8*/, "\\t"/*9*/, "\\n"/*10*/, "\\v"/*11*/, "\\f"/*12*/, "\\r"/*13*/,
4
4
  " "/*32*/,
5
- "\\u007f", "\\u00a0", "\\u00ad", "\\u034f", "\\u061c",
5
+ "\\u007f", "\\u0085"/*next line*/, "\\u00a0", "\\u00ad", "\\u034f", "\\u061c",
6
6
  "\\u115f", "\\u1160",
7
7
  "\\u17b4", "\\u17b5",
8
8
  "\\u180b-\\u180e",
@@ -6,10 +6,11 @@ const {
6
6
  createString,
7
7
  } = require("./common");
8
8
  var powermap = require("./powermap");
9
-
9
+ var number_rep = /^[+-]?([\d\.]+)(?:e([+-]?\d+))?$/;
10
10
  class Math extends Program {
11
- number_reg = /^(\d+(\.\d+)?|\.\d+)$/;
11
+ number_reg = /^(\d+(?:\.\d+){0,2}|(?:\.\d+){1,2}|(?:\d+\.){1,3})\.*(?:e[+-]?\d+)?$/;
12
12
  powermap = Object.assign({}, powermap);
13
+ value_reg = /^(false|true|null|Infinity|NaN|undefined|eval|this|arguments)$/;
13
14
  constructor() {
14
15
  super();
15
16
  var pmap = this.powermap;
@@ -101,7 +102,12 @@ var getRows = function (code) {
101
102
  return trs;
102
103
  }
103
104
  var getArgs = function (a) {
104
- return split(a, ',').map(toFlat);
105
+ return split(a, ',').map(a => {
106
+ var cells = createExpressList(a);
107
+ if (!cells[cells.length - 1]?.first) cells.pop();
108
+ if (cells.length === 1) return toFlat(cells[0]);
109
+ return cells.map(toFlat);
110
+ });
105
111
  }
106
112
  var uncup = function (cup) {
107
113
  if (cup.iscup && cup.length <= 1) cup = cup[0];
@@ -127,7 +133,7 @@ var back = function (cache) {
127
133
  cache.splice(s, cache.length - s);
128
134
  }
129
135
  var toFlat = function (exp) {
130
- if (exp.length === 1 && exp[0].type !== SCOPED) return exp[0].text;
136
+ if (exp.length === 1 && exp[0].type !== SCOPED && !exp[0].isdigit) return exp[0].text;
131
137
  var bx = 0;
132
138
  var p0 = 0;
133
139
  var left = [];
@@ -235,12 +241,37 @@ var toFlat = function (exp) {
235
241
  }
236
242
  if (e.isdigit) a: {
237
243
  var et = e.text;
238
- var v = +et;
244
+ var [, a, e10] = number_rep.exec(et);
245
+ var b = a.split('.');
246
+ if (b.length > 2 || e10) {
247
+ var nrep = b[2] || b[1];
248
+ var npre = b[0];
249
+ if (b[2]) {
250
+ npre += "." + b[1];
251
+ }
252
+ else if (b[1] ? b.length <= 2 || b.length > 3 : b.length <= 1 || b.length > 2) {
253
+ if (nrep) npre += "." + nrep;
254
+ nrep = '';
255
+ }
256
+ if (String(+npre) === npre) npre = +npre;
257
+ if (String(+nrep) === nrep) nrep = +nrep;
258
+ var v = [npre, nrep];
259
+ if (b.length > (b[2] ? 4 : b[1] ? 3 : 2)) v.push(b.slice(b[2] ? 3 : b[1] ? 2 : 1, b.length).join('.') + ".");
260
+ else if (e10) v.push('');
261
+ if (e10) {
262
+ if (String(+e10) === e10) e10 = +e10;
263
+ v.push(e10);
264
+ }
265
+ v = { "..": v };
266
+ left.push(v);
267
+ continue;
268
+ }
269
+ var v = +a;
239
270
  if (/^\+/.test(et)) {
240
- if (String(v) !== et.slice(1)) break a;
271
+ if (String(v) !== a.slice(1)) break a;
241
272
  v = make("+", '', v);
242
273
  }
243
- if (String(v) !== et) break a;
274
+ if (String(v) !== a) break a;
244
275
  left.push(v);
245
276
  continue;
246
277
  }
@@ -21,6 +21,10 @@ t(`a(b,c)`)
21
21
  t(`[b,c]'`)
22
22
  t(`H[+]`)
23
23
  t(`H[2-]`)
24
- t.debug = true;
25
24
  t(`H'*1`)
26
- t(`cos(theta,2)*E +(1 - cos(theta))*K'*K+sin(theta)*[0,-K_2,K_1;K_2,0,-K_0;-K_1,K_0,0]`)
25
+ t(`cos(theta,2)*E +(1 - cos(theta))*K'*K+sin(theta)*[0,-K_2,K_1;K_2,0,-K_0;-K_1,K_0,0]`)
26
+ t.debug = true;
27
+ t(`group(
28
+ x+y=10 tab(circle,1),
29
+ x*y=25 tab(circle,2)
30
+ )`)
@@ -16,9 +16,10 @@ class 素玉 extends Program {
16
16
 
17
17
  var rarg = new 素玉;
18
18
  rarg.quotes.push(["url(", ")"]);
19
- var replaceHReg = new RegExp(numberReg.source + /\s*([\/\*])\s*/.source + numberReg.source, 'gi');
20
- var replaceLReg = new RegExp(numberReg.source + /(\s*[\+\-]\s+|[\+\-])/.source + numberReg.source, 'gi');
21
- var replaceTReg = new RegExp(numberReg.source + /\s*[\/\*\+\-]\s*/.source + numberReg.source, 'i');
19
+ var numberReg2 = /([\-\+]?(?:\d+(?:\.\d*)?|\.\d+))([a-zH]+|%)?/;
20
+ var replaceHReg = new RegExp(numberReg2.source + /\s*([\/\*])\s*/.source + numberReg2.source, 'gi');
21
+ var replaceLReg = new RegExp(numberReg2.source + /(\s*[\+\-]\s+|[\+\-])/.source + numberReg2.source, 'gi');
22
+ var replaceTReg = new RegExp(numberReg2.source + /\s*[\/\*\+\-]\s*/.source + numberReg2.source, 'i');
22
23
  var remove_quote = a => a.replace(/~\s*(['"`])((?:\\[\s\S]|[^'"`\\])*?)\1/g, '$2');
23
24
  var keepdot = function (a) {
24
25
  var g = Math.pow(10, Math.log10(a) | 0) * 1000;
@@ -78,6 +78,12 @@ test(`a >{b{a:b}}`, `a>b{a:b;}`);
78
78
  test(`a{>b{a:b}}`, `a>b{a:b;}`);
79
79
  test(`.type(@type,@media) {.@{type} {&:before{content:"@{media}";}}}.type(videoinput, "相机");`, `.videoinput:before{content:"相机";}`);
80
80
  test(`.type(@type,@media) {.@{type} {&:before{content:"@{media}";}}}.type(videoinput, 相机);`, `.videoinput:before{content:"相机";}`);
81
+ test(`
82
+ @avatar-top: -12px;
83
+ a{
84
+ top: 12px- @avatar-top;
85
+ }
86
+ `,'a{top:24px;}');
81
87
  common.createString.debug = true;
82
88
  Program.debug = true;
83
89
  test(`@type(@len){
@@ -89,7 +95,7 @@ test(`@type(@len){
89
95
  }
90
96
  }
91
97
  @type(1)
92
- `, '');
98
+ `, '>[nlist]{width:1.9em;}');
93
99
  Program.debug = false;
94
100
  common.createString.debug = false;
95
101
  assert(素馨(`:not(a):not(b){c:d}`, 'abc'), `abc :not(a):not(b){c:d;}`);
@@ -132,4 +138,4 @@ assert(素馨(`h1{a:c; span{a:b} i{a:b} }`, '.home-', true), `.home- h1 span{a:b
132
138
  assert(素馨(`h1{ button{&:not(hover){.track{a:b}}} }`, '.home-', true), `.home- h1 button:not(hover) .track{a:b;}`);
133
139
  assert(素馨(`@type(@a){&[type=@a]{a:1}} @type(white)`, '.btn-', true), `.btn-[type=white]{a:1;}`);
134
140
  assert(素馨(`a,b{c,d{ g&{e:f}}}`, '', true), `a gc,b gc,a gd,b gd{e:f;}`);
135
- assert(素馨(`a{a:lch(from rgb(20 20 20) l c h)}`, '', true), `a{a:lch(from rgb(20 20 20) l c h);}`);
141
+ assert(素馨(`a{a:lch(from rgb(20 20 20) l c h)}`, '', true), `a{a:lch(from rgb(20 20 20) l c h);}`);
@@ -52,6 +52,7 @@ padding {
52
52
 
53
53
  & {
54
54
  height: 100%;
55
+ overflow: hidden;
55
56
  }
56
57
 
57
58
  fileitem {
@@ -40,7 +40,8 @@ var colors = module.exports = {
40
40
  BgCyan2: "\x1b[106m",
41
41
  BgWhite2: "\x1b[107m",
42
42
  };
43
- colors.label = colors.strap = colors.value = colors.FgBlue2;
43
+ colors.tag = colors.FgBlue2;
44
+ colors.label = colors.strap = colors.value = colors.FgWhite;
44
45
  colors.comment = colors.FgGreen;
45
46
  colors.invoke = colors.method = colors.FgYellow2;
46
47
  colors.express = colors.property = colors.FgCyan2;
@@ -36,7 +36,7 @@ var replaceArg = function (arg) {
36
36
  function build(func, argNames, argsArr) {
37
37
  var newf = String(func).replace(regexps, rep);
38
38
  return Function.apply(null, argNames.map(replaceArg).concat("return " + newf))
39
- .apply(this, replaceArg(argsArr));
39
+ .apply(this, argsArr.map(replaceArg));
40
40
  }
41
41
  var arriswise = function (func, args = []) {
42
42
  if (isFunction(args.slice)) {
@@ -1,2 +1,2 @@
1
1
  @border-solid: #0003;
2
- @border-focus: #06fe;
2
+ @border-focus: #29c;
@@ -151,7 +151,7 @@ function confirm() {
151
151
  Promise.resolve().then(function () {
152
152
  if (isMounted(element)) return;
153
153
  element.$mask = true;
154
- popup(element, target || [.5, .5], target ? 'rhomb' : true);
154
+ popup(element, target || [.5, .5], target ? 'rhomb' : target !== false);
155
155
  element.focus();
156
156
  if (!target) drag.on(head, element);
157
157
  else {
@@ -141,7 +141,7 @@ var popup_view = function (element, target, style) {
141
141
  }
142
142
  else if (target instanceof Array) {
143
143
  if (isNode(style) && style.$mask) addMask(element, style);
144
- else if (typeof style === 'boolean') addMask(element);
144
+ else if (typeof style === 'boolean' && style) addMask(element);
145
145
  popup_to_point(element, target);
146
146
  }
147
147
  else if (target === true || target < 0) {
@@ -35,6 +35,7 @@ function prompt() {
35
35
  var submit = null;
36
36
  var wrap = false;
37
37
  var value = '';
38
+ var mask = false;
38
39
  var attrs = {
39
40
  type: null,
40
41
  max: null,
@@ -48,6 +49,7 @@ function prompt() {
48
49
  else if (typeof arg === 'string') msg = arg;
49
50
  else if (isArray(arg)) opts = arg;
50
51
  else if (isFunction(arg) || arg instanceof RegExp) check = arg;
52
+ else if (typeof arg === 'boolean') mask = arg;
51
53
  else if (isObject(arg)) {
52
54
  if (isFunction(arg.test)) check = arg;
53
55
  if (isFunction(arg.check)) check = arg.check;
@@ -55,6 +57,7 @@ function prompt() {
55
57
  if (isString(arg.msg || arg.title)) msg = arg.msg || arg.title;
56
58
  if (isHandled(arg.info)) info = arg.info;
57
59
  if (isHandled(arg.value)) value = arg.value;
60
+ if (isHandled(arg.mask)) mask = arg.mask;
58
61
  for (var k in attrs) {
59
62
  if (k in arg) attrs[k] = arg[k];
60
63
  }
@@ -117,7 +120,7 @@ function prompt() {
117
120
  } else {
118
121
  c.errored = true;
119
122
  }
120
- });
123
+ }, { target: mask });
121
124
  on('mounted')(ipt, function () {
122
125
  if (setDisable) setDisable();
123
126
  setTimeout(function () {
@@ -44,6 +44,6 @@
44
44
  border-radius: 7px;
45
45
  height: 100%;
46
46
  width: 100%;
47
- background-color: #0092cc;
47
+ background-color: #29c9;
48
48
  }
49
49
  }
@@ -611,7 +611,7 @@ function table(elem) {
611
611
  model,
612
612
  scrollbar,
613
613
  sort(f) {
614
- this.data.sort(f);
614
+ this.data = this.data.toSorted(f);
615
615
  },
616
616
  setWidth(target, f) {
617
617
  css(target, { width: f.width });
@@ -147,6 +147,7 @@ function ybox(generator) {
147
147
  } else {
148
148
  var wheelTime = 0;
149
149
  onmousewheel(_box, function (event) {
150
+ if (event.defaultPrevented) return;
150
151
  event.preventDefault();
151
152
  var isNew = event.timeStamp - wheelTime > 120;
152
153
  wheelTime = event.timeStamp;
@@ -39,10 +39,14 @@
39
39
  color: #b5cea8;
40
40
  }
41
41
 
42
- label {
42
+ tag {
43
43
  color: #569cd6;
44
44
  }
45
45
 
46
+ label {
47
+ color: #ccc;
48
+ }
49
+
46
50
  selector {
47
51
  color: #d7ba7d;
48
52
  }
@@ -71,6 +71,7 @@ var codecolor = function (c) {
71
71
  };
72
72
  var setExpress = function (o, label) {
73
73
  if (!o.text || o.wraped) return;
74
+ if (o.type !== EXPRESS) return;
74
75
  o.wraped = true;
75
76
  var keys = o.text.split(".");
76
77
  var pdot = !keys[0] && keys.length > 1;
@@ -124,6 +125,13 @@ var codecolor = function (c) {
124
125
  switch (o.type) {
125
126
  case LABEL:
126
127
  o.text = wrap(o.text, 'label');
128
+ var label = o.tack;
129
+ used[o.tack].forEach(o => {
130
+ if (o.text !== label) return;
131
+ var prev = o.prev;
132
+ if (!prev || prev.type !== STRAP || prev.isend || !/^(break|continue)$/.test(prev.text)) return;
133
+ o.text = wrap(o.text, 'label');
134
+ })
127
135
  break;
128
136
  case QUOTED:
129
137
  if (o.length || !o.text) {
@@ -157,7 +165,7 @@ var codecolor = function (c) {
157
165
  if (o.tag_leave) o.tag_leave = wrapcode(o.tag_leave, 'stamp');
158
166
  if (o.entry) o.entry = wrapcode(o.entry, 'stamp');
159
167
  if (o.leave) o.leave = wrapcode(o.leave, 'stamp');
160
- o.tag = wrapcode(o.tag, 'label');
168
+ o.tag = wrapcode(o.tag, 'tag');
161
169
  o.forEach(setcolor);
162
170
  break;
163
171
  case SCOPED:
@@ -9,7 +9,7 @@ var rows = function (type, text) {
9
9
  type = String(type).toLowerCase();
10
10
  if (type in 语言) {
11
11
  var c = 语言[type](text);
12
- 标签化(c);
12
+ 标签化(c, c.envs);
13
13
  text = c.toString();
14
14
  }
15
15
  else text = 标签化.encode(text);