efront 4.35.7 → 4.35.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.
@@ -237,7 +237,7 @@ class Matrix extends Array {
237
237
  }
238
238
  toDOMString() {
239
239
  if (this.size()[1] === 2) return `matrix(${this.getTransform()})`;
240
- return `matrix(${this})`;
240
+ return `matrix3d(${this})`;
241
241
  }
242
242
  }
243
243
 
@@ -296,7 +296,7 @@ function solve(body, ox, dx) {
296
296
  var p1 = p;
297
297
  var pt1 = pt;
298
298
  var p2 = p;
299
- while (p1 <= cache[cache.length - 1]) {
299
+ while (p <= cache[cache.length - 1]) {
300
300
  p2 = p1;
301
301
  p1 = cache.pop();
302
302
  pt1 = cache.pop();
@@ -306,7 +306,7 @@ function solve(body, ox, dx) {
306
306
  if (p === p1 && p > powermap[">>>"]) cache.push(bx, pt1, p1);
307
307
  continue;
308
308
  }
309
- var cx1 = make(body, bx, cx, p === p2 ? pt1 : null);
309
+ var cx1 = make(body, bx, cx, pt1);
310
310
  if (cx1 !== cx) {
311
311
  dx -= cx - cx1;
312
312
  cx = cx1;
@@ -316,6 +316,12 @@ function solve(body, ox, dx) {
316
316
  }
317
317
  if (p === 0) {
318
318
  cache.splice(0, cache.length);
319
+ continue;
320
+ }
321
+ if (p > p0) {
322
+ bx = cx + 1;
323
+ cache.push(bx, pt, p);
324
+ continue;
319
325
  }
320
326
  continue;
321
327
  }
@@ -65,7 +65,6 @@ t("a+ b*3**2", "a + b * 9");
65
65
  t("a+ 2*3**b", "a + 2 * 3 ** b");
66
66
  t("a+ 2*3 +c", "a + 6 + c");
67
67
  t("a+ 2*3 +4+c", "a + 10 + c");
68
- autoeval.debug = true;
69
68
  t("a- 2*3 +4+c", "a - 2 + c");
70
69
  t("a- 1 +4", "a + 3");
71
70
  t("a / 6 * 3", "a * 0.5");
@@ -84,14 +83,17 @@ tc("calc(10 / 20)", "0.5");
84
83
  tc("calc(10 / 20)", "0.5");
85
84
  tc("Math.log(f) / Math.LN2 / 10 | 0", "Math.log(f) * 0.14426950408889633 | 0");
86
85
  tc("Math.log(f) / Math.LN2 / 10 * 10 | 0", "Math.log(f) * 1.4426950408889634 | 0");
86
+ autoeval.debug = true;
87
87
  tc("Math.log(f) / Math.LN2 / 10 ** 2 | 0", "Math.log(f) * 0.014426950408889633 | 0");
88
+ autoeval.debug = false;
88
89
  // tf(path.join(__dirname, "../zimoli/spacechar_test.js"))
89
90
  t("1<<0", '1');
90
91
  t("1<<3", '8');
91
- t("(1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)",'1335')
92
- t("(1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)","7973")
93
- t("(1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)","21522")
94
- t('1n<<32n','4294967296n');
95
- t('4294967296n*4294967296n','18446744073709551616n');
96
- t('4294967296n*2147483648n','9223372036854775808n');
97
- t('0x20000000n*0x1000000n','9007199254740992n');
92
+ t("(1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)", '1335')
93
+ t("(1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)", "7973")
94
+ t("(1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)", "21522")
95
+ t('1n<<32n', '4294967296n');
96
+ t('4294967296n*4294967296n', '18446744073709551616n');
97
+ t('4294967296n*2147483648n', '9223372036854775808n');
98
+ t('0x20000000n*0x1000000n', '9007199254740992n');
99
+ t("1 + 1 / 2 + 1 / 3 + 1 / 4 + 1 / 5 + 1 / 6 + 1 / 7 + 1 / 8 + 1 / 9 + 1 / 10 + 1 / 11 + 1 / 12 + 1 / 13 + 1 / 14 + 1 / 15 + 1 / 16 + 1 / 17 + 1 / 18 + 1 / 19 + 1 / 20", "3.5977396571436824")
@@ -1,3 +1,3 @@
1
1
  function wrapHtml(htmldata) {
2
- return htmldata ? `\`${String(htmldata).replace(/>\s+</g, "><").trim()}\`` : '``';
2
+ return htmldata ? `\`${String(htmldata).replace(/>\s+</g, "><").replace(/\\[^`]/g, "\\$&").trim()}\`` : '``';
3
3
  }
