@leafer-in/editor 2.0.5 → 2.0.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/dist/editor.cjs +8 -5
- package/dist/editor.esm.js +8 -5
- package/dist/editor.esm.min.js +1 -1
- package/dist/editor.esm.min.js.map +1 -1
- package/dist/editor.js +8 -5
- 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 +6 -0
- package/src/decorator/data.ts +1 -5
- package/src/display/EditBox.ts +2 -0
- package/types/index.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-in/editor",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.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.0.
|
|
38
|
-
"@leafer-ui/core": "^2.0.
|
|
39
|
-
"@leafer-in/resize": "^2.0.
|
|
40
|
-
"@leafer-ui/interface": "^2.0.
|
|
41
|
-
"@leafer-in/interface": "^2.0.
|
|
37
|
+
"@leafer-ui/draw": "^2.0.6",
|
|
38
|
+
"@leafer-ui/core": "^2.0.6",
|
|
39
|
+
"@leafer-in/resize": "^2.0.6",
|
|
40
|
+
"@leafer-ui/interface": "^2.0.6",
|
|
41
|
+
"@leafer-in/interface": "^2.0.6"
|
|
42
42
|
}
|
|
43
43
|
}
|
package/src/Editor.ts
CHANGED
|
@@ -143,6 +143,12 @@ export class Editor extends Group implements IEditor {
|
|
|
143
143
|
this.setDimOthers(value, 'bright', this.list)
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
+
public cancelDimOthers(): void {
|
|
147
|
+
this.setDimOthers(false)
|
|
148
|
+
this.setBright(false)
|
|
149
|
+
this.hasDimOthers = undefined
|
|
150
|
+
}
|
|
151
|
+
|
|
146
152
|
// update
|
|
147
153
|
|
|
148
154
|
public update(): void {
|
package/src/decorator/data.ts
CHANGED
|
@@ -28,11 +28,7 @@ export function targetAttr(fn: IFunction) {
|
|
|
28
28
|
else if (check === false) return
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
if (t.hasDimOthers)
|
|
32
|
-
t.setDimOthers(false)
|
|
33
|
-
t.setBright(false)
|
|
34
|
-
t.hasDimOthers = undefined
|
|
35
|
-
}
|
|
31
|
+
if (t.hasDimOthers) t.cancelDimOthers()
|
|
36
32
|
|
|
37
33
|
if (isArray(value) && value.length > 1 && value[0].locked) value.splice(0, 1) // fix: 单个锁定 + shift多选
|
|
38
34
|
if (t.single) {
|
package/src/display/EditBox.ts
CHANGED
|
@@ -175,6 +175,8 @@ export class EditBox extends Group implements IEditBox {
|
|
|
175
175
|
editor.setDimOthers(dimOthers)
|
|
176
176
|
editor.setBright(!!dimOthers || bright)
|
|
177
177
|
editor.hasDimOthers = true
|
|
178
|
+
} else if (editor.hasDimOthers) {
|
|
179
|
+
editor.cancelDimOthers()
|
|
178
180
|
}
|
|
179
181
|
|
|
180
182
|
if (spread) BoundsHelper.spread(bounds, spread)
|
package/types/index.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ declare class Editor extends Group implements IEditor {
|
|
|
96
96
|
shiftItem(item: IUI): void;
|
|
97
97
|
setDimOthers(value: boolean | number, attrName?: 'bright' | 'dim', list?: IUI[]): void;
|
|
98
98
|
setBright(value: boolean): void;
|
|
99
|
+
cancelDimOthers(): void;
|
|
99
100
|
update(): void;
|
|
100
101
|
updateEditBox(): void;
|
|
101
102
|
getEditTool(name: string): IEditTool;
|