@leafer-in/editor 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/editor.cjs +28 -9
- package/dist/editor.esm.js +28 -9
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +28 -9
- 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 +28 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-in/editor",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.3",
|
|
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": "^1.9.
|
|
38
|
-
"@leafer-ui/core": "^1.9.
|
|
39
|
-
"@leafer-in/resize": "^1.9.
|
|
40
|
-
"@leafer-ui/interface": "^1.9.
|
|
41
|
-
"@leafer-in/interface": "^1.9.
|
|
37
|
+
"@leafer-ui/draw": "^1.9.3",
|
|
38
|
+
"@leafer-ui/core": "^1.9.3",
|
|
39
|
+
"@leafer-in/resize": "^1.9.3",
|
|
40
|
+
"@leafer-ui/interface": "^1.9.3",
|
|
41
|
+
"@leafer-in/interface": "^1.9.3"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/Editor.ts
CHANGED
|
@@ -141,11 +141,22 @@ export class Editor extends Group implements IEditor {
|
|
|
141
141
|
this.unloadEditTool()
|
|
142
142
|
|
|
143
143
|
if (this.editing) {
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
144
|
+
const target = this.element
|
|
145
|
+
let name = target.editOuter || 'EditTool'
|
|
146
|
+
|
|
147
|
+
const { beforeEditOuter } = this.mergeConfig
|
|
148
|
+
if (beforeEditOuter) {
|
|
149
|
+
const check = beforeEditOuter({ target, name })
|
|
150
|
+
if (isString(check)) name = check
|
|
151
|
+
else if (check === false) return
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (EditToolCreator.list[name]) {
|
|
155
|
+
const tool = this.editTool = this.editToolList[name] = this.editToolList[name] || EditToolCreator.get(name, this)
|
|
156
|
+
this.editBox.load()
|
|
157
|
+
tool.load()
|
|
158
|
+
this.update()
|
|
159
|
+
}
|
|
149
160
|
}
|
|
150
161
|
}
|
|
151
162
|
|
|
@@ -274,13 +285,21 @@ export class Editor extends Group implements IEditor {
|
|
|
274
285
|
if (target && select) this.target = target
|
|
275
286
|
|
|
276
287
|
if (this.single) {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
288
|
+
if (!target) target = this.element
|
|
289
|
+
if (!name) name = target.editInner
|
|
290
|
+
|
|
291
|
+
const { beforeEditInner } = this.mergeConfig
|
|
292
|
+
if (beforeEditInner) {
|
|
293
|
+
const check = beforeEditInner({ target, name })
|
|
294
|
+
if (isString(check)) name = check
|
|
295
|
+
else if (check === false) return
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
if (EditToolCreator.list[name]) {
|
|
280
299
|
this.editTool.unload()
|
|
281
300
|
this.innerEditing = true
|
|
282
301
|
this.innerEditor = this.editToolList[name] = this.editToolList[name] || EditToolCreator.get(name, this)
|
|
283
|
-
this.innerEditor.editTarget =
|
|
302
|
+
this.innerEditor.editTarget = target
|
|
284
303
|
|
|
285
304
|
this.emitInnerEvent(InnerEditorEvent.BEFORE_OPEN)
|
|
286
305
|
this.innerEditor.load()
|