@leafer-editor/worker 1.0.10 → 1.1.1

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.
@@ -108,7 +108,7 @@ const MathHelper = {
108
108
  return rotation - oldRotation;
109
109
  },
110
110
  float(num, maxLength) {
111
- const a = maxLength ? pow$1(10, maxLength) : 1000000000000;
111
+ const a = maxLength !== undefined ? pow$1(10, maxLength) : 1000000000000;
112
112
  num = round(num * a) / a;
113
113
  return num === -0 ? 0 : num;
114
114
  },
@@ -430,7 +430,7 @@ const MatrixHelper = {
430
430
  const M$9 = MatrixHelper;
431
431
 
432
432
  const { toInnerPoint: toInnerPoint$2, toOuterPoint: toOuterPoint$3 } = MatrixHelper;
433
- const { sin: sin$4, cos: cos$4, abs: abs$5, sqrt: sqrt$2, atan2: atan2$2, min: min$1, PI: PI$3 } = Math;
433
+ const { sin: sin$4, cos: cos$4, abs: abs$6, sqrt: sqrt$2, atan2: atan2$2, min: min$1, PI: PI$3 } = Math;
434
434
  const PointHelper = {
435
435
  defaultPoint: getPointData(),
436
436
  tempPoint: {},
@@ -519,8 +519,8 @@ const PointHelper = {
519
519
  return getDistanceFrom(t.x, t.y, point.x, point.y);
520
520
  },
521
521
  getDistanceFrom(x1, y1, x2, y2) {
522
- const x = abs$5(x2 - x1);
523
- const y = abs$5(y2 - y1);
522
+ const x = abs$6(x2 - x1);
523
+ const y = abs$6(y2 - y1);
524
524
  return sqrt$2(x * x + y * y);
525
525
  },
526
526
  getMinDistanceFrom(x1, y1, x2, y2, x3, y3) {
@@ -1374,7 +1374,7 @@ function getNameList(name) {
1374
1374
  }
1375
1375
  const D$6 = Debug;
1376
1376
 
1377
- const debug$g = Debug.get('RunTime');
1377
+ const debug$h = Debug.get('RunTime');
1378
1378
  const Run = {
1379
1379
  currentId: 0,
1380
1380
  currentName: '',
@@ -1392,7 +1392,7 @@ const Run = {
1392
1392
  const time = R.idMap[id], name = R.nameMap[id];
1393
1393
  const duration = microsecond ? (performance.now() - time) / 1000 : Date.now() - time;
1394
1394
  R.idMap[id] = R.nameMap[id] = R.nameToIdMap[name] = undefined;
1395
- debug$g.log(name, duration, 'ms');
1395
+ debug$h.log(name, duration, 'ms');
1396
1396
  },
1397
1397
  endOfName(name, microsecond) {
1398
1398
  const id = R.nameToIdMap[name];
@@ -1406,18 +1406,18 @@ function needPlugin(name) {
1406
1406
  console.error('need plugin: @leafer-in/' + name);
1407
1407
  }
1408
1408
 
1409
- const debug$f = Debug.get('UICreator');
1409
+ const debug$g = Debug.get('UICreator');
1410
1410
  const UICreator = {
1411
1411
  list: {},
1412
1412
  register(UI) {
1413
1413
  const { __tag: tag } = UI.prototype;
1414
1414
  if (list$3[tag])
1415
- debug$f.repeat(tag);
1415
+ debug$g.repeat(tag);
1416
1416
  list$3[tag] = UI;
1417
1417
  },
1418
1418
  get(tag, data, x, y, width, height) {
1419
1419
  if (!list$3[tag])
1420
- debug$f.error('not register ' + tag);
1420
+ debug$g.error('not register ' + tag);
1421
1421
  const ui = new list$3[tag](data);
1422
1422
  if (x !== undefined) {
1423
1423
  ui.x = x;
@@ -1433,7 +1433,7 @@ const UICreator = {
1433
1433
  };
1434
1434
  const { list: list$3 } = UICreator;
1435
1435
 
1436
- const debug$e = Debug.get('EventCreator');
1436
+ const debug$f = Debug.get('EventCreator');
1437
1437
  const EventCreator = {
1438
1438
  nameList: {},
1439
1439
  register(Event) {
@@ -1441,7 +1441,7 @@ const EventCreator = {
1441
1441
  Object.keys(Event).forEach(key => {
1442
1442
  name = Event[key];
1443
1443
  if (typeof name === 'string')
1444
- nameList[name] && debug$e.repeat(name), nameList[name] = Event;
1444
+ nameList[name] && debug$f.repeat(name), nameList[name] = Event;
1445
1445
  });
1446
1446
  },
1447
1447
  changeName(oldName, newName) {
@@ -1513,17 +1513,19 @@ const DataHelper = {
1513
1513
  assign(t, defaultData);
1514
1514
  return t;
1515
1515
  },
1516
- assign(t, merge) {
1516
+ assign(t, merge, exclude) {
1517
1517
  let value;
1518
1518
  Object.keys(merge).forEach(key => {
1519
- var _a;
1519
+ var _a, _b;
1520
1520
  value = merge[key];
1521
- if ((value === null || value === void 0 ? void 0 : value.constructor) === Object) {
1522
- (((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object) ? assign(t[key], merge[key]) : t[key] = merge[key];
1523
- }
1524
- else {
1525
- t[key] = merge[key];
1521
+ if ((value === null || value === void 0 ? void 0 : value.constructor) === Object && ((_a = t[key]) === null || _a === void 0 ? void 0 : _a.constructor) === Object)
1522
+ return assign(t[key], merge[key], exclude && exclude[key]);
1523
+ if (exclude && (key in exclude)) {
1524
+ if (((_b = exclude[key]) === null || _b === void 0 ? void 0 : _b.constructor) === Object)
1525
+ assign(t[key] = {}, merge[key], exclude[key]);
1526
+ return;
1526
1527
  }
1528
+ t[key] = merge[key];
1527
1529
  });
1528
1530
  },
1529
1531
  copyAttrs(t, from, include) {
@@ -2327,7 +2329,7 @@ const RectHelper = {
2327
2329
  }
2328
2330
  };
2329
2331
 
2330
- const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$4, PI: PI$2, sqrt: sqrt$1, pow } = Math;
2332
+ const { sin: sin$3, cos: cos$3, atan2: atan2$1, ceil: ceil$1, abs: abs$5, PI: PI$2, sqrt: sqrt$1, pow } = Math;
2331
2333
  const { setPoint: setPoint$4, addPoint: addPoint$2 } = TwoPointBoundsHelper;
2332
2334
  const { set, toNumberPoints: toNumberPoints$1 } = PointHelper;
2333
2335
  const { M: M$8, L: L$9, C: C$8, Q: Q$7, Z: Z$7 } = PathCommandMap;
@@ -2400,7 +2402,7 @@ const BezierHelper = {
2400
2402
  let totalRadian = endRadian - startRadian;
2401
2403
  if (totalRadian < 0)
2402
2404
  totalRadian += PI2;
2403
- if (totalRadian === PI$2 || (abs$4(BAx + BAy) < 1.e-12) || (abs$4(CBx + CBy) < 1.e-12)) {
2405
+ if (totalRadian === PI$2 || (abs$5(BAx + BAy) < 1.e-12) || (abs$5(CBx + CBy) < 1.e-12)) {
2404
2406
  if (data)
2405
2407
  data.push(L$9, x1, y1);
2406
2408
  if (setPointBounds) {
@@ -2442,7 +2444,7 @@ const BezierHelper = {
2442
2444
  totalRadian -= PI2;
2443
2445
  if (anticlockwise)
2444
2446
  totalRadian -= PI2;
2445
- const parts = ceil$1(abs$4(totalRadian / PI_2));
2447
+ const parts = ceil$1(abs$5(totalRadian / PI_2));
2446
2448
  const partRadian = totalRadian / parts;
2447
2449
  const partRadian4Sin = sin$3(partRadian / 4);
2448
2450
  const control = 8 / 3 * partRadian4Sin * partRadian4Sin / sin$3(partRadian / 2);
@@ -2595,7 +2597,7 @@ const EllipseHelper = {
2595
2597
  const { M: M$7, m, L: L$8, l, H, h, V, v, C: C$7, c, S, s, Q: Q$6, q, T, t, A, a, Z: Z$6, z, N: N$5, D: D$5, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5 } = PathCommandMap;
2596
2598
  const { rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1 } = BezierHelper;
2597
2599
  const { ellipticalArc } = EllipseHelper;
2598
- const debug$d = Debug.get('PathConvert');
2600
+ const debug$e = Debug.get('PathConvert');
2599
2601
  const setEndPoint$1 = {};
2600
2602
  const PathConvert = {
2601
2603
  current: { dot: 0 },
@@ -2836,7 +2838,7 @@ const PathConvert = {
2836
2838
  i += 6;
2837
2839
  break;
2838
2840
  default:
2839
- debug$d.error(`command: ${command} [index:${i}]`, old);
2841
+ debug$e.error(`command: ${command} [index:${i}]`, old);
2840
2842
  return data;
2841
2843
  }
2842
2844
  lastCommand = command;
@@ -2883,7 +2885,7 @@ const { current, pushData, copyData } = PathConvert;
2883
2885
 
2884
2886
  const { M: M$6, L: L$7, C: C$6, Q: Q$5, Z: Z$5, N: N$4, D: D$4, X: X$4, G: G$4, F: F$5, O: O$5, P: P$4, U: U$4 } = PathCommandMap;
2885
2887
  const { getMinDistanceFrom, getRadianFrom } = PointHelper;
2886
- const { tan, min, abs: abs$3 } = Math;
2888
+ const { tan, min, abs: abs$4 } = Math;
2887
2889
  const startPoint = {};
2888
2890
  const PathCommandDataHelper = {
2889
2891
  beginPath(data) {
@@ -2946,7 +2948,7 @@ const PathCommandDataHelper = {
2946
2948
  arcTo(data, x1, y1, x2, y2, radius, lastX, lastY) {
2947
2949
  if (lastX !== undefined) {
2948
2950
  const maxRadius = tan(getRadianFrom(lastX, lastY, x1, y1, x2, y2) / 2) * (getMinDistanceFrom(lastX, lastY, x1, y1, x2, y2) / 2);
2949
- data.push(U$4, x1, y1, x2, y2, min(radius, abs$3(maxRadius)));
2951
+ data.push(U$4, x1, y1, x2, y2, min(radius, abs$4(maxRadius)));
2950
2952
  }
2951
2953
  else {
2952
2954
  data.push(U$4, x1, y1, x2, y2, radius);
@@ -3061,7 +3063,7 @@ class PathCreator {
3061
3063
  }
3062
3064
 
3063
3065
  const { M: M$5, L: L$6, C: C$5, Q: Q$4, Z: Z$4, N: N$3, D: D$3, X: X$3, G: G$3, F: F$4, O: O$4, P: P$3, U: U$3 } = PathCommandMap;
3064
- const debug$c = Debug.get('PathDrawer');
3066
+ const debug$d = Debug.get('PathDrawer');
3065
3067
  const PathDrawer = {
3066
3068
  drawPathByData(drawer, data) {
3067
3069
  if (!data)
@@ -3124,7 +3126,7 @@ const PathDrawer = {
3124
3126
  i += 6;
3125
3127
  break;
3126
3128
  default:
3127
- debug$c.error(`command: ${command} [index:${i}]`, data);
3129
+ debug$d.error(`command: ${command} [index:${i}]`, data);
3128
3130
  return;
3129
3131
  }
3130
3132
  }
@@ -3134,7 +3136,7 @@ const PathDrawer = {
3134
3136
  const { M: M$4, L: L$5, C: C$4, Q: Q$3, Z: Z$3, N: N$2, D: D$2, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2 } = PathCommandMap;
3135
3137
  const { toTwoPointBounds, toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc, ellipse: ellipse$1 } = BezierHelper;
3136
3138
  const { addPointBounds, copy: copy$b, addPoint: addPoint$1, setPoint: setPoint$3, addBounds, toBounds: toBounds$3 } = TwoPointBoundsHelper;
3137
- const debug$b = Debug.get('PathBounds');
3139
+ const debug$c = Debug.get('PathBounds');
3138
3140
  let radius, radiusX, radiusY;
3139
3141
  const tempPointBounds = {};
3140
3142
  const setPointBounds = {};
@@ -3242,7 +3244,7 @@ const PathBounds = {
3242
3244
  i += 6;
3243
3245
  break;
3244
3246
  default:
3245
- debug$b.error(`command: ${command} [index:${i}]`, data);
3247
+ debug$c.error(`command: ${command} [index:${i}]`, data);
3246
3248
  return;
3247
3249
  }
3248
3250
  }
@@ -3358,7 +3360,7 @@ const FileHelper = {
3358
3360
  const F$2 = FileHelper;
3359
3361
  F$2.opacityTypes.forEach(type => F$2.upperCaseTypeMap[type] = type.toUpperCase());
3360
3362
 
3361
- const debug$a = Debug.get('TaskProcessor');
3363
+ const debug$b = Debug.get('TaskProcessor');
3362
3364
  class TaskItem {
3363
3365
  constructor(task) {
3364
3366
  this.parallel = true;
@@ -3373,7 +3375,7 @@ class TaskItem {
3373
3375
  yield this.task();
3374
3376
  }
3375
3377
  catch (error) {
3376
- debug$a.error(error);
3378
+ debug$b.error(error);
3377
3379
  }
3378
3380
  });
3379
3381
  }
@@ -3891,6 +3893,8 @@ function opacityType(defaultValue) {
3891
3893
  return decorateLeafAttr(defaultValue, (key) => attr({
3892
3894
  set(value) {
3893
3895
  this.__setAttr(key, value) && (this.__layout.opacityChanged || this.__layout.opacityChange());
3896
+ if (this.mask)
3897
+ checkMask(this);
3894
3898
  }
3895
3899
  }));
3896
3900
  }
@@ -3907,9 +3911,20 @@ function visibleType(defaultValue) {
3907
3911
  this.__runAnimation('in');
3908
3912
  }
3909
3913
  doVisible(this, key, value, oldValue);
3914
+ if (this.mask)
3915
+ checkMask(this);
3910
3916
  }
3911
3917
  }));
3912
3918
  }
3919
+ function checkMask(leaf) {
3920
+ const { parent } = leaf;
3921
+ if (parent) {
3922
+ const { __hasMask } = parent;
3923
+ parent.__updateMask();
3924
+ if (__hasMask !== parent.__hasMask)
3925
+ parent.forceUpdate();
3926
+ }
3927
+ }
3913
3928
  function doVisible(leaf, key, value, oldValue) {
3914
3929
  if (leaf.__setAttr(key, value)) {
3915
3930
  leaf.__layout.opacityChanged || leaf.__layout.opacityChange();
@@ -4047,7 +4062,7 @@ function defineDataProcessor(target, key, defaultValue) {
4047
4062
  defineKey(data, key, property);
4048
4063
  }
4049
4064
 
4050
- const debug$9 = new Debug('rewrite');
4065
+ const debug$a = new Debug('rewrite');
4051
4066
  const list$2 = [];
4052
4067
  const excludeNames = ['destroy', 'constructor'];
4053
4068
  function rewrite(method) {
@@ -4064,7 +4079,7 @@ function doRewrite(error) {
4064
4079
  if (list$2.length) {
4065
4080
  list$2.forEach(item => {
4066
4081
  if (error)
4067
- debug$9.error(item.name, '需在Class上装饰@rewriteAble()');
4082
+ debug$a.error(item.name, '需在Class上装饰@rewriteAble()');
4068
4083
  item.run();
4069
4084
  });
4070
4085
  list$2.length = 0;
@@ -4165,20 +4180,17 @@ const LeafHelper = {
4165
4180
  }
4166
4181
  return true;
4167
4182
  },
4168
- moveWorld(t, x, y = 0, isInnerPoint) {
4183
+ moveWorld(t, x, y = 0, isInnerPoint, transition) {
4169
4184
  const local = typeof x === 'object' ? Object.assign({}, x) : { x, y };
4170
4185
  isInnerPoint ? toOuterPoint$1(t.localTransform, local, local, true) : (t.parent && toInnerPoint$1(t.parent.worldTransform, local, local, true));
4171
- L$3.moveLocal(t, local.x, local.y);
4186
+ L$3.moveLocal(t, local.x, local.y, transition);
4172
4187
  },
4173
- moveLocal(t, x, y = 0) {
4174
- if (typeof x === 'object') {
4175
- t.x += x.x;
4176
- t.y += x.y;
4177
- }
4178
- else {
4179
- t.x += x;
4180
- t.y += y;
4181
- }
4188
+ moveLocal(t, x, y = 0, transition) {
4189
+ if (typeof x === 'object')
4190
+ y = x.y, x = x.x;
4191
+ x += t.x;
4192
+ y += t.y;
4193
+ transition ? t.animate({ x, y }, transition) : (t.x = x, t.y = y);
4182
4194
  },
4183
4195
  zoomOfWorld(t, origin, scaleX, scaleY, resize) {
4184
4196
  L$3.zoomOfLocal(t, getTempLocal(t, origin), scaleX, scaleY, resize);
@@ -4975,13 +4987,13 @@ const { on, on_, off, off_, once, emit: emit$2, emitEvent: emitEvent$1, hasEvent
4975
4987
  const LeafEventer = { on, on_, off, off_, once, emit: emit$2, emitEvent: emitEvent$1, hasEvent, destroyEventer: destroy };
4976
4988
 
4977
4989
  const { isFinite } = Number;
4978
- const debug$8 = Debug.get('setAttr');
4990
+ const debug$9 = Debug.get('setAttr');
4979
4991
  const LeafDataProxy = {
4980
4992
  __setAttr(name, newValue, checkFiniteNumber) {
4981
4993
  if (this.leaferIsCreated) {
4982
4994
  const oldValue = this.__.__getInput(name);
4983
4995
  if (checkFiniteNumber && !isFinite(newValue) && newValue !== undefined) {
4984
- debug$8.warn(this.innerName, name, newValue);
4996
+ debug$9.warn(this.innerName, name, newValue);
4985
4997
  newValue = undefined;
4986
4998
  }
4987
4999
  if (typeof newValue === 'object' || oldValue !== newValue) {
@@ -5437,8 +5449,8 @@ let Leaf = class Leaf {
5437
5449
  canvas.clearRect(r.x, r.y, r.width, r.height);
5438
5450
  canvas.restore();
5439
5451
  }
5440
- __updateMask(value) {
5441
- this.__hasMask = value ? true : this.children.some(item => item.__.mask);
5452
+ __updateMask(_value) {
5453
+ this.__hasMask = this.children.some(item => item.__.mask && item.__.visible && item.__.opacity);
5442
5454
  }
5443
5455
  __renderMask(_canvas, _options) { }
5444
5456
  __getNowWorld(options) {
@@ -5558,11 +5570,11 @@ let Leaf = class Leaf {
5558
5570
  transform(matrix, resize) {
5559
5571
  transform(this, matrix, resize);
5560
5572
  }
5561
- move(x, y) {
5562
- moveLocal(this, x, y);
5573
+ move(x, y, transition) {
5574
+ moveLocal(this, x, y, transition);
5563
5575
  }
5564
- moveInner(x, y) {
5565
- moveWorld(this, x, y, true);
5576
+ moveInner(x, y, transition) {
5577
+ moveWorld(this, x, y, true, transition);
5566
5578
  }
5567
5579
  scaleOf(origin, scaleX, scaleY, resize) {
5568
5580
  zoomOfLocal(this, getLocalOrigin(this, origin), scaleX, scaleY, resize);
@@ -5576,8 +5588,8 @@ let Leaf = class Leaf {
5576
5588
  transformWorld(worldTransform, resize) {
5577
5589
  transformWorld(this, worldTransform, resize);
5578
5590
  }
5579
- moveWorld(x, y) {
5580
- moveWorld(this, x, y);
5591
+ moveWorld(x, y, transition) {
5592
+ moveWorld(this, x, y, false, transition);
5581
5593
  }
5582
5594
  scaleOfWorld(worldOrigin, scaleX, scaleY, resize) {
5583
5595
  zoomOfWorld(this, worldOrigin, scaleX, scaleY, resize);
@@ -5678,9 +5690,10 @@ Leaf = __decorate([
5678
5690
  useModule(LeafRender)
5679
5691
  ], Leaf);
5680
5692
 
5681
- const { setListWithFn } = BoundsHelper;
5693
+ const { setListWithFn: setListWithFn$1 } = BoundsHelper;
5682
5694
  const { sort } = BranchHelper;
5683
5695
  const { localBoxBounds, localStrokeBounds, localRenderBounds, maskLocalBoxBounds, maskLocalStrokeBounds, maskLocalRenderBounds } = LeafBoundsHelper;
5696
+ const debug$8 = new Debug('Branch');
5684
5697
  let Branch = class Branch extends Leaf {
5685
5698
  __updateStrokeSpread() {
5686
5699
  const { children } = this;
@@ -5699,13 +5712,13 @@ let Branch = class Branch extends Leaf {
5699
5712
  return 0;
5700
5713
  }
5701
5714
  __updateBoxBounds() {
5702
- setListWithFn(this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
5715
+ setListWithFn$1(this.__layout.boxBounds, this.children, this.__hasMask ? maskLocalBoxBounds : localBoxBounds);
5703
5716
  }
5704
5717
  __updateStrokeBounds() {
5705
- setListWithFn(this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
5718
+ setListWithFn$1(this.__layout.strokeBounds, this.children, this.__hasMask ? maskLocalStrokeBounds : localStrokeBounds);
5706
5719
  }
5707
5720
  __updateRenderBounds() {
5708
- setListWithFn(this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
5721
+ setListWithFn$1(this.__layout.renderBounds, this.children, this.__hasMask ? maskLocalRenderBounds : localRenderBounds);
5709
5722
  }
5710
5723
  __updateSortChildren() {
5711
5724
  let affectSort;
@@ -5721,8 +5734,8 @@ let Branch = class Branch extends Leaf {
5721
5734
  }
5722
5735
  }
5723
5736
  add(child, index) {
5724
- if (child === this)
5725
- return;
5737
+ if (child === this || child.destroyed)
5738
+ return debug$8.warn('add self or destroyed');
5726
5739
  const noIndex = index === undefined;
5727
5740
  if (!child.__) {
5728
5741
  if (child instanceof Array)
@@ -5736,8 +5749,9 @@ let Branch = class Branch extends Leaf {
5736
5749
  noIndex ? this.children.push(child) : this.children.splice(index, 0, child);
5737
5750
  if (child.isBranch)
5738
5751
  this.__.__childBranchNumber = (this.__.__childBranchNumber || 0) + 1;
5739
- child.__layout.boxChanged || child.__layout.boxChange();
5740
- child.__layout.matrixChanged || child.__layout.matrixChange();
5752
+ const childLayout = child.__layout;
5753
+ childLayout.boxChanged || childLayout.boxChange();
5754
+ childLayout.matrixChanged || childLayout.matrixChange();
5741
5755
  if (child.__bubbleMap)
5742
5756
  child.__emitLifeEvent(ChildEvent.ADD);
5743
5757
  if (this.leafer) {
@@ -5975,7 +5989,7 @@ class LeafLevelList {
5975
5989
  }
5976
5990
  }
5977
5991
 
5978
- const version = "1.0.10";
5992
+ const version = "1.1.1";
5979
5993
 
5980
5994
  class LeaferCanvas extends LeaferCanvasBase {
5981
5995
  get allowBackgroundColor() { return true; }
@@ -6213,7 +6227,7 @@ function updateChange(updateList) {
6213
6227
  });
6214
6228
  }
6215
6229
 
6216
- const { worldBounds } = LeafBoundsHelper;
6230
+ const { worldBounds: worldBounds$1 } = LeafBoundsHelper;
6217
6231
  const bigBounds = { x: 0, y: 0, width: 100000, height: 100000 };
6218
6232
  class LayoutBlockData {
6219
6233
  constructor(list) {
@@ -6225,7 +6239,7 @@ class LayoutBlockData {
6225
6239
  this.updatedList = list;
6226
6240
  }
6227
6241
  setBefore() {
6228
- this.beforeBounds.setListWithFn(this.updatedList.list, worldBounds);
6242
+ this.beforeBounds.setListWithFn(this.updatedList.list, worldBounds$1);
6229
6243
  }
6230
6244
  setAfter() {
6231
6245
  const { list } = this.updatedList;
@@ -6233,7 +6247,7 @@ class LayoutBlockData {
6233
6247
  this.afterBounds.set(bigBounds);
6234
6248
  }
6235
6249
  else {
6236
- this.afterBounds.setListWithFn(list, worldBounds);
6250
+ this.afterBounds.setListWithFn(list, worldBounds$1);
6237
6251
  }
6238
6252
  this.updatedBounds.setList([this.beforeBounds, this.afterBounds]);
6239
6253
  }
@@ -6420,25 +6434,25 @@ class Renderer {
6420
6434
  if (userConfig)
6421
6435
  this.config = DataHelper.default(userConfig, this.config);
6422
6436
  this.__listenEvents();
6423
- this.__requestRender();
6424
6437
  }
6425
6438
  start() {
6426
6439
  this.running = true;
6440
+ this.update(false);
6427
6441
  }
6428
6442
  stop() {
6429
6443
  this.running = false;
6430
6444
  }
6431
- update() {
6432
- this.changed = true;
6445
+ update(change = true) {
6446
+ if (!this.changed)
6447
+ this.changed = change;
6448
+ this.__requestRender();
6433
6449
  }
6434
6450
  requestLayout() {
6435
6451
  this.target.emit(LayoutEvent.REQUEST);
6436
6452
  }
6437
6453
  render(callback) {
6438
- if (!(this.running && this.canvas.view)) {
6439
- this.changed = true;
6440
- return;
6441
- }
6454
+ if (!(this.running && this.canvas.view))
6455
+ return this.update();
6442
6456
  const { target } = this;
6443
6457
  this.times = 0;
6444
6458
  this.totalBounds = new Bounds();
@@ -6572,16 +6586,17 @@ class Renderer {
6572
6586
  }
6573
6587
  }
6574
6588
  __requestRender() {
6575
- const startTime = Date.now();
6589
+ if (this.requestTime)
6590
+ return;
6591
+ const requestTime = this.requestTime = Date.now();
6576
6592
  Platform.requestRender(() => {
6577
- this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - startTime)));
6593
+ this.FPS = Math.min(60, Math.ceil(1000 / (Date.now() - requestTime)));
6594
+ this.requestTime = 0;
6578
6595
  if (this.running) {
6579
6596
  if (this.changed && this.canvas.view)
6580
6597
  this.render();
6581
6598
  this.target.emit(RenderEvent.NEXT);
6582
6599
  }
6583
- if (this.target)
6584
- this.__requestRender();
6585
6600
  });
6586
6601
  }
6587
6602
  __onResize(e) {
@@ -6597,7 +6612,7 @@ class Renderer {
6597
6612
  }
6598
6613
  }
6599
6614
  this.addBlock(new Bounds(0, 0, 1, 1));
6600
- this.changed = true;
6615
+ this.update();
6601
6616
  }
6602
6617
  __onLayoutEnd(event) {
6603
6618
  if (event.data)
@@ -7005,7 +7020,7 @@ class UIData extends LeafData {
7005
7020
  return true;
7006
7021
  return t.fill && this.__hasStroke;
7007
7022
  }
7008
- get __clipAfterFill() { return (this.cornerRadius || this.__pathInputed); }
7023
+ get __clipAfterFill() { const t = this; return (t.cornerRadius || t.innerShadow || t.__pathInputed); }
7009
7024
  get __autoWidth() { return !this._width; }
7010
7025
  get __autoHeight() { return !this._height; }
7011
7026
  get __autoSide() { return !this._width || !this._height; }
@@ -7119,7 +7134,7 @@ class GroupData extends UIData {
7119
7134
 
7120
7135
  class BoxData extends GroupData {
7121
7136
  get __boxStroke() { return !this.__pathInputed; }
7122
- get __drawAfterFill() { return this.overflow === 'hide' && this.__clipAfterFill && this.__leaf.children.length; }
7137
+ get __drawAfterFill() { const t = this; return (t.overflow === 'hide' && (t.__clipAfterFill || t.innerShadow) && t.__leaf.children.length); }
7123
7138
  get __clipAfterFill() { return this.__leaf.isOverflow || super.__clipAfterFill; }
7124
7139
  }
7125
7140
 
@@ -7405,11 +7420,15 @@ let UI = UI_1 = class UI extends Leaf {
7405
7420
  super(data);
7406
7421
  }
7407
7422
  reset(_data) { }
7408
- set(data, isTemp) {
7409
- if (isTemp) {
7410
- this.lockNormalStyle = true;
7411
- Object.assign(this, data);
7412
- this.lockNormalStyle = false;
7423
+ set(data, transition) {
7424
+ if (transition) {
7425
+ if (transition === 'temp') {
7426
+ this.lockNormalStyle = true;
7427
+ Object.assign(this, data);
7428
+ this.lockNormalStyle = false;
7429
+ }
7430
+ else
7431
+ this.animate(data, transition);
7413
7432
  }
7414
7433
  else
7415
7434
  Object.assign(this, data);
@@ -7719,17 +7738,17 @@ let Group = class Group extends UI {
7719
7738
  if (!this.children)
7720
7739
  this.children = [];
7721
7740
  }
7722
- set(data, isTemp) {
7741
+ set(data, transition) {
7723
7742
  if (data.children) {
7724
7743
  const { children } = data;
7725
7744
  delete data.children;
7726
7745
  this.children ? this.clear() : this.__setBranch();
7727
- super.set(data, isTemp);
7746
+ super.set(data, transition);
7728
7747
  children.forEach(child => this.add(child));
7729
7748
  data.children = children;
7730
7749
  }
7731
7750
  else
7732
- super.set(data, isTemp);
7751
+ super.set(data, transition);
7733
7752
  }
7734
7753
  toJSON(options) {
7735
7754
  const data = super.toJSON(options);
@@ -7775,20 +7794,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7775
7794
  constructor(userConfig, data) {
7776
7795
  super(data);
7777
7796
  this.config = {
7778
- type: 'design',
7779
7797
  start: true,
7780
7798
  hittable: true,
7781
7799
  smooth: true,
7782
- lazySpeard: 100,
7783
- zoom: {
7784
- min: 0.01,
7785
- max: 256
7786
- },
7787
- move: {
7788
- holdSpaceKey: true,
7789
- holdMiddleKey: true,
7790
- autoDistance: 2
7791
- }
7800
+ lazySpeard: 100
7792
7801
  };
7793
7802
  this.leafs = 0;
7794
7803
  this.__eventIds = [];
@@ -7805,23 +7814,27 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7805
7814
  init(userConfig, parentApp) {
7806
7815
  if (this.canvas)
7807
7816
  return;
7808
- this.__setLeafer(this);
7809
- if (userConfig)
7810
- DataHelper.assign(this.config, userConfig);
7811
7817
  let start;
7812
7818
  const { config } = this;
7813
- this.initType(config.type);
7819
+ this.__setLeafer(this);
7820
+ if (parentApp) {
7821
+ this.parentApp = parentApp;
7822
+ this.__bindApp(parentApp);
7823
+ start = parentApp.running;
7824
+ }
7825
+ if (userConfig) {
7826
+ this.parent = parentApp;
7827
+ this.initType(userConfig.type);
7828
+ this.parent = undefined;
7829
+ DataHelper.assign(config, userConfig);
7830
+ }
7814
7831
  const canvas = this.canvas = Creator.canvas(config);
7815
7832
  this.__controllers.push(this.renderer = Creator.renderer(this, canvas, config), this.watcher = Creator.watcher(this, config), this.layouter = Creator.layouter(this, config));
7816
7833
  if (this.isApp)
7817
7834
  this.__setApp();
7818
7835
  this.__checkAutoLayout(config, parentApp);
7819
7836
  this.view = canvas.view;
7820
- if (parentApp) {
7821
- this.__bindApp(parentApp);
7822
- start = parentApp.running;
7823
- }
7824
- else {
7837
+ if (!parentApp) {
7825
7838
  this.selector = Creator.selector(this);
7826
7839
  this.interaction = Creator.interaction(this, canvas, this.selector, config);
7827
7840
  if (this.interaction) {
@@ -7842,8 +7855,8 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7842
7855
  }
7843
7856
  onInit() { }
7844
7857
  initType(_type) { }
7845
- set(data) {
7846
- this.waitInit(() => { super.set(data); });
7858
+ set(data, transition) {
7859
+ this.waitInit(() => { super.set(data, transition); });
7847
7860
  }
7848
7861
  start() {
7849
7862
  clearTimeout(this.__startTimer);
@@ -7878,7 +7891,11 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7878
7891
  forceRender(bounds) {
7879
7892
  this.renderer.addBlock(bounds ? new Bounds(bounds) : this.canvas.bounds);
7880
7893
  if (this.viewReady)
7881
- this.renderer.update();
7894
+ this.renderer.render();
7895
+ }
7896
+ requestRender(change = false) {
7897
+ if (this.renderer)
7898
+ this.renderer.update(change);
7882
7899
  }
7883
7900
  updateCursor(cursor) {
7884
7901
  const i = this.interaction;
@@ -7986,8 +8003,10 @@ let Leafer = Leafer_1 = class Leafer extends Group {
7986
8003
  const { imageReady } = this;
7987
8004
  if (imageReady && !this.viewCompleted)
7988
8005
  this.__checkViewCompleted();
7989
- if (!imageReady)
8006
+ if (!imageReady) {
7990
8007
  this.viewCompleted = false;
8008
+ this.requestRender();
8009
+ }
7991
8010
  }
7992
8011
  }
7993
8012
  __checkViewCompleted(emit = true) {
@@ -8045,6 +8064,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8045
8064
  }
8046
8065
  else
8047
8066
  list.push(item);
8067
+ this.requestRender();
8048
8068
  }
8049
8069
  zoom(_zoomType, _padding, _fixedScale) {
8050
8070
  return needPlugin('view');
@@ -8098,7 +8118,7 @@ let Leafer = Leafer_1 = class Leafer extends Group {
8098
8118
  this.canvasManager.destroy();
8099
8119
  }
8100
8120
  this.canvas.destroy();
8101
- this.config.view = this.view = null;
8121
+ this.config.view = this.view = this.parentApp = null;
8102
8122
  if (this.userConfig)
8103
8123
  this.userConfig.view = null;
8104
8124
  super.destroy();
@@ -8825,9 +8845,9 @@ let App = class App extends Leafer {
8825
8845
  if (ground)
8826
8846
  this.ground = this.addLeafer(ground);
8827
8847
  if (tree || editor)
8828
- this.tree = this.addLeafer(tree);
8848
+ this.tree = this.addLeafer(tree || { type: userConfig.type || 'design' });
8829
8849
  if (sky || editor)
8830
- this.sky = this.addLeafer(sky || { type: 'draw', usePartRender: false });
8850
+ this.sky = this.addLeafer(sky);
8831
8851
  if (editor)
8832
8852
  this.sky.add(this.editor = Creator.editor(editor));
8833
8853
  }
@@ -9032,10 +9052,8 @@ let DragEvent = class DragEvent extends PointerEvent {
9032
9052
  this.data = data;
9033
9053
  }
9034
9054
  static getValidMove(leaf, start, total) {
9035
- const { draggable, dragBounds, x, y } = leaf;
9036
- const move = leaf.getLocalPoint(total, null, true);
9037
- move.x += start.x - x;
9038
- move.y += start.y - y;
9055
+ const { draggable, dragBounds } = leaf, move = leaf.getLocalPoint(total, null, true);
9056
+ PointHelper.move(move, start.x - leaf.x, start.y - leaf.y);
9039
9057
  if (dragBounds)
9040
9058
  this.getMoveInDragBounds(leaf.__local, dragBounds === 'parent' ? leaf.parent.boxBounds : dragBounds, move, true);
9041
9059
  if (draggable === 'x')
@@ -9045,8 +9063,7 @@ let DragEvent = class DragEvent extends PointerEvent {
9045
9063
  return move;
9046
9064
  }
9047
9065
  static getMoveInDragBounds(childBox, dragBounds, move, change) {
9048
- const x = childBox.x + move.x, y = childBox.y + move.y;
9049
- const right = x + childBox.width, bottom = y + childBox.height;
9066
+ const x = childBox.x + move.x, y = childBox.y + move.y, right = x + childBox.width, bottom = y + childBox.height;
9050
9067
  const boundsRight = dragBounds.x + dragBounds.width, boundsBottom = dragBounds.y + dragBounds.height;
9051
9068
  if (!change)
9052
9069
  move = Object.assign({}, move);
@@ -9098,9 +9115,7 @@ let DragEvent = class DragEvent extends PointerEvent {
9098
9115
  return this.getLocalMove(relative, true);
9099
9116
  }
9100
9117
  getPageBounds() {
9101
- const total = this.getPageTotal();
9102
- const start = this.getPagePoint();
9103
- const bounds = {};
9118
+ const total = this.getPageTotal(), start = this.getPagePoint(), bounds = {};
9104
9119
  BoundsHelper.set(bounds, start.x - total.x, start.y - total.y, total.x, total.y);
9105
9120
  BoundsHelper.unsign(bounds);
9106
9121
  return bounds;
@@ -9186,184 +9201,7 @@ KeyEvent = __decorate([
9186
9201
  registerUIEvent()
9187
9202
  ], KeyEvent);
9188
9203
 
9189
- function addInteractionWindow(leafer) {
9190
- if (leafer.isApp)
9191
- return;
9192
- leafer.__eventIds.push(leafer.on_(MoveEvent.BEFORE_MOVE, (e) => {
9193
- leafer.zoomLayer.move(leafer.getValidMove(e.moveX, e.moveY));
9194
- }), leafer.on_(ZoomEvent.BEFORE_ZOOM, (e) => {
9195
- const { zoomLayer } = leafer;
9196
- const changeScale = leafer.getValidScale(e.scale);
9197
- if (changeScale !== 1) {
9198
- PointHelper.scaleOf(zoomLayer, e, changeScale);
9199
- zoomLayer.scale = zoomLayer.__.scaleX * changeScale;
9200
- }
9201
- }));
9202
- }
9203
-
9204
- function document$1(leafer) {
9205
- addInteractionWindow(leafer);
9206
- const { move, zoom } = leafer.config;
9207
- move.scroll = 'limit';
9208
- zoom.min = 1;
9209
- }
9210
-
9211
- function block(leafer) {
9212
- const { config } = leafer;
9213
- (config.wheel || (config.wheel = {})).preventDefault = false;
9214
- (config.touch || (config.touch = {})).preventDefault = 'auto';
9215
- }
9216
-
9217
- const debug$3 = Debug.get('LeaferTypeCreator');
9218
- const LeaferTypeCreator = {
9219
- list: {},
9220
- register(name, fn) {
9221
- list$1[name] && debug$3.repeat(name);
9222
- list$1[name] = fn;
9223
- },
9224
- run(name, leafer) {
9225
- const fn = list$1[name];
9226
- fn && fn(leafer);
9227
- }
9228
- };
9229
- const { list: list$1, register } = LeaferTypeCreator;
9230
- register('design', addInteractionWindow);
9231
- register('document', document$1);
9232
- register('block', block);
9233
-
9234
- const leafer = Leafer.prototype;
9235
- leafer.initType = function (type) {
9236
- LeaferTypeCreator.run(type, this);
9237
- };
9238
- leafer.getValidMove = function (moveX, moveY) {
9239
- const { scroll, disabled } = this.app.config.move;
9240
- if (scroll) {
9241
- Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
9242
- if (scroll === 'limit') {
9243
- const { x, y, width, height } = new Bounds(this.__world).addPoint(this.zoomLayer);
9244
- const right = x + width - this.width, bottom = y + height - this.height;
9245
- if (x >= 0 && right <= 0)
9246
- moveX = 0;
9247
- else if (moveX > 0) {
9248
- if (x + moveX > 0)
9249
- moveX = -x;
9250
- }
9251
- else if (moveX < 0 && right + moveX < 0)
9252
- moveX = -right;
9253
- if (y >= 0 && bottom <= 0)
9254
- moveY = 0;
9255
- else if (moveY > 0) {
9256
- if (y + moveY > 0)
9257
- moveY = -y;
9258
- }
9259
- else if (moveY < 0 && bottom + moveY < 0)
9260
- moveY = -bottom;
9261
- }
9262
- }
9263
- return { x: disabled ? 0 : moveX, y: disabled ? 0 : moveY };
9264
- };
9265
- leafer.getValidScale = function (changeScale) {
9266
- const { scaleX } = this.zoomLayer.__, { min, max, disabled } = this.app.config.zoom, absScale = Math.abs(scaleX * changeScale);
9267
- if (absScale < min)
9268
- changeScale = min / scaleX;
9269
- else if (absScale > max)
9270
- changeScale = max / scaleX;
9271
- return disabled ? 1 : changeScale;
9272
- };
9273
-
9274
- class Transformer {
9275
- get transforming() { return !!(this.moveData || this.zoomData || this.rotateData); }
9276
- constructor(interaction) {
9277
- this.interaction = interaction;
9278
- }
9279
- move(data) {
9280
- const { interaction } = this;
9281
- if (!data.moveType)
9282
- data.moveType = 'move';
9283
- if (!this.moveData) {
9284
- const { path } = interaction.selector.getByPoint(data, interaction.hitRadius);
9285
- data.path = path;
9286
- this.moveData = Object.assign(Object.assign({}, data), { moveX: 0, moveY: 0 });
9287
- interaction.cancelHover();
9288
- interaction.emit(MoveEvent.START, this.moveData);
9289
- }
9290
- data.path = this.moveData.path;
9291
- interaction.emit(MoveEvent.BEFORE_MOVE, data);
9292
- interaction.emit(MoveEvent.MOVE, data);
9293
- this.transformEndWait();
9294
- }
9295
- zoom(data) {
9296
- const { interaction } = this;
9297
- if (!this.zoomData) {
9298
- const { path } = interaction.selector.getByPoint(data, interaction.hitRadius);
9299
- data.path = path;
9300
- this.zoomData = Object.assign(Object.assign({}, data), { scale: 1 });
9301
- interaction.cancelHover();
9302
- interaction.emit(ZoomEvent.START, this.zoomData);
9303
- }
9304
- data.path = this.zoomData.path;
9305
- interaction.emit(ZoomEvent.BEFORE_ZOOM, data);
9306
- interaction.emit(ZoomEvent.ZOOM, data);
9307
- this.transformEndWait();
9308
- }
9309
- rotate(data) {
9310
- const { interaction } = this;
9311
- if (!this.rotateData) {
9312
- const { path } = interaction.selector.getByPoint(data, interaction.hitRadius);
9313
- data.path = path;
9314
- this.rotateData = Object.assign(Object.assign({}, data), { rotation: 0 });
9315
- interaction.cancelHover();
9316
- interaction.emit(RotateEvent.START, this.rotateData);
9317
- }
9318
- data.path = this.rotateData.path;
9319
- interaction.emit(RotateEvent.BEFORE_ROTATE, data);
9320
- interaction.emit(RotateEvent.ROTATE, data);
9321
- this.transformEndWait();
9322
- }
9323
- transformEndWait() {
9324
- clearTimeout(this.transformTimer);
9325
- this.transformTimer = setTimeout(() => {
9326
- this.transformEnd();
9327
- }, this.interaction.config.pointer.transformTime);
9328
- }
9329
- transformEnd() {
9330
- this.moveEnd();
9331
- this.zoomEnd();
9332
- this.rotateEnd();
9333
- }
9334
- moveEnd() {
9335
- if (this.moveData) {
9336
- this.interaction.emit(MoveEvent.END, this.moveData);
9337
- this.moveData = null;
9338
- }
9339
- }
9340
- zoomEnd() {
9341
- if (this.zoomData) {
9342
- this.interaction.emit(ZoomEvent.END, this.zoomData);
9343
- this.zoomData = null;
9344
- }
9345
- }
9346
- rotateEnd() {
9347
- if (this.rotateData) {
9348
- this.interaction.emit(RotateEvent.END, this.rotateData);
9349
- this.rotateData = null;
9350
- }
9351
- }
9352
- destroy() {
9353
- this.zoomData = this.moveData = this.rotateData = null;
9354
- }
9355
- }
9356
-
9357
9204
  const InteractionHelper = {
9358
- getMoveEventData(center, move, event) {
9359
- return Object.assign(Object.assign({}, event), { x: center.x, y: center.y, moveX: move.x, moveY: move.y });
9360
- },
9361
- getRotateEventData(center, angle, event) {
9362
- return Object.assign(Object.assign({}, event), { x: center.x, y: center.y, rotation: angle });
9363
- },
9364
- getZoomEventData(center, scale, event) {
9365
- return Object.assign(Object.assign({}, event), { x: center.x, y: center.y, scale });
9366
- },
9367
9205
  getDragEventData(startPoint, lastPoint, event) {
9368
9206
  return Object.assign(Object.assign({}, event), { x: event.x, y: event.y, moveX: event.x - lastPoint.x, moveY: event.y - lastPoint.y, totalX: event.x - startPoint.x, totalY: event.y - startPoint.y });
9369
9207
  },
@@ -9372,18 +9210,14 @@ const InteractionHelper = {
9372
9210
  data });
9373
9211
  },
9374
9212
  getSwipeDirection(angle) {
9375
- if (angle < -45 && angle > -135) {
9213
+ if (angle < -45 && angle > -135)
9376
9214
  return SwipeEvent.UP;
9377
- }
9378
- else if (angle > 45 && angle < 135) {
9215
+ else if (angle > 45 && angle < 135)
9379
9216
  return SwipeEvent.DOWN;
9380
- }
9381
- else if (angle <= 45 && angle >= -45) {
9217
+ else if (angle <= 45 && angle >= -45)
9382
9218
  return SwipeEvent.RIGHT;
9383
- }
9384
- else {
9219
+ else
9385
9220
  return SwipeEvent.LEFT;
9386
- }
9387
9221
  },
9388
9222
  getSwipeEventData(startPoint, lastDragData, event) {
9389
9223
  return Object.assign(Object.assign({}, event), { moveX: lastDragData.moveX, moveY: lastDragData.moveY, totalX: event.x - startPoint.x, totalY: event.y - startPoint.y, type: I.getSwipeDirection(PointHelper.getAngle(startPoint, event)) });
@@ -9456,9 +9290,8 @@ class Dragger {
9456
9290
  interaction.emit(MoveEvent.START, this.dragData);
9457
9291
  }
9458
9292
  }
9459
- if (!this.moving) {
9293
+ if (!this.moving)
9460
9294
  this.dragStart(data, canDrag);
9461
- }
9462
9295
  this.drag(data);
9463
9296
  }
9464
9297
  dragStart(data, canDrag) {
@@ -9536,16 +9369,9 @@ class Dragger {
9536
9369
  dragEnd(data, speed) {
9537
9370
  if (!this.dragging && !this.moving)
9538
9371
  return;
9539
- const { moveX, moveY } = this.dragData;
9540
- if (this.interaction.config.move.dragAnimate && this.canAnimate && this.moving && (Math.abs(moveX) > 1 || Math.abs(moveY) > 1)) {
9541
- data = Object.assign({}, data);
9542
- speed = (speed || (data.pointerType === 'touch' ? 2 : 1)) * 0.9;
9543
- PointHelper.move(data, moveX * speed, moveY * speed);
9544
- this.drag(data);
9545
- this.animate(() => { this.dragEnd(data, 1); });
9546
- }
9547
- else
9548
- this.dragEndReal(data);
9372
+ if (this.checkDragEndAnimate(data, speed))
9373
+ return;
9374
+ this.dragEndReal(data);
9549
9375
  }
9550
9376
  dragEndReal(data) {
9551
9377
  const { interaction, downData, dragData } = this;
@@ -9572,12 +9398,6 @@ class Dragger {
9572
9398
  this.dragReset();
9573
9399
  this.animate(null, 'off');
9574
9400
  }
9575
- animate(func, off) {
9576
- const animateWait = func || this.animateWait;
9577
- if (animateWait)
9578
- this.interaction.target.nextRender(animateWait, null, off);
9579
- this.animateWait = func;
9580
- }
9581
9401
  swipe(data, downData, dragData, endDragData) {
9582
9402
  const { interaction } = this;
9583
9403
  if (PointHelper.getDistance(downData, data) > interaction.config.pointer.swipeDistance) {
@@ -9594,45 +9414,17 @@ class Dragger {
9594
9414
  dragReset() {
9595
9415
  DragEvent.list = DragEvent.data = this.draggableList = this.dragData = this.downData = this.dragOverPath = this.dragEnterPath = null;
9596
9416
  }
9597
- checkDragOut(data) {
9598
- const { interaction } = this;
9599
- this.autoMoveCancel();
9600
- if (this.dragging && !interaction.shrinkCanvasBounds.hitPoint(data))
9601
- this.autoMoveOnDragOut(data);
9602
- }
9603
- autoMoveOnDragOut(data) {
9604
- const { interaction, downData, canDragOut } = this;
9605
- const { autoDistance, dragOut } = interaction.config.move;
9606
- if (!dragOut || !canDragOut || !autoDistance)
9607
- return;
9608
- const bounds = interaction.shrinkCanvasBounds;
9609
- const { x, y } = bounds;
9610
- const right = BoundsHelper.maxX(bounds);
9611
- const bottom = BoundsHelper.maxY(bounds);
9612
- const moveX = data.x < x ? autoDistance : (right < data.x ? -autoDistance : 0);
9613
- const moveY = data.y < y ? autoDistance : (bottom < data.y ? -autoDistance : 0);
9614
- let totalX = 0, totalY = 0;
9615
- this.autoMoveTimer = setInterval(() => {
9616
- totalX += moveX;
9617
- totalY += moveY;
9618
- PointHelper.move(downData, moveX, moveY);
9619
- PointHelper.move(this.dragData, moveX, moveY);
9620
- interaction.move(Object.assign(Object.assign({}, data), { moveX, moveY, totalX, totalY, moveType: 'drag' }));
9621
- interaction.pointerMoveReal(data);
9622
- }, 10);
9623
- }
9624
- autoMoveCancel() {
9625
- if (this.autoMoveTimer) {
9626
- clearInterval(this.autoMoveTimer);
9627
- this.autoMoveTimer = 0;
9628
- }
9629
- }
9417
+ checkDragEndAnimate(_data, _speed) { return false; }
9418
+ animate(_func, _off) { }
9419
+ checkDragOut(_data) { }
9420
+ autoMoveOnDragOut(_data) { }
9421
+ autoMoveCancel() { }
9630
9422
  destroy() {
9631
9423
  this.dragReset();
9632
9424
  }
9633
9425
  }
9634
9426
 
9635
- const debug$2 = Debug.get('emit');
9427
+ const debug$3 = Debug.get('emit');
9636
9428
  function emit$1(type, data, path, excludePath) {
9637
9429
  if (!path && !data.path)
9638
9430
  return;
@@ -9662,7 +9454,7 @@ function emit$1(type, data, path, excludePath) {
9662
9454
  }
9663
9455
  }
9664
9456
  catch (e) {
9665
- debug$2.error(e);
9457
+ debug$3.error(e);
9666
9458
  }
9667
9459
  }
9668
9460
  const allowTypes = ['move', 'zoom', 'rotate', 'key'];
@@ -9696,28 +9488,12 @@ function exclude(leaf, excludePath) {
9696
9488
  return excludePath && excludePath.has(leaf);
9697
9489
  }
9698
9490
 
9699
- const MultiTouchHelper = {
9700
- getData(list) {
9701
- const a = list[0];
9702
- const b = list[1];
9703
- const lastCenter = PointHelper.getCenter(a.from, b.from);
9704
- const center = PointHelper.getCenter(a.to, b.to);
9705
- const move = { x: center.x - lastCenter.x, y: center.y - lastCenter.y };
9706
- const lastDistance = PointHelper.getDistance(a.from, b.from);
9707
- const distance = PointHelper.getDistance(a.to, b.to);
9708
- const scale = distance / lastDistance;
9709
- const angle = PointHelper.getRotation(a.from, b.from, a.to, b.to);
9710
- return { move, scale, angle, center };
9711
- }
9712
- };
9713
-
9714
9491
  const config$1 = {
9715
9492
  wheel: {
9716
9493
  zoomSpeed: 0.5,
9717
9494
  moveSpeed: 0.5,
9718
9495
  rotateSpeed: 0.5,
9719
9496
  delta: { x: 80 / 4, y: 8.0 },
9720
- preventDefault: true
9721
9497
  },
9722
9498
  pointer: {
9723
9499
  hitRadius: 5,
@@ -9728,17 +9504,18 @@ const config$1 = {
9728
9504
  dragHover: true,
9729
9505
  dragDistance: 2,
9730
9506
  swipeDistance: 20,
9731
- preventDefaultMenu: true
9732
9507
  },
9733
9508
  touch: {
9734
- preventDefault: true
9509
+ preventDefault: 'auto'
9735
9510
  },
9736
9511
  multiTouch: {},
9512
+ move: { autoDistance: 2 },
9513
+ zoom: {},
9737
9514
  cursor: true,
9738
9515
  keyEvent: true
9739
9516
  };
9740
9517
 
9741
- const { pathHasEventType, getMoveEventData, getZoomEventData, getRotateEventData, pathCanDrag, pathHasOutside } = InteractionHelper;
9518
+ const { pathHasEventType, pathCanDrag, pathHasOutside } = InteractionHelper;
9742
9519
  class InteractionBase {
9743
9520
  get dragging() { return this.dragger.dragging; }
9744
9521
  get transforming() { return this.transformer.transforming; }
@@ -9760,7 +9537,7 @@ class InteractionBase {
9760
9537
  this.canvas = canvas;
9761
9538
  this.selector = selector;
9762
9539
  this.defaultPath = new LeafList(target);
9763
- this.transformer = new Transformer(this);
9540
+ this.createTransformer();
9764
9541
  this.dragger = new Dragger(this);
9765
9542
  if (userConfig)
9766
9543
  this.config = DataHelper.default(userConfig, this.config);
@@ -9861,14 +9638,6 @@ class InteractionBase {
9861
9638
  data.isCancel = true;
9862
9639
  this.pointerUp(data);
9863
9640
  }
9864
- multiTouch(data, list) {
9865
- if (this.config.multiTouch.disabled)
9866
- return;
9867
- const { move, angle, scale, center } = MultiTouchHelper.getData(list);
9868
- this.rotate(getRotateEventData(center, angle, data));
9869
- this.zoom(getZoomEventData(center, scale, data));
9870
- this.move(getMoveEventData(center, move, data));
9871
- }
9872
9641
  menu(data) {
9873
9642
  this.findPath(data);
9874
9643
  this.emit(PointerEvent.MENU, data);
@@ -9882,18 +9651,13 @@ class InteractionBase {
9882
9651
  this.waitRightTap = this.waitMenuTap = false;
9883
9652
  }
9884
9653
  }
9885
- move(data) {
9886
- this.transformer.move(data);
9887
- }
9888
- zoom(data) {
9889
- this.transformer.zoom(data);
9890
- }
9891
- rotate(data) {
9892
- this.transformer.rotate(data);
9893
- }
9894
- transformEnd() {
9895
- this.transformer.transformEnd();
9896
- }
9654
+ createTransformer() { }
9655
+ move(_data) { }
9656
+ zoom(_data) { }
9657
+ rotate(_data) { }
9658
+ transformEnd() { }
9659
+ wheel(_data) { }
9660
+ multiTouch(_data, _list) { }
9897
9661
  keyDown(data) {
9898
9662
  if (!this.config.keyEvent)
9899
9663
  return;
@@ -10131,8 +9895,9 @@ class InteractionBase {
10131
9895
  this.longPressed = false;
10132
9896
  }
10133
9897
  __onResize() {
9898
+ const { dragOut } = this.m;
10134
9899
  this.shrinkCanvasBounds = new Bounds(this.canvas.bounds);
10135
- this.shrinkCanvasBounds.spread(-2);
9900
+ this.shrinkCanvasBounds.spread(-(typeof dragOut === 'number' ? dragOut : 2));
10136
9901
  }
10137
9902
  __listenEvents() {
10138
9903
  const { target } = this;
@@ -10152,7 +9917,8 @@ class InteractionBase {
10152
9917
  this.stop();
10153
9918
  this.__removeListenEvents();
10154
9919
  this.dragger.destroy();
10155
- this.transformer.destroy();
9920
+ if (this.transformer)
9921
+ this.transformer.destroy();
10156
9922
  this.downData = this.overPath = this.enterPath = null;
10157
9923
  }
10158
9924
  }
@@ -10488,6 +10254,8 @@ function stroke(stroke, ui, canvas) {
10488
10254
  case 'center':
10489
10255
  canvas.setStroke(stroke, __strokeWidth, options);
10490
10256
  canvas.stroke();
10257
+ if (options.__useArrow)
10258
+ strokeArrow(ui, canvas);
10491
10259
  break;
10492
10260
  case 'inside':
10493
10261
  canvas.save();
@@ -10525,6 +10293,8 @@ function strokes(strokes, ui, canvas) {
10525
10293
  case 'center':
10526
10294
  canvas.setStroke(undefined, __strokeWidth, options);
10527
10295
  drawStrokesStyle(strokes, false, ui, canvas);
10296
+ if (options.__useArrow)
10297
+ strokeArrow(ui, canvas);
10528
10298
  break;
10529
10299
  case 'inside':
10530
10300
  canvas.save();
@@ -10550,6 +10320,14 @@ function strokes(strokes, ui, canvas) {
10550
10320
  }
10551
10321
  }
10552
10322
  }
10323
+ function strokeArrow(ui, canvas) {
10324
+ if (ui.__.dashPattern) {
10325
+ canvas.beginPath();
10326
+ ui.__drawPathByData(canvas, ui.__.__pathForArrow);
10327
+ canvas.dashPattern = null;
10328
+ canvas.stroke();
10329
+ }
10330
+ }
10553
10331
 
10554
10332
  const { getSpread, getOuterOf, getByMove, getIntersectData } = BoundsHelper;
10555
10333
  function shape(ui, current, options) {
@@ -10866,13 +10644,13 @@ function ignoreRender(ui, value) {
10866
10644
  }
10867
10645
 
10868
10646
  const { get: get$1, scale: scale$2, copy: copy$4 } = MatrixHelper;
10869
- const { ceil, abs: abs$2 } = Math;
10647
+ const { ceil, abs: abs$3 } = Math;
10870
10648
  function createPattern(ui, paint, pixelRatio) {
10871
10649
  let { scaleX, scaleY } = ImageManager.patternLocked ? ui.__world : ui.__nowWorld;
10872
10650
  const id = scaleX + '-' + scaleY + '-' + pixelRatio;
10873
10651
  if (paint.patternId !== id && !ui.destroyed) {
10874
- scaleX = abs$2(scaleX);
10875
- scaleY = abs$2(scaleY);
10652
+ scaleX = abs$3(scaleX);
10653
+ scaleY = abs$3(scaleY);
10876
10654
  const { image, data } = paint;
10877
10655
  let imageScale, imageMatrix, { width, height, scaleX: sx, scaleY: sy, opacity, transform, repeat } = data;
10878
10656
  if (sx) {
@@ -10928,7 +10706,7 @@ function createPattern(ui, paint, pixelRatio) {
10928
10706
  }
10929
10707
  }
10930
10708
 
10931
- const { abs: abs$1 } = Math;
10709
+ const { abs: abs$2 } = Math;
10932
10710
  function checkImage(ui, canvas, paint, allowPaint) {
10933
10711
  const { scaleX, scaleY } = ImageManager.patternLocked ? ui.__world : ui.__nowWorld;
10934
10712
  const { pixelRatio } = canvas;
@@ -10940,8 +10718,8 @@ function checkImage(ui, canvas, paint, allowPaint) {
10940
10718
  if (allowPaint) {
10941
10719
  if (!data.repeat) {
10942
10720
  let { width, height } = data;
10943
- width *= abs$1(scaleX) * pixelRatio;
10944
- height *= abs$1(scaleY) * pixelRatio;
10721
+ width *= abs$2(scaleX) * pixelRatio;
10722
+ height *= abs$2(scaleY) * pixelRatio;
10945
10723
  if (data.scaleX) {
10946
10724
  width *= data.scaleX;
10947
10725
  height *= data.scaleY;
@@ -11420,15 +11198,15 @@ const { trimRight } = TextRowHelper;
11420
11198
  const { Letter, Single, Before, After, Symbol, Break } = CharType;
11421
11199
  let word, row, wordWidth, rowWidth, realWidth;
11422
11200
  let char, charWidth, startCharSize, charSize, charType, lastCharType, langBreak, afterBreak, paraStart;
11423
- let textDrawData, rows = [], bounds$1, findMaxWidth;
11201
+ let textDrawData, rows = [], bounds$3, findMaxWidth;
11424
11202
  function createRows(drawData, content, style) {
11425
11203
  textDrawData = drawData;
11426
11204
  rows = drawData.rows;
11427
- bounds$1 = drawData.bounds;
11428
- findMaxWidth = !bounds$1.width && !style.autoSizeAlign;
11205
+ bounds$3 = drawData.bounds;
11206
+ findMaxWidth = !bounds$3.width && !style.autoSizeAlign;
11429
11207
  const { __letterSpacing, paraIndent, textCase } = style;
11430
11208
  const { canvas } = Platform;
11431
- const { width, height } = bounds$1;
11209
+ const { width, height } = bounds$3;
11432
11210
  const charMode = width || height || __letterSpacing || (textCase !== 'none');
11433
11211
  if (charMode) {
11434
11212
  const wrap = style.textWrap !== 'none';
@@ -11542,7 +11320,7 @@ function addRow() {
11542
11320
  startCharSize = 0;
11543
11321
  }
11544
11322
  row.width = rowWidth;
11545
- if (bounds$1.width)
11323
+ if (bounds$3.width)
11546
11324
  trimRight(row);
11547
11325
  else if (findMaxWidth)
11548
11326
  setMaxWidth();
@@ -11979,7 +11757,7 @@ function checkLazy(leaf) {
11979
11757
  }
11980
11758
 
11981
11759
  const canvas = LeaferCanvasBase.prototype;
11982
- const debug$1 = Debug.get('@leafer-ui/export');
11760
+ const debug$2 = Debug.get('@leafer-ui/export');
11983
11761
  canvas.export = function (filename, options) {
11984
11762
  const { quality, blob } = FileHelper.getExportOptions(options);
11985
11763
  if (filename.includes('.'))
@@ -11994,7 +11772,7 @@ canvas.toBlob = function (type, quality) {
11994
11772
  Platform.origin.canvasToBolb(this.view, type, quality).then((blob) => {
11995
11773
  resolve(blob);
11996
11774
  }).catch((e) => {
11997
- debug$1.error(e);
11775
+ debug$2.error(e);
11998
11776
  resolve(null);
11999
11777
  });
12000
11778
  });
@@ -12007,7 +11785,7 @@ canvas.saveAs = function (filename, quality) {
12007
11785
  Platform.origin.canvasSaveAs(this.view, filename, quality).then(() => {
12008
11786
  resolve(true);
12009
11787
  }).catch((e) => {
12010
- debug$1.error(e);
11788
+ debug$2.error(e);
12011
11789
  resolve(false);
12012
11790
  });
12013
11791
  });
@@ -12297,9 +12075,12 @@ function targetAttr(fn) {
12297
12075
  };
12298
12076
  }
12299
12077
 
12300
- const matrix = MatrixHelper.get();
12301
- const { abs } = Math;
12078
+ const { abs: abs$1 } = Math;
12302
12079
  const { copy: copy$2, scale: scale$1 } = MatrixHelper;
12080
+ const { setListWithFn } = BoundsHelper;
12081
+ const { worldBounds } = LeafBoundsHelper;
12082
+ const matrix = getMatrixData();
12083
+ const bounds$2 = getBoundsData();
12303
12084
  class Stroker extends UI {
12304
12085
  constructor() {
12305
12086
  super();
@@ -12310,6 +12091,17 @@ class Stroker extends UI {
12310
12091
  setTarget(target, style) {
12311
12092
  this.set(style);
12312
12093
  this.target = target;
12094
+ this.update();
12095
+ }
12096
+ update() {
12097
+ const { list } = this;
12098
+ if (list.length) {
12099
+ setListWithFn(bounds$2, list, worldBounds);
12100
+ this.set(bounds$2);
12101
+ }
12102
+ else {
12103
+ this.width = this.height = 1;
12104
+ }
12313
12105
  }
12314
12106
  __draw(canvas, options) {
12315
12107
  const { list } = this;
@@ -12319,8 +12111,8 @@ class Stroker extends UI {
12319
12111
  for (let i = 0; i < list.length; i++) {
12320
12112
  leaf = list[i];
12321
12113
  const { worldTransform, worldRenderBounds } = leaf;
12322
- if (bounds && bounds.hit(worldRenderBounds, options.matrix)) {
12323
- const aScaleX = abs(worldTransform.scaleX), aScaleY = abs(worldTransform.scaleY);
12114
+ if (!bounds || bounds.hit(worldRenderBounds, options.matrix)) {
12115
+ const aScaleX = abs$1(worldTransform.scaleX), aScaleY = abs$1(worldTransform.scaleY);
12324
12116
  if (aScaleX !== aScaleY) {
12325
12117
  copy$2(matrix, worldTransform);
12326
12118
  scale$1(matrix, 1 / aScaleX, 1 / aScaleY);
@@ -12337,7 +12129,7 @@ class Stroker extends UI {
12337
12129
  leaf.__drawPath(canvas);
12338
12130
  else
12339
12131
  leaf.__.__pathForRender ? leaf.__drawRenderPath(canvas) : leaf.__drawPathByBox(canvas);
12340
- data.strokeWidth = strokeWidth / abs(worldTransform.scaleX);
12132
+ data.strokeWidth = strokeWidth / abs$1(worldTransform.scaleX);
12341
12133
  }
12342
12134
  if (stroke)
12343
12135
  typeof stroke === 'string' ? Paint.stroke(stroke, this, canvas) : Paint.strokes(stroke, this, canvas);
@@ -12359,7 +12151,6 @@ __decorate([
12359
12151
  function onTarget$1(stroker) {
12360
12152
  const value = stroker.target;
12361
12153
  stroker.list = value ? (value instanceof Array ? value : [value]) : [];
12362
- stroker.forceUpdate();
12363
12154
  }
12364
12155
 
12365
12156
  class SelectArea extends Group {
@@ -12444,8 +12235,8 @@ class EditSelect extends Group {
12444
12235
  }
12445
12236
  }
12446
12237
  update() {
12447
- if (this.targetStroker.target)
12448
- this.targetStroker.forceUpdate();
12238
+ this.hoverStroker.update();
12239
+ this.targetStroker.update();
12449
12240
  }
12450
12241
  onPointerMove(e) {
12451
12242
  const { app, editor } = this;
@@ -13263,11 +13054,11 @@ const config = {
13263
13054
  skewable: true
13264
13055
  };
13265
13056
 
13266
- const bounds = new Bounds();
13057
+ const bounds$1 = new Bounds();
13267
13058
  function simulate(editor) {
13268
13059
  const { simulateTarget, list } = editor;
13269
13060
  const { zoomLayer } = list[0].leafer.zoomLayer;
13270
- simulateTarget.safeChange(() => simulateTarget.reset(bounds.setListWithFn(list, (leaf) => leaf.getBounds('box', 'page')).get()));
13061
+ simulateTarget.safeChange(() => simulateTarget.reset(bounds$1.setListWithFn(list, (leaf) => leaf.getBounds('box', 'page')).get()));
13271
13062
  zoomLayer.add(simulateTarget);
13272
13063
  }
13273
13064
 
@@ -13363,7 +13154,7 @@ const EditorHelper = {
13363
13154
  }
13364
13155
  };
13365
13156
 
13366
- const debug = Debug.get('EditToolCreator');
13157
+ const debug$1 = Debug.get('EditToolCreator');
13367
13158
  function registerEditTool() {
13368
13159
  return (target) => {
13369
13160
  EditToolCreator.register(target);
@@ -13374,14 +13165,14 @@ const EditToolCreator = {
13374
13165
  list: {},
13375
13166
  register(EditTool) {
13376
13167
  const { tag } = EditTool.prototype;
13377
- list[tag] && debug.repeat(tag);
13378
- list[tag] = EditTool;
13168
+ list$1[tag] && debug$1.repeat(tag);
13169
+ list$1[tag] = EditTool;
13379
13170
  },
13380
13171
  get(tag, editor) {
13381
- return new list[tag](editor);
13172
+ return new list$1[tag](editor);
13382
13173
  }
13383
13174
  };
13384
- const { list } = EditToolCreator;
13175
+ const { list: list$1 } = EditToolCreator;
13385
13176
 
13386
13177
  class InnerEditorEvent extends EditorEvent {
13387
13178
  constructor(type, data) {
@@ -14098,6 +13889,349 @@ UI.setEditInner = function (editorName) {
14098
13889
  });
14099
13890
  };
14100
13891
 
13892
+ function addViewport(leafer, mergeConfig, custom) {
13893
+ addViewportConfig(leafer.parentApp ? leafer.parentApp : leafer, mergeConfig);
13894
+ if (leafer.isApp || custom)
13895
+ return;
13896
+ leafer.__eventIds.push(leafer.on_(MoveEvent.BEFORE_MOVE, (e) => {
13897
+ leafer.zoomLayer.move(leafer.getValidMove(e.moveX, e.moveY));
13898
+ }), leafer.on_(ZoomEvent.BEFORE_ZOOM, (e) => {
13899
+ const { zoomLayer } = leafer;
13900
+ const changeScale = leafer.getValidScale(e.scale);
13901
+ if (changeScale !== 1) {
13902
+ PointHelper.scaleOf(zoomLayer, e, changeScale);
13903
+ zoomLayer.scale = zoomLayer.__.scaleX * changeScale;
13904
+ }
13905
+ }));
13906
+ }
13907
+ function addViewportConfig(leafer, mergeConfig) {
13908
+ if (mergeConfig)
13909
+ DataHelper.assign(leafer.config, mergeConfig);
13910
+ DataHelper.assign(leafer.config, {
13911
+ wheel: { preventDefault: true },
13912
+ touch: { preventDefault: true },
13913
+ pointer: { preventDefaultMenu: true }
13914
+ }, leafer.userConfig);
13915
+ }
13916
+
13917
+ function custom(leafer) {
13918
+ addViewport(leafer, null, true);
13919
+ }
13920
+
13921
+ function design(leafer) {
13922
+ addViewport(leafer, {
13923
+ zoom: {
13924
+ min: 0.01,
13925
+ max: 256
13926
+ },
13927
+ move: {
13928
+ holdSpaceKey: true,
13929
+ holdMiddleKey: true,
13930
+ }
13931
+ });
13932
+ }
13933
+
13934
+ function document$1(leafer) {
13935
+ addViewport(leafer, {
13936
+ zoom: { min: 1 },
13937
+ move: { scroll: 'limit' }
13938
+ });
13939
+ }
13940
+
13941
+ const debug = Debug.get('LeaferTypeCreator');
13942
+ const LeaferTypeCreator = {
13943
+ list: {},
13944
+ register(name, fn) {
13945
+ list[name] && debug.repeat(name);
13946
+ list[name] = fn;
13947
+ },
13948
+ run(name, leafer) {
13949
+ const fn = list[name];
13950
+ fn && fn(leafer);
13951
+ }
13952
+ };
13953
+ const { list, register } = LeaferTypeCreator;
13954
+ register('viewport', addViewport);
13955
+ register('custom', custom);
13956
+ register('design', design);
13957
+ register('document', document$1);
13958
+
13959
+ const MultiTouchHelper = {
13960
+ getData(list) {
13961
+ const a = list[0], b = list[1];
13962
+ const lastCenter = PointHelper.getCenter(a.from, b.from);
13963
+ const center = PointHelper.getCenter(a.to, b.to);
13964
+ const move = { x: center.x - lastCenter.x, y: center.y - lastCenter.y };
13965
+ const lastDistance = PointHelper.getDistance(a.from, b.from);
13966
+ const distance = PointHelper.getDistance(a.to, b.to);
13967
+ const scale = distance / lastDistance;
13968
+ const rotation = PointHelper.getRotation(a.from, b.from, a.to, b.to);
13969
+ return { move, scale, rotation, center };
13970
+ }
13971
+ };
13972
+
13973
+ const WheelEventHelper = {
13974
+ getMove(event, config) {
13975
+ let { moveSpeed } = config;
13976
+ let { deltaX, deltaY } = event;
13977
+ if (event.shiftKey && !deltaX) {
13978
+ deltaX = deltaY;
13979
+ deltaY = 0;
13980
+ }
13981
+ if (deltaX > 50)
13982
+ deltaX = Math.max(50, deltaX / 3);
13983
+ if (deltaY > 50)
13984
+ deltaY = Math.max(50, deltaY / 3);
13985
+ return { x: -deltaX * moveSpeed * 2, y: -deltaY * moveSpeed * 2 };
13986
+ },
13987
+ getScale(event, config) {
13988
+ let zoom;
13989
+ let scale = 1;
13990
+ let { zoomMode, zoomSpeed } = config;
13991
+ const delta = event.deltaY || event.deltaX;
13992
+ if (zoomMode) {
13993
+ zoom = (zoomMode === 'mouse') ? true : (!event.deltaX && (Platform.intWheelDeltaY ? Math.abs(delta) > 17 : Math.ceil(delta) !== delta));
13994
+ if (event.shiftKey || event.metaKey || event.ctrlKey)
13995
+ zoom = true;
13996
+ }
13997
+ else {
13998
+ zoom = !event.shiftKey && (event.metaKey || event.ctrlKey);
13999
+ }
14000
+ if (zoom) {
14001
+ zoomSpeed = MathHelper.within(zoomSpeed, 0, 1);
14002
+ const min = event.deltaY ? config.delta.y : config.delta.x;
14003
+ scale = 1 - delta / (min * 4) * zoomSpeed;
14004
+ if (scale < 0.5)
14005
+ scale = 0.5;
14006
+ if (scale >= 1.5)
14007
+ scale = 1.5;
14008
+ }
14009
+ return scale;
14010
+ }
14011
+ };
14012
+
14013
+ class Transformer {
14014
+ get transforming() { return !!(this.moveData || this.zoomData || this.rotateData); }
14015
+ constructor(interaction) {
14016
+ this.interaction = interaction;
14017
+ }
14018
+ move(data) {
14019
+ const { interaction } = this;
14020
+ if (!data.moveType)
14021
+ data.moveType = 'move';
14022
+ if (!this.moveData) {
14023
+ this.setPath(data);
14024
+ this.moveData = Object.assign(Object.assign({}, data), { moveX: 0, moveY: 0 });
14025
+ interaction.emit(MoveEvent.START, this.moveData);
14026
+ }
14027
+ data.path = this.moveData.path;
14028
+ interaction.emit(MoveEvent.BEFORE_MOVE, data);
14029
+ interaction.emit(MoveEvent.MOVE, data);
14030
+ this.transformEndWait();
14031
+ }
14032
+ zoom(data) {
14033
+ const { interaction } = this;
14034
+ if (!this.zoomData) {
14035
+ this.setPath(data);
14036
+ this.zoomData = Object.assign(Object.assign({}, data), { scale: 1 });
14037
+ interaction.emit(ZoomEvent.START, this.zoomData);
14038
+ }
14039
+ data.path = this.zoomData.path;
14040
+ interaction.emit(ZoomEvent.BEFORE_ZOOM, data);
14041
+ interaction.emit(ZoomEvent.ZOOM, data);
14042
+ this.transformEndWait();
14043
+ }
14044
+ rotate(data) {
14045
+ const { interaction } = this;
14046
+ if (!this.rotateData) {
14047
+ this.setPath(data);
14048
+ this.rotateData = Object.assign(Object.assign({}, data), { rotation: 0 });
14049
+ interaction.emit(RotateEvent.START, this.rotateData);
14050
+ }
14051
+ data.path = this.rotateData.path;
14052
+ interaction.emit(RotateEvent.BEFORE_ROTATE, data);
14053
+ interaction.emit(RotateEvent.ROTATE, data);
14054
+ this.transformEndWait();
14055
+ }
14056
+ setPath(data) {
14057
+ const { interaction } = this;
14058
+ const { path } = interaction.selector.getByPoint(data, interaction.hitRadius);
14059
+ data.path = path;
14060
+ interaction.cancelHover();
14061
+ }
14062
+ transformEndWait() {
14063
+ clearTimeout(this.transformTimer);
14064
+ this.transformTimer = setTimeout(() => {
14065
+ this.transformEnd();
14066
+ }, this.interaction.p.transformTime);
14067
+ }
14068
+ transformEnd() {
14069
+ const { interaction, moveData, zoomData, rotateData } = this;
14070
+ if (moveData)
14071
+ interaction.emit(MoveEvent.END, moveData);
14072
+ if (zoomData)
14073
+ interaction.emit(ZoomEvent.END, zoomData);
14074
+ if (rotateData)
14075
+ interaction.emit(RotateEvent.END, rotateData);
14076
+ this.reset();
14077
+ }
14078
+ reset() {
14079
+ this.zoomData = this.moveData = this.rotateData = null;
14080
+ }
14081
+ destroy() {
14082
+ this.reset();
14083
+ }
14084
+ }
14085
+
14086
+ const leafer = Leafer.prototype;
14087
+ const bounds = new Bounds();
14088
+ leafer.initType = function (type) {
14089
+ LeaferTypeCreator.run(type, this);
14090
+ };
14091
+ leafer.getValidMove = function (moveX, moveY) {
14092
+ const { scroll, disabled } = this.app.config.move;
14093
+ if (scroll) {
14094
+ const type = scroll === true ? '' : scroll;
14095
+ if (type.includes('x'))
14096
+ moveX = moveX || moveY, moveY = 0;
14097
+ else if (type.includes('y'))
14098
+ moveY = moveY || moveX, moveX = 0;
14099
+ else
14100
+ Math.abs(moveX) > Math.abs(moveY) ? moveY = 0 : moveX = 0;
14101
+ if (type.includes('limit')) {
14102
+ const { x, y, width, height } = bounds.set(this.__world).addPoint(this.zoomLayer);
14103
+ const right = x + width - this.width, bottom = y + height - this.height;
14104
+ if (x >= 0 && right <= 0)
14105
+ moveX = 0;
14106
+ else if (moveX > 0) {
14107
+ if (x + moveX > 0)
14108
+ moveX = -x;
14109
+ }
14110
+ else if (moveX < 0 && right + moveX < 0)
14111
+ moveX = -right;
14112
+ if (y >= 0 && bottom <= 0)
14113
+ moveY = 0;
14114
+ else if (moveY > 0) {
14115
+ if (y + moveY > 0)
14116
+ moveY = -y;
14117
+ }
14118
+ else if (moveY < 0 && bottom + moveY < 0)
14119
+ moveY = -bottom;
14120
+ }
14121
+ }
14122
+ return { x: disabled ? 0 : moveX, y: disabled ? 0 : moveY };
14123
+ };
14124
+ leafer.getValidScale = function (changeScale) {
14125
+ const { scaleX } = this.zoomLayer.__, { min, max, disabled } = this.app.config.zoom, absScale = Math.abs(scaleX * changeScale);
14126
+ if (min && absScale < min)
14127
+ changeScale = min / scaleX;
14128
+ else if (max && absScale > max)
14129
+ changeScale = max / scaleX;
14130
+ return disabled ? 1 : MathHelper.float(changeScale);
14131
+ };
14132
+
14133
+ function getMoveEventData(move, event) {
14134
+ return Object.assign(Object.assign({}, event), { moveX: move.x, moveY: move.y });
14135
+ }
14136
+ function getRotateEventData(rotation, event) {
14137
+ return Object.assign(Object.assign({}, event), { rotation });
14138
+ }
14139
+ function getZoomEventData(scale, event) {
14140
+ return Object.assign(Object.assign({}, event), { scale });
14141
+ }
14142
+ const interaction = InteractionBase.prototype;
14143
+ interaction.createTransformer = function () {
14144
+ this.transformer = new Transformer(this);
14145
+ };
14146
+ interaction.move = function (data) {
14147
+ this.transformer.move(data);
14148
+ };
14149
+ interaction.zoom = function (data) {
14150
+ this.transformer.zoom(data);
14151
+ };
14152
+ interaction.rotate = function (data) {
14153
+ this.transformer.rotate(data);
14154
+ };
14155
+ interaction.transformEnd = function () {
14156
+ this.transformer.transformEnd();
14157
+ };
14158
+ interaction.wheel = function (data) {
14159
+ const { wheel } = this.config;
14160
+ if (wheel.disabled)
14161
+ return;
14162
+ const scale = wheel.getScale ? wheel.getScale(data, wheel) : WheelEventHelper.getScale(data, wheel);
14163
+ scale !== 1 ? this.zoom(getZoomEventData(scale, data)) : this.move(getMoveEventData(wheel.getMove ? wheel.getMove(data, wheel) : WheelEventHelper.getMove(data, wheel), data));
14164
+ };
14165
+ interaction.multiTouch = function (data, list) {
14166
+ if (this.config.multiTouch.disabled)
14167
+ return;
14168
+ const { move, rotation, scale, center } = MultiTouchHelper.getData(list);
14169
+ Object.assign(data, center);
14170
+ this.rotate(getRotateEventData(rotation, data));
14171
+ this.zoom(getZoomEventData(scale, data));
14172
+ this.move(getMoveEventData(move, data));
14173
+ };
14174
+
14175
+ const dragger = Dragger.prototype;
14176
+ const { abs } = Math;
14177
+ dragger.checkDragEndAnimate = function (data, speed) {
14178
+ const { moveX, moveY } = this.dragData;
14179
+ const absMoveX = abs(moveX), absMoveY = abs(moveY), minMove = speed ? 1 : 0.1;
14180
+ const dragAnimate = this.interaction.m.dragAnimate && this.canAnimate && this.moving && (absMoveX > minMove || absMoveY > minMove);
14181
+ if (dragAnimate) {
14182
+ const inertia = data.pointerType === 'touch' ? 3 : 1, maxMove = 70;
14183
+ speed = speed ? 0.95 : inertia;
14184
+ if (absMoveX * speed > maxMove)
14185
+ speed = maxMove / absMoveX;
14186
+ else if (absMoveY * speed > maxMove)
14187
+ speed = maxMove / absMoveY;
14188
+ data = Object.assign({}, data);
14189
+ PointHelper.move(data, moveX * speed, moveY * speed);
14190
+ this.drag(data);
14191
+ this.animate(() => { this.dragEnd(data, 1); });
14192
+ }
14193
+ return dragAnimate;
14194
+ };
14195
+ dragger.animate = function (func, off) {
14196
+ const animateWait = func || this.animateWait;
14197
+ if (animateWait)
14198
+ this.interaction.target.nextRender(animateWait, null, off);
14199
+ this.animateWait = func;
14200
+ };
14201
+ dragger.checkDragOut = function (data) {
14202
+ const { interaction } = this;
14203
+ this.autoMoveCancel();
14204
+ if (this.dragging && !interaction.shrinkCanvasBounds.hitPoint(data))
14205
+ this.autoMoveOnDragOut(data);
14206
+ };
14207
+ dragger.autoMoveOnDragOut = function (data) {
14208
+ const { interaction, downData, canDragOut } = this;
14209
+ const { autoDistance, dragOut } = interaction.m;
14210
+ if (!dragOut || !canDragOut || !autoDistance)
14211
+ return;
14212
+ const bounds = interaction.shrinkCanvasBounds;
14213
+ const { x, y } = bounds;
14214
+ const right = BoundsHelper.maxX(bounds);
14215
+ const bottom = BoundsHelper.maxY(bounds);
14216
+ const moveX = data.x < x ? autoDistance : (right < data.x ? -autoDistance : 0);
14217
+ const moveY = data.y < y ? autoDistance : (bottom < data.y ? -autoDistance : 0);
14218
+ let totalX = 0, totalY = 0;
14219
+ this.autoMoveTimer = setInterval(() => {
14220
+ totalX += moveX;
14221
+ totalY += moveY;
14222
+ PointHelper.move(downData, moveX, moveY);
14223
+ PointHelper.move(this.dragData, moveX, moveY);
14224
+ interaction.move(Object.assign(Object.assign({}, data), { moveX, moveY, totalX, totalY, moveType: 'drag' }));
14225
+ interaction.pointerMoveReal(data);
14226
+ }, 10);
14227
+ };
14228
+ dragger.autoMoveCancel = function () {
14229
+ if (this.autoMoveTimer) {
14230
+ clearInterval(this.autoMoveTimer);
14231
+ this.autoMoveTimer = 0;
14232
+ }
14233
+ };
14234
+
14101
14235
  function getZoomScale(scaleX, type) {
14102
14236
  let scale = 1;
14103
14237
  const out = type === 'out', absScale = Math.abs(scaleX);
@@ -14127,7 +14261,7 @@ function getFixBounds(bounds, scaleBounds) {
14127
14261
 
14128
14262
  Leafer.prototype.zoom = function (zoomType, padding, fixed) {
14129
14263
  const { zoomLayer } = this;
14130
- const limitBounds = this.canvas.bounds.clone().shrink(padding ? padding : 30), bounds = new Bounds();
14264
+ const limitBounds = this.canvas.bounds.clone().shrink(padding !== undefined ? padding : 30), bounds = new Bounds();
14131
14265
  const center = { x: limitBounds.x + limitBounds.width / 2, y: limitBounds.y + limitBounds.height / 2 };
14132
14266
  let changeScale;
14133
14267
  const { scaleX } = this.__;
@@ -14375,13 +14509,13 @@ const half = { x: -0.5 };
14375
14509
  const angle = { connect: half, offset: { x: -0.71, bevelJoin: 0.36, roundJoin: 0.22 }, path: [1, -3, -3, 2, 0, 0, 2, -3, 3] };
14376
14510
  const angleSide = { connect: half, offset: { x: -1.207, bevelJoin: 0.854, roundJoin: 0.707 }, path: [1, -3, -3, 2, 0, 0, 2, -1, 0] };
14377
14511
  const triangleLinePath = [1, -3, 0, 2, -3, -2, 2, 0, 0, 2, -3, 2, 2, -3, 0];
14378
- const triangle = { connect: half, offset: { x: -0.9, bevelJoin: 0.624, roundJoin: 0.4 }, path: [...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1] };
14512
+ const triangle = { connect: half, offset: { x: -0.9, bevelJoin: 0.624, roundJoin: 0.4 }, path: [...triangleLinePath, 1, -2.05, 1.1, 2, -2.05, -1.1], dashPath: [1, -2, 0, 2, -0.5, 0] };
14379
14513
  const arrowLinePath = [1, -3, 0, 2, -3.5, -1.8, 2, 0, 0, 2, -3.5, 1.8, 2, -3, 0];
14380
- const arrow = { connect: half, offset: { x: -1.1, bevelJoin: 0.872, roundJoin: 0.6 }, path: [...arrowLinePath, 1, -2.25, 0.95, 2, -2.25, -0.95] };
14381
- const triangleFlip = { offset: half, path: [...triangle.path], };
14514
+ const arrow = { connect: half, offset: { x: -1.1, bevelJoin: 0.872, roundJoin: 0.6 }, path: [...arrowLinePath, 1, -2.25, 0.95, 2, -2.25, -0.95], dashPath: [1, -3, 0, 2, -0.5, 0] };
14515
+ const triangleFlip = { offset: half, path: [...triangle.path], dashPath: [1, -2.5, 0, 2, -1, 0] };
14382
14516
  rotate(triangleFlip.path, 180, { x: -1.5, y: 0 });
14383
14517
  const circleLine = { connect: { x: -1.3 }, path: [1, 1.8, -0.1, 2, 1.8, 0, 26, 0, 0, 1.8, 0, 359, 0], };
14384
- const circle = { connect: { x: 0.5 }, path: [...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0] };
14518
+ const circle = { connect: { x: 0.5 }, path: [...circleLine.path, 1, 0, 0, 26, 0, 0, 1, 0, 360, 0], dashPath: [1, -0.5, 0, 2, 0.5, 0] };
14385
14519
  const squareLine = { connect: { x: -1.3 }, path: [1, -1.4, 0, 2, -1.4, -1.4, 2, 1.4, -1.4, 2, 1.4, 1.4, 2, -1.4, 1.4, 2, -1.4, 0] };
14386
14520
  const square = { path: [...squareLine.path, 2, -1.4, -0.49, 2, 1, -0.49, 1, -1.4, 0.49, 2, 1, 0.49] };
14387
14521
  const diamondLine = DataHelper.clone(squareLine);
@@ -14403,12 +14537,14 @@ const arrows = {
14403
14537
  'diamond-line': diamondLine,
14404
14538
  mark,
14405
14539
  };
14406
- function getArrowPath(ui, arrow, from, to, scale, connectOffset) {
14540
+ function getArrowPath(ui, arrow, from, to, scale, connectOffset, hasDashPattern) {
14407
14541
  const { strokeCap, strokeJoin } = ui.__;
14408
- const { offset, connect, path } = (typeof arrow === 'object' ? arrow : arrows[arrow]);
14542
+ const { offset, connect, path, dashPath } = (typeof arrow === 'object' ? arrow : arrows[arrow]);
14409
14543
  let connectX = connect ? connect.x : 0;
14410
14544
  let offsetX = offset ? offset.x : 0;
14411
14545
  const data = [...path];
14546
+ if (hasDashPattern && dashPath)
14547
+ data.push(...dashPath);
14412
14548
  if (strokeCap !== 'none')
14413
14549
  connectX -= 0.5;
14414
14550
  if (offset) {
@@ -14432,7 +14568,7 @@ const last = {}, now = {};
14432
14568
  const PathArrowModule = {
14433
14569
  list: arrows,
14434
14570
  addArrows(ui, changeRenderPath) {
14435
- const { startArrow, endArrow, strokeWidth, __pathForRender: data } = ui.__;
14571
+ const { startArrow, endArrow, strokeWidth, dashPattern, __pathForRender: data } = ui.__;
14436
14572
  let command, i = 0, len = data.length, count = 0, useStartArrow = startArrow && startArrow !== 'none';
14437
14573
  while (i < len) {
14438
14574
  command = data[i];
@@ -14491,17 +14627,20 @@ const PathArrowModule = {
14491
14627
  if (count === 2 && useStartArrow)
14492
14628
  copy(second, command === L ? now : last);
14493
14629
  if (i === len) {
14494
- const p = ui.__.__pathForRender = changeRenderPath ? [...data] : data;
14630
+ const path = ui.__.__pathForRender = changeRenderPath ? [...data] : data;
14631
+ const pathForArrow = ui.__.__pathForArrow = [];
14495
14632
  if (useStartArrow) {
14496
- p.push(...getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint));
14633
+ const startArrowPath = getArrowPath(ui, startArrow, second, first, strokeWidth, connectPoint, !!dashPattern);
14634
+ dashPattern ? pathForArrow.push(...startArrowPath) : path.push(...startArrowPath);
14497
14635
  if (connectPoint.x) {
14498
14636
  getDistancePoint(first, second, -connectPoint.x, true);
14499
- p[1] = second.x;
14500
- p[2] = second.y;
14637
+ path[1] = second.x;
14638
+ path[2] = second.y;
14501
14639
  }
14502
14640
  }
14503
14641
  if (endArrow && endArrow !== 'none') {
14504
- p.push(...getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint));
14642
+ const endArrowPath = getArrowPath(ui, endArrow, last, now, strokeWidth, connectPoint, !!dashPattern);
14643
+ dashPattern ? pathForArrow.push(...endArrowPath) : path.push(...endArrowPath);
14505
14644
  if (connectPoint.x) {
14506
14645
  getDistancePoint(now, last, -connectPoint.x, true);
14507
14646
  let index;
@@ -14520,7 +14659,7 @@ const PathArrowModule = {
14520
14659
  break;
14521
14660
  }
14522
14661
  if (index)
14523
- setPoint(p, last, index);
14662
+ setPoint(path, last, index);
14524
14663
  }
14525
14664
  }
14526
14665
  }
@@ -14645,7 +14784,7 @@ let TextEditor = class TextEditor extends InnerEditor {
14645
14784
  style.position = 'fixed';
14646
14785
  style.transformOrigin = 'left top';
14647
14786
  style.boxSizing = 'border-box';
14648
- this.isHTMLText ? div.innerHTML = text.text : div.innerText = text.text;
14787
+ this.isHTMLText ? div.innerHTML = String(text.text) : div.innerText = String(text.text);
14649
14788
  const { view } = editor.app;
14650
14789
  (this.inBody = view instanceof HTMLCanvasElement) ? document.body.appendChild(div) : view.appendChild(div);
14651
14790
  this.eventIds = [
@@ -14816,4 +14955,4 @@ HTMLText = __decorate([
14816
14955
  registerUI()
14817
14956
  ], HTMLText);
14818
14957
 
14819
- export { AlignHelper, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Platform, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, ZoomEvent, addInteractionWindow, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, needPlugin, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };
14958
+ export { AlignHelper, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Platform, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isNull, layoutProcessor, maskType, naturalBoundsType, needPlugin, opacityType, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, sortType, strokeType, surfaceType, tempBounds$1 as tempBounds, tempMatrix, tempPoint$3 as tempPoint, useCanvas, useModule, version, visibleType, zoomLayerType };