efront 4.23.5 → 4.23.6
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.
- package/coms/basic/spaces.js +2 -2
- package/coms/compile/Program.js +5 -3
- package/coms/compile/common.js +14 -0
- package/coms//350/214/250/350/217/260/list.js +1 -1
- package/coms//350/214/250/350/217/260//347/274/226/350/276/221/346/241/206.xht +65 -15
- package/package.json +1 -1
- package/public/efront.js +1 -1
- package/public/pivot/page/auth/login.txt +1 -1
- package/public/pivot/page/cert/main.txt +1 -1
- package/public/pivot/page/cert/orders.txt +1 -1
- package/public/pivot/page/cert/update.txt +1 -1
- package/public/pivot/page/db/act.txt +1 -1
- package/public/pivot/page/db/config.txt +1 -1
- package/public/pivot/page/db/edit.txt +1 -1
- package/public/pivot/page/db/list.txt +1 -1
- package/public/pivot//344/270/273/351/241/265.html +2 -2
package/coms/basic/spaces.js
CHANGED
|
@@ -25,8 +25,8 @@ var toHex = a => {
|
|
|
25
25
|
a = Array(5 - a.length).join('0') + a;
|
|
26
26
|
return "\\u" + a;
|
|
27
27
|
};
|
|
28
|
-
spaceDefined.avoid = function (extra_tokens) {
|
|
29
|
-
if (extra_tokens) extra_tokens = extra_tokens.replace(/[^\w]/ig, toHex);
|
|
28
|
+
spaceDefined.avoid = function (extra_tokens, encodeAvoid) {
|
|
29
|
+
if (extra_tokens && encodeAvoid !== false) extra_tokens = extra_tokens.replace(/[^\w]/ig, toHex);
|
|
30
30
|
var u0 = "[^\\ud80c][\\udc00-\\udfff]|\\ud80c[^\\udffc]";
|
|
31
31
|
var u1 = "[^\\ud834][\\udc00-\\udfff]|\\ud834[^\\udd73-\\udd7a]";
|
|
32
32
|
return `[^${extra_tokens || ''}${spaceDefined.join('')}]|${u0}|${u1}`;
|
package/coms/compile/Program.js
CHANGED
|
@@ -241,7 +241,10 @@ class Program {
|
|
|
241
241
|
else if (!last || last.type === STAMP && (!(last.text in powermap)) && !last.istype) {
|
|
242
242
|
if (powermap[o.text] > powermap["="]) o.unary = true;
|
|
243
243
|
}
|
|
244
|
-
else if (last.type === STRAP && !last.isend
|
|
244
|
+
else if (last.type === STRAP && !last.isend
|
|
245
|
+
|| last.type === STAMP && !last.istype && !/^(\+\+|\-\-)$/.test(last.text)
|
|
246
|
+
|| last.type === SCOPED && !last.isExpress
|
|
247
|
+
) {
|
|
245
248
|
o.unary = /^[^=;,\:]$/.test(o.text);
|
|
246
249
|
if (o.unary && /^(\+|\-)$/.test(o.text) && last && last.type === STAMP && /^(\+\+|\-\-)$/.test(last.text)) o.unary = !!last.unary;
|
|
247
250
|
}
|
|
@@ -548,7 +551,6 @@ class Program {
|
|
|
548
551
|
m = match?.[0];
|
|
549
552
|
}
|
|
550
553
|
loop: while (index < text.length) {
|
|
551
|
-
|
|
552
554
|
if (queue.type & (QUOTED | ELEMENT)) {
|
|
553
555
|
var quote = quote_map[queue.entry];
|
|
554
556
|
var reg = quote.reg;
|
|
@@ -1050,7 +1052,7 @@ class Program {
|
|
|
1050
1052
|
scopes = this.compile(scopes);
|
|
1051
1053
|
tokens = Object.keys(tokens).join("");
|
|
1052
1054
|
tokens = this.compile(tokens);
|
|
1053
|
-
var express = `(?:\\\\u\\{[^\\}]+\\}|${spaceDefined.avoid(tokens)})+`;
|
|
1055
|
+
var express = `(?:\\\\u\\{[^\\}]+\\}|${spaceDefined.avoid(tokens, false)})+`;
|
|
1054
1056
|
this.express_reg = new RegExp(`^${express}$`);
|
|
1055
1057
|
this.space_reg = spaceDefined.is_reg;
|
|
1056
1058
|
this.space_exp = spaceDefined.reg;
|
package/coms/compile/common.js
CHANGED
|
@@ -1835,6 +1835,19 @@ var patchArrawScope = function (arraw, origin) {
|
|
|
1835
1835
|
};
|
|
1836
1836
|
};
|
|
1837
1837
|
|
|
1838
|
+
var isDeclareOnly = function (o) {
|
|
1839
|
+
if (!o.kind) return false;
|
|
1840
|
+
while (o) {
|
|
1841
|
+
var q = o.queue;
|
|
1842
|
+
if (!q.kind) break;
|
|
1843
|
+
o = q;
|
|
1844
|
+
}
|
|
1845
|
+
var n = o.next;
|
|
1846
|
+
if (!n) return true;
|
|
1847
|
+
if (n.type !== STAMP || /^[,;]$/.test(n.text)) return true;
|
|
1848
|
+
return false;
|
|
1849
|
+
}
|
|
1850
|
+
|
|
1838
1851
|
module.exports = {
|
|
1839
1852
|
/* 1 */COMMENT,
|
|
1840
1853
|
/* 2 */SPACE,
|
|
@@ -1854,6 +1867,7 @@ module.exports = {
|
|
|
1854
1867
|
needfoot_reg,
|
|
1855
1868
|
unshort,
|
|
1856
1869
|
skipAssignment,
|
|
1870
|
+
isDeclareOnly,
|
|
1857
1871
|
getDeclared,
|
|
1858
1872
|
getBodyWith,
|
|
1859
1873
|
getFuncBody,
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
@ntype(@len) {
|
|
27
27
|
|
|
28
28
|
&[ntype="@{len}"] {
|
|
29
|
-
@w: @len/2+
|
|
29
|
+
@w: @len/2+1.4;
|
|
30
30
|
@bg: --bgcolor;
|
|
31
31
|
|
|
32
32
|
>[nlist],
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
min-height: 100%;
|
|
37
37
|
outline: none;
|
|
38
38
|
|
|
39
|
-
>
|
|
39
|
+
>n,
|
|
40
40
|
>d {
|
|
41
41
|
display: block;
|
|
42
42
|
}
|
|
@@ -89,6 +89,10 @@
|
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
+
>n[current] {
|
|
93
|
+
color: #ccc;
|
|
94
|
+
}
|
|
95
|
+
|
|
92
96
|
>n,
|
|
93
97
|
>d {
|
|
94
98
|
display: block;
|
|
@@ -98,7 +102,7 @@
|
|
|
98
102
|
</style>
|
|
99
103
|
<编辑框 spellcheck=false e-class="上色.className" e-style="{whiteSpace:'pre'}" ntype:="codeSpan">
|
|
100
104
|
<list contenteditable="false" nlist# :src="(r,i) in coderows" -style="{height:codeHeight}">
|
|
101
|
-
<n -bind="i+1"></n>
|
|
105
|
+
<n current:="isCurrent(i)" -bind="i+1"></n>
|
|
102
106
|
</list>
|
|
103
107
|
<list clist# contenteditable="true" :src="(r,i) in coderows" -style="{height:codeHeight}">
|
|
104
108
|
<d -html="r"></d>
|
|
@@ -133,7 +137,11 @@
|
|
|
133
137
|
on('scroll')(coder, function () {
|
|
134
138
|
nlist.refresh();
|
|
135
139
|
clist.refresh();
|
|
136
|
-
})
|
|
140
|
+
});
|
|
141
|
+
var isCurrent = function (i) {
|
|
142
|
+
if (!selection) return false;
|
|
143
|
+
return i >= selection[0] && i <= selection[2];
|
|
144
|
+
};
|
|
137
145
|
var coderows = [], codetext = '';
|
|
138
146
|
coder.setValue = async function (text) {
|
|
139
147
|
codetext = text;
|
|
@@ -143,7 +151,8 @@
|
|
|
143
151
|
coderows = colored;
|
|
144
152
|
codeHistory = [[codetext]];
|
|
145
153
|
historyIndex = 0;
|
|
146
|
-
|
|
154
|
+
refresh();
|
|
155
|
+
render.refresh(coder);
|
|
147
156
|
};
|
|
148
157
|
coder.getValue = function () {
|
|
149
158
|
return codetext;
|
|
@@ -151,6 +160,7 @@
|
|
|
151
160
|
var selection;
|
|
152
161
|
var markAnchorOffset = function () {
|
|
153
162
|
selection = getSelection();
|
|
163
|
+
render.refresh(nlist);
|
|
154
164
|
};
|
|
155
165
|
var getNodeAt = function (row, col) {
|
|
156
166
|
var d = clist.at(row);
|
|
@@ -195,14 +205,13 @@
|
|
|
195
205
|
var [an, ai, fn, fi] = selection;
|
|
196
206
|
[fn, fi] = getNodeAt(fn, fi);
|
|
197
207
|
[an, ai] = fn === an && fi === ai ? [fn, fi] : getNodeAt(an, ai);
|
|
198
|
-
|
|
208
|
+
document_selection.setBaseAndExtent(an, ai, fn, fi);
|
|
199
209
|
}
|
|
200
210
|
var trimspace = (_, a) => a ? "" : " ";
|
|
201
211
|
var 更新 = function () {
|
|
202
212
|
var { scrollTop, scrollLeft } = clist;
|
|
203
213
|
refresh();
|
|
204
|
-
render.refresh(
|
|
205
|
-
render.refresh(nlist);
|
|
214
|
+
render.refresh(coder);
|
|
206
215
|
clist.scrollTop = scrollTop;
|
|
207
216
|
clist.scrollLeft = scrollLeft;
|
|
208
217
|
};
|
|
@@ -210,12 +219,12 @@
|
|
|
210
219
|
var followChar = null, beforeText = false;
|
|
211
220
|
var fixpace = function (event) {
|
|
212
221
|
event.preventDefault();
|
|
213
|
-
|
|
222
|
+
insertText(' ', false);
|
|
214
223
|
};
|
|
215
224
|
var updatechar = function (event) {
|
|
216
225
|
if (event.defaultPrevented) return;
|
|
217
226
|
coderid++;
|
|
218
|
-
var { anchorNode, anchorOffset } =
|
|
227
|
+
var { anchorNode, anchorOffset } = document_selection;
|
|
219
228
|
if (!coder || !anchorNode) return;
|
|
220
229
|
while (anchorNode.nodeType === 1 || anchorOffset === 0) {
|
|
221
230
|
if (anchorNode.nodeType === 1) {
|
|
@@ -296,7 +305,6 @@
|
|
|
296
305
|
beforeText = false;
|
|
297
306
|
followChar = '';
|
|
298
307
|
}
|
|
299
|
-
|
|
300
308
|
};
|
|
301
309
|
var pairsmap = Object.create(null);
|
|
302
310
|
[
|
|
@@ -324,7 +332,17 @@
|
|
|
324
332
|
var getCol = function (node, offset) {
|
|
325
333
|
var d = getTargetIn(clist, node, false);
|
|
326
334
|
if (!d) return;
|
|
327
|
-
if (node.nodeType === 1)
|
|
335
|
+
if (node.nodeType === 1) {
|
|
336
|
+
var childNodes = node.childNodes;
|
|
337
|
+
if (offset < childNodes.length) {
|
|
338
|
+
node = childNodes[offset];
|
|
339
|
+
offset = 0;
|
|
340
|
+
}
|
|
341
|
+
else {
|
|
342
|
+
offset = node.innerText.length;
|
|
343
|
+
node = null;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
328
346
|
while (node && node !== d) {
|
|
329
347
|
var p = node.previousSibling;
|
|
330
348
|
if (p) {
|
|
@@ -342,11 +360,11 @@
|
|
|
342
360
|
return offset;
|
|
343
361
|
};
|
|
344
362
|
var getFocusRow = function () {
|
|
345
|
-
var { focusNode } =
|
|
363
|
+
var { focusNode } = document_selection;
|
|
346
364
|
return getRow(focusNode);
|
|
347
365
|
};
|
|
348
366
|
var getSelection = function () {
|
|
349
|
-
var { focusNode, anchorNode, focusOffset, anchorOffset } =
|
|
367
|
+
var { focusNode, anchorNode, focusOffset, anchorOffset } = document_selection;
|
|
350
368
|
var fn = getRow(focusNode);
|
|
351
369
|
var an = anchorNode === focusNode ? fn : getRow(anchorNode);
|
|
352
370
|
var fi = getCol(focusNode, focusOffset);
|
|
@@ -394,10 +412,39 @@
|
|
|
394
412
|
|
|
395
413
|
}
|
|
396
414
|
if (patchAfter) {
|
|
397
|
-
|
|
415
|
+
insertText(patchAfter, true);
|
|
398
416
|
}
|
|
399
417
|
return patchAfter;
|
|
400
418
|
};
|
|
419
|
+
var document_selection = document.getSelection();
|
|
420
|
+
var insertText = function (text, isPatch) {
|
|
421
|
+
markAnchorOffset();
|
|
422
|
+
var [an, ai, fn, fi] = selection;
|
|
423
|
+
var [n, i] = getNodeAt(fn, fi);
|
|
424
|
+
var d = 0;
|
|
425
|
+
if (n.nodeType === 1) {
|
|
426
|
+
n.insertBefore(document.createTextNode(text), n.childNodes[i + 1]);
|
|
427
|
+
if (!isPatch) d = 1;
|
|
428
|
+
}
|
|
429
|
+
else if (n.nodeType === 3) {
|
|
430
|
+
var v = n.nodeValue;
|
|
431
|
+
n.nodeValue = v.slice(0, i) + text + v.slice(i);
|
|
432
|
+
if (!isPatch) d = text.length;
|
|
433
|
+
}
|
|
434
|
+
if (d) {
|
|
435
|
+
selection[3] += d;
|
|
436
|
+
if (ai === fi) selection[1] += d;
|
|
437
|
+
}
|
|
438
|
+
if (an === fn && ai === fi) {
|
|
439
|
+
i += d;
|
|
440
|
+
document_selection.setBaseAndExtent(n, i, n, i);
|
|
441
|
+
}
|
|
442
|
+
else {
|
|
443
|
+
[an, ai] = getNodeAt(an, ai);
|
|
444
|
+
document_selection.setBaseAndExtent(an, ai, n, i + d);
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
}
|
|
401
448
|
var removeEndBR = function (d) {
|
|
402
449
|
var e = d.lastChild;
|
|
403
450
|
while (e) {
|
|
@@ -461,6 +508,9 @@
|
|
|
461
508
|
on('keydown.tab.prevent.only')(coder, function () {
|
|
462
509
|
keytab(1);
|
|
463
510
|
});
|
|
511
|
+
bind('selectionchange', document)(coder, function () {
|
|
512
|
+
markAnchorOffset();
|
|
513
|
+
});
|
|
464
514
|
var updo = function () {
|
|
465
515
|
[codetext, selection] = codeHistory[historyIndex];
|
|
466
516
|
coderows = 上色.rows(coder.type, codetext);
|