@tmagic/stage 1.1.3 → 1.1.4
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/tmagic-stage.mjs +10 -4
- package/dist/tmagic-stage.mjs.map +1 -1
- package/dist/tmagic-stage.umd.js +10 -4
- package/dist/tmagic-stage.umd.js.map +1 -1
- package/package.json +4 -4
- package/src/StageDragResize.ts +11 -3
- package/src/TargetCalibrate.ts +1 -1
- package/src/const.ts +1 -0
- package/types/const.d.ts +2 -1
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.1.
|
|
2
|
+
"version": "1.1.4",
|
|
3
3
|
"name": "@tmagic/stage",
|
|
4
4
|
"sideEffects": [
|
|
5
5
|
"dist/*"
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@scena/guides": "^0.17.0",
|
|
32
|
-
"@tmagic/core": "1.1.
|
|
33
|
-
"@tmagic/schema": "1.1.
|
|
34
|
-
"@tmagic/utils": "1.1.
|
|
32
|
+
"@tmagic/core": "1.1.4",
|
|
33
|
+
"@tmagic/schema": "1.1.4",
|
|
34
|
+
"@tmagic/utils": "1.1.4",
|
|
35
35
|
"events": "^3.3.0",
|
|
36
36
|
"keycon": "^1.1.2",
|
|
37
37
|
"lodash-es": "^4.17.21",
|
package/src/StageDragResize.ts
CHANGED
|
@@ -96,6 +96,11 @@ export default class StageDragResize extends EventEmitter {
|
|
|
96
96
|
const oldTarget = this.target;
|
|
97
97
|
this.target = el;
|
|
98
98
|
|
|
99
|
+
if (!this.dragEl) {
|
|
100
|
+
this.dragEl = globalThis.document.createElement('div');
|
|
101
|
+
this.container.append(this.dragEl);
|
|
102
|
+
}
|
|
103
|
+
|
|
99
104
|
// 从不能拖动到能拖动的节点之间切换,要重新创建moveable,不然dragStart不生效
|
|
100
105
|
if (!this.moveable || this.target !== oldTarget) {
|
|
101
106
|
this.init(el);
|
|
@@ -157,6 +162,7 @@ export default class StageDragResize extends EventEmitter {
|
|
|
157
162
|
public clearSelectStatus(): void {
|
|
158
163
|
if (!this.moveable) return;
|
|
159
164
|
this.destroyDragEl();
|
|
165
|
+
this.dragEl = undefined;
|
|
160
166
|
this.moveable.target = null;
|
|
161
167
|
this.moveable.updateTarget();
|
|
162
168
|
}
|
|
@@ -184,9 +190,11 @@ export default class StageDragResize extends EventEmitter {
|
|
|
184
190
|
this.mode = getMode(el);
|
|
185
191
|
|
|
186
192
|
this.destroyGhostEl();
|
|
187
|
-
|
|
188
|
-
this.dragEl
|
|
189
|
-
|
|
193
|
+
|
|
194
|
+
if (!this.dragEl) {
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
|
|
190
198
|
this.dragEl.style.cssText = getTargetElStyle(el);
|
|
191
199
|
this.dragEl.id = `${DRAG_EL_ID_PREFIX}${el.id}`;
|
|
192
200
|
|
package/src/TargetCalibrate.ts
CHANGED
|
@@ -57,7 +57,7 @@ export default class TargetCalibrate extends EventEmitter {
|
|
|
57
57
|
top: ${top}px;
|
|
58
58
|
width: ${el.clientWidth}px;
|
|
59
59
|
height: ${el.clientHeight}px;
|
|
60
|
-
z-index: ${ZIndex.
|
|
60
|
+
z-index: ${ZIndex.HIGHLIGHT_EL};
|
|
61
61
|
`;
|
|
62
62
|
|
|
63
63
|
this.operationEl.id = `${prefix}${el.id}`;
|
package/src/const.ts
CHANGED