@leafer/miniapp 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/miniapp.cjs CHANGED
@@ -32,6 +32,8 @@ var color = require("@leafer-in/color");
32
32
 
33
33
  var resize = require("@leafer-in/resize");
34
34
 
35
+ var bright = require("@leafer-in/bright");
36
+
35
37
  Object.keys(miniapp).forEach(function(k) {
36
38
  if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
37
39
  enumerable: true,
@@ -175,3 +177,12 @@ Object.keys(resize).forEach(function(k) {
175
177
  }
176
178
  });
177
179
  });
180
+
181
+ Object.keys(bright).forEach(function(k) {
182
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
183
+ enumerable: true,
184
+ get: function() {
185
+ return bright[k];
186
+ }
187
+ });
188
+ });
@@ -29,3 +29,5 @@ export * from "@leafer-in/filter";
29
29
  export * from "@leafer-in/color";
30
30
 
31
31
  export * from "@leafer-in/resize";
32
+
33
+ export * from "@leafer-in/bright";
@@ -1,2 +1,2 @@
1
- export*from"@leafer-ui/miniapp";export*from"@leafer-in/editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";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/miniapp";export*from"@leafer-in/editor";export*from"@leafer-in/viewport";export*from"@leafer-in/view";export*from"@leafer-in/scroll";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=miniapp.esm.min.js.map
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("@leafer-ui/miniapp"),r=require("@leafer-in/editor"),t=require("@leafer-in/viewport"),o=require("@leafer-in/view"),n=require("@leafer-in/scroll"),c=require("@leafer-in/arrow"),a=require("@leafer-in/flow"),p=require("@leafer-in/animate"),f=require("@leafer-in/motion-path"),u=require("@leafer-in/state"),i=require("@leafer-in/robot"),l=require("@leafer-in/find"),s=require("@leafer-in/export"),b=require("@leafer-in/filter"),y=require("@leafer-in/color"),O=require("@leafer-in/resize");Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(exports,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})}),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]}})});
1
+ "use strict";var e=require("@leafer-ui/miniapp"),r=require("@leafer-in/editor"),t=require("@leafer-in/viewport"),o=require("@leafer-in/view"),n=require("@leafer-in/scroll"),c=require("@leafer-in/arrow"),a=require("@leafer-in/flow"),p=require("@leafer-in/animate"),f=require("@leafer-in/motion-path"),u=require("@leafer-in/state"),i=require("@leafer-in/robot"),l=require("@leafer-in/find"),s=require("@leafer-in/export"),b=require("@leafer-in/filter"),y=require("@leafer-in/color"),O=require("@leafer-in/resize"),j=require("@leafer-in/bright");Object.keys(e).forEach(function(r){"default"===r||Object.prototype.hasOwnProperty.call(exports,r)||Object.defineProperty(exports,r,{enumerable:!0,get:function(){return e[r]}})}),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]}})});
2
2
  //# sourceMappingURL=miniapp.min.cjs.map
@@ -423,6 +423,15 @@ const MatrixHelper = {
423
423
  t.c *= scaleY;
424
424
  t.d *= scaleY;
425
425
  },
