@salesforce/lightning-out 2.2.1-rc.2 → 2.2.1-rc.7
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/index.esm.js +86 -21
- package/dist/index.iife.debug.js +86 -21
- package/dist/index.iife.prod.js +3 -3
- package/package.json +5 -3
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @salesforce/lightning-out v2.2.1-rc.
|
|
1
|
+
/*! @salesforce/lightning-out v2.2.1-rc.7 (2026-06-16) */
|
|
2
2
|
/**
|
|
3
3
|
* EmbeddingResizer - Handles dynamic iframe/container resizing
|
|
4
4
|
* Uses ResizeObserver to monitor element size changes and notify the host
|
|
@@ -423,10 +423,15 @@ class LightningOutIFrame {
|
|
|
423
423
|
// Clear the timeout, cache its window and origin
|
|
424
424
|
this.#timeoutID = clearTimeout(this.#timeoutID);
|
|
425
425
|
this.#config(event.source, event.origin);
|
|
426
|
-
//
|
|
427
|
-
|
|
426
|
+
// Extract lightningDomain from the postMessage if provided
|
|
427
|
+
const lightningDomain = event.data.lightningDomain;
|
|
428
|
+
// Notify the parentElement that the iframe has successfully loaded.
|
|
429
|
+
// Pass both origin and lightningDomain so the app can decide which to use.
|
|
428
430
|
this.#parentElement.dispatchEvent(new CustomEvent(events.lo.iframe.load, {
|
|
429
|
-
detail:
|
|
431
|
+
detail: {
|
|
432
|
+
origin: event.origin,
|
|
433
|
+
lightningDomain: lightningDomain,
|
|
434
|
+
},
|
|
430
435
|
}));
|
|
431
436
|
break;
|
|
432
437
|
}
|
|
@@ -1049,7 +1054,7 @@ const ARIA_BLOCK = new Set([
|
|
|
1049
1054
|
]);
|
|
1050
1055
|
class LightningOutComponent extends HTMLElement {
|
|
1051
1056
|
_uuid = getUUID();
|
|
1052
|
-
|
|
1057
|
+
componentReady = false;
|
|
1053
1058
|
_standardName = elementNameToStandardName(this.localName); // May change during registration
|
|
1054
1059
|
#parentApp; // The parent LightningOutApplication
|
|
1055
1060
|
#loError = new LightningOutError(this);
|
|
@@ -1076,7 +1081,7 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1076
1081
|
return compURL;
|
|
1077
1082
|
}
|
|
1078
1083
|
_init() {
|
|
1079
|
-
if (!this.
|
|
1084
|
+
if (!this.componentReady) {
|
|
1080
1085
|
// We don't care about events.lo.iframe.ready, we care about messages.lo.ready
|
|
1081
1086
|
this.#loIFrame.load(this._getComponentURL().href);
|
|
1082
1087
|
}
|
|
@@ -1089,6 +1094,9 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1089
1094
|
logger$1.debug("#messageListener:", `this._uuid: ${this._uuid}`, `this._standardName: ${this._standardName}`, `event.data: ${JSON.stringify(event.data)}`);
|
|
1090
1095
|
switch (event.data.type) {
|
|
1091
1096
|
case messages.lo.ready: {
|
|
1097
|
+
// Flip the gate before draining: the queued items re-enter addEventListener/dispatchEvent and need to
|
|
1098
|
+
// take the immediate post-message path, not get re-queued.
|
|
1099
|
+
this.componentReady = true;
|
|
1092
1100
|
while (this.#eventQueue.length) {
|
|
1093
1101
|
const item = this.#eventQueue.shift();
|
|
1094
1102
|
if (!item)
|
|
@@ -1103,7 +1111,6 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1103
1111
|
this.dispatchEvent(item.event);
|
|
1104
1112
|
}
|
|
1105
1113
|
}
|
|
1106
|
-
this._ready = true;
|
|
1107
1114
|
super.dispatchEvent(new CustomEvent(events.lo.component.ready));
|
|
1108
1115
|
break;
|
|
1109
1116
|
}
|
|
@@ -1186,12 +1193,36 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1186
1193
|
}
|
|
1187
1194
|
};
|
|
1188
1195
|
addEventListener(eventName, listener, options) {
|
|
1196
|
+
// Replay `lo.component.ready` for late subscribers. The event is one-shot (fires once when the iframe
|
|
1197
|
+
// handshake completes) so a listener attached afterwards would otherwise never run. Use a microtask to match
|
|
1198
|
+
// normal DOM event-dispatch timing.
|
|
1199
|
+
if (eventName === events.lo.component.ready && this.componentReady) {
|
|
1200
|
+
const event = new CustomEvent(events.lo.component.ready);
|
|
1201
|
+
queueMicrotask(() => {
|
|
1202
|
+
if (typeof listener === "function") {
|
|
1203
|
+
listener.call(this, event);
|
|
1204
|
+
}
|
|
1205
|
+
else {
|
|
1206
|
+
listener.handleEvent(event);
|
|
1207
|
+
}
|
|
1208
|
+
});
|
|
1209
|
+
}
|
|
1210
|
+
// `lo.*` events are host-local: they're never dispatched from inside the iframe, so there's nothing to mirror
|
|
1211
|
+
// across the postMessage bridge. Register locally and skip the round-trip + key bookkeeping.
|
|
1212
|
+
if (eventName.startsWith("lo.")) {
|
|
1213
|
+
super.addEventListener(eventName, listener, options);
|
|
1214
|
+
return;
|
|
1215
|
+
}
|
|
1189
1216
|
let key = this.#listenerKeyMap.get(listener);
|
|
1190
1217
|
if (!key) {
|
|
1191
1218
|
key = `${eventName}_${this.#listenerKeySeed++}`;
|
|
1192
1219
|
this.#listenerKeyMap.set(listener, key);
|
|
1193
1220
|
}
|
|
1194
|
-
|
|
1221
|
+
// Gate on componentReady (handshake complete), not iframeReady (which only means window/origin are known).
|
|
1222
|
+
// Between those two points the iframe-side container has not yet bound its embedded component, so any
|
|
1223
|
+
// forwarded message would be silently dropped. Once the handshake completes, the queue is flushed in
|
|
1224
|
+
// #messageListener via the messages.lo.ready branch.
|
|
1225
|
+
if (this.componentReady) {
|
|
1195
1226
|
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1196
1227
|
super.addEventListener(...arguments);
|
|
1197
1228
|
this.#loIFrame.postMessage({
|
|
@@ -1212,7 +1243,8 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1212
1243
|
return super.dispatchEvent(event);
|
|
1213
1244
|
}
|
|
1214
1245
|
else {
|
|
1215
|
-
|
|
1246
|
+
// Gate on componentReady (handshake complete), not iframeReady — see addEventListener for rationale.
|
|
1247
|
+
if (this.componentReady) {
|
|
1216
1248
|
logger$1.debug(`dispatchEvent: dispatching event "${event.type}" to this Element and embedded Element inside the iframe`);
|
|
1217
1249
|
const result = super.dispatchEvent(event);
|
|
1218
1250
|
this.#loIFrame.postMessage({
|
|
@@ -1223,15 +1255,22 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1223
1255
|
return result;
|
|
1224
1256
|
}
|
|
1225
1257
|
else {
|
|
1226
|
-
logger$1.debug(`dispatchEvent:
|
|
1258
|
+
logger$1.debug(`dispatchEvent: component not ready, queueing event "${event.type}"`);
|
|
1227
1259
|
this.#eventQueue.push({ type: "dispatch", event });
|
|
1228
1260
|
return true; // Assuming success since we're queueing it
|
|
1229
1261
|
}
|
|
1230
1262
|
}
|
|
1231
1263
|
}
|
|
1232
1264
|
removeEventListener(eventName, listener, options) {
|
|
1265
|
+
// Mirror the addEventListener short-circuit for host-local `lo.*` events.
|
|
1266
|
+
if (eventName.startsWith("lo.")) {
|
|
1267
|
+
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1268
|
+
super.removeEventListener(...arguments);
|
|
1269
|
+
return;
|
|
1270
|
+
}
|
|
1233
1271
|
const key = this.#listenerKeyMap.get(listener);
|
|
1234
|
-
|
|
1272
|
+
// Gate on componentReady (handshake complete), not iframeReady — see addEventListener for rationale.
|
|
1273
|
+
if (this.componentReady) {
|
|
1235
1274
|
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1236
1275
|
super.removeEventListener(...arguments);
|
|
1237
1276
|
this.#loIFrame.postMessage({
|
|
@@ -1265,7 +1304,7 @@ class LightningOutComponent extends HTMLElement {
|
|
|
1265
1304
|
this.style.height ||= "100%";
|
|
1266
1305
|
this.#parentApp = registry.registerComponent(this);
|
|
1267
1306
|
this._standardName = this.#parentApp._getComponentStandardName(this);
|
|
1268
|
-
if (this.#parentApp.
|
|
1307
|
+
if (this.#parentApp.applicationReady) {
|
|
1269
1308
|
this._init();
|
|
1270
1309
|
}
|
|
1271
1310
|
}
|
|
@@ -1314,9 +1353,8 @@ class LightningOutRouter {
|
|
|
1314
1353
|
appURL = new URL(`lwr/application/amd/0/${lang}ai/${lwrApp}`, this.config.origin);
|
|
1315
1354
|
}
|
|
1316
1355
|
else {
|
|
1317
|
-
// Route to CLWR
|
|
1318
|
-
|
|
1319
|
-
appURL = new URL(pathname, this.config.origin);
|
|
1356
|
+
// Route to CLWR. Note: sitePrefix may be blank and that's okay.
|
|
1357
|
+
appURL = new URL(`${this.config.sitePrefix}/lightning-out`, this.config.origin);
|
|
1320
1358
|
}
|
|
1321
1359
|
appURL.searchParams.set("componentName", componentName);
|
|
1322
1360
|
return this.#addCommonParams(appURL, parentElementId);
|
|
@@ -1342,7 +1380,7 @@ class LightningOutRouter {
|
|
|
1342
1380
|
url.searchParams.set("parentElementId", parentElementId);
|
|
1343
1381
|
url.searchParams.set("loAppOrigin", this.config.loAppOrigin);
|
|
1344
1382
|
// This helps in general but also for cache busting
|
|
1345
|
-
url.searchParams.set("loVersion", "2.2.1-rc.
|
|
1383
|
+
url.searchParams.set("loVersion", "2.2.1-rc.7");
|
|
1346
1384
|
if (this.config.appId) {
|
|
1347
1385
|
url.searchParams.set("appId", this.config.appId);
|
|
1348
1386
|
}
|
|
@@ -1369,7 +1407,7 @@ const DESIGN_SYSTEM_VALUES = new Set(["slds1", "slds2", "none"]);
|
|
|
1369
1407
|
const INIT_TRIGGERING_PROPS = new Set(["frontdoorUrl", "orgUrl"]);
|
|
1370
1408
|
class LightningOutApplication extends HTMLElement {
|
|
1371
1409
|
_uuid = getUUID();
|
|
1372
|
-
|
|
1410
|
+
applicationReady = false;
|
|
1373
1411
|
#loError = new LightningOutError(this);
|
|
1374
1412
|
#loIFrame = new LightningOutIFrame({
|
|
1375
1413
|
parentElement: this,
|
|
@@ -1407,6 +1445,23 @@ class LightningOutApplication extends HTMLElement {
|
|
|
1407
1445
|
// We have to register this instance as early as possible
|
|
1408
1446
|
registry.registerApplication(this);
|
|
1409
1447
|
}
|
|
1448
|
+
addEventListener(eventName, listener, options) {
|
|
1449
|
+
// Replay `lo.application.ready` for late subscribers. The event is one-shot (fires once when the iframe
|
|
1450
|
+
// finishes loading) so a listener attached afterwards would otherwise never run. Use a microtask to match
|
|
1451
|
+
// normal DOM event-dispatch timing.
|
|
1452
|
+
if (eventName === events.lo.application.ready && this.applicationReady) {
|
|
1453
|
+
const event = new CustomEvent(events.lo.application.ready);
|
|
1454
|
+
queueMicrotask(() => {
|
|
1455
|
+
if (typeof listener === "function") {
|
|
1456
|
+
listener.call(this, event);
|
|
1457
|
+
}
|
|
1458
|
+
else {
|
|
1459
|
+
listener.handleEvent(event);
|
|
1460
|
+
}
|
|
1461
|
+
});
|
|
1462
|
+
}
|
|
1463
|
+
super.addEventListener(eventName, listener, options);
|
|
1464
|
+
}
|
|
1410
1465
|
#access(orgUrl) {
|
|
1411
1466
|
try {
|
|
1412
1467
|
this.#orgUrl = new URL(orgUrl);
|
|
@@ -1475,10 +1530,20 @@ class LightningOutApplication extends HTMLElement {
|
|
|
1475
1530
|
}
|
|
1476
1531
|
#iframeLoaded = (event) => {
|
|
1477
1532
|
// Set our internal flag
|
|
1478
|
-
this.
|
|
1479
|
-
|
|
1480
|
-
//
|
|
1481
|
-
|
|
1533
|
+
this.applicationReady = true;
|
|
1534
|
+
const eventDetail = event.detail;
|
|
1535
|
+
// Handle both old format (string) and new format (object with origin and lightningDomain)
|
|
1536
|
+
if (typeof eventDetail === "string") {
|
|
1537
|
+
// Legacy format: detail is just the origin string
|
|
1538
|
+
this.#lwrAppOrigin = eventDetail;
|
|
1539
|
+
}
|
|
1540
|
+
else {
|
|
1541
|
+
// New format: detail is an object with origin and optional lightningDomain
|
|
1542
|
+
// Use lightningDomain if provided, otherwise fall back to origin
|
|
1543
|
+
this.#lwrAppOrigin = eventDetail.lightningDomain || eventDetail.origin;
|
|
1544
|
+
}
|
|
1545
|
+
// Reset the router so it picks up the new origin in its config
|
|
1546
|
+
this.#loRouter = undefined;
|
|
1482
1547
|
// Initiate registered components
|
|
1483
1548
|
this.#initComponents();
|
|
1484
1549
|
// Notify the user that the application session is ready
|
package/dist/index.iife.debug.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @salesforce/lightning-out v2.2.1-rc.
|
|
1
|
+
/*! @salesforce/lightning-out v2.2.1-rc.7 (2026-06-16) */
|
|
2
2
|
var LO2 = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -426,10 +426,15 @@ var LO2 = (function (exports) {
|
|
|
426
426
|
// Clear the timeout, cache its window and origin
|
|
427
427
|
this.#timeoutID = clearTimeout(this.#timeoutID);
|
|
428
428
|
this.#config(event.source, event.origin);
|
|
429
|
-
//
|
|
430
|
-
|
|
429
|
+
// Extract lightningDomain from the postMessage if provided
|
|
430
|
+
const lightningDomain = event.data.lightningDomain;
|
|
431
|
+
// Notify the parentElement that the iframe has successfully loaded.
|
|
432
|
+
// Pass both origin and lightningDomain so the app can decide which to use.
|
|
431
433
|
this.#parentElement.dispatchEvent(new CustomEvent(events.lo.iframe.load, {
|
|
432
|
-
detail:
|
|
434
|
+
detail: {
|
|
435
|
+
origin: event.origin,
|
|
436
|
+
lightningDomain: lightningDomain,
|
|
437
|
+
},
|
|
433
438
|
}));
|
|
434
439
|
break;
|
|
435
440
|
}
|
|
@@ -1052,7 +1057,7 @@ var LO2 = (function (exports) {
|
|
|
1052
1057
|
]);
|
|
1053
1058
|
class LightningOutComponent extends HTMLElement {
|
|
1054
1059
|
_uuid = getUUID();
|
|
1055
|
-
|
|
1060
|
+
componentReady = false;
|
|
1056
1061
|
_standardName = elementNameToStandardName(this.localName); // May change during registration
|
|
1057
1062
|
#parentApp; // The parent LightningOutApplication
|
|
1058
1063
|
#loError = new LightningOutError(this);
|
|
@@ -1079,7 +1084,7 @@ var LO2 = (function (exports) {
|
|
|
1079
1084
|
return compURL;
|
|
1080
1085
|
}
|
|
1081
1086
|
_init() {
|
|
1082
|
-
if (!this.
|
|
1087
|
+
if (!this.componentReady) {
|
|
1083
1088
|
// We don't care about events.lo.iframe.ready, we care about messages.lo.ready
|
|
1084
1089
|
this.#loIFrame.load(this._getComponentURL().href);
|
|
1085
1090
|
}
|
|
@@ -1092,6 +1097,9 @@ var LO2 = (function (exports) {
|
|
|
1092
1097
|
logger$1.debug("#messageListener:", `this._uuid: ${this._uuid}`, `this._standardName: ${this._standardName}`, `event.data: ${JSON.stringify(event.data)}`);
|
|
1093
1098
|
switch (event.data.type) {
|
|
1094
1099
|
case messages.lo.ready: {
|
|
1100
|
+
// Flip the gate before draining: the queued items re-enter addEventListener/dispatchEvent and need to
|
|
1101
|
+
// take the immediate post-message path, not get re-queued.
|
|
1102
|
+
this.componentReady = true;
|
|
1095
1103
|
while (this.#eventQueue.length) {
|
|
1096
1104
|
const item = this.#eventQueue.shift();
|
|
1097
1105
|
if (!item)
|
|
@@ -1106,7 +1114,6 @@ var LO2 = (function (exports) {
|
|
|
1106
1114
|
this.dispatchEvent(item.event);
|
|
1107
1115
|
}
|
|
1108
1116
|
}
|
|
1109
|
-
this._ready = true;
|
|
1110
1117
|
super.dispatchEvent(new CustomEvent(events.lo.component.ready));
|
|
1111
1118
|
break;
|
|
1112
1119
|
}
|
|
@@ -1189,12 +1196,36 @@ var LO2 = (function (exports) {
|
|
|
1189
1196
|
}
|
|
1190
1197
|
};
|
|
1191
1198
|
addEventListener(eventName, listener, options) {
|
|
1199
|
+
// Replay `lo.component.ready` for late subscribers. The event is one-shot (fires once when the iframe
|
|
1200
|
+
// handshake completes) so a listener attached afterwards would otherwise never run. Use a microtask to match
|
|
1201
|
+
// normal DOM event-dispatch timing.
|
|
1202
|
+
if (eventName === events.lo.component.ready && this.componentReady) {
|
|
1203
|
+
const event = new CustomEvent(events.lo.component.ready);
|
|
1204
|
+
queueMicrotask(() => {
|
|
1205
|
+
if (typeof listener === "function") {
|
|
1206
|
+
listener.call(this, event);
|
|
1207
|
+
}
|
|
1208
|
+
else {
|
|
1209
|
+
listener.handleEvent(event);
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
}
|
|
1213
|
+
// `lo.*` events are host-local: they're never dispatched from inside the iframe, so there's nothing to mirror
|
|
1214
|
+
// across the postMessage bridge. Register locally and skip the round-trip + key bookkeeping.
|
|
1215
|
+
if (eventName.startsWith("lo.")) {
|
|
1216
|
+
super.addEventListener(eventName, listener, options);
|
|
1217
|
+
return;
|
|
1218
|
+
}
|
|
1192
1219
|
let key = this.#listenerKeyMap.get(listener);
|
|
1193
1220
|
if (!key) {
|
|
1194
1221
|
key = `${eventName}_${this.#listenerKeySeed++}`;
|
|
1195
1222
|
this.#listenerKeyMap.set(listener, key);
|
|
1196
1223
|
}
|
|
1197
|
-
|
|
1224
|
+
// Gate on componentReady (handshake complete), not iframeReady (which only means window/origin are known).
|
|
1225
|
+
// Between those two points the iframe-side container has not yet bound its embedded component, so any
|
|
1226
|
+
// forwarded message would be silently dropped. Once the handshake completes, the queue is flushed in
|
|
1227
|
+
// #messageListener via the messages.lo.ready branch.
|
|
1228
|
+
if (this.componentReady) {
|
|
1198
1229
|
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1199
1230
|
super.addEventListener(...arguments);
|
|
1200
1231
|
this.#loIFrame.postMessage({
|
|
@@ -1215,7 +1246,8 @@ var LO2 = (function (exports) {
|
|
|
1215
1246
|
return super.dispatchEvent(event);
|
|
1216
1247
|
}
|
|
1217
1248
|
else {
|
|
1218
|
-
|
|
1249
|
+
// Gate on componentReady (handshake complete), not iframeReady — see addEventListener for rationale.
|
|
1250
|
+
if (this.componentReady) {
|
|
1219
1251
|
logger$1.debug(`dispatchEvent: dispatching event "${event.type}" to this Element and embedded Element inside the iframe`);
|
|
1220
1252
|
const result = super.dispatchEvent(event);
|
|
1221
1253
|
this.#loIFrame.postMessage({
|
|
@@ -1226,15 +1258,22 @@ var LO2 = (function (exports) {
|
|
|
1226
1258
|
return result;
|
|
1227
1259
|
}
|
|
1228
1260
|
else {
|
|
1229
|
-
logger$1.debug(`dispatchEvent:
|
|
1261
|
+
logger$1.debug(`dispatchEvent: component not ready, queueing event "${event.type}"`);
|
|
1230
1262
|
this.#eventQueue.push({ type: "dispatch", event });
|
|
1231
1263
|
return true; // Assuming success since we're queueing it
|
|
1232
1264
|
}
|
|
1233
1265
|
}
|
|
1234
1266
|
}
|
|
1235
1267
|
removeEventListener(eventName, listener, options) {
|
|
1268
|
+
// Mirror the addEventListener short-circuit for host-local `lo.*` events.
|
|
1269
|
+
if (eventName.startsWith("lo.")) {
|
|
1270
|
+
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1271
|
+
super.removeEventListener(...arguments);
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1236
1274
|
const key = this.#listenerKeyMap.get(listener);
|
|
1237
|
-
|
|
1275
|
+
// Gate on componentReady (handshake complete), not iframeReady — see addEventListener for rationale.
|
|
1276
|
+
if (this.componentReady) {
|
|
1238
1277
|
// @ts-ignore: Spread arguments works at runtime even though TypeScript doesn't like it
|
|
1239
1278
|
super.removeEventListener(...arguments);
|
|
1240
1279
|
this.#loIFrame.postMessage({
|
|
@@ -1268,7 +1307,7 @@ var LO2 = (function (exports) {
|
|
|
1268
1307
|
this.style.height ||= "100%";
|
|
1269
1308
|
this.#parentApp = registry.registerComponent(this);
|
|
1270
1309
|
this._standardName = this.#parentApp._getComponentStandardName(this);
|
|
1271
|
-
if (this.#parentApp.
|
|
1310
|
+
if (this.#parentApp.applicationReady) {
|
|
1272
1311
|
this._init();
|
|
1273
1312
|
}
|
|
1274
1313
|
}
|
|
@@ -1317,9 +1356,8 @@ var LO2 = (function (exports) {
|
|
|
1317
1356
|
appURL = new URL(`lwr/application/amd/0/${lang}ai/${lwrApp}`, this.config.origin);
|
|
1318
1357
|
}
|
|
1319
1358
|
else {
|
|
1320
|
-
// Route to CLWR
|
|
1321
|
-
|
|
1322
|
-
appURL = new URL(pathname, this.config.origin);
|
|
1359
|
+
// Route to CLWR. Note: sitePrefix may be blank and that's okay.
|
|
1360
|
+
appURL = new URL(`${this.config.sitePrefix}/lightning-out`, this.config.origin);
|
|
1323
1361
|
}
|
|
1324
1362
|
appURL.searchParams.set("componentName", componentName);
|
|
1325
1363
|
return this.#addCommonParams(appURL, parentElementId);
|
|
@@ -1345,7 +1383,7 @@ var LO2 = (function (exports) {
|
|
|
1345
1383
|
url.searchParams.set("parentElementId", parentElementId);
|
|
1346
1384
|
url.searchParams.set("loAppOrigin", this.config.loAppOrigin);
|
|
1347
1385
|
// This helps in general but also for cache busting
|
|
1348
|
-
url.searchParams.set("loVersion", "2.2.1-rc.
|
|
1386
|
+
url.searchParams.set("loVersion", "2.2.1-rc.7");
|
|
1349
1387
|
if (this.config.appId) {
|
|
1350
1388
|
url.searchParams.set("appId", this.config.appId);
|
|
1351
1389
|
}
|
|
@@ -1372,7 +1410,7 @@ var LO2 = (function (exports) {
|
|
|
1372
1410
|
const INIT_TRIGGERING_PROPS = new Set(["frontdoorUrl", "orgUrl"]);
|
|
1373
1411
|
class LightningOutApplication extends HTMLElement {
|
|
1374
1412
|
_uuid = getUUID();
|
|
1375
|
-
|
|
1413
|
+
applicationReady = false;
|
|
1376
1414
|
#loError = new LightningOutError(this);
|
|
1377
1415
|
#loIFrame = new LightningOutIFrame({
|
|
1378
1416
|
parentElement: this,
|
|
@@ -1410,6 +1448,23 @@ var LO2 = (function (exports) {
|
|
|
1410
1448
|
// We have to register this instance as early as possible
|
|
1411
1449
|
registry.registerApplication(this);
|
|
1412
1450
|
}
|
|
1451
|
+
addEventListener(eventName, listener, options) {
|
|
1452
|
+
// Replay `lo.application.ready` for late subscribers. The event is one-shot (fires once when the iframe
|
|
1453
|
+
// finishes loading) so a listener attached afterwards would otherwise never run. Use a microtask to match
|
|
1454
|
+
// normal DOM event-dispatch timing.
|
|
1455
|
+
if (eventName === events.lo.application.ready && this.applicationReady) {
|
|
1456
|
+
const event = new CustomEvent(events.lo.application.ready);
|
|
1457
|
+
queueMicrotask(() => {
|
|
1458
|
+
if (typeof listener === "function") {
|
|
1459
|
+
listener.call(this, event);
|
|
1460
|
+
}
|
|
1461
|
+
else {
|
|
1462
|
+
listener.handleEvent(event);
|
|
1463
|
+
}
|
|
1464
|
+
});
|
|
1465
|
+
}
|
|
1466
|
+
super.addEventListener(eventName, listener, options);
|
|
1467
|
+
}
|
|
1413
1468
|
#access(orgUrl) {
|
|
1414
1469
|
try {
|
|
1415
1470
|
this.#orgUrl = new URL(orgUrl);
|
|
@@ -1478,10 +1533,20 @@ var LO2 = (function (exports) {
|
|
|
1478
1533
|
}
|
|
1479
1534
|
#iframeLoaded = (event) => {
|
|
1480
1535
|
// Set our internal flag
|
|
1481
|
-
this.
|
|
1482
|
-
|
|
1483
|
-
//
|
|
1484
|
-
|
|
1536
|
+
this.applicationReady = true;
|
|
1537
|
+
const eventDetail = event.detail;
|
|
1538
|
+
// Handle both old format (string) and new format (object with origin and lightningDomain)
|
|
1539
|
+
if (typeof eventDetail === "string") {
|
|
1540
|
+
// Legacy format: detail is just the origin string
|
|
1541
|
+
this.#lwrAppOrigin = eventDetail;
|
|
1542
|
+
}
|
|
1543
|
+
else {
|
|
1544
|
+
// New format: detail is an object with origin and optional lightningDomain
|
|
1545
|
+
// Use lightningDomain if provided, otherwise fall back to origin
|
|
1546
|
+
this.#lwrAppOrigin = eventDetail.lightningDomain || eventDetail.origin;
|
|
1547
|
+
}
|
|
1548
|
+
// Reset the router so it picks up the new origin in its config
|
|
1549
|
+
this.#loRouter = undefined;
|
|
1485
1550
|
// Initiate registered components
|
|
1486
1551
|
this.#initComponents();
|
|
1487
1552
|
// Notify the user that the application session is ready
|
package/dist/index.iife.prod.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/*! @salesforce/lightning-out v2.2.1-rc.
|
|
2
|
-
var LO2=function(e){"use strict";function t(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(36)}const r={application:{ready:"lo.application.ready",error:"lo.application.error",logout:"lo.application.logout",auth:{redirect:"lo.application.auth.redirect"}},component:{ready:"lo.component.ready",error:"lo.component.error"},iframe:{load:"lo.iframe.load",error:"lo.iframe.error",logout:"lo.iframe.logout",auth:{redirect:"lo.iframe.auth.redirect"}}},i={addEventListener:"lo.addEventListener",dispatchEvent:"lo.dispatchEvent",error:"lo.error",getComponentData:"lo.getComponentData",loaded:"lo.loaded",logout:"lo.logout",ready:"lo.ready",redirect:"lo.redirect",removeEventListener:"lo.removeEventListener",setComponentData:"lo.setComponentData",setComponentProps:"lo.setComponentProps"},s={error:0,warn:1,info:2,debug:3,trace:4};class o{static#e="LO2";static#t="error";#r;static set level(e){this.#t=e}static set prefix(e){this.#e=e}get brand(){return`${o.#e}:${this.#r}:`}constructor(e){this.#r="string"==typeof e?e:e.constructor?.name}error(...e){s.error<=s[o.#t]&&console.error(this.brand,...e)}warn(...e){s.warn<=s[o.#t]&&console.warn(this.brand,...e)}info(...e){s.info<=s[o.#t]&&console.info(this.brand,...e)}debug(...e){s.debug<=s[o.#t]&&console.debug(this.brand,...e)}trace(...e){s.trace<=s[o.#t]&&console.trace(this.brand,...e)}}const
|
|
1
|
+
/*! @salesforce/lightning-out v2.2.1-rc.7 (2026-06-16) */
|
|
2
|
+
var LO2=function(e){"use strict";function t(){return Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(36)}const r={application:{ready:"lo.application.ready",error:"lo.application.error",logout:"lo.application.logout",auth:{redirect:"lo.application.auth.redirect"}},component:{ready:"lo.component.ready",error:"lo.component.error"},iframe:{load:"lo.iframe.load",error:"lo.iframe.error",logout:"lo.iframe.logout",auth:{redirect:"lo.iframe.auth.redirect"}}},i={addEventListener:"lo.addEventListener",dispatchEvent:"lo.dispatchEvent",error:"lo.error",getComponentData:"lo.getComponentData",loaded:"lo.loaded",logout:"lo.logout",ready:"lo.ready",redirect:"lo.redirect",removeEventListener:"lo.removeEventListener",setComponentData:"lo.setComponentData",setComponentProps:"lo.setComponentProps"},s={error:0,warn:1,info:2,debug:3,trace:4};class o{static#e="LO2";static#t="error";#r;static set level(e){this.#t=e}static set prefix(e){this.#e=e}get brand(){return`${o.#e}:${this.#r}:`}constructor(e){this.#r="string"==typeof e?e:e.constructor?.name}error(...e){s.error<=s[o.#t]&&console.error(this.brand,...e)}warn(...e){s.warn<=s[o.#t]&&console.warn(this.brand,...e)}info(...e){s.info<=s[o.#t]&&console.info(this.brand,...e)}debug(...e){s.debug<=s[o.#t]&&console.debug(this.brand,...e)}trace(...e){s.trace<=s[o.#t]&&console.trace(this.brand,...e)}}const n=new o("LightningOutError");class a{#i;#r;constructor(e){this.#r="string"==typeof e?e:e.constructor?.name,"function"==typeof e.dispatchEvent&&(this.#i=e)}#s(e){return`${this.#r}: ${e}`}create(e){const t="string"==typeof e?e:e.message;return new Error(this.#s(t))}dispatch(e,t){const r="string"==typeof t?t:t.message||t.detail?.message;if(this.#i){const i=t.detail||{message:this.#s(r),originalError:t},s=new CustomEvent(e,{detail:i});this.#i.dispatchEvent(s),n.error(`${this.#s("dispatched error")} -> ${e}: ${r}`)}else n.error(`${this.#s("unable to dispatch error on a non-EventTarget object")} -> ${e}: ${r}`)}}const l=new a("LightningOutUtils");function h(e){return e.replace(/([A-Z])/g,"-$1").toLowerCase()}function c(e,t=!1){if(/[A-Z]/.test(e))throw l.create(`elementNameToStandardName: "${e}" is not a valid custom element name - must be all lowercase.`);const r=e.indexOf("-");if(-1===r)throw l.create(`elementNameToStandardName: "${e}" is not a valid custom element name - missing hyphen character.`);return`${function(e){if(/[A-Z]/.test(e))throw l.create(`snakeToCamel: "${e}" is not valid snake_case - must be all lowercase.`);return e.replace(/_([a-z_])/g,(e,t)=>t.toUpperCase())}(e.slice(0,r))}${t?":":"/"}${function(e){if(/[A-Z]/.test(e))throw l.create(`kebabToCamel: "${e}" is not valid kebab-case - must be all lowercase.`);return e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}(e.slice(r+1))}`}function d(e,t){const r=Object.entries(t).map(t=>{let[r,i]=t;const s=r.split("dataMirror");2===s.length&&""===s[0]&&(r=s[1].charAt(0).toLowerCase()+s[1].slice(1));const o=`_propertyChanged_${r}`;if("function"==typeof e[o]){i=(0,e[o])(i)}return[r,i]});return Object.fromEntries(r)}const p=new o("LightningOutIFrame");class m{#o;#n;#a;#l="display:none";#h="border:0px; width:100%; height:100%; overflow:auto;";#c;#d;#p;#m;#u;#g;constructor(e){this.#o=e.parentElement,this.#n=e.isVisible,this.#a=new a(e.parentElement)}get iframeReady(){return!!this.#p&&!!this.#m}get iframeElement(){return this.#d}#f(e,t){this.#p=e,this.#m=t}#v=e=>{if(e.data.id===this.#o._uuid)switch(p.debug("#messageListener:",`parentElement._uuid: ${this.#o._uuid}`,`parentElement.localName: ${this.#o.localName}`,JSON.stringify(e.data)),e.data.type){case i.loaded:{this.#g=clearTimeout(this.#g),this.#f(e.source,e.origin);const t=e.data.lightningDomain;this.#o.dispatchEvent(new CustomEvent(r.iframe.load,{detail:{origin:e.origin,lightningDomain:t}}));break}case i.logout:this.#g=clearTimeout(this.#g),this.#o.dispatchEvent(new CustomEvent(r.iframe.logout));break;case i.redirect:this.#g=clearTimeout(this.#g),this.#o.dispatchEvent(new CustomEvent(r.iframe.auth.redirect,{detail:{redirectUrl:e.data.redirectUrl,redirectOrigin:e.origin}}))}};#b(e){this.#d&&this.#n&&(this.#d.style.height=`${e}px`,p.debug(`#handleResize: applied height ${e}px to iframe`))}#w(){if(!this.#d){const e=window.document.createElement("iframe");e.name="lightning_af",e.setAttribute("sandbox",["allow-downloads","allow-forms","allow-popups","allow-same-origin","allow-scripts","allow-top-navigation-by-user-activation"].join(" ")),e.style.cssText=this.#n?this.#h:this.#l,this.#d=e,this.#c=this.#o.attachShadow({mode:"closed"}),this.#c.appendChild(this.#d),e.addEventListener("load",this.#y),window.addEventListener("message",this.#v)}return this.#d}load(e){const t=this.#w();this.#u=new URL(e),p.debug("#loadIframe: endpoint =",function(e){const t={},r=e=>{const t={};for(const[r,i]of e.entries())t[r]=i;return t};if(t.url=e.origin+e.pathname,t.urlParams=r(e.searchParams),"/secur/frontdoor.jsp"===e.pathname){const e=t.urlParams.otp?"startURL":"retURL",i=new URL(t.urlParams[e],"http://dummy.com");t.urlParams[e]={url:i.pathname,urlParams:r(i.searchParams)}}return t}(this.#u)),this.#f(void 0,void 0),this.#n?t.src=e:localStorage.getItem("LightningOutIFrame:load:window.open")?window.open(e,`LO2 Hidden ${this.#o._uuid}`,"left=200,top=200,width=800,height=800"):t.src=e}#y=()=>{this.#g&&clearTimeout(this.#g),this.#g=setTimeout(()=>{if(!this.iframeReady){const e="Error: Unknown error, unable to load the iframe.";this.#a.dispatch(r.iframe.error,e),this.#E(e)}},6e4)};destroy(){this.#c&&(this.#c.innerHTML=""),this.#d&&this.#d.remove(),this.#c=void 0,this.#d=void 0,this.#f(void 0,void 0)}#E(e){if(this.#n&&this.#u){const t=new URL("/lightning/lightning.out.message.html",this.#u.origin);t.search=new URLSearchParams({loAppOrigin:window.location.origin,parentElementId:this.#o._uuid,message:e}).toString(),this.load(t.href)}}postMessage(e){if(!this.#p||!this.#m)throw this.#a.create("Error attempting to postMessage on an iframe that is not ready.");p.debug("postMessage:",`parentElement: ${this.#o._uuid}`,JSON.stringify(e));try{this.#p.postMessage(e,this.#m)}catch(e){const t=`postMessage error: ${e}`;throw this.#a.dispatch(r.iframe.error,t),this.#a.create(t)}}}
|
|
3
3
|
/**
|
|
4
4
|
* @file property-observer.ts
|
|
5
5
|
* @author Caridy Patiño (2025)
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @description Provides the PropertyObserver class, a utility to observe property and attribute
|
|
8
8
|
* changes on any DOM element, with automatic getter/setter interception and batched notifications.
|
|
9
|
-
*/const u=new o("PropertyObserver");class g{_el;_cb;_cache;_shouldObserve;_interceptedProps;_originalDescriptors;_observer;_changesPending;_pendingChanges;_attributeExceptions=new Map([["for","htmlFor"],["class","className"],["formnovalidate","formNoValidate"],["readonly","readOnly"],["maxlength","maxLength"],["minlength","minLength"],["contenteditable","contentEditable"],["spellcheck","spellcheck"],["novalidate","noValidate"],["autofocus","autofocus"],["autocomplete","autocomplete"],["crossorigin","crossOrigin"]]);constructor(e,t,r){if(!(e instanceof Element))throw new TypeError("Target must be a DOM Element");if("function"!=typeof t)throw new TypeError("Callback must be a function");if(r&&"function"!=typeof r)throw new TypeError("shouldObserve callback must be a function");this._el=e,this._cb=t,this._cache=new Map,this._shouldObserve=r||((e,t)=>!1===t),this._interceptedProps=new Set,this._originalDescriptors=new Map,this._changesPending=!1,this._pendingChanges={},this._initialScan(),this._setupMutationObserver()}disconnect(){this._observer&&this._observer.disconnect();for(const[e,t]of this._originalDescriptors)Object.defineProperty(this._el,e,t);this._cache.clear(),this._interceptedProps.clear(),this._originalDescriptors.clear(),this._pendingChanges={},this._changesPending=!1}_initialScan(){const e={};for(const t of Array.from(this._el.attributes)){const r=t.name,i=this._isStandardAttribute(r);if(!this._shouldObserve(r,i))continue;const s=this._attributeNameToPropName(r),o=t.value;e[s]=o,this._cache.set(s,o),this._installPropertyInterceptor(s)}for(const t of Object.getOwnPropertyNames(this._el)){const r=this._isStandardProperty(t);if(this._cache.has(t)||!this._shouldObserve(t,r))continue;const i=this._el[t];e[t]=i,this._cache.set(t,i),this._installPropertyInterceptor(t)}if(Object.keys(e).length>0)try{this._cb(e)}catch(e){u.error("Error in initial PropertyObserver callback:",e)}}_setupMutationObserver(){this._observer=new MutationObserver(e=>{const t={};for(const r of e)if("attributes"===r.type&&r.attributeName){const e=r.attributeName,i=this._isStandardAttribute(e);if(!this._shouldObserve(e,i))continue;const s=this._attributeNameToPropName(e),o=this._el.getAttribute(e);o!==this._cache.get(s)&&(t[s]=o,this._cache.set(s,o),this._interceptedProps.has(s)||this._installPropertyInterceptor(s))}Object.keys(t).length>0&&this._batchChanges(t)}),this._observer.observe(this._el,{attributes:!0,attributeOldValue:!1})}_installPropertyInterceptor(e){if(this._interceptedProps.has(e))return;const t=Object.getOwnPropertyDescriptor(this._el,e)||{value:this._el[e],writable:!0,enumerable:!0,configurable:!0};this._originalDescriptors.set(e,t);const r={enumerable:t.enumerable,configurable:t.configurable,get:t.get||(()=>t.value),set:r=>{r!==this._cache.get(e)&&(t.set?t.set.call(this._el,r):t.value=r,this._cache.set(e,r),this._batchChanges({[e]:r}))}};Object.defineProperty(this._el,e,r),this._interceptedProps.add(e)}_batchChanges(e){Object.assign(this._pendingChanges,e),this._changesPending||(this._changesPending=!0,queueMicrotask(()=>{this._changesPending=!1;const e={...this._pendingChanges};this._pendingChanges={};try{this._cb(e)}catch(e){u.error("Error in PropertyObserver callback:",e)}}))}_attributeNameToPropName(e){return this._attributeExceptions.has(e)?this._attributeExceptions.get(e):e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_isStandardAttribute(e){if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("on"))return!0;const t=this._attributeNameToPropName(e);return this._isStandardProperty(t)}_isStandardProperty(e){return e in HTMLElement.prototype}}const f=new class{#E=new n("LightningOutRegistry");appToComps=new WeakMap;compToApp=new WeakMap;compNameToApp=new Map;registerApplication(e){this.appToComps.has(e)||this.appToComps.set(e,new Set)}registerComponentName(e,t){if(this.compNameToApp.has(e))throw this.#E.create(`"${e}" is already registered to another App.`);this.compNameToApp.set(e,t)}registerComponent(e,t){if(this.compToApp.has(e))throw this.#E.create("This Comp is already registered to another App.");let r=t;if(!r){const t=e.localName;if(r=this.compNameToApp.get(t),!r)throw this.#E.create(`Could not find a parent App for component "${e.localName}"`)}return this.appToComps.get(r).add(e),this.compToApp.set(e,r),r}unregisterComponent(e){const t=this.compToApp.get(e);if(!t)return!1;const r=this.appToComps.get(t);return r?.delete(e),this.compToApp.delete(e),!0}getComps(e){const t=this.appToComps.get(e);if(!t)throw this.#E.create("Unable to find set of LightningOutComponents");return t}},b=new o("LightningOutComponent"),w=new Set(["autocapitalize","autocorrect","dir","enterkeyhint","inputmode","lang","spellcheck","style","title","translate"]),v=new Set(["aria-disabled","aria-hidden","aria-label","aria-live","aria-modal","aria-pressed","aria-valuemax","aria-valuemin","aria-valuenow"]),_=new Set(["accesskey","autofocus","draggable","exportparts","hidden","inert","nonce","part","slot","tabindex"]),y=new Set(["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"]);class E extends HTMLElement{_uuid=t();_ready=!1;_standardName=c(this.localName);#C;#E=new n(this);#L=new m({parentElement:this,isVisible:!0});#A;#P=!0;#O=[];#$=new WeakMap;#U=0;constructor(){super(),b.trace("constructor: called",`_uuid: ${this._uuid}`)}_getComponentURL(){const e=this.#C;if(!e)throw this.#E.create("Undefined parent App!");return e._getComponentURL(this._standardName,this._uuid)}_init(){this._ready||this.#L.load(this._getComponentURL().href)}#b=e=>{if(e.data.id===this._uuid)switch(b.debug("#messageListener:",`this._uuid: ${this._uuid}`,`this._standardName: ${this._standardName}`,`event.data: ${JSON.stringify(e.data)}`),e.data.type){case i.ready:for(;this.#O.length;){const e=this.#O.shift();e&&("add"===e.type?this.addEventListener(...e.args):"remove"===e.type?this.removeEventListener(...e.args):"dispatch"===e.type&&this.dispatchEvent(e.event))}this._ready=!0,super.dispatchEvent(new CustomEvent(r.component.ready));break;case i.getComponentData:this.#A=new g(this,this.#S,this.#R);break;case i.dispatchEvent:{const t=new CustomEvent(e.data.name,{detail:e.data.detail});super.dispatchEvent(t);break}case i.error:this.#E.dispatch(r.component.error,e.data.error);break;default:b.info("#messageListener:","Unknown message received:",{"event.data":e.data})}};_propertyChanged_style=e=>{const t=this.style,r=[];for(let e=0;e<t.length;e+=1){const i=t.item(e);i.startsWith("--")&&r.push(`${i}:${t.getPropertyValue(i)}`)}return r.join(";")};#S=e=>{const t=d(this,e);b.debug("#propObserverCallback:",{changes:e,propsToSend:t}),this.#P?(this.#P=!1,this.#L.postMessage({type:i.setComponentData,componentData:{id:this._uuid,name:this._standardName,props:t}})):this.#L.postMessage({type:i.setComponentProps,componentProps:t})};#R=(e,t)=>{const r=l(e);return b.debug("#shouldObserveCallback:",{attrOrPropName:e,attrName:r,isStandard:t}),t?!(!w.has(r)&&!v.has(r))||(_.has(r)||y.has(r)||r.startsWith("on")?(b.warn(`"${r}" will not be mirrored.`),!1):!!r.startsWith("data-mirror-")||(b.warn(`"${r}" will not be mirrored.`),!1)):!r.startsWith("_")};addEventListener(e,t,r){let s=this.#$.get(t);s||(s=`${e}_${this.#U++}`,this.#$.set(t,s)),this.#L.iframeReady?(super.addEventListener(...arguments),this.#L.postMessage({name:e,options:r,listenerKey:s,type:i.addEventListener})):(this.#O.push({type:"add",args:[e,t,r]}),b.debug("addEventListener:","#eventQueue pushed add args:",[e,t,r]))}dispatchEvent(e){if(e.type.startsWith("lo."))return b.debug(`dispatchEvent: dispatching event "${e.type}" to this Element only`),super.dispatchEvent(e);if(this.#L.iframeReady){b.debug(`dispatchEvent: dispatching event "${e.type}" to this Element and embedded Element inside the iframe`);const t=super.dispatchEvent(e);return this.#L.postMessage({name:e.type,detail:e.detail||{},type:i.dispatchEvent}),t}return b.debug(`dispatchEvent: iframe not reade, queueing event "${e.type}"`),this.#O.push({type:"dispatch",event:e}),!0}removeEventListener(e,t,r){const s=this.#$.get(t);this.#L.iframeReady?(super.removeEventListener(...arguments),this.#L.postMessage({name:e,options:r,listenerKey:s,type:i.removeEventListener})):(this.#O.push({type:"remove",args:[e,t,r]}),b.debug("removeEventListener:","#eventQueue pushed remove args:",[e,t,r])),s&&this.#$.delete(t)}adoptedCallback(){throw this.remove(),this.#E.create("This component cannot be rerendered for security reasons.")}connectedCallback(){if(b.trace("connectedCallback: called",`_uuid: ${this._uuid}`),window.addEventListener("message",this.#b),this.hasChildNodes())throw this.#E.create("Should not have child nodes");this.style.display||="block",this.style.width||="100%",this.style.height||="100%",this.#C=f.registerComponent(this),this._standardName=this.#C._getComponentStandardName(this),this.#C._ready&&this._init()}disconnectedCallback(){b.trace("disconnectedCallback: called",`_uuid: ${this._uuid}`),this.#L.destroy(),window.removeEventListener("message",this.#b),f.unregisterComponent(this),this.#A?.disconnect()}connectedMoveCallback(){}}class C{config;errorHandler;constructor(e,t){if(this.config=e,this.errorHandler=t,!this.config.origin)throw this.errorHandler('Missing "frontdoor-url" or "org-url" attribute')}getComponentURL(e,t){let r;if(void 0===this.config.sitePrefix){let t=e.includes("/")?this.config.lwrAppComp:e.includes(":")?this.config.lwrAppAura:void 0;if(void 0===t)throw this.errorHandler(`Invalid componentName: ${e}`);t=t.replace("/","%2F");const i=this.config.lang?`l/${this.config.lang}/`:"";r=new URL(`lwr/application/amd/0/${i}ai/${t}`,this.config.origin)}else{const e=`${this.config.sitePrefix}/lightning-out`;r=new URL(e,this.config.origin)}return r.searchParams.set("componentName",e),this.#N(r,t)}getAuthURL(e){let t;if(void 0===this.config.sitePrefix){const e=this.config.lwrAppAuth.replace("/","%2F");t=new URL(`lwr/application/amd/0/ai/${e}`,this.config.origin)}else t=new URL(this.config.lwrPageAuth,this.config.origin);return this.#N(t,e)}getPageURL(e,t){const r=new URL(e,this.config.origin);return this.#N(r,t)}#N(e,t){return e.searchParams.set("parentElementId",t),e.searchParams.set("loAppOrigin",this.config.loAppOrigin),e.searchParams.set("loVersion","2.2.1-rc.2"),this.config.appId&&e.searchParams.set("appId",this.config.appId),this.config.testMode&&e.searchParams.set("testMode","true"),this.config.designSystem&&e.searchParams.set("designSystem",this.config.designSystem),this.config.globalStyle&&e.searchParams.set("globalStyle",this.config.globalStyle),e}}const L=new o("LightningOutApplication"),A=new Set(["slds1","slds2","none"]),P=new Set(["frontdoorUrl","orgUrl"]);class O extends HTMLElement{_uuid=t();_ready=!1;#E=new n(this);#L=new m({parentElement:this,isVisible:!1});#k;#A;#I="";#T="lightningout/auth";#M="lightningout/container";#x="lightningout/auraContainer";#D="lightning/lightning.out.auth.html";#F="lightning/lightning.out.logout.html";#j="lightning/lightning.out.auth.error.html";#V="/secur/logout.jsp";lwrApplication;orgUrl;#W;frontdoorUrl;#H;appId;#K;components;#Q=new Map;sitePrefix;#z;designSystem;#Z;globalStyle;#J;#q=document.documentElement.lang??"";constructor(){super(),L.trace("constructor: called",`_uuid: ${this._uuid}`),f.registerApplication(this)}#G(e){try{this.#W=new URL(e)}catch{throw this.#E.create(`Invalid org-url: ${e}`)}this.dispatchEvent(new CustomEvent(r.iframe.load,{detail:this.#W.origin}))}#X(e){try{this.#H=new URL(e),this.#I=this.#H.origin;const t=this.#B(),r=this.#H.searchParams.has("otp")?"startURL":"retURL";this.#H.searchParams.set(r,t.pathname+t.search);const i=this.#Y(this.#j);this.#H.searchParams.set("error-redirect-uri",i.pathname+i.search)}catch{throw this.#E.create(`Invalid frontdoor-url: ${e}`)}this.#L.load(this.#H.href)}#ee(){const e=new URL(this.#V,this.#I),t=this.#Y(this.#F);e.searchParams.set("redirect-uri",t.pathname+t.search),this.#L.load(e.href)}getRouter(){if(void 0===this.#k){const e={origin:this.#I,lwrPageAuth:this.#D,lwrAppAuth:this.#T,lwrAppComp:this.#M,lwrAppAura:this.#x,sitePrefix:this.#z,lang:this.#q,appId:this.#K,testMode:this.__testMode||!1,loAppOrigin:window.location.origin,designSystem:this.#Z,globalStyle:this.#J};this.#k=new C(e,e=>this.#E.create(e))}return this.#k}_getComponentURL(e,t){return this.getRouter().getComponentURL(e,t)}#B(){return this.getRouter().getAuthURL(this._uuid)}#Y(e){return this.getRouter().getPageURL(e,this._uuid)}#te=e=>{this._ready=!0,this.#I=e.detail,this.#re(),this.dispatchEvent(new CustomEvent(r.application.ready))};#ie=e=>{this.#E.dispatch(r.application.error,e)};#se=e=>{this.dispatchEvent(new CustomEvent(r.application.logout))};#oe=e=>{this.dispatchEvent(new CustomEvent(r.application.auth.redirect,{detail:e.detail}))};#re(){f.getComps(this).forEach(e=>{e._init()})}#S=e=>{const t={},r={};Object.keys(e).forEach(i=>{P.has(i)?r[i]=e[i]:t[i]=e[i]}),d(this,t),d(this,r)};#R=(e,t)=>t?"lang"===e:!e.startsWith("_");_propertyChanged_lwrApplication=e=>{if(void 0!==e){const t=e.split("/");if(2!==t.length||!t[0]||!t[1])throw this.#E.create(`"${e}" is not a valid lwr-application name, must be of the form 'namespace/name'`);this.#M=e}};_propertyChanged_lang=e=>{this.#q=e??""};_propertyChanged_orgUrl=e=>{if(void 0!==e){if(void 0!==this.#H)throw this.#E.create('Can\'t set "org-url" because "frontdoor-url" is already set');""===e?this.#ee():this.#G(e)}};_propertyChanged_frontdoorUrl=e=>{if(void 0!==e){if(void 0!==this.#W)throw this.#E.create('Can\'t set "frontdoor-url" because "org-url" is already set');""===e?this.#ee():this.#X(e)}};_propertyChanged_sitePrefix=e=>{void 0!==e&&(this.#z=e)};_propertyChanged_appId=e=>{void 0!==e&&(this.#K=e)};_propertyChanged_globalStyle=e=>{if(void 0!==e){const t=e.split(";").map(e=>e.trim()).filter(e=>e.length>0),r=[];for(const e of t){const[t,...i]=e.split(":"),s=t.trim();if(!s.startsWith("--"))throw this.#E.create(`Invalid global-style: "${s}" is not a CSS custom property. Only CSS custom properties (starting with --) are allowed.`);const o=i.join(":").trim();o&&r.push(`${s}:${o}`)}this.#J=r.join(";")+";"}};_propertyChanged_components=e=>{void 0!==e&&e.split(",").forEach(e=>{const[t,r]=e.split(" as ").map(e=>e.trim()),i=function(e){return e.includes("/")||e.includes(":")}(t);if(i&&t.includes(":"))throw this.#E.create(`"${t}" is not supported in components. Use kebab "namespace-name" in components and the "aura" attribute on the component element instead.`);const s=i?t:c(t),o=r||(i?function(e){const t=e.includes("/")?"/":":",r=e.indexOf(t);if(-1===r)throw h.create(`standardNameToElementName: "${e}" is not a valid component name - missing namespace separator.`);if(/-/.test(e))throw h.create(`standardNameToElementName: "${e}" is not a valid component name - must not contain hyphens.`);if(/^[A-Z]/.test(e))throw h.create(`standardNameToElementName: "${e}" is not a valid component name - first character must not be uppercase.`);const i=e.slice(0,r),s=e.slice(r+1);return`${i.replace(/([A-Z_])/g,"_$1").toLowerCase()}-${l(s)}`}(s):t);if(o&&!this.#Q.has(o)){this.#Q.set(o,s);try{f.registerComponentName(o,this),customElements.define(o,class extends E{})}catch(e){throw this.#E.create(`"${o}" is already registered. ${e}`)}}})};_propertyChanged_designSystem=e=>{if(void 0!==e&&!A.has(e))throw this.#E.create(`Invalid design-system: ${e}`);this.#Z=e};_getComponentStandardName(e){const t=e.localName,r=e.hasAttribute("aura"),i=this.#Q.get(t);if(!i)throw this.#E.create(`"${t}" is not registered.`);return r&&i.includes("/")?i.replace("/",":"):i}get _compNames(){}connectedCallback(){if(L.trace("connectedCallback: called",`_uuid: ${this._uuid}`),this.hasChildNodes())throw this.#E.create("Should not have child nodes");this.style.display||="none",this.addEventListener(r.iframe.load,this.#te),this.addEventListener(r.iframe.error,this.#ie),this.addEventListener(r.iframe.logout,this.#se),this.addEventListener(r.iframe.auth.redirect,this.#oe),this.#A=new g(this,this.#S,this.#R)}disconnectedCallback(){L.trace("disconnectedCallback: called",`_uuid: ${this._uuid}`),this.#ee(),this.#L.destroy(),this.removeEventListener(r.iframe.load,this.#te),this.removeEventListener(r.iframe.error,this.#ie),this.removeEventListener(r.iframe.logout,this.#se),this.removeEventListener(r.iframe.auth.redirect,this.#oe),this.#A?.disconnect()}connectedMoveCallback(){}}return o.level="debug",window.customElements.define("lightning-out-application",O),e.LightningOutApplication=O,e}({});
|
|
9
|
+
*/const u=new o("PropertyObserver");class g{_el;_cb;_cache;_shouldObserve;_interceptedProps;_originalDescriptors;_observer;_changesPending;_pendingChanges;_attributeExceptions=new Map([["for","htmlFor"],["class","className"],["formnovalidate","formNoValidate"],["readonly","readOnly"],["maxlength","maxLength"],["minlength","minLength"],["contenteditable","contentEditable"],["spellcheck","spellcheck"],["novalidate","noValidate"],["autofocus","autofocus"],["autocomplete","autocomplete"],["crossorigin","crossOrigin"]]);constructor(e,t,r){if(!(e instanceof Element))throw new TypeError("Target must be a DOM Element");if("function"!=typeof t)throw new TypeError("Callback must be a function");if(r&&"function"!=typeof r)throw new TypeError("shouldObserve callback must be a function");this._el=e,this._cb=t,this._cache=new Map,this._shouldObserve=r||((e,t)=>!1===t),this._interceptedProps=new Set,this._originalDescriptors=new Map,this._changesPending=!1,this._pendingChanges={},this._initialScan(),this._setupMutationObserver()}disconnect(){this._observer&&this._observer.disconnect();for(const[e,t]of this._originalDescriptors)Object.defineProperty(this._el,e,t);this._cache.clear(),this._interceptedProps.clear(),this._originalDescriptors.clear(),this._pendingChanges={},this._changesPending=!1}_initialScan(){const e={};for(const t of Array.from(this._el.attributes)){const r=t.name,i=this._isStandardAttribute(r);if(!this._shouldObserve(r,i))continue;const s=this._attributeNameToPropName(r),o=t.value;e[s]=o,this._cache.set(s,o),this._installPropertyInterceptor(s)}for(const t of Object.getOwnPropertyNames(this._el)){const r=this._isStandardProperty(t);if(this._cache.has(t)||!this._shouldObserve(t,r))continue;const i=this._el[t];e[t]=i,this._cache.set(t,i),this._installPropertyInterceptor(t)}if(Object.keys(e).length>0)try{this._cb(e)}catch(e){u.error("Error in initial PropertyObserver callback:",e)}}_setupMutationObserver(){this._observer=new MutationObserver(e=>{const t={};for(const r of e)if("attributes"===r.type&&r.attributeName){const e=r.attributeName,i=this._isStandardAttribute(e);if(!this._shouldObserve(e,i))continue;const s=this._attributeNameToPropName(e),o=this._el.getAttribute(e);o!==this._cache.get(s)&&(t[s]=o,this._cache.set(s,o),this._interceptedProps.has(s)||this._installPropertyInterceptor(s))}Object.keys(t).length>0&&this._batchChanges(t)}),this._observer.observe(this._el,{attributes:!0,attributeOldValue:!1})}_installPropertyInterceptor(e){if(this._interceptedProps.has(e))return;const t=Object.getOwnPropertyDescriptor(this._el,e)||{value:this._el[e],writable:!0,enumerable:!0,configurable:!0};this._originalDescriptors.set(e,t);const r={enumerable:t.enumerable,configurable:t.configurable,get:t.get||(()=>t.value),set:r=>{r!==this._cache.get(e)&&(t.set?t.set.call(this._el,r):t.value=r,this._cache.set(e,r),this._batchChanges({[e]:r}))}};Object.defineProperty(this._el,e,r),this._interceptedProps.add(e)}_batchChanges(e){Object.assign(this._pendingChanges,e),this._changesPending||(this._changesPending=!0,queueMicrotask(()=>{this._changesPending=!1;const e={...this._pendingChanges};this._pendingChanges={};try{this._cb(e)}catch(e){u.error("Error in PropertyObserver callback:",e)}}))}_attributeNameToPropName(e){return this._attributeExceptions.has(e)?this._attributeExceptions.get(e):e.replace(/-([a-z])/g,(e,t)=>t.toUpperCase())}_isStandardAttribute(e){if(e.startsWith("data-")||e.startsWith("aria-")||e.startsWith("on"))return!0;const t=this._attributeNameToPropName(e);return this._isStandardProperty(t)}_isStandardProperty(e){return e in HTMLElement.prototype}}const f=new class{#_=new a("LightningOutRegistry");appToComps=new WeakMap;compToApp=new WeakMap;compNameToApp=new Map;registerApplication(e){this.appToComps.has(e)||this.appToComps.set(e,new Set)}registerComponentName(e,t){if(this.compNameToApp.has(e))throw this.#_.create(`"${e}" is already registered to another App.`);this.compNameToApp.set(e,t)}registerComponent(e,t){if(this.compToApp.has(e))throw this.#_.create("This Comp is already registered to another App.");let r=t;if(!r){const t=e.localName;if(r=this.compNameToApp.get(t),!r)throw this.#_.create(`Could not find a parent App for component "${e.localName}"`)}return this.appToComps.get(r).add(e),this.compToApp.set(e,r),r}unregisterComponent(e){const t=this.compToApp.get(e);if(!t)return!1;const r=this.appToComps.get(t);return r?.delete(e),this.compToApp.delete(e),!0}getComps(e){const t=this.appToComps.get(e);if(!t)throw this.#_.create("Unable to find set of LightningOutComponents");return t}},v=new o("LightningOutComponent"),b=new Set(["autocapitalize","autocorrect","dir","enterkeyhint","inputmode","lang","spellcheck","style","title","translate"]),w=new Set(["aria-disabled","aria-hidden","aria-label","aria-live","aria-modal","aria-pressed","aria-valuemax","aria-valuemin","aria-valuenow"]),y=new Set(["accesskey","autofocus","draggable","exportparts","hidden","inert","nonce","part","slot","tabindex"]),E=new Set(["aria-activedescendant","aria-controls","aria-describedby","aria-details","aria-errormessage","aria-flowto","aria-labelledby","aria-owns"]);class _ extends HTMLElement{_uuid=t();componentReady=!1;_standardName=c(this.localName);#C;#_=new a(this);#L=new m({parentElement:this,isVisible:!0});#A;#P=!0;#O=[];#R=new WeakMap;#$=0;constructor(){super(),v.trace("constructor: called",`_uuid: ${this._uuid}`)}_getComponentURL(){const e=this.#C;if(!e)throw this.#_.create("Undefined parent App!");return e._getComponentURL(this._standardName,this._uuid)}_init(){this.componentReady||this.#L.load(this._getComponentURL().href)}#v=e=>{if(e.data.id===this._uuid)switch(v.debug("#messageListener:",`this._uuid: ${this._uuid}`,`this._standardName: ${this._standardName}`,`event.data: ${JSON.stringify(e.data)}`),e.data.type){case i.ready:for(this.componentReady=!0;this.#O.length;){const e=this.#O.shift();e&&("add"===e.type?this.addEventListener(...e.args):"remove"===e.type?this.removeEventListener(...e.args):"dispatch"===e.type&&this.dispatchEvent(e.event))}super.dispatchEvent(new CustomEvent(r.component.ready));break;case i.getComponentData:this.#A=new g(this,this.#U,this.#S);break;case i.dispatchEvent:{const t=new CustomEvent(e.data.name,{detail:e.data.detail});super.dispatchEvent(t);break}case i.error:this.#_.dispatch(r.component.error,e.data.error);break;default:v.info("#messageListener:","Unknown message received:",{"event.data":e.data})}};_propertyChanged_style=e=>{const t=this.style,r=[];for(let e=0;e<t.length;e+=1){const i=t.item(e);i.startsWith("--")&&r.push(`${i}:${t.getPropertyValue(i)}`)}return r.join(";")};#U=e=>{const t=d(this,e);v.debug("#propObserverCallback:",{changes:e,propsToSend:t}),this.#P?(this.#P=!1,this.#L.postMessage({type:i.setComponentData,componentData:{id:this._uuid,name:this._standardName,props:t}})):this.#L.postMessage({type:i.setComponentProps,componentProps:t})};#S=(e,t)=>{const r=h(e);return v.debug("#shouldObserveCallback:",{attrOrPropName:e,attrName:r,isStandard:t}),t?!(!b.has(r)&&!w.has(r))||(y.has(r)||E.has(r)||r.startsWith("on")?(v.warn(`"${r}" will not be mirrored.`),!1):!!r.startsWith("data-mirror-")||(v.warn(`"${r}" will not be mirrored.`),!1)):!r.startsWith("_")};addEventListener(e,t,s){if(e===r.component.ready&&this.componentReady){const e=new CustomEvent(r.component.ready);queueMicrotask(()=>{"function"==typeof t?t.call(this,e):t.handleEvent(e)})}if(e.startsWith("lo."))return void super.addEventListener(e,t,s);let o=this.#R.get(t);o||(o=`${e}_${this.#$++}`,this.#R.set(t,o)),this.componentReady?(super.addEventListener(...arguments),this.#L.postMessage({name:e,options:s,listenerKey:o,type:i.addEventListener})):(this.#O.push({type:"add",args:[e,t,s]}),v.debug("addEventListener:","#eventQueue pushed add args:",[e,t,s]))}dispatchEvent(e){if(e.type.startsWith("lo."))return v.debug(`dispatchEvent: dispatching event "${e.type}" to this Element only`),super.dispatchEvent(e);if(this.componentReady){v.debug(`dispatchEvent: dispatching event "${e.type}" to this Element and embedded Element inside the iframe`);const t=super.dispatchEvent(e);return this.#L.postMessage({name:e.type,detail:e.detail||{},type:i.dispatchEvent}),t}return v.debug(`dispatchEvent: component not ready, queueing event "${e.type}"`),this.#O.push({type:"dispatch",event:e}),!0}removeEventListener(e,t,r){if(e.startsWith("lo."))return void super.removeEventListener(...arguments);const s=this.#R.get(t);this.componentReady?(super.removeEventListener(...arguments),this.#L.postMessage({name:e,options:r,listenerKey:s,type:i.removeEventListener})):(this.#O.push({type:"remove",args:[e,t,r]}),v.debug("removeEventListener:","#eventQueue pushed remove args:",[e,t,r])),s&&this.#R.delete(t)}adoptedCallback(){throw this.remove(),this.#_.create("This component cannot be rerendered for security reasons.")}connectedCallback(){if(v.trace("connectedCallback: called",`_uuid: ${this._uuid}`),window.addEventListener("message",this.#v),this.hasChildNodes())throw this.#_.create("Should not have child nodes");this.style.display||="block",this.style.width||="100%",this.style.height||="100%",this.#C=f.registerComponent(this),this._standardName=this.#C._getComponentStandardName(this),this.#C.applicationReady&&this._init()}disconnectedCallback(){v.trace("disconnectedCallback: called",`_uuid: ${this._uuid}`),this.#L.destroy(),window.removeEventListener("message",this.#v),f.unregisterComponent(this),this.#A?.disconnect()}connectedMoveCallback(){}}class C{config;errorHandler;constructor(e,t){if(this.config=e,this.errorHandler=t,!this.config.origin)throw this.errorHandler('Missing "frontdoor-url" or "org-url" attribute')}getComponentURL(e,t){let r;if(void 0===this.config.sitePrefix){let t=e.includes("/")?this.config.lwrAppComp:e.includes(":")?this.config.lwrAppAura:void 0;if(void 0===t)throw this.errorHandler(`Invalid componentName: ${e}`);t=t.replace("/","%2F");const i=this.config.lang?`l/${this.config.lang}/`:"";r=new URL(`lwr/application/amd/0/${i}ai/${t}`,this.config.origin)}else r=new URL(`${this.config.sitePrefix}/lightning-out`,this.config.origin);return r.searchParams.set("componentName",e),this.#N(r,t)}getAuthURL(e){let t;if(void 0===this.config.sitePrefix){const e=this.config.lwrAppAuth.replace("/","%2F");t=new URL(`lwr/application/amd/0/ai/${e}`,this.config.origin)}else t=new URL(this.config.lwrPageAuth,this.config.origin);return this.#N(t,e)}getPageURL(e,t){const r=new URL(e,this.config.origin);return this.#N(r,t)}#N(e,t){return e.searchParams.set("parentElementId",t),e.searchParams.set("loAppOrigin",this.config.loAppOrigin),e.searchParams.set("loVersion","2.2.1-rc.7"),this.config.appId&&e.searchParams.set("appId",this.config.appId),this.config.testMode&&e.searchParams.set("testMode","true"),this.config.designSystem&&e.searchParams.set("designSystem",this.config.designSystem),this.config.globalStyle&&e.searchParams.set("globalStyle",this.config.globalStyle),e}}const L=new o("LightningOutApplication"),A=new Set(["slds1","slds2","none"]),P=new Set(["frontdoorUrl","orgUrl"]);class O extends HTMLElement{_uuid=t();applicationReady=!1;#_=new a(this);#L=new m({parentElement:this,isVisible:!1});#k;#A;#T="";#I="lightningout/auth";#M="lightningout/container";#x="lightningout/auraContainer";#D="lightning/lightning.out.auth.html";#F="lightning/lightning.out.logout.html";#j="lightning/lightning.out.auth.error.html";#W="/secur/logout.jsp";lwrApplication;orgUrl;#V;frontdoorUrl;#H;appId;#K;components;#Q=new Map;sitePrefix;#z;designSystem;#Z;globalStyle;#q;#J=document.documentElement.lang??"";constructor(){super(),L.trace("constructor: called",`_uuid: ${this._uuid}`),f.registerApplication(this)}addEventListener(e,t,i){if(e===r.application.ready&&this.applicationReady){const e=new CustomEvent(r.application.ready);queueMicrotask(()=>{"function"==typeof t?t.call(this,e):t.handleEvent(e)})}super.addEventListener(e,t,i)}#G(e){try{this.#V=new URL(e)}catch{throw this.#_.create(`Invalid org-url: ${e}`)}this.dispatchEvent(new CustomEvent(r.iframe.load,{detail:this.#V.origin}))}#X(e){try{this.#H=new URL(e),this.#T=this.#H.origin;const t=this.#B(),r=this.#H.searchParams.has("otp")?"startURL":"retURL";this.#H.searchParams.set(r,t.pathname+t.search);const i=this.#Y(this.#j);this.#H.searchParams.set("error-redirect-uri",i.pathname+i.search)}catch{throw this.#_.create(`Invalid frontdoor-url: ${e}`)}this.#L.load(this.#H.href)}#ee(){const e=new URL(this.#W,this.#T),t=this.#Y(this.#F);e.searchParams.set("redirect-uri",t.pathname+t.search),this.#L.load(e.href)}getRouter(){if(void 0===this.#k){const e={origin:this.#T,lwrPageAuth:this.#D,lwrAppAuth:this.#I,lwrAppComp:this.#M,lwrAppAura:this.#x,sitePrefix:this.#z,lang:this.#J,appId:this.#K,testMode:this.__testMode||!1,loAppOrigin:window.location.origin,designSystem:this.#Z,globalStyle:this.#q};this.#k=new C(e,e=>this.#_.create(e))}return this.#k}_getComponentURL(e,t){return this.getRouter().getComponentURL(e,t)}#B(){return this.getRouter().getAuthURL(this._uuid)}#Y(e){return this.getRouter().getPageURL(e,this._uuid)}#te=e=>{this.applicationReady=!0;const t=e.detail;this.#T="string"==typeof t?t:t.lightningDomain||t.origin,this.#k=void 0,this.#re(),this.dispatchEvent(new CustomEvent(r.application.ready))};#ie=e=>{this.#_.dispatch(r.application.error,e)};#se=e=>{this.dispatchEvent(new CustomEvent(r.application.logout))};#oe=e=>{this.dispatchEvent(new CustomEvent(r.application.auth.redirect,{detail:e.detail}))};#re(){f.getComps(this).forEach(e=>{e._init()})}#U=e=>{const t={},r={};Object.keys(e).forEach(i=>{P.has(i)?r[i]=e[i]:t[i]=e[i]}),d(this,t),d(this,r)};#S=(e,t)=>t?"lang"===e:!e.startsWith("_");_propertyChanged_lwrApplication=e=>{if(void 0!==e){const t=e.split("/");if(2!==t.length||!t[0]||!t[1])throw this.#_.create(`"${e}" is not a valid lwr-application name, must be of the form 'namespace/name'`);this.#M=e}};_propertyChanged_lang=e=>{this.#J=e??""};_propertyChanged_orgUrl=e=>{if(void 0!==e){if(void 0!==this.#H)throw this.#_.create('Can\'t set "org-url" because "frontdoor-url" is already set');""===e?this.#ee():this.#G(e)}};_propertyChanged_frontdoorUrl=e=>{if(void 0!==e){if(void 0!==this.#V)throw this.#_.create('Can\'t set "frontdoor-url" because "org-url" is already set');""===e?this.#ee():this.#X(e)}};_propertyChanged_sitePrefix=e=>{void 0!==e&&(this.#z=e)};_propertyChanged_appId=e=>{void 0!==e&&(this.#K=e)};_propertyChanged_globalStyle=e=>{if(void 0!==e){const t=e.split(";").map(e=>e.trim()).filter(e=>e.length>0),r=[];for(const e of t){const[t,...i]=e.split(":"),s=t.trim();if(!s.startsWith("--"))throw this.#_.create(`Invalid global-style: "${s}" is not a CSS custom property. Only CSS custom properties (starting with --) are allowed.`);const o=i.join(":").trim();o&&r.push(`${s}:${o}`)}this.#q=r.join(";")+";"}};_propertyChanged_components=e=>{void 0!==e&&e.split(",").forEach(e=>{const[t,r]=e.split(" as ").map(e=>e.trim()),i=function(e){return e.includes("/")||e.includes(":")}(t);if(i&&t.includes(":"))throw this.#_.create(`"${t}" is not supported in components. Use kebab "namespace-name" in components and the "aura" attribute on the component element instead.`);const s=i?t:c(t),o=r||(i?function(e){const t=e.includes("/")?"/":":",r=e.indexOf(t);if(-1===r)throw l.create(`standardNameToElementName: "${e}" is not a valid component name - missing namespace separator.`);if(/-/.test(e))throw l.create(`standardNameToElementName: "${e}" is not a valid component name - must not contain hyphens.`);if(/^[A-Z]/.test(e))throw l.create(`standardNameToElementName: "${e}" is not a valid component name - first character must not be uppercase.`);const i=e.slice(0,r),s=e.slice(r+1);return`${i.replace(/([A-Z_])/g,"_$1").toLowerCase()}-${h(s)}`}(s):t);if(o&&!this.#Q.has(o)){this.#Q.set(o,s);try{f.registerComponentName(o,this),customElements.define(o,class extends _{})}catch(e){throw this.#_.create(`"${o}" is already registered. ${e}`)}}})};_propertyChanged_designSystem=e=>{if(void 0!==e&&!A.has(e))throw this.#_.create(`Invalid design-system: ${e}`);this.#Z=e};_getComponentStandardName(e){const t=e.localName,r=e.hasAttribute("aura"),i=this.#Q.get(t);if(!i)throw this.#_.create(`"${t}" is not registered.`);return r&&i.includes("/")?i.replace("/",":"):i}get _compNames(){}connectedCallback(){if(L.trace("connectedCallback: called",`_uuid: ${this._uuid}`),this.hasChildNodes())throw this.#_.create("Should not have child nodes");this.style.display||="none",this.addEventListener(r.iframe.load,this.#te),this.addEventListener(r.iframe.error,this.#ie),this.addEventListener(r.iframe.logout,this.#se),this.addEventListener(r.iframe.auth.redirect,this.#oe),this.#A=new g(this,this.#U,this.#S)}disconnectedCallback(){L.trace("disconnectedCallback: called",`_uuid: ${this._uuid}`),this.#ee(),this.#L.destroy(),this.removeEventListener(r.iframe.load,this.#te),this.removeEventListener(r.iframe.error,this.#ie),this.removeEventListener(r.iframe.logout,this.#se),this.removeEventListener(r.iframe.auth.redirect,this.#oe),this.#A?.disconnect()}connectedMoveCallback(){}}return o.level="debug",window.customElements.define("lightning-out-application",O),e.LightningOutApplication=O,e}({});
|
|
10
10
|
//# sourceMappingURL=index.iife.prod.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/lightning-out",
|
|
3
|
-
"version": "2.2.1-rc.
|
|
3
|
+
"version": "2.2.1-rc.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Lightning Out 2.0 for Salesforce",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -22,11 +22,13 @@
|
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"core": "2.2.1-rc.
|
|
26
|
-
"utils": "2.2.1-rc.
|
|
25
|
+
"core": "2.2.1-rc.7",
|
|
26
|
+
"utils": "2.2.1-rc.7"
|
|
27
27
|
},
|
|
28
28
|
"files": [
|
|
29
29
|
"dist/",
|
|
30
|
+
"!dist/__tests__/",
|
|
31
|
+
"!dist/__mocks__/",
|
|
30
32
|
"!dist/*.test.js",
|
|
31
33
|
"!dist/*.map",
|
|
32
34
|
"README.md",
|