@lwrjs/everywhere 0.10.0-alpha.12 → 0.10.0-alpha.13
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/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/5c2ba82d0f6a4680735c5f024b1d4f08/config.js +10 -0
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/{0_10_0-alpha_12 → 0_10_0-alpha_13}/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js +4 -4
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/2_45_2/s/97b809a5745ddedba3acd0433f339b58/lwc.js +7 -7
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_10_0-alpha_12 → 0_10_0-alpha_13}/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js +3 -3
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/0_10_0-alpha_13/s/5e6db37af51f0d23be4893abe5eeb913/lwr_init.js +163 -0
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_10_0-alpha_12/s/47b3d0565b6d407aa007cd99ec22f4bc → 0_10_0-alpha_13/s/306caa2af665db6678fe4013e2f82aa1}/lwr_loader.js +32 -4
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_10_0-alpha_12/s/3426e42c3e22ce07ab2adc62c4c523a0 → 0_10_0-alpha_13/s/7a802ee7a2430244c1f66bce2c2eafef}/lwr_metrics.js +13 -1
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/0_10_0-alpha_13/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +102 -0
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_10_0-alpha_12 → 0_10_0-alpha_13}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_10_0-alpha_12 → 0_10_0-alpha_13}/lwr-error-shim.js +1 -1
- package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_10_0-alpha_12 → 0_10_0-alpha_13}/lwr-loader-shim.bundle.js +77 -17
- package/build/assets/amd/lwr-everywhere-debug.js +37 -9
- package/build/assets/amd/lwr-everywhere-min.js +6 -1
- package/build/assets/amd/lwr-everywhere.js +37 -9
- package/build/assets/core/lwr-everywhere-debug.js +33 -5
- package/build/assets/core/lwr-everywhere-min.js +6 -1
- package/build/assets/core/lwr-everywhere.js +33 -5
- package/build/assets/esm/lwr-everywhere-debug.js +1 -1
- package/build/assets/esm/lwr-everywhere-min.js +1 -1
- package/build/assets/esm/lwr-everywhere.js +1 -1
- package/build/generate.js +1 -1
- package/build/index.js +1 -1
- package/build/modules/lwr/vault/vault.d.ts +1 -1
- package/build/utils.d.ts +1 -1
- package/package.json +8 -6
- package/src/generate.ts +1 -1
- package/src/index.ts +4 -1
- package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/aef0bdcf858bd7ec72663e7611465624/config.js +0 -10
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/0_10_0-alpha_12/s/8199fbc1a33dffe14973c3ee0a3f6aa3/lwr_init.js +0 -118
- package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/0_10_0-alpha_12/s/4e65d4b97b3cc3d2f06a4cc284f3dd68/lwr_profiler.js +0 -68
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/* This script is generated */
|
|
2
|
+
/* Client Bootstrap configuration */
|
|
3
|
+
globalThis.LWR = globalThis.LWR || {};
|
|
4
|
+
Object.assign(globalThis.LWR, {"appId":"amd-bootstrap","bootstrapModule":"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_10_0-alpha_13/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_10_0-alpha_13/s/5e6db37af51f0d23be4893abe5eeb913/lwr_init.js":["lwr/init/v/0_10_0-alpha_13"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_10_0-alpha_13/s/7a802ee7a2430244c1f66bce2c2eafef/lwr_metrics.js":["lwr/metrics/v/0_10_0-alpha_13"],"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_10_0-alpha_13/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js":["lwr/profiler/v/0_10_0-alpha_13"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F2_45_2/s/97b809a5745ddedba3acd0433f339b58/lwc.js":["lwc/v/2_45_2"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_10_0-alpha_13/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_10_0-alpha_13"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_10_0-alpha_13/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_10_0-alpha_13"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_10_0-alpha_13/s/c40e6caf07454ce13961de8ca76ab7f0/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/init/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_10_0-alpha_13/s/5e6db37af51f0d23be4893abe5eeb913/lwr_init.js","lwr/metrics/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_10_0-alpha_13/s/7a802ee7a2430244c1f66bce2c2eafef/lwr_metrics.js","lwr/profiler/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_10_0-alpha_13/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js","lwc/v/2_45_2":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F2_45_2/s/97b809a5745ddedba3acd0433f339b58/lwc.js","lwr/everywhereAmd/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_10_0-alpha_13/s/c538071acf5bde58e816967a14c465c3/lwr_everywhereAmd.js","lwr/vault/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_10_0-alpha_13/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_10_0-alpha_13"],"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13"],"preloadModules":["lwr/init/v/0_10_0-alpha_13","lwr/metrics/v/0_10_0-alpha_13","lwc/v/2_45_2","lwr/everywhereAmd/v/0_10_0-alpha_13"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
|
|
5
|
+
globalThis.process = { env: { NODE_ENV: "compat", SSR: false } };
|
|
6
|
+
// Appended by Static Site Generator
|
|
7
|
+
if (!globalThis.LWR.imports) { globalThis.LWR.imports = {}; }
|
|
8
|
+
Object.assign(globalThis.LWR.imports, {"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_10_0-alpha_13/s/306caa2af665db6678fe4013e2f82aa1/lwr_loader.js":["lwr/loader/v/0_10_0-alpha_13"]})
|
|
9
|
+
if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
|
|
10
|
+
Object.assign(globalThis.LWR.index, {"lwr/loader/v/0_10_0-alpha_13":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_10_0-alpha_13/s/306caa2af665db6678fe4013e2f82aa1/lwr_loader.js"})
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-
|
|
1
|
+
LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13', ['lwr/loader/v/0_10_0-alpha_13', 'lwr/init/v/0_10_0-alpha_13'], (function (_0_10_0Alpha_13$1, _0_10_0Alpha_13) { 'use strict';
|
|
2
2
|
|
|
3
3
|
const clientBootstrapConfig = globalThis.LWR;
|
|
4
4
|
|
|
5
5
|
// initialize additional non-configured root components
|
|
6
6
|
const { rootComponents, ssrProps } = clientBootstrapConfig;
|
|
7
7
|
Promise.all(rootComponents.map(async (rootSpecifier) => {
|
|
8
|
-
const element =
|
|
9
|
-
return
|
|
10
|
-
|
|
8
|
+
const element = _0_10_0Alpha_13.toKebabCase(rootSpecifier);
|
|
9
|
+
return _0_10_0Alpha_13$1.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_10_0-alpha_13').then(({default: Ctor}) => {
|
|
10
|
+
_0_10_0Alpha_13.init([[element, Ctor]], ssrProps);
|
|
11
11
|
});
|
|
12
12
|
}));
|
|
13
13
|
|
|
@@ -1552,7 +1552,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
1552
1552
|
valueMutated(originalTarget, key);
|
|
1553
1553
|
return true;
|
|
1554
1554
|
}
|
|
1555
|
-
/*LWC compiler v2.45.
|
|
1555
|
+
/*LWC compiler v2.45.3*/
|
|
1556
1556
|
}
|
|
1557
1557
|
const getterMap = new WeakMap();
|
|
1558
1558
|
const setterMap = new WeakMap();
|
|
@@ -1645,7 +1645,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
1645
1645
|
/* istanbul ignore next */
|
|
1646
1646
|
return false;
|
|
1647
1647
|
}
|
|
1648
|
-
/*LWC compiler v2.45.
|
|
1648
|
+
/*LWC compiler v2.45.3*/
|
|
1649
1649
|
}
|
|
1650
1650
|
function extract(objectOrArray) {
|
|
1651
1651
|
if (isArray(objectOrArray)) {
|
|
@@ -3236,7 +3236,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
3236
3236
|
*/
|
|
3237
3237
|
if (isFunction$1(SuperClass)) {
|
|
3238
3238
|
HTMLBridgeElement = class extends SuperClass {
|
|
3239
|
-
/*LWC compiler v2.45.
|
|
3239
|
+
/*LWC compiler v2.45.3*/
|
|
3240
3240
|
};
|
|
3241
3241
|
} else {
|
|
3242
3242
|
HTMLBridgeElement = function () {
|
|
@@ -8112,7 +8112,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
8112
8112
|
// invokes the DOM api with an .apply() or .call() to initialize any DOM api sub-classing,
|
|
8113
8113
|
// which are not equipped to be initialized that way.
|
|
8114
8114
|
class clazz extends HTMLElementAlias {
|
|
8115
|
-
/*LWC compiler v2.45.
|
|
8115
|
+
/*LWC compiler v2.45.3*/
|
|
8116
8116
|
}
|
|
8117
8117
|
customElements.define('lwc-test-' + Math.floor(Math.random() * 1000000), clazz);
|
|
8118
8118
|
new clazz();
|
|
@@ -8170,7 +8170,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
8170
8170
|
// Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
|
|
8171
8171
|
}
|
|
8172
8172
|
}
|
|
8173
|
-
/*LWC compiler v2.45.
|
|
8173
|
+
/*LWC compiler v2.45.3*/
|
|
8174
8174
|
}
|
|
8175
8175
|
// Do not unnecessarily add a connectedCallback/disconnectedCallback, as it introduces perf overhead
|
|
8176
8176
|
// See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
|
|
@@ -8311,7 +8311,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
8311
8311
|
this.setNewContext = setNewContext;
|
|
8312
8312
|
this.setDisconnectedCallback = setDisconnectedCallback;
|
|
8313
8313
|
}
|
|
8314
|
-
/*LWC compiler v2.45.
|
|
8314
|
+
/*LWC compiler v2.45.3*/
|
|
8315
8315
|
}
|
|
8316
8316
|
function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
|
|
8317
8317
|
dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
|
|
@@ -8701,7 +8701,7 @@ LWR.define('lwc/v/2_45_2', ['exports'], (function (exports) { 'use strict';
|
|
|
8701
8701
|
attributeChangedCallback(name, oldValue, newValue) {
|
|
8702
8702
|
attributeChangedCallback.call(this, name, oldValue, newValue);
|
|
8703
8703
|
}
|
|
8704
|
-
/*LWC compiler v2.45.
|
|
8704
|
+
/*LWC compiler v2.45.3*/
|
|
8705
8705
|
}, _a.observedAttributes = observedAttributes, _a;
|
|
8706
8706
|
}
|
|
8707
8707
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
LWR.define('lwr/everywhereAmd/v/0_10_0-
|
|
1
|
+
LWR.define('lwr/everywhereAmd/v/0_10_0-alpha_13', ['exports', 'lwr/vault/v/0_10_0-alpha_13'], (function (exports, _0_10_0Alpha_13) { 'use strict';
|
|
2
2
|
|
|
3
3
|
// IMPORTANT: Do not add any static imports to this file that are not bundled with the amd-client
|
|
4
4
|
|
|
5
5
|
// Do an OAuthed fetch
|
|
6
6
|
async function authFetch(url, accept = 'javascript') {
|
|
7
|
-
const authInfo =
|
|
7
|
+
const authInfo = _0_10_0Alpha_13.getAuthInfo();
|
|
8
8
|
if (authInfo) {
|
|
9
9
|
return fetch(url, {
|
|
10
10
|
headers: {
|
|
@@ -54,7 +54,7 @@ LWR.define('lwr/everywhereAmd/v/0_10_0-alpha_12', ['exports', 'lwr/vault/v/0_10_
|
|
|
54
54
|
function authenticate(authInfo) {
|
|
55
55
|
// Put OAuth info into the vault
|
|
56
56
|
if (authInfo) {
|
|
57
|
-
|
|
57
|
+
_0_10_0Alpha_13.setAuthInfo(authInfo);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
LWR.define('lwr/init/v/0_10_0-alpha_13', ['exports', 'lwr/metrics/v/0_10_0-alpha_13', 'lwr/profiler/v/0_10_0-alpha_13', 'lwc/v/2_45_2'], (function (exports, _0_10_0Alpha_13$1, _0_10_0Alpha_13, _2_45_2) { 'use strict';
|
|
2
|
+
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
|
|
5
|
+
// <hydrateComponentProxy> - This code is removed in core
|
|
6
|
+
|
|
7
|
+
function hydrateComponentProxy(customElement, Ctor, props) {
|
|
8
|
+
_2_45_2.hydrateComponent(customElement, Ctor, props);
|
|
9
|
+
}
|
|
10
|
+
// </hydrateComponentProxy>
|
|
11
|
+
|
|
12
|
+
function initializeWebComponent(elementName, Ctor) {
|
|
13
|
+
return _2_45_2.createElement(elementName, {
|
|
14
|
+
is: Ctor
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Convert a module specifier into a valid CustomElement registry name:
|
|
20
|
+
* - remove any version linking
|
|
21
|
+
* - change / to -
|
|
22
|
+
* - convert uppercase letters into "-${lowercase}"
|
|
23
|
+
* eg: "c/app" => "c-app"
|
|
24
|
+
* eg: "my/helloWorld" => "my-hello-world"
|
|
25
|
+
* eg: "lwr/example/v/1.0.0" => "lwr-example"
|
|
26
|
+
* @param specifier The bare specifier to convert
|
|
27
|
+
*/
|
|
28
|
+
function toKebabCase(specifier) {
|
|
29
|
+
return specifier.replace(/\/v\/[a-zA-Z0-9-_.]+$/, '').replace('/', '-').replace(/([A-Z])/g, c => `-${c.toLowerCase()}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* This method maps between attribute names
|
|
34
|
+
* and the corresponding props name.
|
|
35
|
+
*/
|
|
36
|
+
const CAMEL_REGEX = /-([a-z])/g;
|
|
37
|
+
function getPropFromAttrName(propName) {
|
|
38
|
+
return propName.replace(CAMEL_REGEX, g => g[1].toUpperCase());
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Import any requested static application dependencies, define the root
|
|
43
|
+
* application component(s) into the CustomElement registry, and inject them.
|
|
44
|
+
* @param rootModules - An array of arrays, each one holding a pair of
|
|
45
|
+
* bare specifier and corresponding LightningElement constructor
|
|
46
|
+
* @example - [['x/appRoot', appCtor], ['x/nav', navCtor]]
|
|
47
|
+
*/
|
|
48
|
+
function init(rootModules, ssrProps = {}) {
|
|
49
|
+
if (typeof customElements === 'undefined' || typeof document === 'undefined') {
|
|
50
|
+
_0_10_0Alpha_13.logOperationStart({
|
|
51
|
+
id: _0_10_0Alpha_13$1.BOOTSTRAP_END
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
_0_10_0Alpha_13.logOperationStart({
|
|
56
|
+
id: _0_10_0Alpha_13$1.INIT
|
|
57
|
+
});
|
|
58
|
+
let index = 0;
|
|
59
|
+
for (const [specifier, ctor] of rootModules) {
|
|
60
|
+
const elementName = toKebabCase(specifier);
|
|
61
|
+
|
|
62
|
+
// initialize and inject the root module into the LWR Root or DOM if it is missing
|
|
63
|
+
if (!document.body.querySelector(elementName)) {
|
|
64
|
+
_0_10_0Alpha_13.logOperationStart({
|
|
65
|
+
id: _0_10_0Alpha_13$1.INIT_MODULE,
|
|
66
|
+
specifier,
|
|
67
|
+
specifierIndex: ++index
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
// this is for SPA like routes (one component at the root level) utilizing the lwr-root directive
|
|
71
|
+
const component = initializeWebComponent(elementName, ctor);
|
|
72
|
+
const container = document.querySelector('[lwr-root]');
|
|
73
|
+
container ? container.appendChild(component) : document.body.appendChild(component);
|
|
74
|
+
_0_10_0Alpha_13.logOperationEnd({
|
|
75
|
+
id: _0_10_0Alpha_13$1.INIT_MODULE,
|
|
76
|
+
specifier,
|
|
77
|
+
specifierIndex: index,
|
|
78
|
+
metadata: {
|
|
79
|
+
renderMode: 'spa'
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
continue;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// the page has been rendered or SSR'd, and each component needs to initialized(or hydrated)
|
|
86
|
+
const elements = document.querySelectorAll(elementName);
|
|
87
|
+
for (const element of elements) {
|
|
88
|
+
_0_10_0Alpha_13.logOperationStart({
|
|
89
|
+
id: _0_10_0Alpha_13$1.INIT_MODULE,
|
|
90
|
+
specifier,
|
|
91
|
+
specifierIndex: ++index
|
|
92
|
+
});
|
|
93
|
+
const propsId = element.dataset.lwrPropsId;
|
|
94
|
+
|
|
95
|
+
// hydrate SSR'd components
|
|
96
|
+
if (propsId) {
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
98
|
+
// @ts-ignore
|
|
99
|
+
hydrateComponentProxy(element, ctor, ssrProps[propsId] || {});
|
|
100
|
+
_0_10_0Alpha_13.logOperationEnd({
|
|
101
|
+
id: _0_10_0Alpha_13$1.INIT_MODULE,
|
|
102
|
+
specifier,
|
|
103
|
+
specifierIndex: index,
|
|
104
|
+
metadata: {
|
|
105
|
+
renderMode: 'ssr'
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
continue;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Note: due to the bug described at the top of this file, each CSR'd custom element
|
|
112
|
+
// must be replaced with the new synthetic constructor. Attributes and children are
|
|
113
|
+
// copied over to the new component.
|
|
114
|
+
const component = initializeWebComponent(elementName, ctor);
|
|
115
|
+
|
|
116
|
+
// copy the attributes
|
|
117
|
+
for (const {
|
|
118
|
+
name,
|
|
119
|
+
value
|
|
120
|
+
} of element.attributes) {
|
|
121
|
+
component.setAttribute(name, value);
|
|
122
|
+
const prop = getPropFromAttrName(name);
|
|
123
|
+
if (prop in component) {
|
|
124
|
+
// set attributes as properties for reactivity
|
|
125
|
+
component[prop] = value;
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// save the children
|
|
130
|
+
while (element.childNodes.length > 0) {
|
|
131
|
+
component.appendChild(element.childNodes[0]);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
// swap the element out with the initialized component
|
|
135
|
+
const parent = element.parentElement;
|
|
136
|
+
if (parent) {
|
|
137
|
+
parent.replaceChild(component, element);
|
|
138
|
+
}
|
|
139
|
+
_0_10_0Alpha_13.logOperationEnd({
|
|
140
|
+
id: _0_10_0Alpha_13$1.INIT_MODULE,
|
|
141
|
+
specifier,
|
|
142
|
+
specifierIndex: index,
|
|
143
|
+
metadata: {
|
|
144
|
+
renderMode: 'csr'
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
_0_10_0Alpha_13.logOperationEnd({
|
|
150
|
+
id: _0_10_0Alpha_13$1.INIT
|
|
151
|
+
});
|
|
152
|
+
_0_10_0Alpha_13.logOperationStart({
|
|
153
|
+
id: _0_10_0Alpha_13$1.BOOTSTRAP_END
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
exports.getPropFromAttrName = getPropFromAttrName;
|
|
158
|
+
exports.init = init;
|
|
159
|
+
exports.toKebabCase = toKebabCase;
|
|
160
|
+
|
|
161
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
162
|
+
|
|
163
|
+
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/loader/v/0_10_0-
|
|
1
|
+
LWR.define('lwr/loader/v/0_10_0-alpha_13', ['exports'], (function (exports) { 'use strict';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Copyright (c) 2021, salesforce.com, inc.
|
|
@@ -6,7 +6,7 @@ LWR.define('lwr/loader/v/0_10_0-alpha_12', ['exports'], (function (exports) { 'u
|
|
|
6
6
|
* SPDX-License-Identifier: MIT
|
|
7
7
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
8
8
|
*/
|
|
9
|
-
/* LWR Module Loader v0.10.0-alpha.
|
|
9
|
+
/* LWR Module Loader v0.10.0-alpha.13 */
|
|
10
10
|
const templateRegex = /\{([0-9]+)\}/g;
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
12
|
function templateString(template, args) {
|
|
@@ -25,7 +25,7 @@ LWR.define('lwr/loader/v/0_10_0-alpha_12', ['exports'], (function (exports) { 'u
|
|
|
25
25
|
super();
|
|
26
26
|
this.message = generateErrorMessage(errorInfo, errorArgs);
|
|
27
27
|
}
|
|
28
|
-
/*LWC compiler v2.45.
|
|
28
|
+
/*LWC compiler v2.45.3*/
|
|
29
29
|
}
|
|
30
30
|
function invariant(condition, errorInfo) {
|
|
31
31
|
if (!condition) {
|
|
@@ -543,6 +543,34 @@ LWR.define('lwr/loader/v/0_10_0-alpha_12', ['exports'], (function (exports) { 'u
|
|
|
543
543
|
}
|
|
544
544
|
const MODULE_LOAD_TIMEOUT_TIMER = 300000;
|
|
545
545
|
|
|
546
|
+
/*!
|
|
547
|
+
* Copyright (C) 2023 salesforce.com, inc.
|
|
548
|
+
*/
|
|
549
|
+
// @ts-ignore: Prevent cannot find name 'trustedTypes' error.
|
|
550
|
+
const SUPPORTS_TRUSTED_TYPES = typeof trustedTypes !== 'undefined';
|
|
551
|
+
function createTrustedTypesPolicy(name, options) {
|
|
552
|
+
// @ts-ignore: Prevent cannot find name 'trustedTypes' error.
|
|
553
|
+
return trustedTypes.createPolicy(name, options);
|
|
554
|
+
}
|
|
555
|
+
function createFallbackPolicy(_name, options) {
|
|
556
|
+
return options;
|
|
557
|
+
}
|
|
558
|
+
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types
|
|
559
|
+
const createPolicy = SUPPORTS_TRUSTED_TYPES ? createTrustedTypesPolicy : createFallbackPolicy;
|
|
560
|
+
const policyOptions = {
|
|
561
|
+
createHTML(value) {
|
|
562
|
+
return value;
|
|
563
|
+
},
|
|
564
|
+
createScript(value) {
|
|
565
|
+
return value;
|
|
566
|
+
},
|
|
567
|
+
createScriptURL(value) {
|
|
568
|
+
return value;
|
|
569
|
+
}
|
|
570
|
+
};
|
|
571
|
+
const trusted = createPolicy('trusted', policyOptions);
|
|
572
|
+
/*! version: 0.19.4 */
|
|
573
|
+
|
|
546
574
|
/* global console,process */
|
|
547
575
|
|
|
548
576
|
let lastWindowError;
|
|
@@ -591,7 +619,7 @@ LWR.define('lwr/loader/v/0_10_0-alpha_12', ['exports'], (function (exports) { 'u
|
|
|
591
619
|
code = `${code}\n//# sourceURL=${id}`; // append sourceURL for debugging
|
|
592
620
|
try {
|
|
593
621
|
// TODO eval source maps for debugging
|
|
594
|
-
eval(code);
|
|
622
|
+
eval(trusted.createScript(code));
|
|
595
623
|
} catch (e) {
|
|
596
624
|
throw new LoaderError(FAIL_LOAD, [id]);
|
|
597
625
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/metrics/v/0_10_0-
|
|
1
|
+
LWR.define('lwr/metrics/v/0_10_0-alpha_13', ['exports'], (function (exports) { 'use strict';
|
|
2
2
|
|
|
3
3
|
// Bootstrap / shim
|
|
4
4
|
const BOOTSTRAP_PREFIX = 'lwr.bootstrap.';
|
|
@@ -7,6 +7,13 @@ LWR.define('lwr/metrics/v/0_10_0-alpha_12', ['exports'], (function (exports) { '
|
|
|
7
7
|
const BOOTSTRAP_ERROR_COUNT = `${BOOTSTRAP_ERROR}.count`;
|
|
8
8
|
const BOOTSTRAP_DURATION = `${BOOTSTRAP_PREFIX}duration`;
|
|
9
9
|
|
|
10
|
+
// Initialization
|
|
11
|
+
const INIT = 'lwr.bootstrap.init';
|
|
12
|
+
const INIT_DURATION = `${INIT}.duration`;
|
|
13
|
+
const INIT_MODULE = `lwr.bootstrap.init.module`;
|
|
14
|
+
const INIT_MODULE_DURATION = `${INIT_MODULE}.duration`;
|
|
15
|
+
const INIT_MODULE_COUNT = `${INIT_MODULE}.count`;
|
|
16
|
+
|
|
10
17
|
// Loader: modules
|
|
11
18
|
const LOADER_PREFIX = 'lwr.loader.';
|
|
12
19
|
const MODULE_DEFINE = `${LOADER_PREFIX}module.define`;
|
|
@@ -39,6 +46,11 @@ LWR.define('lwr/metrics/v/0_10_0-alpha_12', ['exports'], (function (exports) { '
|
|
|
39
46
|
exports.BOOTSTRAP_ERROR = BOOTSTRAP_ERROR;
|
|
40
47
|
exports.BOOTSTRAP_ERROR_COUNT = BOOTSTRAP_ERROR_COUNT;
|
|
41
48
|
exports.BOOTSTRAP_PREFIX = BOOTSTRAP_PREFIX;
|
|
49
|
+
exports.INIT = INIT;
|
|
50
|
+
exports.INIT_DURATION = INIT_DURATION;
|
|
51
|
+
exports.INIT_MODULE = INIT_MODULE;
|
|
52
|
+
exports.INIT_MODULE_COUNT = INIT_MODULE_COUNT;
|
|
53
|
+
exports.INIT_MODULE_DURATION = INIT_MODULE_DURATION;
|
|
42
54
|
exports.LOADER_PREFIX = LOADER_PREFIX;
|
|
43
55
|
exports.MAPPINGS_ERROR = MAPPINGS_ERROR;
|
|
44
56
|
exports.MAPPINGS_ERROR_COUNT = MAPPINGS_ERROR_COUNT;
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
LWR.define('lwr/profiler/v/0_10_0-alpha_13', ['exports'], (function (exports) { 'use strict';
|
|
2
|
+
|
|
3
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
7
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
8
|
+
var Phase = /*#__PURE__*/function (Phase) {
|
|
9
|
+
Phase[Phase["Start"] = 0] = "Start";
|
|
10
|
+
Phase[Phase["End"] = 1] = "End";
|
|
11
|
+
return Phase;
|
|
12
|
+
}(Phase || {});
|
|
13
|
+
// Attach a custom dispatcher
|
|
14
|
+
let customDispatcher;
|
|
15
|
+
function attachDispatcher(dispatcher) {
|
|
16
|
+
customDispatcher = dispatcher;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Check if the Performance API is available
|
|
20
|
+
// e.g. JSDom (used in Jest) doesn't implement these
|
|
21
|
+
const perf = globalThis.performance;
|
|
22
|
+
const isPerfSupported = typeof perf !== 'undefined' && typeof perf.mark === 'function' && typeof perf.clearMarks === 'function' && typeof perf.measure === 'function' && typeof perf.clearMeasures === 'function';
|
|
23
|
+
function getMeasureName(id, specifier) {
|
|
24
|
+
return specifier ? `${id}-${specifier}` : id;
|
|
25
|
+
}
|
|
26
|
+
function getMarkName(id, specifier, specifierIndex) {
|
|
27
|
+
const measureName = getMeasureName(id, specifier);
|
|
28
|
+
return specifier && specifierIndex ? `${measureName}_${specifierIndex}` : measureName;
|
|
29
|
+
}
|
|
30
|
+
function getDetail(specifier, metadata) {
|
|
31
|
+
const detail = specifier || metadata ? _objectSpread({}, metadata) : null;
|
|
32
|
+
if (detail && specifier) {
|
|
33
|
+
detail['specifier'] = specifier;
|
|
34
|
+
}
|
|
35
|
+
return detail;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// For marking request metrics
|
|
39
|
+
// Fallback to the Performance API if there is no custom dispatcher
|
|
40
|
+
function logOperationStart({
|
|
41
|
+
id,
|
|
42
|
+
specifier,
|
|
43
|
+
specifierIndex,
|
|
44
|
+
metadata
|
|
45
|
+
}) {
|
|
46
|
+
if (customDispatcher) {
|
|
47
|
+
customDispatcher({
|
|
48
|
+
id,
|
|
49
|
+
phase: Phase.Start,
|
|
50
|
+
specifier,
|
|
51
|
+
metadata
|
|
52
|
+
});
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
if (isPerfSupported) {
|
|
56
|
+
const markName = getMarkName(id, specifier, specifierIndex);
|
|
57
|
+
const detail = getDetail(specifier, metadata);
|
|
58
|
+
perf.mark(markName, {
|
|
59
|
+
detail
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// For measuring duration metrics
|
|
65
|
+
// Fallback to the Performance API if there is no custom dispatcher
|
|
66
|
+
/* istanbul ignore next */
|
|
67
|
+
function logOperationEnd({
|
|
68
|
+
id,
|
|
69
|
+
specifier,
|
|
70
|
+
specifierIndex,
|
|
71
|
+
metadata
|
|
72
|
+
}) {
|
|
73
|
+
if (customDispatcher) {
|
|
74
|
+
customDispatcher({
|
|
75
|
+
id,
|
|
76
|
+
phase: Phase.End,
|
|
77
|
+
specifier,
|
|
78
|
+
metadata
|
|
79
|
+
});
|
|
80
|
+
} else if (isPerfSupported) {
|
|
81
|
+
const markName = getMarkName(id, specifier, specifierIndex);
|
|
82
|
+
const measureName = getMeasureName(id, specifier);
|
|
83
|
+
const detail = getDetail(specifier, metadata);
|
|
84
|
+
perf.measure(measureName, {
|
|
85
|
+
start: markName,
|
|
86
|
+
detail
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
// Clear the created mark and measure to avoid filling the performance entry buffer
|
|
90
|
+
// Even if they get deleted, existing PerformanceObservers preserve copies of the entries
|
|
91
|
+
perf.clearMarks(markName);
|
|
92
|
+
perf.clearMeasures(measureName);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
exports.attachDispatcher = attachDispatcher;
|
|
97
|
+
exports.logOperationEnd = logOperationEnd;
|
|
98
|
+
exports.logOperationStart = logOperationStart;
|
|
99
|
+
|
|
100
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
101
|
+
|
|
102
|
+
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
LWR.define('lwr/vault/v/0_10_0-
|
|
1
|
+
LWR.define('lwr/vault/v/0_10_0-alpha_13', ['exports'], (function (exports) { 'use strict';
|
|
2
2
|
|
|
3
3
|
// Credential vault for storing setters and subscribers for OAuth info
|
|
4
4
|
// This module is a SINGLETON and must be excluded from ESM bundling
|
|
@@ -4,6 +4,6 @@
|
|
|
4
4
|
* SPDX-License-Identifier: MIT
|
|
5
5
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
6
6
|
*/
|
|
7
|
-
/* LWR Error Shim v0.10.0-alpha.
|
|
7
|
+
/* LWR Error Shim v0.10.0-alpha.13 */
|
|
8
8
|
!function(){"use strict";if(!(globalThis.LWR&&globalThis.LWR.define)){const o=new Error("The LWR application failed to bootstrap");if(!globalThis.LWR||!globalThis.LWR.onError)throw o;globalThis.LWR.onError(o)}}();
|
|
9
9
|
//# sourceMappingURL=lwr-error-shim.js.map
|