426
+ pixelScale(t, pixelRatio, to) {
427
+ to || (to = t);
428
+ to.a = t.a * pixelRatio;
429
+ to.b = t.b * pixelRatio;
430
+ to.c = t.c * pixelRatio;
431
+ to.d = t.d * pixelRatio;
432
+ to.e = t.e * pixelRatio;
433
+ to.f = t.f * pixelRatio;
434
+ },
426
435
  scaleOfOuter(t, origin, scaleX, scaleY) {
427
436
  M$a.toInnerPoint(t, origin, tempPoint$4);
428
437
  M$a.scaleOfInner(t, tempPoint$4, scaleX, scaleY);
@@ -922,6 +931,10 @@ class Matrix {
922
931
  this.scaleY *= y || x;
923
932
  return this;
924
933
  }
934
+ pixelScale(pixelRatio) {
935
+ MatrixHelper.pixelScale(this, pixelRatio);
936
+ return this;
937
+ }
925
938
  scaleOfOuter(origin, x, y) {
926
939
  MatrixHelper.scaleOfOuter(this, origin, x, y);
927
940
  return this;
@@ -2146,7 +2159,7 @@ __decorate([ contextMethod() ], Canvas$1.prototype, "measureText", null);
2146
2159
 
2147
2160
  __decorate([ contextMethod() ], Canvas$1.prototype, "strokeText", null);
2148
2161
 
2149
- const {copy: copy$b, multiplyParent: multiplyParent$4} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2162
+ const {copy: copy$b, multiplyParent: multiplyParent$4, pixelScale: pixelScale} = MatrixHelper, {round: round$4} = Math, tempPixelBounds = new Bounds, tempPixelBounds2 = new Bounds;
2150
2163
 
2151
2164
  const minSize = {
2152
2165
  width: 1,
@@ -2247,12 +2260,7 @@ class LeaferCanvasBase extends Canvas$1 {
2247
2260
  setWorld(matrix, parentMatrix) {
2248
2261
  const {pixelRatio: pixelRatio, pixelSnap: pixelSnap} = this, w = this.worldTransform;
2249
2262
  if (parentMatrix) multiplyParent$4(matrix, parentMatrix, w);
2250
- w.a = matrix.a * pixelRatio;
2251
- w.b = matrix.b * pixelRatio;
2252
- w.c = matrix.c * pixelRatio;
2253
- w.d = matrix.d * pixelRatio;
2254
- w.e = matrix.e * pixelRatio;
2255
- w.f = matrix.f * pixelRatio;
2263
+ pixelScale(matrix, pixelRatio, w);
2256
2264
  if (pixelSnap) {
2257
2265
  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),
2258
2266
  w.f = round$4(w.f);
@@ -4265,6 +4273,18 @@ function surfaceType(defaultValue) {
4265
4273
  }));
4266
4274
  }
4267
4275
 
4276
+ function dimType(defaultValue) {
4277
+ return decorateLeafAttr(defaultValue, key => attr({
4278
+ set(value) {
4279
+ if (this.__setAttr(key, value)) {
4280
+ const data = this.__;
4281
+ DataHelper.stintSet(data, "__useDim", data.dim || data.bright || data.dimskip);
4282
+ this.__layout.surfaceChange();
4283
+ }
4284
+ }
4285
+ }));
4286
+ }
4287
+
4268
4288
  function opacityType(defaultValue) {
4269
4289
  return decorateLeafAttr(defaultValue, key => attr({
4270
4290
  set(value) {
@@ -4309,7 +4329,7 @@ function sortType(defaultValue) {
4309
4329
  return decorateLeafAttr(defaultValue, key => attr({
4310
4330
  set(value) {
4311
4331
  if (this.__setAttr(key, value)) {
4312
- this.__layout.surfaceChanged || this.__layout.surfaceChange();
4332
+ this.__layout.surfaceChange();
4313
4333
  this.waitParent(() => {
4314
4334
  this.parent.__layout.childrenSortChange();
4315
4335
  });
@@ -4346,7 +4366,7 @@ function hitType(defaultValue) {
4346
4366
  set(value) {
4347
4367
  if (this.__setAttr(key, value)) {
4348
4368
  this.__layout.hitCanvasChanged = true;
4349
- if (Debug.showBounds === "hit") this.__layout.surfaceChanged || this.__layout.surfaceChange();
4369
+ if (Debug.showBounds === "hit") this.__layout.surfaceChange();
4350
4370
  if (this.leafer) this.leafer.updateCursor();
4351
4371
  }
4352
4372
  }
@@ -5861,6 +5881,7 @@ const LeafRender = {
5861
5881
  if (options.shape) return this.__renderShape(canvas, options);
5862
5882
  if (this.__worldOpacity) {
5863
5883
  const data = this.__;
5884
+ if (data.bright && !options.topRendering) return options.topList.add(this);
5864
5885
  canvas.setWorld(this.__nowWorld = this.__getNowWorld(options));
5865
5886
  canvas.opacity = options.dimOpacity && !data.dimskip ? data.opacity * options.dimOpacity : data.opacity;
5866
5887
  if (this.__.__single) {
@@ -5909,7 +5930,9 @@ const BranchRender = {
5909
5930
  this.__nowWorld = this.__getNowWorld(options);
5910
5931
  if (this.__worldOpacity) {
5911
5932
  const data = this.__;
5912
- if (data.dim) options.dimOpacity = data.dim === true ? .2 : data.dim; else if (data.dimskip) options.dimOpacity && (options.dimOpacity = 0);
5933
+ if (data.__useDim) {
5934
+ 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);
5935
+ }
5913
5936
  if (data.__single && !this.isBranchLeaf) {
5914
5937
  if (data.eraser === "path") return this.__renderEraser(canvas, options);
5915
5938
  const tempCanvas = canvas.getSameCanvas(false, true);
@@ -6751,7 +6774,7 @@ class LeafLevelList {
6751
6774
  }
6752
6775
  }
6753
6776
 
6754
- const version = "1.9.6";
6777
+ const version = "1.9.7";
6755
6778
 
6756
6779
  class LeaferCanvas extends LeaferCanvasBase {
6757
6780
  get allowBackgroundColor() {
@@ -7458,7 +7481,7 @@ class Renderer {
7458
7481
  };
7459
7482
  if (this.needFill) canvas.fillWorld(bounds, this.config.fill);
7460
7483
  if (Debug.showRepaint) Debug.drawRepaint(canvas, bounds);
7461
- this.target.__render(canvas, options);
7484
+ Platform.render(this.target, canvas, options);
7462
7485
  this.renderBounds = realBounds = realBounds || bounds;
7463
7486
  this.renderOptions = options;
7464
7487
  this.totalBounds.isEmpty() ? this.totalBounds = realBounds : this.totalBounds.add(realBounds);
@@ -7734,6 +7757,15 @@ Object.assign(Creator, {
7734
7757
 
7735
7758
  Platform.layout = Layouter.fullLayout;
7736
7759
 
7760
+ Platform.render = function(target, canvas, options) {
7761
+ const topOptions = Object.assign(Object.assign({}, options), {
7762
+ topRendering: true
7763
+ });
7764
+ options.topList = new LeafList;
7765
+ target.__render(canvas, options);
7766
+ if (options.topList.length) options.topList.forEach(item => item.__render(canvas, topOptions));
7767
+ };
7768
+
7737
7769
  function effectType(defaultValue) {
7738
7770
  return decorateLeafAttr(defaultValue, key => attr({
7739
7771
  set(value) {
@@ -8509,9 +8541,9 @@ __decorate([ visibleType(true) ], UI.prototype, "visible", void 0);
8509
8541
 
8510
8542
  __decorate([ surfaceType(false) ], UI.prototype, "locked", void 0);
8511
8543
 
8512
- __decorate([ surfaceType(false) ], UI.prototype, "dim", void 0);
8544
+ __decorate([ dimType(false) ], UI.prototype, "dim", void 0);
8513
8545
 
8514
- __decorate([ surfaceType(false) ], UI.prototype, "dimskip", void 0);
8546
+ __decorate([ dimType(false) ], UI.prototype, "dimskip", void 0);
8515
8547
 
8516
8548
  __decorate([ sortType(0) ], UI.prototype, "zIndex", void 0);
8517
8549
 
@@ -12892,12 +12924,15 @@ function targetAttr(fn) {
12892
12924
  set(value) {
12893
12925
  const old = this[privateKey];
12894
12926
  if (old !== value) {
12895
- if (this.config) {
12927
+ const t = this;
12928
+ if (t.config) {
12896
12929
  const isSelect = key === "target";
12897
12930
  if (isSelect) {
12931
+ t.setDimOthers(false);
12932
+ t.setBright(false);
12898
12933
  if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1);
12899
- if (this.single) this.element.syncEventer = null;
12900
- const {beforeSelect: beforeSelect} = this.config;
12934
+ if (t.single) t.element.syncEventer = null;
12935
+ const {beforeSelect: beforeSelect} = t.config;
12901
12936
  if (beforeSelect) {
12902
12937
  const check = beforeSelect({
12903
12938
  target: value
@@ -12907,7 +12942,7 @@ function targetAttr(fn) {
12907
12942
  }
12908
12943
  const type = isSelect ? EditorEvent.BEFORE_SELECT : EditorEvent.BEFORE_HOVER;
12909
12944
  if (this.hasEvent(type)) this.emitEvent(new EditorEvent(type, {
12910
- editor: this,
12945
+ editor: t,
12911
12946
  value: value,
12912
12947
  oldValue: old
12913
12948
  }));
@@ -13578,13 +13613,18 @@ const cacheCursors = {};
13578
13613
  function updatePointCursor(editBox, e) {
13579
13614
  const {enterPoint: point, dragging: dragging, skewing: skewing, resizing: resizing, flippedX: flippedX, flippedY: flippedY} = editBox;
13580
13615
  if (!point || !editBox.editor.editing || !editBox.canUse) return;
13616
+ if (point.name === "rect") return updateMoveCursor(editBox);
13581
13617
  if (point.name === "circle") return;
13582
- if (point.pointType === "button") {
13618
+ let {rotation: rotation} = editBox;
13619
+ const {pointType: pointType} = point, {moveCursor: moveCursor, resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
13620
+ if (pointType === "move") {
13621
+ point.cursor = moveCursor;
13622
+ if (!moveable) point.visible = false;
13623
+ return;
13624
+ } else if (pointType === "button") {
13583
13625
  if (!point.cursor) point.cursor = "pointer";
13584
13626
  return;
13585
13627
  }
13586
- let {rotation: rotation} = editBox;
13587
- const {pointType: pointType} = point, {resizeCursor: resizeCursor, rotateCursor: rotateCursor, skewCursor: skewCursor, resizeable: resizeable, rotateable: rotateable, skewable: skewable} = editBox.mergeConfig;
13588
13628
  let showResize = pointType.includes("resize");
13589
13629
  if (showResize && rotateable && (editBox.isHoldRotateKey(e) || !resizeable)) showResize = false;
13590
13630
  const showSkew = skewable && !showResize && (point.name === "resize-line" || pointType === "skew");
@@ -13665,7 +13705,7 @@ class EditBox extends Group {
13665
13705
  constructor(editor) {
13666
13706
  super();
13667
13707
  this.view = new Group;
13668
- this.rect = new Box({
13708
+ this.rect = new EditPoint({
13669
13709
  name: "rect",
13670
13710
  hitFill: "all",
13671
13711
  hitStroke: "none",
@@ -13727,12 +13767,13 @@ class EditBox extends Group {
13727
13767
  this.listenPointEvents(resizePoint, "resize", i);
13728
13768
  }
13729
13769
  this.listenPointEvents(circle, "rotate", 2);
13770
+ this.listenPointEvents(rect, "move", 8);
13730
13771
  view.addMany(...rotatePoints, rect, circle, buttons, ...resizeLines, ...resizePoints);
13731
13772
  this.add(view);
13732
13773
  }
13733
13774
  load() {
13734
- const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints} = this;
13735
- const {stroke: stroke, strokeWidth: strokeWidth} = mergeConfig;
13775
+ const {target: target, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, resizePoints: resizePoints, resizeLines: resizeLines} = this;
13776
+ const {stroke: stroke, strokeWidth: strokeWidth, resizeLine: resizeLine} = mergeConfig;
13736
13777
  const pointsStyle = this.getPointsStyle();
13737
13778
  const middlePointsStyle = this.getMiddlePointsStyle();
13738
13779
  this.visible = !target.locked;
@@ -13741,6 +13782,10 @@ class EditBox extends Group {
13741
13782
  resizeP = resizePoints[i];
13742
13783
  resizeP.set(this.getPointStyle(i % 2 ? middlePointsStyle[(i - 1) / 2 % middlePointsStyle.length] : pointsStyle[i / 2 % pointsStyle.length]));
13743
13784
  resizeP.rotation = (i - (i % 2 ? 1 : 0)) / 2 * 90;
13785
+ if (i % 2) resizeLines[(i - 1) / 2].set(Object.assign({
13786
+ pointType: "resize",
13787
+ rotation: (i - 1) / 2 * 90
13788
+ }, resizeLine || {}));
13744
13789
  }
13745
13790
  circle.set(this.getPointStyle(mergeConfig.circle || mergeConfig.rotatePoint || pointsStyle[0]));
13746
13791
  rect.set(Object.assign({
@@ -13785,10 +13830,12 @@ class EditBox extends Group {
13785
13830
  if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null;
13786
13831
  }
13787
13832
  updateBounds(bounds) {
13788
- const {editMask: editMask} = this.editor;
13789
- const {mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
13790
- const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
13833
+ const {editor: editor, mergeConfig: mergeConfig, single: single, rect: rect, circle: circle, buttons: buttons, resizePoints: resizePoints, rotatePoints: rotatePoints, resizeLines: resizeLines} = this;
13834
+ const {editMask: editMask} = editor;
13835
+ const {middlePoint: middlePoint, resizeable: resizeable, rotateable: rotateable, hideOnSmall: hideOnSmall, editBox: editBox, mask: mask, dimOthers: dimOthers, bright: bright, spread: spread, hideRotatePoints: hideRotatePoints, hideResizeLines: hideResizeLines} = mergeConfig;
13791
13836
  editMask.visible = mask ? true : 0;
13837
+ editor.setDimOthers(dimOthers);
13838
+ editor.setBright(!!dimOthers || bright);
13792
13839
  if (spread) BoundsHelper.spread(bounds, spread);
13793
13840
  if (this.view.worldOpacity) {
13794
13841
  const {width: width, height: height} = bounds;
@@ -13809,10 +13856,10 @@ class EditBox extends Group {
13809
13856
  resizeL.visible = resizeP.visible && !hideResizeLines;
13810
13857
  resizeP.visible = rotateP.visible = showPoints && !!middlePoint;
13811
13858
  if ((i + 1) / 2 % 2) {
13812
- resizeL.width = width;
13859
+ resizeL.width = width + resizeL.height;
13813
13860
  if (hideOnSmall && resizeP.width * 2 > width) resizeP.visible = false;
13814
13861
  } else {
13815
- resizeL.height = height;
13862
+ resizeL.width = height + resizeL.height;
13816
13863
  if (hideOnSmall && resizeP.width * 2 > height) resizeP.visible = false;
13817
13864
  }
13818
13865
  }
@@ -13889,7 +13936,7 @@ class EditBox extends Group {
13889
13936
  this.dragging = true;
13890
13937
  const point = this.dragPoint = e.current, {pointType: pointType} = point;
13891
13938
  const {editor: editor, dragStartData: dragStartData} = this, {target: target} = this, {moveable: moveable, resizeable: resizeable, rotateable: rotateable, skewable: skewable, hideOnMove: hideOnMove} = this.mergeConfig;
13892
- if (point.name === "rect") {
13939
+ if (pointType === "move") {
13893
13940
  moveable && (this.moving = true);
13894
13941
  editor.opacity = hideOnMove ? 0 : 1;
13895
13942
  } else {
@@ -13914,23 +13961,22 @@ class EditBox extends Group {
13914
13961
  if (this.moving && this.mergeConfig.dragLimitAnimate && this.target.dragBounds) this.transformTool.onMove(e);
13915
13962
  this.dragPoint = null;
13916
13963
  this.resetDoing();
13917
- const {name: name, pointType: pointType} = e.current;
13918
- if (name === "rect") this.editor.opacity = 1;
13964
+ const {pointType: pointType} = e.current;
13965
+ if (pointType === "move") this.editor.opacity = 1;
13919
13966
  if (pointType && pointType.includes("resize")) ResizeEvent.resizingKeys = null;
13920
13967
  }
13921
13968
  onDrag(e) {
13922
13969
  const {transformTool: transformTool, moving: moving, resizing: resizing, rotating: rotating, skewing: skewing} = this;
13923
13970
  if (moving) {
13924
13971
  transformTool.onMove(e);
13925
- updateMoveCursor(this);
13926
13972
  } else if (resizing || rotating || skewing) {
13927
13973
  const point = e.current;
13928
13974
  if (point.pointType) this.enterPoint = point;
13929
13975
  if (rotating) transformTool.onRotate(e);
13930
13976
  if (resizing) transformTool.onScale(e);
13931
13977
  if (skewing) transformTool.onSkew(e);
13932
- updatePointCursor(this, e);
13933
13978
  }
13979
+ updatePointCursor(this, e);
13934
13980
  }
13935
13981
  resetDoing() {
13936
13982
  if (this.canUse) this.dragging = this.gesturing = this.moving = this.resizing = this.rotating = this.skewing = false;
@@ -14026,17 +14072,15 @@ class EditBox extends Group {
14026
14072
  listenPointEvents(point, type, direction) {
14027
14073
  point.direction = direction;
14028
14074
  point.pointType = type;
14029
- const events = [ [ DragEvent.START, this.onDragStart, this ], [ DragEvent.DRAG, this.onDrag, this ], [ DragEvent.END, this.onDragEnd, this ], [ PointerEvent.LEAVE, () => {
14030
- this.enterPoint = null;
14031
- } ] ];
14032
- if (point.name !== "circle") events.push([ PointerEvent.ENTER, e => {
14075
+ this.__eventIds.push(point.on_([ [ DragEvent.START, this.onDragStart, this ], [ DragEvent.DRAG, this.onDrag, this ], [ DragEvent.END, this.onDragEnd, this ], [ PointerEvent.ENTER, e => {
14033
14076
  this.enterPoint = point, updatePointCursor(this, e);
14034
- } ]);
14035
- this.__eventIds.push(point.on_(events));
14077
+ } ], [ PointerEvent.LEAVE, () => {
14078
+ this.enterPoint = null;
14079
+ } ] ]));
14036
14080
  }
14037
14081
  __listenEvents() {
14038
14082
  const {rect: rect, editor: editor, __eventIds: events} = this;
14039
- events.push(rect.on_([ [ DragEvent.START, this.onDragStart, this ], [ DragEvent.DRAG, this.onDrag, this ], [ DragEvent.END, this.onDragEnd, this ], [ PointerEvent.ENTER, () => updateMoveCursor(this) ], [ PointerEvent.DOUBLE_TAP, this.onDoubleTap, this ], [ PointerEvent.LONG_PRESS, this.onLongPress, this ] ]));
14083
+ events.push(rect.on_([ [ PointerEvent.DOUBLE_TAP, this.onDoubleTap, this ], [ PointerEvent.LONG_PRESS, this.onLongPress, this ] ]));
14040
14084
  this.waitLeafer(() => {
14041
14085
  events.push(editor.app.on_([ [ [ KeyEvent.HOLD, KeyEvent.UP ], this.onKey, this ], [ KeyEvent.DOWN, this.onArrow, this ], [ MoveEvent.BEFORE_MOVE, this.onMove, this, true ], [ ZoomEvent.BEFORE_ZOOM, this.onScale, this, true ], [ RotateEvent.BEFORE_ROTATE, this.onRotate, this, true ], [ MoveEvent.END, this.onMoveEnd, this ], [ ZoomEvent.END, this.resetDoing, this ], [ RotateEvent.END, this.resetDoing, this ] ]));
14042
14086
  });
@@ -14764,6 +14808,16 @@ let Editor = class Editor extends Group {
14764
14808
  shiftItem(item) {
14765
14809
  this.hasItem(item) ? this.removeItem(item) : this.addItem(item);
14766
14810
  }
14811
+ setDimOthers(value, attrName = "dim", list) {
14812
+ if (!list) {
14813
+ const {dimTarget: dimTarget, targetLeafer: targetLeafer} = this;
14814
+ list = dimTarget ? isArray(dimTarget) ? dimTarget : [ dimTarget ] : [ targetLeafer ];
14815
+ }
14816
+ if (list[0] && list[0][attrName] !== (value || false)) list.forEach(item => DataHelper.stintSet(item, attrName, value));
14817
+ }
14818
+ setBright(value) {
14819
+ this.setDimOthers(value, "bright", this.list);
14820
+ }
14767
14821
  update() {
14768
14822
  if (this.editing) {
14769
14823
  if (!this.element.parent) return this.cancel();
@@ -14986,10 +15040,10 @@ let Editor = class Editor extends Group {
14986
15040
 
14987
15041
  __decorate([ mergeConfigAttr() ], Editor.prototype, "mergeConfig", void 0);
14988
15042
 
14989
- __decorate([ targetAttr(onHover) ], Editor.prototype, "hoverTarget", void 0);
14990
-
14991
15043
  __decorate([ targetAttr(onTarget) ], Editor.prototype, "target", void 0);
14992
15044
 
15045
+ __decorate([ targetAttr(onHover) ], Editor.prototype, "hoverTarget", void 0);
15046
+
14993
15047
  Editor = __decorate([ useModule(TransformTool, [ "editBox", "editTool", "emitEvent" ]) ], Editor);
14994
15048
 
14995
15049
  class InnerEditor {
@@ -19191,14 +19245,10 @@ const ExportModule = {
19191
19245
  renderOptions.bounds = canvas.bounds;
19192
19246
  }
19193
19247
  canvas.save();
19194
- if (isFrame && !isUndefined(fill)) {
19195
- const oldFill = leaf.get("fill");
19196
- leaf.fill = "";
19197
- leaf.__render(canvas, renderOptions);
19198
- leaf.fill = oldFill;
19199
- } else {
19200
- leaf.__render(canvas, renderOptions);
19201
- }
19248
+ const igroneFill = isFrame && !isUndefined(fill), oldFill = leaf.get("fill");
19249
+ if (igroneFill) leaf.fill = "";
19250
+ Platform.render(leaf, canvas, renderOptions);
19251
+ if (igroneFill) leaf.fill = oldFill;
19202
19252
  canvas.restore();
19203
19253
  if (sliceLeaf) sliceLeaf.__updateWorldOpacity();
19204
19254
  if (trim) {
@@ -19360,4 +19410,8 @@ Object.assign(Filter, {
19360
19410
  }
19361
19411
  });
19362
19412
 
19363
- 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, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, createAttr, createDescriptor, cursorType, dataProcessor, dataType, decorateLeafAttr, defineDataProcessor, defineKey, defineLeafAttr, doBoundsType, doStrokeType, effectType, emptyData, eraserType, extraPropertyEventMap, getBoundsData, getDescriptor, getMatrixData, getPointData, hitType, isArray, isData, isEmptyData, 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$1 as tempBounds, tempMatrix$1 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };
19413
+ Plugin.add("bright");
19414
+
19415
+ UI.addAttr("bright", false, dimType);
19416
+
19417
+ 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, Frame, FrameData, Group, GroupData, HighBezierHelper, HighCurveHelper, HitCanvasManager, Image, ImageData, ImageEvent, ImageManager, IncrementId, InnerEditor, InnerEditorEvent, Interaction, InteractionBase, InteractionHelper, KeyEvent, Keyboard, LayoutEvent, Layouter, Leaf, LeafBounds, LeafBoundsHelper, LeafData, LeafDataProxy, LeafEventer, LeafHelper, LeafLayout, LeafLevelList, LeafList, LeafMatrix, LeafRender, Leafer, LeaferCanvas, LeaferCanvasBase, LeaferData, LeaferEvent, LeaferImage, LeaferTypeCreator, Line, LineData, LineEditTool, MathHelper, Matrix, MatrixHelper, MoveEvent, MultiTouchHelper, MyDragEvent, MyImage, MyPointerEvent, NeedConvertToCanvasCommandMap, OneRadian, PI2, PI_2, Paint, PaintGradient, PaintImage, Path, PathArrow, PathArrowModule, PathBounds, PathCommandDataHelper, PathCommandMap, PathConvert, PathCorner, PathCreator, PathData, PathDrawer, PathHelper, PathMatrixHelper, PathNumberCommandLengthMap, PathNumberCommandMap, PathScaler, Pen, PenData, Picker, Platform, Plugin, Point, PointHelper, PointerButton, PointerEvent, Polygon, PolygonData, PropertyEvent, Rect, RectData, RectHelper, RectRender, RenderEvent, Renderer, ResizeEvent, Resource, Robot, RobotData, RotateEvent, Run, ScrollBar, SelectArea, Selector, Star, StarData, State, StringNumberMap, Stroker, SwipeEvent, TaskItem, TaskProcessor, Text, TextConvert, TextData, TransformTool, Transformer, Transition, TwoPointBoundsHelper, UI, UIBounds, UICreator, UIData, UIEvent, UIRender, UnitConvert, WaitHelper, WatchEvent, Watcher, WheelEventHelper, ZoomEvent, addViewport, addViewportConfig, affectRenderBoundsType, affectStrokeBoundsType, arrowType, attr, autoLayoutType, boundsType, canvasPatch, canvasSizeAttrs, 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, 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$1 as tempBounds, tempMatrix$1 as tempMatrix, tempPoint$3 as tempPoint, tryToNumber, useCanvas, useModule, version, visibleType, zoomLayerType };