@tmagic/stage 1.5.0-beta.5 → 1.5.0-beta.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/tmagic-stage.js +10 -10
- package/dist/tmagic-stage.umd.cjs +10 -10
- package/package.json +4 -4
- package/src/StageRender.ts +13 -13
- package/types/index.d.ts +1 -1
package/dist/tmagic-stage.js
CHANGED
|
@@ -2376,6 +2376,16 @@ class StageRender extends EventEmitter$1 {
|
|
|
2376
2376
|
getTargetElement(id) {
|
|
2377
2377
|
return getElById()(this.getDocument(), id);
|
|
2378
2378
|
}
|
|
2379
|
+
postTmagicRuntimeReady() {
|
|
2380
|
+
this.contentWindow = this.iframe?.contentWindow;
|
|
2381
|
+
this.contentWindow.magic = this.getMagicApi();
|
|
2382
|
+
this.contentWindow.postMessage(
|
|
2383
|
+
{
|
|
2384
|
+
tmagicRuntimeReady: true
|
|
2385
|
+
},
|
|
2386
|
+
"*"
|
|
2387
|
+
);
|
|
2388
|
+
}
|
|
2379
2389
|
/**
|
|
2380
2390
|
* 销毁实例
|
|
2381
2391
|
*/
|
|
@@ -2439,16 +2449,6 @@ class StageRender extends EventEmitter$1 {
|
|
|
2439
2449
|
this.emit("onload");
|
|
2440
2450
|
injectStyle(this.contentWindow.document, style);
|
|
2441
2451
|
};
|
|
2442
|
-
postTmagicRuntimeReady() {
|
|
2443
|
-
this.contentWindow = this.iframe?.contentWindow;
|
|
2444
|
-
this.contentWindow.magic = this.getMagicApi();
|
|
2445
|
-
this.contentWindow.postMessage(
|
|
2446
|
-
{
|
|
2447
|
-
tmagicRuntimeReady: true
|
|
2448
|
-
},
|
|
2449
|
-
"*"
|
|
2450
|
-
);
|
|
2451
|
-
}
|
|
2452
2452
|
}
|
|
2453
2453
|
|
|
2454
2454
|
class StageCore extends EventEmitter$1 {
|
|
@@ -2372,6 +2372,16 @@
|
|
|
2372
2372
|
getTargetElement(id) {
|
|
2373
2373
|
return utils.getElById()(this.getDocument(), id);
|
|
2374
2374
|
}
|
|
2375
|
+
postTmagicRuntimeReady() {
|
|
2376
|
+
this.contentWindow = this.iframe?.contentWindow;
|
|
2377
|
+
this.contentWindow.magic = this.getMagicApi();
|
|
2378
|
+
this.contentWindow.postMessage(
|
|
2379
|
+
{
|
|
2380
|
+
tmagicRuntimeReady: true
|
|
2381
|
+
},
|
|
2382
|
+
"*"
|
|
2383
|
+
);
|
|
2384
|
+
}
|
|
2375
2385
|
/**
|
|
2376
2386
|
* 销毁实例
|
|
2377
2387
|
*/
|
|
@@ -2435,16 +2445,6 @@
|
|
|
2435
2445
|
this.emit("onload");
|
|
2436
2446
|
utils.injectStyle(this.contentWindow.document, style);
|
|
2437
2447
|
};
|
|
2438
|
-
postTmagicRuntimeReady() {
|
|
2439
|
-
this.contentWindow = this.iframe?.contentWindow;
|
|
2440
|
-
this.contentWindow.magic = this.getMagicApi();
|
|
2441
|
-
this.contentWindow.postMessage(
|
|
2442
|
-
{
|
|
2443
|
-
tmagicRuntimeReady: true
|
|
2444
|
-
},
|
|
2445
|
-
"*"
|
|
2446
|
-
);
|
|
2447
|
-
}
|
|
2448
2448
|
}
|
|
2449
2449
|
|
|
2450
2450
|
class StageCore extends EventEmitter.EventEmitter {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.0-beta.
|
|
2
|
+
"version": "1.5.0-beta.6",
|
|
3
3
|
"name": "@tmagic/stage",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/tmagic-stage.umd.cjs",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"typescript": "*",
|
|
48
|
-
"@tmagic/
|
|
49
|
-
"@tmagic/utils": "1.5.0-beta.
|
|
50
|
-
"@tmagic/
|
|
48
|
+
"@tmagic/schema": "1.5.0-beta.6",
|
|
49
|
+
"@tmagic/utils": "1.5.0-beta.6",
|
|
50
|
+
"@tmagic/core": "1.5.0-beta.6"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
|
53
53
|
"typescript": {
|
package/src/StageRender.ts
CHANGED
|
@@ -155,6 +155,19 @@ export default class StageRender extends EventEmitter {
|
|
|
155
155
|
return getElById()(this.getDocument(), id);
|
|
156
156
|
}
|
|
157
157
|
|
|
158
|
+
public postTmagicRuntimeReady() {
|
|
159
|
+
this.contentWindow = this.iframe?.contentWindow as RuntimeWindow;
|
|
160
|
+
|
|
161
|
+
this.contentWindow.magic = this.getMagicApi();
|
|
162
|
+
|
|
163
|
+
this.contentWindow.postMessage(
|
|
164
|
+
{
|
|
165
|
+
tmagicRuntimeReady: true,
|
|
166
|
+
},
|
|
167
|
+
'*',
|
|
168
|
+
);
|
|
169
|
+
}
|
|
170
|
+
|
|
158
171
|
/**
|
|
159
172
|
* 销毁实例
|
|
160
173
|
*/
|
|
@@ -236,17 +249,4 @@ export default class StageRender extends EventEmitter {
|
|
|
236
249
|
|
|
237
250
|
injectStyle(this.contentWindow.document, style);
|
|
238
251
|
};
|
|
239
|
-
|
|
240
|
-
private postTmagicRuntimeReady() {
|
|
241
|
-
this.contentWindow = this.iframe?.contentWindow as RuntimeWindow;
|
|
242
|
-
|
|
243
|
-
this.contentWindow.magic = this.getMagicApi();
|
|
244
|
-
|
|
245
|
-
this.contentWindow.postMessage(
|
|
246
|
-
{
|
|
247
|
-
tmagicRuntimeReady: true,
|
|
248
|
-
},
|
|
249
|
-
'*',
|
|
250
|
-
);
|
|
251
|
-
}
|
|
252
252
|
}
|
package/types/index.d.ts
CHANGED
|
@@ -698,6 +698,7 @@ declare class StageRender extends EventEmitter$1 {
|
|
|
698
698
|
*/
|
|
699
699
|
getElementsFromPoint(point: Point): HTMLElement[];
|
|
700
700
|
getTargetElement(id: Id): HTMLElement | null;
|
|
701
|
+
postTmagicRuntimeReady(): void;
|
|
701
702
|
/**
|
|
702
703
|
* 销毁实例
|
|
703
704
|
*/
|
|
@@ -712,7 +713,6 @@ declare class StageRender extends EventEmitter$1 {
|
|
|
712
713
|
*/
|
|
713
714
|
private flagSelectedEl;
|
|
714
715
|
private iframeLoadHandler;
|
|
715
|
-
private postTmagicRuntimeReady;
|
|
716
716
|
}
|
|
717
717
|
|
|
718
718
|
/**
|