leafer-ui 1.0.0-rc.4 → 1.0.0-rc.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.
@@ -126,13 +126,13 @@ const MatrixHelper = {
126
126
  t.d *= y;
127
127
  },
128
128
  scaleOfOuter(t, origin, x, y = x) {
129
- M$5.toInnerPoint(t, origin, tempPoint$1);
130
- M$5.scaleOfInner(t, tempPoint$1, x, y);
129
+ M$6.toInnerPoint(t, origin, tempPoint$1);
130
+ M$6.scaleOfInner(t, tempPoint$1, x, y);
131
131
  },
132
132
  scaleOfInner(t, origin, x, y = x) {
133
- M$5.translateInner(t, origin.x, origin.y);
134
- M$5.scale(t, x, y);
135
- M$5.translateInner(t, -origin.x, -origin.y);
133
+ M$6.translateInner(t, origin.x, origin.y);
134
+ M$6.scale(t, x, y);
135
+ M$6.translateInner(t, -origin.x, -origin.y);
136
136
  },
137
137
  rotate(t, angle) {
138
138
  angle *= OneRadian;
@@ -145,13 +145,13 @@ const MatrixHelper = {
145
145
  t.d = (c * sinR) + (d * cosR);
146
146
  },
147
147
  rotateOfOuter(t, origin, angle) {
148
- M$5.toInnerPoint(t, origin, tempPoint$1);
149
- M$5.rotateOfInner(t, tempPoint$1, angle);
148
+ M$6.toInnerPoint(t, origin, tempPoint$1);
149
+ M$6.rotateOfInner(t, tempPoint$1, angle);
150
150
  },
151
151
  rotateOfInner(t, origin, angle) {
152
- M$5.translateInner(t, origin.x, origin.y);
153
- M$5.rotate(t, angle);
154
- M$5.translateInner(t, -origin.x, -origin.y);
152
+ M$6.translateInner(t, origin.x, origin.y);
153
+ M$6.rotate(t, angle);
154
+ M$6.translateInner(t, -origin.x, -origin.y);
155
155
  },
156
156
  skew(t, x, y) {
157
157
  const { a, b, c, d } = t;
@@ -167,13 +167,13 @@ const MatrixHelper = {
167
167
  }
168
168
  },
169
169
  skewOfOuter(t, origin, x, y) {
170
- M$5.toInnerPoint(t, origin, tempPoint$1);
171
- M$5.skewOfInner(t, tempPoint$1, x, y);
170
+ M$6.toInnerPoint(t, origin, tempPoint$1);
171
+ M$6.skewOfInner(t, tempPoint$1, x, y);
172
172
  },
173
173
  skewOfInner(t, origin, x, y) {
174
- M$5.translateInner(t, origin.x, origin.y);
175
- M$5.skew(t, x, y);
176
- M$5.translateInner(t, -origin.x, -origin.y);
174
+ M$6.translateInner(t, origin.x, origin.y);
175
+ M$6.skew(t, x, y);
176
+ M$6.translateInner(t, -origin.x, -origin.y);
177
177
  },
178
178
  multiply(t, matrix) {
179
179
  const { a, b, c, d, e, f } = t;
@@ -196,12 +196,12 @@ const MatrixHelper = {
196
196
  t.f = (e * matrix.b) + (f * matrix.d) + matrix.f;
197
197
  },
198
198
  divide(t, matrix) {
199
- M$5.preMultiply(t, M$5.tempInvert(matrix));
199
+ M$6.preMultiply(t, M$6.tempInvert(matrix));
200
200
  },
201
201
  tempInvert(t) {
202
- const { tempMatrix: temp } = M$5;
203
- M$5.copy(temp, t);
204
- M$5.invert(temp);
202
+ const { tempMatrix: temp } = M$6;
203
+ M$6.copy(temp, t);
204
+ M$6.invert(temp);
205
205
  return temp;
206
206
  },
207
207
  invert(t) {
@@ -264,10 +264,10 @@ const MatrixHelper = {
264
264
  return { x: t.e, y: t.f, scaleX, scaleY, rotation, skewX, skewY };
265
265
  },
266
266
  reset(t) {
267
- M$5.set(t);
267
+ M$6.set(t);
268
268
  }
269
269
  };
270
- const M$5 = MatrixHelper;
270
+ const M$6 = MatrixHelper;
271
271
 
272
272
  const { toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$2 } = MatrixHelper;
273
273
  const { sin: sin$5, cos: cos$5, abs: abs$1, sqrt: sqrt$2, atan2: atan2$2 } = Math;
@@ -587,9 +587,7 @@ const BoundsHelper = {
587
587
  }
588
588
  B.move(to, -to.offsetX, -to.offsetY);
589
589
  },
590
- scale(t, scaleX, scaleY) {
591
- if (!scaleY)
592
- scaleY = scaleX;
590
+ scale(t, scaleX, scaleY = scaleX) {
593
591
  if (t.x)
594
592
  t.x *= scaleX;
595
593
  if (t.y)
@@ -597,6 +595,12 @@ const BoundsHelper = {
597
595
  t.width *= scaleX;
598
596
  t.height *= scaleY;
599
597
  },
598
+ scaleOf(t, origin, scaleX, scaleY) {
599
+ t.x += (t.x - origin.x) * (scaleX - 1);
600
+ t.y += (t.y - origin.y) * (scaleY - 1);
601
+ t.width *= scaleX;
602
+ t.height *= scaleY;
603
+ },
600
604
  tempToOuterOf(t, matrix) {
601
605
  B.copy(B.tempBounds, t);
602
606
  B.toOuterOf(B.tempBounds, matrix);
@@ -647,14 +651,14 @@ const BoundsHelper = {
647
651
  },
648
652
  getFitMatrix(t, put) {
649
653
  const scale = Math.min(1, Math.min(t.width / put.width, t.height / put.height));
650
- return new Matrix(scale, 0, 0, scale, -Math.ceil(put.x * scale), -Math.ceil(put.y * scale));
654
+ return new Matrix(scale, 0, 0, scale, -put.x * scale, -put.y * scale);
651
655
  },
652
656
  getSpread(t, spreadX, spreadY) {
653
657
  const n = {};
654
658
  B.copyAndSpread(n, t, spreadX, spreadY);
655
659
  return n;
656
660
  },
657
- spread(t, spreadX, spreadY) {
661
+ spread(t, spreadX, spreadY = spreadX) {
658
662
  B.copyAndSpread(t, t, spreadX, spreadY);
659
663
  },
660
664
  ceil(t) {
@@ -788,6 +792,10 @@ class Bounds {
788
792
  BoundsHelper.scale(this, scaleX, scaleY);
789
793
  return this;
790
794
  }
795
+ scaleOf(origin, scaleX, scaleY) {
796
+ BoundsHelper.scaleOf(this, origin, scaleX, scaleY);
797
+ return this;
798
+ }
791
799
  toOuterOf(matrix, to) {
792
800
  BoundsHelper.toOuterOf(this, matrix, to);
793
801
  return this;
@@ -795,8 +803,8 @@ class Bounds {
795
803
  getFitMatrix(put) {
796
804
  return BoundsHelper.getFitMatrix(this, put);
797
805
  }
798
- spread(size) {
799
- BoundsHelper.spread(this, size);
806
+ spread(spreadX, spreadY) {
807
+ BoundsHelper.spread(this, spreadX, spreadY);
800
808
  return this;
801
809
  }
802
810
  ceil() {
@@ -1340,14 +1348,22 @@ class LeafData {
1340
1348
  if (this.__input && this.__input[name] !== undefined)
1341
1349
  this.__input[name] = undefined;
1342
1350
  }
1343
- __getInputData() {
1351
+ __getInputData(options) {
1344
1352
  const data = { tag: this.__leaf.tag }, { __input } = this;
1345
- let realKey, value;
1346
- for (let key in this) {
1347
- realKey = key.substring(1);
1348
- if (this[realKey] !== undefined) {
1349
- value = __input ? __input[realKey] : undefined;
1350
- data[realKey] = value === undefined ? this[key] : value;
1353
+ if (options) {
1354
+ for (let key in this) {
1355
+ if (key[0] !== '_')
1356
+ data[key] = this[key];
1357
+ }
1358
+ }
1359
+ else {
1360
+ let realKey, value;
1361
+ for (let key in this) {
1362
+ realKey = key.substring(1);
1363
+ if (this[realKey] !== undefined) {
1364
+ value = __input ? __input[realKey] : undefined;
1365
+ data[realKey] = value === undefined ? this[key] : value;
1366
+ }
1351
1367
  }
1352
1368
  }
1353
1369
  return data;
@@ -1378,6 +1394,8 @@ class LeafData {
1378
1394
  }
1379
1395
 
1380
1396
  const FileHelper = {
1397
+ opacityTypes: ['png', 'webp', 'svg'],
1398
+ upperCaseTypeMap: {},
1381
1399
  mineType(type) {
1382
1400
  if (!type || type.startsWith('image'))
1383
1401
  return type;
@@ -1390,6 +1408,7 @@ const FileHelper = {
1390
1408
  return l[l.length - 1];
1391
1409
  }
1392
1410
  };
1411
+ FileHelper.opacityTypes.forEach(type => FileHelper.upperCaseTypeMap[type] = type.toUpperCase());
1393
1412
 
1394
1413
  /******************************************************************************
1395
1414
  Copyright (c) Microsoft Corporation.
@@ -2083,11 +2102,11 @@ const RectHelper = {
2083
2102
  const { sin: sin$4, cos: cos$4, atan2: atan2$1, ceil, abs, PI: PI$2, sqrt: sqrt$1, pow } = Math;
2084
2103
  const { setPoint: setPoint$1, addPoint: addPoint$1 } = TwoPointBoundsHelper;
2085
2104
  const { set: set$2 } = PointHelper;
2086
- const { M: M$4, L: L$5, C: C$4, Q: Q$4, Z: Z$4 } = PathCommandMap;
2105
+ const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$5 } = PathCommandMap;
2087
2106
  const tempPoint = {};
2088
2107
  const BezierHelper = {
2089
2108
  points(data, points, curve, close) {
2090
- data.push(M$4, points[0], points[1]);
2109
+ data.push(M$5, points[0], points[1]);
2091
2110
  if (curve && points.length > 5) {
2092
2111
  let aX, aY, bX, bY, cX, cY, c1X, c1Y, c2X, c2Y;
2093
2112
  let ba, cb, d, len = points.length;
@@ -2117,7 +2136,7 @@ const BezierHelper = {
2117
2136
  data.push(Q$4, c1X, c1Y, bX, bY);
2118
2137
  }
2119
2138
  else {
2120
- data.push(C$4, c2X, c2Y, c1X, c1Y, bX, bY);
2139
+ data.push(C$5, c2X, c2Y, c1X, c1Y, bX, bY);
2121
2140
  }
2122
2141
  c2X = bX + cb * cX;
2123
2142
  c2Y = bY + cb * cY;
@@ -2127,11 +2146,11 @@ const BezierHelper = {
2127
2146
  }
2128
2147
  else {
2129
2148
  for (let i = 2, len = points.length; i < len; i += 2) {
2130
- data.push(L$5, points[i], points[i + 1]);
2149
+ data.push(L$6, points[i], points[i + 1]);
2131
2150
  }
2132
2151
  }
2133
2152
  if (close)
2134
- data.push(Z$4);
2153
+ data.push(Z$5);
2135
2154
  },
2136
2155
  rect(data, x, y, width, height) {
2137
2156
  PathHelper.creator.path = data;
@@ -2154,7 +2173,7 @@ const BezierHelper = {
2154
2173
  totalRadian += PI2;
2155
2174
  if (totalRadian === PI$2 || (abs(BAx + BAy) < 1.e-12) || (abs(CBx + CBy) < 1.e-12)) {
2156
2175
  if (data)
2157
- data.push(L$5, x1, y1);
2176
+ data.push(L$6, x1, y1);
2158
2177
  if (setPointBounds) {
2159
2178
  setPoint$1(setPointBounds, fromX, fromY);
2160
2179
  addPoint$1(setPointBounds, x1, y1);
@@ -2207,7 +2226,7 @@ const BezierHelper = {
2207
2226
  let startY = y = rotationSin * radiusX * startCos + rotationCos * radiusY * startSin;
2208
2227
  let fromX = cx + x, fromY = cy + y;
2209
2228
  if (data)
2210
- data.push(L$5, fromX, fromY);
2229
+ data.push(L$6, fromX, fromY);
2211
2230
  if (setPointBounds)
2212
2231
  setPoint$1(setPointBounds, fromX, fromY);
2213
2232
  if (setStartPoint)
@@ -2222,7 +2241,7 @@ const BezierHelper = {
2222
2241
  x2 = cx + x + control * (rotationCos * radiusX * endSin + rotationSin * radiusY * endCos);
2223
2242
  y2 = cy + y + control * (rotationSin * radiusX * endSin - rotationCos * radiusY * endCos);
2224
2243
  if (data)
2225
- data.push(C$4, x1, y1, x2, y2, cx + x, cy + y);
2244
+ data.push(C$5, x1, y1, x2, y2, cx + x, cy + y);
2226
2245
  if (setPointBounds)
2227
2246
  toTwoPointBounds$1(cx + startX, cy + startY, x1, y1, x2, y2, cx + x, cy + y, setPointBounds, true);
2228
2247
  startX = x;
@@ -2236,7 +2255,7 @@ const BezierHelper = {
2236
2255
  set$2(setEndPoint, cx + x, cy + y);
2237
2256
  },
2238
2257
  quadraticCurveTo(data, fromX, fromY, x1, y1, toX, toY) {
2239
- data.push(C$4, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
2258
+ data.push(C$5, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY);
2240
2259
  },
2241
2260
  toTwoPointBoundsByQuadraticCurve(fromX, fromY, x1, y1, toX, toY, pointBounds, addMode) {
2242
2261
  toTwoPointBounds$1(fromX, fromY, (fromX + 2 * x1) / 3, (fromY + 2 * y1) / 3, (toX + 2 * x1) / 3, (toY + 2 * y1) / 3, toX, toY, pointBounds, addMode);
@@ -2330,7 +2349,7 @@ const EllipseHelper = {
2330
2349
  const centerX = fromX + halfX + rotationCos * cx - rotationSin * cy;
2331
2350
  const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
2332
2351
  const anticlockwise = totalRadian < 0 ? 1 : 0;
2333
- if (curveMode) {
2352
+ if (curveMode || Platform.ellipseToCurve) {
2334
2353
  ellipse$5(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2335
2354
  }
2336
2355
  else {
@@ -2344,7 +2363,7 @@ const EllipseHelper = {
2344
2363
  }
2345
2364
  };
2346
2365
 
2347
- const { M: M$3, m, L: L$4, l, H, h, V, v, C: C$3, c, S, s, Q: Q$3, q, T, t, A, a, Z: Z$3, z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$3, O: O$3, P: P$3, U: U$3 } = PathCommandMap;
2366
+ const { M: M$4, m, L: L$5, l, H, h, V, v, C: C$4, c, S, s, Q: Q$3, q, T, t, A, a, Z: Z$4, z, N: N$3, D: D$3, X: X$3, G: G$3, F: F$3, O: O$3, P: P$3, U: U$4 } = PathCommandMap;
2348
2367
  const { rect: rect$2, roundRect: roundRect$2, arcTo: arcTo$2, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
2349
2368
  const { ellipticalArc } = EllipseHelper;
2350
2369
  const debug$b = Debug.get('PathConvert');
@@ -2432,33 +2451,33 @@ const PathConvert = {
2432
2451
  case m:
2433
2452
  old[i + 1] += x;
2434
2453
  old[i + 2] += y;
2435
- case M$3:
2454
+ case M$4:
2436
2455
  x = old[i + 1];
2437
2456
  y = old[i + 2];
2438
- data.push(M$3, x, y);
2457
+ data.push(M$4, x, y);
2439
2458
  i += 3;
2440
2459
  break;
2441
2460
  case h:
2442
2461
  old[i + 1] += x;
2443
2462
  case H:
2444
2463
  x = old[i + 1];
2445
- data.push(L$4, x, y);
2464
+ data.push(L$5, x, y);
2446
2465
  i += 2;
2447
2466
  break;
2448
2467
  case v:
2449
2468
  old[i + 1] += y;
2450
2469
  case V:
2451
2470
  y = old[i + 1];
2452
- data.push(L$4, x, y);
2471
+ data.push(L$5, x, y);
2453
2472
  i += 2;
2454
2473
  break;
2455
2474
  case l:
2456
2475
  old[i + 1] += x;
2457
2476
  old[i + 2] += y;
2458
- case L$4:
2477
+ case L$5:
2459
2478
  x = old[i + 1];
2460
2479
  y = old[i + 2];
2461
- data.push(L$4, x, y);
2480
+ data.push(L$5, x, y);
2462
2481
  i += 3;
2463
2482
  break;
2464
2483
  case s:
@@ -2468,14 +2487,14 @@ const PathConvert = {
2468
2487
  old[i + 4] += y;
2469
2488
  command = S;
2470
2489
  case S:
2471
- smooth = (lastCommand === C$3) || (lastCommand === S);
2490
+ smooth = (lastCommand === C$4) || (lastCommand === S);
2472
2491
  x1 = smooth ? (x * 2 - controlX) : old[i + 1];
2473
2492
  y1 = smooth ? (y * 2 - controlY) : old[i + 2];
2474
2493
  controlX = old[i + 1];
2475
2494
  controlY = old[i + 2];
2476
2495
  x = old[i + 3];
2477
2496
  y = old[i + 4];
2478
- data.push(C$3, x1, y1, controlX, controlY, x, y);
2497
+ data.push(C$4, x1, y1, controlX, controlY, x, y);
2479
2498
  i += 5;
2480
2499
  break;
2481
2500
  case c:
@@ -2485,13 +2504,13 @@ const PathConvert = {
2485
2504
  old[i + 4] += y;
2486
2505
  old[i + 5] += x;
2487
2506
  old[i + 6] += y;
2488
- command = C$3;
2489
- case C$3:
2507
+ command = C$4;
2508
+ case C$4:
2490
2509
  controlX = old[i + 3];
2491
2510
  controlY = old[i + 4];
2492
2511
  x = old[i + 5];
2493
2512
  y = old[i + 6];
2494
- data.push(C$3, old[i + 1], old[i + 2], controlX, controlY, x, y);
2513
+ data.push(C$4, old[i + 1], old[i + 2], controlX, controlY, x, y);
2495
2514
  i += 7;
2496
2515
  break;
2497
2516
  case t:
@@ -2531,8 +2550,8 @@ const PathConvert = {
2531
2550
  i += 8;
2532
2551
  break;
2533
2552
  case z:
2534
- case Z$3:
2535
- data.push(Z$3);
2553
+ case Z$4:
2554
+ data.push(Z$4);
2536
2555
  i++;
2537
2556
  break;
2538
2557
  case N$3:
@@ -2577,7 +2596,7 @@ const PathConvert = {
2577
2596
  y = old[i + 2];
2578
2597
  i += 4;
2579
2598
  break;
2580
- case U$3:
2599
+ case U$4:
2581
2600
  arcTo$2(curveMode ? data : copyData(data, old, i, 6), x, y, old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], null, setEndPoint$1);
2582
2601
  x = setEndPoint$1.x;
2583
2602
  y = setEndPoint$1.y;
@@ -2608,26 +2627,26 @@ const PathConvert = {
2608
2627
  };
2609
2628
  const { current, pushData, copyData } = PathConvert;
2610
2629
 
2611
- const { M: M$2, L: L$3, C: C$2, Q: Q$2, Z: Z$2, N: N$2, D: D$2, X: X$2, G: G$2, F: F$2, O: O$2, P: P$2, U: U$2 } = PathCommandMap;
2630
+ const { M: M$3, L: L$4, C: C$3, Q: Q$2, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F: F$2, O: O$2, P: P$2, U: U$3 } = PathCommandMap;
2612
2631
  const startPoint = {};
2613
2632
  const PathCommandDataHelper = {
2614
2633
  beginPath(data) {
2615
2634
  data.length = 0;
2616
2635
  },
2617
2636
  moveTo(data, x, y) {
2618
- data.push(M$2, x, y);
2637
+ data.push(M$3, x, y);
2619
2638
  },
2620
2639
  lineTo(data, x, y) {
2621
- data.push(L$3, x, y);
2640
+ data.push(L$4, x, y);
2622
2641
  },
2623
2642
  bezierCurveTo(data, x1, y1, x2, y2, x, y) {
2624
- data.push(C$2, x1, y1, x2, y2, x, y);
2643
+ data.push(C$3, x1, y1, x2, y2, x, y);
2625
2644
  },
2626
2645
  quadraticCurveTo(data, x1, y1, x, y) {
2627
2646
  data.push(Q$2, x1, y1, x, y);
2628
2647
  },
2629
2648
  closePath(data) {
2630
- data.push(Z$2);
2649
+ data.push(Z$3);
2631
2650
  },
2632
2651
  rect(data, x, y, width, height) {
2633
2652
  data.push(N$2, x, y, width, height);
@@ -2669,7 +2688,7 @@ const PathCommandDataHelper = {
2669
2688
  }
2670
2689
  },
2671
2690
  arcTo(data, x1, y1, x2, y2, radius) {
2672
- data.push(U$2, x1, y1, x2, y2, radius);
2691
+ data.push(U$3, x1, y1, x2, y2, radius);
2673
2692
  },
2674
2693
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
2675
2694
  if (rotation === undefined)
@@ -2679,7 +2698,7 @@ const PathCommandDataHelper = {
2679
2698
  if (endAngle === undefined)
2680
2699
  endAngle = 360;
2681
2700
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, null, null, startPoint);
2682
- data.push(M$2, startPoint.x, startPoint.y);
2701
+ data.push(M$3, startPoint.x, startPoint.y);
2683
2702
  ellipse$3(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
2684
2703
  },
2685
2704
  drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
@@ -2688,7 +2707,7 @@ const PathCommandDataHelper = {
2688
2707
  if (endAngle === undefined)
2689
2708
  endAngle = 360;
2690
2709
  BezierHelper.arc(null, x, y, radius, startAngle, endAngle, anticlockwise, null, null, startPoint);
2691
- data.push(M$2, startPoint.x, startPoint.y);
2710
+ data.push(M$3, startPoint.x, startPoint.y);
2692
2711
  arc$2(data, x, y, radius, startAngle, endAngle, anticlockwise);
2693
2712
  },
2694
2713
  drawPoints(data, points, curve, close) {
@@ -2765,7 +2784,7 @@ class PathCreator {
2765
2784
  }
2766
2785
  }
2767
2786
 
2768
- const { M: M$1, L: L$2, C: C$1, Q: Q$1, Z: Z$1, N: N$1, D: D$1, X: X$1, G: G$1, F: F$1, O: O$1, P: P$1, U: U$1 } = PathCommandMap;
2787
+ const { M: M$2, L: L$3, C: C$2, Q: Q$1, Z: Z$2, N: N$1, D: D$1, X: X$1, G: G$1, F: F$1, O: O$1, P: P$1, U: U$2 } = PathCommandMap;
2769
2788
  const debug$a = Debug.get('PathDrawer');
2770
2789
  const PathDrawer = {
2771
2790
  drawPathByData(drawer, data) {
@@ -2776,15 +2795,15 @@ const PathDrawer = {
2776
2795
  while (i < len) {
2777
2796
  command = data[i];
2778
2797
  switch (command) {
2779
- case M$1:
2798
+ case M$2:
2780
2799
  drawer.moveTo(data[i + 1], data[i + 2]);
2781
2800
  i += 3;
2782
2801
  break;
2783
- case L$2:
2802
+ case L$3:
2784
2803
  drawer.lineTo(data[i + 1], data[i + 2]);
2785
2804
  i += 3;
2786
2805
  break;
2787
- case C$1:
2806
+ case C$2:
2788
2807
  drawer.bezierCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
2789
2808
  i += 7;
2790
2809
  break;
@@ -2792,7 +2811,7 @@ const PathDrawer = {
2792
2811
  drawer.quadraticCurveTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4]);
2793
2812
  i += 5;
2794
2813
  break;
2795
- case Z$1:
2814
+ case Z$2:
2796
2815
  drawer.closePath();
2797
2816
  i += 1;
2798
2817
  break;
@@ -2824,7 +2843,7 @@ const PathDrawer = {
2824
2843
  drawer.arc(data[i + 1], data[i + 2], data[i + 3], 0, PI2, false);
2825
2844
  i += 4;
2826
2845
  break;
2827
- case U$1:
2846
+ case U$2:
2828
2847
  drawer.arcTo(data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5]);
2829
2848
  i += 6;
2830
2849
  break;
@@ -2836,7 +2855,7 @@ const PathDrawer = {
2836
2855
  }
2837
2856
  };
2838
2857
 
2839
- const { M, L: L$1, C, Q, Z, N, D, X, G, F, O, P, U } = PathCommandMap;
2858
+ const { M: M$1, L: L$2, C: C$1, Q, Z: Z$1, N, D, X, G, F, O, P, U: U$1 } = PathCommandMap;
2840
2859
  const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo, arc, ellipse: ellipse$1 } = BezierHelper;
2841
2860
  const { add: add$1, copy: copy$6, addPoint, setPoint, addBounds, toBounds: toBounds$3 } = TwoPointBoundsHelper;
2842
2861
  const debug$9 = Debug.get('PathBounds');
@@ -2858,7 +2877,7 @@ const PathBounds = {
2858
2877
  while (i < len) {
2859
2878
  command = data[i];
2860
2879
  if (i === 0) {
2861
- if (command === Z || command === C || command === Q) {
2880
+ if (command === Z$1 || command === C$1 || command === Q) {
2862
2881
  setPoint(setPointBounds, x, y);
2863
2882
  }
2864
2883
  else {
@@ -2866,14 +2885,14 @@ const PathBounds = {
2866
2885
  }
2867
2886
  }
2868
2887
  switch (command) {
2869
- case M:
2870
- case L$1:
2888
+ case M$1:
2889
+ case L$2:
2871
2890
  x = data[i + 1];
2872
2891
  y = data[i + 2];
2873
2892
  addPoint(setPointBounds, x, y);
2874
2893
  i += 3;
2875
2894
  break;
2876
- case C:
2895
+ case C$1:
2877
2896
  toX = data[i + 5];
2878
2897
  toY = data[i + 6];
2879
2898
  toTwoPointBounds(x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], toX, toY, tempPointBounds);
@@ -2893,7 +2912,7 @@ const PathBounds = {
2893
2912
  y = toY;
2894
2913
  i += 5;
2895
2914
  break;
2896
- case Z:
2915
+ case Z$1:
2897
2916
  i += 1;
2898
2917
  break;
2899
2918
  case N:
@@ -2940,7 +2959,7 @@ const PathBounds = {
2940
2959
  x += radius;
2941
2960
  i += 4;
2942
2961
  break;
2943
- case U:
2962
+ case U$1:
2944
2963
  arcTo(null, x, y, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], tempPointBounds, setEndPoint);
2945
2964
  i === 0 ? copy$6(setPointBounds, tempPointBounds) : add$1(setPointBounds, tempPointBounds);
2946
2965
  x = setEndPoint.x;
@@ -2955,9 +2974,60 @@ const PathBounds = {
2955
2974
  }
2956
2975
  };
2957
2976
 
2977
+ const { M, L: L$1, C, Z, U } = PathCommandMap;
2958
2978
  const PathCorner = {
2959
- smooth(data, _cornerRadius, _cornerSmoothing) {
2960
- return data;
2979
+ smooth(data, cornerRadius, _cornerSmoothing) {
2980
+ let command;
2981
+ let i = 0, x = 0, y = 0, startX, startY = 0, centerX = 0, centerY = 0;
2982
+ const len = data.length;
2983
+ const smooth = [];
2984
+ while (i < len) {
2985
+ command = data[i];
2986
+ switch (command) {
2987
+ case M:
2988
+ startX = data[i + 1];
2989
+ startY = data[i + 2];
2990
+ i += 3;
2991
+ if (data[i] === L$1) {
2992
+ centerX = startX + (data[i + 1] - startX) / 2;
2993
+ centerY = startY + (data[i + 2] - startY) / 2;
2994
+ smooth.push(M, centerX, centerY);
2995
+ }
2996
+ else {
2997
+ smooth.push(M, startX, startY);
2998
+ }
2999
+ break;
3000
+ case L$1:
3001
+ x = data[i + 1];
3002
+ y = data[i + 2];
3003
+ i += 3;
3004
+ switch (data[i]) {
3005
+ case L$1:
3006
+ smooth.push(U, x, y, data[i + 1], data[i + 2], cornerRadius);
3007
+ break;
3008
+ case Z:
3009
+ smooth.push(U, x, y, startX, startY, cornerRadius);
3010
+ break;
3011
+ default:
3012
+ smooth.push(L$1, x, y);
3013
+ }
3014
+ break;
3015
+ case C:
3016
+ smooth.push(C, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6]);
3017
+ i += 7;
3018
+ break;
3019
+ case Z:
3020
+ smooth.push(U, startX, startY, centerX, centerY, cornerRadius);
3021
+ smooth.push(Z);
3022
+ i += 1;
3023
+ break;
3024
+ }
3025
+ }
3026
+ if (command !== Z) {
3027
+ smooth[1] = startX;
3028
+ smooth[2] = startY;
3029
+ }
3030
+ return smooth;
2961
3031
  }
2962
3032
  };
2963
3033
 
@@ -3009,9 +3079,7 @@ class TaskItem {
3009
3079
  }
3010
3080
 
3011
3081
  class TaskProcessor {
3012
- get total() {
3013
- return this.list.length + this.delayNumber;
3014
- }
3082
+ get total() { return this.list.length + this.delayNumber; }
3015
3083
  get finishedIndex() {
3016
3084
  return this.isComplete ? 0 : this.index + this.parallelSuccessNumber;
3017
3085
  }
@@ -3067,8 +3135,10 @@ class TaskProcessor {
3067
3135
  else {
3068
3136
  this.delayNumber++;
3069
3137
  setTimeout(() => {
3070
- this.delayNumber--;
3071
- this.push(task, start);
3138
+ if (this.delayNumber) {
3139
+ this.delayNumber--;
3140
+ this.push(task, start);
3141
+ }
3072
3142
  }, delay);
3073
3143
  }
3074
3144
  this.isComplete = false;
@@ -3085,6 +3155,7 @@ class TaskProcessor {
3085
3155
  this.parallelSuccessNumber = 0;
3086
3156
  this.list = [];
3087
3157
  this.parallelList = [];
3158
+ this.delayNumber = 0;
3088
3159
  }
3089
3160
  start() {
3090
3161
  if (!this.running) {
@@ -3257,6 +3328,23 @@ const ImageManager = {
3257
3328
  list.length = 0;
3258
3329
  }
3259
3330
  },
3331
+ isPixel(config) {
3332
+ return FileHelper.opacityTypes.some(item => I$1.isFormat(item, config));
3333
+ },
3334
+ isFormat(format, config) {
3335
+ if (config.format === format)
3336
+ return true;
3337
+ const { url } = config;
3338
+ if (url.startsWith('data:')) {
3339
+ if (url.startsWith('data:' + FileHelper.mineType(format)))
3340
+ return true;
3341
+ }
3342
+ else {
3343
+ if (url.includes('.' + format) || url.includes('.' + FileHelper.upperCaseTypeMap[format]))
3344
+ return true;
3345
+ }
3346
+ return false;
3347
+ },
3260
3348
  destroy() {
3261
3349
  I$1.map = {};
3262
3350
  }
@@ -3272,17 +3360,7 @@ class LeaferImage {
3272
3360
  this.waitComplete = [];
3273
3361
  this.innerId = create$1(IMAGE);
3274
3362
  this.config = config || { url: '' };
3275
- const { url } = config;
3276
- if (url.startsWith('data:')) {
3277
- if (url.startsWith('data:image/svg'))
3278
- this.isSVG = true;
3279
- }
3280
- else {
3281
- if (url.includes('.svg'))
3282
- this.isSVG = true;
3283
- }
3284
- if (this.config.format === 'svg')
3285
- this.isSVG = true;
3363
+ this.isSVG = ImageManager.isFormat('svg', config);
3286
3364
  }
3287
3365
  load(onSuccess, onError) {
3288
3366
  if (!this.loading) {
@@ -3355,13 +3433,19 @@ class Event {
3355
3433
  }
3356
3434
  stopDefault() {
3357
3435
  this.isStopDefault = true;
3436
+ if (this.origin)
3437
+ Platform.event.stopDefault(this.origin);
3358
3438
  }
3359
3439
  stopNow() {
3360
3440
  this.isStopNow = true;
3361
3441
  this.isStop = true;
3442
+ if (this.origin)
3443
+ Platform.event.stopNow(this.origin);
3362
3444
  }
3363
3445
  stop() {
3364
3446
  this.isStop = true;
3447
+ if (this.origin)
3448
+ Platform.event.stop(this.origin);
3365
3449
  }
3366
3450
  }
3367
3451
 
@@ -3423,20 +3507,6 @@ class ResizeEvent extends Event {
3423
3507
  }
3424
3508
  ResizeEvent.RESIZE = 'resize';
3425
3509
 
3426
- class TransformEvent extends Event {
3427
- constructor(type, params) {
3428
- super(type);
3429
- if (params)
3430
- Object.assign(this, params);
3431
- }
3432
- }
3433
- TransformEvent.START = 'transform.start';
3434
- TransformEvent.CHANGE = 'transform.change';
3435
- TransformEvent.END = 'transform.end';
3436
- TransformEvent.BEFORE_START = 'transform.before_start';
3437
- TransformEvent.BEFORE_CHANGE = 'transform.before_change';
3438
- TransformEvent.BEFORE_END = 'transform.before_end';
3439
-
3440
3510
  class WatchEvent extends Event {
3441
3511
  constructor(type, data) {
3442
3512
  super(type);
@@ -3537,15 +3607,15 @@ class UIEvent extends Event {
3537
3607
  this.bubbles = true;
3538
3608
  Object.assign(this, params);
3539
3609
  }
3540
- getInner(target) {
3541
- if (!target)
3542
- target = this.current;
3543
- return target.getInnerPoint(this);
3610
+ getInner(relative) {
3611
+ if (!relative)
3612
+ relative = this.current;
3613
+ return relative.getInnerPoint(this);
3544
3614
  }
3545
- getLocal(target) {
3546
- if (!target)
3547
- target = this.current;
3548
- return target.getLocalPoint(this);
3615
+ getLocal(relative) {
3616
+ if (!relative)
3617
+ relative = this.current;
3618
+ return relative.getLocalPoint(this);
3549
3619
  }
3550
3620
  static changeName(oldName, newName) {
3551
3621
  EventCreator.changeName(oldName, newName);
@@ -3592,7 +3662,7 @@ function positionType(defaultValue) {
3592
3662
  defineLeafAttr(target, key, defaultValue, {
3593
3663
  set(value) {
3594
3664
  this.__setAttr(key, value);
3595
- this.__layout.positionChanged || this.__layout.positionChange();
3665
+ this.__layout.matrixChanged || this.__layout.matrixChange();
3596
3666
  }
3597
3667
  });
3598
3668
  };
@@ -3624,7 +3694,7 @@ function boundsType(defaultValue) {
3624
3694
  this.__setAttr(key, value);
3625
3695
  this.__layout.boxChanged || this.__layout.boxChange();
3626
3696
  if (this.__.around)
3627
- this.__layout.positionChanged || this.__layout.positionChange();
3697
+ this.__layout.matrixChanged || this.__layout.matrixChange();
3628
3698
  }
3629
3699
  });
3630
3700
  };
@@ -3860,29 +3930,36 @@ PointerEvent.CLICK = 'click';
3860
3930
  PointerEvent.DOUBLE_CLICK = 'double_click';
3861
3931
  PointerEvent.LONG_PRESS = 'long_press';
3862
3932
  PointerEvent.LONG_TAP = 'long_tap';
3933
+ PointerEvent.MENU = 'pointer.menu';
3863
3934
  PointerEvent = __decorate([
3864
3935
  registerUIEvent()
3865
3936
  ], PointerEvent);
3866
3937
 
3867
3938
  const move = {};
3868
3939
  let DragEvent = class DragEvent extends PointerEvent {
3869
- getInnerMove(target, total) {
3870
- if (!target)
3871
- target = this.current;
3940
+ static setList(data) {
3941
+ this.list = data instanceof LeafList ? data : new LeafList(data);
3942
+ }
3943
+ static setData(data) {
3944
+ this.data = data;
3945
+ }
3946
+ getInnerMove(relative, total) {
3947
+ if (!relative)
3948
+ relative = this.current;
3872
3949
  this.assignMove(total);
3873
- return target.getInnerPoint(move, null, true);
3950
+ return relative.getInnerPoint(move, null, true);
3874
3951
  }
3875
- getLocalMove(target, total) {
3876
- if (!target)
3877
- target = this.current;
3952
+ getLocalMove(relative, total) {
3953
+ if (!relative)
3954
+ relative = this.current;
3878
3955
  this.assignMove(total);
3879
- return target.getLocalPoint(move, null, true);
3956
+ return relative.getLocalPoint(move, null, true);
3880
3957
  }
3881
- getInnerTotal(target) {
3882
- return this.getInnerMove(target, true);
3958
+ getInnerTotal(relative) {
3959
+ return this.getInnerMove(relative, true);
3883
3960
  }
3884
- getLocalTotal(target) {
3885
- return this.getLocalMove(target, true);
3961
+ getLocalTotal(relative) {
3962
+ return this.getLocalMove(relative, true);
3886
3963
  }
3887
3964
  assignMove(total) {
3888
3965
  move.x = total ? this.totalX : this.moveX;
@@ -3901,17 +3978,16 @@ DragEvent = __decorate([
3901
3978
  registerUIEvent()
3902
3979
  ], DragEvent);
3903
3980
 
3904
- var DropEvent_1;
3905
- let DropEvent = DropEvent_1 = class DropEvent extends PointerEvent {
3981
+ let DropEvent = class DropEvent extends PointerEvent {
3906
3982
  static setList(data) {
3907
- DropEvent_1.dragList = data instanceof LeafList ? data : new LeafList(data);
3983
+ DragEvent.setList(data);
3908
3984
  }
3909
3985
  static setData(data) {
3910
- this.dragData = data;
3986
+ DragEvent.setData(data);
3911
3987
  }
3912
3988
  };
3913
3989
  DropEvent.DROP = 'drop';
3914
- DropEvent = DropEvent_1 = __decorate([
3990
+ DropEvent = __decorate([
3915
3991
  registerUIEvent()
3916
3992
  ], DropEvent);
3917
3993
 
@@ -4018,7 +4094,6 @@ class Transformer {
4018
4094
  this.moveEnd();
4019
4095
  this.zoomEnd();
4020
4096
  this.rotateEnd();
4021
- this.transformMode = null;
4022
4097
  }
4023
4098
  moveEnd() {
4024
4099
  if (this.moveData) {
@@ -4043,7 +4118,7 @@ class Transformer {
4043
4118
  }
4044
4119
  }
4045
4120
 
4046
- const { copy: copy$5, translate: translate$2, toInnerPoint: toInnerPoint$1, scaleOfOuter: scaleOfOuter$3, rotateOfOuter: rotateOfOuter$3, skewOfOuter } = MatrixHelper;
4121
+ const { copy: copy$5, toInnerPoint: toInnerPoint$1, scaleOfOuter: scaleOfOuter$3, rotateOfOuter: rotateOfOuter$3, skewOfOuter } = MatrixHelper;
4047
4122
  const matrix = {};
4048
4123
  const LeafHelper = {
4049
4124
  updateAllWorldMatrix(leaf) {
@@ -4086,63 +4161,41 @@ const LeafHelper = {
4086
4161
  return true;
4087
4162
  },
4088
4163
  moveWorld(t, x, y) {
4089
- t.__layout.checkUpdate();
4090
4164
  const local = { x, y };
4091
4165
  if (t.parent)
4092
- toInnerPoint$1(t.parent.__world, local, local, true);
4166
+ toInnerPoint$1(t.parent.worldTransform, local, local, true);
4093
4167
  L.moveLocal(t, local.x, local.y);
4094
4168
  },
4095
4169
  moveLocal(t, x, y = 0) {
4096
4170
  t.x += x;
4097
4171
  t.y += y;
4098
4172
  },
4099
- zoomOfWorld(t, origin, scaleX, scaleY, moveLayer) {
4100
- t.__layout.checkUpdate();
4101
- const local = t.parent ? PointHelper.tempToInnerOf(origin, t.parent.__world) : origin;
4102
- this.zoomOfLocal(t, local, scaleX, scaleY, moveLayer);
4173
+ zoomOfWorld(t, origin, scaleX, scaleY) {
4174
+ this.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY);
4103
4175
  },
4104
- zoomOfLocal(t, origin, scaleX, scaleY = scaleX, moveLayer) {
4176
+ zoomOfLocal(t, origin, scaleX, scaleY = scaleX) {
4105
4177
  copy$5(matrix, t.__local);
4106
- if (moveLayer)
4107
- translate$2(matrix, moveLayer.x, moveLayer.y);
4108
4178
  scaleOfOuter$3(matrix, origin, scaleX, scaleY);
4109
- if (!moveLayer)
4110
- moveLayer = t;
4111
- moveLayer.x += matrix.e - t.__local.e;
4112
- moveLayer.y += matrix.f - t.__local.f;
4179
+ moveByMatrix(t, matrix);
4113
4180
  t.scaleX *= scaleX;
4114
4181
  t.scaleY *= scaleY;
4115
4182
  },
4116
- rotateOfWorld(t, origin, angle, moveLayer) {
4117
- t.__layout.checkUpdate();
4118
- const local = t.parent ? PointHelper.tempToInnerOf(origin, t.parent.__world) : origin;
4119
- this.rotateOfLocal(t, local, angle, moveLayer);
4183
+ rotateOfWorld(t, origin, angle) {
4184
+ this.rotateOfLocal(t, getTempLocal(t, origin), angle);
4120
4185
  },
4121
- rotateOfLocal(t, origin, angle, moveLayer) {
4186
+ rotateOfLocal(t, origin, angle) {
4122
4187
  copy$5(matrix, t.__local);
4123
- if (moveLayer)
4124
- translate$2(matrix, moveLayer.x, moveLayer.y);
4125
4188
  rotateOfOuter$3(matrix, origin, angle);
4126
- if (!moveLayer)
4127
- moveLayer = t;
4128
- moveLayer.x += matrix.e - t.__local.e;
4129
- moveLayer.y += matrix.f - t.__local.f;
4189
+ moveByMatrix(t, matrix);
4130
4190
  t.rotation = MathHelper.formatRotation(t.rotation + angle);
4131
4191
  },
4132
- skewOfWorld(t, origin, skewX, skewY, moveLayer) {
4133
- t.__layout.checkUpdate();
4134
- const local = t.parent ? PointHelper.tempToInnerOf(origin, t.parent.__world) : origin;
4135
- this.skewOfLocal(t, local, skewX, skewY, moveLayer);
4192
+ skewOfWorld(t, origin, skewX, skewY) {
4193
+ this.skewOfLocal(t, getTempLocal(t, origin), skewX, skewY);
4136
4194
  },
4137
- skewOfLocal(t, origin, skewX, skewY, moveLayer) {
4195
+ skewOfLocal(t, origin, skewX, skewY) {
4138
4196
  copy$5(matrix, t.__local);
4139
- if (moveLayer)
4140
- translate$2(matrix, moveLayer.x, moveLayer.y);
4141
4197
  skewOfOuter(matrix, origin, skewX, skewY);
4142
- if (!moveLayer)
4143
- moveLayer = t;
4144
- moveLayer.x = matrix.e - t.__local.e;
4145
- moveLayer.y = matrix.f - t.__local.f;
4198
+ moveByMatrix(t, matrix);
4146
4199
  t.skewX = MathHelper.formatSkew(t.skewX + skewX);
4147
4200
  t.skewY = MathHelper.formatSkew(t.skewY + skewY);
4148
4201
  },
@@ -4152,10 +4205,29 @@ const LeafHelper = {
4152
4205
  parent.worldToInner(position);
4153
4206
  t.set(position);
4154
4207
  parent.add(t);
4208
+ },
4209
+ hasParent(t, parent) {
4210
+ if (!parent)
4211
+ return false;
4212
+ let p = t;
4213
+ while (p) {
4214
+ if (parent === p)
4215
+ return true;
4216
+ p = p.parent;
4217
+ }
4218
+ return false;
4155
4219
  }
4156
4220
  };
4157
4221
  const L = LeafHelper;
4158
4222
  const { updateAllWorldMatrix: updateAllWorldMatrix$2, updateAllWorldOpacity: updateAllWorldOpacity$1, updateAllChange: updateAllChange$1 } = L;
4223
+ function moveByMatrix(t, matrix) {
4224
+ t.x += matrix.e - t.__local.e;
4225
+ t.y += matrix.f - t.__local.f;
4226
+ }
4227
+ function getTempLocal(t, world) {
4228
+ t.__layout.checkUpdate();
4229
+ return t.parent ? PointHelper.tempToInnerOf(world, t.parent.__world) : world;
4230
+ }
4159
4231
 
4160
4232
  const LeafBoundsHelper = {
4161
4233
  worldBounds(target) {
@@ -4317,7 +4389,8 @@ const InteractionHelper = {
4317
4389
  };
4318
4390
  const I = InteractionHelper;
4319
4391
 
4320
- const { getDragEventData, getDropEventData, getSwipeEventData, filterPathByEventType } = InteractionHelper;
4392
+ const emptyList = new LeafList();
4393
+ const { getDragEventData, getDropEventData, getSwipeEventData } = InteractionHelper;
4321
4394
  class Dragger {
4322
4395
  constructor(interaction) {
4323
4396
  this.interaction = interaction;
@@ -4325,8 +4398,8 @@ class Dragger {
4325
4398
  setDragData(data) {
4326
4399
  this.dragData = getDragEventData(data, data, data);
4327
4400
  }
4328
- getDragList() {
4329
- return this.dragging ? DropEvent.dragList || this.dragList : null;
4401
+ getList() {
4402
+ return this.dragging ? (DragEvent.list || this.interaction.selector.list || this.dragableList || emptyList) : emptyList;
4330
4403
  }
4331
4404
  checkDrag(data, canDrag) {
4332
4405
  const { interaction } = this;
@@ -4355,7 +4428,7 @@ class Dragger {
4355
4428
  interaction.emit(MoveEvent.MOVE, this.dragData);
4356
4429
  }
4357
4430
  else if (this.dragging) {
4358
- this.dragDragableList();
4431
+ this.realDrag();
4359
4432
  interaction.emit(DragEvent.BEFORE_DRAG, this.dragData);
4360
4433
  interaction.emit(DragEvent.DRAG, this.dragData);
4361
4434
  }
@@ -4366,9 +4439,6 @@ class Dragger {
4366
4439
  if (this.dragging) {
4367
4440
  this.interaction.emit(DragEvent.START, this.dragData);
4368
4441
  this.getDragableList(this.dragData.path);
4369
- this.dragList = filterPathByEventType(this.dragData.path, DragEvent.DRAG);
4370
- if (!this.dragList.length && this.dragableList)
4371
- this.dragList.pushList(this.dragableList);
4372
4442
  }
4373
4443
  }
4374
4444
  }
@@ -4377,16 +4447,17 @@ class Dragger {
4377
4447
  for (let i = 0, len = path.length; i < len; i++) {
4378
4448
  leaf = path.list[i];
4379
4449
  if (leaf.__.draggable && leaf.__.hitSelf) {
4380
- this.dragableList = [leaf];
4450
+ this.dragableList = new LeafList(leaf);
4381
4451
  break;
4382
4452
  }
4383
4453
  }
4384
4454
  }
4385
- dragDragableList() {
4455
+ realDrag() {
4386
4456
  const { running } = this.interaction;
4387
- if (this.dragableList && running) {
4457
+ const list = this.getList();
4458
+ if (list.length && running) {
4388
4459
  const { moveX, moveY } = this.dragData;
4389
- this.dragableList.forEach(leaf => {
4460
+ list.forEach(leaf => {
4390
4461
  LeafHelper.moveWorld(leaf, moveX, moveY);
4391
4462
  });
4392
4463
  }
@@ -4443,20 +4514,14 @@ class Dragger {
4443
4514
  }
4444
4515
  }
4445
4516
  drop(data) {
4446
- const dropData = getDropEventData(data, this.getDragList(), DropEvent.dragData);
4517
+ const dropData = getDropEventData(data, this.getList(), DragEvent.data);
4447
4518
  dropData.path = this.dragEnterPath;
4448
4519
  this.interaction.emit(DropEvent.DROP, dropData);
4449
4520
  this.interaction.emit(DragEvent.LEAVE, data, this.dragEnterPath);
4450
4521
  }
4451
4522
  dragReset() {
4452
- DropEvent.dragList = null;
4453
- this.dragList = null;
4454
- this.dragableList = null;
4455
- this.dragData = null;
4456
- this.dragOverPath = null;
4457
- this.dragEnterPath = null;
4458
- this.dragging = null;
4459
- this.moving = null;
4523
+ DragEvent.list = DragEvent.data = this.dragableList = this.dragData = this.dragOverPath = this.dragEnterPath = null;
4524
+ this.dragging = this.moving = false;
4460
4525
  }
4461
4526
  checkDragOut(data) {
4462
4527
  const { interaction } = this;
@@ -4692,6 +4757,10 @@ class InteractionBase {
4692
4757
  this.zoom(getZoomEventData$1(center, scale, data));
4693
4758
  this.move(getMoveEventData$1(center, move, data));
4694
4759
  }
4760
+ menu(data) {
4761
+ this.findPath(data);
4762
+ this.emit(PointerEvent.MENU, data);
4763
+ }
4695
4764
  move(data) {
4696
4765
  this.transformer.move(data);
4697
4766
  }
@@ -4801,6 +4870,9 @@ class InteractionBase {
4801
4870
  data.path = find.path;
4802
4871
  return find.path;
4803
4872
  }
4873
+ isDrag(leaf) {
4874
+ return this.dragger.getList().has(leaf);
4875
+ }
4804
4876
  updateDownData(data) {
4805
4877
  if (!data)
4806
4878
  data = this.downData;
@@ -4814,7 +4886,7 @@ class InteractionBase {
4814
4886
  data = this.hoverData;
4815
4887
  if (!data)
4816
4888
  return;
4817
- this.findPath(data, { exclude: this.dragger.getDragList(), name: PointerEvent.MOVE });
4889
+ this.findPath(data, { exclude: this.dragger.getList(), name: PointerEvent.MOVE });
4818
4890
  this.hoverData = data;
4819
4891
  }
4820
4892
  updateCursor(data) {
@@ -4934,7 +5006,7 @@ class LeafLayout {
4934
5006
  this.renderBounds = this.strokeBounds = this.boxBounds = { x: 0, y: 0, width: 0, height: 0 };
4935
5007
  this.localRenderBounds = this.localStrokeBounds = leaf.__local;
4936
5008
  this.boxChange();
4937
- this.positionChange();
5009
+ this.matrixChange();
4938
5010
  }
4939
5011
  checkUpdate(force) {
4940
5012
  const { leafer } = this.leaf;
@@ -5061,11 +5133,6 @@ class LeafLayout {
5061
5133
  this.renderSpread || (this.renderSpread = 1);
5062
5134
  this.boundsChanged = true;
5063
5135
  }
5064
- positionChange() {
5065
- this.positionChanged = true;
5066
- this.matrixChanged = true;
5067
- this.localBoxChanged || this.localBoxChange();
5068
- }
5069
5136
  scaleChange() {
5070
5137
  this.scaleChanged = true;
5071
5138
  this._scaleOrRotationChange();
@@ -5077,6 +5144,9 @@ class LeafLayout {
5077
5144
  }
5078
5145
  _scaleOrRotationChange() {
5079
5146
  this.affectScaleOrRotation = true;
5147
+ this.matrixChange();
5148
+ }
5149
+ matrixChange() {
5080
5150
  this.matrixChanged = true;
5081
5151
  this.localBoxChanged || this.localBoxChange();
5082
5152
  }
@@ -5219,10 +5289,13 @@ function __getListenerMap(eventer, capture, create) {
5219
5289
  const LeafDataProxy = {
5220
5290
  __setAttr(name, newValue) {
5221
5291
  if (this.leafer && this.leafer.created) {
5222
- if (typeof newValue === 'object' || this.__.__getInput(name) !== newValue) {
5292
+ const oldValue = this.__.__getInput(name);
5293
+ if (typeof newValue === 'object' || oldValue !== newValue) {
5223
5294
  this.__[name] = newValue;
5295
+ if (this.proxyData)
5296
+ this.setProxyAttr(name, newValue);
5224
5297
  const { CHANGE } = PropertyEvent;
5225
- const event = new PropertyEvent(CHANGE, this, name, this.__.__get(name), newValue);
5298
+ const event = new PropertyEvent(CHANGE, this, name, oldValue, newValue);
5226
5299
  if (this.hasEvent(CHANGE) && !this.isLeafer)
5227
5300
  this.emitEvent(event);
5228
5301
  this.leafer.emitEvent(event);
@@ -5230,10 +5303,21 @@ const LeafDataProxy = {
5230
5303
  }
5231
5304
  else {
5232
5305
  this.__[name] = newValue;
5306
+ if (this.proxyData)
5307
+ this.setProxyAttr(name, newValue);
5233
5308
  }
5234
5309
  },
5235
5310
  __getAttr(name) {
5311
+ if (this.proxyData)
5312
+ return this.getProxyAttr(name);
5236
5313
  return this.__.__get(name);
5314
+ },
5315
+ setProxyAttr(name, newValue) {
5316
+ if (this.proxyData[name] !== newValue)
5317
+ this.proxyData[name] = newValue;
5318
+ },
5319
+ getProxyAttr(name) {
5320
+ return this.proxyData[name];
5237
5321
  }
5238
5322
  };
5239
5323
 
@@ -5313,17 +5397,17 @@ const LeafMatrix = {
5313
5397
  }
5314
5398
  }
5315
5399
  }
5316
- if (layout.positionChanged) {
5317
- r.e = this.__.x;
5318
- r.f = this.__.y;
5319
- const { width, height, around } = this.__;
5320
- if (around && width && height) {
5400
+ const { x, y, around } = this.__;
5401
+ r.e = x;
5402
+ r.f = y;
5403
+ if (around) {
5404
+ const { width, height } = this.__;
5405
+ if (width && height) {
5321
5406
  const origin = (around === 'center') ? defaultCenter : around;
5322
5407
  const offsetX = width * origin.x, offsetY = height * origin.y;
5323
5408
  r.e -= offsetX * r.a + offsetY * r.c;
5324
5409
  r.f -= offsetX * r.b + offsetY * r.d;
5325
5410
  }
5326
- layout.positionChanged = false;
5327
5411
  }
5328
5412
  this.__layout.matrixChanged = false;
5329
5413
  }
@@ -5418,7 +5502,7 @@ const LeafBounds = {
5418
5502
  data.__naturalWidth = layout.boxBounds.width;
5419
5503
  data.__naturalHeight = layout.boxBounds.height;
5420
5504
  if (this.around) {
5421
- layout.positionChanged = layout.matrixChanged = true;
5505
+ layout.matrixChanged = true;
5422
5506
  this.__updateWorldMatrix();
5423
5507
  }
5424
5508
  },
@@ -5443,6 +5527,10 @@ const LeafHit = {
5443
5527
  setRadius(point, this.__.hitRadius);
5444
5528
  }
5445
5529
  toInnerRadiusPointOf(point, this.__world, inner);
5530
+ if (this.__.hitBox) {
5531
+ if (BoundsHelper.hitRadiusPoint(this.__layout.boxBounds, inner))
5532
+ return true;
5533
+ }
5446
5534
  return this.__hit(inner);
5447
5535
  },
5448
5536
  __drawHitPath(canvas) {
@@ -5486,12 +5574,21 @@ const LeafMask = {
5486
5574
  __updateMask(value) {
5487
5575
  this.__hasMask = value ? true : this.children.some(item => item.__.isMask);
5488
5576
  },
5489
- __renderMask(canvas, content, mask) {
5577
+ __renderMask(canvas, content, mask, recycle) {
5578
+ content.opacity = 1;
5490
5579
  content.resetTransform();
5491
5580
  content.useMask(mask);
5492
- canvas.resetTransform();
5493
5581
  canvas.opacity = this.__worldOpacity;
5582
+ canvas.resetTransform();
5494
5583
  canvas.copyWorld(content);
5584
+ if (recycle) {
5585
+ content.recycle();
5586
+ mask.recycle();
5587
+ }
5588
+ else {
5589
+ content.clear();
5590
+ mask.clear();
5591
+ }
5495
5592
  },
5496
5593
  __removeMask(child) {
5497
5594
  if (child) {
@@ -5546,15 +5643,13 @@ const BranchRender = {
5546
5643
  const { children } = this;
5547
5644
  if (this.__hasMask && children.length > 1) {
5548
5645
  let mask;
5549
- let maskCanvas = canvas.getSameCanvas();
5550
- let contentCanvas = canvas.getSameCanvas();
5646
+ const maskCanvas = canvas.getSameCanvas();
5647
+ const contentCanvas = canvas.getSameCanvas();
5551
5648
  for (let i = 0, len = children.length; i < len; i++) {
5552
5649
  child = children[i];
5553
5650
  if (child.isMask) {
5554
5651
  if (mask) {
5555
5652
  this.__renderMask(canvas, contentCanvas, maskCanvas);
5556
- maskCanvas.clear();
5557
- contentCanvas.clear();
5558
5653
  }
5559
5654
  else {
5560
5655
  mask = true;
@@ -5562,11 +5657,9 @@ const BranchRender = {
5562
5657
  child.__render(maskCanvas, options);
5563
5658
  continue;
5564
5659
  }
5565
- child.__render(contentCanvas, options);
5660
+ child.__render(mask ? contentCanvas : canvas, options);
5566
5661
  }
5567
- this.__renderMask(canvas, contentCanvas, maskCanvas);
5568
- maskCanvas.recycle();
5569
- contentCanvas.recycle();
5662
+ this.__renderMask(canvas, contentCanvas, maskCanvas, true);
5570
5663
  }
5571
5664
  else {
5572
5665
  const { bounds, hideBounds } = options;
@@ -5606,11 +5699,16 @@ let Leaf = class Leaf {
5606
5699
  get __ignoreHitWorld() { return (this.__hasMask || this.__hasEraser) && this.__.hitChildren; }
5607
5700
  constructor(data) {
5608
5701
  this.innerId = create(LEAF);
5702
+ this.reset(data);
5703
+ }
5704
+ reset(data) {
5609
5705
  this.__world = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0, scaleX: 1, scaleY: 1, rotation: 0, skewX: 0, skewY: 0 };
5610
5706
  this.__local = { a: 1, b: 0, c: 0, d: 1, e: 0, f: 0, x: 0, y: 0, width: 0, height: 0 };
5611
5707
  this.__worldOpacity = 1;
5612
5708
  this.__ = new this.__DataProcessor(this);
5613
5709
  this.__layout = new this.__LayoutProcessor(this);
5710
+ if (this.__level)
5711
+ this.resetCustom();
5614
5712
  if (data) {
5615
5713
  if (data.children) {
5616
5714
  this.set(data);
@@ -5620,6 +5718,10 @@ let Leaf = class Leaf {
5620
5718
  }
5621
5719
  }
5622
5720
  }
5721
+ resetCustom() {
5722
+ this.__hasMask = this.__hasEraser = null;
5723
+ this.forceUpdate();
5724
+ }
5623
5725
  waitParent(item) {
5624
5726
  this.parent ? item() : (this.__parentWait ? this.__parentWait.push(item) : this.__parentWait = [item]);
5625
5727
  }
@@ -5634,8 +5736,11 @@ let Leaf = class Leaf {
5634
5736
  if (leafer !== null)
5635
5737
  leafer = this;
5636
5738
  }
5739
+ if (this.leafer && !leafer)
5740
+ this.leafer.leafs--;
5637
5741
  this.leafer = leafer;
5638
5742
  if (leafer) {
5743
+ leafer.leafs++;
5639
5744
  this.__level = this.parent ? this.parent.__level + 1 : 1;
5640
5745
  if (this.__leaferWait)
5641
5746
  WaitHelper.run(this.__leaferWait);
@@ -5648,6 +5753,7 @@ let Leaf = class Leaf {
5648
5753
  }
5649
5754
  }
5650
5755
  set(_data) { }
5756
+ get(_options) { return undefined; }
5651
5757
  toJSON() {
5652
5758
  return this.__.__getInputData();
5653
5759
  }
@@ -5656,9 +5762,13 @@ let Leaf = class Leaf {
5656
5762
  }
5657
5763
  __setAttr(_attrName, _newValue) { }
5658
5764
  __getAttr(_attrName) { return undefined; }
5765
+ setProxyAttr(_attrName, _newValue) { }
5766
+ getProxyAttr(_attrName) { return undefined; }
5767
+ find(_condition) { return undefined; }
5768
+ findOne(_condition) { return undefined; }
5659
5769
  forceUpdate(attrName) {
5660
5770
  if (attrName === undefined)
5661
- attrName = 'scaleX';
5771
+ attrName = 'width';
5662
5772
  else if (attrName === 'surface')
5663
5773
  attrName = 'blendMode';
5664
5774
  const value = this.__.__getInput(attrName);
@@ -5680,7 +5790,7 @@ let Leaf = class Leaf {
5680
5790
  __onUpdateSize() { }
5681
5791
  __updateEraser(_value) { }
5682
5792
  __updateMask(_value) { }
5683
- __renderMask(_canvas, _content, _mask) { }
5793
+ __renderMask(_canvas, _content, _mask, _recycle) { }
5684
5794
  __removeMask(_child) { }
5685
5795
  getWorld(attrName) {
5686
5796
  this.__layout.checkUpdate();
@@ -5865,7 +5975,7 @@ let Branch = class Branch extends Leaf {
5865
5975
  index === undefined ? this.children.push(child) : this.children.splice(index, 0, child);
5866
5976
  if (child.isBranch)
5867
5977
  this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
5868
- child.__layout.boundsChanged || child.__layout.positionChange();
5978
+ child.__layout.boundsChanged || child.__layout.matrixChange();
5869
5979
  if (child.__parentWait)
5870
5980
  WaitHelper.run(child.__parentWait);
5871
5981
  if (this.leafer) {
@@ -6084,7 +6194,7 @@ function updateMatrix(updateList, levelList) {
6084
6194
  let layout;
6085
6195
  updateList.list.forEach(leaf => {
6086
6196
  layout = leaf.__layout;
6087
- if (levelList.without(leaf) && !layout.useZoomProxy) {
6197
+ if (levelList.without(leaf) && !layout.proxyZoom) {
6088
6198
  if (layout.matrixChanged) {
6089
6199
  updateAllWorldMatrix$1(leaf);
6090
6200
  levelList.push(leaf);
@@ -6403,8 +6513,7 @@ class Renderer {
6403
6513
  const { canvas, updateBlocks: list } = this;
6404
6514
  if (!list)
6405
6515
  return debug$4.warn('PartRender: need update attr');
6406
- if (list.some(block => block.includes(this.target.__world)))
6407
- this.mergeBlocks();
6516
+ this.mergeBlocks();
6408
6517
  list.forEach(block => { if (canvas.bounds.hit(block) && !block.isEmpty())
6409
6518
  this.clipRender(block); });
6410
6519
  }
@@ -6423,7 +6532,7 @@ class Renderer {
6423
6532
  canvas.clearWorld(bounds, true);
6424
6533
  canvas.clipWorld(bounds, true);
6425
6534
  }
6426
- this.__render(bounds, realBounds);
6535
+ this.__render(bounds, includes, realBounds);
6427
6536
  canvas.restore();
6428
6537
  Run.end(t);
6429
6538
  }
@@ -6432,12 +6541,12 @@ class Renderer {
6432
6541
  const { canvas } = this;
6433
6542
  canvas.save();
6434
6543
  canvas.clear();
6435
- this.__render(canvas.bounds);
6544
+ this.__render(canvas.bounds, true);
6436
6545
  canvas.restore();
6437
6546
  Run.end(t);
6438
6547
  }
6439
- __render(bounds, realBounds) {
6440
- const options = (bounds === null || bounds === void 0 ? void 0 : bounds.includes(this.target.__world)) ? {} : { bounds };
6548
+ __render(bounds, includes, realBounds) {
6549
+ const options = bounds.includes(this.target.__world) ? { includes } : { bounds, includes };
6441
6550
  if (this.needFill)
6442
6551
  this.canvas.fillWorld(bounds, this.config.fill);
6443
6552
  if (Debug.showRepaint)
@@ -6538,7 +6647,7 @@ class Renderer {
6538
6647
  }
6539
6648
 
6540
6649
  const { hitRadiusPoint } = BoundsHelper;
6541
- class FindPath {
6650
+ class Pather {
6542
6651
  constructor(target, selector) {
6543
6652
  this.target = target;
6544
6653
  this.selector = selector;
@@ -6658,117 +6767,108 @@ class FindPath {
6658
6767
  class Selector {
6659
6768
  constructor(target, userConfig) {
6660
6769
  this.config = {};
6661
- this.innerIdList = {};
6662
- this.idList = {};
6663
- this.classNameList = {};
6664
- this.tagNameList = {};
6770
+ this.innerIdMap = {};
6771
+ this.idMap = {};
6772
+ this.methods = {
6773
+ id: (leaf, name) => leaf.id === name ? this.idMap[name] = leaf : 0,
6774
+ innerId: (leaf, innerId) => leaf.innerId === innerId ? this.innerIdMap[innerId] = leaf : 0,
6775
+ className: (leaf, name) => leaf.className === name ? 1 : 0,
6776
+ tag: (leaf, name) => leaf.__tag === name ? 1 : 0
6777
+ };
6665
6778
  this.target = target;
6666
6779
  if (userConfig)
6667
6780
  this.config = DataHelper.default(userConfig, this.config);
6668
- this.findPath = new FindPath(target, this);
6781
+ this.pather = new Pather(target, this);
6669
6782
  this.__listenEvents();
6670
6783
  }
6671
6784
  getByPoint(hitPoint, hitRadius, options) {
6672
6785
  if (Platform.name === 'node')
6673
6786
  this.target.emit(LayoutEvent.CHECK_UPDATE);
6674
- return this.findPath.getByPoint(hitPoint, hitRadius, options);
6675
- }
6676
- find(name, branch) {
6677
- if (typeof name === 'number') {
6678
- return this.getByInnerId(name, branch);
6679
- }
6680
- else if (name.startsWith('#')) {
6681
- return this.getById(name.substring(1), branch);
6682
- }
6683
- else if (name.startsWith('.')) {
6684
- return this.getByClassName(name.substring(1), branch);
6685
- }
6686
- else {
6687
- return this.getByTagName(name, branch);
6787
+ return this.pather.getByPoint(hitPoint, hitRadius, options);
6788
+ }
6789
+ getBy(condition, branch, one, options) {
6790
+ switch (typeof condition) {
6791
+ case 'number':
6792
+ const leaf = this.getByInnerId(condition, branch);
6793
+ return one ? leaf : (leaf ? [leaf] : []);
6794
+ case 'string':
6795
+ switch (condition[0]) {
6796
+ case '#':
6797
+ const leaf = this.getById(condition.substring(1), branch);
6798
+ return one ? leaf : (leaf ? [leaf] : []);
6799
+ case '.':
6800
+ return this.getByMethod(this.methods.className, branch, one, condition.substring(1));
6801
+ default:
6802
+ return this.getByMethod(this.methods.tag, branch, one, condition);
6803
+ }
6804
+ case 'function':
6805
+ return this.getByMethod(condition, branch, one, options);
6688
6806
  }
6689
6807
  }
6690
- getByInnerId(name, branch) {
6691
- let cache = this.innerIdList[name];
6808
+ getByInnerId(innerId, branch) {
6809
+ const cache = this.innerIdMap[innerId];
6692
6810
  if (cache)
6693
6811
  return cache;
6694
- if (!branch)
6695
- branch = this.target;
6696
- let find;
6697
- this.loopFind(branch, (leaf) => {
6698
- if (leaf.innerId === name) {
6699
- find = leaf;
6700
- this.innerIdList[name] = find;
6701
- return true;
6702
- }
6703
- else {
6704
- return false;
6705
- }
6706
- });
6707
- return find;
6812
+ this.eachFind(this.toChildren(branch), this.methods.innerId, null, innerId);
6813
+ return this.findLeaf;
6708
6814
  }
6709
- getById(name, branch) {
6710
- let cache = this.idList[name];
6711
- if (cache)
6815
+ getById(id, branch) {
6816
+ const cache = this.idMap[id];
6817
+ if (cache && LeafHelper.hasParent(cache, branch || this.target))
6712
6818
  return cache;
6713
- if (!branch)
6714
- branch = this.target;
6715
- let find;
6716
- this.loopFind(branch, (leaf) => {
6717
- if (leaf.id === name) {
6718
- find = leaf;
6719
- this.idList[name] = find;
6720
- return true;
6721
- }
6722
- else {
6723
- return false;
6724
- }
6725
- });
6726
- return find;
6819
+ this.eachFind(this.toChildren(branch), this.methods.id, null, id);
6820
+ return this.findLeaf;
6727
6821
  }
6728
- getByClassName(name, branch) {
6729
- if (!branch)
6730
- branch = this.target;
6731
- let find = [];
6732
- this.loopFind(branch, (leaf) => {
6733
- if (leaf.className === name)
6734
- find.push(leaf);
6735
- return false;
6736
- });
6737
- return find;
6822
+ getByClassName(className, branch) {
6823
+ return this.getByMethod(this.methods.className, branch, false, className);
6738
6824
  }
6739
- getByTagName(name, branch) {
6740
- if (!branch)
6741
- branch = this.target;
6742
- let find = [];
6743
- this.loopFind(branch, (leaf) => {
6744
- if (leaf.__tag === name)
6745
- find.push(leaf);
6746
- return false;
6747
- });
6748
- return find;
6825
+ getByTag(tag, branch) {
6826
+ return this.getByMethod(this.methods.tag, branch, false, tag);
6749
6827
  }
6750
- loopFind(branch, find) {
6751
- if (find(branch))
6752
- return;
6753
- const { children } = branch;
6828
+ getByMethod(method, branch, one, options) {
6829
+ const list = one ? null : [];
6830
+ this.eachFind(this.toChildren(branch), method, list, options);
6831
+ return list || this.findLeaf;
6832
+ }
6833
+ eachFind(children, method, list, options) {
6834
+ let child;
6754
6835
  for (let i = 0, len = children.length; i < len; i++) {
6755
- branch = children[i];
6756
- if (find(branch))
6757
- return;
6758
- if (branch.isBranch)
6759
- this.loopFind(branch, find);
6836
+ child = children[i];
6837
+ if (method(child, options)) {
6838
+ if (list) {
6839
+ list.push(child);
6840
+ }
6841
+ else {
6842
+ this.findLeaf = child;
6843
+ return;
6844
+ }
6845
+ }
6846
+ if (child.isBranch)
6847
+ this.eachFind(child.children, method, list, options);
6760
6848
  }
6761
6849
  }
6850
+ toChildren(branch) {
6851
+ this.findLeaf = null;
6852
+ return [branch || this.target];
6853
+ }
6762
6854
  __onRemoveChild(event) {
6763
- const target = event.target;
6764
- if (this.idList[target.id])
6765
- this.idList[target.id] = null;
6766
- if (this.innerIdList[target.id])
6767
- this.innerIdList[target.innerId] = null;
6855
+ const { id, innerId } = event.child;
6856
+ if (this.idMap[id])
6857
+ delete this.idMap[id];
6858
+ if (this.innerIdMap[innerId])
6859
+ delete this.innerIdMap[innerId];
6860
+ }
6861
+ __checkIdChange(event) {
6862
+ if (event.attrName === 'id') {
6863
+ const id = event.oldValue;
6864
+ if (this.idMap[id])
6865
+ delete this.idMap[id];
6866
+ }
6768
6867
  }
6769
6868
  __listenEvents() {
6770
6869
  this.__eventIds = [
6771
- this.target.on_(ChildEvent.REMOVE, this.__onRemoveChild, this)
6870
+ this.target.on_(ChildEvent.REMOVE, this.__onRemoveChild, this),
6871
+ this.target.on_(PropertyEvent.CHANGE, this.__checkIdChange, this)
6772
6872
  ];
6773
6873
  }
6774
6874
  __removeListenEvents() {
@@ -6778,11 +6878,10 @@ class Selector {
6778
6878
  destroy() {
6779
6879
  if (this.__eventIds.length) {
6780
6880
  this.__removeListenEvents();
6781
- this.findPath.destroy();
6782
- this.innerIdList = {};
6783
- this.idList = {};
6784
- this.classNameList = {};
6785
- this.tagNameList = {};
6881
+ this.pather.destroy();
6882
+ this.findLeaf = null;
6883
+ this.innerIdMap = {};
6884
+ this.idMap = {};
6786
6885
  }
6787
6886
  }
6788
6887
  }
@@ -7004,7 +7103,7 @@ const WheelEventHelper = {
7004
7103
  let { zoomMode, zoomSpeed } = config;
7005
7104
  const delta = e.deltaY || e.deltaX;
7006
7105
  if (zoomMode) {
7007
- zoom = !e.deltaX && (Platform.intWheelDeltaY ? Math.abs(delta) > 17 : Math.ceil(delta) !== delta);
7106
+ zoom = (zoomMode === 'mouse') ? true : (!e.deltaX && (Platform.intWheelDeltaY ? Math.abs(delta) > 17 : Math.ceil(delta) !== delta));
7008
7107
  if (e.shiftKey || e.metaKey || e.ctrlKey)
7009
7108
  zoom = true;
7010
7109
  }
@@ -7041,6 +7140,7 @@ class Interaction extends InteractionBase {
7041
7140
  'pointerdown': this.onPointerDown,
7042
7141
  'mousedown': this.onMouseDown,
7043
7142
  'touchstart': this.onTouchStart,
7143
+ 'contextmenu': this.onContextMenu,
7044
7144
  'wheel': this.onWheel,
7045
7145
  'gesturestart': this.onGesturestart,
7046
7146
  'gesturechange': this.onGesturechange,
@@ -7113,6 +7213,9 @@ class Interaction extends InteractionBase {
7113
7213
  onKeyUp(e) {
7114
7214
  this.keyUp(KeyEventHelper.convert(e));
7115
7215
  }
7216
+ onContextMenu(e) {
7217
+ this.menu(PointerEventHelper.convert(e, this.getLocal(e)));
7218
+ }
7116
7219
  onScroll() {
7117
7220
  this.canvas.updateClientBounds();
7118
7221
  }
@@ -7317,6 +7420,11 @@ function useCanvas(_canvasType, _power) {
7317
7420
  });
7318
7421
  }
7319
7422
  };
7423
+ Platform.event = {
7424
+ stopDefault(origin) { origin.preventDefault(); },
7425
+ stopNow(origin) { origin.stopImmediatePropagation(); },
7426
+ stop(origin) { origin.stopPropagation(); }
7427
+ };
7320
7428
  Platform.canvas = Creator.canvas();
7321
7429
  Platform.conicGradientSupport = !!Platform.canvas.context.createConicGradient;
7322
7430
  }
@@ -7353,7 +7461,7 @@ function draw(leafer) {
7353
7461
  function design(leafer) {
7354
7462
  if (leafer.isApp)
7355
7463
  return;
7356
- leafer.__eventIds.push(leafer.on_(MoveEvent.BEFORE_MOVE, (e) => { LeafHelper.moveWorld(leafer.moveLayer, e.moveX, e.moveY); }), leafer.on_(ZoomEvent.BEFORE_ZOOM, (e) => {
7464
+ leafer.__eventIds.push(leafer.on_(MoveEvent.BEFORE_MOVE, (e) => { LeafHelper.moveWorld(leafer.zoomLayer, e.moveX, e.moveY); }), leafer.on_(ZoomEvent.BEFORE_ZOOM, (e) => {
7357
7465
  const { scaleX } = leafer.zoomLayer.__, { min, max } = leafer.config.zoom;
7358
7466
  let { scale } = e;
7359
7467
  if (scale * Math.abs(scaleX) < min)
@@ -7434,6 +7542,8 @@ class UIData extends LeafData {
7434
7542
  this.__removeInput('fill');
7435
7543
  Paint.recycleImage('fill', this);
7436
7544
  this.__isFills = false;
7545
+ if (this.__pixelFill)
7546
+ this.__pixelFill = false;
7437
7547
  }
7438
7548
  this._fill = value;
7439
7549
  }
@@ -7450,6 +7560,8 @@ class UIData extends LeafData {
7450
7560
  this.__removeInput('stroke');
7451
7561
  Paint.recycleImage('stroke', this);
7452
7562
  this.__isStrokes = false;
7563
+ if (this.__pixelStroke)
7564
+ this.__pixelStroke = false;
7453
7565
  }
7454
7566
  this._stroke = value;
7455
7567
  }
@@ -7747,9 +7859,9 @@ const UIRender = {
7747
7859
  const { fill, stroke } = this.__;
7748
7860
  this.__drawRenderPath(canvas);
7749
7861
  if (fill)
7750
- Paint.fill('#000000', this, canvas);
7862
+ this.__.__pixelFill ? Paint.fills(fill, this, canvas) : Paint.fill('#000000', this, canvas);
7751
7863
  if (stroke)
7752
- Paint.stroke('#000000', this, canvas, renderOptions);
7864
+ this.__.__pixelStroke ? Paint.strokes(stroke, this, canvas, renderOptions) : Paint.stroke('#000000', this, canvas, renderOptions);
7753
7865
  }
7754
7866
  };
7755
7867
 
@@ -7796,14 +7908,19 @@ let UI = UI_1 = class UI extends Leaf {
7796
7908
  const { scaleX, scaleY } = this;
7797
7909
  return scaleX !== scaleY ? { x: scaleX, y: scaleY } : scaleX;
7798
7910
  }
7799
- constructor(data) {
7800
- super(data);
7801
- }
7911
+ reset(_data) { }
7802
7912
  set(data) {
7803
7913
  Object.assign(this, data);
7804
7914
  }
7805
- get() {
7806
- return this.__.__getInputData();
7915
+ get(options) {
7916
+ return this.__.__getInputData(options);
7917
+ }
7918
+ getProxyData() { return undefined; }
7919
+ find(condition) {
7920
+ return this.leafer ? this.leafer.selector.getBy(condition, this) : [];
7921
+ }
7922
+ findOne(condition) {
7923
+ return this.leafer ? this.leafer.selector.getBy(condition, this, true) : null;
7807
7924
  }
7808
7925
  getPath(curve) {
7809
7926
  const path = this.__.path;
@@ -7927,6 +8044,9 @@ __decorate([
7927
8044
  __decorate([
7928
8045
  strokeType('path')
7929
8046
  ], UI.prototype, "hitStroke", void 0);
8047
+ __decorate([
8048
+ hitType(false)
8049
+ ], UI.prototype, "hitBox", void 0);
7930
8050
  __decorate([
7931
8051
  hitType(true)
7932
8052
  ], UI.prototype, "hitChildren", void 0);
@@ -7987,6 +8107,9 @@ __decorate([
7987
8107
  __decorate([
7988
8108
  effectType()
7989
8109
  ], UI.prototype, "grayscale", void 0);
8110
+ __decorate([
8111
+ rewrite(Leaf.prototype.reset)
8112
+ ], UI.prototype, "reset", null);
7990
8113
  __decorate([
7991
8114
  rewrite(PathDrawer.drawPathByData)
7992
8115
  ], UI.prototype, "__drawPathByData", null);
@@ -8024,8 +8147,12 @@ let Group = class Group extends UI {
8024
8147
  if (data.children) {
8025
8148
  const { children } = data;
8026
8149
  delete data.children;
8027
- if (!this.children)
8150
+ if (!this.children) {
8028
8151
  this.__setBranch();
8152
+ }
8153
+ else {
8154
+ this.removeAll(true);
8155
+ }
8029
8156
  super.set(data);
8030
8157
  let child;
8031
8158
  children.forEach(childData => {
@@ -8226,8 +8353,10 @@ let Ellipse = class Ellipse extends UI {
8226
8353
  ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
8227
8354
  moveTo$3(path, width, ry);
8228
8355
  }
8229
- ellipse(path, rx, ry, rx, ry, 0, 0, 360, true);
8356
+ ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
8230
8357
  }
8358
+ if (Platform.ellipseToCurve)
8359
+ this.__.path = PathConvert.toCanvasData(path, true);
8231
8360
  }
8232
8361
  else {
8233
8362
  if (startAngle || endAngle) {
@@ -8537,7 +8666,7 @@ Canvas = __decorate([
8537
8666
  registerUI()
8538
8667
  ], Canvas);
8539
8668
 
8540
- const { copyAndSpread, includes, spread } = BoundsHelper;
8669
+ const { copyAndSpread, includes, spread, setByList } = BoundsHelper;
8541
8670
  let Text = class Text extends UI {
8542
8671
  get __tag() { return 'Text'; }
8543
8672
  get textDrawData() {
@@ -8571,18 +8700,19 @@ let Text = class Text extends UI {
8571
8700
  __updateBoxBounds() {
8572
8701
  const data = this.__;
8573
8702
  const layout = this.__layout;
8574
- const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase } = data;
8703
+ const { lineHeight, letterSpacing, fontFamily, fontSize, fontWeight, italic, textCase, textOverflow } = data;
8704
+ const width = data.__getInput('width');
8705
+ const height = data.__getInput('height');
8575
8706
  data.__lineHeight = UnitConvert.number(lineHeight, fontSize);
8576
8707
  data.__letterSpacing = UnitConvert.number(letterSpacing, fontSize);
8577
8708
  data.__baseLine = data.__lineHeight - (data.__lineHeight - fontSize * 0.7) / 2;
8578
8709
  data.__font = `${italic ? 'italic ' : ''}${textCase === 'small-caps' ? 'small-caps ' : ''}${fontWeight !== 'normal' ? fontWeight + ' ' : ''}${fontSize}px ${fontFamily}`;
8710
+ data.__clipText = textOverflow !== 'show' && (width || height);
8579
8711
  this.__updateTextDrawData();
8580
8712
  const { bounds } = data.__textDrawData;
8581
8713
  const b = layout.boxBounds;
8582
8714
  if (data.__lineHeight < fontSize)
8583
8715
  spread(bounds, fontSize / 2);
8584
- const width = data.__getInput('width');
8585
- const height = data.__getInput('height');
8586
8716
  if (width && height) {
8587
8717
  super.__updateBoxBounds();
8588
8718
  }
@@ -8597,6 +8727,10 @@ let Text = class Text extends UI {
8597
8727
  if (contentBounds !== layout.contentBounds) {
8598
8728
  layout.contentBounds = contentBounds;
8599
8729
  layout.renderChanged = true;
8730
+ setByList(data.__textBoxBounds = {}, [b, bounds]);
8731
+ }
8732
+ else {
8733
+ data.__textBoxBounds = contentBounds;
8600
8734
  }
8601
8735
  }
8602
8736
  __updateRenderSpread() {
@@ -8606,7 +8740,7 @@ let Text = class Text extends UI {
8606
8740
  return width;
8607
8741
  }
8608
8742
  __updateRenderBounds() {
8609
- copyAndSpread(this.__layout.renderBounds, this.__layout.contentBounds, this.__layout.renderSpread);
8743
+ copyAndSpread(this.__layout.renderBounds, this.__.__textBoxBounds, this.__layout.renderSpread);
8610
8744
  }
8611
8745
  };
8612
8746
  __decorate([
@@ -8624,6 +8758,9 @@ __decorate([
8624
8758
  __decorate([
8625
8759
  affectStrokeBoundsType('outside')
8626
8760
  ], Text.prototype, "strokeAlign", void 0);
8761
+ __decorate([
8762
+ hitType('all')
8763
+ ], Text.prototype, "hitFill", void 0);
8627
8764
  __decorate([
8628
8765
  boundsType('')
8629
8766
  ], Text.prototype, "text", void 0);
@@ -8663,6 +8800,9 @@ __decorate([
8663
8800
  __decorate([
8664
8801
  boundsType('top')
8665
8802
  ], Text.prototype, "verticalAlign", void 0);
8803
+ __decorate([
8804
+ boundsType('normal')
8805
+ ], Text.prototype, "textWrap", void 0);
8666
8806
  __decorate([
8667
8807
  boundsType('show')
8668
8808
  ], Text.prototype, "textOverflow", void 0);
@@ -8748,10 +8888,10 @@ let Leafer = class Leafer extends Group {
8748
8888
  get __tag() { return 'Leafer'; }
8749
8889
  get isApp() { return false; }
8750
8890
  get app() { return this.parent || this; }
8891
+ get cursorPoint() { return (this.interaction && this.interaction.hoverData) || { x: this.width / 2, y: this.height / 2 }; }
8751
8892
  constructor(userConfig, data) {
8752
8893
  super(data);
8753
8894
  this.zoomLayer = this;
8754
- this.moveLayer = this;
8755
8895
  this.config = {
8756
8896
  type: 'design',
8757
8897
  start: true,
@@ -8767,6 +8907,7 @@ let Leafer = class Leafer extends Group {
8767
8907
  autoDistance: 2
8768
8908
  }
8769
8909
  };
8910
+ this.leafs = 0;
8770
8911
  this.__eventIds = [];
8771
8912
  this.__controllers = [];
8772
8913
  this.__readyWait = [];
@@ -8880,9 +9021,8 @@ let Leafer = class Leafer extends Group {
8880
9021
  this.isLeafer = !!leafer;
8881
9022
  this.__level = 1;
8882
9023
  }
8883
- setZoomLayer(zoomLayer, moveLayer) {
9024
+ setZoomLayer(zoomLayer) {
8884
9025
  this.zoomLayer = zoomLayer;
8885
- this.moveLayer = moveLayer || zoomLayer;
8886
9026
  }
8887
9027
  __checkAutoLayout(config) {
8888
9028
  if (!config.width || !config.height) {
@@ -9390,10 +9530,14 @@ function checkImage(ui, canvas, paint, allowPaint) {
9390
9530
  createPattern(ui, paint, canvas.pixelRatio);
9391
9531
  }
9392
9532
  else {
9393
- ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9394
- if (canvas.bounds.hit(ui.__world) && createPattern(ui, paint, canvas.pixelRatio))
9533
+ if (!paint.patternTask) {
9534
+ paint.patternTask = ImageManager.patternTasker.add(() => __awaiter(this, void 0, void 0, function* () {
9535
+ paint.patternTask = null;
9536
+ if (canvas.bounds.hit(ui.__world))
9537
+ createPattern(ui, paint, canvas.pixelRatio);
9395
9538
  ui.forceUpdate('surface');
9396
- }), 300);
9539
+ }), 300);
9540
+ }
9397
9541
  }
9398
9542
  return false;
9399
9543
  }
@@ -9757,17 +9901,30 @@ function conicGradient(paint, box) {
9757
9901
  let recycleMap;
9758
9902
  function compute(attrName, ui) {
9759
9903
  const value = [];
9904
+ const data = ui.__;
9760
9905
  let item;
9761
- let paints = ui.__.__input[attrName];
9906
+ let paints = data.__input[attrName];
9762
9907
  if (!(paints instanceof Array))
9763
9908
  paints = [paints];
9764
- recycleMap = recycleImage(attrName, ui.__);
9909
+ recycleMap = recycleImage(attrName, data);
9765
9910
  for (let i = 0, len = paints.length; i < len; i++) {
9766
9911
  item = getLeafPaint(attrName, paints[i], ui);
9767
9912
  if (item)
9768
9913
  value.push(item);
9769
9914
  }
9770
- ui.__['_' + attrName] = value.length ? value : undefined;
9915
+ data['_' + attrName] = value.length ? value : undefined;
9916
+ let isPixel;
9917
+ if (paints.length === 1) {
9918
+ const paint = paints[0];
9919
+ if (paint.type === 'image')
9920
+ isPixel = ImageManager.isPixel(paint);
9921
+ }
9922
+ if (attrName === 'fill') {
9923
+ data.__pixelFill = isPixel;
9924
+ }
9925
+ else {
9926
+ data.__pixelStroke = isPixel;
9927
+ }
9771
9928
  }
9772
9929
  function getLeafPaint(attrName, paint, ui) {
9773
9930
  if (typeof paint !== 'object' || paint.visible === false || paint.opacity === 0)
@@ -10042,6 +10199,8 @@ function createRows(drawData, content, style) {
10042
10199
  const { width, height } = bounds;
10043
10200
  const charMode = width || height || __letterSpacing || (textCase !== 'none');
10044
10201
  if (charMode) {
10202
+ const wrap = style.textWrap !== 'none';
10203
+ const breakAll = style.textWrap === 'break';
10045
10204
  paraStart = true;
10046
10205
  lastCharType = null;
10047
10206
  startCharSize = charWidth = charSize = wordWidth = rowWidth = 0;
@@ -10068,16 +10227,23 @@ function createRows(drawData, content, style) {
10068
10227
  langBreak = (charType === Single && (lastCharType === Single || lastCharType === Letter)) || (lastCharType === Single && charType !== After);
10069
10228
  afterBreak = ((charType === Before || charType === Single) && (lastCharType === Symbol || lastCharType === After));
10070
10229
  realWidth = paraStart && paraIndent ? width - paraIndent : width;
10071
- if (width && rowWidth + wordWidth + charWidth > realWidth) {
10072
- if (!afterBreak)
10073
- afterBreak = charType === Letter && lastCharType == After;
10074
- if (langBreak || afterBreak || charType === Break || charType === Before || charType === Single || (wordWidth + charWidth > realWidth)) {
10230
+ if (wrap && (width && rowWidth + wordWidth + charWidth > realWidth)) {
10231
+ if (breakAll) {
10075
10232
  if (wordWidth)
10076
10233
  addWord();
10077
10234
  addRow();
10078
10235
  }
10079
10236
  else {
10080
- addRow();
10237
+ if (!afterBreak)
10238
+ afterBreak = charType === Letter && lastCharType == After;
10239
+ if (langBreak || afterBreak || charType === Break || charType === Before || charType === Single || (wordWidth + charWidth > realWidth)) {
10240
+ if (wordWidth)
10241
+ addWord();
10242
+ addRow();
10243
+ }
10244
+ else {
10245
+ addRow();
10246
+ }
10081
10247
  }
10082
10248
  }
10083
10249
  if (char === ' ' && paraStart !== true && (rowWidth + wordWidth) === 0) ;
@@ -10147,7 +10313,7 @@ function addRow() {
10147
10313
 
10148
10314
  const CharMode = 0;
10149
10315
  const WordMode = 1;
10150
- const RowMode = 2;
10316
+ const TextMode = 2;
10151
10317
  function layoutChar(drawData, style, width, _height) {
10152
10318
  const { rows } = drawData;
10153
10319
  const { textAlign, paraIndent, letterSpacing } = style;
@@ -10156,15 +10322,12 @@ function layoutChar(drawData, style, width, _height) {
10156
10322
  if (row.words) {
10157
10323
  indentWidth = paraIndent && row.paraStart ? paraIndent : 0;
10158
10324
  addWordWidth = (width && textAlign === 'justify' && row.words.length > 1) ? (width - row.width - indentWidth) / (row.words.length - 1) : 0;
10159
- mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : RowMode);
10160
- if (mode === RowMode) {
10161
- row.text = '';
10325
+ mode = (letterSpacing || row.isOverflow) ? CharMode : (addWordWidth > 0.01 ? WordMode : TextMode);
10326
+ if (row.isOverflow && !letterSpacing)
10327
+ row.textMode = true;
10328
+ if (mode === TextMode) {
10162
10329
  row.x += indentWidth;
10163
- row.words.forEach(word => {
10164
- word.data.forEach(char => {
10165
- row.text += char.char;
10166
- });
10167
- });
10330
+ toTextChar$1(row);
10168
10331
  }
10169
10332
  else {
10170
10333
  row.x += indentWidth;
@@ -10190,6 +10353,14 @@ function layoutChar(drawData, style, width, _height) {
10190
10353
  }
10191
10354
  });
10192
10355
  }
10356
+ function toTextChar$1(row) {
10357
+ row.text = '';
10358
+ row.words.forEach(word => {
10359
+ word.data.forEach(char => {
10360
+ row.text += char.char;
10361
+ });
10362
+ });
10363
+ }
10193
10364
  function toWordChar(data, charX, wordChar) {
10194
10365
  data.forEach(char => {
10195
10366
  wordChar.char += char.char;
@@ -10210,10 +10381,10 @@ function toChar(data, charX, rowData) {
10210
10381
 
10211
10382
  function layoutText(drawData, style) {
10212
10383
  const { rows, bounds } = drawData;
10213
- const { __lineHeight, __baseLine, __letterSpacing, textAlign, verticalAlign, paraSpacing, textOverflow } = style;
10384
+ const { __lineHeight, __baseLine, __letterSpacing, __clipText, textAlign, verticalAlign, paraSpacing } = style;
10214
10385
  let { x, y, width, height } = bounds, realHeight = __lineHeight * rows.length + (paraSpacing ? paraSpacing * (drawData.paraNumber - 1) : 0);
10215
10386
  let starY = __baseLine;
10216
- if (textOverflow !== 'show' && realHeight > height) {
10387
+ if (__clipText && realHeight > height) {
10217
10388
  realHeight = Math.max(height, __lineHeight);
10218
10389
  drawData.overflow = rows.length;
10219
10390
  }
@@ -10262,39 +10433,58 @@ function layoutText(drawData, style) {
10262
10433
  bounds.x = rowX;
10263
10434
  if (rowWidth > bounds.width)
10264
10435
  bounds.width = rowWidth;
10436
+ if (__clipText && width && width < rowWidth) {
10437
+ row.isOverflow = true;
10438
+ if (!drawData.overflow)
10439
+ drawData.overflow = rows.length;
10440
+ }
10265
10441
  }
10266
10442
  bounds.y = y;
10267
10443
  bounds.height = realHeight;
10268
10444
  }
10269
10445
 
10270
- function clipText(drawData, textOverflow) {
10446
+ function clipText(drawData, style) {
10271
10447
  const { rows, overflow } = drawData;
10448
+ let { textOverflow } = style;
10272
10449
  rows.splice(overflow);
10273
10450
  if (textOverflow !== 'hide') {
10274
10451
  if (textOverflow === 'ellipsis')
10275
10452
  textOverflow = '...';
10453
+ let char, charRight;
10276
10454
  const ellipsisWidth = Platform.canvas.measureText(textOverflow).width;
10277
- const row = rows[overflow - 1];
10278
- let char, end = row.data.length - 1, charRight;
10279
- const { x, width } = drawData.bounds;
10280
- const right = x + width - ellipsisWidth;
10281
- for (let i = end; i > -1; i--) {
10282
- char = row.data[i];
10283
- charRight = char.x + char.width;
10284
- if (i === end && charRight < right) {
10285
- break;
10286
- }
10287
- else if (charRight < right && char.char !== ' ') {
10288
- row.data.splice(i + 1);
10289
- row.width -= char.width;
10290
- break;
10455
+ const right = style.x + style.width - ellipsisWidth;
10456
+ const list = style.textWrap === 'none' ? rows : [rows[overflow - 1]];
10457
+ list.forEach(row => {
10458
+ if (row.isOverflow && row.data) {
10459
+ let end = row.data.length - 1;
10460
+ for (let i = end; i > -1; i--) {
10461
+ char = row.data[i];
10462
+ charRight = char.x + char.width;
10463
+ if (i === end && charRight < right) {
10464
+ break;
10465
+ }
10466
+ else if (charRight < right && char.char !== ' ') {
10467
+ row.data.splice(i + 1);
10468
+ row.width -= char.width;
10469
+ break;
10470
+ }
10471
+ row.width -= char.width;
10472
+ }
10473
+ row.width += ellipsisWidth;
10474
+ row.data.push({ char: textOverflow, x: charRight });
10475
+ if (row.textMode)
10476
+ toTextChar(row);
10291
10477
  }
10292
- row.width -= char.width;
10293
- }
10294
- row.width += ellipsisWidth;
10295
- row.data.push({ char: textOverflow, x: charRight });
10478
+ });
10296
10479
  }
10297
10480
  }
10481
+ function toTextChar(row) {
10482
+ row.text = '';
10483
+ row.data.forEach(char => {
10484
+ row.text += char.char;
10485
+ });
10486
+ row.data = null;
10487
+ }
10298
10488
 
10299
10489
  function decorationText(drawData, style) {
10300
10490
  const { fontSize } = style;
@@ -10315,7 +10505,7 @@ const TextConvert = {
10315
10505
  let x = 0, y = 0;
10316
10506
  let width = style.__getInput('width') || 0;
10317
10507
  let height = style.__getInput('height') || 0;
10318
- const { textDecoration, textOverflow, __font, padding } = style;
10508
+ const { textDecoration, __font, padding } = style;
10319
10509
  if (padding) {
10320
10510
  const [top, right, bottom, left] = MathHelper.fourNumber(padding);
10321
10511
  if (width) {
@@ -10337,7 +10527,7 @@ const TextConvert = {
10337
10527
  layoutText(drawData, style);
10338
10528
  layoutChar(drawData, style, width);
10339
10529
  if (drawData.overflow)
10340
- clipText(drawData, textOverflow);
10530
+ clipText(drawData, style);
10341
10531
  if (textDecoration !== 'none')
10342
10532
  decorationText(drawData, style);
10343
10533
  return drawData;
@@ -10423,4 +10613,4 @@ Object.assign(Export$1, Export);
10423
10613
 
10424
10614
  useCanvas();
10425
10615
 
10426
- export { Animate, AnimateEvent, App, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, Branch, BranchHelper, BranchRender, Canvas, CanvasManager, ChildEvent, ColorConvert$1 as ColorConvert, Creator, Cursor, DataHelper, Debug, DragEvent, DropEvent, Effect, Ellipse, EllipseHelper, Event, EventCreator, Export$1 as Export, FileHelper, Frame, Group, HitCanvasManager, Image$1 as Image, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafHit, LeafLayout, LeafLevelList, LeafList, LeafMask, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, Path, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, Platform, PluginManager, Point, PointHelper, PointerButton, PointerEvent, Polygon, PropertyEvent, Rect, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, Selector, Star, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert$1 as TextConvert, TransformEvent, TwoPointBounds, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIEvent, UIHit, UIRender, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, aliasType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, defineDataProcessor, defineKey, defineLeafAttr, effectType, eraserType, getDescriptor, hitType, layoutProcessor, maskType, opacityType, pathType, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, setDefaultValue, sortType, strokeType, surfaceType, useCanvas, useModule, usePlugin };
10616
+ export { Animate, AnimateEvent, App, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, Branch, BranchHelper, BranchRender, Canvas, CanvasManager, ChildEvent, ColorConvert$1 as ColorConvert, Creator, Cursor, DataHelper, Debug, DragEvent, DropEvent, Effect, Ellipse, EllipseHelper, Event, EventCreator, Export$1 as Export, FileHelper, Frame, Group, HitCanvasManager, Image$1 as Image, ImageEvent, ImageManager, IncrementId, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafHit, LeafLayout, LeafLevelList, LeafList, LeafMask, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, Path, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathDrawer, PathHelper, PathNumberCommandLengthMap, PathNumberCommandMap, Pen, Platform, PluginManager, Point, PointHelper, PointerButton, PointerEvent, Polygon, PropertyEvent, Rect, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, Selector, Star, StringNumberMap, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert$1 as TextConvert, TwoPointBounds, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIEvent, UIHit, UIRender, WaitHelper, WatchEvent, Watcher, ZoomEvent, affectRenderBoundsType, affectStrokeBoundsType, aliasType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, defineDataProcessor, defineKey, defineLeafAttr, effectType, eraserType, getDescriptor, hitType, layoutProcessor, maskType, opacityType, pathType, positionType, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleType, setDefaultValue, sortType, strokeType, surfaceType, useCanvas, useModule, usePlugin };