@leafer/worker 2.0.3 → 2.0.4

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.
@@ -2794,10 +2794,10 @@ const BezierHelper = {
2794
2794
  const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
2795
2795
  startRadian -= PI_2 * sign;
2796
2796
  endRadian -= PI_2 * sign;
2797
- return ellipse$6(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2797
+ return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2798
2798
  },
2799
2799
  arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2800
- return ellipse$6(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2800
+ return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2801
2801
  },
2802
2802
  ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2803
2803
  const rotationRadian = rotation * OneRadian;
@@ -2899,11 +2899,11 @@ const BezierHelper = {
2899
2899
  }
2900
2900
  };
2901
2901
 
2902
- const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6} = BezierHelper;
2902
+ const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
2903
2903
 
2904
2904
  const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
2905
2905
 
2906
- const {ellipse: ellipse$5} = BezierHelper;
2906
+ const {ellipse: ellipse$7} = BezierHelper;
2907
2907
 
2908
2908
  const EllipseHelper = {
2909
2909
  ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
@@ -2941,7 +2941,7 @@ const EllipseHelper = {
2941
2941
  const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
2942
2942
  const anticlockwise = totalRadian < 0 ? 1 : 0;
2943
2943
  if (curveMode || Platform.ellipseToCurve) {
2944
- ellipse$5(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2944
+ ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2945
2945
  } else {
2946
2946
  if (radiusX === radiusY && !rotation) {
2947
2947
  data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
@@ -2963,7 +2963,7 @@ const PathCommandNodeHelper = {
2963
2963
 
2964
2964
  const {M: M$9, m: m, L: L$9, l: l, H: H, h: h, V: V, v: v, C: C$7, c: c, S: S$1, s: s, Q: Q$6, q: q, T: T, t: t, A: A, a: a, Z: Z$7, z: z, N: N$5, D: D$6, X: X$5, G: G$5, F: F$6, O: O$6, P: P$5, U: U$5} = PathCommandMap;
2965
2965
 
2966
- const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2966
+ const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2967
2967
 
2968
2968
  const {ellipticalArc: ellipticalArc} = EllipseHelper;
2969
2969
 
@@ -3196,14 +3196,14 @@ const PathConvert = {
3196
3196
  break;
3197
3197
 
3198
3198
  case G$5:
3199
- ellipse$4(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
3199
+ ellipse$6(curveMode ? data : copyData(data, old, i, 9), old[i + 1], old[i + 2], old[i + 3], old[i + 4], old[i + 5], old[i + 6], old[i + 7], old[i + 8], null, setEndPoint$1);
3200
3200
  x = setEndPoint$1.x;
3201
3201
  y = setEndPoint$1.y;
3202
3202
  i += 9;
3203
3203
  break;
3204
3204
 
3205
3205
  case F$6:
3206
- curveMode ? ellipse$4(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
3206
+ curveMode ? ellipse$6(data, old[i + 1], old[i + 2], old[i + 3], old[i + 4], 0, 0, 360, false) : copyData(data, old, i, 5);
3207
3207
  x = old[i + 1] + old[i + 3];
3208
3208
  y = old[i + 2];
3209
3209
  i += 5;
@@ -3357,7 +3357,7 @@ const PathCommandDataHelper = {
3357
3357
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3358
3358
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
3359
3359
  data.push(M$8, startPoint.x, startPoint.y);
3360
- ellipse$3(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3360
+ ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3361
3361
  },
3362
3362
  drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
3363
3363
  BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3369,9 +3369,9 @@ const PathCommandDataHelper = {
3369
3369
  }
3370
3370
  };
3371
3371
 
3372
- const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
3372
+ const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
3373
3373
 
3374
- const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$2, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3374
+ const {moveTo: moveTo$4, lineTo: lineTo$3, quadraticCurveTo: quadraticCurveTo, bezierCurveTo: bezierCurveTo, closePath: closePath$3, beginPath: beginPath, rect: rect$2, roundRect: roundRect$1, ellipse: ellipse$4, arc: arc$1, arcTo: arcTo$2, drawEllipse: drawEllipse, drawArc: drawArc, drawPoints: drawPoints$2} = PathCommandDataHelper;
3375
3375
 
3376
3376
  class PathCreator {
3377
3377
  set path(value) {
@@ -3428,7 +3428,7 @@ class PathCreator {
3428
3428
  return this;
3429
3429
  }
3430
3430
  ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3431
- ellipse$2(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3431
+ ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3432
3432
  this.paint();
3433
3433
  return this;
3434
3434
  }
@@ -3550,7 +3550,7 @@ const PathDrawer = {
3550
3550
 
3551
3551
  const {M: M$6, L: L$6, C: C$4, Q: Q$3, Z: Z$4, N: N$2, D: D$3, X: X$2, G: G$2, F: F$3, O: O$3, P: P$2, U: U$2} = PathCommandMap;
3552
3552
 
3553
- const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
3553
+ const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$3} = BezierHelper;
3554
3554
 
3555
3555
  const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3556
3556
 
@@ -3633,7 +3633,7 @@ const PathBounds = {
3633
3633
  break;
3634
3634
 
3635
3635
  case G$2:
3636
- ellipse$1(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
3636
+ ellipse$3(null, data[i + 1], data[i + 2], data[i + 3], data[i + 4], data[i + 5], data[i + 6], data[i + 7], data[i + 8], tempPointBounds, setEndPoint);
3637
3637
  i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3638
3638
  x = setEndPoint.x;
3639
3639
  y = setEndPoint.y;
@@ -5620,7 +5620,7 @@ class BoundsEvent extends Event {
5620
5620
  }
5621
5621
  }
5622
5622
  static emitWorld(leaf) {
5623
- if (leaf.leaferIsReady) leaf.emit(WORLD, this);
5623
+ if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
5624
5624
  }
5625
5625
  }
5626
5626
 
@@ -6581,14 +6581,16 @@ let Leaf = class Leaf {
6581
6581
  relative.innerToWorld(world, to, distance);
6582
6582
  world = to ? to : world;
6583
6583
  }
6584
- toInnerPoint(this.scrollWorldTransform, world, to, distance);
6584
+ toInnerPoint(this.worldTransform, world, to, distance);
6585
6585
  }
6586
6586
  innerToWorld(inner, to, distance, relative) {
6587
- toOuterPoint(this.scrollWorldTransform, inner, to, distance);
6587
+ toOuterPoint(this.worldTransform, inner, to, distance);
6588
6588
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6589
6589
  }
6590
6590
  getBoxPoint(world, relative, distance, change) {
6591
- return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true);
6591
+ const inner = this.getInnerPoint(world, relative, distance, change);
6592
+ if (distance) return inner;
6593
+ return this.getBoxPointByInner(inner, null, null, true);
6592
6594
  }
6593
6595
  getBoxPointByInner(inner, _relative, _distance, change) {
6594
6596
  const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
@@ -7051,7 +7053,7 @@ class LeafLevelList {
7051
7053
  }
7052
7054
  }
7053
7055
 
7054
- const version = "2.0.3";
7056
+ const version = "2.0.4";
7055
7057
 
7056
7058
  class LeaferCanvas extends LeaferCanvasBase {
7057
7059
  get allowBackgroundColor() {
@@ -8239,7 +8241,11 @@ class EllipseData extends UIData {
8239
8241
 
8240
8242
  class PolygonData extends LineData {}
8241
8243
 
8242
- class StarData extends UIData {}
8244
+ class StarData extends UIData {
8245
+ get __boxStroke() {
8246
+ return !this.__pathInputed;
8247
+ }
8248
+ }
8243
8249
 
8244
8250
  class PathData extends UIData {
8245
8251
  get __pathInputed() {
@@ -9251,6 +9257,9 @@ let Box = class Box extends Group {
9251
9257
  get isBranchLeaf() {
9252
9258
  return true;
9253
9259
  }
9260
+ get __useSelfBox() {
9261
+ return this.pathInputed;
9262
+ }
9254
9263
  constructor(data) {
9255
9264
  super(data);
9256
9265
  this.__layout.renderChanged || this.__layout.renderChange();
@@ -9266,7 +9275,7 @@ let Box = class Box extends Group {
9266
9275
  }
9267
9276
  __updateRectBoxBounds() {}
9268
9277
  __updateBoxBounds(_secondLayout) {
9269
- if (this.children.length && !this.pathInputed) {
9278
+ if (this.children.length && !this.__useSelfBox) {
9270
9279
  const data = this.__;
9271
9280
  if (data.__autoSide) {
9272
9281
  if (data.__hasSurface) this.__extraUpdate();
@@ -9375,7 +9384,7 @@ __decorate([ affectRenderBoundsType("hide") ], Frame.prototype, "overflow", void
9375
9384
 
9376
9385
  Frame = __decorate([ registerUI() ], Frame);
9377
9386
 
9378
- const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
9387
+ const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
9379
9388
 
9380
9389
  let Ellipse = class Ellipse extends UI {
9381
9390
  get __tag() {
@@ -9388,21 +9397,21 @@ let Ellipse = class Ellipse extends UI {
9388
9397
  let open;
9389
9398
  if (innerRadius) {
9390
9399
  if (startAngle || endAngle) {
9391
- if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
9392
- ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
9400
+ if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
9401
+ ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
9393
9402
  } else {
9394
9403
  if (innerRadius < 1) {
9395
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
9404
+ ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
9396
9405
  moveTo$3(path, width, ry);
9397
9406
  }
9398
- ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
9407
+ ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
9399
9408
  }
9400
9409
  } else {
9401
9410
  if (startAngle || endAngle) {
9402
9411
  moveTo$3(path, rx, ry);
9403
- ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
9412
+ ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
9404
9413
  } else {
9405
- ellipse(path, rx, ry, rx, ry);
9414
+ ellipse$2(path, rx, ry, rx, ry);
9406
9415
  }
9407
9416
  }
9408
9417
  if (!open) closePath$2(path);
@@ -10998,6 +11007,14 @@ class InteractionBase {
10998
11007
  stopDragAnimate() {
10999
11008
  this.dragger.stopAnimate();
11000
11009
  }
11010
+ replaceDownTarget(target) {
11011
+ const {downData: downData} = this;
11012
+ if (downData && target) {
11013
+ const {path: path} = downData;
11014
+ path.remove(path.list[0]);
11015
+ path.addAt(target, 0);
11016
+ }
11017
+ }
11001
11018
  updateDownData(data, options, merge) {
11002
11019
  const {downData: downData} = this;
11003
11020
  if (!data && downData) data = downData;
@@ -12084,7 +12101,7 @@ function checkImage(paint, drawImage, ui, canvas, renderOptions) {
12084
12101
  if (drawImage) {
12085
12102
  if (data.repeat) {
12086
12103
  drawImage = false;
12087
- } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
12104
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
12088
12105
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
12089
12106
  }
12090
12107
  }
@@ -12637,7 +12654,7 @@ function createRows(drawData, content, style) {
12637
12654
  }, row = {
12638
12655
  words: []
12639
12656
  };
12640
- if (__letterSpacing) content = [ ...content ];
12657
+ content = [ ...content ];
12641
12658
  for (let i = 0, len = content.length; i < len; i++) {
12642
12659
  char = content[i];
12643
12660
  if (char === "\n") {
@@ -13110,10 +13127,10 @@ function targetAttr(fn) {
13110
13127
  });
13111
13128
  if (isObject(check)) value = check; else if (check === false) return;
13112
13129
  }
13113
- const {dimOthers: dimOthers, bright: bright} = t.editBox.mergedConfig || t.config;
13114
- if (!isUndefined(dimOthers) || !isUndefined(bright)) {
13130
+ if (t.hasDimOthers) {
13115
13131
  t.setDimOthers(false);
13116
13132
  t.setBright(false);
13133
+ t.hasDimOthers = undefined;
13117
13134
  }
13118
13135
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
13119
13136
  if (t.single) {
@@ -14046,6 +14063,7 @@ class EditBox extends Group {
14046
14063
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
14047
14064
  editor.setDimOthers(dimOthers);
14048
14065
  editor.setBright(!!dimOthers || bright);
14066
+ editor.hasDimOthers = true;
14049
14067
  }
14050
14068
  if (spread) BoundsHelper.spread(bounds, spread);
14051
14069
  if (this.view.worldOpacity) {
@@ -14152,8 +14170,9 @@ class EditBox extends Group {
14152
14170
  onDragStart(e) {
14153
14171
  this.dragging = true;
14154
14172
  const point = this.dragPoint = e.current, {pointType: pointType} = point;
14155
- const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = this.mergeConfig;
14173
+ const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, onCopy: onCopy} = this.mergeConfig;
14156
14174
  if (pointType === "move") {
14175
+ if (e.altKey && onCopy && onCopy() && this.editor.single) this.app.interaction.replaceDownTarget(this.target);
14157
14176
  moveable && (this.moving = true);
14158
14177
  } else {
14159
14178
  if (pointType.includes("rotate") || this.isHoldRotateKey(e) || !resizeable) {
@@ -14272,26 +14291,31 @@ class EditBox extends Group {
14272
14291
  updatePointCursor(this, e);
14273
14292
  }
14274
14293
  onArrow(e) {
14275
- if (this.canUse && this.mergeConfig.keyEvent) {
14294
+ if (this.canUse) {
14276
14295
  let x = 0, y = 0;
14277
- const distance = e.shiftKey ? 10 : 1;
14278
14296
  switch (e.code) {
14279
14297
  case "ArrowDown":
14280
- y = distance;
14298
+ y = 1;
14281
14299
  break;
14282
14300
 
14283
14301
  case "ArrowUp":
14284
- y = -distance;
14302
+ y = -1;
14285
14303
  break;
14286
14304
 
14287
14305
  case "ArrowLeft":
14288
- x = -distance;
14306
+ x = -1;
14289
14307
  break;
14290
14308
 
14291
14309
  case "ArrowRight":
14292
- x = distance;
14310
+ x = 1;
14311
+ }
14312
+ if (x || y) {
14313
+ const {keyEvent: keyEvent, arrowStep: arrowStep, arrowFastStep: arrowFastStep} = this.mergeConfig;
14314
+ if (keyEvent) {
14315
+ const step = e.shiftKey ? arrowFastStep : arrowStep;
14316
+ this.transformTool.move(x * step, y * step);
14317
+ }
14293
14318
  }
14294
- if (x || y) this.transformTool.move(x, y);
14295
14319
  }
14296
14320
  }
14297
14321
  onDoubleTap(e) {
@@ -14403,6 +14427,8 @@ const config$1 = {
14403
14427
  pointSize: 10,
14404
14428
  pointRadius: 16,
14405
14429
  rotateGap: 45,
14430
+ arrowStep: 1,
14431
+ arrowFastStep: 10,
14406
14432
  buttonsDirection: "bottom",
14407
14433
  buttonsMargin: 12,
14408
14434
  hideOnSmall: true,
@@ -20711,4 +20737,141 @@ Plugin.add("scale-fixed");
20711
20737
 
20712
20738
  UI.addAttr("scaleFixed", undefined, scaleFixedType);
20713
20739
 
20714
- export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, 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, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, 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, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
20740
+ class EllipseBoxData extends BoxData {}
20741
+
20742
+ const ellipse$1 = Ellipse.prototype;
20743
+
20744
+ let EllipseBox = class EllipseBox extends Box {
20745
+ get __tag() {
20746
+ return "EllipseBox";
20747
+ }
20748
+ __updatePath() {}
20749
+ };
20750
+
20751
+ __decorate([ dataProcessor(EllipseBoxData) ], EllipseBox.prototype, "__", void 0);
20752
+
20753
+ __decorate([ pathType(0) ], EllipseBox.prototype, "innerRadius", void 0);
20754
+
20755
+ __decorate([ pathType(0) ], EllipseBox.prototype, "startAngle", void 0);
20756
+
20757
+ __decorate([ pathType(0) ], EllipseBox.prototype, "endAngle", void 0);
20758
+
20759
+ __decorate([ rewrite(ellipse$1.__updatePath) ], EllipseBox.prototype, "__updatePath", null);
20760
+
20761
+ EllipseBox = __decorate([ rewriteAble(), registerUI() ], EllipseBox);
20762
+
20763
+ class PolygonBoxData extends BoxData {
20764
+ get __usePathBox() {
20765
+ return this.points || this.__pathInputed;
20766
+ }
20767
+ }
20768
+
20769
+ const polygon = Polygon.prototype;
20770
+
20771
+ let PolygonBox = class PolygonBox extends Box {
20772
+ get __tag() {
20773
+ return "PolygonBox";
20774
+ }
20775
+ __updatePath() {}
20776
+ };
20777
+
20778
+ __decorate([ dataProcessor(PolygonBoxData) ], PolygonBox.prototype, "__", void 0);
20779
+
20780
+ __decorate([ pathType(3) ], PolygonBox.prototype, "sides", void 0);
20781
+
20782
+ __decorate([ pathType() ], PolygonBox.prototype, "points", void 0);
20783
+
20784
+ __decorate([ pathType(0) ], PolygonBox.prototype, "curve", void 0);
20785
+
20786
+ __decorate([ rewrite(polygon.__updatePath) ], PolygonBox.prototype, "__updatePath", null);
20787
+
20788
+ PolygonBox = __decorate([ rewriteAble(), registerUI() ], PolygonBox);
20789
+
20790
+ class StarBoxData extends BoxData {}
20791
+
20792
+ const ellipse = Star.prototype;
20793
+
20794
+ let StarBox = class StarBox extends Box {
20795
+ get __tag() {
20796
+ return "StarBox";
20797
+ }
20798
+ __updatePath() {}
20799
+ };
20800
+
20801
+ __decorate([ pathType(5) ], StarBox.prototype, "corners", void 0);
20802
+
20803
+ __decorate([ pathType(.382) ], StarBox.prototype, "innerRadius", void 0);
20804
+
20805
+ __decorate([ dataProcessor(StarBoxData) ], StarBox.prototype, "__", void 0);
20806
+
20807
+ __decorate([ rewrite(ellipse.__updatePath) ], StarBox.prototype, "__updatePath", null);
20808
+
20809
+ StarBox = __decorate([ rewriteAble(), registerUI() ], StarBox);
20810
+
20811
+ class PathBoxData extends BoxData {}
20812
+
20813
+ let PathBox = class PathBox extends Box {
20814
+ get __tag() {
20815
+ return "PathBox";
20816
+ }
20817
+ };
20818
+
20819
+ __decorate([ dataProcessor(PathBoxData) ], PathBox.prototype, "__", void 0);
20820
+
20821
+ __decorate([ affectStrokeBoundsType("center") ], PathBox.prototype, "strokeAlign", void 0);
20822
+
20823
+ PathBox = __decorate([ registerUI() ], PathBox);
20824
+
20825
+ class ImageBoxData extends BoxData {
20826
+ get __urlType() {
20827
+ return "image";
20828
+ }
20829
+ setUrl(value) {
20830
+ this.__setImageFill(value);
20831
+ this._url = value;
20832
+ }
20833
+ __setImageFill(value) {
20834
+ this.fill = value ? {
20835
+ type: this.__urlType,
20836
+ mode: "stretch",
20837
+ url: value
20838
+ } : undefined;
20839
+ }
20840
+ __getData() {
20841
+ const data = super.__getData();
20842
+ if (data.url) delete data.fill;
20843
+ return data;
20844
+ }
20845
+ __getInputData(names, options) {
20846
+ const data = super.__getInputData(names, options);
20847
+ if (data.url) delete data.fill;
20848
+ return data;
20849
+ }
20850
+ }
20851
+
20852
+ let ImageBox = class ImageBox extends Box {
20853
+ get __tag() {
20854
+ return "ImageBox";
20855
+ }
20856
+ get ready() {
20857
+ const {image: image} = this;
20858
+ return image && image.ready;
20859
+ }
20860
+ get image() {
20861
+ const {fill: fill} = this.__;
20862
+ return isArray(fill) && fill[0].image;
20863
+ }
20864
+ get __useSelfBox() {
20865
+ return true;
20866
+ }
20867
+ };
20868
+
20869
+ __decorate([ dataProcessor(ImageBoxData) ], ImageBox.prototype, "__", void 0);
20870
+
20871
+ __decorate([ boundsType("") ], ImageBox.prototype, "url", void 0);
20872
+
20873
+ ImageBox = __decorate([ registerUI() ], ImageBox);
20874
+
20875
+ Plugin.add("box");
20876
+
20877
+ export { AlignHelper, Animate, AnimateEasing, AnimateEvent, AnimateList, Answer, App, AroundHelper, Arrow, ArrowData, AutoBounds, BezierHelper, Bounds, BoundsEvent, BoundsHelper, Box, BoxData, Branch, BranchHelper, BranchRender, Canvas, CanvasData, CanvasManager, ChildEvent, ColorConvert, Creator, Cursor, DataHelper, Debug, Direction4, Direction9, DragBoundsHelper, DragEvent, Dragger, DropEvent, EditBox, EditDataHelper, EditPoint, EditSelect, EditSelectHelper, EditTool, EditToolCreator, Editor, EditorEvent, EditorGroupEvent, EditorHelper, EditorMoveEvent, EditorRotateEvent, EditorScaleEvent, EditorSkewEvent, Effect, Ellipse, EllipseBox, EllipseBoxData, EllipseData, EllipseHelper, Event, EventCreator, Eventer, Export, FileHelper, Filter, Finder, Flow, FourNumberHelper, Frame, FrameData, Group, GroupData, HTMLText, HTMLTextData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageBox, ImageBoxData, 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, LeaferFilm, LeaferImage, LeaferTypeCreator, LeaferVideo, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, MyTouchEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathBox, PathBoxData, PathCommandDataHelper, PathCommandMap, PathCommandNodeHelper, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNodeHandleType, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonBox, PolygonBoxData, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, Scroller, SelectArea, Selector, Star, StarBox, StarBoxData, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TextEditor, TouchEvent, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, UnitConvertHelper, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, dimType, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, isFinite$1 as isFinite, isNull, isNumber, isObject, isString, isUndefined, layoutProcessor, leaferTransformAttrMap, maskType, motionPathType, naturalBoundsType, opacityType, path, pathInputType, pathType, pen, positionType, registerEditTool, registerInnerEditor, registerUI, registerUIEvent, resizeType, rewrite, rewriteAble, rotationType, scaleResize, scaleResizeFontSize, scaleResizeGroup, scaleResizePath, scaleResizePoints, scaleType, scrollType, sortType, stateStyleType, stateType, strokeType, surfaceType, tempBounds$3 as tempBounds, tempMatrix$2 as tempMatrix, tempPoint$4 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };