@leafer/worker 1.9.6 → 1.9.7

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
@@ -36,6 +36,8 @@ var color = require("@leafer-in/color");
36
36
 
37
37
  var resize = require("@leafer-in/resize");
38
38
 
39
+ var bright = require("@leafer-in/bright");
40
+
39
41
  Object.keys(worker).forEach(function(k) {
40
42
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
41
43
  enumerable: true,
@@ -197,3 +199,12 @@ Object.keys(resize).forEach(function(k) {
197
199
  }
198
200
  });
199
201
  });
202
+
203
+ Object.keys(bright).forEach(function(k) {
204
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
205
+ enumerable: true,
206
+ get: function() {
207
+ return bright[k];
208
+ }
209
+ });
210
+ });
@@ -33,3 +33,5 @@ export * from "@leafer-in/filter";
33
33
  export * from "@leafer-in/color";
34
34
 
35
35
  export * from "@leafer-in/resize";
36
+
37
+ export * from "@leafer-in/bright";
@@ -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";
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";
2
2
  //# sourceMappingURL=worker.esm.min.js.map
package/dist/worker.js CHANGED
@@ -392,6 +392,15 @@ var LeaferUI = function(exports) {
392
392
  t.c *= scaleY;
393
393
  t.d *= scaleY;
394
394
  },
395
+ pixelScale(t, pixelRatio, to) {
396
+ to || (to = t);
397
+ to.a = t.a * pixelRatio;
398
+ to.b = t.b * pixelRatio;
399
+ to.c = t.c * pixelRatio;
400
+ to.d = t.d * pixelRatio;
401
+ to.e = t.e * pixelRatio;
402
+ to.f = t.f * pixelRatio;
403
+ },
395
404
  scaleOfOuter(t, origin, scaleX, scaleY) {
396
405
  M$a.toInnerPoint(t, origin, tempPoint$4);
397
406
  M$a.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
@@ -882,6 +891,10 @@ var LeaferUI = function(exports) {
882
891
  this.scaleY *= y || x;
883
892
  return this;
884
893
  }
894
+ pixelScale(pixelRatio) {
895
+ MatrixHelper.pixelScale(this, pixelRatio);
896
+ return this;
897
+ }
885
898
  scaleOfOuter(origin, x, y) {
886
899
  MatrixHelper.scaleOfOuter(this, origin, x, y);
887
900
  return this;
@@ -1991,7 +2004,7 @@ var LeaferUI = function(exports) {
1991
2004
  __decorate([ contextMethod() ], Canvas.prototype, "fillText", null);
1992
2005
  __decorate([ contextMethod() ], Canvas.prototype, "measureText", null);
1993
2006
  __decorate([ contextMethod() ], Canvas.prototype, "strokeText", null);
1994
- const {copy: copy$b, multiplyParent: multiplyParent$4} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2007
+ const {copy: copy$b, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
1995
2008
  const minSize = {
1996
2009
  width: 1,
1997
2010
  height: 1,
@@ -2089,12 +2102,7 @@ var LeaferUI = function(exports) {
2089
2102
  setWorld(matrix, parentMatrix) {
2090
2103
  const {pixelRatio: pixelRatio, pixelSnap: pixelSnap} = this, w = this.worldTransform;
2091
2104
  if (parentMatrix) multiplyParent$4(matrix, parentMatrix, w);
2092
- w.a = matrix.a * pixelRatio;
2093
- w.b = matrix.b * pixelRatio;
2094
- w.c = matrix.c * pixelRatio;
2095
- w.d = matrix.d * pixelRatio;
2096
- w.e = matrix.e * pixelRatio;
2097
- w.f = matrix.f * pixelRatio;
2105
+ pixelScale(matrix, pixelRatio, w);
2098
2106
  if (pixelSnap) {
2099
2107
  if (matrix.half && matrix.half * pixelRatio % 2) w.e = round$4(w.e - .5) + .5, w.f = round$4(w.f - .5) + .5; else w.e = round$4(w.e),
2100
2108
  w.f = round$4(w.f);
@@ -4008,6 +4016,17 @@ var LeaferUI = function(exports) {
4008
4016
  }
4009
4017
  }));
4010
4018
  }
4019
+ function dimType(defaultValue) {
4020
+ return decorateLeafAttr(defaultValue, key => attr({
4021
+ set(value) {
4022
+ if (this.__setAttr(key, value)) {
4023
+ const data = this.__;
4024
+ DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
4025
+ this.__layout.surfaceChange();
4026
+ }
4027
+ }
4028
+ }));
4029
+ }
4011
4030
  function opacityType(defaultValue) {
4012
4031
  return decorateLeafAttr(defaultValue, key => attr({
4013
4032
  set(value) {
@@ -4048,7 +4067,7 @@ var LeaferUI = function(exports) {
4048
4067
  return decorateLeafAttr(defaultValue, key => attr({
4049
4068
  set(value) {
4050
4069
  if (this.__setAttr(key, value)) {
4051
- this.__layout.surfaceChanged || this.__layout.surfaceChange();
4070
+ this.__layout.surfaceChange();
4052
4071
  this.waitParent(() => {
4053
4072
  this.parent.__layout.childrenSortChange();
4054
4073
  });
@@ -4082,7 +4101,7 @@ var LeaferUI = function(exports) {
4082
4101
  set(value) {
4083
4102
  if (this.__setAttr(key, value)) {
4084
4103
  this.__layout.hitCanvasChanged = true;
4085
- if (Debug.showBounds === "hit") this.__layout.surfaceChanged || this.__layout.surfaceChange();
4104
+ if (Debug.showBounds === "hit") this.__layout.surfaceChange();
4086
4105
  if (this.leafer) this.leafer.updateCursor();
4087
4106
  }
4088
4107
  }
@@ -5480,6 +5499,7 @@ var LeaferUI = function(exports) {
5480
5499
  if (options.shape) return this.__renderShape(canvas, options);
5481
5500
  if (this.__worldOpacity) {
5482
5501
  const data = this.__;
5502
+ if (data.bright && !options.topRendering) return options.topList.add(this);
5483
5503
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5484
5504
  canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
5485
5505
  if (this.__.__single) {
@@ -5526,7 +5546,9 @@ var LeaferUI = function(exports) {
5526
5546
  this.__nowWorld = this.__getNowWorld(options);
5527
5547
  if (this.__worldOpacity) {
5528
5548
  const data = this.__;
5529
- if (data.dim) options.dimOpacity = data.dim === true ? .2 : data.dim; else if (data.dimskip) options.dimOpacity && (options.dimOpacity = 0);
5549
+ if (data.__useDim) {
5550
+ if (data.dim) options.dimOpacity = data.dim === true ? .2 : data.dim; else if (data.bright && !options.topRendering) return options.topList.add(this); else if (data.dimskip) options.dimOpacity && (options.dimOpacity = 0);
5551
+ }
5530
5552
  if (data.__single && !this.isBranchLeaf) {
5531
5553
  if (data.eraser === "path") return this.__renderEraser(canvas, options);
5532
5554
  const tempCanvas = canvas.getSameCanvas(false, true);
@@ -6351,7 +6373,7 @@ var LeaferUI = function(exports) {
6351
6373
  this.levelMap = null;
6352
6374
  }
6353
6375
  }
6354
- const version = "1.9.6";
6376
+ const version = "1.9.7";
6355
6377
  class LeaferCanvas extends LeaferCanvasBase {
6356
6378
  get allowBackgroundColor() {
6357
6379
  return true;
@@ -6878,7 +6900,7 @@ var LeaferUI = function(exports) {
6878
6900
  };
6879
6901
  if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
6880
6902
  if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds);
6881
- this.target.__render(canvas, options);
6903
+ Platform.render(this.target, canvas, options);
6882
6904
  this.renderBounds = realBounds = realBounds || bounds;
6883
6905
  this.renderOptions = options;
6884
6906
  this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
@@ -7147,6 +7169,14 @@ var LeaferUI = function(exports) {
7147
7169
  selector: (target, options) => new Selector(target, options)
7148
7170
  });
7149
7171
  Platform.layout = Layouter.fullLayout;
7172
+ Platform.render = function(target, canvas, options) {
7173
+ const topOptions = Object.assign(Object.assign({}, options), {
7174
+ topRendering: true
7175
+ });
7176
+ options.topList = new LeafList;
7177
+ target.__render(canvas, options);
7178
+ if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
7179
+ };
7150
7180
  function effectType(defaultValue) {
7151
7181
  return decorateLeafAttr(defaultValue, key => attr({
7152
7182
  set(value) {
@@ -7864,8 +7894,8 @@ var LeaferUI = function(exports) {
7864
7894
  __decorate([ opacityType(1) ], exports.UI.prototype, "opacity", void 0);
7865
7895
  __decorate([ visibleType(true) ], exports.UI.prototype, "visible", void 0);
7866
7896
  __decorate([ surfaceType(false) ], exports.UI.prototype, "locked", void 0);
7867
- __decorate([ surfaceType(false) ], exports.UI.prototype, "dim", void 0);
7868
- __decorate([ surfaceType(false) ], exports.UI.prototype, "dimskip", void 0);
7897
+ __decorate([ dimType(false) ], exports.UI.prototype, "dim", void 0);
7898
+ __decorate([ dimType(false) ], exports.UI.prototype, "dimskip", void 0);
7869
7899
  __decorate([ sortType(0) ], exports.UI.prototype, "zIndex", void 0);
7870
7900
  __decorate([ maskType(false) ], exports.UI.prototype, "mask", void 0);
7871
7901
  __decorate([ eraserType(false) ], exports.UI.prototype, "eraser", void 0);
@@ -11670,12 +11700,15 @@ var LeaferUI = function(exports) {
11670
11700
  set(value) {
11671
11701
  const old = this[privateKey];
11672
11702
  if (old !== value) {
11673
- if (this.config) {
11703
+ const t = this;
11704
+ if (t.config) {
11674
11705
  const isSelect = key === "target";
11675
11706
  if (isSelect) {
11707
+ t.setDimOthers(false);
11708
+ t.setBright(false);
11676
11709
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
11677
- if (this.single) this.element.syncEventer = null;
11678
- const {beforeSelect: beforeSelect} = this.config;
11710
+ if (t.single) t.element.syncEventer = null;
11711
+ const {beforeSelect: beforeSelect} = t.config;
11679
11712
  if (beforeSelect) {
11680
11713
  const check = beforeSelect({
11681
11714
  target: value
@@ -11685,7 +11718,7 @@ var LeaferUI = function(exports) {
11685
11718
  }
11686
11719
  const type = isSelect ? EditorEvent.BEFORE_SELECT : EditorEvent.BEFORE_HOVER;
11687
11720
  if (this.hasEvent(type)) this.emitEvent(new EditorEvent(type, {
11688
- editor: this,
11721
+ editor: t,
11689
11722
  value: value,
11690
11723
  oldValue: old
11691
11724
  }));
@@ -12335,13 +12368,18 @@ var LeaferUI = function(exports) {
12335
12368
  function updatePointCursor(editBox, e) {
12336
12369
  const {enterPoint: point, dragging: dragging, skewing: skewing, resizing: resizing, flippedX: flippedX, flippedY: flippedY} = editBox;
12337
12370
  if (!point || !editBox.editor.editing || !editBox.canUse) return;
12371
+ if (point.name === "rect") return updateMoveCursor(editBox);
12338
12372
  if (point.name === "circle") return;
12339
- if (point.pointType === "button") {
12373
+ let {rotation: rotation} = editBox;
12374
+ const {pointType: pointType} = point, {moveCursor: moveCursor, resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
12375
+ if (pointType === "move") {
12376
+ point.cursor = moveCursor;
12377
+ if (!moveable) point.visible = false;
12378
+ return;
12379
+ } else if (pointType === "button") {
12340
12380
  if (!point.cursor) point.cursor = "pointer";
12341
12381
  return;
12342
12382
  }
12343
- let {rotation: rotation} = editBox;
12344
- const {pointType: pointType} = point, {resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
12345
12383
  let showResize = pointType.includes("resize");
12346
12384
  if (showResize && rotateable && (editBox.isHoldRotateKey(e) || !resizeable)) showResize = false;
12347
12385
  const showSkew = skewable && !showResize && (point.name === "resize-line" || pointType === "skew");
@@ -12417,7 +12455,7 @@ var LeaferUI = function(exports) {
12417
12455
  constructor(editor) {
12418
12456
  super();
12419
12457
  this.view = new exports.Group;
12420
- this.rect = new exports.Box({
12458
+ this.rect = new EditPoint({
12421
12459
  name: "rect",
12422
12460
  hitFill: "all",
12423
12461
  hitStroke: "none",
@@ -12479,12 +12517,13 @@ var LeaferUI = function(exports) {
12479
12517
  this.listenPointEvents(resizePoint, "resize", i);
12480
12518
  }
12481
12519
  this.listenPointEvents(circle, "rotate", 2);
12520
+ this.listenPointEvents(rect, "move", 8);
12482
12521
  view.addMany(...rotatePoints, rect, circle, buttons, ...resizeLines, ...resizePoints);
12483
12522
  this.add(view);
12484
12523
  }
12485
12524
  load() {
12486
- const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints} = this;
12487
- const {stroke: stroke, strokeWidth: strokeWidth} = mergeConfig;
12525
+ const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints, resizeLines: resizeLines} = this;
12526
+ const {stroke: stroke, strokeWidth: strokeWidth, resizeLine: resizeLine} = mergeConfig;
12488
12527
  const pointsStyle = this.getPointsStyle();
12489
12528
  const middlePointsStyle = this.getMiddlePointsStyle();
12490
12529
  this.visible = !target.locked;
@@ -12493,6 +12532,10 @@ var LeaferUI = function(exports) {
12493
12532
  resizeP = resizePoints[i];
12494
12533
  resizeP.set(this.getPointStyle(i % 2 ? middlePointsStyle[(i - 1) / 2 % middlePointsStyle.length] : pointsStyle[i / 2 % pointsStyle.length]));
12495
12534
  resizeP.rotation = (i - (i % 2 ? 1 : 0)) / 2 * 90;
12535
+ if (i % 2) resizeLines[(i - 1) / 2].set(Object.assign({
12536
+ pointType: "resize",
12537
+ rotation: (i - 1) / 2 * 90
12538
+ }, resizeLine || {}));
12496
12539
  }
12497
12540
  circle.set(this.getPointStyle(mergeConfig.circle || mergeConfig.rotatePoint || pointsStyle[0]));
12498
12541
  rect.set(Object.assign({
@@ -12537,10 +12580,12 @@ var LeaferUI = function(exports) {
12537
12580
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
12538
12581
  }
12539
12582
  updateBounds(bounds) {
12540
- const {editMask: editMask} = this.editor;
12541
- const {mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
12542
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
12583
+ const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
12584
+ const {editMask: editMask} = editor;
12585
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
12543
12586
  editMask.visible = mask ? true : 0;
12587
+ editor.setDimOthers(dimOthers);
12588
+ editor.setBright(!!dimOthers || bright);
12544
12589
  if (spread) BoundsHelper.spread(bounds, spread);
12545
12590
  if (this.view.worldOpacity) {
12546
12591
  const {width: width, height: height} = bounds;
@@ -12561,10 +12606,10 @@ var LeaferUI = function(exports) {
12561
12606
  resizeL.visible = resizeP.visible && !hideResizeLines;
12562
12607
  resizeP.visible = rotateP.visible = showPoints && !!middlePoint;
12563
12608
  if ((i + 1) / 2 % 2) {
12564
- resizeL.width = width;
12609
+ resizeL.width = width + resizeL.height;
12565
12610
  if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
12566
12611
  } else {
12567
- resizeL.height = height;
12612
+ resizeL.width = height + resizeL.height;
12568
12613
  if (hideOnSmall && resizeP.width * 2 > height) resizeP.visible = false;
12569
12614
  }
12570
12615
  }
@@ -12641,7 +12686,7 @@ var LeaferUI = function(exports) {
12641
12686
  this.dragging = true;
12642
12687
  const point = this.dragPoint = e.current, {pointType: pointType} = point;
12643
12688
  const {editor: editor, dragStartData: dragStartData} = this, {target: target} = this, {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, hideOnMove: hideOnMove} = this.mergeConfig;
12644
- if (point.name === "rect") {
12689
+ if (pointType === "move") {
12645
12690
  moveable && (this.moving = true);
12646
12691
  editor.opacity = hideOnMove ? 0 : 1;
12647
12692
  } else {
@@ -12666,23 +12711,22 @@ var LeaferUI = function(exports) {
12666
12711
  if (this.moving && this.mergeConfig.dragLimitAnimate && this.target.dragBounds) this.transformTool.onMove(e);
12667
12712
  this.dragPoint = null;
12668
12713
  this.resetDoing();
12669
- const {name: name, pointType: pointType} = e.current;
12670
- if (name === "rect") this.editor.opacity = 1;
12714
+ const {pointType: pointType} = e.current;
12715
+ if (pointType === "move") this.editor.opacity = 1;
12671
12716
  if (pointType && pointType.includes("resize")) ResizeEvent.resizingKeys = null;
12672
12717
  }
12673
12718
  onDrag(e) {
12674
12719
  const {transformTool: transformTool, moving: moving, resizing: resizing, rotating: rotating, skewing: skewing} = this;
12675
12720
  if (moving) {
12676
12721
  transformTool.onMove(e);
12677
- updateMoveCursor(this);
12678
12722
  } else if (resizing || rotating || skewing) {
12679
12723
  const point = e.current;
12680
12724
  if (point.pointType) this.enterPoint = point;
12681
12725
  if (rotating) transformTool.onRotate(e);
12682
12726
  if (resizing) transformTool.onScale(e);
12683
12727
  if (skewing) transformTool.onSkew(e);
12684
- updatePointCursor(this, e);
12685
12728
  }
12729
+ updatePointCursor(this, e);
12686
12730
  }
12687
12731
  resetDoing() {
12688
12732
  if (this.canUse) this.dragging = this.gesturing = this.moving = this.resizing = this.rotating = this.skewing = false;
@@ -12778,17 +12822,15 @@ var LeaferUI = function(exports) {
12778
12822
  listenPointEvents(point, type, direction) {
12779
12823
  point.direction = direction;
12780
12824
  point.pointType = type;
12781
- const events = [ [ exports.DragEvent.START, this.onDragStart, this ], [ exports.DragEvent.DRAG, this.onDrag, this ], [ exports.DragEvent.END, this.onDragEnd, this ], [ exports.PointerEvent.LEAVE, () => {
12782
- this.enterPoint = null;
12783
- } ] ];
12784
- if (point.name !== "circle") events.push([ exports.PointerEvent.ENTER, e => {
12825
+ this.__eventIds.push(point.on_([ [ exports.DragEvent.START, this.onDragStart, this ], [ exports.DragEvent.DRAG, this.onDrag, this ], [ exports.DragEvent.END, this.onDragEnd, this ], [ exports.PointerEvent.ENTER, e => {
12785
12826
  this.enterPoint = point, updatePointCursor(this, e);
12786
- } ]);
12787
- this.__eventIds.push(point.on_(events));
12827
+ } ], [ exports.PointerEvent.LEAVE, () => {
12828
+ this.enterPoint = null;
12829
+ } ] ]));
12788
12830
  }
12789
12831
  __listenEvents() {
12790
12832
  const {rect: rect, editor: editor, __eventIds: events} = this;
12791
- events.push(rect.on_([ [ exports.DragEvent.START, this.onDragStart, this ], [ exports.DragEvent.DRAG, this.onDrag, this ], [ exports.DragEvent.END, this.onDragEnd, this ], [ exports.PointerEvent.ENTER, () => updateMoveCursor(this) ], [ exports.PointerEvent.DOUBLE_TAP, this.onDoubleTap, this ], [ exports.PointerEvent.LONG_PRESS, this.onLongPress, this ] ]));
12833
+ events.push(rect.on_([ [ exports.PointerEvent.DOUBLE_TAP, this.onDoubleTap, this ], [ exports.PointerEvent.LONG_PRESS, this.onLongPress, this ] ]));
12792
12834
  this.waitLeafer(() => {
12793
12835
  events.push(editor.app.on_([ [ [ exports.KeyEvent.HOLD, exports.KeyEvent.UP ], this.onKey, this ], [ exports.KeyEvent.DOWN, this.onArrow, this ], [ exports.MoveEvent.BEFORE_MOVE, this.onMove, this, true ], [ exports.ZoomEvent.BEFORE_ZOOM, this.onScale, this, true ], [ exports.RotateEvent.BEFORE_ROTATE, this.onRotate, this, true ], [ exports.MoveEvent.END, this.onMoveEnd, this ], [ exports.ZoomEvent.END, this.resetDoing, this ], [ exports.RotateEvent.END, this.resetDoing, this ] ]));
12794
12836
  });
@@ -13466,6 +13508,16 @@ var LeaferUI = function(exports) {
13466
13508
  shiftItem(item) {
13467
13509
  this.hasItem(item) ? this.removeItem(item) : this.addItem(item);
13468
13510
  }
13511
+ setDimOthers(value, attrName = "dim", list) {
13512
+ if (!list) {
13513
+ const {dimTarget: dimTarget, targetLeafer: targetLeafer} = this;
13514
+ list = dimTarget ? isArray(dimTarget) ? dimTarget : [ dimTarget ] : [ targetLeafer ];
13515
+ }
13516
+ if (list[0] && list[0][attrName] !== (value || false)) list.forEach(item => DataHelper.stintSet(item, attrName, value));
13517
+ }
13518
+ setBright(value) {
13519
+ this.setDimOthers(value, "bright", this.list);
13520
+ }
13469
13521
  update() {
13470
13522
  if (this.editing) {
13471
13523
  if (!this.element.parent) return this.cancel();
@@ -13686,8 +13738,8 @@ var LeaferUI = function(exports) {
13686
13738
  }
13687
13739
  };
13688
13740
  __decorate([ mergeConfigAttr() ], exports.Editor.prototype, "mergeConfig", void 0);
13689
- __decorate([ targetAttr(onHover) ], exports.Editor.prototype, "hoverTarget", void 0);
13690
13741
  __decorate([ targetAttr(onTarget) ], exports.Editor.prototype, "target", void 0);
13742
+ __decorate([ targetAttr(onHover) ], exports.Editor.prototype, "hoverTarget", void 0);
13691
13743
  exports.Editor = __decorate([ useModule(TransformTool, [ "editBox", "editTool", "emitEvent" ]) ], exports.Editor);
13692
13744
  class InnerEditor {
13693
13745
  static registerInnerEditor() {
@@ -17809,14 +17861,10 @@ var LeaferUI = function(exports) {
17809
17861
  renderOptions.bounds = canvas.bounds;
17810
17862
  }
17811
17863
  canvas.save();
17812
- if (isFrame && !isUndefined(fill)) {
17813
- const oldFill = leaf.get("fill");
17814
- leaf.fill = "";
17815
- leaf.__render(canvas, renderOptions);
17816
- leaf.fill = oldFill;
17817
- } else {
17818
- leaf.__render(canvas, renderOptions);
17819
- }
17864
+ const igroneFill = isFrame && !isUndefined(fill), oldFill = leaf.get("fill");
17865
+ if (igroneFill) leaf.fill = "";
17866
+ Platform.render(leaf, canvas, renderOptions);
17867
+ if (igroneFill) leaf.fill = oldFill;
17820
17868
  canvas.restore();
17821
17869
  if (sliceLeaf) sliceLeaf.__updateWorldOpacity();
17822
17870
  if (trim) {
@@ -17962,6 +18010,8 @@ var LeaferUI = function(exports) {
17962
18010
  return width;
17963
18011
  }
17964
18012
  });
18013
+ Plugin.add("bright");
18014
+ exports.UI.addAttr("bright", false, dimType);
17965
18015
  exports.AlignHelper = AlignHelper;
17966
18016
  exports.AnimateEasing = AnimateEasing;
17967
18017
  exports.AnimateEvent = AnimateEvent;
@@ -18134,6 +18184,7 @@ var LeaferUI = function(exports) {
18134
18184
  exports.defineDataProcessor = defineDataProcessor;
18135
18185
  exports.defineKey = defineKey;
18136
18186
  exports.defineLeafAttr = defineLeafAttr;
18187
+ exports.dimType = dimType;
18137
18188
  exports.doBoundsType = doBoundsType;
18138
18189
  exports.doStrokeType = doStrokeType;
18139
18190
  exports.effectType = effectType;
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@leafer-ui/worker"),t=require("@leafer-in/editor"),r=require("@leafer-in/text-editor"),o=require("@leafer-in/viewport"),n=require("@leafer-in/view"),c=require("@leafer-in/scroll"),a=require("@leafer-in/html"),f=require("@leafer-in/arrow"),p=require("@leafer-in/flow"),u=require("@leafer-in/animate"),i=require("@leafer-in/motion-path"),l=require("@leafer-in/state"),s=require("@leafer-in/robot"),b=require("@leafer-in/find"),y=require("@leafer-in/export"),O=require("@leafer-in/filter"),j=require("@leafer-in/color"),d=require("@leafer-in/resize");Object.keys(e).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}),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(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(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(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(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(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]}})});
1
+ "use strict";var e=require("@leafer-ui/worker"),t=require("@leafer-in/editor"),r=require("@leafer-in/text-editor"),o=require("@leafer-in/viewport"),n=require("@leafer-in/view"),c=require("@leafer-in/scroll"),a=require("@leafer-in/html"),f=require("@leafer-in/arrow"),p=require("@leafer-in/flow"),u=require("@leafer-in/animate"),i=require("@leafer-in/motion-path"),l=require("@leafer-in/state"),s=require("@leafer-in/robot"),b=require("@leafer-in/find"),y=require("@leafer-in/export"),O=require("@leafer-in/filter"),j=require("@leafer-in/color"),d=require("@leafer-in/resize"),h=require("@leafer-in/bright");Object.keys(e).forEach(function(t){"default"===t||Object.prototype.hasOwnProperty.call(exports,t)||Object.defineProperty(exports,t,{enumerable:!0,get:function(){return e[t]}})}),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(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(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(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(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(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(h).forEach(function(e){"default"===e||Object.prototype.hasOwnProperty.call(exports,e)||Object.defineProperty(exports,e,{enumerable:!0,get:function(){return h[e]}})});
2
2
  //# sourceMappingURL=worker.min.cjs.map