efront 4.2.6 → 4.2.8
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/compile/unstruct.js +2 -1
- package/coms/compile/unstruct_test.js +3 -2
- package/coms/compile//347/264/240/351/246/250.js +3 -2
- package/coms/compile//347/264/240/351/246/250_test.js +3 -1
- package/coms/layer/glance.js +13 -16
- package/coms/layer/glance.less +13 -10
- package/data/packexe-setup.sfx +0 -0
- package/package.json +1 -1
- package/public/efront.js +1 -1
package/coms/compile/unstruct.js
CHANGED
|
@@ -1266,8 +1266,9 @@ function toqueue(body, getname, ret = false, result = []) {
|
|
|
1266
1266
|
if (o.text === 'else') {
|
|
1267
1267
|
while (body[cx] !== o.next) cx++;
|
|
1268
1268
|
o = o.next;
|
|
1269
|
+
var ispbr = iftop[iftop.length - 3];
|
|
1270
|
+
if (!ispbr) ifpatch(result, true);
|
|
1269
1271
|
isbr = isbreak(o);
|
|
1270
|
-
if (!isbr) ifpatch(result, true);
|
|
1271
1272
|
iftop.push(result.length);
|
|
1272
1273
|
elseif = true;
|
|
1273
1274
|
}
|
|
@@ -69,7 +69,7 @@ test("for(a in b)", "for (a in b)", true);
|
|
|
69
69
|
test("for(a of b)", "for (a of b)", true);
|
|
70
70
|
test("for await(a of b)", "for await (a of b)", true);
|
|
71
71
|
test("for(a = os[Symbol.iterator] || os[Symbol.asyncIterator] || Array.prototype[Symbol.iterator], a = a.call(os), b = a.next(); !b.done && (o = b.value, true); b = a.next())", "_ = Symbol.iterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.asyncIterator; _ = os[_]; if (_) return [1, 0]; _ = Symbol.iterator; _ = Array.prototype[_];\r\n a = _; a = a.call(os); b = a.next(); return [1, 0];\r\n _ = !b.done; if (!_) return [1, 0]; o = b.value; _ = (true);\r\n if (!_) return [1, 0]; b = a.next(); return [-1, 0]", true);
|
|
72
|
-
test("for(a=0;a<1;a++)if(a==0)continue\r\n else a=1", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [
|
|
72
|
+
test("for(a=0;a<1;a++)if(a==0)continue\r\n else a=1", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [2, 0]; _ = a == 0; if (_) return [1, 0]; a = 1; return [1, 0];\r\n _ = a++; return [-1, 0]`, true);
|
|
73
73
|
test("for(a=0;a<1;a++)if(a==0){continue} else {a=1}", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [3, 0]; _ = a == 0; if (!_) return [1, 0]; return [2, 0];\r\n a = 1; return [1, 0];\r\n _ = a++; return [-2, 0]`, true);
|
|
74
74
|
test("for(a=0;a<1;a++){if(a==0){a=2;continue} else if(b) {a=1;continue} c=3}", `a = 0; return [1, 0];\r\n _ = a < 1; if (!_) return [4, 0]; _ = a == 0; if (!_) return [1, 0]; a = 2; return [3, 0];\r\n if (!b) return [1, 0]; a = 1; return [2, 0];\r\n c = 3; return [1, 0];\r\n _ = a++; return [-3, 0]`, true);
|
|
75
75
|
test("for(a=0;a<10;a++) await a", "a = 0; return [1, 0];\r\n _ = a < 10; if (!_) return [2, 0]; _ = a; return [_, 1];\r\n _ = @; _ = a++; return [-1, 0]", true);
|
|
@@ -134,4 +134,5 @@ test("[key[1]][key[2]][key[3]]", '_ = key[1]; _ = [_]; _0 = key[2]; _ = _[_0]; _
|
|
|
134
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
135
|
test("if(a)a:{break a}", "if (!a) return [2, 0]; return [1, 0];\r\n return [1, 0]", true);
|
|
136
136
|
unstruct.debug = true;
|
|
137
|
-
test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0; _ = (_); rgb = _ & 0xffffff", true);
|
|
137
|
+
test("rgb=(rgb<<8|rgb>>16)&0xffffff", "_ = rgb << 8, _0 = rgb >> 16, _ = _ | _0; _ = (_); rgb = _ & 0xffffff", true);
|
|
138
|
+
test(`if (c) a; else return true; return false`, "if (!c) return [1, 0]; a; return [2, 0];\r\n return [true, 2];\r\n return [false, 2]")
|
|
@@ -583,10 +583,11 @@ function 素馨(text, scopeName, compress) {
|
|
|
583
583
|
}
|
|
584
584
|
return result.rest.map(a => a.join("")).concat(result).map(a => {
|
|
585
585
|
var ats = [];
|
|
586
|
-
a = a.replace(
|
|
586
|
+
a = a.replace(/\s*@\{(@[^\}]*)\}/g, function (_, q) {
|
|
587
|
+
q = q.replace(/((?:\s|\))(?:and|or))\(/g, '$1 (');
|
|
587
588
|
ats.push(q);
|
|
588
589
|
return ''
|
|
589
|
-
});
|
|
590
|
+
}).trim();
|
|
590
591
|
if (!a) return '';
|
|
591
592
|
var atk = ats.join(';');
|
|
592
593
|
if (queried.key !== atk) {
|
|
@@ -69,4 +69,6 @@ assert(素馨(`a>:root{&:not(a):not(b){c:d}}`, '.abc-'), `a>.abc-:not(a):not(b){
|
|
|
69
69
|
|
|
70
70
|
assert(素馨(`.a (){ &:after{abc:1}} .b{.a();}`, '.abc-'), `.abc- .b:after{abc:1;}`);
|
|
71
71
|
assert(素馨(`@a:1px;@margin-x:@a+10px; a{m:-@margin-x}`), `a{m:-11px;}`);
|
|
72
|
-
assert(素馨(`a{@a:1px;@margin-x:@a+10px;m:-@margin-x}`), `a{m:-11px;}`);
|
|
72
|
+
assert(素馨(`a{@a:1px;@margin-x:@a+10px;m:-@margin-x}`), `a{m:-11px;}`);
|
|
73
|
+
assert(素馨(`@media screen{&.a{b:1}}`,'a'), `@media screen{a.a{b:1;}}`);
|
|
74
|
+
assert(素馨(`@media screen and(max-width:100px){&.a{b:1}}`,'a'), `@media screen and (max-width:100px){a.a{b:1;}}`);
|
package/coms/layer/glance.js
CHANGED
|
@@ -99,23 +99,20 @@ function main(mainPath, historyName = "") {
|
|
|
99
99
|
};
|
|
100
100
|
var bindClass = function () {
|
|
101
101
|
if (closed) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
102
|
+
if (hasClass(layer, "open")) {
|
|
103
|
+
removeClass(layer, 'open');
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
addClass(layer, 'close');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
else {
|
|
110
|
+
if (hasClass(layer, 'close')) {
|
|
111
|
+
removeClass(layer, 'close');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
addClass(layer, 'open');
|
|
108
115
|
}
|
|
109
|
-
} else {
|
|
110
|
-
addClass(layer, 'open');
|
|
111
|
-
removeClass(layer, 'close');
|
|
112
|
-
css(layer, `margin-left:${fromOffset(leftLayer.offsetWidth)}`);
|
|
113
|
-
setTimeout(function () {
|
|
114
|
-
var collapse = layer.clientLeft === 0;
|
|
115
|
-
if (!collapse) {
|
|
116
|
-
css(layer, 'margin-left:0');
|
|
117
|
-
}
|
|
118
|
-
}, 20);
|
|
119
116
|
}
|
|
120
117
|
};
|
|
121
118
|
var update = function (event) {
|
package/coms/layer/glance.less
CHANGED
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
position: relative;
|
|
7
7
|
border-radius: 3px;
|
|
8
8
|
overflow: hidden;
|
|
9
|
-
border-left: @left-width solid transparent;
|
|
10
9
|
box-sizing: border-box;
|
|
11
10
|
overflow: visible;
|
|
12
11
|
transition: border-left-width 0.2s ease-out, margin-left .2s ease-out, left .2s ease-out;
|
|
@@ -40,20 +39,24 @@
|
|
|
40
39
|
padding: 50px 10px 20px 10px;
|
|
41
40
|
}
|
|
42
41
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
// 宽屏: 用border-left
|
|
43
|
+
@media all and (min-width:961px) {
|
|
44
|
+
& {
|
|
45
|
+
border-left: @left-width solid transparent;
|
|
46
|
+
}
|
|
46
47
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
margin-left: 0 !important;
|
|
48
|
+
&.close {
|
|
49
|
+
border-left-width: 0;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
// 窄屏: 用margin-left
|
|
54
|
+
@media(max-width:960px) {
|
|
55
|
+
|
|
54
56
|
& {
|
|
55
|
-
border-radius: 0;
|
|
56
|
-
border-left-width: 0 !important;
|
|
57
57
|
margin-left: 0;
|
|
58
58
|
}
|
|
59
|
+
&.open {
|
|
60
|
+
margin-left: @left-width;
|
|
61
|
+
}
|
|
59
62
|
}
|
package/data/packexe-setup.sfx
CHANGED
|
Binary file
|