@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.
package/dist/worker.cjs CHANGED
@@ -42,6 +42,8 @@ var scroller = require("@leafer-in/scroller");
42
42
 
43
43
  var scaleFixed = require("@leafer-in/scale-fixed");
44
44
 
45
+ var box = require("@leafer-in/box");
46
+
45
47
  exports.PathNodeHandleType = void 0;
46
48
 
47
49
  (function(PathNodeHandleType) {
@@ -239,3 +241,12 @@ Object.keys(scaleFixed).forEach(function(k) {
239
241
  }
240
242
  });
241
243
  });
244
+
245
+ Object.keys(box).forEach(function(k) {
246
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
247
+ enumerable: true,
248
+ get: function() {
249
+ return box[k];
250
+ }
251
+ });
252
+ });
@@ -40,6 +40,8 @@ export * from "@leafer-in/scroller";
40
40
 
41
41
  export * from "@leafer-in/scale-fixed";
42
42
 
43
+ export * from "@leafer-in/box";
44
+
43
45
  var PathNodeHandleType;
44
46
 
45
47
  (function(PathNodeHandleType) {
@@ -1,2 +1,2 @@
1
- export*from"@leafer-ui/worker";export*from"@leafer-in/editor";export*from"@leafer-in/text-editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";export*from"@leafer-in/html";export*from"@leafer-in/arrow";export*from"@leafer-in/flow";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/state";export*from"@leafer-in/robot";export*from"@leafer-in/find";export*from"@leafer-in/export";export*from"@leafer-in/filter";export*from"@leafer-in/color";export*from"@leafer-in/resize";export*from"@leafer-in/bright";export*from"@leafer-in/scroller";export*from"@leafer-in/scale-fixed";var r;!function(r){r[r.none=1]="none",r[r.free=2]="free",r[r.mirrorAngle=3]="mirrorAngle",r[r.mirror=4]="mirror"}(r||(r={}));export{r as PathNodeHandleType};
1
+ export*from"@leafer-ui/worker";export*from"@leafer-in/editor";export*from"@leafer-in/text-editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";export*from"@leafer-in/html";export*from"@leafer-in/arrow";export*from"@leafer-in/flow";export*from"@leafer-in/animate";export*from"@leafer-in/motion-path";export*from"@leafer-in/state";export*from"@leafer-in/robot";export*from"@leafer-in/find";export*from"@leafer-in/export";export*from"@leafer-in/filter";export*from"@leafer-in/color";export*from"@leafer-in/resize";export*from"@leafer-in/bright";export*from"@leafer-in/scroller";export*from"@leafer-in/scale-fixed";export*from"@leafer-in/box";var r;!function(r){r[r.none=1]="none",r[r.free=2]="free",r[r.mirrorAngle=3]="mirrorAngle",r[r.mirror=4]="mirror"}(r||(r={}));export{r as PathNodeHandleType};
2
2
  //# sourceMappingURL=worker.esm.min.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.esm.min.js","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"upBA4HYA,GAAZ,SAAYA,GACRA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA,QACH,CALD,CAAYA,IAAAA,EAAkB,CAAA"}
1
+ {"version":3,"file":"worker.esm.min.js","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"mrBA4HYA,GAAZ,SAAYA,GACRA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA,QACH,CALD,CAAYA,IAAAA,EAAkB,CAAA"}
package/dist/worker.js CHANGED
@@ -2607,10 +2607,10 @@ var LeaferUI = function(exports) {
2607
2607
  const centerY = y1 + c * sin$4(startRadian + totalRadian / 2 + PI_2 * sign);
2608
2608
  startRadian -= PI_2 * sign;
2609
2609
  endRadian -= PI_2 * sign;
2610
- return ellipse$6(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2610
+ return ellipse$8(data, centerX, centerY, radius, radius, 0, startRadian / OneRadian, endRadian / OneRadian, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2611
2611
  },
2612
2612
  arc(data, x, y, radius, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2613
- return ellipse$6(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2613
+ return ellipse$8(data, x, y, radius, radius, 0, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint);
2614
2614
  },
2615
2615
  ellipse(data, cx, cy, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise, setPointBounds, setEndPoint, setStartPoint) {
2616
2616
  const rotationRadian = rotation * OneRadian;
@@ -2711,9 +2711,9 @@ var LeaferUI = function(exports) {
2711
2711
  return 3 * o * o * (v1 - fromV) + 6 * o * t * (v2 - v1) + 3 * t * t * (toV - v2);
2712
2712
  }
2713
2713
  };
2714
- const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$6} = BezierHelper;
2714
+ const {getPointAndSet: getPointAndSet, toTwoPointBounds: toTwoPointBounds$1, ellipse: ellipse$8} = BezierHelper;
2715
2715
  const {sin: sin$3, cos: cos$3, sqrt: sqrt$2, atan2: atan2} = Math;
2716
- const {ellipse: ellipse$5} = BezierHelper;
2716
+ const {ellipse: ellipse$7} = BezierHelper;
2717
2717
  const EllipseHelper = {
2718
2718
  ellipticalArc(data, fromX, fromY, radiusX, radiusY, rotation, largeFlag, sweepFlag, toX, toY, curveMode) {
2719
2719
  const halfX = (toX - fromX) / 2;
@@ -2750,7 +2750,7 @@ var LeaferUI = function(exports) {
2750
2750
  const centerY = fromY + halfY + rotationSin * cx + rotationCos * cy;
2751
2751
  const anticlockwise = totalRadian < 0 ? 1 : 0;
2752
2752
  if (curveMode || Platform.ellipseToCurve) {
2753
- ellipse$5(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2753
+ ellipse$7(data, centerX, centerY, radiusX, radiusY, rotation, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
2754
2754
  } else {
2755
2755
  if (radiusX === radiusY && !rotation) {
2756
2756
  data.push(PathCommandMap.O, centerX, centerY, radiusX, startRadian / OneRadian, endRadian / OneRadian, anticlockwise);
@@ -2769,7 +2769,7 @@ var LeaferUI = function(exports) {
2769
2769
  }
2770
2770
  };
2771
2771
  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;
2772
- const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$4, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2772
+ const {rect: rect$3, roundRect: roundRect$2, arcTo: arcTo$3, arc: arc$3, ellipse: ellipse$6, quadraticCurveTo: quadraticCurveTo$1} = BezierHelper;
2773
2773
  const {ellipticalArc: ellipticalArc} = EllipseHelper;
2774
2774
  const debug$f = Debug.get("PathConvert");
2775
2775
  const setEndPoint$1 = {};
@@ -2998,14 +2998,14 @@ var LeaferUI = function(exports) {
2998
2998
  break;
2999
2999
 
3000
3000
  case G$5:
3001
- 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);
3001
+ 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);
3002
3002
  x = setEndPoint$1.x;
3003
3003
  y = setEndPoint$1.y;
3004
3004
  i += 9;
3005
3005
  break;
3006
3006
 
3007
3007
  case F$6:
3008
- 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);
3008
+ 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);
3009
3009
  x = old[i + 1] + old[i + 3];
3010
3010
  y = old[i + 2];
3011
3011
  i += 5;
@@ -3153,7 +3153,7 @@ var LeaferUI = function(exports) {
3153
3153
  drawEllipse(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3154
3154
  BezierHelper.ellipse(null, x, y, radiusX, radiusY, isNull(rotation) ? 0 : rotation, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
3155
3155
  data.push(M$8, startPoint.x, startPoint.y);
3156
- ellipse$3(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3156
+ ellipse$5(data, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3157
3157
  },
3158
3158
  drawArc(data, x, y, radius, startAngle, endAngle, anticlockwise) {
3159
3159
  BezierHelper.arc(null, x, y, radius, isNull(startAngle) ? 0 : startAngle, isNull(endAngle) ? 360 : endAngle, anticlockwise, null, null, startPoint);
@@ -3164,8 +3164,8 @@ var LeaferUI = function(exports) {
3164
3164
  BezierHelper.points(data, points, curve, close);
3165
3165
  }
3166
3166
  };
3167
- const {ellipse: ellipse$3, arc: arc$2} = PathCommandDataHelper;
3168
- 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;
3167
+ const {ellipse: ellipse$5, arc: arc$2} = PathCommandDataHelper;
3168
+ 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;
3169
3169
  class PathCreator {
3170
3170
  set path(value) {
3171
3171
  this.__path = value;
@@ -3221,7 +3221,7 @@ var LeaferUI = function(exports) {
3221
3221
  return this;
3222
3222
  }
3223
3223
  ellipse(x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise) {
3224
- ellipse$2(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3224
+ ellipse$4(this.__path, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise);
3225
3225
  this.paint();
3226
3226
  return this;
3227
3227
  }
@@ -3338,7 +3338,7 @@ var LeaferUI = function(exports) {
3338
3338
  }
3339
3339
  };
3340
3340
  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;
3341
- const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$1} = BezierHelper;
3341
+ const {toTwoPointBounds: toTwoPointBounds, toTwoPointBoundsByQuadraticCurve: toTwoPointBoundsByQuadraticCurve, arcTo: arcTo$1, arc: arc, ellipse: ellipse$3} = BezierHelper;
3342
3342
  const {addPointBounds: addPointBounds, copy: copy$9, addPoint: addPoint$1, setPoint: setPoint$3, addBounds: addBounds, toBounds: toBounds$2} = TwoPointBoundsHelper;
3343
3343
  const debug$d = Debug.get("PathBounds");
3344
3344
  let radius, radiusX, radiusY;
@@ -3414,7 +3414,7 @@ var LeaferUI = function(exports) {
3414
3414
  break;
3415
3415
 
3416
3416
  case G$2:
3417
- 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);
3417
+ 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);
3418
3418
  i === 0 ? copy$9(setPointBounds, tempPointBounds) : addPointBounds(setPointBounds, tempPointBounds);
3419
3419
  x = setEndPoint.x;
3420
3420
  y = setEndPoint.y;
@@ -5289,7 +5289,7 @@ var LeaferUI = function(exports) {
5289
5289
  }
5290
5290
  }
5291
5291
  static emitWorld(leaf) {
5292
- if (leaf.leaferIsReady) leaf.emit(WORLD, this);
5292
+ if (leaf.leaferIsReady) leaf.emit(WORLD, leaf);
5293
5293
  }
5294
5294
  }
5295
5295
  BoundsEvent.RESIZE = "bounds.resize";
@@ -6175,14 +6175,16 @@ var LeaferUI = function(exports) {
6175
6175
  relative.innerToWorld(world, to, distance);
6176
6176
  world = to ? to : world;
6177
6177
  }
6178
- toInnerPoint(this.scrollWorldTransform, world, to, distance);
6178
+ toInnerPoint(this.worldTransform, world, to, distance);
6179
6179
  }
6180
6180
  innerToWorld(inner, to, distance, relative) {
6181
- toOuterPoint(this.scrollWorldTransform, inner, to, distance);
6181
+ toOuterPoint(this.worldTransform, inner, to, distance);
6182
6182
  if (relative) relative.worldToInner(to ? to : inner, null, distance);
6183
6183
  }
6184
6184
  getBoxPoint(world, relative, distance, change) {
6185
- return this.getBoxPointByInner(this.getInnerPoint(world, relative, distance, change), null, null, true);
6185
+ const inner = this.getInnerPoint(world, relative, distance, change);
6186
+ if (distance) return inner;
6187
+ return this.getBoxPointByInner(inner, null, null, true);
6186
6188
  }
6187
6189
  getBoxPointByInner(inner, _relative, _distance, change) {
6188
6190
  const point = change ? inner : Object.assign({}, inner), {x: x, y: y} = this.boxBounds;
@@ -6635,7 +6637,7 @@ var LeaferUI = function(exports) {
6635
6637
  this.levelMap = null;
6636
6638
  }
6637
6639
  }
6638
- const version = "2.0.3";
6640
+ const version = "2.0.4";
6639
6641
  class LeaferCanvas extends LeaferCanvasBase {
6640
6642
  get allowBackgroundColor() {
6641
6643
  return true;
@@ -7756,7 +7758,11 @@ var LeaferUI = function(exports) {
7756
7758
  }
7757
7759
  }
7758
7760
  class PolygonData extends LineData {}
7759
- class StarData extends UIData {}
7761
+ class StarData extends UIData {
7762
+ get __boxStroke() {
7763
+ return !this.__pathInputed;
7764
+ }
7765
+ }
7760
7766
  class PathData extends UIData {
7761
7767
  get __pathInputed() {
7762
7768
  return 2;
@@ -8661,6 +8667,9 @@ var LeaferUI = function(exports) {
8661
8667
  get isBranchLeaf() {
8662
8668
  return true;
8663
8669
  }
8670
+ get __useSelfBox() {
8671
+ return this.pathInputed;
8672
+ }
8664
8673
  constructor(data) {
8665
8674
  super(data);
8666
8675
  this.__layout.renderChanged || this.__layout.renderChange();
@@ -8676,7 +8685,7 @@ var LeaferUI = function(exports) {
8676
8685
  }
8677
8686
  __updateRectBoxBounds() {}
8678
8687
  __updateBoxBounds(_secondLayout) {
8679
- if (this.children.length && !this.pathInputed) {
8688
+ if (this.children.length && !this.__useSelfBox) {
8680
8689
  const data = this.__;
8681
8690
  if (data.__autoSide) {
8682
8691
  if (data.__hasSurface) this.__extraUpdate();
@@ -8765,7 +8774,7 @@ var LeaferUI = function(exports) {
8765
8774
  __decorate([ surfaceType("#FFFFFF") ], exports.Frame.prototype, "fill", void 0);
8766
8775
  __decorate([ affectRenderBoundsType("hide") ], exports.Frame.prototype, "overflow", void 0);
8767
8776
  exports.Frame = __decorate([ registerUI() ], exports.Frame);
8768
- const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse} = PathCommandDataHelper;
8777
+ const {moveTo: moveTo$3, closePath: closePath$2, ellipse: ellipse$2} = PathCommandDataHelper;
8769
8778
  exports.Ellipse = class Ellipse extends exports.UI {
8770
8779
  get __tag() {
8771
8780
  return "Ellipse";
@@ -8777,21 +8786,21 @@ var LeaferUI = function(exports) {
8777
8786
  let open;
8778
8787
  if (innerRadius) {
8779
8788
  if (startAngle || endAngle) {
8780
- if (innerRadius < 1) ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
8781
- ellipse(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
8789
+ if (innerRadius < 1) ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius, 0, startAngle, endAngle, false); else open = true;
8790
+ ellipse$2(path, rx, ry, rx, ry, 0, endAngle, startAngle, true);
8782
8791
  } else {
8783
8792
  if (innerRadius < 1) {
8784
- ellipse(path, rx, ry, rx * innerRadius, ry * innerRadius);
8793
+ ellipse$2(path, rx, ry, rx * innerRadius, ry * innerRadius);
8785
8794
  moveTo$3(path, width, ry);
8786
8795
  }
8787
- ellipse(path, rx, ry, rx, ry, 0, 360, 0, true);
8796
+ ellipse$2(path, rx, ry, rx, ry, 0, 360, 0, true);
8788
8797
  }
8789
8798
  } else {
8790
8799
  if (startAngle || endAngle) {
8791
8800
  moveTo$3(path, rx, ry);
8792
- ellipse(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
8801
+ ellipse$2(path, rx, ry, rx, ry, 0, startAngle, endAngle, false);
8793
8802
  } else {
8794
- ellipse(path, rx, ry, rx, ry);
8803
+ ellipse$2(path, rx, ry, rx, ry);
8795
8804
  }
8796
8805
  }
8797
8806
  if (!open) closePath$2(path);
@@ -10205,6 +10214,14 @@ var LeaferUI = function(exports) {
10205
10214
  stopDragAnimate() {
10206
10215
  this.dragger.stopAnimate();
10207
10216
  }
10217
+ replaceDownTarget(target) {
10218
+ const {downData: downData} = this;
10219
+ if (downData && target) {
10220
+ const {path: path} = downData;
10221
+ path.remove(path.list[0]);
10222
+ path.addAt(target, 0);
10223
+ }
10224
+ }
10208
10225
  updateDownData(data, options, merge) {
10209
10226
  const {downData: downData} = this;
10210
10227
  if (!data && downData) data = downData;
@@ -11212,7 +11229,7 @@ var LeaferUI = function(exports) {
11212
11229
  if (drawImage) {
11213
11230
  if (data.repeat) {
11214
11231
  drawImage = false;
11215
- } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" && ResizeEvent.isResizing(ui) || exporting)) {
11232
+ } else if (!(originPaint.changeful || paint.film || Platform.name === "miniapp" || exporting)) {
11216
11233
  drawImage = Platform.image.isLarge(image, scaleX, scaleY) || image.width * scaleX > 8096 || image.height * scaleY > 8096;
11217
11234
  }
11218
11235
  }
@@ -11692,7 +11709,7 @@ var LeaferUI = function(exports) {
11692
11709
  }, row = {
11693
11710
  words: []
11694
11711
  };
11695
- if (__letterSpacing) content = [ ...content ];
11712
+ content = [ ...content ];
11696
11713
  for (let i = 0, len = content.length; i < len; i++) {
11697
11714
  char = content[i];
11698
11715
  if (char === "\n") {
@@ -12127,10 +12144,10 @@ var LeaferUI = function(exports) {
12127
12144
  });
12128
12145
  if (isObject(check)) value = check; else if (check === false) return;
12129
12146
  }
12130
- const {dimOthers: dimOthers, bright: bright} = t.editBox.mergedConfig || t.config;
12131
- if (!isUndefined(dimOthers) || !isUndefined(bright)) {
12147
+ if (t.hasDimOthers) {
12132
12148
  t.setDimOthers(false);
12133
12149
  t.setBright(false);
12150
+ t.hasDimOthers = undefined;
12134
12151
  }
12135
12152
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
12136
12153
  if (t.single) {
@@ -13037,6 +13054,7 @@ var LeaferUI = function(exports) {
13037
13054
  if (!isUndefined(dimOthers) || !isUndefined(bright)) {
13038
13055
  editor.setDimOthers(dimOthers);
13039
13056
  editor.setBright(!!dimOthers || bright);
13057
+ editor.hasDimOthers = true;
13040
13058
  }
13041
13059
  if (spread) BoundsHelper.spread(bounds, spread);
13042
13060
  if (this.view.worldOpacity) {
@@ -13143,8 +13161,9 @@ var LeaferUI = function(exports) {
13143
13161
  onDragStart(e) {
13144
13162
  this.dragging = true;
13145
13163
  const point = this.dragPoint = e.current, {pointType: pointType} = point;
13146
- const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = this.mergeConfig;
13164
+ const {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, onCopy: onCopy} = this.mergeConfig;
13147
13165
  if (pointType === "move") {
13166
+ if (e.altKey && onCopy && onCopy() && this.editor.single) this.app.interaction.replaceDownTarget(this.target);
13148
13167
  moveable && (this.moving = true);
13149
13168
  } else {
13150
13169
  if (pointType.includes("rotate") || this.isHoldRotateKey(e) || !resizeable) {
@@ -13263,26 +13282,31 @@ var LeaferUI = function(exports) {
13263
13282
  updatePointCursor(this, e);
13264
13283
  }
13265
13284
  onArrow(e) {
13266
- if (this.canUse && this.mergeConfig.keyEvent) {
13285
+ if (this.canUse) {
13267
13286
  let x = 0, y = 0;
13268
- const distance = e.shiftKey ? 10 : 1;
13269
13287
  switch (e.code) {
13270
13288
  case "ArrowDown":
13271
- y = distance;
13289
+ y = 1;
13272
13290
  break;
13273
13291
 
13274
13292
  case "ArrowUp":
13275
- y = -distance;
13293
+ y = -1;
13276
13294
  break;
13277
13295
 
13278
13296
  case "ArrowLeft":
13279
- x = -distance;
13297
+ x = -1;
13280
13298
  break;
13281
13299
 
13282
13300
  case "ArrowRight":
13283
- x = distance;
13301
+ x = 1;
13302
+ }
13303
+ if (x || y) {
13304
+ const {keyEvent: keyEvent, arrowStep: arrowStep, arrowFastStep: arrowFastStep} = this.mergeConfig;
13305
+ if (keyEvent) {
13306
+ const step = e.shiftKey ? arrowFastStep : arrowStep;
13307
+ this.transformTool.move(x * step, y * step);
13308
+ }
13284
13309
  }
13285
- if (x || y) this.transformTool.move(x, y);
13286
13310
  }
13287
13311
  }
13288
13312
  onDoubleTap(e) {
@@ -13387,6 +13411,8 @@ var LeaferUI = function(exports) {
13387
13411
  pointSize: 10,
13388
13412
  pointRadius: 16,
13389
13413
  rotateGap: 45,
13414
+ arrowStep: 1,
13415
+ arrowFastStep: 10,
13390
13416
  buttonsDirection: "bottom",
13391
13417
  buttonsMargin: 12,
13392
13418
  hideOnSmall: true,
@@ -19196,6 +19222,106 @@ var LeaferUI = function(exports) {
19196
19222
  };
19197
19223
  Plugin.add("scale-fixed");
19198
19224
  exports.UI.addAttr("scaleFixed", undefined, scaleFixedType);
19225
+ class EllipseBoxData extends BoxData {}
19226
+ const ellipse$1 = exports.Ellipse.prototype;
19227
+ exports.EllipseBox = class EllipseBox extends exports.Box {
19228
+ get __tag() {
19229
+ return "EllipseBox";
19230
+ }
19231
+ __updatePath() {}
19232
+ };
19233
+ __decorate([ dataProcessor(EllipseBoxData) ], exports.EllipseBox.prototype, "__", void 0);
19234
+ __decorate([ pathType(0) ], exports.EllipseBox.prototype, "innerRadius", void 0);
19235
+ __decorate([ pathType(0) ], exports.EllipseBox.prototype, "startAngle", void 0);
19236
+ __decorate([ pathType(0) ], exports.EllipseBox.prototype, "endAngle", void 0);
19237
+ __decorate([ rewrite(ellipse$1.__updatePath) ], exports.EllipseBox.prototype, "__updatePath", null);
19238
+ exports.EllipseBox = __decorate([ rewriteAble(), registerUI() ], exports.EllipseBox);
19239
+ class PolygonBoxData extends BoxData {
19240
+ get __usePathBox() {
19241
+ return this.points || this.__pathInputed;
19242
+ }
19243
+ }
19244
+ const polygon = exports.Polygon.prototype;
19245
+ exports.PolygonBox = class PolygonBox extends exports.Box {
19246
+ get __tag() {
19247
+ return "PolygonBox";
19248
+ }
19249
+ __updatePath() {}
19250
+ };
19251
+ __decorate([ dataProcessor(PolygonBoxData) ], exports.PolygonBox.prototype, "__", void 0);
19252
+ __decorate([ pathType(3) ], exports.PolygonBox.prototype, "sides", void 0);
19253
+ __decorate([ pathType() ], exports.PolygonBox.prototype, "points", void 0);
19254
+ __decorate([ pathType(0) ], exports.PolygonBox.prototype, "curve", void 0);
19255
+ __decorate([ rewrite(polygon.__updatePath) ], exports.PolygonBox.prototype, "__updatePath", null);
19256
+ exports.PolygonBox = __decorate([ rewriteAble(), registerUI() ], exports.PolygonBox);
19257
+ class StarBoxData extends BoxData {}
19258
+ const ellipse = exports.Star.prototype;
19259
+ exports.StarBox = class StarBox extends exports.Box {
19260
+ get __tag() {
19261
+ return "StarBox";
19262
+ }
19263
+ __updatePath() {}
19264
+ };
19265
+ __decorate([ pathType(5) ], exports.StarBox.prototype, "corners", void 0);
19266
+ __decorate([ pathType(.382) ], exports.StarBox.prototype, "innerRadius", void 0);
19267
+ __decorate([ dataProcessor(StarBoxData) ], exports.StarBox.prototype, "__", void 0);
19268
+ __decorate([ rewrite(ellipse.__updatePath) ], exports.StarBox.prototype, "__updatePath", null);
19269
+ exports.StarBox = __decorate([ rewriteAble(), registerUI() ], exports.StarBox);
19270
+ class PathBoxData extends BoxData {}
19271
+ exports.PathBox = class PathBox extends exports.Box {
19272
+ get __tag() {
19273
+ return "PathBox";
19274
+ }
19275
+ };
19276
+ __decorate([ dataProcessor(PathBoxData) ], exports.PathBox.prototype, "__", void 0);
19277
+ __decorate([ affectStrokeBoundsType("center") ], exports.PathBox.prototype, "strokeAlign", void 0);
19278
+ exports.PathBox = __decorate([ registerUI() ], exports.PathBox);
19279
+ class ImageBoxData extends BoxData {
19280
+ get __urlType() {
19281
+ return "image";
19282
+ }
19283
+ setUrl(value) {
19284
+ this.__setImageFill(value);
19285
+ this._url = value;
19286
+ }
19287
+ __setImageFill(value) {
19288
+ this.fill = value ? {
19289
+ type: this.__urlType,
19290
+ mode: "stretch",
19291
+ url: value
19292
+ } : undefined;
19293
+ }
19294
+ __getData() {
19295
+ const data = super.__getData();
19296
+ if (data.url) delete data.fill;
19297
+ return data;
19298
+ }
19299
+ __getInputData(names, options) {
19300
+ const data = super.__getInputData(names, options);
19301
+ if (data.url) delete data.fill;
19302
+ return data;
19303
+ }
19304
+ }
19305
+ exports.ImageBox = class ImageBox extends exports.Box {
19306
+ get __tag() {
19307
+ return "ImageBox";
19308
+ }
19309
+ get ready() {
19310
+ const {image: image} = this;
19311
+ return image && image.ready;
19312
+ }
19313
+ get image() {
19314
+ const {fill: fill} = this.__;
19315
+ return isArray(fill) && fill[0].image;
19316
+ }
19317
+ get __useSelfBox() {
19318
+ return true;
19319
+ }
19320
+ };
19321
+ __decorate([ dataProcessor(ImageBoxData) ], exports.ImageBox.prototype, "__", void 0);
19322
+ __decorate([ boundsType("") ], exports.ImageBox.prototype, "url", void 0);
19323
+ exports.ImageBox = __decorate([ registerUI() ], exports.ImageBox);
19324
+ Plugin.add("box");
19199
19325
  exports.AlignHelper = AlignHelper;
19200
19326
  exports.AnimateEasing = AnimateEasing;
19201
19327
  exports.AnimateEvent = AnimateEvent;
@@ -19233,6 +19359,7 @@ var LeaferUI = function(exports) {
19233
19359
  exports.EditorScaleEvent = EditorScaleEvent;
19234
19360
  exports.EditorSkewEvent = EditorSkewEvent;
19235
19361
  exports.Effect = Effect;
19362
+ exports.EllipseBoxData = EllipseBoxData;
19236
19363
  exports.EllipseData = EllipseData;
19237
19364
  exports.EllipseHelper = EllipseHelper;
19238
19365
  exports.Event = Event;
@@ -19249,6 +19376,7 @@ var LeaferUI = function(exports) {
19249
19376
  exports.HighBezierHelper = HighBezierHelper;
19250
19377
  exports.HighCurveHelper = HighCurveHelper;
19251
19378
  exports.HitCanvasManager = HitCanvasManager;
19379
+ exports.ImageBoxData = ImageBoxData;
19252
19380
  exports.ImageData = ImageData;
19253
19381
  exports.ImageEvent = ImageEvent;
19254
19382
  exports.ImageManager = ImageManager;
@@ -19298,6 +19426,7 @@ var LeaferUI = function(exports) {
19298
19426
  exports.PathArrow = PathArrow;
19299
19427
  exports.PathArrowModule = PathArrowModule;
19300
19428
  exports.PathBounds = PathBounds;
19429
+ exports.PathBoxData = PathBoxData;
19301
19430
  exports.PathCommandDataHelper = PathCommandDataHelper;
19302
19431
  exports.PathCommandMap = PathCommandMap;
19303
19432
  exports.PathCommandNodeHelper = PathCommandNodeHelper;
@@ -19318,6 +19447,7 @@ var LeaferUI = function(exports) {
19318
19447
  exports.Point = Point;
19319
19448
  exports.PointHelper = PointHelper;
19320
19449
  exports.PointerButton = PointerButton;
19450
+ exports.PolygonBoxData = PolygonBoxData;
19321
19451
  exports.PolygonData = PolygonData;
19322
19452
  exports.PropertyEvent = PropertyEvent;
19323
19453
  exports.RectData = RectData;
@@ -19333,6 +19463,7 @@ var LeaferUI = function(exports) {
19333
19463
  exports.Scroller = Scroller;
19334
19464
  exports.SelectArea = SelectArea;
19335
19465
  exports.Selector = Selector;
19466
+ exports.StarBoxData = StarBoxData;
19336
19467
  exports.StarData = StarData;
19337
19468
  exports.State = State;
19338
19469
  exports.StringNumberMap = StringNumberMap;
@@ -1,2 +1,2 @@
1
- "use strict";var e,r=require("@leafer-ui/worker"),t=require("@leafer-in/editor"),o=require("@leafer-in/text-editor"),n=require("@leafer-in/viewport"),c=require("@leafer-in/view"),a=require("@leafer-in/scroll"),p=require("@leafer-in/html"),f=require("@leafer-in/arrow"),u=require("@leafer-in/flow"),i=require("@leafer-in/animate"),l=require("@leafer-in/motion-path"),s=require("@leafer-in/state"),y=require("@leafer-in/robot"),b=require("@leafer-in/find"),O=require("@leafer-in/export"),j=require("@leafer-in/filter"),d=require("@leafer-in/color"),h=require("@leafer-in/resize"),x=require("@leafer-in/bright"),P=require("@leafer-in/scroller"),m=require("@leafer-in/scale-fixed");exports.PathNodeHandleType=void 0,(e=exports.PathNodeHandleType||(exports.PathNodeHandleType={}))[e.none=1]="none",e[e.free=2]="free",e[e.mirrorAngle=3]="mirrorAngle",e[e.mirror=4]="mirror",Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(c).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(a).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(p).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(f).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(u).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(l).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(s).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(y).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(b).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(O).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(j).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})}),Object.keys(d).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})}),Object.keys(h).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[e]}})}),Object.keys(x).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return x[e]}})}),Object.keys(P).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return P[e]}})}),Object.keys(m).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return m[e]}})});
1
+ "use strict";var e,r=require("@leafer-ui/worker"),t=require("@leafer-in/editor"),o=require("@leafer-in/text-editor"),n=require("@leafer-in/viewport"),c=require("@leafer-in/view"),a=require("@leafer-in/scroll"),p=require("@leafer-in/html"),f=require("@leafer-in/arrow"),u=require("@leafer-in/flow"),i=require("@leafer-in/animate"),l=require("@leafer-in/motion-path"),s=require("@leafer-in/state"),b=require("@leafer-in/robot"),y=require("@leafer-in/find"),O=require("@leafer-in/export"),j=require("@leafer-in/filter"),d=require("@leafer-in/color"),x=require("@leafer-in/resize"),h=require("@leafer-in/bright"),P=require("@leafer-in/scroller"),m=require("@leafer-in/scale-fixed"),w=require("@leafer-in/box");exports.PathNodeHandleType=void 0,(e=exports.PathNodeHandleType||(exports.PathNodeHandleType={}))[e.none=1]="none",e[e.free=2]="free",e[e.mirrorAngle=3]="mirrorAngle",e[e.mirror=4]="mirror",Object.keys(r).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return r[e]}})}),Object.keys(t).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return t[e]}})}),Object.keys(o).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return o[e]}})}),Object.keys(n).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return n[e]}})}),Object.keys(c).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return c[e]}})}),Object.keys(a).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return a[e]}})}),Object.keys(p).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return p[e]}})}),Object.keys(f).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return f[e]}})}),Object.keys(u).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})}),Object.keys(i).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return i[e]}})}),Object.keys(l).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return l[e]}})}),Object.keys(s).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return s[e]}})}),Object.keys(b).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return b[e]}})}),Object.keys(y).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return y[e]}})}),Object.keys(O).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return O[e]}})}),Object.keys(j).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return j[e]}})}),Object.keys(d).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})}),Object.keys(x).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return x[e]}})}),Object.keys(h).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[e]}})}),Object.keys(P).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return P[e]}})}),Object.keys(m).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return m[e]}})}),Object.keys(w).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return w[e]}})});
2
2
  //# sourceMappingURL=worker.min.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"worker.min.cjs","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"iBA4HYA,qpBAAAA,QAAAA,wBAAAA,GAAAA,EAAAA,QAAAA,qBAAAA,2BAAkB,CAAA,IAC1BA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA"}
