@o3r/third-party 11.1.0-prerelease.9 → 11.2.0-prerelease.0
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.
|
|
3
|
+
"version": "11.2.0-prerelease.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
"uuid": "^10.0.0"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
|
-
"@angular-devkit/schematics": "~18.
|
|
20
|
-
"@o3r/core": "^11.
|
|
21
|
-
"@o3r/schematics": "^11.
|
|
22
|
-
"@schematics/angular": "~18.
|
|
19
|
+
"@angular-devkit/schematics": "~18.1.0",
|
|
20
|
+
"@o3r/core": "^11.2.0-prerelease.0",
|
|
21
|
+
"@o3r/schematics": "^11.2.0-prerelease.0",
|
|
22
|
+
"@schematics/angular": "~18.1.0",
|
|
23
23
|
"rxjs": "^7.8.1"
|
|
24
24
|
},
|
|
25
25
|
"peerDependenciesMeta": {
|
|
@@ -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"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ngAddIframe =
|
|
3
|
+
exports.ngAddIframe = void 0;
|
|
4
|
+
exports.ngAddIframeFn = ngAddIframeFn;
|
|
4
5
|
const schematics_1 = require("@angular-devkit/schematics");
|
|
5
6
|
const schematics_2 = require("@o3r/schematics");
|
|
6
7
|
const node_path_1 = require("node:path");
|
|
@@ -33,7 +34,9 @@ function ngAddIframeFn(options) {
|
|
|
33
34
|
from: '@angular/core',
|
|
34
35
|
importNames: [
|
|
35
36
|
'AfterViewInit',
|
|
36
|
-
'
|
|
37
|
+
'ElementRef',
|
|
38
|
+
'OnDestroy',
|
|
39
|
+
'viewChild'
|
|
37
40
|
]
|
|
38
41
|
},
|
|
39
42
|
{
|
|
@@ -74,23 +77,24 @@ function ngAddIframeFn(options) {
|
|
|
74
77
|
&& classElement.name.escapedText.toString() === 'subscriptions');
|
|
75
78
|
/* eslint-disable indent */
|
|
76
79
|
const propertiesToAdd = (0, schematics_2.generateClassElementsFromString)(`
|
|
77
|
-
|
|
78
|
-
private bridge
|
|
80
|
+
private frame = viewChild.required<ElementRef<HTMLIFrameElement>>('frame');
|
|
81
|
+
private bridge?: IframeBridge;
|
|
79
82
|
${!hasSubscriptions ? 'private subscriptions: Subscription[] = [];' : ''}
|
|
80
83
|
`);
|
|
81
84
|
/* eslint-disable indent */
|
|
82
85
|
const newNgAfterViewInit = (0, schematics_2.getSimpleUpdatedMethod)(node, factory, 'ngAfterViewInit', (0, schematics_2.generateBlockStatementsFromString)(`
|
|
83
|
-
|
|
84
|
-
|
|
86
|
+
const nativeElem = this.frame().nativeElement;
|
|
87
|
+
if (nativeElem.contentDocument) {
|
|
88
|
+
nativeElem.contentDocument.write(
|
|
85
89
|
generateIFrameContent(
|
|
86
90
|
'', // third-party-script-url
|
|
87
91
|
'' // third-party-html-headers-to-add
|
|
88
92
|
)
|
|
89
93
|
);
|
|
90
|
-
|
|
94
|
+
nativeElem.contentDocument.close();
|
|
91
95
|
}
|
|
92
|
-
if (
|
|
93
|
-
this.bridge = new IframeBridge(window,
|
|
96
|
+
if (nativeElem.contentWindow) {
|
|
97
|
+
this.bridge = new IframeBridge(window, nativeElem);
|
|
94
98
|
this.subscriptions.push(
|
|
95
99
|
this.bridge.messages$.subscribe((message) => {
|
|
96
100
|
switch (message.action) {
|
|
@@ -161,7 +165,6 @@ function ngAddIframeFn(options) {
|
|
|
161
165
|
}
|
|
162
166
|
};
|
|
163
167
|
}
|
|
164
|
-
exports.ngAddIframeFn = ngAddIframeFn;
|
|
165
168
|
/**
|
|
166
169
|
* Add iframe to an existing component
|
|
167
170
|
* @param options
|