@o3r/third-party 11.1.0-prerelease.4 → 11.1.0-prerelease.40
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": "@o3r/third-party",
|
|
3
|
-
"version": "11.1.0-prerelease.
|
|
3
|
+
"version": "11.1.0-prerelease.40",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@angular-devkit/schematics": "~18.0.0",
|
|
20
|
-
"@o3r/core": "^11.1.0-prerelease.
|
|
21
|
-
"@o3r/schematics": "^11.1.0-prerelease.
|
|
20
|
+
"@o3r/core": "^11.1.0-prerelease.40",
|
|
21
|
+
"@o3r/schematics": "^11.1.0-prerelease.40",
|
|
22
22
|
"@schematics/angular": "~18.0.0",
|
|
23
23
|
"rxjs": "^7.8.1"
|
|
24
24
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/iframe-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAoBpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AA0B5D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/iframe-to-component/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,IAAI,EAGL,MAAM,4BAA4B,CAAC;AAoBpC,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AA0B5D;;;GAGG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,2BAA2B,GAAG,IAAI,CA2LxE;AAED;;;GAGG;AACH,eAAO,MAAM,WAAW,gDAAuD,CAAC"}
|
|
@@ -33,7 +33,9 @@ function ngAddIframeFn(options) {
|
|
|
33
33
|
from: '@angular/core',
|
|
34
34
|
importNames: [
|
|
35
35
|
'AfterViewInit',
|
|
36
|
-
'
|
|
36
|
+
'ElementRef',
|
|
37
|
+
'OnDestroy',
|
|
38
|
+
'viewChild'
|
|
37
39
|
]
|
|
38
40
|
},
|
|
39
41
|
{
|
|
@@ -74,23 +76,24 @@ function ngAddIframeFn(options) {
|
|
|
74
76
|
&& classElement.name.escapedText.toString() === 'subscriptions');
|
|
75
77
|
/* eslint-disable indent */
|
|
76
78
|
const propertiesToAdd = (0, schematics_2.generateClassElementsFromString)(`
|
|
77
|
-
|
|
78
|
-
private bridge
|
|
79
|
+
private frame = viewChild.required<ElementRef<HTMLIFrameElement>>('frame');
|
|
80
|
+
private bridge?: IframeBridge;
|
|
79
81
|
${!hasSubscriptions ? 'private subscriptions: Subscription[] = [];' : ''}
|
|
80
82
|
`);
|
|
81
83
|
/* eslint-disable indent */
|
|
82
84
|
const newNgAfterViewInit = (0, schematics_2.getSimpleUpdatedMethod)(node, factory, 'ngAfterViewInit', (0, schematics_2.generateBlockStatementsFromString)(`
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
const nativeElem = this.frame().nativeElement;
|
|
86
|
+
if (nativeElem.contentDocument) {
|
|
87
|
+
nativeElem.contentDocument.write(
|
|
85
88
|
generateIFrameContent(
|
|
86
89
|
'', // third-party-script-url
|
|
87
90
|
'' // third-party-html-headers-to-add
|
|
88
91
|
)
|
|
89
92
|
);
|
|
90
|
-
|
|
93
|
+
nativeElem.contentDocument.close();
|
|
91
94
|
}
|
|
92
|
-
if (
|
|
93
|
-
this.bridge = new IframeBridge(window,
|
|
95
|
+
if (nativeElem.contentWindow) {
|
|
96
|
+
this.bridge = new IframeBridge(window, nativeElem);
|
|
94
97
|
this.subscriptions.push(
|
|
95
98
|
this.bridge.messages$.subscribe((message) => {
|
|
96
99
|
switch (message.action) {
|