@@ -164,10 +164,11 @@ async function pullFileWithRTC(scope, file) {
164
164
  // <!-- console.log('接收端打开') -->
165
165
  report();
166
166
  };
167
- channel.onclose = function () {
167
+ channel.onclose = async function () {
168
168
  // <!-- console.log('接收端关闭') -->
169
169
  if (writed === file.size) tipbox.setText(`接收完成`, 'success');
170
170
  else tipbox.setText('接收异常', "error");
171
+ await writable.close();
171
172
  };
172
173
  channel.onerror = function (event) {
173
174
  // <!-- console.log('接收端异常',event) -->
@@ -1,7 +1,7 @@
1
1
  .grid() {
2
- @mask-color1 : rgba(255, 255, 255, .6);
2
+ @mask-color1 : rgba(255, 255, 255, .3);
3
3
  @mask-color2 : rgba(0, 0, 0, 0);
4
- @mask-color3 : rgba(0, 0, 0, .1);
4
+ @mask-color3 : rgba(0, 0, 0, .3);
5
5
  background-image:
6
6
  linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
7
7
  linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
@@ -16,7 +16,8 @@ var getOffset = function (e) {
16
16
  if (isFinite(e.screenX)) return [e.screenX, e.screenY];
17
17
  };
18
18
 
19
- var getMouse = function (e) {
19
+ var getMousePosition = function (e) {
20
+ if ('screenX' in e) return [e.screenX, e.screenY];
20
21
  return [e.clientX, e.clientY];
21
22
  };
22
23
  var z;
@@ -51,7 +52,7 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
51
52
  if ((!target.hasAttribute || target.hasAttribute('draggable')) && target.draggable === false) return;
52
53
  initialEvent.preventDefault();
53
54
  var target_offset = getOffset(target);
54
- var saved_delta = { x: target_offset[0] - initialEvent.clientX, y: target_offset[1] - initialEvent.clientY };
55
+ var saved_delta = { x: target_offset[0] - getMousePosition(initialEvent)[0], y: target_offset[1] - getMousePosition(initialEvent)[1] };
55
56
  var clone;
56
57
  if (target.style) {
57
58
  var saved_opacity = target.style.opacity;
@@ -90,12 +91,13 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
90
91
  extraClones.map(c => document.body.appendChild(c));
91
92
  saved_delta.x += clone_left - target_left;
92
93
  saved_delta.y += clone_top - target_top;
93
- target.setAttribute("dragging", '');
94
+ if (target.setAttribute) target.setAttribute("dragging", '');
94
95
  dispatch("dragstart", target);
95
96
  }
96
97
  event.moveLocked = true;
97
- var offsetLeft = saved_delta.x + event.clientX;
98
- var offsetTop = saved_delta.y + event.clientY;
98
+ var [screenX, screenY] = getMousePosition(event);
99
+ var offsetLeft = saved_delta.x + screenX;
100
+ var offsetTop = saved_delta.y + screenY;
99
101
  var [c_left, c_top] = getOffset(clone);
100
102
  var cloneDeltaLeft = -c_left, cloneDeltaTop = -c_top;
101
103
  var [c_left, c_top] = move.call(clone, offsetLeft, offsetTop, preventOverflow);
@@ -115,7 +117,10 @@ function drag(target, initialEvent, preventOverflow, isMovingSource) {
115
117
  remove(extraClones);
116
118
  extraTargets.map((target, cx) => css(target, extraStyles[cx]));
117
119
  if (tgz != null) css(target, { zIndex: tgz });
118
- if (saved_delta.ing) target.removeAttribute("dragging"), dispatch("dragend", target);
120
+ if (saved_delta.ing) {
121
+ if (target.removeAttribute) target.removeAttribute("dragging");
122
+ dispatch("dragend", target);
123
+ }
119
124
  drag.target = null;
120
125
  saved_delta = null;
121
126
  };
@@ -50,16 +50,35 @@ var locktouch = function (target, handles) {
50
50
  }
51
51
  }
52
52
  };
53
-
53
+ var getX = function (event) {
54
+ if ('screenX' in event) return event.screenX;
55
+ return event.clientX;
56
+ };
57
+ var getY = function (event) {
58
+ if ('screenY' in event) return event.screenY;
59
+ return event.clientY;
60
+ };
54
61
  function moveupon(target, handles, initialEvent) {
55
62
  var { start, move, end } = handles;
56
63
  var touchLocked = false;
64
+ var savedX, savedY;
57
65
  var offmouseup, offtouchend, offtouchcancel;
66
+ var setMovement = function (event) {
67
+ if ("movementX" in event) return
68
+ var x = getX(event);
69
+ event.movementX = x - savedX;
70
+ savedX = x;
71
+ var y = getY(event);
72
+ event.movementY = y - savedY;
73
+ savedY = y;
74
+ }
58
75
  var mousemove = function (event) {
76
+ setMovement(event);
59
77
  if (isFunction(move)) move.call(target, event);
60
78
  };
61
79
 
62
80
  var touchmove = function (event) {
81
+ setMovement(event);
63
82
  extendTouchEvent(event);
64
83
  if (isFunction(move)) move.call(target, event);
65
84
  };
@@ -87,6 +106,7 @@ function moveupon(target, handles, initialEvent) {
87
106
 
88
107
  if (initialEvent) {
89
108
  if (locktouch(initialEvent.target, handles)) return;
109
+ if (target.notouch) return;
90
110
  if (initialEvent.type === "touchstart") {
91
111
  extendTouchEvent(initialEvent);
92
112
  initialEvent.preventDefault();
@@ -100,8 +120,11 @@ function moveupon(target, handles, initialEvent) {
100
120
  onmousedown(target, function (event) {
101
121
  if (touchLocked) return;
102
122
  if (locktouch(event.target, handles)) return;
123
+ if (target.notouch) return;
103
124
  touchLocked = true;
104
125
  hookmouse(event);
126
+ savedX = getX(event);
127
+ savedY = getY(event);
105
128
  if (isFunction(start)) start.call(this, event);
106
129
  });
107
130
  ontouchstart(target, function (event) {
@@ -109,6 +132,8 @@ function moveupon(target, handles, initialEvent) {
109
132
  if (locktouch(event.target, handles)) return;
110
133
  touchLocked = true;
111
134
  extendTouchEvent(event);
135
+ savedX = getX(event);
136
+ savedY = getY(event);
112
137
  hooktouch(event);
113
138
  if (isFunction(start)) start.call(this, event);
114
139
  });
@@ -1,3 +1,4 @@
1
+ @import "bggrid-func.less";
1
2
  & {
2
3
  width: 100%;
3
4
  height: 100%;
@@ -10,24 +11,6 @@
10
11
  background-color: #000;
11
12
  }
12
13
 
13
-
14
- .grid() {
15
- @mask-color1 : rgba(255, 255, 255, .6);
16
- @mask-color2 : rgba(0, 0, 0, 0);
17
- @mask-color3 : rgba(0, 0, 0, .1);
18
- background-image:
19
- linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
20
- linear-gradient(45deg, @mask-color1, 25%, @mask-color1, 25%, @mask-color2, 75%, @mask-color1, 75%, @mask-color1),
21
- linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3),
22
- linear-gradient(45deg, @mask-color3, 25%, @mask-color3, 25%, @mask-color2, 75%, @mask-color3, 75%, @mask-color3);
23
- background-size: 20px 20px;
24
- background-position: 0 0, 10px 10px, 10px 0, 0 10px;
25
- background-repeat: repeat;
26
- background-clip: border-box;
27
- background-color: #fff;
28
-
29
- }
30
-
31
14
  &[grid],
32
15
  &.grid,
33
16
  &[type=grid] {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "efront",
3
- "version": "4.35.7",
3
+ "version": "4.35.8",
4
4
  "description": "一个开发环境,提供一种自由的前端开发模式,也可作为辅助工具使用。",
5
5
  "main": "public/efront.js",
6
6
  "directories": {