1
+ {"version":3,"file":"worker.min.cjs","sources":["../../../../../../../src/leafer/packages/interface/src/path/IPathCommand.ts"],"sourcesContent":["import { IPointData } from '../math/IMath'\n\ntype Command = number\ntype x = number\ntype y = number\ntype x1 = number\ntype y1 = number\ntype x2 = number\ntype y2 = number\ntype radiusX = number\ntype radiusY = number\ntype xAxisRotation = number\ntype largeArcFlag = number\ntype sweepFlag = number\n\n\nexport type MCommandData = [Command, x, y]\nexport type HCommandData = [Command, x]\nexport type VCommandData = [Command, y]\nexport type LCommandData = MCommandData\n\nexport type CCommandData = [Command, x1, y1, x2, y2, x, y]\nexport type SCommandData = [Command, x2, y2, x, y]\n\nexport type QCommandData = [Command, x1, y1, x, y]\nexport type TCommandData = [Command, x, y]\n\nexport type ZCommandData = [Command]\n\nexport type ACommandData = [Command, radiusX, radiusY, xAxisRotation, largeArcFlag, sweepFlag, x, y]\n\n\n// 非svg标准的canvas绘图命令\ntype width = number\ntype height = number\ntype rotation = number\ntype startAngle = number\ntype endAngle = number\ntype anticlockwise = boolean\ntype cornerRadius = number | number[]\ntype radius = number\n\nexport type RectCommandData = [Command, x, y, width, height]\nexport type RoundRectCommandData = [Command, x, y, width, height, cornerRadius]\nexport type EllipseCommandData = [Command, x, y, radiusX, radiusY, rotation, startAngle, endAngle, anticlockwise]\nexport type ArcCommandData = [Command, x, y, radius, startAngle, endAngle, anticlockwise]\nexport type ArcToCommandData = [Command, x1, y1, x2, y2, radius]\n\n\nexport type CanvasPathCommand = 1 | 2 | 5 | 7 | 11 // M | L | C | Q | Z canvas可以绘制的命令\n\nexport type IPathCommandData = number[] // ...(MCommandData | LCommandData | CCommandData | QCommandData | ZCommandData)\n\n\n// 路径命令对象\nexport interface MoveToCommandObject {\n name: 'M'\n x: number\n y: number\n}\nexport interface LineToCommandObject {\n name: 'L'\n x: number\n y: number\n}\n\nexport interface BezierCurveToCommandObject {\n name: 'C'\n x1: number\n y1: number\n x2: number\n y2: number\n x: number\n y: number\n}\n\nexport interface QuadraticCurveToCommandObject {\n name: 'Q'\n x1: number\n y1: number\n x: number\n y: number\n}\n\nexport interface ClosePathCommandObject {\n name: 'Z'\n}\n\nexport type IPathCommandObject = MoveToCommandObject | LineToCommandObject | BezierCurveToCommandObject | QuadraticCurveToCommandObject | ClosePathCommandObject // M | L | C | Q | Z canvas可以绘制的命令\n\n\n// 可视化路径节点\n\nexport interface IPathCommandNodeBase {\n name: 'M^' | 'L^' | 'C^' | 'Z^'\n x: number\n y: number\n a?: IPointData // 第一个手柄,连接上一个节点\n b?: IPointData // 第二个手柄,连接下一个节点\n ab?: PathNodeHandleType // 手柄类型\n}\n\nexport interface MoveToCommandNode extends IPathCommandNodeBase {\n name: 'M^'\n}\nexport interface LineToCommandNode extends IPathCommandNodeBase {\n name: 'L^'\n}\n\nexport interface BezierCurveToCommandNode extends IPathCommandNodeBase {\n name: 'C^'\n}\n\nexport interface ClosePathCommandNode {\n name: 'Z^'\n x?: number\n y?: number\n a?: IPointData\n b?: IPointData\n ab?: PathNodeHandleType\n}\n\nexport type IPathCommandNode = MoveToCommandNode | LineToCommandNode | BezierCurveToCommandNode | ClosePathCommandNode // M | L | C | Z 路径节点命令(适合可视化编辑)\n\nexport enum PathNodeHandleType { // 手柄类型\n none = 1, // 无手柄\n free = 2, // 每个手柄自由控制\n mirrorAngle = 3, // 仅镜像角度\n mirror = 4, // 镜像角度和长度\n}\n\nexport type PathNodeHandleName = 'a' | 'b' // 手柄名称\n\nexport interface IPathNodeBase {\n pathNode: IPathCommandNode\n}"],"names":["PathNodeHandleType"],"mappings":"iBA4HYA,irBAAAA,QAAAA,wBAAAA,GAAAA,EAAAA,QAAAA,qBAAAA,2BAAkB,CAAA,IAC1BA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,KAAA,GAAA,OACAA,EAAAA,EAAA,YAAA,GAAA,cACAA,EAAAA,EAAA,OAAA,GAAA"}