@leafer/worker 1.9.2 → 1.9.3

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.js CHANGED
@@ -1129,10 +1129,8 @@ var LeaferUI = function(exports) {
1129
1129
  t.y += y;
1130
1130
  },
1131
1131
  scroll(t, data) {
1132
- if (data.scrollY || data.scrollX) {
1133
- t.x += data.scrollX;
1134
- t.y += data.scrollY;
1135
- }
1132
+ t.x += data.scrollX;
1133
+ t.y += data.scrollY;
1136
1134
  },
1137
1135
  getByMove(t, x, y) {
1138
1136
  t = Object.assign({}, t);
@@ -6343,7 +6341,7 @@ var LeaferUI = function(exports) {
6343
6341
  this.levelMap = null;
6344
6342
  }
6345
6343
  }
6346
- const version = "1.9.2";
6344
+ const version = "1.9.3";
6347
6345
  class LeaferCanvas extends LeaferCanvasBase {
6348
6346
  get allowBackgroundColor() {
6349
6347
  return true;
@@ -8375,7 +8373,10 @@ var LeaferUI = function(exports) {
8375
8373
  const data = this.__, layout = this.__layout, {renderBounds: renderBounds, boxBounds: boxBounds} = layout;
8376
8374
  const childrenRenderBounds = layout.childrenRenderBounds || (layout.childrenRenderBounds = getBoundsData());
8377
8375
  super.__updateRenderBounds(childrenRenderBounds);
8378
- scroll(childrenRenderBounds, data);
8376
+ if (data.overflow.includes("scroll")) {
8377
+ add(childrenRenderBounds, boxBounds);
8378
+ scroll(childrenRenderBounds, data);
8379
+ }
8379
8380
  this.__updateRectRenderBounds();
8380
8381
  isOverflow = !includes$1(boxBounds, childrenRenderBounds);
8381
8382
  if (isOverflow && data.overflow === "show") add(renderBounds, childrenRenderBounds);
@@ -13482,11 +13483,22 @@ var LeaferUI = function(exports) {
13482
13483
  updateEditTool() {
13483
13484
  this.unloadEditTool();
13484
13485
  if (this.editing) {
13485
- const name = this.element.editOuter || "EditTool";
13486
- const tool = this.editTool = this.editToolList[name] = this.editToolList[name] || EditToolCreator.get(name, this);
13487
- this.editBox.load();
13488
- tool.load();
13489
- this.update();
13486
+ const target = this.element;
13487
+ let name = target.editOuter || "EditTool";
13488
+ const {beforeEditOuter: beforeEditOuter} = this.mergeConfig;
13489
+ if (beforeEditOuter) {
13490
+ const check = beforeEditOuter({
13491
+ target: target,
13492
+ name: name
13493
+ });
13494
+ if (isString(check)) name = check; else if (check === false) return;
13495
+ }
13496
+ if (EditToolCreator.list[name]) {
13497
+ const tool = this.editTool = this.editToolList[name] = this.editToolList[name] || EditToolCreator.get(name, this);
13498
+ this.editBox.load();
13499
+ tool.load();
13500
+ this.update();
13501
+ }
13490
13502
  }
13491
13503
  }
13492
13504
  unloadEditTool() {
@@ -13579,13 +13591,21 @@ var LeaferUI = function(exports) {
13579
13591
  if (isString(nameOrSelect)) name = nameOrSelect; else if (!select) select = nameOrSelect;
13580
13592
  if (target && select) this.target = target;
13581
13593
  if (this.single) {
13582
- const editTarget = target || this.element;
13583
- name || (name = editTarget.editInner);
13584
- if (name && EditToolCreator.list[name]) {
13594
+ if (!target) target = this.element;
13595
+ if (!name) name = target.editInner;
13596
+ const {beforeEditInner: beforeEditInner} = this.mergeConfig;
13597
+ if (beforeEditInner) {
13598
+ const check = beforeEditInner({
13599
+ target: target,
13600
+ name: name
13601
+ });
13602
+ if (isString(check)) name = check; else if (check === false) return;
13603
+ }
13604
+ if (EditToolCreator.list[name]) {
13585
13605
  this.editTool.unload();
13586
13606
  this.innerEditing = true;
13587
13607
  this.innerEditor = this.editToolList[name] = this.editToolList[name] || EditToolCreator.get(name, this);
13588
- this.innerEditor.editTarget = editTarget;
13608
+ this.innerEditor.editTarget = target;
13589
13609
  this.emitInnerEvent(InnerEditorEvent.BEFORE_OPEN);
13590
13610
  this.innerEditor.load();
13591
13611
  this.emitInnerEvent(InnerEditorEvent.OPEN);