@tmagic/stage 1.5.20 → 1.5.21
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.js +20 -4
- package/dist/tmagic-stage.umd.cjs +20 -4
- package/package.json +2 -2
- package/src/StageCore.ts +4 -0
- package/src/StageRender.ts +21 -4
- package/types/index.d.ts +3 -0
package/dist/tmagic-stage.js
CHANGED
|
@@ -2418,14 +2418,27 @@ class StageRender extends EventEmitter$1 {
|
|
|
2418
2418
|
"*"
|
|
2419
2419
|
);
|
|
2420
2420
|
}
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2421
|
+
reloadIframe(url) {
|
|
2422
|
+
if (this.renderType !== RenderType.IFRAME) return;
|
|
2423
|
+
const el = this.iframe?.parentElement;
|
|
2424
|
+
this.destroyIframe();
|
|
2425
|
+
this.runtimeUrl = url;
|
|
2426
|
+
this.createIframe();
|
|
2427
|
+
this.mount(el);
|
|
2428
|
+
this.runtime = null;
|
|
2429
|
+
}
|
|
2430
|
+
destroyIframe() {
|
|
2425
2431
|
this.iframe?.removeEventListener("load", this.iframeLoadHandler);
|
|
2426
2432
|
this.contentWindow = null;
|
|
2427
2433
|
this.iframe?.remove();
|
|
2428
2434
|
this.iframe = void 0;
|
|
2435
|
+
}
|
|
2436
|
+
/**
|
|
2437
|
+
* 销毁实例
|
|
2438
|
+
*/
|
|
2439
|
+
destroy() {
|
|
2440
|
+
this.destroyIframe();
|
|
2441
|
+
globalThis.runtime = void 0;
|
|
2429
2442
|
this.removeAllListeners();
|
|
2430
2443
|
}
|
|
2431
2444
|
on(eventName, listener) {
|
|
@@ -2638,6 +2651,9 @@ class StageCore extends EventEmitter$1 {
|
|
|
2638
2651
|
enableMultiSelect() {
|
|
2639
2652
|
this.actionManager?.enableMultiSelect();
|
|
2640
2653
|
}
|
|
2654
|
+
reloadIframe(url) {
|
|
2655
|
+
this.renderer?.reloadIframe(url);
|
|
2656
|
+
}
|
|
2641
2657
|
/**
|
|
2642
2658
|
* 销毁实例
|
|
2643
2659
|
*/
|
|
@@ -4891,14 +4891,27 @@
|
|
|
4891
4891
|
"*"
|
|
4892
4892
|
);
|
|
4893
4893
|
}
|
|
4894
|
-
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4894
|
+
reloadIframe(url) {
|
|
4895
|
+
if (this.renderType !== RenderType.IFRAME) return;
|
|
4896
|
+
const el = this.iframe?.parentElement;
|
|
4897
|
+
this.destroyIframe();
|
|
4898
|
+
this.runtimeUrl = url;
|
|
4899
|
+
this.createIframe();
|
|
4900
|
+
this.mount(el);
|
|
4901
|
+
this.runtime = null;
|
|
4902
|
+
}
|
|
4903
|
+
destroyIframe() {
|
|
4898
4904
|
this.iframe?.removeEventListener("load", this.iframeLoadHandler);
|
|
4899
4905
|
this.contentWindow = null;
|
|
4900
4906
|
this.iframe?.remove();
|
|
4901
4907
|
this.iframe = void 0;
|
|
4908
|
+
}
|
|
4909
|
+
/**
|
|
4910
|
+
* 销毁实例
|
|
4911
|
+
*/
|
|
4912
|
+
destroy() {
|
|
4913
|
+
this.destroyIframe();
|
|
4914
|
+
globalThis.runtime = void 0;
|
|
4902
4915
|
this.removeAllListeners();
|
|
4903
4916
|
}
|
|
4904
4917
|
on(eventName, listener) {
|
|
@@ -5111,6 +5124,9 @@
|
|
|
5111
5124
|
enableMultiSelect() {
|
|
5112
5125
|
this.actionManager?.enableMultiSelect();
|
|
5113
5126
|
}
|
|
5127
|
+
reloadIframe(url) {
|
|
5128
|
+
this.renderer?.reloadIframe(url);
|
|
5129
|
+
}
|
|
5114
5130
|
/**
|
|
5115
5131
|
* 销毁实例
|
|
5116
5132
|
*/
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.
|
|
2
|
+
"version": "1.5.21",
|
|
3
3
|
"name": "@tmagic/stage",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-stage.umd.cjs",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"typescript": "*",
|
|
45
|
-
"@tmagic/core": "1.5.
|
|
45
|
+
"@tmagic/core": "1.5.21"
|
|
46
46
|
},
|
|
47
47
|
"peerDependenciesMeta": {
|
|
48
48
|
"typescript": {
|
package/src/StageCore.ts
CHANGED
package/src/StageRender.ts
CHANGED
|
@@ -172,14 +172,31 @@ export default class StageRender extends EventEmitter {
|
|
|
172
172
|
);
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
175
|
+
public reloadIframe(url: string) {
|
|
176
|
+
if (this.renderType !== RenderType.IFRAME) return;
|
|
177
|
+
|
|
178
|
+
const el = this.iframe?.parentElement;
|
|
179
|
+
this.destroyIframe();
|
|
180
|
+
this.runtimeUrl = url;
|
|
181
|
+
this.createIframe();
|
|
182
|
+
this.mount(el as HTMLDivElement);
|
|
183
|
+
this.runtime = null;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
public destroyIframe() {
|
|
179
187
|
this.iframe?.removeEventListener('load', this.iframeLoadHandler);
|
|
180
188
|
this.contentWindow = null;
|
|
181
189
|
this.iframe?.remove();
|
|
182
190
|
this.iframe = undefined;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* 销毁实例
|
|
195
|
+
*/
|
|
196
|
+
public destroy(): void {
|
|
197
|
+
this.destroyIframe();
|
|
198
|
+
// @ts-ignore
|
|
199
|
+
globalThis.runtime = undefined;
|
|
183
200
|
this.removeAllListeners();
|
|
184
201
|
}
|
|
185
202
|
|
package/types/index.d.ts
CHANGED
|
@@ -703,6 +703,8 @@ declare class StageRender extends EventEmitter$1 {
|
|
|
703
703
|
getElementsFromPoint(point: Point): HTMLElement[];
|
|
704
704
|
getTargetElement(id: Id): HTMLElement | null;
|
|
705
705
|
postTmagicRuntimeReady(): void;
|
|
706
|
+
reloadIframe(url: string): void;
|
|
707
|
+
destroyIframe(): void;
|
|
706
708
|
/**
|
|
707
709
|
* 销毁实例
|
|
708
710
|
*/
|
|
@@ -788,6 +790,7 @@ declare class StageCore extends EventEmitter$1 {
|
|
|
788
790
|
getDragStatus(): _tmagic_editor.StageDragStatus | undefined;
|
|
789
791
|
disableMultiSelect(): void;
|
|
790
792
|
enableMultiSelect(): void;
|
|
793
|
+
reloadIframe(url: string): void;
|
|
791
794
|
/**
|
|
792
795
|
* 销毁实例
|
|
793
796
|
*/
|