efront 3.36.9 → 3.37.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.
- package/coms/basic/strings.js +2 -1
- package/coms/compile/Javascript.js +17 -4
- package/coms/compile/common.js +1 -1
- package/coms/kugou/bg.less +1 -1
- package/coms/role/file.js +1 -1
- package/coms/role/folder.js +1 -1
- package/coms/zimoli/field.js +1 -1
- package/coms/zimoli/popup.js +1 -1
- package/coms/zimoli/renderDefaults.js +4 -2
- package/package.json +1 -1
- package/public/efront.js +1 -1
- /package/coms/zimoli/{option.js → optionbar.js} +0 -0
- /package/coms/zimoli/{option.less → optionbar.less} +0 -0
package/coms/basic/strings.js
CHANGED
|
@@ -27,11 +27,12 @@ function encode(str, q = "\"") {
|
|
|
27
27
|
function decode(s) {
|
|
28
28
|
var r = /^(['"`])([\s\S]*)\1$/.exec(s);
|
|
29
29
|
if (!r) return s;
|
|
30
|
-
return r[2].replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\([\s\S])/ig, (a, b) => {
|
|
30
|
+
return r[2].replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\([0-7]{1,3}|[\s\S])/ig, (a, b) => {
|
|
31
31
|
if (!b) {
|
|
32
32
|
return String.fromCharCode(parseInt(a.slice(2), 16));
|
|
33
33
|
}
|
|
34
34
|
if (unescapeMap.hasOwnProperty(a)) return unescapeMap[a];
|
|
35
|
+
if (/^[0-7]+$/.test(b)) return String.fromCharCode(parseInt(b, 8));
|
|
35
36
|
return b;
|
|
36
37
|
});
|
|
37
38
|
}
|
|
@@ -479,7 +479,7 @@ var removeImport = function (c, i, code) {
|
|
|
479
479
|
used[name] = [];
|
|
480
480
|
if (dec[0] !== "*") dec[0].forEach((dn, i) => {
|
|
481
481
|
var da = dec[0].attributes[i];
|
|
482
|
-
used[dn].forEach(u => {
|
|
482
|
+
if (used[dn]) used[dn].forEach(u => {
|
|
483
483
|
u.text = name + da[0];
|
|
484
484
|
used[name].push(u);
|
|
485
485
|
});
|
|
@@ -538,9 +538,18 @@ var removeExport = function (c, i, code) {
|
|
|
538
538
|
}
|
|
539
539
|
var [dec, map, o] = getDeclared(n.next, 'export');
|
|
540
540
|
if (/^(class|function)$/.test(n.text)) {
|
|
541
|
+
var e = skipAssignment(code, i + 1);
|
|
542
|
+
if (code[e] && code[e].type !== STAMP) {
|
|
543
|
+
code.splice(e, 0, { type: STAMP, text: ';' });
|
|
544
|
+
}
|
|
541
545
|
c.text = `exports.${dec[0]}`;
|
|
542
546
|
c.type = EXPRESS;
|
|
543
|
-
code.splice(i + 1, 0, ...scan(
|
|
547
|
+
code.splice(i + 1, 0, ...scan(`=`));
|
|
548
|
+
var nn = n.next;
|
|
549
|
+
var d = nn.text;
|
|
550
|
+
if (used[d]) used[d].forEach(a => a.text = `exports.${d}`);
|
|
551
|
+
delete used[d];
|
|
552
|
+
delete envs[d];
|
|
544
553
|
return;
|
|
545
554
|
}
|
|
546
555
|
var nn = n.next;
|
|
@@ -549,12 +558,16 @@ var removeExport = function (c, i, code) {
|
|
|
549
558
|
if (!code.exportDecs) {
|
|
550
559
|
code.exportDecs = [];
|
|
551
560
|
}
|
|
552
|
-
dec.forEach((d
|
|
561
|
+
dec.forEach(function rm(d) {
|
|
562
|
+
if (d instanceof Array) return d.forEach(rm);
|
|
553
563
|
for (var a of used[d]) {
|
|
554
564
|
if (a.kind && a.kind !== 'export') continue;
|
|
555
565
|
if (!a.export) code.exportDecs.push(a), a.export = true;
|
|
556
566
|
}
|
|
557
567
|
});
|
|
568
|
+
dec.forEach(d => {
|
|
569
|
+
if (typeof d === 'string') for (var a of used[d]) if (a.kind === 'export') a.needEqual = true;
|
|
570
|
+
});
|
|
558
571
|
code.splice(i, oi - i);
|
|
559
572
|
};
|
|
560
573
|
|
|
@@ -592,7 +605,7 @@ Javascript.prototype.fix = function (code) {
|
|
|
592
605
|
delete code.exportDecs;
|
|
593
606
|
exportDecs.forEach(e => {
|
|
594
607
|
e.text = 'exports.' + e.text;
|
|
595
|
-
if (e.
|
|
608
|
+
if (e.needEqual) {
|
|
596
609
|
var n = e.next;
|
|
597
610
|
if (!n || n.type !== STAMP || n.text !== '=') {
|
|
598
611
|
var i = code.indexOf(e);
|
package/coms/compile/common.js
CHANGED
|
@@ -12,7 +12,7 @@ const [
|
|
|
12
12
|
/* 512 */LABEL,
|
|
13
13
|
/*1024 */PROPERTY,
|
|
14
14
|
] = new Array(20).fill(0).map((_, a) => 1 << a);
|
|
15
|
-
var number_reg = /^(0x[0-9a-f]+|0b\d+|0o\d+|(\d*\.\d+|\d+\.?)(e[\+\-]?\d+|[mn])
|
|
15
|
+
var number_reg = /^(0x[0-9a-f]+|0b\d+|0o\d+|(\d*\.\d+|\d+\.?))(e[\+\-]?\d+|[mn])?$/i;
|
|
16
16
|
var equal_reg = /^(?:[\+\-\*\/~\^&\|%]|\*\*|>>>?|<<)?\=$|^(?:\+\+|\-\-)$/;
|
|
17
17
|
var skipAssignment = function (o, cx) {
|
|
18
18
|
var next = arguments.length === 1 ? function () {
|
package/coms/kugou/bg.less
CHANGED
package/coms/role/file.js
CHANGED
package/coms/role/folder.js
CHANGED
package/coms/zimoli/field.js
CHANGED
package/coms/zimoli/popup.js
CHANGED
|
@@ -181,7 +181,7 @@ var isypop = function (target) {
|
|
|
181
181
|
|| target.offsetLeft - previousSibling.offsetLeft >= previousSibling.offsetWidth / 2
|
|
182
182
|
)
|
|
183
183
|
) return true;
|
|
184
|
-
var padding = parseFloat(getComputedStyle(offsetParent).paddingTop) + parseFloat(getComputedStyle(offsetParent).paddingBottom);
|
|
184
|
+
var padding = offsetParent ? parseFloat(getComputedStyle(offsetParent).paddingTop) + parseFloat(getComputedStyle(offsetParent).paddingBottom) : 0;
|
|
185
185
|
if (offsetParent && target.offsetTop / target.offsetHeight < .2 && (offsetParent.clientWidth - padding) / target.offsetWidth > 1.5) return true;
|
|
186
186
|
|
|
187
187
|
};
|