forgeframe 0.0.6 → 0.0.9
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/constants.d.ts +1 -1
- package/dist/core/consumer/props-pipeline.d.ts +16 -0
- package/dist/core/consumer/renderer.d.ts +2 -0
- package/dist/core/consumer/transport.d.ts +1 -0
- package/dist/core/consumer.d.ts +12 -0
- package/dist/core/host.d.ts +44 -0
- package/dist/forgeframe.js +1034 -779
- package/dist/forgeframe.umd.cjs +2 -2
- package/dist/render/iframe.d.ts +30 -0
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/forgeframe.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
const
|
|
1
|
+
const f = {
|
|
2
2
|
/** Render component in an iframe */
|
|
3
3
|
IFRAME: "iframe",
|
|
4
4
|
/** Render component in a popup window */
|
|
5
5
|
POPUP: "popup"
|
|
6
|
-
},
|
|
6
|
+
}, g = {
|
|
7
7
|
/** Emitted when rendering starts */
|
|
8
8
|
RENDER: "render",
|
|
9
9
|
/** Emitted when component is fully rendered and initialized */
|
|
@@ -26,14 +26,14 @@ const m = {
|
|
|
26
26
|
RESIZE: "resize",
|
|
27
27
|
/** Emitted when component receives focus */
|
|
28
28
|
FOCUS: "focus"
|
|
29
|
-
},
|
|
29
|
+
}, A = {
|
|
30
30
|
/** Default JSON serialization */
|
|
31
31
|
JSON: "json",
|
|
32
32
|
/** Base64 encoding for binary or large data */
|
|
33
33
|
BASE64: "base64",
|
|
34
|
-
/**
|
|
34
|
+
/** Explicit framed-path encoding for nested objects */
|
|
35
35
|
DOTIFY: "dotify"
|
|
36
|
-
},
|
|
36
|
+
}, z = {
|
|
37
37
|
/** Request message expecting a response */
|
|
38
38
|
REQUEST: "request",
|
|
39
39
|
/** Response to a previous request */
|
|
@@ -63,14 +63,14 @@ const m = {
|
|
|
63
63
|
CONSUMER_EXPORT: "forgeframe_consumer_export",
|
|
64
64
|
/** Get sibling components request */
|
|
65
65
|
GET_SIBLINGS: "forgeframe_get_siblings"
|
|
66
|
-
},
|
|
67
|
-
if ("0.0.
|
|
66
|
+
}, M = "__forgeframe__", se = (() => {
|
|
67
|
+
if ("0.0.9".trim().length === 0)
|
|
68
68
|
throw new Error(
|
|
69
69
|
"ForgeFrame VERSION injection is missing. Configure __FORGEFRAME_VERSION__ in build/test tooling."
|
|
70
70
|
);
|
|
71
|
-
return "0.0.
|
|
71
|
+
return "0.0.9";
|
|
72
72
|
})();
|
|
73
|
-
class
|
|
73
|
+
class Ie {
|
|
74
74
|
/**
|
|
75
75
|
* Internal storage for event listeners mapped by event name.
|
|
76
76
|
* @internal
|
|
@@ -118,8 +118,8 @@ class Re {
|
|
|
118
118
|
* @public
|
|
119
119
|
*/
|
|
120
120
|
once(e, t) {
|
|
121
|
-
const
|
|
122
|
-
return this.on(e,
|
|
121
|
+
const s = (r) => (this.off(e, s), t(r));
|
|
122
|
+
return this.on(e, s);
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* Emits an event, invoking all registered handlers with the provided data.
|
|
@@ -141,9 +141,9 @@ class Re {
|
|
|
141
141
|
* @public
|
|
142
142
|
*/
|
|
143
143
|
emit(e, t) {
|
|
144
|
-
const
|
|
145
|
-
if (
|
|
146
|
-
for (const r of
|
|
144
|
+
const s = this.listeners.get(e);
|
|
145
|
+
if (s)
|
|
146
|
+
for (const r of s)
|
|
147
147
|
try {
|
|
148
148
|
const i = r(t);
|
|
149
149
|
i && typeof i == "object" && "catch" in i && typeof i.catch == "function" && i.catch((o) => {
|
|
@@ -179,8 +179,8 @@ class Re {
|
|
|
179
179
|
this.listeners.delete(e);
|
|
180
180
|
return;
|
|
181
181
|
}
|
|
182
|
-
const
|
|
183
|
-
|
|
182
|
+
const s = this.listeners.get(e);
|
|
183
|
+
s && (s.delete(t), s.size === 0 && this.listeners.delete(e));
|
|
184
184
|
}
|
|
185
185
|
/**
|
|
186
186
|
* Removes all event listeners from the emitter.
|
|
@@ -221,14 +221,14 @@ class Re {
|
|
|
221
221
|
return this.listeners.get(e)?.size ?? 0;
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
function
|
|
225
|
-
const
|
|
226
|
-
return `${
|
|
224
|
+
function qe() {
|
|
225
|
+
const n = Date.now().toString(36), e = Math.random().toString(36).slice(2, 11);
|
|
226
|
+
return `${n}_${e}`;
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function L() {
|
|
229
229
|
return Math.random().toString(36).slice(2, 11);
|
|
230
230
|
}
|
|
231
|
-
class
|
|
231
|
+
class Je {
|
|
232
232
|
/**
|
|
233
233
|
* Array of registered cleanup tasks awaiting execution.
|
|
234
234
|
* @internal
|
|
@@ -301,8 +301,8 @@ class We {
|
|
|
301
301
|
for (const t of e)
|
|
302
302
|
try {
|
|
303
303
|
await t();
|
|
304
|
-
} catch (
|
|
305
|
-
console.error("Error in cleanup task:",
|
|
304
|
+
} catch (s) {
|
|
305
|
+
console.error("Error in cleanup task:", s);
|
|
306
306
|
}
|
|
307
307
|
}
|
|
308
308
|
/**
|
|
@@ -345,123 +345,123 @@ class We {
|
|
|
345
345
|
this.tasks = [], this.cleaned = !1;
|
|
346
346
|
}
|
|
347
347
|
}
|
|
348
|
-
function
|
|
349
|
-
let
|
|
350
|
-
return { promise: new Promise((
|
|
351
|
-
|
|
352
|
-
}), resolve:
|
|
348
|
+
function Se() {
|
|
349
|
+
let n, e;
|
|
350
|
+
return { promise: new Promise((s, r) => {
|
|
351
|
+
n = s, e = r;
|
|
352
|
+
}), resolve: n, reject: e };
|
|
353
353
|
}
|
|
354
|
-
function
|
|
355
|
-
return new Promise((
|
|
354
|
+
function Ke(n, e, t = "Operation timed out") {
|
|
355
|
+
return new Promise((s, r) => {
|
|
356
356
|
const i = setTimeout(() => {
|
|
357
357
|
r(new Error(`${t} (${e}ms)`));
|
|
358
358
|
}, e);
|
|
359
|
-
|
|
360
|
-
clearTimeout(i),
|
|
359
|
+
n.then((o) => {
|
|
360
|
+
clearTimeout(i), s(o);
|
|
361
361
|
}).catch((o) => {
|
|
362
362
|
clearTimeout(i), r(o);
|
|
363
363
|
});
|
|
364
364
|
});
|
|
365
365
|
}
|
|
366
|
-
const
|
|
367
|
-
function
|
|
368
|
-
return
|
|
366
|
+
const I = /* @__PURE__ */ new Map(), Ye = 200;
|
|
367
|
+
function Xe(n) {
|
|
368
|
+
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
369
369
|
}
|
|
370
|
-
function
|
|
371
|
-
if (!
|
|
370
|
+
function Ge(n) {
|
|
371
|
+
if (!n.includes("*"))
|
|
372
372
|
return null;
|
|
373
|
-
const e =
|
|
373
|
+
const e = I.get(n);
|
|
374
374
|
if (e)
|
|
375
375
|
return e;
|
|
376
|
-
const t =
|
|
377
|
-
if (
|
|
378
|
-
const r =
|
|
379
|
-
r &&
|
|
376
|
+
const t = n.split("*").map((r) => Xe(r)).join(".*"), s = new RegExp(`^${t}$`);
|
|
377
|
+
if (I.size >= Ye) {
|
|
378
|
+
const r = I.keys().next().value;
|
|
379
|
+
r && I.delete(r);
|
|
380
380
|
}
|
|
381
|
-
return
|
|
381
|
+
return I.set(n, s), s;
|
|
382
382
|
}
|
|
383
|
-
function
|
|
384
|
-
return
|
|
383
|
+
function Ze(n, e) {
|
|
384
|
+
return n.global || n.sticky ? new RegExp(n.source, n.flags.replace(/[gy]/g, "")).test(e) : n.test(e);
|
|
385
385
|
}
|
|
386
|
-
function
|
|
386
|
+
function k(n = window) {
|
|
387
387
|
try {
|
|
388
|
-
return
|
|
388
|
+
return n.location.origin;
|
|
389
389
|
} catch {
|
|
390
390
|
return "";
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
|
-
function
|
|
393
|
+
function ve(n, e = window) {
|
|
394
394
|
try {
|
|
395
|
-
return
|
|
395
|
+
return n.location.origin === e.location.origin;
|
|
396
396
|
} catch {
|
|
397
397
|
return !1;
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
if (typeof
|
|
402
|
-
if (
|
|
403
|
-
const t =
|
|
404
|
-
return t ? t.test(e) :
|
|
400
|
+
function v(n, e) {
|
|
401
|
+
if (typeof n == "string") {
|
|
402
|
+
if (n === "*") return !0;
|
|
403
|
+
const t = Ge(n);
|
|
404
|
+
return t ? t.test(e) : n === e;
|
|
405
405
|
}
|
|
406
|
-
return
|
|
406
|
+
return n instanceof RegExp ? Ze(n, e) : Array.isArray(n) ? n.some((t) => v(t, e)) : !1;
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
if (!
|
|
408
|
+
function Z(n) {
|
|
409
|
+
if (!n) return !0;
|
|
410
410
|
try {
|
|
411
|
-
return
|
|
411
|
+
return n.closed;
|
|
412
412
|
} catch {
|
|
413
413
|
return !0;
|
|
414
414
|
}
|
|
415
415
|
}
|
|
416
|
-
function
|
|
416
|
+
function Qe(n = window) {
|
|
417
417
|
try {
|
|
418
|
-
return
|
|
418
|
+
return n.opener;
|
|
419
419
|
} catch {
|
|
420
420
|
return null;
|
|
421
421
|
}
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function et(n = window) {
|
|
424
424
|
try {
|
|
425
|
-
const e =
|
|
426
|
-
return e && e !==
|
|
425
|
+
const e = n.parent;
|
|
426
|
+
return e && e !== n ? e : null;
|
|
427
427
|
} catch {
|
|
428
428
|
return null;
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
function
|
|
431
|
+
function tt(n = window) {
|
|
432
432
|
try {
|
|
433
|
-
return
|
|
433
|
+
return n.parent !== n;
|
|
434
434
|
} catch {
|
|
435
435
|
return !0;
|
|
436
436
|
}
|
|
437
437
|
}
|
|
438
|
-
function
|
|
438
|
+
function nt(n = window) {
|
|
439
439
|
try {
|
|
440
|
-
return
|
|
440
|
+
return n.opener !== null && n.opener !== void 0;
|
|
441
441
|
} catch {
|
|
442
442
|
return !1;
|
|
443
443
|
}
|
|
444
444
|
}
|
|
445
|
-
const
|
|
446
|
-
function
|
|
447
|
-
const
|
|
445
|
+
const _e = 100, P = /* @__PURE__ */ new Map();
|
|
446
|
+
function st() {
|
|
447
|
+
const n = [];
|
|
448
448
|
for (const [e, t] of P.entries())
|
|
449
|
-
|
|
450
|
-
for (const e of
|
|
449
|
+
Z(t) && n.push(e);
|
|
450
|
+
for (const e of n)
|
|
451
451
|
P.delete(e);
|
|
452
452
|
}
|
|
453
|
-
function
|
|
454
|
-
if (P.size >=
|
|
453
|
+
function rt(n, e) {
|
|
454
|
+
if (P.size >= _e && st(), P.size >= _e) {
|
|
455
455
|
const t = P.keys().next().value;
|
|
456
456
|
t && P.delete(t);
|
|
457
457
|
}
|
|
458
|
-
P.set(
|
|
458
|
+
P.set(n, e);
|
|
459
459
|
}
|
|
460
|
-
function
|
|
461
|
-
P.delete(
|
|
460
|
+
function it(n) {
|
|
461
|
+
P.delete(n);
|
|
462
462
|
}
|
|
463
|
-
function
|
|
464
|
-
return
|
|
463
|
+
function ot(n, e) {
|
|
464
|
+
return n.global || n.sticky ? new RegExp(n.source, n.flags.replace(/[gy]/g, "")).test(e) : n.test(e);
|
|
465
465
|
}
|
|
466
466
|
class _ {
|
|
467
467
|
/** @internal */
|
|
@@ -530,7 +530,7 @@ class _ {
|
|
|
530
530
|
return t._default = e, t;
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
class
|
|
533
|
+
class re extends _ {
|
|
534
534
|
/** @internal */
|
|
535
535
|
_minLength;
|
|
536
536
|
/** @internal */
|
|
@@ -556,7 +556,7 @@ class G extends _ {
|
|
|
556
556
|
issues: [
|
|
557
557
|
{ message: `String must be at most ${this._maxLength} characters` }
|
|
558
558
|
]
|
|
559
|
-
} : this._pattern && !
|
|
559
|
+
} : this._pattern && !ot(this._pattern, t) ? {
|
|
560
560
|
issues: [
|
|
561
561
|
{
|
|
562
562
|
message: this._patternMessage || `String must match pattern ${this._pattern}`
|
|
@@ -566,7 +566,7 @@ class G extends _ {
|
|
|
566
566
|
}
|
|
567
567
|
/** @internal */
|
|
568
568
|
_clone() {
|
|
569
|
-
const e = new
|
|
569
|
+
const e = new re();
|
|
570
570
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e._minLength = this._minLength, e._maxLength = this._maxLength, e._pattern = this._pattern, e._patternMessage = this._patternMessage, e._trim = this._trim, e;
|
|
571
571
|
}
|
|
572
572
|
/**
|
|
@@ -623,8 +623,8 @@ class G extends _ {
|
|
|
623
623
|
* ```
|
|
624
624
|
*/
|
|
625
625
|
pattern(e, t) {
|
|
626
|
-
const
|
|
627
|
-
return
|
|
626
|
+
const s = this._clone();
|
|
627
|
+
return s._pattern = e, s._patternMessage = t, s;
|
|
628
628
|
}
|
|
629
629
|
/**
|
|
630
630
|
* Validates as email address.
|
|
@@ -691,7 +691,7 @@ class G extends _ {
|
|
|
691
691
|
return e._minLength = 1, e;
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
class
|
|
694
|
+
class ie extends _ {
|
|
695
695
|
/** @internal */
|
|
696
696
|
_min;
|
|
697
697
|
/** @internal */
|
|
@@ -706,7 +706,7 @@ class Z extends _ {
|
|
|
706
706
|
}
|
|
707
707
|
/** @internal */
|
|
708
708
|
_clone() {
|
|
709
|
-
const e = new
|
|
709
|
+
const e = new ie();
|
|
710
710
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e._min = this._min, e._max = this._max, e._int = this._int, e;
|
|
711
711
|
}
|
|
712
712
|
/**
|
|
@@ -786,7 +786,7 @@ class Z extends _ {
|
|
|
786
786
|
return e._max = -Number.MIN_VALUE, e;
|
|
787
787
|
}
|
|
788
788
|
}
|
|
789
|
-
class
|
|
789
|
+
class oe extends _ {
|
|
790
790
|
/** @internal */
|
|
791
791
|
_validate(e) {
|
|
792
792
|
return typeof e != "boolean" ? {
|
|
@@ -795,11 +795,11 @@ class Q extends _ {
|
|
|
795
795
|
}
|
|
796
796
|
/** @internal */
|
|
797
797
|
_clone() {
|
|
798
|
-
const e = new
|
|
798
|
+
const e = new oe();
|
|
799
799
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e;
|
|
800
800
|
}
|
|
801
801
|
}
|
|
802
|
-
class
|
|
802
|
+
class ae extends _ {
|
|
803
803
|
/** @internal */
|
|
804
804
|
_validate(e) {
|
|
805
805
|
return typeof e != "function" ? {
|
|
@@ -808,11 +808,11 @@ class ee extends _ {
|
|
|
808
808
|
}
|
|
809
809
|
/** @internal */
|
|
810
810
|
_clone() {
|
|
811
|
-
const e = new
|
|
811
|
+
const e = new ae();
|
|
812
812
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e;
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
|
-
class
|
|
815
|
+
class W extends _ {
|
|
816
816
|
/** @internal */
|
|
817
817
|
_itemSchema;
|
|
818
818
|
/** @internal */
|
|
@@ -839,8 +839,8 @@ class $ extends _ {
|
|
|
839
839
|
};
|
|
840
840
|
if (this._itemSchema) {
|
|
841
841
|
const t = [];
|
|
842
|
-
for (let
|
|
843
|
-
const r = this._itemSchema["~standard"].validate(e[
|
|
842
|
+
for (let s = 0; s < e.length; s++) {
|
|
843
|
+
const r = this._itemSchema["~standard"].validate(e[s]);
|
|
844
844
|
if (r instanceof Promise)
|
|
845
845
|
throw new Error(
|
|
846
846
|
"Async schema validation is not supported. Use synchronous schemas."
|
|
@@ -849,7 +849,7 @@ class $ extends _ {
|
|
|
849
849
|
return {
|
|
850
850
|
issues: r.issues.map((i) => ({
|
|
851
851
|
...i,
|
|
852
|
-
path: [
|
|
852
|
+
path: [s, ...i.path || []]
|
|
853
853
|
}))
|
|
854
854
|
};
|
|
855
855
|
t.push(r.value);
|
|
@@ -860,7 +860,7 @@ class $ extends _ {
|
|
|
860
860
|
}
|
|
861
861
|
/** @internal */
|
|
862
862
|
_clone() {
|
|
863
|
-
const e = new
|
|
863
|
+
const e = new W();
|
|
864
864
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e._itemSchema = this._itemSchema, e._minLength = this._minLength, e._maxLength = this._maxLength, e;
|
|
865
865
|
}
|
|
866
866
|
/**
|
|
@@ -876,7 +876,7 @@ class $ extends _ {
|
|
|
876
876
|
* ```
|
|
877
877
|
*/
|
|
878
878
|
of(e) {
|
|
879
|
-
const t = new
|
|
879
|
+
const t = new W();
|
|
880
880
|
return t._optional = this._optional, t._nullable = this._nullable, t._itemSchema = e, t._minLength = this._minLength, t._maxLength = this._maxLength, t;
|
|
881
881
|
}
|
|
882
882
|
/**
|
|
@@ -919,7 +919,7 @@ class $ extends _ {
|
|
|
919
919
|
return this.min(1);
|
|
920
920
|
}
|
|
921
921
|
}
|
|
922
|
-
class
|
|
922
|
+
class B extends _ {
|
|
923
923
|
/** @internal */
|
|
924
924
|
_shape;
|
|
925
925
|
/** @internal */
|
|
@@ -934,7 +934,7 @@ class L extends _ {
|
|
|
934
934
|
}
|
|
935
935
|
]
|
|
936
936
|
};
|
|
937
|
-
const t = e,
|
|
937
|
+
const t = e, s = {};
|
|
938
938
|
if (this._shape) {
|
|
939
939
|
if (this._strict) {
|
|
940
940
|
const r = new Set(Object.keys(this._shape));
|
|
@@ -957,18 +957,18 @@ class L extends _ {
|
|
|
957
957
|
path: [r, ...a.path || []]
|
|
958
958
|
}))
|
|
959
959
|
};
|
|
960
|
-
|
|
960
|
+
s[r] = o.value;
|
|
961
961
|
}
|
|
962
962
|
if (!this._strict)
|
|
963
963
|
for (const r of Object.keys(t))
|
|
964
|
-
r in this._shape || (
|
|
965
|
-
return { value:
|
|
964
|
+
r in this._shape || (s[r] = t[r]);
|
|
965
|
+
return { value: s };
|
|
966
966
|
}
|
|
967
967
|
return { value: e };
|
|
968
968
|
}
|
|
969
969
|
/** @internal */
|
|
970
970
|
_clone() {
|
|
971
|
-
const e = new
|
|
971
|
+
const e = new B();
|
|
972
972
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e._shape = this._shape, e._strict = this._strict, e;
|
|
973
973
|
}
|
|
974
974
|
/**
|
|
@@ -986,7 +986,7 @@ class L extends _ {
|
|
|
986
986
|
* ```
|
|
987
987
|
*/
|
|
988
988
|
shape(e) {
|
|
989
|
-
const t = new
|
|
989
|
+
const t = new B();
|
|
990
990
|
return t._optional = this._optional, t._nullable = this._nullable, t._shape = e, t._strict = this._strict, t;
|
|
991
991
|
}
|
|
992
992
|
/**
|
|
@@ -1002,7 +1002,7 @@ class L extends _ {
|
|
|
1002
1002
|
return e._strict = !0, e;
|
|
1003
1003
|
}
|
|
1004
1004
|
}
|
|
1005
|
-
class
|
|
1005
|
+
class ce extends _ {
|
|
1006
1006
|
/** @internal */
|
|
1007
1007
|
_value;
|
|
1008
1008
|
constructor(e) {
|
|
@@ -1016,11 +1016,11 @@ class te extends _ {
|
|
|
1016
1016
|
}
|
|
1017
1017
|
/** @internal */
|
|
1018
1018
|
_clone() {
|
|
1019
|
-
const e = new
|
|
1019
|
+
const e = new ce(this._value);
|
|
1020
1020
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e;
|
|
1021
1021
|
}
|
|
1022
1022
|
}
|
|
1023
|
-
class
|
|
1023
|
+
class le extends _ {
|
|
1024
1024
|
/** @internal */
|
|
1025
1025
|
_values;
|
|
1026
1026
|
/** @internal */
|
|
@@ -1040,11 +1040,11 @@ class se extends _ {
|
|
|
1040
1040
|
}
|
|
1041
1041
|
/** @internal */
|
|
1042
1042
|
_clone() {
|
|
1043
|
-
const e = new
|
|
1043
|
+
const e = new le(this._values);
|
|
1044
1044
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e;
|
|
1045
1045
|
}
|
|
1046
1046
|
}
|
|
1047
|
-
class
|
|
1047
|
+
class ue extends _ {
|
|
1048
1048
|
constructor() {
|
|
1049
1049
|
super(), this._nullable = !0;
|
|
1050
1050
|
}
|
|
@@ -1054,11 +1054,11 @@ class ne extends _ {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
/** @internal */
|
|
1056
1056
|
_clone() {
|
|
1057
|
-
const e = new
|
|
1057
|
+
const e = new ue();
|
|
1058
1058
|
return e._optional = this._optional, e._nullable = this._nullable, e._default = this._default, e;
|
|
1059
1059
|
}
|
|
1060
1060
|
}
|
|
1061
|
-
const
|
|
1061
|
+
const p = {
|
|
1062
1062
|
/**
|
|
1063
1063
|
* Creates a string schema.
|
|
1064
1064
|
*
|
|
@@ -1071,7 +1071,7 @@ const d = {
|
|
|
1071
1071
|
* prop.string().pattern(/^[a-z]+$/)
|
|
1072
1072
|
* ```
|
|
1073
1073
|
*/
|
|
1074
|
-
string: () => new
|
|
1074
|
+
string: () => new re(),
|
|
1075
1075
|
/**
|
|
1076
1076
|
* Creates a number schema.
|
|
1077
1077
|
*
|
|
@@ -1083,7 +1083,7 @@ const d = {
|
|
|
1083
1083
|
* prop.number().positive()
|
|
1084
1084
|
* ```
|
|
1085
1085
|
*/
|
|
1086
|
-
number: () => new
|
|
1086
|
+
number: () => new ie(),
|
|
1087
1087
|
/**
|
|
1088
1088
|
* Creates a boolean schema.
|
|
1089
1089
|
*
|
|
@@ -1093,7 +1093,7 @@ const d = {
|
|
|
1093
1093
|
* prop.boolean().default(false)
|
|
1094
1094
|
* ```
|
|
1095
1095
|
*/
|
|
1096
|
-
boolean: () => new
|
|
1096
|
+
boolean: () => new oe(),
|
|
1097
1097
|
/**
|
|
1098
1098
|
* Creates a function schema.
|
|
1099
1099
|
*
|
|
@@ -1106,7 +1106,7 @@ const d = {
|
|
|
1106
1106
|
* prop.function<(data: { id: string }) => Promise<void>>()
|
|
1107
1107
|
* ```
|
|
1108
1108
|
*/
|
|
1109
|
-
function: () => new
|
|
1109
|
+
function: () => new ae(),
|
|
1110
1110
|
/**
|
|
1111
1111
|
* Creates an array schema.
|
|
1112
1112
|
*
|
|
@@ -1119,7 +1119,7 @@ const d = {
|
|
|
1119
1119
|
* prop.array().of(prop.number()).min(1).max(10)
|
|
1120
1120
|
* ```
|
|
1121
1121
|
*/
|
|
1122
|
-
array: () => new
|
|
1122
|
+
array: () => new W(),
|
|
1123
1123
|
/**
|
|
1124
1124
|
* Creates an object schema.
|
|
1125
1125
|
*
|
|
@@ -1135,7 +1135,7 @@ const d = {
|
|
|
1135
1135
|
* prop.object().shape({ key: prop.string() }).strict()
|
|
1136
1136
|
* ```
|
|
1137
1137
|
*/
|
|
1138
|
-
object: () => new
|
|
1138
|
+
object: () => new B(),
|
|
1139
1139
|
/**
|
|
1140
1140
|
* Creates a literal schema for exact value matching.
|
|
1141
1141
|
*
|
|
@@ -1148,7 +1148,7 @@ const d = {
|
|
|
1148
1148
|
* prop.literal(true)
|
|
1149
1149
|
* ```
|
|
1150
1150
|
*/
|
|
1151
|
-
literal: (
|
|
1151
|
+
literal: (n) => new ce(n),
|
|
1152
1152
|
/**
|
|
1153
1153
|
* Creates an enum schema for a set of allowed values.
|
|
1154
1154
|
*
|
|
@@ -1160,7 +1160,7 @@ const d = {
|
|
|
1160
1160
|
* prop.enum([1, 2, 3])
|
|
1161
1161
|
* ```
|
|
1162
1162
|
*/
|
|
1163
|
-
enum: (
|
|
1163
|
+
enum: (n) => new le(n),
|
|
1164
1164
|
/**
|
|
1165
1165
|
* Creates a schema that accepts any value.
|
|
1166
1166
|
*
|
|
@@ -1172,173 +1172,173 @@ const d = {
|
|
|
1172
1172
|
* prop.any()
|
|
1173
1173
|
* ```
|
|
1174
1174
|
*/
|
|
1175
|
-
any: () => new
|
|
1176
|
-
},
|
|
1175
|
+
any: () => new ue()
|
|
1176
|
+
}, O = {
|
|
1177
1177
|
uid: {
|
|
1178
|
-
schema:
|
|
1178
|
+
schema: p.string().optional(),
|
|
1179
1179
|
sendToHost: !0
|
|
1180
1180
|
},
|
|
1181
1181
|
tag: {
|
|
1182
|
-
schema:
|
|
1182
|
+
schema: p.string().optional(),
|
|
1183
1183
|
sendToHost: !0
|
|
1184
1184
|
},
|
|
1185
1185
|
dimensions: {
|
|
1186
|
-
schema:
|
|
1186
|
+
schema: p.object().default(() => ({ width: "100%", height: "100%" })),
|
|
1187
1187
|
sendToHost: !1
|
|
1188
1188
|
},
|
|
1189
1189
|
timeout: {
|
|
1190
|
-
schema:
|
|
1190
|
+
schema: p.number().default(1e4),
|
|
1191
1191
|
sendToHost: !1
|
|
1192
1192
|
},
|
|
1193
1193
|
cspNonce: {
|
|
1194
|
-
schema:
|
|
1194
|
+
schema: p.string().optional(),
|
|
1195
1195
|
sendToHost: !0
|
|
1196
1196
|
},
|
|
1197
1197
|
// Lifecycle callbacks - not sent to host (consumer-only)
|
|
1198
1198
|
onDisplay: {
|
|
1199
|
-
schema:
|
|
1199
|
+
schema: p.function().optional(),
|
|
1200
1200
|
sendToHost: !1
|
|
1201
1201
|
},
|
|
1202
1202
|
onRendered: {
|
|
1203
|
-
schema:
|
|
1203
|
+
schema: p.function().optional(),
|
|
1204
1204
|
sendToHost: !1
|
|
1205
1205
|
},
|
|
1206
1206
|
onRender: {
|
|
1207
|
-
schema:
|
|
1207
|
+
schema: p.function().optional(),
|
|
1208
1208
|
sendToHost: !1
|
|
1209
1209
|
},
|
|
1210
1210
|
onPrerendered: {
|
|
1211
|
-
schema:
|
|
1211
|
+
schema: p.function().optional(),
|
|
1212
1212
|
sendToHost: !1
|
|
1213
1213
|
},
|
|
1214
1214
|
onPrerender: {
|
|
1215
|
-
schema:
|
|
1215
|
+
schema: p.function().optional(),
|
|
1216
1216
|
sendToHost: !1
|
|
1217
1217
|
},
|
|
1218
1218
|
onClose: {
|
|
1219
|
-
schema:
|
|
1219
|
+
schema: p.function().optional(),
|
|
1220
1220
|
sendToHost: !1
|
|
1221
1221
|
},
|
|
1222
1222
|
onDestroy: {
|
|
1223
|
-
schema:
|
|
1223
|
+
schema: p.function().optional(),
|
|
1224
1224
|
sendToHost: !1
|
|
1225
1225
|
},
|
|
1226
1226
|
onResize: {
|
|
1227
|
-
schema:
|
|
1227
|
+
schema: p.function().optional(),
|
|
1228
1228
|
sendToHost: !1
|
|
1229
1229
|
},
|
|
1230
1230
|
onFocus: {
|
|
1231
|
-
schema:
|
|
1231
|
+
schema: p.function().optional(),
|
|
1232
1232
|
sendToHost: !1
|
|
1233
1233
|
},
|
|
1234
1234
|
onError: {
|
|
1235
|
-
schema:
|
|
1235
|
+
schema: p.function().optional(),
|
|
1236
1236
|
sendToHost: !1
|
|
1237
1237
|
},
|
|
1238
1238
|
onProps: {
|
|
1239
|
-
schema:
|
|
1239
|
+
schema: p.function().optional(),
|
|
1240
1240
|
sendToHost: !1
|
|
1241
1241
|
}
|
|
1242
1242
|
};
|
|
1243
|
-
function
|
|
1244
|
-
return typeof
|
|
1243
|
+
function x(n) {
|
|
1244
|
+
return typeof n == "object" && n !== null && "~standard" in n && typeof n["~standard"] == "object" && n["~standard"] !== null && n["~standard"].version === 1 && typeof n["~standard"].vendor == "string" && typeof n["~standard"].validate == "function";
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1247
|
-
const
|
|
1248
|
-
if (
|
|
1246
|
+
function at(n, e, t) {
|
|
1247
|
+
const s = n["~standard"].validate(e);
|
|
1248
|
+
if (s instanceof Promise)
|
|
1249
1249
|
throw new Error(
|
|
1250
1250
|
`Prop "${t}" uses an async schema. ForgeFrame only supports synchronous schema validation. Please use a synchronous schema or remove async operations (like database lookups) from your schema definition.`
|
|
1251
1251
|
);
|
|
1252
|
-
if (
|
|
1253
|
-
const r =
|
|
1252
|
+
if (s.issues) {
|
|
1253
|
+
const r = s.issues.map((i) => `${ct(i.path, t)}: ${i.message}`);
|
|
1254
1254
|
throw new Error(`Validation failed: ${r.join("; ")}`);
|
|
1255
1255
|
}
|
|
1256
|
-
return
|
|
1256
|
+
return s.value;
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
if (!
|
|
1258
|
+
function ct(n, e) {
|
|
1259
|
+
if (!n || n.length === 0)
|
|
1260
1260
|
return e;
|
|
1261
|
-
const t =
|
|
1262
|
-
if (typeof
|
|
1263
|
-
if ("key" in
|
|
1264
|
-
return String(
|
|
1265
|
-
if ("index" in
|
|
1266
|
-
return String(
|
|
1261
|
+
const t = n.map((s) => {
|
|
1262
|
+
if (typeof s == "object" && s !== null) {
|
|
1263
|
+
if ("key" in s && s.key !== void 0)
|
|
1264
|
+
return String(s.key);
|
|
1265
|
+
if ("index" in s && typeof s.index == "number")
|
|
1266
|
+
return String(s.index);
|
|
1267
1267
|
}
|
|
1268
|
-
return String(
|
|
1268
|
+
return String(s);
|
|
1269
1269
|
});
|
|
1270
1270
|
return `${e}.${t.join(".")}`;
|
|
1271
1271
|
}
|
|
1272
|
-
function
|
|
1273
|
-
const e =
|
|
1274
|
-
return { isDirectSchema: e, definition: e ? { schema:
|
|
1272
|
+
function N(n) {
|
|
1273
|
+
const e = x(n);
|
|
1274
|
+
return { isDirectSchema: e, definition: e ? { schema: n } : n };
|
|
1275
1275
|
}
|
|
1276
|
-
function
|
|
1277
|
-
const
|
|
1278
|
-
...
|
|
1276
|
+
function Pe(n, e, t) {
|
|
1277
|
+
const s = {
|
|
1278
|
+
...O,
|
|
1279
1279
|
...e
|
|
1280
1280
|
}, r = {};
|
|
1281
|
-
for (const [i, o] of Object.entries(
|
|
1282
|
-
const { definition: a } =
|
|
1281
|
+
for (const [i, o] of Object.entries(s)) {
|
|
1282
|
+
const { definition: a } = N(o);
|
|
1283
1283
|
let c;
|
|
1284
|
-
const l = a.alias,
|
|
1285
|
-
if (
|
|
1286
|
-
c =
|
|
1287
|
-
else if (
|
|
1288
|
-
c =
|
|
1284
|
+
const l = a.alias, m = i in n, h = l && l in n;
|
|
1285
|
+
if (m)
|
|
1286
|
+
c = n[i];
|
|
1287
|
+
else if (h)
|
|
1288
|
+
c = n[l];
|
|
1289
1289
|
else if (a.value)
|
|
1290
1290
|
c = a.value(t);
|
|
1291
1291
|
else if (a.default !== void 0)
|
|
1292
1292
|
c = typeof a.default == "function" ? a.default(t) : a.default;
|
|
1293
|
-
else if (a.schema &&
|
|
1294
|
-
const
|
|
1295
|
-
!(
|
|
1293
|
+
else if (a.schema && x(a.schema)) {
|
|
1294
|
+
const d = a.schema["~standard"].validate(void 0);
|
|
1295
|
+
!(d instanceof Promise) && !d.issues && (c = d.value);
|
|
1296
1296
|
}
|
|
1297
1297
|
c !== void 0 && a.decorate && (c = a.decorate({ value: c, props: r })), r[i] = c;
|
|
1298
1298
|
}
|
|
1299
1299
|
return r;
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function S(n, e) {
|
|
1302
1302
|
const t = {
|
|
1303
|
-
...
|
|
1303
|
+
...O,
|
|
1304
1304
|
...e
|
|
1305
1305
|
};
|
|
1306
|
-
for (const [
|
|
1307
|
-
const { isDirectSchema: i, definition: o } =
|
|
1308
|
-
let a = s
|
|
1306
|
+
for (const [s, r] of Object.entries(t)) {
|
|
1307
|
+
const { isDirectSchema: i, definition: o } = N(r);
|
|
1308
|
+
let a = n[s];
|
|
1309
1309
|
if (o.required && a === void 0)
|
|
1310
|
-
throw new Error(`Prop "${
|
|
1311
|
-
if (o.schema &&
|
|
1312
|
-
(a !== void 0 || i) && (a =
|
|
1310
|
+
throw new Error(`Prop "${s}" is required but was not provided`);
|
|
1311
|
+
if (o.schema && x(o.schema))
|
|
1312
|
+
(a !== void 0 || i) && (a = at(o.schema, a, s), n[s] = a);
|
|
1313
1313
|
else if (a === void 0)
|
|
1314
1314
|
continue;
|
|
1315
|
-
o.validate && o.validate({ value: a, props:
|
|
1315
|
+
o.validate && o.validate({ value: a, props: n });
|
|
1316
1316
|
}
|
|
1317
1317
|
}
|
|
1318
|
-
function
|
|
1318
|
+
function Ee(n, e, t, s) {
|
|
1319
1319
|
const r = {
|
|
1320
|
-
...
|
|
1320
|
+
...O,
|
|
1321
1321
|
...e
|
|
1322
1322
|
}, i = {};
|
|
1323
1323
|
for (const [o, a] of Object.entries(r)) {
|
|
1324
|
-
const { definition: c } =
|
|
1325
|
-
if (c.sendToHost === !1 || c.sameDomain && !
|
|
1324
|
+
const { definition: c } = N(a), l = n[o];
|
|
1325
|
+
if (c.sendToHost === !1 || c.sameDomain && !s) continue;
|
|
1326
1326
|
if (c.trustedDomains) {
|
|
1327
|
-
const
|
|
1328
|
-
if (!
|
|
1327
|
+
const h = c.trustedDomains;
|
|
1328
|
+
if (!v(h, t)) continue;
|
|
1329
1329
|
}
|
|
1330
|
-
let
|
|
1331
|
-
c.hostDecorate && l !== void 0 && (
|
|
1330
|
+
let m = l;
|
|
1331
|
+
c.hostDecorate && l !== void 0 && (m = c.hostDecorate({ value: l, props: n })), i[o] = m;
|
|
1332
1332
|
}
|
|
1333
1333
|
return i;
|
|
1334
1334
|
}
|
|
1335
|
-
function
|
|
1336
|
-
const t = new URLSearchParams(),
|
|
1337
|
-
...
|
|
1335
|
+
function lt(n, e) {
|
|
1336
|
+
const t = new URLSearchParams(), s = {
|
|
1337
|
+
...O,
|
|
1338
1338
|
...e
|
|
1339
1339
|
};
|
|
1340
|
-
for (const [r, i] of Object.entries(
|
|
1341
|
-
const { definition: o } =
|
|
1340
|
+
for (const [r, i] of Object.entries(s)) {
|
|
1341
|
+
const { definition: o } = N(i), a = n[r];
|
|
1342
1342
|
if (a === void 0 || typeof a == "function" || !o.queryParam) continue;
|
|
1343
1343
|
const c = typeof o.queryParam == "string" ? o.queryParam : r;
|
|
1344
1344
|
let l;
|
|
@@ -1346,13 +1346,13 @@ function it(s, e) {
|
|
|
1346
1346
|
}
|
|
1347
1347
|
return t;
|
|
1348
1348
|
}
|
|
1349
|
-
function
|
|
1350
|
-
const t = new URLSearchParams(),
|
|
1351
|
-
...
|
|
1349
|
+
function ut(n, e) {
|
|
1350
|
+
const t = new URLSearchParams(), s = {
|
|
1351
|
+
...O,
|
|
1352
1352
|
...e
|
|
1353
1353
|
};
|
|
1354
|
-
for (const [r, i] of Object.entries(
|
|
1355
|
-
const { definition: o } =
|
|
1354
|
+
for (const [r, i] of Object.entries(s)) {
|
|
1355
|
+
const { definition: o } = N(i), a = n[r];
|
|
1356
1356
|
if (a === void 0 || typeof a == "function" || !o.bodyParam) continue;
|
|
1357
1357
|
const c = typeof o.bodyParam == "string" ? o.bodyParam : r;
|
|
1358
1358
|
let l;
|
|
@@ -1360,11 +1360,11 @@ function ot(s, e) {
|
|
|
1360
1360
|
}
|
|
1361
1361
|
return t;
|
|
1362
1362
|
}
|
|
1363
|
-
const
|
|
1364
|
-
function
|
|
1365
|
-
return !
|
|
1363
|
+
const be = 500, ht = /* @__PURE__ */ new Set(["__proto__"]);
|
|
1364
|
+
function Te(n) {
|
|
1365
|
+
return !ht.has(n);
|
|
1366
1366
|
}
|
|
1367
|
-
class
|
|
1367
|
+
class he {
|
|
1368
1368
|
/**
|
|
1369
1369
|
* Creates a new FunctionBridge instance.
|
|
1370
1370
|
*
|
|
@@ -1391,14 +1391,14 @@ class re {
|
|
|
1391
1391
|
* @returns A function reference that can be sent across domains
|
|
1392
1392
|
*/
|
|
1393
1393
|
serialize(e, t) {
|
|
1394
|
-
if (this.localFunctions.size >=
|
|
1394
|
+
if (this.localFunctions.size >= be) {
|
|
1395
1395
|
const r = this.localFunctions.keys().next().value;
|
|
1396
1396
|
r && this.localFunctions.delete(r);
|
|
1397
1397
|
}
|
|
1398
|
-
const
|
|
1399
|
-
return this.localFunctions.set(
|
|
1398
|
+
const s = L();
|
|
1399
|
+
return this.localFunctions.set(s, e), this.currentBatchIds.add(s), {
|
|
1400
1400
|
__type__: "function",
|
|
1401
|
-
__id__:
|
|
1401
|
+
__id__: s,
|
|
1402
1402
|
__name__: t || e.name || "anonymous"
|
|
1403
1403
|
};
|
|
1404
1404
|
}
|
|
@@ -1414,14 +1414,14 @@ class re {
|
|
|
1414
1414
|
* @param targetDomain - The origin of the target window
|
|
1415
1415
|
* @returns A callable wrapper function
|
|
1416
1416
|
*/
|
|
1417
|
-
deserialize(e, t,
|
|
1417
|
+
deserialize(e, t, s) {
|
|
1418
1418
|
const r = `${e.__id__}`, i = this.remoteFunctions.get(r);
|
|
1419
1419
|
if (i) return i;
|
|
1420
|
-
if (this.remoteFunctions.size >=
|
|
1420
|
+
if (this.remoteFunctions.size >= be) {
|
|
1421
1421
|
const a = this.remoteFunctions.keys().next().value;
|
|
1422
1422
|
a && this.remoteFunctions.delete(a);
|
|
1423
1423
|
}
|
|
1424
|
-
const o = async (...a) => this.messenger.send(t,
|
|
1424
|
+
const o = async (...a) => this.messenger.send(t, s, u.CALL, {
|
|
1425
1425
|
id: e.__id__,
|
|
1426
1426
|
args: a
|
|
1427
1427
|
});
|
|
@@ -1447,10 +1447,10 @@ class re {
|
|
|
1447
1447
|
this.messenger.on(
|
|
1448
1448
|
u.CALL,
|
|
1449
1449
|
async ({ id: e, args: t }) => {
|
|
1450
|
-
const
|
|
1451
|
-
if (!
|
|
1450
|
+
const s = this.localFunctions.get(e);
|
|
1451
|
+
if (!s)
|
|
1452
1452
|
throw new Error(`Function with id "${e}" not found`);
|
|
1453
|
-
return
|
|
1453
|
+
return s(...t);
|
|
1454
1454
|
}
|
|
1455
1455
|
);
|
|
1456
1456
|
}
|
|
@@ -1528,180 +1528,194 @@ class re {
|
|
|
1528
1528
|
this.localFunctions.clear(), this.remoteFunctions.clear(), this.currentBatchIds.clear();
|
|
1529
1529
|
}
|
|
1530
1530
|
}
|
|
1531
|
-
function
|
|
1532
|
-
if (typeof
|
|
1533
|
-
return e.serialize(
|
|
1534
|
-
if (Array.isArray(
|
|
1535
|
-
if (t.has(
|
|
1531
|
+
function Q(n, e, t = /* @__PURE__ */ new WeakSet()) {
|
|
1532
|
+
if (typeof n == "function")
|
|
1533
|
+
return e.serialize(n);
|
|
1534
|
+
if (Array.isArray(n)) {
|
|
1535
|
+
if (t.has(n))
|
|
1536
1536
|
throw new Error("Circular reference detected in props - arrays cannot contain circular references");
|
|
1537
|
-
t.add(
|
|
1537
|
+
t.add(n);
|
|
1538
1538
|
try {
|
|
1539
|
-
return
|
|
1539
|
+
return n.map((s) => Q(s, e, t));
|
|
1540
1540
|
} finally {
|
|
1541
|
-
t.delete(
|
|
1541
|
+
t.delete(n);
|
|
1542
1542
|
}
|
|
1543
1543
|
}
|
|
1544
|
-
if (typeof
|
|
1545
|
-
if (t.has(
|
|
1544
|
+
if (typeof n == "object" && n !== null) {
|
|
1545
|
+
if (t.has(n))
|
|
1546
1546
|
throw new Error("Circular reference detected in props - objects cannot contain circular references");
|
|
1547
|
-
t.add(
|
|
1547
|
+
t.add(n);
|
|
1548
1548
|
try {
|
|
1549
|
-
const
|
|
1550
|
-
for (const [r, i] of Object.entries(
|
|
1551
|
-
|
|
1552
|
-
return
|
|
1549
|
+
const s = {};
|
|
1550
|
+
for (const [r, i] of Object.entries(n))
|
|
1551
|
+
Te(r) && (s[r] = Q(i, e, t));
|
|
1552
|
+
return s;
|
|
1553
1553
|
} finally {
|
|
1554
|
-
t.delete(
|
|
1554
|
+
t.delete(n);
|
|
1555
1555
|
}
|
|
1556
1556
|
}
|
|
1557
|
-
return
|
|
1557
|
+
return n;
|
|
1558
1558
|
}
|
|
1559
|
-
function
|
|
1560
|
-
if (
|
|
1561
|
-
return e.deserialize(
|
|
1562
|
-
if (Array.isArray(
|
|
1563
|
-
if (r.has(
|
|
1559
|
+
function ee(n, e, t, s, r = /* @__PURE__ */ new WeakSet()) {
|
|
1560
|
+
if (he.isFunctionRef(n))
|
|
1561
|
+
return e.deserialize(n, t, s);
|
|
1562
|
+
if (Array.isArray(n)) {
|
|
1563
|
+
if (r.has(n))
|
|
1564
1564
|
throw new Error("Circular reference detected in serialized props");
|
|
1565
|
-
r.add(
|
|
1565
|
+
r.add(n);
|
|
1566
1566
|
try {
|
|
1567
|
-
return
|
|
1568
|
-
(i) =>
|
|
1567
|
+
return n.map(
|
|
1568
|
+
(i) => ee(i, e, t, s, r)
|
|
1569
1569
|
);
|
|
1570
1570
|
} finally {
|
|
1571
|
-
r.delete(
|
|
1571
|
+
r.delete(n);
|
|
1572
1572
|
}
|
|
1573
1573
|
}
|
|
1574
|
-
if (typeof
|
|
1575
|
-
if (r.has(
|
|
1574
|
+
if (typeof n == "object" && n !== null) {
|
|
1575
|
+
if (r.has(n))
|
|
1576
1576
|
throw new Error("Circular reference detected in serialized props");
|
|
1577
|
-
r.add(
|
|
1577
|
+
r.add(n);
|
|
1578
1578
|
try {
|
|
1579
1579
|
const i = {};
|
|
1580
|
-
for (const [o, a] of Object.entries(
|
|
1581
|
-
|
|
1580
|
+
for (const [o, a] of Object.entries(n))
|
|
1581
|
+
Te(o) && (i[o] = ee(a, e, t, s, r));
|
|
1582
1582
|
return i;
|
|
1583
1583
|
} finally {
|
|
1584
|
-
r.delete(
|
|
1584
|
+
r.delete(n);
|
|
1585
1585
|
}
|
|
1586
1586
|
}
|
|
1587
|
-
return
|
|
1587
|
+
return n;
|
|
1588
1588
|
}
|
|
1589
|
-
const
|
|
1590
|
-
function
|
|
1591
|
-
return !
|
|
1589
|
+
const dt = /* @__PURE__ */ new Set(["__proto__"]), te = "__forgeframe.dotify_path__:";
|
|
1590
|
+
function Ue(n) {
|
|
1591
|
+
return !dt.has(n);
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1593
|
+
function Ne(n, e = []) {
|
|
1594
1594
|
const t = [];
|
|
1595
|
-
for (const [
|
|
1596
|
-
const i = e
|
|
1595
|
+
for (const [s, r] of Object.entries(n)) {
|
|
1596
|
+
const i = [...e, s];
|
|
1597
1597
|
if (r !== null && typeof r == "object" && !Array.isArray(r))
|
|
1598
|
-
t.push(
|
|
1598
|
+
t.push(Ne(r, i));
|
|
1599
1599
|
else {
|
|
1600
|
-
const o = encodeURIComponent(
|
|
1601
|
-
|
|
1600
|
+
const o = `${te}${encodeURIComponent(
|
|
1601
|
+
JSON.stringify(i)
|
|
1602
|
+
)}`, a = encodeURIComponent(JSON.stringify(r));
|
|
1603
|
+
t.push(`${o}=${a}`);
|
|
1602
1604
|
}
|
|
1603
1605
|
}
|
|
1604
1606
|
return t.filter(Boolean).join("&");
|
|
1605
1607
|
}
|
|
1606
|
-
function
|
|
1608
|
+
function pt(n) {
|
|
1607
1609
|
const e = {};
|
|
1608
|
-
if (!
|
|
1609
|
-
const t =
|
|
1610
|
-
for (const
|
|
1611
|
-
const
|
|
1612
|
-
if (
|
|
1613
|
-
|
|
1610
|
+
if (!n) return e;
|
|
1611
|
+
const t = n.split("&");
|
|
1612
|
+
for (const s of t) {
|
|
1613
|
+
const r = s.indexOf("=");
|
|
1614
|
+
if (r === -1) continue;
|
|
1615
|
+
const i = s.slice(0, r), o = s.slice(r + 1);
|
|
1616
|
+
if (!i || o === void 0) continue;
|
|
1617
|
+
let a;
|
|
1614
1618
|
try {
|
|
1615
|
-
|
|
1619
|
+
a = JSON.parse(decodeURIComponent(o));
|
|
1616
1620
|
} catch {
|
|
1617
|
-
|
|
1621
|
+
a = decodeURIComponent(o);
|
|
1618
1622
|
}
|
|
1619
|
-
const
|
|
1620
|
-
if (
|
|
1621
|
-
let
|
|
1622
|
-
for (let h = 0; h <
|
|
1623
|
-
const
|
|
1624
|
-
(!Object.prototype.hasOwnProperty.call(
|
|
1623
|
+
const c = ft(i);
|
|
1624
|
+
if (c.some((h) => !Ue(h))) continue;
|
|
1625
|
+
let l = e;
|
|
1626
|
+
for (let h = 0; h < c.length - 1; h++) {
|
|
1627
|
+
const d = c[h], C = l[d];
|
|
1628
|
+
(!Object.prototype.hasOwnProperty.call(l, d) || typeof C != "object" || C === null || Array.isArray(C)) && (l[d] = {}), l = l[d];
|
|
1625
1629
|
}
|
|
1626
|
-
const
|
|
1627
|
-
|
|
1630
|
+
const m = c[c.length - 1];
|
|
1631
|
+
l[m] = a;
|
|
1628
1632
|
}
|
|
1629
1633
|
return e;
|
|
1630
1634
|
}
|
|
1631
|
-
function
|
|
1632
|
-
|
|
1635
|
+
function ft(n) {
|
|
1636
|
+
if (!n.startsWith(te))
|
|
1637
|
+
throw new Error("Invalid DOTIFY path framing");
|
|
1638
|
+
const e = decodeURIComponent(
|
|
1639
|
+
n.slice(te.length)
|
|
1640
|
+
), t = JSON.parse(e);
|
|
1641
|
+
if (Array.isArray(t) && t.length > 0 && t.every((s) => typeof s == "string"))
|
|
1642
|
+
return t;
|
|
1643
|
+
throw new Error("Invalid DOTIFY path framing");
|
|
1644
|
+
}
|
|
1645
|
+
function mt(n) {
|
|
1646
|
+
return typeof n == "object" && n !== null && n.__type__ === "dotify" && typeof n.__value__ == "string";
|
|
1633
1647
|
}
|
|
1634
|
-
function
|
|
1635
|
-
const
|
|
1636
|
-
...
|
|
1648
|
+
function gt(n, e, t) {
|
|
1649
|
+
const s = {
|
|
1650
|
+
...O,
|
|
1637
1651
|
...e
|
|
1638
1652
|
}, r = {};
|
|
1639
|
-
for (const [i, o] of Object.entries(
|
|
1653
|
+
for (const [i, o] of Object.entries(n)) {
|
|
1640
1654
|
if (o === void 0) continue;
|
|
1641
|
-
const a =
|
|
1642
|
-
r[i] =
|
|
1655
|
+
const a = s[i];
|
|
1656
|
+
r[i] = yt(o, a, t);
|
|
1643
1657
|
}
|
|
1644
1658
|
return r;
|
|
1645
1659
|
}
|
|
1646
|
-
function
|
|
1647
|
-
if (typeof
|
|
1648
|
-
return t.serialize(
|
|
1649
|
-
const
|
|
1650
|
-
if (
|
|
1651
|
-
const r = JSON.stringify(
|
|
1660
|
+
function yt(n, e, t) {
|
|
1661
|
+
if (typeof n == "function")
|
|
1662
|
+
return t.serialize(n);
|
|
1663
|
+
const s = e?.serialization ?? A.JSON;
|
|
1664
|
+
if (s === A.BASE64 && typeof n == "object") {
|
|
1665
|
+
const r = JSON.stringify(n);
|
|
1652
1666
|
return {
|
|
1653
1667
|
__type__: "base64",
|
|
1654
1668
|
__value__: btoa(encodeURIComponent(r))
|
|
1655
1669
|
};
|
|
1656
1670
|
}
|
|
1657
|
-
return
|
|
1671
|
+
return s === A.DOTIFY && typeof n == "object" && n !== null && !Array.isArray(n) ? {
|
|
1658
1672
|
__type__: "dotify",
|
|
1659
|
-
__value__:
|
|
1660
|
-
} :
|
|
1673
|
+
__value__: Ne(n)
|
|
1674
|
+
} : Q(n, t);
|
|
1661
1675
|
}
|
|
1662
|
-
function
|
|
1676
|
+
function Oe(n, e, t, s, r, i) {
|
|
1663
1677
|
const o = {
|
|
1664
|
-
...
|
|
1678
|
+
...O,
|
|
1665
1679
|
...e
|
|
1666
1680
|
}, a = {};
|
|
1667
|
-
for (const [c, l] of Object.entries(
|
|
1668
|
-
if (!
|
|
1669
|
-
const
|
|
1670
|
-
a[c] =
|
|
1681
|
+
for (const [c, l] of Object.entries(n)) {
|
|
1682
|
+
if (!Ue(c)) continue;
|
|
1683
|
+
const m = o[c];
|
|
1684
|
+
a[c] = wt(
|
|
1671
1685
|
l,
|
|
1672
|
-
|
|
1686
|
+
m,
|
|
1673
1687
|
t,
|
|
1674
|
-
|
|
1688
|
+
s,
|
|
1675
1689
|
r,
|
|
1676
1690
|
i
|
|
1677
1691
|
);
|
|
1678
1692
|
}
|
|
1679
1693
|
return a;
|
|
1680
1694
|
}
|
|
1681
|
-
function
|
|
1682
|
-
if (
|
|
1695
|
+
function wt(n, e, t, s, r, i) {
|
|
1696
|
+
if (_t(n))
|
|
1683
1697
|
try {
|
|
1684
|
-
const o = decodeURIComponent(atob(
|
|
1698
|
+
const o = decodeURIComponent(atob(n.__value__));
|
|
1685
1699
|
return JSON.parse(o);
|
|
1686
1700
|
} catch {
|
|
1687
|
-
return
|
|
1701
|
+
return n;
|
|
1688
1702
|
}
|
|
1689
|
-
if (
|
|
1703
|
+
if (mt(n))
|
|
1690
1704
|
try {
|
|
1691
|
-
return
|
|
1705
|
+
return pt(n.__value__);
|
|
1692
1706
|
} catch {
|
|
1693
|
-
return
|
|
1707
|
+
return n;
|
|
1694
1708
|
}
|
|
1695
|
-
return
|
|
1709
|
+
return ee(n, s, r, i);
|
|
1696
1710
|
}
|
|
1697
|
-
function
|
|
1698
|
-
return typeof
|
|
1711
|
+
function _t(n) {
|
|
1712
|
+
return typeof n == "object" && n !== null && n.__type__ === "base64" && typeof n.__value__ == "string";
|
|
1699
1713
|
}
|
|
1700
|
-
class
|
|
1701
|
-
constructor(e, t,
|
|
1702
|
-
this.options = e, this.createPropContext =
|
|
1714
|
+
class Pt {
|
|
1715
|
+
constructor(e, t, s) {
|
|
1716
|
+
this.options = e, this.createPropContext = s, this.inputProps = { ...t };
|
|
1703
1717
|
const r = this.inputProps, i = this.createPropContext(r);
|
|
1704
|
-
this.props =
|
|
1718
|
+
this.props = Pe(r, this.options.props, i);
|
|
1705
1719
|
}
|
|
1706
1720
|
/** Current normalized prop snapshot. */
|
|
1707
1721
|
props;
|
|
@@ -1713,18 +1727,30 @@ class mt {
|
|
|
1713
1727
|
* Builds and validates the next props snapshot.
|
|
1714
1728
|
*/
|
|
1715
1729
|
buildNextProps(e) {
|
|
1716
|
-
const t = { ...this.inputProps, ...e },
|
|
1717
|
-
return
|
|
1730
|
+
const t = { ...this.inputProps, ...e }, s = { ...this.props, ...e }, r = this.createPropContext(s), i = Pe(s, this.options.props, r);
|
|
1731
|
+
return S(i, this.options.props), this.options.validate?.({ props: i }), { nextInputProps: t, nextProps: i };
|
|
1718
1732
|
}
|
|
1719
1733
|
/**
|
|
1720
1734
|
* Applies a props update and synchronizes it to the host when connected.
|
|
1721
1735
|
*/
|
|
1722
1736
|
updateProps(e, t) {
|
|
1723
1737
|
return this.queuePropsUpdate(async () => {
|
|
1724
|
-
const { nextInputProps:
|
|
1725
|
-
t.assertStableRenderedOrigin(o), this.inputProps =
|
|
1738
|
+
const { nextInputProps: s, nextProps: r } = this.buildNextProps(e), i = t.resolveUrl(r), o = t.resolveUrlOrigin(i);
|
|
1739
|
+
t.assertStableRenderedOrigin(o), this.inputProps = s, this.props = r, t.isRendered() || t.syncTrustedDomainForUrl(i), t.shouldSendPropsToHost() && await t.sendPropsUpdateToHost(r), t.emitPropsUpdated(r);
|
|
1726
1740
|
}, t.shouldSendPropsToHost);
|
|
1727
1741
|
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Queues a host synchronization for the current props snapshot.
|
|
1744
|
+
*
|
|
1745
|
+
* @remarks
|
|
1746
|
+
* This shares the same serialization queue as updateProps so function bridge
|
|
1747
|
+
* batches cannot overlap with user-initiated prop updates.
|
|
1748
|
+
*/
|
|
1749
|
+
syncCurrentPropsToHost(e) {
|
|
1750
|
+
return this.queuePropsUpdate(async () => {
|
|
1751
|
+
e.shouldSendPropsToHost() && await e.sendPropsUpdateToHost(this.props);
|
|
1752
|
+
}, e.shouldSendPropsToHost);
|
|
1753
|
+
}
|
|
1728
1754
|
/**
|
|
1729
1755
|
* Queues prop updates when a previous host sync is in flight.
|
|
1730
1756
|
*/
|
|
@@ -1733,8 +1759,8 @@ class mt {
|
|
|
1733
1759
|
const r = e();
|
|
1734
1760
|
return t() && this.trackPendingUpdate(r), r;
|
|
1735
1761
|
}
|
|
1736
|
-
const
|
|
1737
|
-
return this.trackPendingUpdate(
|
|
1762
|
+
const s = this.pendingPropsUpdate.then(e, e);
|
|
1763
|
+
return this.trackPendingUpdate(s), s;
|
|
1738
1764
|
}
|
|
1739
1765
|
/**
|
|
1740
1766
|
* Tracks a promise as the active queued update and clears it when settled.
|
|
@@ -1751,46 +1777,76 @@ class mt {
|
|
|
1751
1777
|
});
|
|
1752
1778
|
}
|
|
1753
1779
|
}
|
|
1754
|
-
function
|
|
1755
|
-
return
|
|
1780
|
+
function R(n, e = "100%") {
|
|
1781
|
+
return n === void 0 ? e : typeof n == "number" ? `${n}px` : n;
|
|
1756
1782
|
}
|
|
1757
|
-
function
|
|
1758
|
-
if (
|
|
1759
|
-
if (typeof
|
|
1760
|
-
const t = parseInt(
|
|
1783
|
+
function j(n, e) {
|
|
1784
|
+
if (n === void 0) return e;
|
|
1785
|
+
if (typeof n == "number") return n;
|
|
1786
|
+
const t = parseInt(n, 10);
|
|
1761
1787
|
return isNaN(t) ? e : t;
|
|
1762
1788
|
}
|
|
1763
|
-
function
|
|
1789
|
+
function Et(n) {
|
|
1790
|
+
const { name: e, dimensions: t, attributes: s = {}, style: r = {} } = n, i = document.createElement("iframe");
|
|
1791
|
+
return i.name = e, i.setAttribute("frameborder", "0"), i.setAttribute("allowtransparency", "true"), i.setAttribute("scrolling", "auto"), Fe(i, t), Dt(i, s), xt(i, r), It(i, s), i;
|
|
1792
|
+
}
|
|
1793
|
+
function bt(n) {
|
|
1764
1794
|
try {
|
|
1765
|
-
|
|
1795
|
+
n.src = "about:blank", n.parentNode?.removeChild(n);
|
|
1766
1796
|
} catch {
|
|
1767
1797
|
}
|
|
1768
1798
|
}
|
|
1769
|
-
function
|
|
1770
|
-
|
|
1799
|
+
function Ot(n, e) {
|
|
1800
|
+
Fe(n, e);
|
|
1771
1801
|
}
|
|
1772
|
-
function
|
|
1773
|
-
|
|
1802
|
+
function Ct(n) {
|
|
1803
|
+
n.style.display = "", n.style.visibility = "visible";
|
|
1774
1804
|
}
|
|
1775
|
-
function
|
|
1776
|
-
|
|
1805
|
+
function Ce(n) {
|
|
1806
|
+
n.style.display = "none", n.style.visibility = "hidden";
|
|
1777
1807
|
}
|
|
1778
|
-
function
|
|
1808
|
+
function Rt(n) {
|
|
1779
1809
|
try {
|
|
1780
|
-
|
|
1810
|
+
n.focus(), n.contentWindow?.focus();
|
|
1781
1811
|
} catch {
|
|
1782
1812
|
}
|
|
1783
1813
|
}
|
|
1784
|
-
function
|
|
1785
|
-
e.width !== void 0 && (
|
|
1814
|
+
function Fe(n, e) {
|
|
1815
|
+
e.width !== void 0 && (n.style.width = R(e.width)), e.height !== void 0 && (n.style.height = R(e.height));
|
|
1816
|
+
}
|
|
1817
|
+
function xt(n, e) {
|
|
1818
|
+
for (const [t, s] of Object.entries(e)) {
|
|
1819
|
+
if (s === void 0) continue;
|
|
1820
|
+
const r = typeof s == "number" ? `${s}px` : s;
|
|
1821
|
+
n.style.setProperty(
|
|
1822
|
+
t.replace(/([A-Z])/g, "-$1").toLowerCase(),
|
|
1823
|
+
r
|
|
1824
|
+
);
|
|
1825
|
+
}
|
|
1826
|
+
}
|
|
1827
|
+
function Dt(n, e) {
|
|
1828
|
+
for (const [t, s] of Object.entries(e))
|
|
1829
|
+
if (s !== void 0) {
|
|
1830
|
+
if (typeof s == "boolean") {
|
|
1831
|
+
s && n.setAttribute(t, "");
|
|
1832
|
+
continue;
|
|
1833
|
+
}
|
|
1834
|
+
n.setAttribute(t, s);
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1837
|
+
function It(n, e) {
|
|
1838
|
+
e.sandbox || n.setAttribute(
|
|
1839
|
+
"sandbox",
|
|
1840
|
+
"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"
|
|
1841
|
+
);
|
|
1786
1842
|
}
|
|
1787
|
-
class
|
|
1843
|
+
class He extends Error {
|
|
1788
1844
|
constructor(e = "Popup blocked by browser") {
|
|
1789
1845
|
super(e), this.name = "PopupOpenError";
|
|
1790
1846
|
}
|
|
1791
1847
|
}
|
|
1792
|
-
function
|
|
1793
|
-
const { url: e, name: t, dimensions:
|
|
1848
|
+
function St(n) {
|
|
1849
|
+
const { url: e, name: t, dimensions: s } = n, r = j(s.width, 500), i = j(s.height, 500), o = Math.floor(window.screenX + (window.outerWidth - r) / 2), a = Math.floor(window.screenY + (window.outerHeight - i) / 2), c = [
|
|
1794
1850
|
`width=${r}`,
|
|
1795
1851
|
`height=${i}`,
|
|
1796
1852
|
`left=${o}`,
|
|
@@ -1803,50 +1859,50 @@ function Et(s) {
|
|
|
1803
1859
|
"resizable=yes",
|
|
1804
1860
|
"scrollbars=yes"
|
|
1805
1861
|
].join(","), l = window.open(e, t, c);
|
|
1806
|
-
if (!l ||
|
|
1807
|
-
throw new
|
|
1862
|
+
if (!l || Ut(l))
|
|
1863
|
+
throw new He();
|
|
1808
1864
|
return l;
|
|
1809
1865
|
}
|
|
1810
|
-
function
|
|
1866
|
+
function vt(n) {
|
|
1811
1867
|
try {
|
|
1812
|
-
|
|
1868
|
+
n.closed || n.close();
|
|
1813
1869
|
} catch {
|
|
1814
1870
|
}
|
|
1815
1871
|
}
|
|
1816
|
-
function
|
|
1872
|
+
function Tt(n) {
|
|
1817
1873
|
try {
|
|
1818
|
-
|
|
1874
|
+
n.closed || n.focus();
|
|
1819
1875
|
} catch {
|
|
1820
1876
|
}
|
|
1821
1877
|
}
|
|
1822
|
-
function
|
|
1823
|
-
if (!
|
|
1878
|
+
function Ut(n) {
|
|
1879
|
+
if (!n) return !0;
|
|
1824
1880
|
try {
|
|
1825
|
-
return !!(
|
|
1881
|
+
return !!(n.closed || n.innerHeight === 0 || n.innerWidth === 0);
|
|
1826
1882
|
} catch {
|
|
1827
1883
|
return !0;
|
|
1828
1884
|
}
|
|
1829
1885
|
}
|
|
1830
|
-
function
|
|
1886
|
+
function Nt(n, e, t = {}) {
|
|
1831
1887
|
const {
|
|
1832
|
-
initialInterval:
|
|
1888
|
+
initialInterval: s = 100,
|
|
1833
1889
|
// Start fast to catch quick closes
|
|
1834
1890
|
maxInterval: r = 2e3,
|
|
1835
1891
|
// Cap at 2 seconds
|
|
1836
1892
|
multiplier: i = 1.5
|
|
1837
1893
|
// Exponential backoff multiplier
|
|
1838
1894
|
} = t;
|
|
1839
|
-
let o =
|
|
1895
|
+
let o = s, a, c = !1;
|
|
1840
1896
|
const l = () => {
|
|
1841
1897
|
try {
|
|
1842
1898
|
e();
|
|
1843
|
-
} catch (
|
|
1844
|
-
console.error("Error in popup close callback:",
|
|
1899
|
+
} catch (h) {
|
|
1900
|
+
console.error("Error in popup close callback:", h);
|
|
1845
1901
|
}
|
|
1846
|
-
},
|
|
1902
|
+
}, m = () => {
|
|
1847
1903
|
if (!c) {
|
|
1848
1904
|
try {
|
|
1849
|
-
if (
|
|
1905
|
+
if (n.closed) {
|
|
1850
1906
|
l();
|
|
1851
1907
|
return;
|
|
1852
1908
|
}
|
|
@@ -1854,59 +1910,59 @@ function Ot(s, e, t = {}) {
|
|
|
1854
1910
|
l();
|
|
1855
1911
|
return;
|
|
1856
1912
|
}
|
|
1857
|
-
o = Math.min(o * i, r), a = setTimeout(
|
|
1913
|
+
o = Math.min(o * i, r), a = setTimeout(m, o);
|
|
1858
1914
|
}
|
|
1859
1915
|
};
|
|
1860
|
-
return a = setTimeout(
|
|
1916
|
+
return a = setTimeout(m, o), () => {
|
|
1861
1917
|
c = !0, clearTimeout(a);
|
|
1862
1918
|
};
|
|
1863
1919
|
}
|
|
1864
|
-
function
|
|
1920
|
+
function Ft(n, e) {
|
|
1865
1921
|
try {
|
|
1866
|
-
const t =
|
|
1922
|
+
const t = j(e.width, n.outerWidth), s = j(
|
|
1867
1923
|
e.height,
|
|
1868
|
-
|
|
1924
|
+
n.outerHeight
|
|
1869
1925
|
);
|
|
1870
|
-
|
|
1926
|
+
n.resizeTo(t, s);
|
|
1871
1927
|
} catch {
|
|
1872
1928
|
}
|
|
1873
1929
|
}
|
|
1874
|
-
const
|
|
1875
|
-
function
|
|
1876
|
-
const t =
|
|
1930
|
+
const Re = "forgeframe-spinner-style";
|
|
1931
|
+
function Ht(n, e) {
|
|
1932
|
+
const t = n.getElementById(Re);
|
|
1877
1933
|
if (t) {
|
|
1878
1934
|
const r = t.getAttribute("nonce");
|
|
1879
1935
|
if (!e || r === e)
|
|
1880
1936
|
return;
|
|
1881
1937
|
t.remove();
|
|
1882
1938
|
}
|
|
1883
|
-
const
|
|
1884
|
-
|
|
1939
|
+
const s = n.createElement("style");
|
|
1940
|
+
s.id = Re, e && s.setAttribute("nonce", e), s.textContent = `
|
|
1885
1941
|
@keyframes forgeframe-spin {
|
|
1886
1942
|
to { transform: rotate(360deg); }
|
|
1887
1943
|
}
|
|
1888
|
-
`, (
|
|
1944
|
+
`, (n.head ?? n.documentElement).appendChild(s);
|
|
1889
1945
|
}
|
|
1890
|
-
function
|
|
1891
|
-
const { doc: e, dimensions: t, uid:
|
|
1892
|
-
return i.id = `forgeframe-container-${
|
|
1946
|
+
function $t(n) {
|
|
1947
|
+
const { doc: e, dimensions: t, uid: s, tag: r } = n, i = e.createElement("div");
|
|
1948
|
+
return i.id = `forgeframe-container-${s}`, i.setAttribute("data-forgeframe-tag", r), Object.assign(i.style, {
|
|
1893
1949
|
display: "inline-block",
|
|
1894
1950
|
position: "relative",
|
|
1895
|
-
width:
|
|
1896
|
-
height:
|
|
1951
|
+
width: R(t.width),
|
|
1952
|
+
height: R(t.height),
|
|
1897
1953
|
overflow: "hidden"
|
|
1898
1954
|
}), i;
|
|
1899
1955
|
}
|
|
1900
|
-
function
|
|
1901
|
-
const { doc: e, dimensions: t, cspNonce:
|
|
1902
|
-
|
|
1956
|
+
function At(n) {
|
|
1957
|
+
const { doc: e, dimensions: t, cspNonce: s } = n;
|
|
1958
|
+
Ht(e, s);
|
|
1903
1959
|
const r = e.createElement("div");
|
|
1904
1960
|
Object.assign(r.style, {
|
|
1905
1961
|
display: "flex",
|
|
1906
1962
|
alignItems: "center",
|
|
1907
1963
|
justifyContent: "center",
|
|
1908
|
-
width:
|
|
1909
|
-
height:
|
|
1964
|
+
width: R(t.width),
|
|
1965
|
+
height: R(t.height),
|
|
1910
1966
|
backgroundColor: "#f5f5f5",
|
|
1911
1967
|
position: "absolute",
|
|
1912
1968
|
top: "0",
|
|
@@ -1923,22 +1979,22 @@ function It(s) {
|
|
|
1923
1979
|
animation: "forgeframe-spin 1s linear infinite"
|
|
1924
1980
|
}), r.appendChild(i), r;
|
|
1925
1981
|
}
|
|
1926
|
-
function
|
|
1982
|
+
function Lt(n, e = 200) {
|
|
1927
1983
|
return new Promise((t) => {
|
|
1928
|
-
|
|
1984
|
+
n.style.opacity = "0", n.style.transition = `opacity ${e}ms ease-in`, n.offsetHeight, n.style.opacity = "1", setTimeout(t, e);
|
|
1929
1985
|
});
|
|
1930
1986
|
}
|
|
1931
|
-
function
|
|
1987
|
+
function zt(n, e = 200) {
|
|
1932
1988
|
return new Promise((t) => {
|
|
1933
|
-
|
|
1989
|
+
n.style.transition = `opacity ${e}ms ease-out`, n.style.opacity = "0", setTimeout(t, e);
|
|
1934
1990
|
});
|
|
1935
1991
|
}
|
|
1936
|
-
async function
|
|
1937
|
-
e && (await
|
|
1992
|
+
async function Mt(n, e, t) {
|
|
1993
|
+
e && (await zt(e, 150), e.remove()), t.style.display = "", t.style.visibility = "visible", t.style.opacity = "0", await Lt(t, 150);
|
|
1938
1994
|
}
|
|
1939
|
-
class
|
|
1940
|
-
constructor(e, t,
|
|
1941
|
-
this.options = e, this.uid = t, this.getProps =
|
|
1995
|
+
class kt {
|
|
1996
|
+
constructor(e, t, s, r, i) {
|
|
1997
|
+
this.options = e, this.uid = t, this.getProps = s, this.resolveDimensions = r, this.callbacks = i, this.context = this.options.defaultContext;
|
|
1942
1998
|
}
|
|
1943
1999
|
/** Active rendering context. */
|
|
1944
2000
|
context;
|
|
@@ -1948,6 +2004,8 @@ class Nt {
|
|
|
1948
2004
|
container = null;
|
|
1949
2005
|
/** Prerender element currently displayed while host initializes. */
|
|
1950
2006
|
prerenderElement = null;
|
|
2007
|
+
/** Wrapper element created and owned by the renderer. */
|
|
2008
|
+
ownedContainer = null;
|
|
1951
2009
|
/**
|
|
1952
2010
|
* Resolves a container selector or element to an HTMLElement.
|
|
1953
2011
|
*/
|
|
@@ -1967,80 +2025,80 @@ class Nt {
|
|
|
1967
2025
|
*/
|
|
1968
2026
|
async prerender(e, t) {
|
|
1969
2027
|
if (!this.container) return;
|
|
1970
|
-
const
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
2028
|
+
const s = this.container;
|
|
2029
|
+
this.ownedContainer = null;
|
|
2030
|
+
const r = this.getProps(), i = this.options.prerenderTemplate ?? At, o = this.options.containerTemplate ?? $t, a = this.resolveDimensions(), c = r.cspNonce;
|
|
2031
|
+
if (this.context === f.IFRAME) {
|
|
2032
|
+
const d = t();
|
|
2033
|
+
this.iframe = e(d), Ce(this.iframe);
|
|
1974
2034
|
}
|
|
1975
|
-
const
|
|
2035
|
+
const l = {
|
|
1976
2036
|
uid: this.uid,
|
|
1977
2037
|
tag: this.options.tag,
|
|
1978
2038
|
context: this.context,
|
|
1979
|
-
dimensions:
|
|
1980
|
-
props:
|
|
2039
|
+
dimensions: a,
|
|
2040
|
+
props: r,
|
|
1981
2041
|
doc: document,
|
|
1982
|
-
container:
|
|
2042
|
+
container: s,
|
|
1983
2043
|
frame: this.iframe,
|
|
1984
2044
|
prerenderFrame: null,
|
|
1985
2045
|
close: () => this.callbacks.close(),
|
|
1986
2046
|
focus: () => this.callbacks.focus(),
|
|
1987
|
-
cspNonce:
|
|
2047
|
+
cspNonce: c
|
|
1988
2048
|
};
|
|
1989
|
-
this.prerenderElement =
|
|
1990
|
-
const
|
|
2049
|
+
this.prerenderElement = i(l);
|
|
2050
|
+
const m = {
|
|
1991
2051
|
uid: this.uid,
|
|
1992
2052
|
tag: this.options.tag,
|
|
1993
2053
|
context: this.context,
|
|
1994
|
-
dimensions:
|
|
1995
|
-
props:
|
|
2054
|
+
dimensions: a,
|
|
2055
|
+
props: r,
|
|
1996
2056
|
doc: document,
|
|
1997
|
-
container:
|
|
2057
|
+
container: s,
|
|
1998
2058
|
frame: this.iframe,
|
|
1999
2059
|
prerenderFrame: this.prerenderElement,
|
|
2000
2060
|
close: () => this.callbacks.close(),
|
|
2001
2061
|
focus: () => this.callbacks.focus(),
|
|
2002
|
-
cspNonce:
|
|
2003
|
-
}, h =
|
|
2004
|
-
|
|
2062
|
+
cspNonce: c
|
|
2063
|
+
}, h = o(m);
|
|
2064
|
+
if (h) {
|
|
2065
|
+
if (h !== s) {
|
|
2066
|
+
const d = !h.parentNode;
|
|
2067
|
+
s.appendChild(h), d && (this.ownedContainer = h);
|
|
2068
|
+
}
|
|
2069
|
+
this.container = h;
|
|
2070
|
+
}
|
|
2071
|
+
this.prerenderElement && !this.prerenderElement.parentNode && this.container.appendChild(this.prerenderElement), this.iframe && !this.iframe.parentNode && this.container.appendChild(this.iframe);
|
|
2005
2072
|
}
|
|
2006
2073
|
/**
|
|
2007
2074
|
* Creates an iframe element without setting src (for prerender phase).
|
|
2008
2075
|
*/
|
|
2009
2076
|
createIframeElement(e) {
|
|
2010
|
-
const t =
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
t.style.setProperty(
|
|
2018
|
-
a.replace(/([A-Z])/g, "-$1").toLowerCase(),
|
|
2019
|
-
String(l)
|
|
2020
|
-
);
|
|
2021
|
-
}
|
|
2022
|
-
return i.sandbox || t.setAttribute(
|
|
2023
|
-
"sandbox",
|
|
2024
|
-
"allow-scripts allow-same-origin allow-forms allow-popups allow-popups-to-escape-sandbox"
|
|
2025
|
-
), t;
|
|
2077
|
+
const t = this.resolveDimensions(), s = this.getProps(), r = typeof this.options.attributes == "function" ? this.options.attributes(s) : this.options.attributes ?? {}, i = typeof this.options.style == "function" ? this.options.style(s) : this.options.style ?? {};
|
|
2078
|
+
return Et({
|
|
2079
|
+
name: e,
|
|
2080
|
+
dimensions: t,
|
|
2081
|
+
attributes: r,
|
|
2082
|
+
style: i
|
|
2083
|
+
});
|
|
2026
2084
|
}
|
|
2027
2085
|
/**
|
|
2028
2086
|
* Opens host content in iframe or popup context.
|
|
2029
2087
|
*/
|
|
2030
2088
|
open(e) {
|
|
2031
|
-
const t = e.buildUrl(e.baseUrl),
|
|
2032
|
-
if (this.context ===
|
|
2089
|
+
const t = e.buildUrl(e.baseUrl), s = e.buildBodyParams(), r = s.toString().length > 0;
|
|
2090
|
+
if (this.context === f.IFRAME) {
|
|
2033
2091
|
if (!this.iframe)
|
|
2034
2092
|
throw new Error("Iframe not created during prerender");
|
|
2035
|
-
return r ? e.submitBodyForm(this.iframe.name, t,
|
|
2093
|
+
return r ? e.submitBodyForm(this.iframe.name, t, s) : this.iframe.src = t, this.iframe.contentWindow;
|
|
2036
2094
|
}
|
|
2037
|
-
const i = e.buildWindowName(), o =
|
|
2095
|
+
const i = e.buildWindowName(), o = St({
|
|
2038
2096
|
url: r ? "about:blank" : t,
|
|
2039
2097
|
name: i,
|
|
2040
2098
|
dimensions: this.resolveDimensions()
|
|
2041
2099
|
});
|
|
2042
|
-
r && e.submitBodyForm(i, t,
|
|
2043
|
-
const a =
|
|
2100
|
+
r && e.submitBodyForm(i, t, s);
|
|
2101
|
+
const a = Nt(o, () => {
|
|
2044
2102
|
e.onPopupClose();
|
|
2045
2103
|
});
|
|
2046
2104
|
return e.registerCleanup(a), o;
|
|
@@ -2049,18 +2107,18 @@ class Nt {
|
|
|
2049
2107
|
* Swaps prerender content with the live iframe after host initialization.
|
|
2050
2108
|
*/
|
|
2051
2109
|
async swapPrerenderContentIfNeeded() {
|
|
2052
|
-
this.context ===
|
|
2110
|
+
this.context === f.IFRAME && this.iframe && this.container && (await Mt(this.container, this.prerenderElement, this.iframe), this.prerenderElement = null);
|
|
2053
2111
|
}
|
|
2054
2112
|
/**
|
|
2055
2113
|
* Submits a hidden form to navigate a target window via POST.
|
|
2056
2114
|
*/
|
|
2057
|
-
submitBodyForm(e, t,
|
|
2115
|
+
submitBodyForm(e, t, s) {
|
|
2058
2116
|
const r = this.container?.ownerDocument ?? document, i = r.body ?? r.documentElement;
|
|
2059
2117
|
if (!i)
|
|
2060
2118
|
throw new Error("Document root is unavailable for bodyParam form submission");
|
|
2061
2119
|
const o = r.createElement("form");
|
|
2062
2120
|
o.method = "POST", o.action = t, o.target = e, o.style.display = "none";
|
|
2063
|
-
for (const [a, c] of
|
|
2121
|
+
for (const [a, c] of s.entries()) {
|
|
2064
2122
|
const l = r.createElement("input");
|
|
2065
2123
|
l.type = "hidden", l.name = a, l.value = c, o.appendChild(l);
|
|
2066
2124
|
}
|
|
@@ -2075,81 +2133,95 @@ class Nt {
|
|
|
2075
2133
|
* Focuses iframe/popup context.
|
|
2076
2134
|
*/
|
|
2077
2135
|
focus(e) {
|
|
2078
|
-
this.context ===
|
|
2136
|
+
this.context === f.IFRAME && this.iframe ? Rt(this.iframe) : this.context === f.POPUP && e && Tt(e);
|
|
2079
2137
|
}
|
|
2080
2138
|
/**
|
|
2081
2139
|
* Resizes iframe/popup context.
|
|
2082
2140
|
*/
|
|
2083
2141
|
resize(e, t) {
|
|
2084
|
-
this.context ===
|
|
2142
|
+
this.context === f.IFRAME && this.iframe ? Ot(this.iframe, e) : this.context === f.POPUP && t && Ft(t, e);
|
|
2085
2143
|
}
|
|
2086
2144
|
/**
|
|
2087
2145
|
* Shows iframe context.
|
|
2088
2146
|
*/
|
|
2089
2147
|
show() {
|
|
2090
|
-
this.context ===
|
|
2148
|
+
this.context === f.IFRAME && this.iframe && Ct(this.iframe);
|
|
2091
2149
|
}
|
|
2092
2150
|
/**
|
|
2093
2151
|
* Hides iframe context.
|
|
2094
2152
|
*/
|
|
2095
2153
|
hide() {
|
|
2096
|
-
this.context ===
|
|
2154
|
+
this.context === f.IFRAME && this.iframe && Ce(this.iframe);
|
|
2097
2155
|
}
|
|
2098
2156
|
/**
|
|
2099
2157
|
* Destroys rendered iframe/popup DOM artifacts.
|
|
2100
2158
|
*/
|
|
2101
2159
|
destroy(e) {
|
|
2102
|
-
this.iframe && (
|
|
2160
|
+
this.iframe && (bt(this.iframe), this.iframe = null), this.context === f.POPUP && e && vt(e), this.prerenderElement && (this.prerenderElement.remove(), this.prerenderElement = null), this.ownedContainer && (this.ownedContainer.remove(), this.ownedContainer = null), this.container = null;
|
|
2103
2161
|
}
|
|
2104
2162
|
}
|
|
2105
|
-
const
|
|
2106
|
-
function
|
|
2107
|
-
return
|
|
2163
|
+
const ne = "forgeframe:";
|
|
2164
|
+
function Y(n) {
|
|
2165
|
+
return ne + JSON.stringify(n);
|
|
2108
2166
|
}
|
|
2109
|
-
function
|
|
2110
|
-
if (typeof
|
|
2167
|
+
function Wt(n) {
|
|
2168
|
+
if (typeof n != "string" || !n.startsWith(ne)) return null;
|
|
2111
2169
|
try {
|
|
2112
|
-
const e =
|
|
2170
|
+
const e = n.slice(ne.length), t = JSON.parse(e);
|
|
2113
2171
|
return !t.id || !t.type || !t.name || !t.source ? null : t;
|
|
2114
2172
|
} catch {
|
|
2115
2173
|
return null;
|
|
2116
2174
|
}
|
|
2117
2175
|
}
|
|
2118
|
-
function
|
|
2176
|
+
function xe(n, e, t, s) {
|
|
2119
2177
|
return {
|
|
2120
|
-
id:
|
|
2121
|
-
type:
|
|
2178
|
+
id: n,
|
|
2179
|
+
type: z.REQUEST,
|
|
2122
2180
|
name: e,
|
|
2123
2181
|
data: t,
|
|
2124
|
-
source:
|
|
2182
|
+
source: s
|
|
2125
2183
|
};
|
|
2126
2184
|
}
|
|
2127
|
-
function
|
|
2185
|
+
function Bt(n, e, t, s) {
|
|
2128
2186
|
return {
|
|
2129
|
-
id:
|
|
2130
|
-
type:
|
|
2187
|
+
id: n,
|
|
2188
|
+
type: z.RESPONSE,
|
|
2131
2189
|
name: "response",
|
|
2132
2190
|
data: e,
|
|
2133
2191
|
source: t,
|
|
2134
|
-
error:
|
|
2135
|
-
message:
|
|
2136
|
-
stack:
|
|
2192
|
+
error: s ? {
|
|
2193
|
+
message: s.message,
|
|
2194
|
+
stack: s.stack
|
|
2137
2195
|
} : void 0
|
|
2138
2196
|
};
|
|
2139
2197
|
}
|
|
2140
|
-
function
|
|
2141
|
-
return
|
|
2198
|
+
function jt(n) {
|
|
2199
|
+
return n.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2142
2200
|
}
|
|
2143
|
-
function
|
|
2144
|
-
if (!
|
|
2201
|
+
function Vt(n) {
|
|
2202
|
+
if (!n.includes("*"))
|
|
2145
2203
|
return null;
|
|
2146
|
-
const e =
|
|
2204
|
+
const e = n.split("*").map((t) => jt(t)).join(".*");
|
|
2147
2205
|
return new RegExp(`^${e}$`);
|
|
2148
2206
|
}
|
|
2149
|
-
function
|
|
2150
|
-
return
|
|
2207
|
+
function qt(n, e) {
|
|
2208
|
+
return n.global || n.sticky ? new RegExp(n.source, n.flags.replace(/[gy]/g, "")).test(e) : n.test(e);
|
|
2209
|
+
}
|
|
2210
|
+
function Jt(n, e, t) {
|
|
2211
|
+
return e !== n.targetWin ? !1 : n.expectedOrigin === "*" ? !0 : t === n.expectedOrigin;
|
|
2212
|
+
}
|
|
2213
|
+
function Kt(n, e) {
|
|
2214
|
+
if (n === "*")
|
|
2215
|
+
return "*";
|
|
2216
|
+
if (n === "/")
|
|
2217
|
+
return e;
|
|
2218
|
+
try {
|
|
2219
|
+
return new URL(n, e).origin;
|
|
2220
|
+
} catch {
|
|
2221
|
+
return n;
|
|
2222
|
+
}
|
|
2151
2223
|
}
|
|
2152
|
-
class
|
|
2224
|
+
class $e {
|
|
2153
2225
|
/**
|
|
2154
2226
|
* Creates a new Messenger instance.
|
|
2155
2227
|
*
|
|
@@ -2158,8 +2230,8 @@ class Te {
|
|
|
2158
2230
|
* @param domain - The origin domain of this messenger
|
|
2159
2231
|
* @param trustedDomains - Optional domains to trust for incoming messages
|
|
2160
2232
|
*/
|
|
2161
|
-
constructor(e, t = window,
|
|
2162
|
-
this.uid = e, this.win = t, this.domain =
|
|
2233
|
+
constructor(e, t = window, s = window.location.origin, r) {
|
|
2234
|
+
this.uid = e, this.win = t, this.domain = s, this.allowedOrigins.add(s), r && this.addTrustedDomain(r), this.setupListener();
|
|
2163
2235
|
}
|
|
2164
2236
|
/** @internal */
|
|
2165
2237
|
pending = /* @__PURE__ */ new Map();
|
|
@@ -2189,7 +2261,7 @@ class Te {
|
|
|
2189
2261
|
else if (e instanceof RegExp)
|
|
2190
2262
|
this.allowedOriginPatterns.push(e);
|
|
2191
2263
|
else {
|
|
2192
|
-
const t =
|
|
2264
|
+
const t = Vt(e);
|
|
2193
2265
|
t ? this.wildcardPatternRegistry.has(e) || (this.wildcardPatternRegistry.set(e, t), this.allowedOriginPatterns.push(t)) : this.allowedOrigins.add(e);
|
|
2194
2266
|
}
|
|
2195
2267
|
}
|
|
@@ -2207,7 +2279,7 @@ class Te {
|
|
|
2207
2279
|
else {
|
|
2208
2280
|
const t = this.wildcardPatternRegistry.get(e);
|
|
2209
2281
|
t && (this.allowedOriginPatterns = this.allowedOriginPatterns.filter(
|
|
2210
|
-
(
|
|
2282
|
+
(s) => s !== t
|
|
2211
2283
|
), this.wildcardPatternRegistry.delete(e)), this.allowedOrigins.delete(e);
|
|
2212
2284
|
}
|
|
2213
2285
|
}
|
|
@@ -2222,7 +2294,7 @@ class Te {
|
|
|
2222
2294
|
if (this.allowedOrigins.has(e))
|
|
2223
2295
|
return !0;
|
|
2224
2296
|
for (const t of this.allowedOriginPatterns)
|
|
2225
|
-
if (
|
|
2297
|
+
if (qt(t, e))
|
|
2226
2298
|
return !0;
|
|
2227
2299
|
return !1;
|
|
2228
2300
|
}
|
|
@@ -2230,11 +2302,11 @@ class Te {
|
|
|
2230
2302
|
* Resolves source identity from the browser event context.
|
|
2231
2303
|
* @internal
|
|
2232
2304
|
*/
|
|
2233
|
-
resolveVerifiedSource(e, t,
|
|
2305
|
+
resolveVerifiedSource(e, t, s) {
|
|
2234
2306
|
const r = e, i = this.sourceUidRegistry.get(r);
|
|
2235
2307
|
if (i)
|
|
2236
2308
|
return { uid: i, domain: t };
|
|
2237
|
-
const o =
|
|
2309
|
+
const o = s && typeof s.uid == "string" && s.uid.length > 0 ? s.uid : L();
|
|
2238
2310
|
return this.sourceUidRegistry.set(r, o), { uid: o, domain: t };
|
|
2239
2311
|
}
|
|
2240
2312
|
/**
|
|
@@ -2250,23 +2322,25 @@ class Te {
|
|
|
2250
2322
|
* @returns Promise resolving to the response data
|
|
2251
2323
|
* @throws Error if messenger is destroyed or timeout occurs
|
|
2252
2324
|
*/
|
|
2253
|
-
async send(e, t,
|
|
2325
|
+
async send(e, t, s, r, i = 1e4) {
|
|
2254
2326
|
if (this.destroyed)
|
|
2255
2327
|
throw new Error("Messenger has been destroyed");
|
|
2256
|
-
const o =
|
|
2328
|
+
const o = L(), a = xe(o, s, r, {
|
|
2257
2329
|
uid: this.uid,
|
|
2258
2330
|
domain: this.domain
|
|
2259
|
-
}), c =
|
|
2260
|
-
this.pending.delete(o), c.reject(new Error(`Message "${
|
|
2331
|
+
}), c = Se(), l = setTimeout(() => {
|
|
2332
|
+
this.pending.delete(o), c.reject(new Error(`Message "${s}" timed out after ${i}ms`));
|
|
2261
2333
|
}, i);
|
|
2262
2334
|
this.pending.set(o, {
|
|
2263
2335
|
deferred: c,
|
|
2264
|
-
timeout: l
|
|
2336
|
+
timeout: l,
|
|
2337
|
+
targetWin: e,
|
|
2338
|
+
expectedOrigin: Kt(t, this.domain)
|
|
2265
2339
|
});
|
|
2266
2340
|
try {
|
|
2267
|
-
e.postMessage(
|
|
2268
|
-
} catch (
|
|
2269
|
-
throw this.pending.delete(o), clearTimeout(l),
|
|
2341
|
+
e.postMessage(Y(a), t);
|
|
2342
|
+
} catch (m) {
|
|
2343
|
+
throw this.pending.delete(o), clearTimeout(l), m;
|
|
2270
2344
|
}
|
|
2271
2345
|
return c.promise;
|
|
2272
2346
|
}
|
|
@@ -2280,14 +2354,14 @@ class Te {
|
|
|
2280
2354
|
* @param data - Optional data payload
|
|
2281
2355
|
* @throws Error if messenger is destroyed
|
|
2282
2356
|
*/
|
|
2283
|
-
post(e, t,
|
|
2357
|
+
post(e, t, s, r) {
|
|
2284
2358
|
if (this.destroyed)
|
|
2285
2359
|
throw new Error("Messenger has been destroyed");
|
|
2286
|
-
const i =
|
|
2360
|
+
const i = L(), o = xe(i, s, r, {
|
|
2287
2361
|
uid: this.uid,
|
|
2288
2362
|
domain: this.domain
|
|
2289
2363
|
});
|
|
2290
|
-
e.postMessage(
|
|
2364
|
+
e.postMessage(Y(o), t);
|
|
2291
2365
|
}
|
|
2292
2366
|
/**
|
|
2293
2367
|
* Registers a handler for incoming messages of a specific type.
|
|
@@ -2309,28 +2383,31 @@ class Te {
|
|
|
2309
2383
|
this.listener = (e) => {
|
|
2310
2384
|
if (e.source === this.win || !this.isOriginTrusted(e.origin))
|
|
2311
2385
|
return;
|
|
2312
|
-
const t =
|
|
2386
|
+
const t = Wt(e.data);
|
|
2313
2387
|
if (!t) return;
|
|
2314
|
-
const
|
|
2315
|
-
!
|
|
2388
|
+
const s = e.source;
|
|
2389
|
+
!s || typeof s.postMessage != "function" || this.handleMessage(t, s, e.origin);
|
|
2316
2390
|
}, this.win.addEventListener("message", this.listener);
|
|
2317
2391
|
}
|
|
2318
2392
|
/**
|
|
2319
2393
|
* Processes a received message.
|
|
2320
2394
|
* @internal
|
|
2321
2395
|
*/
|
|
2322
|
-
async handleMessage(e, t,
|
|
2323
|
-
if (e.type ===
|
|
2396
|
+
async handleMessage(e, t, s) {
|
|
2397
|
+
if (e.type === z.RESPONSE) {
|
|
2324
2398
|
const r = this.pending.get(e.id);
|
|
2325
|
-
if (r)
|
|
2399
|
+
if (r) {
|
|
2400
|
+
if (!Jt(r, t, s))
|
|
2401
|
+
return;
|
|
2326
2402
|
if (this.pending.delete(e.id), clearTimeout(r.timeout), e.error) {
|
|
2327
2403
|
const i = new Error(e.error.message);
|
|
2328
2404
|
i.stack = e.error.stack, r.deferred.reject(i);
|
|
2329
2405
|
} else
|
|
2330
2406
|
r.deferred.resolve(e.data);
|
|
2407
|
+
}
|
|
2331
2408
|
return;
|
|
2332
2409
|
}
|
|
2333
|
-
if (e.type ===
|
|
2410
|
+
if (e.type === z.REQUEST) {
|
|
2334
2411
|
const r = this.handlers.get(e.name);
|
|
2335
2412
|
if (!r)
|
|
2336
2413
|
return;
|
|
@@ -2338,21 +2415,21 @@ class Te {
|
|
|
2338
2415
|
try {
|
|
2339
2416
|
const c = this.resolveVerifiedSource(
|
|
2340
2417
|
t,
|
|
2341
|
-
|
|
2418
|
+
s,
|
|
2342
2419
|
e.source
|
|
2343
2420
|
);
|
|
2344
2421
|
i = await r(e.data, c);
|
|
2345
2422
|
} catch (c) {
|
|
2346
2423
|
o = c instanceof Error ? c : new Error(String(c));
|
|
2347
2424
|
}
|
|
2348
|
-
const a =
|
|
2425
|
+
const a = Bt(
|
|
2349
2426
|
e.id,
|
|
2350
2427
|
i,
|
|
2351
2428
|
{ uid: this.uid, domain: this.domain },
|
|
2352
2429
|
o
|
|
2353
2430
|
);
|
|
2354
2431
|
try {
|
|
2355
|
-
t.postMessage(
|
|
2432
|
+
t.postMessage(Y(a), s);
|
|
2356
2433
|
} catch {
|
|
2357
2434
|
}
|
|
2358
2435
|
}
|
|
@@ -2381,67 +2458,105 @@ class Te {
|
|
|
2381
2458
|
return this.destroyed;
|
|
2382
2459
|
}
|
|
2383
2460
|
}
|
|
2384
|
-
const
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2461
|
+
const Yt = [
|
|
2462
|
+
"init",
|
|
2463
|
+
"close",
|
|
2464
|
+
"resize",
|
|
2465
|
+
"show",
|
|
2466
|
+
"hide",
|
|
2467
|
+
"onError",
|
|
2468
|
+
"updateProps",
|
|
2469
|
+
"export"
|
|
2470
|
+
], De = 32 * 1024;
|
|
2471
|
+
function Xt(n) {
|
|
2472
|
+
const e = nn(n);
|
|
2473
|
+
return `${M}${e}`;
|
|
2388
2474
|
}
|
|
2389
|
-
function
|
|
2390
|
-
if (!
|
|
2475
|
+
function Ae(n) {
|
|
2476
|
+
if (!n || !n.startsWith(M))
|
|
2391
2477
|
return null;
|
|
2392
|
-
const e =
|
|
2393
|
-
return
|
|
2478
|
+
const e = n.slice(M.length);
|
|
2479
|
+
return sn(e);
|
|
2480
|
+
}
|
|
2481
|
+
function b(n) {
|
|
2482
|
+
return typeof n == "object" && n !== null;
|
|
2483
|
+
}
|
|
2484
|
+
function Gt(n) {
|
|
2485
|
+
return b(n);
|
|
2394
2486
|
}
|
|
2395
|
-
function
|
|
2487
|
+
function Zt(n) {
|
|
2488
|
+
return b(n) && Yt.every(
|
|
2489
|
+
(e) => typeof n[e] == "string" && n[e].length > 0
|
|
2490
|
+
);
|
|
2491
|
+
}
|
|
2492
|
+
function Qt(n) {
|
|
2493
|
+
if (!b(n) || typeof n.tag != "string" || n.tag.length === 0 || typeof n.url != "string" || n.url.length === 0 || n.props !== void 0 && !b(n.props) || n.defaultContext !== void 0 && n.defaultContext !== f.IFRAME && n.defaultContext !== f.POPUP)
|
|
2494
|
+
return !1;
|
|
2495
|
+
if (n.dimensions !== void 0) {
|
|
2496
|
+
if (!b(n.dimensions))
|
|
2497
|
+
return !1;
|
|
2498
|
+
const { width: e, height: t } = n.dimensions;
|
|
2499
|
+
if (e !== void 0 && typeof e != "string" && typeof e != "number" || t !== void 0 && typeof t != "string" && typeof t != "number")
|
|
2500
|
+
return !1;
|
|
2501
|
+
}
|
|
2502
|
+
return !0;
|
|
2503
|
+
}
|
|
2504
|
+
function en(n) {
|
|
2505
|
+
return b(n) ? Object.values(n).every((e) => Qt(e)) : !1;
|
|
2506
|
+
}
|
|
2507
|
+
function tn(n) {
|
|
2508
|
+
return !(!b(n) || typeof n.uid != "string" || n.uid.length === 0 || typeof n.tag != "string" || n.tag.length === 0 || typeof n.version != "string" || n.version.length === 0 || n.version !== se || n.context !== f.IFRAME && n.context !== f.POPUP || typeof n.consumerDomain != "string" || n.consumerDomain.length === 0 || !Gt(n.props) || !Zt(n.exports) || n.children !== void 0 && !en(n.children));
|
|
2509
|
+
}
|
|
2510
|
+
function de(n = window) {
|
|
2396
2511
|
try {
|
|
2397
|
-
return
|
|
2512
|
+
return n.name.startsWith(M);
|
|
2398
2513
|
} catch {
|
|
2399
2514
|
return !1;
|
|
2400
2515
|
}
|
|
2401
2516
|
}
|
|
2402
|
-
function
|
|
2403
|
-
return
|
|
2517
|
+
function X(n, e = window) {
|
|
2518
|
+
return Ae(e.name)?.tag === n;
|
|
2404
2519
|
}
|
|
2405
|
-
function
|
|
2520
|
+
function nn(n) {
|
|
2406
2521
|
try {
|
|
2407
|
-
const e = JSON.stringify(
|
|
2408
|
-
if (
|
|
2522
|
+
const e = JSON.stringify(n), t = btoa(encodeURIComponent(e)), s = new Blob([t]).size;
|
|
2523
|
+
if (s > De)
|
|
2409
2524
|
throw new Error(
|
|
2410
|
-
`Payload size (${Math.round(
|
|
2525
|
+
`Payload size (${Math.round(s / 1024)}KB) exceeds maximum allowed size (${De / 1024}KB). Consider reducing the amount of data passed via props.`
|
|
2411
2526
|
);
|
|
2412
2527
|
return t;
|
|
2413
2528
|
} catch (e) {
|
|
2414
2529
|
throw e instanceof Error && e.message.includes("Payload size") ? e : new Error(`Failed to encode payload: ${e}`);
|
|
2415
2530
|
}
|
|
2416
2531
|
}
|
|
2417
|
-
function
|
|
2532
|
+
function sn(n) {
|
|
2418
2533
|
try {
|
|
2419
|
-
const e = decodeURIComponent(atob(
|
|
2420
|
-
return
|
|
2534
|
+
const e = decodeURIComponent(atob(n)), t = JSON.parse(e);
|
|
2535
|
+
return tn(t) ? t : null;
|
|
2421
2536
|
} catch {
|
|
2422
2537
|
return null;
|
|
2423
2538
|
}
|
|
2424
2539
|
}
|
|
2425
|
-
function
|
|
2540
|
+
function rn(n) {
|
|
2426
2541
|
return {
|
|
2427
|
-
uid:
|
|
2428
|
-
tag:
|
|
2429
|
-
version:
|
|
2430
|
-
context:
|
|
2431
|
-
consumerDomain:
|
|
2432
|
-
props:
|
|
2433
|
-
exports:
|
|
2434
|
-
children:
|
|
2542
|
+
uid: n.uid,
|
|
2543
|
+
tag: n.tag,
|
|
2544
|
+
version: se,
|
|
2545
|
+
context: n.context,
|
|
2546
|
+
consumerDomain: n.consumerDomain,
|
|
2547
|
+
props: n.props,
|
|
2548
|
+
exports: n.exports,
|
|
2549
|
+
children: n.children
|
|
2435
2550
|
};
|
|
2436
2551
|
}
|
|
2437
|
-
function
|
|
2438
|
-
return
|
|
2552
|
+
function on(n = window) {
|
|
2553
|
+
return Ae(n.name);
|
|
2439
2554
|
}
|
|
2440
|
-
class
|
|
2441
|
-
constructor(e, t,
|
|
2442
|
-
this.uid = e, this.options = t, this.resolveUrl =
|
|
2555
|
+
class an {
|
|
2556
|
+
constructor(e, t, s, r) {
|
|
2557
|
+
this.uid = e, this.options = t, this.resolveUrl = s, this.resolveUrlOrigin = r;
|
|
2443
2558
|
const i = this.buildTrustedDomains();
|
|
2444
|
-
this.messenger = new
|
|
2559
|
+
this.messenger = new $e(this.uid, window, k(), i), this.bridge = new he(this.messenger);
|
|
2445
2560
|
}
|
|
2446
2561
|
/** Messenger for host communication. */
|
|
2447
2562
|
messenger;
|
|
@@ -2469,7 +2584,7 @@ class jt {
|
|
|
2469
2584
|
* Returns true when the domain option explicitly includes this origin.
|
|
2470
2585
|
*/
|
|
2471
2586
|
isExplicitDomainTrust(e) {
|
|
2472
|
-
return this.options.domain ?
|
|
2587
|
+
return this.options.domain ? v(this.options.domain, e) : !1;
|
|
2473
2588
|
}
|
|
2474
2589
|
/**
|
|
2475
2590
|
* Ensures the messenger trusts the origin for a resolved host URL.
|
|
@@ -2478,8 +2593,8 @@ class jt {
|
|
|
2478
2593
|
const t = this.resolveUrlOrigin(e);
|
|
2479
2594
|
if (!t)
|
|
2480
2595
|
return;
|
|
2481
|
-
const
|
|
2482
|
-
|
|
2596
|
+
const s = this.dynamicUrlTrustedOrigin;
|
|
2597
|
+
s && s !== t && !this.isExplicitDomainTrust(s) && this.messenger.removeTrustedDomain(s), this.messenger.addTrustedDomain(t), this.dynamicUrlTrustedOrigin = t;
|
|
2483
2598
|
}
|
|
2484
2599
|
/**
|
|
2485
2600
|
* Returns the current host domain target used for messaging.
|
|
@@ -2491,16 +2606,16 @@ class jt {
|
|
|
2491
2606
|
* Returns true when the host window is connected and not closed.
|
|
2492
2607
|
*/
|
|
2493
2608
|
isHostConnected() {
|
|
2494
|
-
return !!(this.hostWindow && !
|
|
2609
|
+
return !!(this.hostWindow && !Z(this.hostWindow));
|
|
2495
2610
|
}
|
|
2496
2611
|
/**
|
|
2497
2612
|
* Serializes host props while keeping function bridge references in sync.
|
|
2498
2613
|
*/
|
|
2499
|
-
serializePropsForHost(e, t,
|
|
2614
|
+
serializePropsForHost(e, t, s) {
|
|
2500
2615
|
this.bridge.startBatch();
|
|
2501
|
-
const r =
|
|
2616
|
+
const r = s?.finishBatch ?? !0;
|
|
2502
2617
|
try {
|
|
2503
|
-
const i =
|
|
2618
|
+
const i = gt(e, t, this.bridge);
|
|
2504
2619
|
return r && this.bridge.finishBatch(), i;
|
|
2505
2620
|
} catch (i) {
|
|
2506
2621
|
throw this.bridge.finishBatch(!0), i;
|
|
@@ -2510,13 +2625,13 @@ class jt {
|
|
|
2510
2625
|
* Sends the current props snapshot to the host window when available.
|
|
2511
2626
|
*/
|
|
2512
2627
|
async sendPropsUpdateToHost(e, t) {
|
|
2513
|
-
if (!this.hostWindow ||
|
|
2628
|
+
if (!this.hostWindow || Z(this.hostWindow))
|
|
2514
2629
|
return;
|
|
2515
|
-
const
|
|
2630
|
+
const s = this.getHostDomain(), r = Ee(
|
|
2516
2631
|
e,
|
|
2517
2632
|
t,
|
|
2518
|
-
|
|
2519
|
-
|
|
2633
|
+
s,
|
|
2634
|
+
ve(this.hostWindow)
|
|
2520
2635
|
), i = this.serializePropsForHost(
|
|
2521
2636
|
r,
|
|
2522
2637
|
t,
|
|
@@ -2525,7 +2640,7 @@ class jt {
|
|
|
2525
2640
|
try {
|
|
2526
2641
|
await this.messenger.send(
|
|
2527
2642
|
this.hostWindow,
|
|
2528
|
-
|
|
2643
|
+
s,
|
|
2529
2644
|
u.PROPS,
|
|
2530
2645
|
i
|
|
2531
2646
|
), this.bridge.finishBatch();
|
|
@@ -2537,41 +2652,41 @@ class jt {
|
|
|
2537
2652
|
* Builds the window.name payload for host initialization.
|
|
2538
2653
|
*/
|
|
2539
2654
|
buildWindowName(e) {
|
|
2540
|
-
const t = e.hostDomain ?? this.getHostDomain(),
|
|
2655
|
+
const t = e.hostDomain ?? this.getHostDomain(), s = Ee(
|
|
2541
2656
|
e.props,
|
|
2542
2657
|
e.propDefinitions,
|
|
2543
2658
|
t,
|
|
2544
2659
|
!1
|
|
2545
2660
|
), r = this.serializePropsForHost(
|
|
2546
|
-
|
|
2661
|
+
s,
|
|
2547
2662
|
e.propDefinitions
|
|
2548
|
-
), i =
|
|
2663
|
+
), i = rn({
|
|
2549
2664
|
uid: this.uid,
|
|
2550
2665
|
tag: e.tag,
|
|
2551
2666
|
context: e.context,
|
|
2552
|
-
consumerDomain:
|
|
2667
|
+
consumerDomain: k(),
|
|
2553
2668
|
props: r,
|
|
2554
2669
|
exports: e.exports,
|
|
2555
2670
|
children: e.children
|
|
2556
2671
|
});
|
|
2557
|
-
return
|
|
2672
|
+
return Xt(i);
|
|
2558
2673
|
}
|
|
2559
2674
|
/**
|
|
2560
2675
|
* Waits for the host to send the initialization handshake.
|
|
2561
2676
|
*/
|
|
2562
|
-
async waitForHost(e, t,
|
|
2677
|
+
async waitForHost(e, t, s) {
|
|
2563
2678
|
if (this.hostInitialized)
|
|
2564
2679
|
return;
|
|
2565
|
-
const r =
|
|
2680
|
+
const r = Se();
|
|
2566
2681
|
this.initPromise = r;
|
|
2567
2682
|
try {
|
|
2568
|
-
await
|
|
2683
|
+
await Ke(
|
|
2569
2684
|
r.promise,
|
|
2570
2685
|
e,
|
|
2571
2686
|
`Host component "${t}" (uid: ${this.uid}) did not initialize within ${e}ms. Check that the host page loads correctly and calls the initialization code.`
|
|
2572
2687
|
);
|
|
2573
2688
|
} catch (i) {
|
|
2574
|
-
throw
|
|
2689
|
+
throw s(i), i;
|
|
2575
2690
|
} finally {
|
|
2576
2691
|
this.initPromise === r && (this.initPromise = null);
|
|
2577
2692
|
}
|
|
@@ -2580,11 +2695,15 @@ class jt {
|
|
|
2580
2695
|
* Sets up host message handlers.
|
|
2581
2696
|
*/
|
|
2582
2697
|
setupMessageHandlers(e) {
|
|
2583
|
-
this.messenger.on(u.INIT, () => (this.hostInitialized = !0, this.initPromise && this.initPromise.resolve(),
|
|
2698
|
+
this.messenger.on(u.INIT, () => (this.hostInitialized = !0, this.initPromise && this.initPromise.resolve(), e.onInit && queueMicrotask(() => {
|
|
2699
|
+
Promise.resolve(e.onInit?.()).catch((t) => {
|
|
2700
|
+
e.onError(t);
|
|
2701
|
+
});
|
|
2702
|
+
}), { success: !0 })), this.messenger.on(u.CLOSE, async () => (await e.onClose(), { success: !0 })), this.messenger.on(u.RESIZE, async (t) => (await e.onResize(t), { success: !0 })), this.messenger.on(u.FOCUS, async () => (await e.onFocus(), { success: !0 })), this.messenger.on(u.SHOW, async () => (await e.onShow(), { success: !0 })), this.messenger.on(u.HIDE, async () => (await e.onHide(), { success: !0 })), this.messenger.on(
|
|
2584
2703
|
u.ERROR,
|
|
2585
2704
|
async (t) => {
|
|
2586
|
-
const
|
|
2587
|
-
return
|
|
2705
|
+
const s = new Error(t.message);
|
|
2706
|
+
return s.stack = t.stack, e.onError(s), { success: !0 };
|
|
2588
2707
|
}
|
|
2589
2708
|
), this.messenger.on(u.EXPORT, async (t) => (e.onExport(t), { success: !0 })), this.messenger.on(u.CONSUMER_EXPORT, async (t) => (e.onConsumerExport(t), { success: !0 })), this.messenger.on(u.GET_SIBLINGS, async (t) => e.onGetSiblings(t));
|
|
2590
2709
|
}
|
|
@@ -2595,7 +2714,7 @@ class jt {
|
|
|
2595
2714
|
this.messenger.destroy(), this.bridge.destroy();
|
|
2596
2715
|
}
|
|
2597
2716
|
}
|
|
2598
|
-
class
|
|
2717
|
+
class pe {
|
|
2599
2718
|
/** Event emitter for lifecycle events. */
|
|
2600
2719
|
event;
|
|
2601
2720
|
/** Arbitrary state storage for the component instance. */
|
|
@@ -2628,6 +2747,8 @@ class oe {
|
|
|
2628
2747
|
/** @internal */
|
|
2629
2748
|
destroyed = !1;
|
|
2630
2749
|
/** @internal */
|
|
2750
|
+
closing = !1;
|
|
2751
|
+
/** @internal */
|
|
2631
2752
|
get props() {
|
|
2632
2753
|
return this.propsPipeline ? this.propsPipeline.props : {};
|
|
2633
2754
|
}
|
|
@@ -2734,7 +2855,7 @@ class oe {
|
|
|
2734
2855
|
* @param props - Initial props to pass to the component
|
|
2735
2856
|
*/
|
|
2736
2857
|
constructor(e, t = {}) {
|
|
2737
|
-
this._uid =
|
|
2858
|
+
this._uid = qe(), this.options = this.normalizeOptions(e), this.event = new Ie(), this.cleanup = new Je(), this.renderer = new kt(
|
|
2738
2859
|
this.options,
|
|
2739
2860
|
this.uid,
|
|
2740
2861
|
() => this.props,
|
|
@@ -2743,15 +2864,15 @@ class oe {
|
|
|
2743
2864
|
close: () => this.close(),
|
|
2744
2865
|
focus: () => this.focus()
|
|
2745
2866
|
}
|
|
2746
|
-
), this.propsPipeline = new
|
|
2867
|
+
), this.propsPipeline = new Pt(
|
|
2747
2868
|
this.options,
|
|
2748
2869
|
{ ...t },
|
|
2749
|
-
(
|
|
2750
|
-
), this.transport = new
|
|
2870
|
+
(s) => this.createPropContext(s)
|
|
2871
|
+
), this.transport = new an(
|
|
2751
2872
|
this.uid,
|
|
2752
2873
|
this.options,
|
|
2753
2874
|
() => this.resolveUrl(),
|
|
2754
|
-
(
|
|
2875
|
+
(s) => this.resolveUrlOrigin(s)
|
|
2755
2876
|
), this.setupMessageHandlers(), this.setupCleanup();
|
|
2756
2877
|
}
|
|
2757
2878
|
/**
|
|
@@ -2777,14 +2898,14 @@ class oe {
|
|
|
2777
2898
|
throw new Error("Component has been destroyed");
|
|
2778
2899
|
if (this.rendered)
|
|
2779
2900
|
throw new Error("Component has already been rendered");
|
|
2780
|
-
this.context = t ?? this.options.defaultContext, this.checkEligibility(),
|
|
2901
|
+
this.context = t ?? this.options.defaultContext, this.checkEligibility(), S(this.props, this.options.props), this.options.validate?.({ props: this.props }), this.container = this.resolveContainer(e), this.event.emit(g.PRERENDER), this.callPropCallback("onPrerender"), await this.prerender(), this.event.emit(g.PRERENDERED), this.callPropCallback("onPrerendered"), this.event.emit(g.RENDER), this.callPropCallback("onRender");
|
|
2781
2902
|
try {
|
|
2782
|
-
await this.open(), await this.waitForHost(), this.context ===
|
|
2783
|
-
} catch (
|
|
2903
|
+
await this.open(), await this.waitForHost(), this.context === f.IFRAME && this.iframe && await this.renderer.swapPrerenderContentIfNeeded();
|
|
2904
|
+
} catch (s) {
|
|
2784
2905
|
throw await this.destroy().catch(() => {
|
|
2785
|
-
}),
|
|
2906
|
+
}), s;
|
|
2786
2907
|
}
|
|
2787
|
-
this.rendered = !0, this.event.emit(
|
|
2908
|
+
this.rendered = !0, this.event.emit(g.RENDERED), this.callPropCallback("onRendered"), this.event.emit(g.DISPLAY), this.callPropCallback("onDisplay");
|
|
2788
2909
|
}
|
|
2789
2910
|
/**
|
|
2790
2911
|
* Renders the component into a container in a different window.
|
|
@@ -2797,10 +2918,10 @@ class oe {
|
|
|
2797
2918
|
* @param container - CSS selector or HTMLElement to render into
|
|
2798
2919
|
* @param context - Override the default rendering context
|
|
2799
2920
|
*/
|
|
2800
|
-
async renderTo(e, t,
|
|
2921
|
+
async renderTo(e, t, s) {
|
|
2801
2922
|
if (e !== window)
|
|
2802
2923
|
throw new Error("Cross-window renderTo is not supported; pass the current window");
|
|
2803
|
-
return this.render(t,
|
|
2924
|
+
return this.render(t, s);
|
|
2804
2925
|
}
|
|
2805
2926
|
/**
|
|
2806
2927
|
* Closes and destroys the component.
|
|
@@ -2809,7 +2930,14 @@ class oe {
|
|
|
2809
2930
|
* Emits the 'close' event before destruction. Safe to call multiple times.
|
|
2810
2931
|
*/
|
|
2811
2932
|
async close() {
|
|
2812
|
-
this.destroyed ||
|
|
2933
|
+
if (!(this.destroyed || this.closing)) {
|
|
2934
|
+
this.closing = !0;
|
|
2935
|
+
try {
|
|
2936
|
+
this.event.emit(g.CLOSE), this.callPropCallback("onClose"), await this.destroy();
|
|
2937
|
+
} finally {
|
|
2938
|
+
this.closing = !1;
|
|
2939
|
+
}
|
|
2940
|
+
}
|
|
2813
2941
|
}
|
|
2814
2942
|
/**
|
|
2815
2943
|
* Focuses the component window.
|
|
@@ -2818,7 +2946,7 @@ class oe {
|
|
|
2818
2946
|
* For iframes, focuses the iframe element. For popups, brings the window to front.
|
|
2819
2947
|
*/
|
|
2820
2948
|
async focus() {
|
|
2821
|
-
this.renderer.focus(this.hostWindow), this.event.emit(
|
|
2949
|
+
this.renderer.focus(this.hostWindow), this.event.emit(g.FOCUS), this.callPropCallback("onFocus");
|
|
2822
2950
|
}
|
|
2823
2951
|
/**
|
|
2824
2952
|
* Resizes the component to the specified dimensions.
|
|
@@ -2826,7 +2954,7 @@ class oe {
|
|
|
2826
2954
|
* @param dimensions - New width and height for the component
|
|
2827
2955
|
*/
|
|
2828
2956
|
async resize(e) {
|
|
2829
|
-
this.renderer.resize(e, this.hostWindow), this.event.emit(
|
|
2957
|
+
this.renderer.resize(e, this.hostWindow), this.event.emit(g.RESIZE, e), this.callPropCallback("onResize", e);
|
|
2830
2958
|
}
|
|
2831
2959
|
/**
|
|
2832
2960
|
* Shows the component if hidden.
|
|
@@ -2863,13 +2991,13 @@ class oe {
|
|
|
2863
2991
|
*/
|
|
2864
2992
|
async applyPropsUpdate(e) {
|
|
2865
2993
|
const t = {
|
|
2866
|
-
resolveUrl: (
|
|
2867
|
-
resolveUrlOrigin: (
|
|
2868
|
-
assertStableRenderedOrigin: (
|
|
2994
|
+
resolveUrl: (s) => this.resolveUrl(s),
|
|
2995
|
+
resolveUrlOrigin: (s) => this.resolveUrlOrigin(s),
|
|
2996
|
+
assertStableRenderedOrigin: (s) => this.assertStableRenderedOrigin(s),
|
|
2869
2997
|
isRendered: () => this.rendered,
|
|
2870
|
-
syncTrustedDomainForUrl: (
|
|
2998
|
+
syncTrustedDomainForUrl: (s) => this.syncTrustedDomainForUrl(s),
|
|
2871
2999
|
shouldSendPropsToHost: () => this.transport.isHostConnected(),
|
|
2872
|
-
sendPropsUpdateToHost: (
|
|
3000
|
+
sendPropsUpdateToHost: (s) => this.sendPropsUpdateToHost(s),
|
|
2873
3001
|
emitPropsUpdated: () => this.emitPropsUpdated()
|
|
2874
3002
|
};
|
|
2875
3003
|
await this.propsPipeline.updateProps(e, t);
|
|
@@ -2896,7 +3024,7 @@ class oe {
|
|
|
2896
3024
|
* @internal
|
|
2897
3025
|
*/
|
|
2898
3026
|
emitPropsUpdated() {
|
|
2899
|
-
this.event.emit(
|
|
3027
|
+
this.event.emit(g.PROPS, this.props), this.callPropCallback("onProps", this.props);
|
|
2900
3028
|
}
|
|
2901
3029
|
/**
|
|
2902
3030
|
* Creates a clone of this instance with the same props.
|
|
@@ -2904,7 +3032,7 @@ class oe {
|
|
|
2904
3032
|
* @returns A new unrendered component instance with identical configuration
|
|
2905
3033
|
*/
|
|
2906
3034
|
clone() {
|
|
2907
|
-
const e = new
|
|
3035
|
+
const e = new pe(this.options, this.props);
|
|
2908
3036
|
return e.inputProps = { ...this.inputProps }, e;
|
|
2909
3037
|
}
|
|
2910
3038
|
/**
|
|
@@ -2923,7 +3051,7 @@ class oe {
|
|
|
2923
3051
|
return {
|
|
2924
3052
|
...e,
|
|
2925
3053
|
props: e.props ?? {},
|
|
2926
|
-
defaultContext: e.defaultContext ??
|
|
3054
|
+
defaultContext: e.defaultContext ?? f.IFRAME,
|
|
2927
3055
|
dimensions: e.dimensions ?? { width: "100%", height: "100%" },
|
|
2928
3056
|
timeout: e.timeout ?? 1e4,
|
|
2929
3057
|
children: e.children
|
|
@@ -3031,38 +3159,38 @@ class oe {
|
|
|
3031
3159
|
buildUrl: (t) => this.buildUrl(t),
|
|
3032
3160
|
buildBodyParams: () => this.buildBodyParams(),
|
|
3033
3161
|
buildWindowName: () => this.buildWindowName(),
|
|
3034
|
-
submitBodyForm: (t,
|
|
3162
|
+
submitBodyForm: (t, s, r) => this.submitBodyForm(t, s, r),
|
|
3035
3163
|
onPopupClose: () => {
|
|
3036
3164
|
this.close();
|
|
3037
3165
|
},
|
|
3038
3166
|
registerCleanup: (t) => {
|
|
3039
3167
|
this.cleanup.register(t);
|
|
3040
3168
|
}
|
|
3041
|
-
}), this.hostWindow &&
|
|
3169
|
+
}), this.hostWindow && rt(this.uid, this.hostWindow);
|
|
3042
3170
|
}
|
|
3043
3171
|
/**
|
|
3044
3172
|
* Builds the URL for the host window including query parameters.
|
|
3045
3173
|
* @internal
|
|
3046
3174
|
*/
|
|
3047
3175
|
buildUrl(e = this.resolveUrl()) {
|
|
3048
|
-
const
|
|
3049
|
-
if (!
|
|
3176
|
+
const s = lt(this.props, this.options.props).toString();
|
|
3177
|
+
if (!s) return e;
|
|
3050
3178
|
const r = e.includes("?") ? "&" : "?";
|
|
3051
|
-
return `${e}${r}${
|
|
3179
|
+
return `${e}${r}${s}`;
|
|
3052
3180
|
}
|
|
3053
3181
|
/**
|
|
3054
3182
|
* Builds POST body parameters from props marked with bodyParam.
|
|
3055
3183
|
* @internal
|
|
3056
3184
|
*/
|
|
3057
3185
|
buildBodyParams() {
|
|
3058
|
-
return
|
|
3186
|
+
return ut(this.props, this.options.props);
|
|
3059
3187
|
}
|
|
3060
3188
|
/**
|
|
3061
3189
|
* Submits a hidden form to navigate a target window via POST.
|
|
3062
3190
|
* @internal
|
|
3063
3191
|
*/
|
|
3064
|
-
submitBodyForm(e, t,
|
|
3065
|
-
this.renderer.submitBodyForm(e, t,
|
|
3192
|
+
submitBodyForm(e, t, s) {
|
|
3193
|
+
this.renderer.submitBodyForm(e, t, s);
|
|
3066
3194
|
}
|
|
3067
3195
|
/**
|
|
3068
3196
|
* Builds the window.name payload for the host window.
|
|
@@ -3086,15 +3214,15 @@ class oe {
|
|
|
3086
3214
|
buildNestedHostRefs() {
|
|
3087
3215
|
if (!this.options.children) return;
|
|
3088
3216
|
const e = this.options.children({ props: this.props }), t = {};
|
|
3089
|
-
for (const [
|
|
3090
|
-
const i =
|
|
3217
|
+
for (const [s, r] of Object.entries(e)) {
|
|
3218
|
+
const i = Pn(r);
|
|
3091
3219
|
if (!i)
|
|
3092
|
-
throw new Error(`Nested component "${
|
|
3220
|
+
throw new Error(`Nested component "${s}" is missing component metadata`);
|
|
3093
3221
|
if (typeof i.url != "string")
|
|
3094
3222
|
throw new Error(
|
|
3095
|
-
`Nested component "${
|
|
3223
|
+
`Nested component "${s}" must use a static string URL. Function URLs are not supported in children.`
|
|
3096
3224
|
);
|
|
3097
|
-
t[
|
|
3225
|
+
t[s] = {
|
|
3098
3226
|
tag: i.tag,
|
|
3099
3227
|
url: i.url,
|
|
3100
3228
|
props: i.props,
|
|
@@ -3144,6 +3272,7 @@ class oe {
|
|
|
3144
3272
|
*/
|
|
3145
3273
|
setupMessageHandlers() {
|
|
3146
3274
|
this.transport.setupMessageHandlers({
|
|
3275
|
+
onInit: () => this.syncSameDomainPropsAfterInit(),
|
|
3147
3276
|
onClose: async () => this.close(),
|
|
3148
3277
|
onResize: async (e) => this.resize(e),
|
|
3149
3278
|
onFocus: async () => this.focus(),
|
|
@@ -3159,6 +3288,28 @@ class oe {
|
|
|
3159
3288
|
onGetSiblings: (e) => this.getSiblingInstances(e)
|
|
3160
3289
|
});
|
|
3161
3290
|
}
|
|
3291
|
+
/**
|
|
3292
|
+
* Synchronizes sameDomain props after the host proves its loaded origin via INIT.
|
|
3293
|
+
* @internal
|
|
3294
|
+
*/
|
|
3295
|
+
async syncSameDomainPropsAfterInit() {
|
|
3296
|
+
if (!(!this.hostWindow || !this.transport.isHostConnected()) && ve(this.hostWindow) && this.hasSameDomainPropDefinition())
|
|
3297
|
+
try {
|
|
3298
|
+
await this.propsPipeline.syncCurrentPropsToHost({
|
|
3299
|
+
shouldSendPropsToHost: () => this.transport.isHostConnected(),
|
|
3300
|
+
sendPropsUpdateToHost: (e) => this.sendPropsUpdateToHost(e)
|
|
3301
|
+
});
|
|
3302
|
+
} catch (e) {
|
|
3303
|
+
this.handleError(e);
|
|
3304
|
+
}
|
|
3305
|
+
}
|
|
3306
|
+
/**
|
|
3307
|
+
* Returns true when any prop definition is restricted to same-origin hosts.
|
|
3308
|
+
* @internal
|
|
3309
|
+
*/
|
|
3310
|
+
hasSameDomainPropDefinition() {
|
|
3311
|
+
return Object.values(this.options.props).some((e) => !e || x(e) ? !1 : e.sameDomain === !0);
|
|
3312
|
+
}
|
|
3162
3313
|
/**
|
|
3163
3314
|
* Gets sibling component instances for a request.
|
|
3164
3315
|
* @internal
|
|
@@ -3166,19 +3317,19 @@ class oe {
|
|
|
3166
3317
|
getSiblingInstances(e) {
|
|
3167
3318
|
const t = [];
|
|
3168
3319
|
if (e.options?.anyConsumer) {
|
|
3169
|
-
for (const
|
|
3170
|
-
|
|
3171
|
-
uid:
|
|
3172
|
-
tag:
|
|
3173
|
-
exports:
|
|
3320
|
+
for (const s of _n())
|
|
3321
|
+
s.instance.uid !== e.uid && t.push({
|
|
3322
|
+
uid: s.instance.uid,
|
|
3323
|
+
tag: s.tag,
|
|
3324
|
+
exports: s.instance.exports
|
|
3174
3325
|
});
|
|
3175
3326
|
return t;
|
|
3176
3327
|
}
|
|
3177
|
-
for (const
|
|
3178
|
-
|
|
3179
|
-
uid:
|
|
3328
|
+
for (const s of wn(e.tag))
|
|
3329
|
+
s.uid !== e.uid && t.push({
|
|
3330
|
+
uid: s.uid,
|
|
3180
3331
|
tag: e.tag,
|
|
3181
|
-
exports:
|
|
3332
|
+
exports: s.exports
|
|
3182
3333
|
});
|
|
3183
3334
|
return t;
|
|
3184
3335
|
}
|
|
@@ -3188,7 +3339,7 @@ class oe {
|
|
|
3188
3339
|
*/
|
|
3189
3340
|
setupCleanup() {
|
|
3190
3341
|
this.cleanup.register(() => {
|
|
3191
|
-
this.messenger.destroy(), this.bridge.destroy(),
|
|
3342
|
+
this.messenger.destroy(), this.bridge.destroy(), it(this.uid);
|
|
3192
3343
|
});
|
|
3193
3344
|
}
|
|
3194
3345
|
/**
|
|
@@ -3196,17 +3347,17 @@ class oe {
|
|
|
3196
3347
|
* @internal
|
|
3197
3348
|
*/
|
|
3198
3349
|
handleError(e) {
|
|
3199
|
-
this.event.emit(
|
|
3350
|
+
this.event.emit(g.ERROR, e), this.callPropCallback("onError", e);
|
|
3200
3351
|
}
|
|
3201
3352
|
/**
|
|
3202
3353
|
* Calls a prop callback if it exists.
|
|
3203
3354
|
* @internal
|
|
3204
3355
|
*/
|
|
3205
3356
|
callPropCallback(e, ...t) {
|
|
3206
|
-
const
|
|
3207
|
-
if (typeof
|
|
3357
|
+
const s = this.props[e];
|
|
3358
|
+
if (typeof s == "function")
|
|
3208
3359
|
try {
|
|
3209
|
-
const r =
|
|
3360
|
+
const r = s(...t);
|
|
3210
3361
|
r && typeof r == "object" && "catch" in r && typeof r.catch == "function" && r.catch((i) => {
|
|
3211
3362
|
console.error(`Error in async ${e} callback:`, i);
|
|
3212
3363
|
});
|
|
@@ -3223,31 +3374,31 @@ class oe {
|
|
|
3223
3374
|
new Error(
|
|
3224
3375
|
`Component "${this.options.tag}" was destroyed before initialization completed`
|
|
3225
3376
|
)
|
|
3226
|
-
), this.initPromise = null), this.hostInitialized = !1, this.renderer.destroy(this.hostWindow), this.hostWindow = null, this.openedHostDomain = null, this.dynamicUrlTrustedOrigin = null, this.pendingPropsUpdate = null, await this.cleanup.cleanup(), this.event.emit(
|
|
3377
|
+
), this.initPromise = null), this.hostInitialized = !1, this.renderer.destroy(this.hostWindow), this.hostWindow = null, this.openedHostDomain = null, this.dynamicUrlTrustedOrigin = null, this.pendingPropsUpdate = null, await this.cleanup.cleanup(), this.event.emit(g.DESTROY), this.callPropCallback("onDestroy"), this.event.removeAllListeners());
|
|
3227
3378
|
}
|
|
3228
3379
|
}
|
|
3229
|
-
const
|
|
3230
|
-
function
|
|
3380
|
+
const T = /* @__PURE__ */ new Map(), U = /* @__PURE__ */ new Map();
|
|
3381
|
+
function cn(n, e) {
|
|
3231
3382
|
const t = e;
|
|
3232
|
-
|
|
3233
|
-
let r =
|
|
3234
|
-
r || (r = /* @__PURE__ */ new Map(),
|
|
3383
|
+
T.get(t.uid) && Le(t.uid);
|
|
3384
|
+
let r = U.get(n);
|
|
3385
|
+
r || (r = /* @__PURE__ */ new Map(), U.set(n, r)), r.set(t.uid, t), T.set(t.uid, { tag: n, instance: t });
|
|
3235
3386
|
}
|
|
3236
|
-
function
|
|
3237
|
-
const e =
|
|
3387
|
+
function Le(n) {
|
|
3388
|
+
const e = T.get(n);
|
|
3238
3389
|
if (!e)
|
|
3239
3390
|
return;
|
|
3240
|
-
|
|
3241
|
-
const t =
|
|
3242
|
-
t && (t.delete(
|
|
3391
|
+
T.delete(n);
|
|
3392
|
+
const t = U.get(e.tag);
|
|
3393
|
+
t && (t.delete(n), t.size === 0 && U.delete(e.tag));
|
|
3243
3394
|
}
|
|
3244
|
-
function
|
|
3245
|
-
return Array.from(
|
|
3395
|
+
function ln(n) {
|
|
3396
|
+
return Array.from(U.get(n)?.values() ?? []);
|
|
3246
3397
|
}
|
|
3247
|
-
function
|
|
3248
|
-
return Array.from(
|
|
3398
|
+
function un() {
|
|
3399
|
+
return Array.from(T.values());
|
|
3249
3400
|
}
|
|
3250
|
-
const
|
|
3401
|
+
const ze = "Could not resolve consumer window", G = "Could not verify consumer origin", hn = /* @__PURE__ */ new Set([
|
|
3251
3402
|
"uid",
|
|
3252
3403
|
"tag",
|
|
3253
3404
|
"close",
|
|
@@ -3264,7 +3415,7 @@ const Fe = "Could not resolve consumer window", Jt = /* @__PURE__ */ new Set([
|
|
|
3264
3415
|
"getPeerInstances",
|
|
3265
3416
|
"children"
|
|
3266
3417
|
]);
|
|
3267
|
-
class
|
|
3418
|
+
class dn {
|
|
3268
3419
|
/**
|
|
3269
3420
|
* Creates a new HostComponent instance.
|
|
3270
3421
|
*
|
|
@@ -3273,13 +3424,13 @@ class Xt {
|
|
|
3273
3424
|
* @param allowedConsumerDomains - Optional allowlist of consumer domains
|
|
3274
3425
|
* @param deferInit - Whether to defer INIT until a later explicit flush
|
|
3275
3426
|
*/
|
|
3276
|
-
constructor(e, t = {},
|
|
3277
|
-
this.propDefinitions = t, this.allowedConsumerDomains =
|
|
3278
|
-
let i = null;
|
|
3427
|
+
constructor(e, t = {}, s, r = !1) {
|
|
3428
|
+
this.propDefinitions = t, this.allowedConsumerDomains = s, this.deferInit = r, this.uid = e.uid, this.tag = e.tag, this.event = new Ie();
|
|
3429
|
+
let i = null, o = null;
|
|
3279
3430
|
try {
|
|
3280
|
-
this.
|
|
3281
|
-
} catch (
|
|
3282
|
-
throw i?.destroy(),
|
|
3431
|
+
this.consumerWindow = this.resolveConsumerWindow(), this.consumerDomain = this.resolveConsumerDomain(e.consumerDomain), o = new $e(this.uid, window, k(), this.consumerDomain), this.messenger = o, this.setupMessageHandlers(), i = new he(this.messenger), this.bridge = i, this.hostProps = this.buildHostProps(e), this.exposeHostProps(), this.deferInit || this.flushInit();
|
|
3432
|
+
} catch (a) {
|
|
3433
|
+
throw i?.destroy(), o?.destroy(), this.event.removeAllListeners(), this.propsHandlers.clear(), a;
|
|
3283
3434
|
}
|
|
3284
3435
|
}
|
|
3285
3436
|
/** The hostProps object containing props and control methods passed from the consumer. */
|
|
@@ -3295,6 +3446,8 @@ class Xt {
|
|
|
3295
3446
|
/** @internal */
|
|
3296
3447
|
consumerDomain;
|
|
3297
3448
|
/** @internal */
|
|
3449
|
+
consumerDomainVerified = !1;
|
|
3450
|
+
/** @internal */
|
|
3298
3451
|
messenger;
|
|
3299
3452
|
/** @internal */
|
|
3300
3453
|
bridge;
|
|
@@ -3352,11 +3505,93 @@ class Xt {
|
|
|
3352
3505
|
* @internal
|
|
3353
3506
|
*/
|
|
3354
3507
|
validateConsumerDomain() {
|
|
3355
|
-
if (this.allowedConsumerDomains
|
|
3508
|
+
if (this.allowedConsumerDomains) {
|
|
3509
|
+
if (!this.consumerDomain)
|
|
3510
|
+
throw new Error(
|
|
3511
|
+
`${G} for component "${this.tag}"`
|
|
3512
|
+
);
|
|
3513
|
+
if (!v(this.allowedConsumerDomains, this.consumerDomain))
|
|
3514
|
+
throw new Error(
|
|
3515
|
+
`Consumer domain "${this.consumerDomain}" is not allowed for component "${this.tag}"`
|
|
3516
|
+
);
|
|
3517
|
+
}
|
|
3518
|
+
}
|
|
3519
|
+
/**
|
|
3520
|
+
* Reads a browser-verifiable consumer origin when available.
|
|
3521
|
+
* @internal
|
|
3522
|
+
*/
|
|
3523
|
+
getVerifiedConsumerOrigin() {
|
|
3524
|
+
return this.getReferrerOrigin() ?? this.getAccessibleConsumerOrigin();
|
|
3525
|
+
}
|
|
3526
|
+
/**
|
|
3527
|
+
* Updates the tracked consumer origin and keeps trusted messaging origins in sync.
|
|
3528
|
+
* @internal
|
|
3529
|
+
*/
|
|
3530
|
+
setConsumerDomain(e, t) {
|
|
3531
|
+
const s = this.consumerDomain;
|
|
3532
|
+
this.consumerDomain = e, this.consumerDomainVerified = t, !(!this.messenger || !s || s === e) && (this.messenger.removeTrustedDomain(s), this.messenger.addTrustedDomain(e));
|
|
3533
|
+
}
|
|
3534
|
+
/**
|
|
3535
|
+
* Applies host configuration that may arrive after deferred pre-initialization.
|
|
3536
|
+
* @internal
|
|
3537
|
+
*/
|
|
3538
|
+
applyHostConfiguration(e, t) {
|
|
3539
|
+
t !== void 0 && (this.allowedConsumerDomains = t), e !== void 0 && (this.propDefinitions = e, S(this.consumerProps, this.getBootstrapValidationDefinitions()), Object.assign(this.hostProps, this.consumerProps), this.hostProps.consumer.props = this.consumerProps);
|
|
3540
|
+
}
|
|
3541
|
+
/**
|
|
3542
|
+
* Resolves the consumer origin from browser-provided context and falls back to the
|
|
3543
|
+
* claimed bootstrap origin only when no explicit allowlist is configured.
|
|
3544
|
+
* @internal
|
|
3545
|
+
*/
|
|
3546
|
+
resolveConsumerDomain(e) {
|
|
3547
|
+
const t = this.getVerifiedConsumerOrigin();
|
|
3548
|
+
if (t)
|
|
3549
|
+
return this.consumerDomainVerified = !0, this.consumerDomain = t, this.validateConsumerDomain(), t;
|
|
3550
|
+
if (this.consumerDomainVerified = !1, this.allowedConsumerDomains)
|
|
3551
|
+
throw new Error(
|
|
3552
|
+
`${G} for component "${this.tag}"`
|
|
3553
|
+
);
|
|
3554
|
+
return e;
|
|
3555
|
+
}
|
|
3556
|
+
/**
|
|
3557
|
+
* Rechecks allowlist constraints against a browser-verified consumer origin.
|
|
3558
|
+
* @internal
|
|
3559
|
+
*/
|
|
3560
|
+
assertAllowedConsumerDomain(e) {
|
|
3561
|
+
const t = this.getVerifiedConsumerOrigin();
|
|
3562
|
+
if (t && this.setConsumerDomain(t, !0), !this.consumerDomainVerified)
|
|
3563
|
+
throw new Error(
|
|
3564
|
+
`${G} for component "${this.tag}"`
|
|
3565
|
+
);
|
|
3566
|
+
if (!v(e, this.consumerDomain))
|
|
3356
3567
|
throw new Error(
|
|
3357
3568
|
`Consumer domain "${this.consumerDomain}" is not allowed for component "${this.tag}"`
|
|
3358
3569
|
);
|
|
3359
3570
|
}
|
|
3571
|
+
/**
|
|
3572
|
+
* Reads the consumer origin from the browser-provided referrer when available.
|
|
3573
|
+
* @internal
|
|
3574
|
+
*/
|
|
3575
|
+
getReferrerOrigin() {
|
|
3576
|
+
if (!document.referrer)
|
|
3577
|
+
return null;
|
|
3578
|
+
try {
|
|
3579
|
+
return new URL(document.referrer, window.location.href).origin;
|
|
3580
|
+
} catch {
|
|
3581
|
+
return null;
|
|
3582
|
+
}
|
|
3583
|
+
}
|
|
3584
|
+
/**
|
|
3585
|
+
* Reads the consumer origin directly when same-origin access is available.
|
|
3586
|
+
* @internal
|
|
3587
|
+
*/
|
|
3588
|
+
getAccessibleConsumerOrigin() {
|
|
3589
|
+
try {
|
|
3590
|
+
return this.consumerWindow.location.origin;
|
|
3591
|
+
} catch {
|
|
3592
|
+
return null;
|
|
3593
|
+
}
|
|
3594
|
+
}
|
|
3360
3595
|
/**
|
|
3361
3596
|
* Returns the hostProps object.
|
|
3362
3597
|
*
|
|
@@ -3370,22 +3605,22 @@ class Xt {
|
|
|
3370
3605
|
* @internal
|
|
3371
3606
|
*/
|
|
3372
3607
|
resolveConsumerWindow() {
|
|
3373
|
-
if (
|
|
3374
|
-
const e =
|
|
3608
|
+
if (tt()) {
|
|
3609
|
+
const e = et();
|
|
3375
3610
|
if (e) return e;
|
|
3376
3611
|
}
|
|
3377
|
-
if (
|
|
3378
|
-
const e =
|
|
3612
|
+
if (nt()) {
|
|
3613
|
+
const e = Qe();
|
|
3379
3614
|
if (e) return e;
|
|
3380
3615
|
}
|
|
3381
|
-
throw new Error(
|
|
3616
|
+
throw new Error(ze);
|
|
3382
3617
|
}
|
|
3383
3618
|
/**
|
|
3384
3619
|
* Builds the hostProps object with deserialized props and control methods.
|
|
3385
3620
|
* @internal
|
|
3386
3621
|
*/
|
|
3387
3622
|
buildHostProps(e) {
|
|
3388
|
-
const t =
|
|
3623
|
+
const t = Oe(
|
|
3389
3624
|
e.props,
|
|
3390
3625
|
this.propDefinitions,
|
|
3391
3626
|
this.messenger,
|
|
@@ -3393,28 +3628,47 @@ class Xt {
|
|
|
3393
3628
|
this.consumerWindow,
|
|
3394
3629
|
this.consumerDomain
|
|
3395
3630
|
);
|
|
3396
|
-
return this.consumerProps = t, {
|
|
3631
|
+
return S(t, this.getBootstrapValidationDefinitions()), this.consumerProps = t, {
|
|
3397
3632
|
...t,
|
|
3398
3633
|
uid: this.uid,
|
|
3399
3634
|
tag: this.tag,
|
|
3400
3635
|
close: () => this.close(),
|
|
3401
3636
|
focus: () => this.focus(),
|
|
3402
|
-
resize: (
|
|
3637
|
+
resize: (s) => this.resize(s),
|
|
3403
3638
|
show: () => this.show(),
|
|
3404
3639
|
hide: () => this.hide(),
|
|
3405
|
-
onProps: (
|
|
3406
|
-
onError: (
|
|
3640
|
+
onProps: (s) => this.onProps(s),
|
|
3641
|
+
onError: (s) => this.onError(s),
|
|
3407
3642
|
getConsumer: () => this.consumerWindow,
|
|
3408
3643
|
getConsumerDomain: () => this.consumerDomain,
|
|
3409
|
-
export: (
|
|
3644
|
+
export: (s) => this.exportData(s),
|
|
3410
3645
|
consumer: {
|
|
3411
3646
|
props: this.consumerProps,
|
|
3412
|
-
export: (
|
|
3647
|
+
export: (s) => this.consumerExport(s)
|
|
3413
3648
|
},
|
|
3414
|
-
getPeerInstances: (
|
|
3649
|
+
getPeerInstances: (s) => this.getPeerInstances(s),
|
|
3415
3650
|
children: this.buildNestedComponents(e.children)
|
|
3416
3651
|
};
|
|
3417
3652
|
}
|
|
3653
|
+
/**
|
|
3654
|
+
* Relaxes required sameDomain props during bootstrap for verified same-origin hosts.
|
|
3655
|
+
* Those props are synchronized after INIT through the live messaging channel.
|
|
3656
|
+
* @internal
|
|
3657
|
+
*/
|
|
3658
|
+
getBootstrapValidationDefinitions() {
|
|
3659
|
+
if (!this.consumerDomainVerified || this.consumerDomain !== k())
|
|
3660
|
+
return this.propDefinitions;
|
|
3661
|
+
let e = !1;
|
|
3662
|
+
const t = {
|
|
3663
|
+
...this.propDefinitions
|
|
3664
|
+
};
|
|
3665
|
+
for (const [s, r] of Object.entries(this.propDefinitions))
|
|
3666
|
+
!r || x(r) || !r.sameDomain || (e = !0, t[s] = {
|
|
3667
|
+
...r,
|
|
3668
|
+
required: !1
|
|
3669
|
+
});
|
|
3670
|
+
return e ? t : this.propDefinitions;
|
|
3671
|
+
}
|
|
3418
3672
|
/**
|
|
3419
3673
|
* Sends initialization message to the consumer.
|
|
3420
3674
|
* @internal
|
|
@@ -3429,7 +3683,7 @@ class Xt {
|
|
|
3429
3683
|
);
|
|
3430
3684
|
} catch (e) {
|
|
3431
3685
|
const t = e instanceof Error ? e : new Error(String(e));
|
|
3432
|
-
this.initError = t, this.event.emit(
|
|
3686
|
+
this.initError = t, this.event.emit(g.ERROR, {
|
|
3433
3687
|
type: "init_failed",
|
|
3434
3688
|
message: `Failed to initialize host component: ${t.message}`,
|
|
3435
3689
|
error: t
|
|
@@ -3571,9 +3825,9 @@ class Xt {
|
|
|
3571
3825
|
buildNestedComponents(e) {
|
|
3572
3826
|
if (!e) return;
|
|
3573
3827
|
const t = {};
|
|
3574
|
-
for (const [
|
|
3828
|
+
for (const [s, r] of Object.entries(e))
|
|
3575
3829
|
try {
|
|
3576
|
-
t[
|
|
3830
|
+
t[s] = ke({
|
|
3577
3831
|
tag: r.tag,
|
|
3578
3832
|
url: r.url,
|
|
3579
3833
|
props: r.props,
|
|
@@ -3581,7 +3835,7 @@ class Xt {
|
|
|
3581
3835
|
defaultContext: r.defaultContext
|
|
3582
3836
|
});
|
|
3583
3837
|
} catch (i) {
|
|
3584
|
-
console.warn(`Failed to create nested component "${
|
|
3838
|
+
console.warn(`Failed to create nested component "${s}":`, i);
|
|
3585
3839
|
}
|
|
3586
3840
|
return Object.keys(t).length > 0 ? t : void 0;
|
|
3587
3841
|
}
|
|
@@ -3592,7 +3846,7 @@ class Xt {
|
|
|
3592
3846
|
setupMessageHandlers() {
|
|
3593
3847
|
this.messenger.on(u.PROPS, (e) => {
|
|
3594
3848
|
try {
|
|
3595
|
-
const t = this.consumerProps,
|
|
3849
|
+
const t = this.consumerProps, s = Oe(
|
|
3596
3850
|
e,
|
|
3597
3851
|
this.propDefinitions,
|
|
3598
3852
|
this.messenger,
|
|
@@ -3600,17 +3854,17 @@ class Xt {
|
|
|
3600
3854
|
this.consumerWindow,
|
|
3601
3855
|
this.consumerDomain
|
|
3602
3856
|
);
|
|
3603
|
-
this.removeStaleHostProps(t,
|
|
3857
|
+
S(s, this.propDefinitions), this.removeStaleHostProps(t, s), this.consumerProps = s, Object.assign(this.hostProps, s), this.hostProps.consumer.props = this.consumerProps;
|
|
3604
3858
|
for (const r of this.propsHandlers)
|
|
3605
3859
|
try {
|
|
3606
|
-
r(
|
|
3860
|
+
r(s);
|
|
3607
3861
|
} catch (i) {
|
|
3608
3862
|
console.error("Error in props handler:", i);
|
|
3609
3863
|
}
|
|
3610
|
-
return this.event.emit(
|
|
3864
|
+
return this.event.emit(g.PROPS, s), { success: !0 };
|
|
3611
3865
|
} catch (t) {
|
|
3612
|
-
const
|
|
3613
|
-
throw console.error("Error deserializing props:",
|
|
3866
|
+
const s = t instanceof Error ? t : new Error(String(t));
|
|
3867
|
+
throw console.error("Error deserializing props:", s), this.event.emit(g.ERROR, s), s;
|
|
3614
3868
|
}
|
|
3615
3869
|
});
|
|
3616
3870
|
}
|
|
@@ -3619,8 +3873,8 @@ class Xt {
|
|
|
3619
3873
|
* @internal
|
|
3620
3874
|
*/
|
|
3621
3875
|
removeStaleHostProps(e, t) {
|
|
3622
|
-
for (const
|
|
3623
|
-
|
|
3876
|
+
for (const s of Object.keys(e))
|
|
3877
|
+
s in t || hn.has(s) || delete this.hostProps[s];
|
|
3624
3878
|
}
|
|
3625
3879
|
/**
|
|
3626
3880
|
* Destroys the host component and cleans up resources.
|
|
@@ -3630,178 +3884,179 @@ class Xt {
|
|
|
3630
3884
|
}
|
|
3631
3885
|
}
|
|
3632
3886
|
let w = null;
|
|
3633
|
-
function
|
|
3887
|
+
function fe(n, e, t = {}) {
|
|
3634
3888
|
if (w) {
|
|
3635
|
-
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
|
|
3639
|
-
|
|
3640
|
-
|
|
3889
|
+
try {
|
|
3890
|
+
w.applyHostConfiguration(
|
|
3891
|
+
n,
|
|
3892
|
+
e
|
|
3893
|
+
), e && w.assertAllowedConsumerDomain(e);
|
|
3894
|
+
} catch (r) {
|
|
3895
|
+
throw gn(), r;
|
|
3641
3896
|
}
|
|
3642
3897
|
return t.deferInit || w.flushInit(), w;
|
|
3643
3898
|
}
|
|
3644
|
-
if (!
|
|
3899
|
+
if (!de())
|
|
3645
3900
|
return null;
|
|
3646
|
-
const
|
|
3647
|
-
if (!
|
|
3901
|
+
const s = on();
|
|
3902
|
+
if (!s)
|
|
3648
3903
|
return console.error("Failed to parse ForgeFrame payload from window.name"), null;
|
|
3649
3904
|
try {
|
|
3650
|
-
w = new
|
|
3651
|
-
n,
|
|
3905
|
+
w = new dn(
|
|
3652
3906
|
s,
|
|
3907
|
+
n,
|
|
3653
3908
|
e,
|
|
3654
3909
|
t.deferInit ?? !1
|
|
3655
3910
|
);
|
|
3656
3911
|
} catch (r) {
|
|
3657
|
-
if (r instanceof Error && r.message ===
|
|
3912
|
+
if (r instanceof Error && r.message === ze)
|
|
3658
3913
|
return null;
|
|
3659
3914
|
throw r;
|
|
3660
3915
|
}
|
|
3661
3916
|
return w;
|
|
3662
3917
|
}
|
|
3663
|
-
function
|
|
3664
|
-
return
|
|
3918
|
+
function pn() {
|
|
3919
|
+
return de();
|
|
3665
3920
|
}
|
|
3666
|
-
function
|
|
3667
|
-
return
|
|
3921
|
+
function fn() {
|
|
3922
|
+
return de();
|
|
3668
3923
|
}
|
|
3669
|
-
function
|
|
3924
|
+
function mn() {
|
|
3670
3925
|
return window.hostProps;
|
|
3671
3926
|
}
|
|
3672
|
-
function
|
|
3927
|
+
function gn() {
|
|
3673
3928
|
w && (w.destroy(), w = null), delete window.hostProps;
|
|
3674
3929
|
}
|
|
3675
|
-
const
|
|
3676
|
-
function
|
|
3677
|
-
if (!
|
|
3930
|
+
const V = /* @__PURE__ */ new Map(), Me = /* @__PURE__ */ Symbol("forgeframe.component.options");
|
|
3931
|
+
function yn(n) {
|
|
3932
|
+
if (!n.tag)
|
|
3678
3933
|
throw new Error("Component tag is required");
|
|
3679
|
-
if (!/^[a-z][a-z0-9-]*$/.test(
|
|
3934
|
+
if (!/^[a-z][a-z0-9-]*$/.test(n.tag))
|
|
3680
3935
|
throw new Error(
|
|
3681
|
-
`Invalid component tag "${
|
|
3936
|
+
`Invalid component tag "${n.tag}". Must start with lowercase letter and contain only lowercase letters, numbers, and hyphens.`
|
|
3682
3937
|
);
|
|
3683
|
-
if (!
|
|
3938
|
+
if (!n.url)
|
|
3684
3939
|
throw new Error("Component url is required");
|
|
3685
|
-
if (typeof
|
|
3940
|
+
if (typeof n.url == "string")
|
|
3686
3941
|
try {
|
|
3687
|
-
new URL(
|
|
3942
|
+
new URL(n.url, window.location.origin);
|
|
3688
3943
|
} catch {
|
|
3689
3944
|
throw new Error(
|
|
3690
|
-
`Invalid component URL "${
|
|
3945
|
+
`Invalid component URL "${n.url}". Must be a valid absolute or relative URL.`
|
|
3691
3946
|
);
|
|
3692
3947
|
}
|
|
3693
|
-
if (
|
|
3694
|
-
throw new Error(`Component "${
|
|
3948
|
+
if (V.has(n.tag))
|
|
3949
|
+
throw new Error(`Component "${n.tag}" is already registered`);
|
|
3695
3950
|
}
|
|
3696
|
-
function
|
|
3697
|
-
|
|
3951
|
+
function ke(n) {
|
|
3952
|
+
yn(n);
|
|
3698
3953
|
const e = [];
|
|
3699
3954
|
let t;
|
|
3700
|
-
if (
|
|
3701
|
-
const r =
|
|
3955
|
+
if (X(n.tag)) {
|
|
3956
|
+
const r = fe(n.props, n.allowedConsumerDomains);
|
|
3702
3957
|
r && (t = r.hostProps);
|
|
3703
3958
|
}
|
|
3704
|
-
const
|
|
3705
|
-
const i = new
|
|
3706
|
-
return e.push(i),
|
|
3959
|
+
const s = function(r = {}) {
|
|
3960
|
+
const i = new pe(n, r);
|
|
3961
|
+
return e.push(i), cn(n.tag, i), i.event.once("destroy", () => {
|
|
3707
3962
|
const o = e.indexOf(i);
|
|
3708
|
-
o !== -1 && e.splice(o, 1),
|
|
3963
|
+
o !== -1 && e.splice(o, 1), Le(i.uid);
|
|
3709
3964
|
}), i;
|
|
3710
3965
|
};
|
|
3711
|
-
return
|
|
3966
|
+
return s.instances = e, s.isHost = () => X(n.tag), s.isEmbedded = () => X(n.tag), s.hostProps = t, s[Me] = n, s.canRenderTo = async (r) => r === window, V.set(n.tag, s), s;
|
|
3712
3967
|
}
|
|
3713
|
-
function
|
|
3714
|
-
return
|
|
3968
|
+
function wn(n) {
|
|
3969
|
+
return ln(n);
|
|
3715
3970
|
}
|
|
3716
|
-
function
|
|
3717
|
-
return
|
|
3971
|
+
function _n() {
|
|
3972
|
+
return un();
|
|
3718
3973
|
}
|
|
3719
|
-
function
|
|
3720
|
-
return
|
|
3974
|
+
function Pn(n) {
|
|
3975
|
+
return n[Me];
|
|
3721
3976
|
}
|
|
3722
|
-
async function
|
|
3723
|
-
await
|
|
3977
|
+
async function En(n) {
|
|
3978
|
+
await n.close();
|
|
3724
3979
|
}
|
|
3725
|
-
async function
|
|
3726
|
-
const e =
|
|
3980
|
+
async function We(n) {
|
|
3981
|
+
const e = V.get(n);
|
|
3727
3982
|
if (!e) return;
|
|
3728
3983
|
const t = [...e.instances];
|
|
3729
|
-
await Promise.all(t.map((
|
|
3984
|
+
await Promise.all(t.map((s) => s.close()));
|
|
3730
3985
|
}
|
|
3731
|
-
async function
|
|
3732
|
-
const
|
|
3733
|
-
await Promise.all(
|
|
3986
|
+
async function bn() {
|
|
3987
|
+
const n = Array.from(V.keys());
|
|
3988
|
+
await Promise.all(n.map((e) => We(e)));
|
|
3734
3989
|
}
|
|
3735
|
-
function
|
|
3736
|
-
const t = Object.keys(
|
|
3737
|
-
if (t.length !==
|
|
3990
|
+
function On(n, e) {
|
|
3991
|
+
const t = Object.keys(n), s = Object.keys(e);
|
|
3992
|
+
if (t.length !== s.length)
|
|
3738
3993
|
return !1;
|
|
3739
3994
|
for (const r of t)
|
|
3740
|
-
if (!Object.prototype.hasOwnProperty.call(e, r) || !Object.is(
|
|
3995
|
+
if (!Object.prototype.hasOwnProperty.call(e, r) || !Object.is(n[r], e[r]))
|
|
3741
3996
|
return !1;
|
|
3742
3997
|
return !0;
|
|
3743
3998
|
}
|
|
3744
|
-
function
|
|
3745
|
-
const { React: t } = e, { createElement:
|
|
3746
|
-
function(
|
|
3999
|
+
function Cn(n, e) {
|
|
4000
|
+
const { React: t } = e, { createElement: s, useRef: r, useEffect: i, useState: o, forwardRef: a } = t, c = a(
|
|
4001
|
+
function(h, d) {
|
|
3747
4002
|
const {
|
|
3748
|
-
onRendered:
|
|
3749
|
-
onError:
|
|
3750
|
-
onClose:
|
|
3751
|
-
context:
|
|
3752
|
-
className:
|
|
3753
|
-
style:
|
|
3754
|
-
...
|
|
3755
|
-
} =
|
|
4003
|
+
onRendered: C,
|
|
4004
|
+
onError: q,
|
|
4005
|
+
onClose: me,
|
|
4006
|
+
context: Be,
|
|
4007
|
+
className: ge,
|
|
4008
|
+
style: ye,
|
|
4009
|
+
...J
|
|
4010
|
+
} = h, F = r(null), K = r(null), H = r(null), $ = r(q), [we, je] = o(null);
|
|
3756
4011
|
return i(() => {
|
|
3757
|
-
|
|
3758
|
-
}, [
|
|
3759
|
-
const
|
|
3760
|
-
if (!
|
|
3761
|
-
const y =
|
|
3762
|
-
return
|
|
3763
|
-
|
|
3764
|
-
}), y.render(
|
|
3765
|
-
|
|
4012
|
+
$.current = q;
|
|
4013
|
+
}, [q]), i(() => {
|
|
4014
|
+
const D = F.current;
|
|
4015
|
+
if (!D) return;
|
|
4016
|
+
const y = n(J);
|
|
4017
|
+
return K.current = y, H.current = J, C && y.event.once("rendered", C), me && y.event.once("close", me), y.event.on("error", (E) => {
|
|
4018
|
+
$.current?.(E);
|
|
4019
|
+
}), y.render(D, Be).catch((E) => {
|
|
4020
|
+
je(E), $.current?.(E);
|
|
3766
4021
|
}), () => {
|
|
3767
4022
|
y.close().catch(() => {
|
|
3768
|
-
}),
|
|
4023
|
+
}), K.current = null, H.current = null;
|
|
3769
4024
|
};
|
|
3770
4025
|
}, []), i(() => {
|
|
3771
|
-
const
|
|
3772
|
-
if (!
|
|
3773
|
-
const y =
|
|
3774
|
-
E &&
|
|
3775
|
-
|
|
4026
|
+
const D = K.current;
|
|
4027
|
+
if (!D) return;
|
|
4028
|
+
const y = J, E = H.current;
|
|
4029
|
+
E && On(E, y) || (H.current = y, D.updateProps(y).catch((Ve) => {
|
|
4030
|
+
$.current?.(Ve);
|
|
3776
4031
|
}));
|
|
3777
4032
|
}), i(() => {
|
|
3778
|
-
|
|
3779
|
-
}, [
|
|
4033
|
+
d && typeof d == "object" && F.current && (d.current = F.current);
|
|
4034
|
+
}, [d]), we ? s(
|
|
3780
4035
|
"div",
|
|
3781
4036
|
{
|
|
3782
|
-
className:
|
|
3783
|
-
style: { color: "red", padding: "16px", ...
|
|
4037
|
+
className: ge,
|
|
4038
|
+
style: { color: "red", padding: "16px", ...ye }
|
|
3784
4039
|
},
|
|
3785
|
-
`Error: ${
|
|
3786
|
-
) :
|
|
3787
|
-
ref:
|
|
3788
|
-
className:
|
|
4040
|
+
`Error: ${we.message}`
|
|
4041
|
+
) : s("div", {
|
|
4042
|
+
ref: F,
|
|
4043
|
+
className: ge,
|
|
3789
4044
|
style: {
|
|
3790
4045
|
display: "inline-block",
|
|
3791
|
-
...
|
|
4046
|
+
...ye
|
|
3792
4047
|
}
|
|
3793
4048
|
});
|
|
3794
4049
|
}
|
|
3795
|
-
), l = `ForgeFrame(${
|
|
4050
|
+
), l = `ForgeFrame(${n.name || "Component"})`;
|
|
3796
4051
|
return c.displayName = l, c;
|
|
3797
4052
|
}
|
|
3798
|
-
function
|
|
4053
|
+
function xn(n) {
|
|
3799
4054
|
return function(t) {
|
|
3800
|
-
return
|
|
4055
|
+
return Cn(t, { React: n });
|
|
3801
4056
|
};
|
|
3802
4057
|
}
|
|
3803
|
-
|
|
3804
|
-
const
|
|
4058
|
+
fe(void 0, void 0, { deferInit: !0 });
|
|
4059
|
+
const Dn = {
|
|
3805
4060
|
/**
|
|
3806
4061
|
* Create a new component definition.
|
|
3807
4062
|
*
|
|
@@ -3826,23 +4081,23 @@ const us = {
|
|
|
3826
4081
|
* await instance.render('#container');
|
|
3827
4082
|
* ```
|
|
3828
4083
|
*/
|
|
3829
|
-
create:
|
|
4084
|
+
create: ke,
|
|
3830
4085
|
/**
|
|
3831
4086
|
* Destroy a single component instance.
|
|
3832
4087
|
*
|
|
3833
4088
|
* @param instance - The component instance to destroy
|
|
3834
4089
|
*/
|
|
3835
|
-
destroy:
|
|
4090
|
+
destroy: En,
|
|
3836
4091
|
/**
|
|
3837
4092
|
* Destroy all instances of a specific component by tag.
|
|
3838
4093
|
*
|
|
3839
4094
|
* @param tag - The component tag name
|
|
3840
4095
|
*/
|
|
3841
|
-
destroyByTag:
|
|
4096
|
+
destroyByTag: We,
|
|
3842
4097
|
/**
|
|
3843
4098
|
* Destroy all ForgeFrame component instances.
|
|
3844
4099
|
*/
|
|
3845
|
-
destroyAll:
|
|
4100
|
+
destroyAll: bn,
|
|
3846
4101
|
/**
|
|
3847
4102
|
* Check if the current window is a host component context.
|
|
3848
4103
|
*
|
|
@@ -3852,7 +4107,7 @@ const us = {
|
|
|
3852
4107
|
*
|
|
3853
4108
|
* @returns True if running inside a ForgeFrame iframe/popup
|
|
3854
4109
|
*/
|
|
3855
|
-
isHost:
|
|
4110
|
+
isHost: pn,
|
|
3856
4111
|
/**
|
|
3857
4112
|
* Check if the current window is embedded by ForgeFrame.
|
|
3858
4113
|
*
|
|
@@ -3861,7 +4116,7 @@ const us = {
|
|
|
3861
4116
|
*
|
|
3862
4117
|
* @returns True if running inside a ForgeFrame iframe/popup
|
|
3863
4118
|
*/
|
|
3864
|
-
isEmbedded:
|
|
4119
|
+
isEmbedded: fn,
|
|
3865
4120
|
/**
|
|
3866
4121
|
* Get hostProps from the current host window.
|
|
3867
4122
|
*
|
|
@@ -3870,7 +4125,7 @@ const us = {
|
|
|
3870
4125
|
*
|
|
3871
4126
|
* @returns The hostProps object if in host context, undefined otherwise
|
|
3872
4127
|
*/
|
|
3873
|
-
getHostProps:
|
|
4128
|
+
getHostProps: mn,
|
|
3874
4129
|
/**
|
|
3875
4130
|
* Flush host initialization in embedded contexts.
|
|
3876
4131
|
*
|
|
@@ -3881,30 +4136,30 @@ const us = {
|
|
|
3881
4136
|
*
|
|
3882
4137
|
* @returns The host component instance if running embedded, otherwise null
|
|
3883
4138
|
*/
|
|
3884
|
-
initHost:
|
|
4139
|
+
initHost: fe,
|
|
3885
4140
|
/**
|
|
3886
4141
|
* Serialization strategy constants.
|
|
3887
4142
|
* @see {@link PROP_SERIALIZATION}
|
|
3888
4143
|
*/
|
|
3889
|
-
PROP_SERIALIZATION:
|
|
4144
|
+
PROP_SERIALIZATION: A,
|
|
3890
4145
|
/**
|
|
3891
4146
|
* Rendering context constants (IFRAME, POPUP).
|
|
3892
4147
|
* @see {@link CONTEXT}
|
|
3893
4148
|
*/
|
|
3894
|
-
CONTEXT:
|
|
4149
|
+
CONTEXT: f,
|
|
3895
4150
|
/**
|
|
3896
4151
|
* Lifecycle event name constants.
|
|
3897
4152
|
* @see {@link EVENT}
|
|
3898
4153
|
*/
|
|
3899
|
-
EVENT:
|
|
4154
|
+
EVENT: g,
|
|
3900
4155
|
/**
|
|
3901
4156
|
* Error thrown when popup window fails to open.
|
|
3902
4157
|
*/
|
|
3903
|
-
PopupOpenError:
|
|
4158
|
+
PopupOpenError: He,
|
|
3904
4159
|
/**
|
|
3905
4160
|
* Current library version.
|
|
3906
4161
|
*/
|
|
3907
|
-
VERSION:
|
|
4162
|
+
VERSION: se,
|
|
3908
4163
|
/**
|
|
3909
4164
|
* Check if a value is a Standard Schema (Zod, Valibot, ArkType, etc.)
|
|
3910
4165
|
*
|
|
@@ -3921,7 +4176,7 @@ const us = {
|
|
|
3921
4176
|
* }
|
|
3922
4177
|
* ```
|
|
3923
4178
|
*/
|
|
3924
|
-
isStandardSchema:
|
|
4179
|
+
isStandardSchema: x,
|
|
3925
4180
|
/**
|
|
3926
4181
|
* Prop schema builders for defining component props.
|
|
3927
4182
|
*
|
|
@@ -3944,36 +4199,36 @@ const us = {
|
|
|
3944
4199
|
* });
|
|
3945
4200
|
* ```
|
|
3946
4201
|
*/
|
|
3947
|
-
prop:
|
|
4202
|
+
prop: p
|
|
3948
4203
|
};
|
|
3949
4204
|
export {
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
|
|
4205
|
+
ue as AnySchema,
|
|
4206
|
+
W as ArraySchema,
|
|
4207
|
+
oe as BooleanSchema,
|
|
4208
|
+
f as CONTEXT,
|
|
4209
|
+
g as EVENT,
|
|
4210
|
+
le as EnumSchema,
|
|
4211
|
+
Dn as ForgeFrame,
|
|
4212
|
+
ae as FunctionSchema,
|
|
4213
|
+
ce as LiteralSchema,
|
|
4214
|
+
ie as NumberSchema,
|
|
4215
|
+
B as ObjectSchema,
|
|
4216
|
+
A as PROP_SERIALIZATION,
|
|
4217
|
+
He as PopupOpenError,
|
|
3963
4218
|
_ as PropSchema,
|
|
3964
|
-
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
4219
|
+
re as StringSchema,
|
|
4220
|
+
se as VERSION,
|
|
4221
|
+
ke as create,
|
|
4222
|
+
Cn as createReactComponent,
|
|
4223
|
+
Dn as default,
|
|
4224
|
+
En as destroy,
|
|
4225
|
+
bn as destroyAll,
|
|
4226
|
+
We as destroyByTag,
|
|
4227
|
+
mn as getHostProps,
|
|
4228
|
+
fe as initHost,
|
|
4229
|
+
fn as isEmbedded,
|
|
4230
|
+
pn as isHost,
|
|
4231
|
+
x as isStandardSchema,
|
|
4232
|
+
p as prop,
|
|
4233
|
+
xn as withReactComponent
|
|
3979
4234
|
};
|