@leafer-in/editor 2.1.4 → 2.1.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leafer-in/editor",
3
- "version": "2.1.4",
3
+ "version": "2.1.6",
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.1.4",
38
- "@leafer-ui/core": "^2.1.4",
39
- "@leafer-in/resize": "^2.1.4",
40
- "@leafer-ui/interface": "^2.1.4",
41
- "@leafer-in/interface": "^2.1.4"
37
+ "@leafer-ui/draw": "^2.1.6",
38
+ "@leafer-ui/core": "^2.1.6",
39
+ "@leafer-in/resize": "^2.1.6",
40
+ "@leafer-ui/interface": "^2.1.6",
41
+ "@leafer-in/interface": "^2.1.6"
42
42
  }
43
43
  }
package/src/index.ts CHANGED
@@ -33,6 +33,7 @@ import { Creator, UI, Group, Text, Box, dataType, Plugin } from '@leafer-ui/draw
33
33
  import '@leafer-in/resize'
34
34
 
35
35
  import { Editor } from './Editor'
36
+ import { EditToolCreator } from './tool/EditToolCreator'
36
37
 
37
38
 
38
39
  Plugin.add('editor', 'resize')
@@ -47,7 +48,11 @@ Creator.editor = function (options?: IEditorConfig, app?: IApp): IEditor {
47
48
  Box.addAttr('textBox', false, dataType)
48
49
 
49
50
  UI.addAttr('editConfig', undefined, dataType)
50
- UI.addAttr('editOuter', (ui: UI) => { ui.updateLayout(); return ui.__.__isLinePath ? 'LineEditTool' : 'EditTool' }, dataType) // fix: Line 需要更新布局才能精准确定
51
+ UI.addAttr('editOuter', (ui: UI) => {
52
+ ui.updateLayout() // fix: Line 需要更新布局才能精准确定
53
+ const name = (ui.tag === 'Line' ? '' : ui.tag) + 'EditTool'
54
+ return ui.__.__isLinePath ? 'LineEditTool' : (EditToolCreator.list[name] ? name : 'EditTool')
55
+ }, dataType)
51
56
 
52
57
  UI.addAttr('editInner', 'PathEditor', dataType)
53
58
  Group.addAttr('editInner', '', dataType) // 必须设为空