@leafer-in/editor 2.2.8 → 2.2.10
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/editor.cjs +24 -18
- package/dist/editor.esm.js +24 -18
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +24 -18
- package/dist/editor.min.cjs +1 -1
- package/dist/editor.min.cjs.map +1 -1
- package/dist/editor.min.js +1 -1
- package/dist/editor.min.js.map +1 -1
- package/package.json +6 -6
- package/src/Editor.ts +1 -0
- package/src/display/EditBox.ts +12 -4
- package/src/display/Stroker.ts +1 -0
- package/src/tool/EditTool.ts +9 -11
- package/src/tool/InnerEditor.ts +1 -0
- package/types/index.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-in/editor",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.10",
|
|
4
4
|
"description": "@leafer-in/editor",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"leaferjs"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"@leafer-ui/draw": "^2.2.
|
|
38
|
-
"@leafer-ui/core": "^2.2.
|
|
39
|
-
"@leafer-in/resize": "^2.2.
|
|
40
|
-
"@leafer-ui/interface": "^2.2.
|
|
41
|
-
"@leafer-in/interface": "^2.2.
|
|
37
|
+
"@leafer-ui/draw": "^2.2.10",
|
|
38
|
+
"@leafer-ui/core": "^2.2.10",
|
|
39
|
+
"@leafer-in/resize": "^2.2.10",
|
|
40
|
+
"@leafer-ui/interface": "^2.2.10",
|
|
41
|
+
"@leafer-in/interface": "^2.2.10"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/Editor.ts
CHANGED
|
@@ -289,6 +289,7 @@ export class Editor extends Group implements IEditor {
|
|
|
289
289
|
if (opened.length) {
|
|
290
290
|
let { list } = opened
|
|
291
291
|
if (this.editing) list = [], opened.forEach(item => this.list.every(leaf => !LeafHelper.hasParent(leaf, item)) && list.push(item))
|
|
292
|
+
else list = [...list] // 防止 list 循环时被修改
|
|
292
293
|
list.forEach(item => this.closeGroup(item as IGroup))
|
|
293
294
|
}
|
|
294
295
|
if (this.editing && !this.selector.dragging) this.checkDeepSelect()
|
package/src/display/EditBox.ts
CHANGED
|
@@ -153,10 +153,7 @@ export class EditBox extends Group implements IEditBox {
|
|
|
153
153
|
const rectThrough = isNull(mergeConfig.rectThrough) ? single : mergeConfig.rectThrough
|
|
154
154
|
rect.hittable = !rectThrough
|
|
155
155
|
|
|
156
|
-
if (rectThrough)
|
|
157
|
-
target.syncEventer = rect // 同步给 rect 冒泡,在 target 属性装饰器中重置
|
|
158
|
-
this.app.interaction.bottomList = [{ target: rect, proxy: target }]
|
|
159
|
-
}
|
|
156
|
+
if (rectThrough) this.addBottomList()
|
|
160
157
|
|
|
161
158
|
// 忽略元素像素对齐,在 target 属性装饰器中重置
|
|
162
159
|
if (single) DataHelper.stintSet(target.__world, 'ignorePixelSnap', ignorePixelSnap)
|
|
@@ -179,6 +176,17 @@ export class EditBox extends Group implements IEditBox {
|
|
|
179
176
|
public unload(): void {
|
|
180
177
|
this.unloadWidgets()
|
|
181
178
|
this.visible = false
|
|
179
|
+
this.removeBottomList()
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
|
|
183
|
+
public addBottomList(): void {
|
|
184
|
+
const { target, rect } = this
|
|
185
|
+
target.syncEventer = rect // 同步给 rect 冒泡,在 target 属性装饰器中重置
|
|
186
|
+
this.app.interaction.bottomList = [{ target: rect, proxy: target }]
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
public removeBottomList(): void {
|
|
182
190
|
if (this.app) this.rect.syncEventer = this.app.interaction.bottomList = null
|
|
183
191
|
}
|
|
184
192
|
|
package/src/display/Stroker.ts
CHANGED
package/src/tool/EditTool.ts
CHANGED
|
@@ -67,20 +67,18 @@ export class EditTool extends InnerEditor implements IEditTool {
|
|
|
67
67
|
// 状态
|
|
68
68
|
|
|
69
69
|
public load(): void {
|
|
70
|
-
this.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
public update(): void {
|
|
75
|
-
this.updateEditBoxConfig()
|
|
76
|
-
this.editBox.update()
|
|
77
|
-
this.onUpdate()
|
|
70
|
+
if (this.editor) {
|
|
71
|
+
this.editBox.view.visible = true
|
|
72
|
+
this.onLoad()
|
|
73
|
+
}
|
|
78
74
|
}
|
|
79
75
|
|
|
80
76
|
public unload(): void {
|
|
81
|
-
this.
|
|
82
|
-
|
|
83
|
-
|
|
77
|
+
if (this.editor) {
|
|
78
|
+
this.editBox.view.visible = false
|
|
79
|
+
this.unloadEditBoxConfig()
|
|
80
|
+
this.onUnload()
|
|
81
|
+
}
|
|
84
82
|
}
|
|
85
83
|
|
|
86
84
|
}
|
package/src/tool/InnerEditor.ts
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -185,6 +185,8 @@ declare class EditBox extends Group implements IEditBox {
|
|
|
185
185
|
load(): void;
|
|
186
186
|
update(): void;
|
|
187
187
|
unload(): void;
|
|
188
|
+
addBottomList(): void;
|
|
189
|
+
removeBottomList(): void;
|
|
188
190
|
updateBounds(bounds: IBoundsData): void;
|
|
189
191
|
protected layoutCircle(): void;
|
|
190
192
|
protected layoutButtons(): void;
|
|
@@ -379,7 +381,6 @@ declare class EditTool extends InnerEditor implements IEditTool {
|
|
|
379
381
|
onRotate(e: IEditorRotateEvent): void;
|
|
380
382
|
onSkew(e: IEditorSkewEvent): void;
|
|
381
383
|
load(): void;
|
|
382
|
-
update(): void;
|
|
383
384
|
unload(): void;
|
|
384
385
|
}
|
|
385
386
|
interface EditTool {
|