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.
@@ -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(`=${dec[0]}\r\n`));
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, i) => {
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.kind) {
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);
@@ -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])?)$/i;
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 () {
@@ -45,7 +45,7 @@
45
45
  background-color: #2873;
46
46
  position: absolute;
47
47
  border-radius: 50%;
48
- backdrop-filter: invert(1);
48
+ // backdrop-filter: invert(1);
49
49
  transition: all .2s;
50
50
  }
51
51
  }
package/coms/role/file.js CHANGED
@@ -1,4 +1,4 @@
1
1
  function file(fileInfo) {
2
2
  var ext = /\.[^\.]+$/.exec(fileInfo.name);
3
- return option(fileInfo.name, ext, false);
3
+ return optionbar(fileInfo.name, ext, false);
4
4
  }
@@ -1,5 +1,5 @@
1
1
  function folder(fileInfo) {
2
2
  var children = fileInfo.children;
3
- var _folder = option(fileInfo.name, children && children.length,14);
3
+ var _folder = optionbar(fileInfo.name, children && children.length,14);
4
4
  return _folder;
5
5
  }
@@ -1,5 +1,5 @@
1
1
  function main(elem) {
2
- elem = option.apply(null, arguments);
2
+ elem = optionbar.apply(null, arguments);
3
3
  var scope = {};
4
4
  care(elem, function (p) {
5
5
  if (elem.childNodes.length) return;
@@ -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
  };
@@ -3,8 +3,10 @@ extend(renderDefaults, {
3
3
  btn: button,
4
4
  button,
5
5
  a: button,
6
- opt: option,
7
- optn: option,
6
+ optionbar: optionbar,
7
+ optbar: optionbar,
8
+ opt: optionbar,
9
+ optn: optionbar,
8
10
  go: zimoli.go,
9
11
  care,
10
12
  cast,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "3.36.9",
3
+ "version": "3.37.0",
4
4
  "description": "简化前端开发,优化web性能",
5
5
  "main": "public/efront.js",
6
6
  "directories": {