@lwrjs/client-modules 0.13.2 → 0.13.4
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.
|
@@ -57,7 +57,7 @@ async function waitForSuccessfulPing(socketUrl) {
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export function initHMR(serverURI = '', metadata) {
|
|
60
|
+
export function initHMR(serverURI = '', metadata, hmrPolling = true) {
|
|
61
61
|
const normalizedMeta = { ...{ assetReferences: [], templates: [] }, ...metadata };
|
|
62
62
|
// {apiVersion}/hmr/{format}/{compat}?debug
|
|
63
63
|
const host = serverURI.startsWith('/') ? location.host : '';
|
|
@@ -70,10 +70,12 @@ export function initHMR(serverURI = '', metadata) {
|
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
if (hmrPolling) {
|
|
74
|
+
// Otherwise wait until the server comes back online and reload the page.
|
|
75
|
+
console.log('Lost connection with server, start polling...');
|
|
76
|
+
await waitForSuccessfulPing(socketUrl);
|
|
77
|
+
location.reload();
|
|
78
|
+
}
|
|
77
79
|
});
|
|
78
80
|
|
|
79
81
|
socket.addEventListener('message', async ({ data }) => {
|
|
@@ -1489,7 +1489,7 @@ const {
|
|
|
1489
1489
|
} = PromiseCtor$LWS.prototype;
|
|
1490
1490
|
const PromiseResolve$LWS = PromiseCtor$LWS.resolve.bind(PromiseCtor$LWS);
|
|
1491
1491
|
const PromiseReject$LWS = PromiseCtor$LWS.reject.bind(PromiseCtor$LWS);
|
|
1492
|
-
/*! version: 0.22.
|
|
1492
|
+
/*! version: 0.22.5 */
|
|
1493
1493
|
|
|
1494
1494
|
/*!
|
|
1495
1495
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -2203,7 +2203,7 @@ const {
|
|
|
2203
2203
|
const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'responseText');
|
|
2204
2204
|
const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'status');
|
|
2205
2205
|
ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
|
|
2206
|
-
/*! version: 0.22.
|
|
2206
|
+
/*! version: 0.22.5 */
|
|
2207
2207
|
|
|
2208
2208
|
/*!
|
|
2209
2209
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -2262,7 +2262,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
|
|
|
2262
2262
|
function sanitizeURLString$LWS(urlString$LWS) {
|
|
2263
2263
|
return urlString$LWS === '' ? urlString$LWS : ReflectApply$LWS$1(StringProtoReplace$LWS, urlString$LWS, [newlinesAndTabsRegExp$LWS, '']);
|
|
2264
2264
|
}
|
|
2265
|
-
/*! version: 0.22.
|
|
2265
|
+
/*! version: 0.22.5 */
|
|
2266
2266
|
|
|
2267
2267
|
/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */
|
|
2268
2268
|
|
|
@@ -3948,7 +3948,7 @@ try {
|
|
|
3948
3948
|
// swallow
|
|
3949
3949
|
}
|
|
3950
3950
|
const trusted = createPolicy('trusted', policyOptions);
|
|
3951
|
-
/*! version: 0.22.
|
|
3951
|
+
/*! version: 0.22.5 */
|
|
3952
3952
|
|
|
3953
3953
|
/*!
|
|
3954
3954
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -4209,7 +4209,7 @@ function blobSanitizer$LWS(sandboxKey$LWS) {
|
|
|
4209
4209
|
}
|
|
4210
4210
|
return getSanitizerForConfig$LWS(sandboxKey$LWS, 'STRING_BLOB_HTML');
|
|
4211
4211
|
}
|
|
4212
|
-
/*! version: 0.22.
|
|
4212
|
+
/*! version: 0.22.5 */
|
|
4213
4213
|
|
|
4214
4214
|
/*!
|
|
4215
4215
|
* Copyright (C) 2023 salesforce.com, inc.
|
|
@@ -4407,7 +4407,7 @@ function encloseSrcSetter$LWS(targetElement$LWS) {
|
|
|
4407
4407
|
ReflectApply$LWS$1(ElementProtoSetAttributeNS$LWS, targetElement$LWS, [attributeNamespaceURI$LWS, attributeName$LWS, src$LWS]);
|
|
4408
4408
|
};
|
|
4409
4409
|
}
|
|
4410
|
-
/*! version: 0.22.
|
|
4410
|
+
/*! version: 0.22.5 */
|
|
4411
4411
|
|
|
4412
4412
|
/*!
|
|
4413
4413
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -6107,8 +6107,8 @@ function initDistortionDocumentOpen$LWS({
|
|
|
6107
6107
|
const {
|
|
6108
6108
|
length: length$LWS
|
|
6109
6109
|
} = args$LWS;
|
|
6110
|
-
// @ts-ignore: document.open() can be called
|
|
6111
|
-
if (this === rootDocument$LWS && length$LWS
|
|
6110
|
+
// @ts-ignore: document.open() can be called zero, one or two arguments which will open the current top-level document
|
|
6111
|
+
if (this === rootDocument$LWS && length$LWS < 3) {
|
|
6112
6112
|
throw new LockerSecurityError$LWS(`Cannot open top level document.`);
|
|
6113
6113
|
}
|
|
6114
6114
|
// istanbul ignore else: needs default platform behavior test
|
|
@@ -6610,7 +6610,7 @@ function initDistortionElementOuterHTMLSetter$LWS({
|
|
|
6610
6610
|
setCustomElementsRegistry$LWS(document$LWS, key$LWS);
|
|
6611
6611
|
const html$LWS = lwsInternalPolicy$LWS.createHTML(value$LWS, key$LWS, ContentType$LWS.HTML);
|
|
6612
6612
|
if (isInherentlyUnsecure$1$LWS(html$LWS)) {
|
|
6613
|
-
throw new LockerSecurityError$LWS(`Cannot set outerHTML using an unsecure ${toSafeTemplateStringValue$LWS(html$LWS)}.`);
|
|
6613
|
+
throw new LockerSecurityError$LWS(`Cannot set 'outerHTML' using an unsecure ${toSafeTemplateStringValue$LWS(html$LWS)}.`);
|
|
6614
6614
|
}
|
|
6615
6615
|
ReflectApply$LWS$1(originalOuterHTMLSetter$LWS, this, [html$LWS]);
|
|
6616
6616
|
}];
|
|
@@ -10108,7 +10108,7 @@ const SVGElementBlockedProperties$LWS = ['nonce'];
|
|
|
10108
10108
|
const UIEventBlockedProperties$LWS = ['rangeParent'];
|
|
10109
10109
|
const WindowBlockedProperties$LWS = ['find', 'requestFileSystem', 'webkitRequestFileSystem'];
|
|
10110
10110
|
const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
|
|
10111
|
-
/*! version: 0.22.
|
|
10111
|
+
/*! version: 0.22.5 */
|
|
10112
10112
|
|
|
10113
10113
|
/*!
|
|
10114
10114
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -10430,43 +10430,21 @@ function proxyMaskFunctionDistortion$LWS({
|
|
|
10430
10430
|
instrumentation: instrumentation$LWS,
|
|
10431
10431
|
key: sandboxKey$LWS
|
|
10432
10432
|
}, distortionFactory$LWS, distortionFunc$LWS, maskFunc$LWS) {
|
|
10433
|
-
let activityName$LWS;
|
|
10434
|
-
// istanbul ignore if: this is a safety precaution that is unreachable via tests
|
|
10435
|
-
if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
|
|
10436
|
-
const {
|
|
10437
|
-
name: factoryName$LWS
|
|
10438
|
-
} = distortionFactory$LWS;
|
|
10439
|
-
activityName$LWS = factoryName$LWS ? ReflectApply$LWS$1(StringProtoReplace$LWS, factoryName$LWS, [LOCKER_IDENTIFIER_MARKER$LWS, '']) : '<unknown>';
|
|
10440
|
-
}
|
|
10441
10433
|
return maskFunction$LWS(distortionFunc$LWS, maskFunc$LWS, {
|
|
10442
10434
|
apply: function (target$LWS, thisArg$LWS, args$LWS) {
|
|
10443
|
-
const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
|
|
10444
10435
|
try {
|
|
10445
10436
|
return ReflectApply$LWS$1(target$LWS, thisArg$LWS, args$LWS);
|
|
10446
10437
|
} catch (error) {
|
|
10447
|
-
activity$LWS == null || activity$LWS.error({
|
|
10448
|
-
sandboxKey: sandboxKey$LWS,
|
|
10449
|
-
error
|
|
10450
|
-
});
|
|
10451
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10452
10438
|
throw error;
|
|
10453
10439
|
} finally {
|
|
10454
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10455
10440
|
}
|
|
10456
10441
|
},
|
|
10457
10442
|
construct: function (target$LWS, args$LWS, newTarget$LWS) {
|
|
10458
|
-
const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
|
|
10459
10443
|
try {
|
|
10460
10444
|
return ReflectConstruct$LWS(target$LWS, args$LWS, newTarget$LWS);
|
|
10461
10445
|
} catch (error) {
|
|
10462
|
-
activity$LWS == null || activity$LWS.error({
|
|
10463
|
-
sandboxKey: sandboxKey$LWS,
|
|
10464
|
-
error
|
|
10465
|
-
});
|
|
10466
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10467
10446
|
throw error;
|
|
10468
10447
|
} finally {
|
|
10469
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10470
10448
|
}
|
|
10471
10449
|
}
|
|
10472
10450
|
});
|
|
@@ -15413,8 +15391,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15413
15391
|
// DOM per url per sandbox.
|
|
15414
15392
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
15415
15393
|
function loadScript$LWS(_thisArg$LWS, url$LWS) {
|
|
15416
|
-
const
|
|
15417
|
-
const resolvedURL$LWS = resolveURL$LWS(urlAsString$LWS);
|
|
15394
|
+
const urlResolved$LWS = resolveURL$LWS(toString$LWS(url$LWS));
|
|
15418
15395
|
const scripts$LWS = ReflectApply$LWS$1(ElementProtoQuerySelectorAll$LWS, head$LWS, ['script']);
|
|
15419
15396
|
for (let i$LWS = 0, {
|
|
15420
15397
|
length: length$LWS
|
|
@@ -15426,13 +15403,13 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15426
15403
|
// false positive if more than one sandbox had loaded this resource.
|
|
15427
15404
|
const status$LWS = (_resourceStatusCache$$LWS = resourceStatusCache$LWS.get(script$LWS)) != null ? _resourceStatusCache$$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15428
15405
|
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
15429
|
-
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) ===
|
|
15406
|
+
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) === urlResolved$LWS) {
|
|
15430
15407
|
if (status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15431
15408
|
return PromiseResolve$LWS(undefined);
|
|
15432
15409
|
}
|
|
15433
15410
|
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15434
15411
|
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15435
|
-
return PromiseReject$LWS(createResourceLoadError$LWS(
|
|
15412
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlResolved$LWS));
|
|
15436
15413
|
}
|
|
15437
15414
|
if (status$LWS === 2 /* ResourceLoaderStatus.Loading */) {
|
|
15438
15415
|
return resourcePromiseCache$LWS.get(script$LWS);
|
|
@@ -15446,16 +15423,16 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15446
15423
|
// has been created by it or not. See W-13034908.
|
|
15447
15424
|
// eslint-disable-next-line no-underscore-dangle
|
|
15448
15425
|
script$LWS._ltngRequireCreated = true;
|
|
15449
|
-
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [
|
|
15450
|
-
return loadPromise$LWS(script$LWS,
|
|
15426
|
+
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [urlResolved$LWS]);
|
|
15427
|
+
return loadPromise$LWS(script$LWS, urlResolved$LWS);
|
|
15451
15428
|
},
|
|
15452
15429
|
// Functionality based on platformResourceLoader#loadStyle (http://sfdc.co/bIpMYB) but
|
|
15453
15430
|
// adjusted for multiple sandboxes. This loadStyle will create one <link> element in the DOM
|
|
15454
15431
|
// per url for all the sandboxes.
|
|
15455
15432
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
15456
15433
|
function loadStyle$LWS(_thisArg$LWS, url$LWS) {
|
|
15457
|
-
const
|
|
15458
|
-
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(
|
|
15434
|
+
const urlResolved$LWS = resolveURL$LWS(toString$LWS(url$LWS));
|
|
15435
|
+
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(urlResolved$LWS)}]`]);
|
|
15459
15436
|
if (link$LWS) {
|
|
15460
15437
|
var _resourceStatusCache$2$LWS;
|
|
15461
15438
|
const status$LWS = (_resourceStatusCache$2$LWS = resourceStatusCache$LWS.get(link$LWS)) != null ? _resourceStatusCache$2$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
@@ -15464,7 +15441,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15464
15441
|
}
|
|
15465
15442
|
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15466
15443
|
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15467
|
-
return PromiseReject$LWS(createResourceLoadError$LWS(
|
|
15444
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlResolved$LWS));
|
|
15468
15445
|
}
|
|
15469
15446
|
const promise$LWS = status$LWS === 2 /* ResourceLoaderStatus.Loading */ ? resourcePromiseCache$LWS.get(link$LWS) : undefined;
|
|
15470
15447
|
return promise$LWS != null ? promise$LWS : PromiseResolve$LWS(undefined);
|
|
@@ -15472,8 +15449,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15472
15449
|
link$LWS = ReflectApply$LWS$1(DocumentProtoCreateElement$LWS$1, document$LWS, ['link']);
|
|
15473
15450
|
link$LWS.type = 'text/css';
|
|
15474
15451
|
link$LWS.rel = 'stylesheet';
|
|
15475
|
-
link$LWS.href =
|
|
15476
|
-
return loadPromise$LWS(link$LWS,
|
|
15452
|
+
link$LWS.href = urlResolved$LWS;
|
|
15453
|
+
return loadPromise$LWS(link$LWS, urlResolved$LWS);
|
|
15477
15454
|
}];
|
|
15478
15455
|
}
|
|
15479
15456
|
function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
@@ -15486,7 +15463,7 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
|
15486
15463
|
// tools from mistaking the regexp or the replacement string for an
|
|
15487
15464
|
// actual source mapping URL.
|
|
15488
15465
|
/\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
|
|
15489
|
-
sourceText$LWS = `\n//# LWS Version = "0.22.
|
|
15466
|
+
sourceText$LWS = `\n//# LWS Version = "0.22.5"\n${sourceText$LWS}`;
|
|
15490
15467
|
return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
|
|
15491
15468
|
// Append "'use strict'" to the extracted function body so it is
|
|
15492
15469
|
// evaluated in strict mode.
|
|
@@ -16138,14 +16115,15 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
16138
16115
|
return secureDep$LWS;
|
|
16139
16116
|
}
|
|
16140
16117
|
secureDep$LWS = {
|
|
16141
|
-
loadScript: (
|
|
16118
|
+
loadScript: (cmp$LWS, url$LWS, config$LWS) => {
|
|
16119
|
+
const urlResolved$LWS = resolveURL$LWS(url$LWS);
|
|
16142
16120
|
const sandbox$LWS = createRootWindowSandboxRecord$LWS({
|
|
16143
16121
|
key: key$LWS
|
|
16144
16122
|
});
|
|
16145
16123
|
if (isGaterEnabledFeature$LWS('enableTrustedMode') && config$LWS != null && config$LWS.trustedMode) {
|
|
16146
16124
|
const trustedGlobals$LWS = config$LWS.trustedGlobals;
|
|
16147
16125
|
if ((trustedGlobals$LWS == null ? void 0 : trustedGlobals$LWS.length) > 0) {
|
|
16148
|
-
return dep$LWS.loadScript(
|
|
16126
|
+
return dep$LWS.loadScript(cmp$LWS, urlResolved$LWS).then(() => {
|
|
16149
16127
|
const installGlobals$LWS = sandbox$LWS.virtualEnvironmentEvaluator(`(list) => list.forEach(([key, get, set]) => Object.defineProperty(window, key, { get, set, configurable: true, enumerable: true }));`);
|
|
16150
16128
|
const globals$LWS = trustedGlobals$LWS.map(globalName$LWS => [globalName$LWS, function get$LWS() {
|
|
16151
16129
|
return window[globalName$LWS];
|
|
@@ -16155,18 +16133,21 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
16155
16133
|
installGlobals$LWS(globals$LWS);
|
|
16156
16134
|
});
|
|
16157
16135
|
}
|
|
16158
|
-
return dep$LWS.loadScript(
|
|
16136
|
+
return dep$LWS.loadScript(cmp$LWS, urlResolved$LWS);
|
|
16159
16137
|
}
|
|
16160
|
-
return sandbox$LWS.helpers.loadScript(
|
|
16138
|
+
return sandbox$LWS.helpers.loadScript(cmp$LWS, urlResolved$LWS);
|
|
16161
16139
|
},
|
|
16162
|
-
loadStyle: (
|
|
16163
|
-
|
|
16164
|
-
|
|
16140
|
+
loadStyle: (cmp$LWS, url$LWS) => {
|
|
16141
|
+
const urlResolved$LWS = resolveURL$LWS(url$LWS);
|
|
16142
|
+
return createRootWindowSandboxRecord$LWS({
|
|
16143
|
+
key: key$LWS
|
|
16144
|
+
}).helpers.loadStyle(cmp$LWS, urlResolved$LWS);
|
|
16145
|
+
}
|
|
16165
16146
|
};
|
|
16166
16147
|
depRegistry$LWS.set(dep$LWS, secureDep$LWS);
|
|
16167
16148
|
return secureDep$LWS;
|
|
16168
16149
|
}
|
|
16169
|
-
/*! version: 0.22.
|
|
16150
|
+
/*! version: 0.22.5 */
|
|
16170
16151
|
|
|
16171
16152
|
const loaderDefine = globalThis.LWR.define;
|
|
16172
16153
|
|
|
@@ -1489,7 +1489,7 @@ const {
|
|
|
1489
1489
|
} = PromiseCtor$LWS.prototype;
|
|
1490
1490
|
const PromiseResolve$LWS = PromiseCtor$LWS.resolve.bind(PromiseCtor$LWS);
|
|
1491
1491
|
const PromiseReject$LWS = PromiseCtor$LWS.reject.bind(PromiseCtor$LWS);
|
|
1492
|
-
/*! version: 0.22.
|
|
1492
|
+
/*! version: 0.22.5 */
|
|
1493
1493
|
|
|
1494
1494
|
/*!
|
|
1495
1495
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -2203,7 +2203,7 @@ const {
|
|
|
2203
2203
|
const XhrProtoResponseTextGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'responseText');
|
|
2204
2204
|
const XhrProtoStatusGetter$LWS = ObjectLookupOwnGetter$LWS$1(XhrProto$LWS, 'status');
|
|
2205
2205
|
ObjectLookupOwnSetter$LWS(XhrProto$LWS, 'withCredentials');
|
|
2206
|
-
/*! version: 0.22.
|
|
2206
|
+
/*! version: 0.22.5 */
|
|
2207
2207
|
|
|
2208
2208
|
/*!
|
|
2209
2209
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -2262,7 +2262,7 @@ function sanitizeURLForElement$LWS(url$LWS) {
|
|
|
2262
2262
|
function sanitizeURLString$LWS(urlString$LWS) {
|
|
2263
2263
|
return urlString$LWS === '' ? urlString$LWS : ReflectApply$LWS$1(StringProtoReplace$LWS, urlString$LWS, [newlinesAndTabsRegExp$LWS, '']);
|
|
2264
2264
|
}
|
|
2265
|
-
/*! version: 0.22.
|
|
2265
|
+
/*! version: 0.22.5 */
|
|
2266
2266
|
|
|
2267
2267
|
/*! @license DOMPurify 3.0.5 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.0.5/LICENSE */
|
|
2268
2268
|
|
|
@@ -3948,7 +3948,7 @@ try {
|
|
|
3948
3948
|
// swallow
|
|
3949
3949
|
}
|
|
3950
3950
|
const trusted = createPolicy('trusted', policyOptions);
|
|
3951
|
-
/*! version: 0.22.
|
|
3951
|
+
/*! version: 0.22.5 */
|
|
3952
3952
|
|
|
3953
3953
|
/*!
|
|
3954
3954
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -4209,7 +4209,7 @@ function blobSanitizer$LWS(sandboxKey$LWS) {
|
|
|
4209
4209
|
}
|
|
4210
4210
|
return getSanitizerForConfig$LWS(sandboxKey$LWS, 'STRING_BLOB_HTML');
|
|
4211
4211
|
}
|
|
4212
|
-
/*! version: 0.22.
|
|
4212
|
+
/*! version: 0.22.5 */
|
|
4213
4213
|
|
|
4214
4214
|
/*!
|
|
4215
4215
|
* Copyright (C) 2023 salesforce.com, inc.
|
|
@@ -4407,7 +4407,7 @@ function encloseSrcSetter$LWS(targetElement$LWS) {
|
|
|
4407
4407
|
ReflectApply$LWS$1(ElementProtoSetAttributeNS$LWS, targetElement$LWS, [attributeNamespaceURI$LWS, attributeName$LWS, src$LWS]);
|
|
4408
4408
|
};
|
|
4409
4409
|
}
|
|
4410
|
-
/*! version: 0.22.
|
|
4410
|
+
/*! version: 0.22.5 */
|
|
4411
4411
|
|
|
4412
4412
|
/*!
|
|
4413
4413
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -6107,8 +6107,8 @@ function initDistortionDocumentOpen$LWS({
|
|
|
6107
6107
|
const {
|
|
6108
6108
|
length: length$LWS
|
|
6109
6109
|
} = args$LWS;
|
|
6110
|
-
// @ts-ignore: document.open() can be called
|
|
6111
|
-
if (this === rootDocument$LWS && length$LWS
|
|
6110
|
+
// @ts-ignore: document.open() can be called zero, one or two arguments which will open the current top-level document
|
|
6111
|
+
if (this === rootDocument$LWS && length$LWS < 3) {
|
|
6112
6112
|
throw new LockerSecurityError$LWS(`Cannot open top level document.`);
|
|
6113
6113
|
}
|
|
6114
6114
|
// istanbul ignore else: needs default platform behavior test
|
|
@@ -6610,7 +6610,7 @@ function initDistortionElementOuterHTMLSetter$LWS({
|
|
|
6610
6610
|
setCustomElementsRegistry$LWS(document$LWS, key$LWS);
|
|
6611
6611
|
const html$LWS = lwsInternalPolicy$LWS.createHTML(value$LWS, key$LWS, ContentType$LWS.HTML);
|
|
6612
6612
|
if (isInherentlyUnsecure$1$LWS(html$LWS)) {
|
|
6613
|
-
throw new LockerSecurityError$LWS(`Cannot set outerHTML using an unsecure ${toSafeTemplateStringValue$LWS(html$LWS)}.`);
|
|
6613
|
+
throw new LockerSecurityError$LWS(`Cannot set 'outerHTML' using an unsecure ${toSafeTemplateStringValue$LWS(html$LWS)}.`);
|
|
6614
6614
|
}
|
|
6615
6615
|
ReflectApply$LWS$1(originalOuterHTMLSetter$LWS, this, [html$LWS]);
|
|
6616
6616
|
}];
|
|
@@ -10108,7 +10108,7 @@ const SVGElementBlockedProperties$LWS = ['nonce'];
|
|
|
10108
10108
|
const UIEventBlockedProperties$LWS = ['rangeParent'];
|
|
10109
10109
|
const WindowBlockedProperties$LWS = ['find', 'requestFileSystem', 'webkitRequestFileSystem'];
|
|
10110
10110
|
const XSLTProcessorBlockedProperties$LWS = ['transformToDocument', 'transformToFragment'];
|
|
10111
|
-
/*! version: 0.22.
|
|
10111
|
+
/*! version: 0.22.5 */
|
|
10112
10112
|
|
|
10113
10113
|
/*!
|
|
10114
10114
|
* Copyright (C) 2019 salesforce.com, inc.
|
|
@@ -10432,43 +10432,21 @@ function proxyMaskFunctionDistortion$LWS({
|
|
|
10432
10432
|
instrumentation: instrumentation$LWS,
|
|
10433
10433
|
key: sandboxKey$LWS
|
|
10434
10434
|
}, distortionFactory$LWS, distortionFunc$LWS, maskFunc$LWS) {
|
|
10435
|
-
let activityName$LWS;
|
|
10436
|
-
// istanbul ignore if: this is a safety precaution that is unreachable via tests
|
|
10437
|
-
if (LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS) {
|
|
10438
|
-
const {
|
|
10439
|
-
name: factoryName$LWS
|
|
10440
|
-
} = distortionFactory$LWS;
|
|
10441
|
-
activityName$LWS = factoryName$LWS ? ReflectApply$LWS$1(StringProtoReplace$LWS, factoryName$LWS, [LOCKER_IDENTIFIER_MARKER$LWS, '']) : '<unknown>';
|
|
10442
|
-
}
|
|
10443
10435
|
return maskFunction$LWS(distortionFunc$LWS, maskFunc$LWS, {
|
|
10444
10436
|
apply: function (target$LWS, thisArg$LWS, args$LWS) {
|
|
10445
|
-
const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
|
|
10446
10437
|
try {
|
|
10447
10438
|
return ReflectApply$LWS$1(target$LWS, thisArg$LWS, args$LWS);
|
|
10448
10439
|
} catch (error) {
|
|
10449
|
-
activity$LWS == null || activity$LWS.error({
|
|
10450
|
-
sandboxKey: sandboxKey$LWS,
|
|
10451
|
-
error
|
|
10452
|
-
});
|
|
10453
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10454
10440
|
throw error;
|
|
10455
10441
|
} finally {
|
|
10456
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10457
10442
|
}
|
|
10458
10443
|
},
|
|
10459
10444
|
construct: function (target$LWS, args$LWS, newTarget$LWS) {
|
|
10460
|
-
const activity$LWS = LOCKER_VERBOSE_INSTRUMENTATION_FLAG$LWS ? instrumentation$LWS == null || instrumentation$LWS.startActivity == null ? void 0 : instrumentation$LWS.startActivity(activityName$LWS) : undefined;
|
|
10461
10445
|
try {
|
|
10462
10446
|
return ReflectConstruct$LWS(target$LWS, args$LWS, newTarget$LWS);
|
|
10463
10447
|
} catch (error) {
|
|
10464
|
-
activity$LWS == null || activity$LWS.error({
|
|
10465
|
-
sandboxKey: sandboxKey$LWS,
|
|
10466
|
-
error
|
|
10467
|
-
});
|
|
10468
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10469
10448
|
throw error;
|
|
10470
10449
|
} finally {
|
|
10471
|
-
activity$LWS == null || activity$LWS.stop();
|
|
10472
10450
|
}
|
|
10473
10451
|
}
|
|
10474
10452
|
});
|
|
@@ -15415,8 +15393,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15415
15393
|
// DOM per url per sandbox.
|
|
15416
15394
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
15417
15395
|
function loadScript$LWS(_thisArg$LWS, url$LWS) {
|
|
15418
|
-
const
|
|
15419
|
-
const resolvedURL$LWS = resolveURL$LWS(urlAsString$LWS);
|
|
15396
|
+
const urlResolved$LWS = resolveURL$LWS(toString$LWS(url$LWS));
|
|
15420
15397
|
const scripts$LWS = ReflectApply$LWS$1(ElementProtoQuerySelectorAll$LWS, head$LWS, ['script']);
|
|
15421
15398
|
for (let i$LWS = 0, {
|
|
15422
15399
|
length: length$LWS
|
|
@@ -15428,13 +15405,13 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15428
15405
|
// false positive if more than one sandbox had loaded this resource.
|
|
15429
15406
|
const status$LWS = (_resourceStatusCache$$LWS = resourceStatusCache$LWS.get(script$LWS)) != null ? _resourceStatusCache$$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
15430
15407
|
// istanbul ignore else: current tests have no way of expressing a state that would cause this condition to evaluate false
|
|
15431
|
-
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) ===
|
|
15408
|
+
if (status$LWS && ReflectApply$LWS$1(scriptSrcGetterDistortion$LWS, script$LWS, []) === urlResolved$LWS) {
|
|
15432
15409
|
if (status$LWS === 3 /* ResourceLoaderStatus.Loaded */) {
|
|
15433
15410
|
return PromiseResolve$LWS(undefined);
|
|
15434
15411
|
}
|
|
15435
15412
|
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15436
15413
|
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15437
|
-
return PromiseReject$LWS(createResourceLoadError$LWS(
|
|
15414
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlResolved$LWS));
|
|
15438
15415
|
}
|
|
15439
15416
|
if (status$LWS === 2 /* ResourceLoaderStatus.Loading */) {
|
|
15440
15417
|
return resourcePromiseCache$LWS.get(script$LWS);
|
|
@@ -15448,16 +15425,16 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15448
15425
|
// has been created by it or not. See W-13034908.
|
|
15449
15426
|
// eslint-disable-next-line no-underscore-dangle
|
|
15450
15427
|
script$LWS._ltngRequireCreated = true;
|
|
15451
|
-
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [
|
|
15452
|
-
return loadPromise$LWS(script$LWS,
|
|
15428
|
+
ReflectApply$LWS$1(scriptSrcSetterDistortion$LWS, script$LWS, [urlResolved$LWS]);
|
|
15429
|
+
return loadPromise$LWS(script$LWS, urlResolved$LWS);
|
|
15453
15430
|
},
|
|
15454
15431
|
// Functionality based on platformResourceLoader#loadStyle (http://sfdc.co/bIpMYB) but
|
|
15455
15432
|
// adjusted for multiple sandboxes. This loadStyle will create one <link> element in the DOM
|
|
15456
15433
|
// per url for all the sandboxes.
|
|
15457
15434
|
// istanbul ignore next: currently unreachable via tests, platformResourceLoader testing is exclusively done in AMD format mode
|
|
15458
15435
|
function loadStyle$LWS(_thisArg$LWS, url$LWS) {
|
|
15459
|
-
const
|
|
15460
|
-
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(
|
|
15436
|
+
const urlResolved$LWS = resolveURL$LWS(toString$LWS(url$LWS));
|
|
15437
|
+
let link$LWS = ReflectApply$LWS$1(ElementProtoQuerySelector$LWS, head$LWS, [`link[href=${enquote$LWS(urlResolved$LWS)}]`]);
|
|
15461
15438
|
if (link$LWS) {
|
|
15462
15439
|
var _resourceStatusCache$2$LWS;
|
|
15463
15440
|
const status$LWS = (_resourceStatusCache$2$LWS = resourceStatusCache$LWS.get(link$LWS)) != null ? _resourceStatusCache$2$LWS : 0 /* ResourceLoaderStatus.None */;
|
|
@@ -15466,7 +15443,7 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15466
15443
|
}
|
|
15467
15444
|
// istanbul ignore if: this status cannot be tested without navigating the page itself during the execution of the request.
|
|
15468
15445
|
if (status$LWS === 1 /* ResourceLoaderStatus.Errored */) {
|
|
15469
|
-
return PromiseReject$LWS(createResourceLoadError$LWS(
|
|
15446
|
+
return PromiseReject$LWS(createResourceLoadError$LWS(urlResolved$LWS));
|
|
15470
15447
|
}
|
|
15471
15448
|
const promise$LWS = status$LWS === 2 /* ResourceLoaderStatus.Loading */ ? resourcePromiseCache$LWS.get(link$LWS) : undefined;
|
|
15472
15449
|
return promise$LWS != null ? promise$LWS : PromiseResolve$LWS(undefined);
|
|
@@ -15474,8 +15451,8 @@ function createEvalHelpersFactoryArgs$LWS(record$LWS) {
|
|
|
15474
15451
|
link$LWS = ReflectApply$LWS$1(DocumentProtoCreateElement$LWS$1, document$LWS, ['link']);
|
|
15475
15452
|
link$LWS.type = 'text/css';
|
|
15476
15453
|
link$LWS.rel = 'stylesheet';
|
|
15477
|
-
link$LWS.href =
|
|
15478
|
-
return loadPromise$LWS(link$LWS,
|
|
15454
|
+
link$LWS.href = urlResolved$LWS;
|
|
15455
|
+
return loadPromise$LWS(link$LWS, urlResolved$LWS);
|
|
15479
15456
|
}];
|
|
15480
15457
|
}
|
|
15481
15458
|
function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
@@ -15488,7 +15465,7 @@ function toSourceText$LWS(value$LWS, sourceType$LWS) {
|
|
|
15488
15465
|
// tools from mistaking the regexp or the replacement string for an
|
|
15489
15466
|
// actual source mapping URL.
|
|
15490
15467
|
/\/\/# sandbox(?=MappingURL=.*?\s*$)/, '//# source']);
|
|
15491
|
-
sourceText$LWS = `\n//# LWS Version = "0.22.
|
|
15468
|
+
sourceText$LWS = `\n//# LWS Version = "0.22.5"\n${sourceText$LWS}`;
|
|
15492
15469
|
return sourceType$LWS === 1 /* SourceType.Module */ && indexOfPragma$LWS(sourceText$LWS, 'use strict') === -1 ?
|
|
15493
15470
|
// Append "'use strict'" to the extracted function body so it is
|
|
15494
15471
|
// evaluated in strict mode.
|
|
@@ -16170,14 +16147,15 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
16170
16147
|
return secureDep$LWS;
|
|
16171
16148
|
}
|
|
16172
16149
|
secureDep$LWS = {
|
|
16173
|
-
loadScript: (
|
|
16150
|
+
loadScript: (cmp$LWS, url$LWS, config$LWS) => {
|
|
16151
|
+
const urlResolved$LWS = resolveURL$LWS(url$LWS);
|
|
16174
16152
|
const sandbox$LWS = createRootWindowSandboxRecord$LWS({
|
|
16175
16153
|
key: key$LWS
|
|
16176
16154
|
});
|
|
16177
16155
|
if (isGaterEnabledFeature$LWS('enableTrustedMode') && config$LWS != null && config$LWS.trustedMode) {
|
|
16178
16156
|
const trustedGlobals$LWS = config$LWS.trustedGlobals;
|
|
16179
16157
|
if ((trustedGlobals$LWS == null ? void 0 : trustedGlobals$LWS.length) > 0) {
|
|
16180
|
-
return dep$LWS.loadScript(
|
|
16158
|
+
return dep$LWS.loadScript(cmp$LWS, urlResolved$LWS).then(() => {
|
|
16181
16159
|
const installGlobals$LWS = sandbox$LWS.virtualEnvironmentEvaluator(`(list) => list.forEach(([key, get, set]) => Object.defineProperty(window, key, { get, set, configurable: true, enumerable: true }));`);
|
|
16182
16160
|
const globals$LWS = trustedGlobals$LWS.map(globalName$LWS => [globalName$LWS, function get$LWS() {
|
|
16183
16161
|
return window[globalName$LWS];
|
|
@@ -16187,18 +16165,21 @@ function wrapPlatformResourceLoader$LWS(dep$LWS, key$LWS) {
|
|
|
16187
16165
|
installGlobals$LWS(globals$LWS);
|
|
16188
16166
|
});
|
|
16189
16167
|
}
|
|
16190
|
-
return dep$LWS.loadScript(
|
|
16168
|
+
return dep$LWS.loadScript(cmp$LWS, urlResolved$LWS);
|
|
16191
16169
|
}
|
|
16192
|
-
return sandbox$LWS.helpers.loadScript(
|
|
16170
|
+
return sandbox$LWS.helpers.loadScript(cmp$LWS, urlResolved$LWS);
|
|
16193
16171
|
},
|
|
16194
|
-
loadStyle: (
|
|
16195
|
-
|
|
16196
|
-
|
|
16172
|
+
loadStyle: (cmp$LWS, url$LWS) => {
|
|
16173
|
+
const urlResolved$LWS = resolveURL$LWS(url$LWS);
|
|
16174
|
+
return createRootWindowSandboxRecord$LWS({
|
|
16175
|
+
key: key$LWS
|
|
16176
|
+
}).helpers.loadStyle(cmp$LWS, urlResolved$LWS);
|
|
16177
|
+
}
|
|
16197
16178
|
};
|
|
16198
16179
|
depRegistry$LWS.set(dep$LWS, secureDep$LWS);
|
|
16199
16180
|
return secureDep$LWS;
|
|
16200
16181
|
}
|
|
16201
|
-
/*! version: 0.22.
|
|
16182
|
+
/*! version: 0.22.5 */
|
|
16202
16183
|
|
|
16203
16184
|
export { $LWS, CORE_SANDBOX_KEY$LWS as CORE_SANDBOX_KEY, createRootWindowSandboxRecord$LWS as createRootWindowSandboxRecord, evaluateFunction$LWS as evaluateFunction, evaluateInCoreSandbox$LWS as evaluateInCoreSandbox, evaluateInSandbox$LWS as evaluateInSandbox, trusted, wrapDependency$LWS as wrapDependency };
|
|
16204
16185
|
//# sourceMappingURL=lockerSandbox.js.map
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "0.13.
|
|
7
|
+
"version": "0.13.4",
|
|
8
8
|
"homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
"build:platform": "node scripts/strip-for-core.js"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@locker/sandbox": "0.22.
|
|
37
|
-
"@lwrjs/shared-utils": "0.13.
|
|
36
|
+
"@locker/sandbox": "0.22.5",
|
|
37
|
+
"@lwrjs/shared-utils": "0.13.4"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@lwrjs/types": "0.13.
|
|
40
|
+
"@lwrjs/types": "0.13.4",
|
|
41
41
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
42
42
|
"@rollup/plugin-sucrase": "^5.0.2",
|
|
43
43
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
"volta": {
|
|
71
71
|
"extends": "../../../package.json"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "398664835cd2c6c6714e88c6f196e9963f7b6595"
|
|
74
74
|
}
|