@lwrjs/everywhere 0.12.0-alpha.1 → 0.12.0-alpha.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. package/README.md +1 -1
  2. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/22ba4f092a0ad5d5fd43174af54ec9bd/config.js +11 -0
  3. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +14 -0
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{5_1_0/s/aff256c8afef6eb76ff8626ad5f54e3b → 5_2_1/s/ccc2929f679182183c24024e0efea4c0}/lwc.js +112 -42
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -4
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js +21 -21
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/loader/v/{0_12_0-alpha_1/s/72e48759a975f1ccb61ab0876d675c46 → 0_12_0-alpha_3/s/820b8b3d56c7a1873095e47ba8f33509}/lwr_loader.js +4 -5
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/274c8343f810353bbad085a79709395f/lwr_metrics.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +1 -1
  11. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  12. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/lwr-error-shim.js +1 -1
  13. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_12_0-alpha_1 → 0_12_0-alpha_3}/lwr-loader-shim.bundle.js +7 -7
  14. package/build/assets/amd/lwr-everywhere-debug.js +9 -10
  15. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  16. package/build/assets/amd/lwr-everywhere.js +9 -10
  17. package/build/assets/core/lwr-everywhere-debug.js +5 -6
  18. package/build/assets/core/lwr-everywhere-min.js +1 -1
  19. package/build/assets/core/lwr-everywhere.js +5 -6
  20. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  21. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  22. package/build/assets/esm/lwr-everywhere.js +1 -1
  23. package/build/modules/lwr/everywhereAmd/everywhereAmd.js +0 -1
  24. package/build/modules/lwr/host/host.js +1 -0
  25. package/package.json +10 -10
  26. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/3c7ae8cf6cbd5c5957be0340c5e5b230/config.js +0 -11
  27. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_1/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
package/README.md CHANGED
@@ -110,7 +110,7 @@ counter.properties = { count: 9 };
110
110
 
111
111
  ### Client-side Navigation
112
112
 
113
- If the embedded component uses the [LWR Client-side Router](https://github.com/salesforce-experience-platform-emu/lwr-recipes/blob/main/doc/navigation.md), turn on the `navigation` setting. Then you can navigate programmatically and subscribe to navigation events and errors. For example:
113
+ If the embedded component uses the [LWR Client-side Router](../router/README.md), turn on the `navigation` setting. Then you can navigate programmatically and subscribe to navigation events and errors. For example:
114
114
 
115
115
  ```js
116
116
  import { createComponent } from 'https://lwr-server.com/resource/path/lwr-everywhere.js';
@@ -0,0 +1,11 @@
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_12_0-alpha_3","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_3/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_3/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js":["lwr/preInit/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_3/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js":["lwr/init/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_3/s/274c8343f810353bbad085a79709395f/lwr_metrics.js":["lwr/metrics/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_3/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js":["lwr/profiler/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F5_2_1/s/ccc2929f679182183c24024e0efea4c0/lwc.js":["lwc/v/5_2_1"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_3/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_12_0-alpha_3"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_3/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_12_0-alpha_3"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_3/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_3/s/f3a204ef43fb3057d910f80d7e9f9ba7/lwr_preInit.js","lwr/init/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_3/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js","lwr/metrics/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_3/s/274c8343f810353bbad085a79709395f/lwr_metrics.js","lwr/profiler/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2Fprofiler%2Fv%2F0_12_0-alpha_3/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js","lwc/v/5_2_1":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F5_2_1/s/ccc2929f679182183c24024e0efea4c0/lwc.js","lwr/everywhereAmd/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_3/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_3/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_12_0-alpha_3"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3"],"preloadModules":["lwr/preInit/v/0_12_0-alpha_3","lwr/init/v/0_12_0-alpha_3","lwr/metrics/v/0_12_0-alpha_3","lwc/v/5_2_1","lwr/everywhereAmd/v/0_12_0-alpha_3"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
5
+ globalThis.process = { env: {"NODE_ENV":"compat","SSR":false,"basePath":"","locale":"en-US","assetBasePath":"","uiBasePath":""} };
6
+ globalThis.lwcRuntimeFlags = { ENABLE_MIXED_SHADOW_MODE: false };
7
+ // Appended by Static Site Generator
8
+ if (!globalThis.LWR.imports) { globalThis.LWR.imports = {}; }
9
+ Object.assign(globalThis.LWR.imports, {"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_12_0-alpha_3/s/820b8b3d56c7a1873095e47ba8f33509/lwr_loader.js":["lwr/loader/v/0_12_0-alpha_3"]})
10
+ if (!globalThis.LWR.index) { globalThis.LWR.index = {}; }
11
+ Object.assign(globalThis.LWR.index, {"lwr/loader/v/0_12_0-alpha_3":"/1/module/amd/1/l/en-US/mi/lwr%2Floader%2Fv%2F0_12_0-alpha_3/s/820b8b3d56c7a1873095e47ba8f33509/lwr_loader.js"})
@@ -0,0 +1,14 @@
1
+ LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3', ['lwr/loader/v/0_12_0-alpha_3', 'lwr/preInit/v/0_12_0-alpha_3', 'lwr/init/v/0_12_0-alpha_3'], (function (_0_12_0Alpha_3$2, _0_12_0Alpha_3, _0_12_0Alpha_3$1) { 'use strict';
2
+
3
+ const clientBootstrapConfig = _0_12_0Alpha_3.getClientBootstrapConfig();
4
+
5
+ // initialize additional non-configured root components
6
+ const { rootComponents, serverData } = clientBootstrapConfig;
7
+ Promise.all(rootComponents.map(async (rootSpecifier) => {
8
+ const element = _0_12_0Alpha_3$1.toKebabCase(rootSpecifier);
9
+ return _0_12_0Alpha_3$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_3').then(({default: Ctor}) => {
10
+ _0_12_0Alpha_3$1.init([[element, Ctor]], serverData);
11
+ });
12
+ }));
13
+
14
+ }));
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/5_2_1', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (C) 2023 salesforce.com, inc.
@@ -316,9 +316,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
316
316
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
317
317
  */
318
318
  // Increment whenever the LWC template compiler changes
319
- const LWC_VERSION = "5.1.0";
319
+ const LWC_VERSION = "5.2.1";
320
320
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
321
- /** version: 5.1.0 */
321
+ /** version: 5.2.1 */
322
322
 
323
323
  /**
324
324
  * Copyright (C) 2023 salesforce.com, inc.
@@ -340,7 +340,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
340
340
  ENABLE_WIRE_SYNC_EMIT: null,
341
341
  DISABLE_LIGHT_DOM_UNSCOPED_CSS: null,
342
342
  ENABLE_FROZEN_TEMPLATE: null,
343
- ENABLE_LEGACY_SCOPE_TOKENS: null
343
+ ENABLE_LEGACY_SCOPE_TOKENS: null,
344
+ ENABLE_FORCE_SHADOW_MIGRATE_MODE: null
344
345
  };
345
346
  // eslint-disable-next-line no-restricted-properties
346
347
  if (!_globalThis.lwcRuntimeFlags) {
@@ -397,7 +398,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
397
398
  setFeatureFlag(name, value);
398
399
  }
399
400
  }
400
- /** version: 5.1.0 */
401
+ /** version: 5.2.1 */
401
402
 
402
403
  /**
403
404
  * Copyright (C) 2023 salesforce.com, inc.
@@ -439,7 +440,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
439
440
  }
440
441
  onReportingEnabledCallbacks.length = 0; // clear the array
441
442
  },
442
-
443
443
  /**
444
444
  * Detach the current reporting control (aka dispatcher).
445
445
  */
@@ -617,7 +617,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
617
617
  } else if (reactiveObservers[0] === ro) {
618
618
  return; // perf optimization considering that most subscriptions will come from the same record
619
619
  }
620
-
621
620
  if (ArrayIndexOf.call(reactiveObservers, ro) === -1) {
622
621
  ro.link(reactiveObservers);
623
622
  }
@@ -1296,7 +1295,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1296
1295
  if (!isExtensible(shadowTarget)) {
1297
1296
  return false; // was already locked down
1298
1297
  }
1299
-
1300
1298
  if (!isExtensible(originalTarget)) {
1301
1299
  this.lockShadowTarget(shadowTarget);
1302
1300
  return false;
@@ -1507,7 +1505,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1507
1505
  valueMutated(originalTarget, key);
1508
1506
  return true;
1509
1507
  }
1510
- /*LWC compiler v5.1.0*/
1508
+ /*LWC compiler v5.2.1*/
1511
1509
  }
1512
1510
  const getterMap = new WeakMap();
1513
1511
  const setterMap = new WeakMap();
@@ -1600,7 +1598,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1600
1598
  /* istanbul ignore next */
1601
1599
  return false;
1602
1600
  }
1603
- /*LWC compiler v5.1.0*/
1601
+ /*LWC compiler v5.2.1*/
1604
1602
  }
1605
1603
  function extract(objectOrArray) {
1606
1604
  if (isArray(objectOrArray)) {
@@ -1808,6 +1806,77 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1808
1806
  }
1809
1807
  }
1810
1808
 
1809
+ /*
1810
+ * Copyright (c) 2023, salesforce.com, inc.
1811
+ * All rights reserved.
1812
+ * SPDX-License-Identifier: MIT
1813
+ * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
1814
+ */
1815
+ let globalStylesheet;
1816
+ function isStyleElement(elm) {
1817
+ return elm.tagName === 'STYLE';
1818
+ }
1819
+ async function fetchStylesheet(elm) {
1820
+ if (isStyleElement(elm)) {
1821
+ return elm.textContent;
1822
+ } else {
1823
+ // <link>
1824
+ const {
1825
+ href
1826
+ } = elm;
1827
+ try {
1828
+ return await (await fetch(href)).text();
1829
+ } catch (err) {
1830
+ logWarnOnce(`Ignoring cross-origin stylesheet in migrate mode: ${href}`);
1831
+ // ignore errors with cross-origin stylesheets - nothing we can do for those
1832
+ return '';
1833
+ }
1834
+ }
1835
+ }
1836
+ function initGlobalStylesheet() {
1837
+ const stylesheet = new CSSStyleSheet();
1838
+ const elmsToPromises = new Map();
1839
+ let lastSeenLength = 0;
1840
+ const copyToGlobalStylesheet = () => {
1841
+ const elms = document.head.querySelectorAll('style:not([data-rendered-by-lwc]),link[rel="stylesheet"]');
1842
+ if (elms.length === lastSeenLength) {
1843
+ return; // nothing to update
1844
+ }
1845
+ lastSeenLength = elms.length;
1846
+ const promises = [...elms].map(elm => {
1847
+ let promise = elmsToPromises.get(elm);
1848
+ if (!promise) {
1849
+ // Cache the promise
1850
+ promise = fetchStylesheet(elm);
1851
+ elmsToPromises.set(elm, promise);
1852
+ }
1853
+ return promise;
1854
+ });
1855
+ Promise.all(promises).then(stylesheetTexts => {
1856
+ // When replaceSync() is called, the entire contents of the constructable stylesheet are replaced
1857
+ // with the copied+concatenated styles. This means that any shadow root's adoptedStyleSheets that
1858
+ // contains this constructable stylesheet will immediately get the new styles.
1859
+ stylesheet.replaceSync(stylesheetTexts.join('\n'));
1860
+ });
1861
+ };
1862
+ const headObserver = new MutationObserver(copyToGlobalStylesheet);
1863
+ // By observing only the childList, note that we are not covering the case where someone changes an `href`
1864
+ // on an existing <link>`, or the textContent on an existing `<style>`. This is assumed to be an uncommon
1865
+ // case and not worth covering.
1866
+ headObserver.observe(document.head, {
1867
+ childList: true
1868
+ });
1869
+ copyToGlobalStylesheet();
1870
+ return stylesheet;
1871
+ }
1872
+ function applyShadowMigrateMode(shadowRoot) {
1873
+ if (!globalStylesheet) {
1874
+ globalStylesheet = initGlobalStylesheet();
1875
+ }
1876
+ shadowRoot.synthetic = true; // pretend to be synthetic mode
1877
+ shadowRoot.adoptedStyleSheets.push(globalStylesheet);
1878
+ }
1879
+
1811
1880
  /*
1812
1881
  * Copyright (c) 2018, salesforce.com, inc.
1813
1882
  * All rights reserved.
@@ -1960,6 +2029,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
1960
2029
  if (process.env.NODE_ENV !== 'production') {
1961
2030
  patchShadowRootWithRestrictions(shadowRoot);
1962
2031
  }
2032
+ if (lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE && vm.shadowMigrateMode) {
2033
+ applyShadowMigrateMode(shadowRoot);
2034
+ }
1963
2035
  return shadowRoot;
1964
2036
  }
1965
2037
  function warnIfInvokedDuringConstruction(vm, methodOrPropName) {
@@ -2473,7 +2545,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
2473
2545
  if (isUndefined$1(adapterContextToken)) {
2474
2546
  return; // no provider found, nothing to be done
2475
2547
  }
2476
-
2477
2548
  const {
2478
2549
  elm,
2479
2550
  context: {
@@ -2907,7 +2978,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
2907
2978
  return "field" /* DescriptorType.Field */;
2908
2979
  }
2909
2980
  }
2910
-
2911
2981
  function validateObservedField(Ctor, fieldName, descriptor) {
2912
2982
  assertNotProd(); // this method should never leak to prod
2913
2983
  if (!isUndefined$1(descriptor)) {
@@ -3277,7 +3347,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3277
3347
  }
3278
3348
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3279
3349
  const HTMLBridgeElement = class extends SuperClass {
3280
- /*LWC compiler v5.1.0*/
3350
+ /*LWC compiler v5.2.1*/
3281
3351
  };
3282
3352
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3283
3353
  // and false positives in case of inheritance.
@@ -3438,7 +3508,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3438
3508
  }
3439
3509
  });
3440
3510
  }
3441
-
3442
3511
  _getWeakRefs(key) {
3443
3512
  let weakRefs = this._map.get(key);
3444
3513
  if (isUndefined$1(weakRefs)) {
@@ -3737,7 +3806,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3737
3806
  if (!isUndefined$1(ctorRenderMode)) {
3738
3807
  renderMode = ctorRenderMode === 'light' ? 0 /* RenderMode.Light */ : 1 /* RenderMode.Shadow */;
3739
3808
  }
3740
-
3741
3809
  let formAssociated = superDef.formAssociated;
3742
3810
  if (!isUndefined$1(ctorFormAssociated)) {
3743
3811
  formAssociated = ctorFormAssociated;
@@ -3870,7 +3938,9 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3870
3938
  // avoid leaking the reference to the public props descriptors
3871
3939
  publicProps[key] = {
3872
3940
  config: propsConfig[key] || 0,
3941
+ // a property by default
3873
3942
  type: "any" /* PropDefType.any */,
3943
+ // no type inference for public services
3874
3944
  attr: htmlPropertyToAttribute(key)
3875
3945
  };
3876
3946
  }
@@ -3900,6 +3970,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
3900
3970
  function createInlineStyleVNode(content) {
3901
3971
  return api.h('style', {
3902
3972
  key: 'style',
3973
+ // special key
3903
3974
  attrs: {
3904
3975
  type: 'text/css'
3905
3976
  }
@@ -4022,7 +4093,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
4022
4093
  }
4023
4094
  useNativeDirPseudoclass = isNull(root) || root.shadowMode === 0 /* ShadowMode.Native */;
4024
4095
  }
4025
-
4026
4096
  ArrayPush$1.call(content, stylesheet(scopeToken, useActualHostSelector, useNativeDirPseudoclass));
4027
4097
  }
4028
4098
  }
@@ -4141,18 +4211,15 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
4141
4211
  } = vnode;
4142
4212
  return type === 2 /* VNodeType.Element */ || type === 3 /* VNodeType.CustomElement */;
4143
4213
  }
4144
-
4145
4214
  function isSameVnode(vnode1, vnode2) {
4146
4215
  return vnode1.key === vnode2.key && vnode1.sel === vnode2.sel;
4147
4216
  }
4148
4217
  function isVCustomElement(vnode) {
4149
4218
  return vnode.type === 3 /* VNodeType.CustomElement */;
4150
4219
  }
4151
-
4152
4220
  function isVFragment(vnode) {
4153
4221
  return vnode.type === 5 /* VNodeType.Fragment */;
4154
4222
  }
4155
-
4156
4223
  function isVScopedSlotFragment(vnode) {
4157
4224
  return vnode.type === 6 /* VNodeType.ScopedSlotFragment */;
4158
4225
  }
@@ -5614,6 +5681,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
5614
5681
  ctor: Ctor,
5615
5682
  owner: vmBeingRendered,
5616
5683
  mode: 'open',
5684
+ // TODO [#1294]: this should be defined in Ctor
5617
5685
  aChildren,
5618
5686
  vm
5619
5687
  };
@@ -6073,17 +6141,14 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6073
6141
  if (hasStyleToken && hasScopedStyles) {
6074
6142
  cacheKey |= 1 /* FragmentCache.HAS_SCOPED_STYLE */;
6075
6143
  }
6076
-
6077
6144
  if (hasStyleToken && isSyntheticShadow) {
6078
6145
  cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
6079
6146
  }
6080
-
6081
6147
  if (hasLegacyToken) {
6082
6148
  // This isn't strictly required for prod, but it's required for our karma tests
6083
6149
  // since the lwcRuntimeFlag may change over time
6084
6150
  cacheKey |= 4 /* FragmentCache.HAS_LEGACY_SCOPE_TOKEN */;
6085
6151
  }
6086
-
6087
6152
  if (!isUndefined$1(cache[cacheKey])) {
6088
6153
  return cache[cacheKey];
6089
6154
  }
@@ -6297,7 +6362,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6297
6362
  }
6298
6363
  }
6299
6364
  }
6300
-
6301
6365
  function invokeComponentRenderMethod(vm) {
6302
6366
  const {
6303
6367
  def: {
@@ -6424,7 +6488,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6424
6488
  if (!isFunction$1(listener)) {
6425
6489
  throw new TypeError('Expected an EventListener but received ' + typeof listener); // avoiding problems with non-valid listeners
6426
6490
  }
6427
-
6428
6491
  let wrappedListener = cmpEventListenerMap.get(listener);
6429
6492
  if (isUndefined$1(wrappedListener)) {
6430
6493
  wrappedListener = function (event) {
@@ -6561,6 +6624,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6561
6624
  // Properties set right after VM creation.
6562
6625
  tro: null,
6563
6626
  shadowMode: null,
6627
+ shadowMigrateMode: false,
6564
6628
  stylesheets: null,
6565
6629
  // Properties set by the LightningElement constructor.
6566
6630
  component: null,
@@ -6576,8 +6640,21 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6576
6640
  vm.debugInfo = create(null);
6577
6641
  }
6578
6642
  vm.stylesheets = computeStylesheets(vm, def.ctor);
6579
- vm.shadowMode = computeShadowMode(def, vm.owner, renderer);
6643
+ const computedShadowMode = computeShadowMode(def, vm.owner, renderer);
6644
+ if (lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE) {
6645
+ vm.shadowMode = 0 /* ShadowMode.Native */;
6646
+ vm.shadowMigrateMode = computedShadowMode === 1 /* ShadowMode.Synthetic */;
6647
+ } else {
6648
+ vm.shadowMode = computedShadowMode;
6649
+ }
6580
6650
  vm.tro = getTemplateReactiveObserver(vm);
6651
+ // We don't need to report the shadow mode if we're rendering in light DOM
6652
+ if (isReportingEnabled() && vm.renderMode === 1 /* RenderMode.Shadow */) {
6653
+ report("ShadowModeUsage" /* ReportingEventId.ShadowModeUsage */, {
6654
+ tagName: vm.tagName,
6655
+ mode: vm.shadowMode
6656
+ });
6657
+ }
6581
6658
  if (process.env.NODE_ENV !== 'production') {
6582
6659
  vm.toString = () => {
6583
6660
  return `[object:vm ${def.name} (${vm.idx})]`;
@@ -6663,12 +6740,12 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6663
6740
  if (process.env.NODE_ENV !== 'production' && lwcRuntimeFlags.ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST) {
6664
6741
  return 0 /* ShadowMode.Native */;
6665
6742
  }
6666
-
6667
6743
  const {
6668
6744
  isSyntheticShadowDefined
6669
6745
  } = renderer;
6670
6746
  let shadowMode;
6671
- if (isSyntheticShadowDefined) {
6747
+ // If ENABLE_FORCE_SHADOW_MIGRATE_MODE is true, then ShadowMode.Synthetic here will mean "force-migrate" mode.
6748
+ if (isSyntheticShadowDefined || lwcRuntimeFlags.ENABLE_FORCE_SHADOW_MIGRATE_MODE) {
6672
6749
  if (def.renderMode === 0 /* RenderMode.Light */) {
6673
6750
  // ShadowMode.Native implies "not synthetic shadow" which is consistent with how
6674
6751
  // everything defaults to native when the synthetic shadow polyfill is unavailable.
@@ -6695,7 +6772,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6695
6772
  // Native if the synthetic shadow polyfill is unavailable.
6696
6773
  shadowMode = 0 /* ShadowMode.Native */;
6697
6774
  }
6698
-
6699
6775
  return shadowMode;
6700
6776
  }
6701
6777
  function assertIsVM(obj) {
@@ -6801,10 +6877,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6801
6877
  throw error; // eslint-disable-line no-unsafe-finally
6802
6878
  }
6803
6879
  }
6804
-
6805
6880
  logGlobalOperationEnd(8 /* OperationId.GlobalRehydrate */);
6806
6881
  }
6807
-
6808
6882
  function runConnectedCallback(vm) {
6809
6883
  const {
6810
6884
  state
@@ -6812,7 +6886,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6812
6886
  if (state === 1 /* VMState.connected */) {
6813
6887
  return; // nothing to do since it was already connected
6814
6888
  }
6815
-
6816
6889
  vm.state = 1 /* VMState.connected */;
6817
6890
  if (hasWireAdapters(vm)) {
6818
6891
  connectWireAdapters(vm);
@@ -6996,7 +7069,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
6996
7069
  if (isUndefined$1(errorBoundaryVm)) {
6997
7070
  throw error; // eslint-disable-line no-unsafe-finally
6998
7071
  }
6999
-
7000
7072
  resetComponentRoot(vm); // remove offenders
7001
7073
  logOperationStart(6 /* OperationId.ErrorCallback */, vm);
7002
7074
  // error boundaries must have an ErrorCallback
@@ -7178,7 +7250,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
7178
7250
  if (enabled) {
7179
7251
  return; // don't double-apply the patches
7180
7252
  }
7181
-
7182
7253
  enabled = true;
7183
7254
  const {
7184
7255
  setAttribute
@@ -7279,7 +7350,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
7279
7350
  }
7280
7351
  // If we return undefined, it's because the element was rendered wholly outside a LightningElement
7281
7352
  }
7282
-
7283
7353
  function checkAndReportViolation(elm, prop, isSetter, setValue) {
7284
7354
  const vm = findVM(elm);
7285
7355
  if (process.env.NODE_ENV !== 'production') {
@@ -8163,7 +8233,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8163
8233
  }
8164
8234
  return getReadOnlyProxy(obj);
8165
8235
  }
8166
- /** version: 5.1.0 */
8236
+ /** version: 5.2.1 */
8167
8237
 
8168
8238
  /*
8169
8239
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8270,6 +8340,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8270
8340
  const elm = document.createElement('style');
8271
8341
  elm.type = 'text/css';
8272
8342
  elm.textContent = content;
8343
+ // Add an attribute to distinguish global styles added by LWC as opposed to other frameworks/libraries on the page
8344
+ elm.setAttribute('data-rendered-by-lwc', '');
8273
8345
  return elm;
8274
8346
  }
8275
8347
  function createStyleElement(content, cacheData) {
@@ -8410,9 +8482,8 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8410
8482
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
8411
8483
  }
8412
8484
  }
8413
- /*LWC compiler v5.1.0*/
8485
+ /*LWC compiler v5.2.1*/
8414
8486
  }
8415
-
8416
8487
  UpgradableConstructor.formAssociated = true;
8417
8488
  // Do not unnecessarily add a connectedCallback/disconnectedCallback/etc., as it introduces perf overhead
8418
8489
  // See: https://github.com/salesforce/lwc/pull/3162#issuecomment-1311851174
@@ -8507,7 +8578,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8507
8578
  function isNull(obj) {
8508
8579
  return obj === null;
8509
8580
  }
8510
- /** version: 5.1.0 */
8581
+ /** version: 5.2.1 */
8511
8582
 
8512
8583
  /*
8513
8584
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8527,7 +8598,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8527
8598
  this.setNewContext = setNewContext;
8528
8599
  this.setDisconnectedCallback = setDisconnectedCallback;
8529
8600
  }
8530
- /*LWC compiler v5.1.0*/
8601
+ /*LWC compiler v5.2.1*/
8531
8602
  }
8532
8603
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
8533
8604
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -8907,7 +8978,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8907
8978
  attributeChangedCallback(name, oldValue, newValue) {
8908
8979
  attributeChangedCallback.call(this, name, oldValue, newValue);
8909
8980
  }
8910
- /*LWC compiler v5.1.0*/
8981
+ /*LWC compiler v5.2.1*/
8911
8982
  }, _a.observedAttributes = observedAttributes, _a;
8912
8983
  }
8913
8984
 
@@ -8932,7 +9003,6 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
8932
9003
  }
8933
9004
  return node; // for convenience
8934
9005
  }
8935
-
8936
9006
  if (!lwcRuntimeFlags.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE) {
8937
9007
  // Monkey patching Node methods to be able to detect the insertions and removal of root elements
8938
9008
  // created via createElement.
@@ -9111,7 +9181,7 @@ LWR.define('lwc/v/5_1_0', ['exports'], (function (exports) { 'use strict';
9111
9181
  });
9112
9182
  });
9113
9183
  }
9114
- /** version: 5.1.0 */
9184
+ /** version: 5.2.1 */
9115
9185
 
9116
9186
  exports.LightningElement = LightningElement;
9117
9187
  exports.__unstable__ProfilerControl = profilerControl;
@@ -1,10 +1,10 @@
1
- LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_1', ['exports', 'lwr/vault/v/0_12_0-alpha_1'], (function (exports, _0_12_0Alpha_1) { 'use strict';
1
+ LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_3', ['exports', 'lwr/vault/v/0_12_0-alpha_3'], (function (exports, _0_12_0Alpha_3) { '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 = _0_12_0Alpha_1.getAuthInfo();
7
+ const authInfo = _0_12_0Alpha_3.getAuthInfo();
8
8
  if (authInfo) {
9
9
  return fetch(url, {
10
10
  headers: {
@@ -40,7 +40,6 @@ LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_1', ['exports', 'lwr/vault/v/0_12_0
40
40
  }
41
41
  });
42
42
  }
43
-
44
43
  function initAmd(services, mappingEndpoint, coreVersion) {
45
44
  // Initialize the loader hooks for LWR-S endpoints
46
45
  if (mappingEndpoint.match(/\/v5\d\.0\//)) {
@@ -54,7 +53,7 @@ LWR.define('lwr/everywhereAmd/v/0_12_0-alpha_1', ['exports', 'lwr/vault/v/0_12_0
54
53
  function authenticate(authInfo) {
55
54
  // Put OAuth info into the vault
56
55
  if (authInfo) {
57
- _0_12_0Alpha_1.setAuthInfo(authInfo);
56
+ _0_12_0Alpha_3.setAuthInfo(authInfo);
58
57
  }
59
58
  }
60
59
 
@@ -1,16 +1,16 @@
1
- LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_1', 'lwr/profiler/v/0_12_0-alpha_1', 'lwc/v/5_1_0'], (function (exports, _0_12_0Alpha_1$1, _0_12_0Alpha_1, _5_1_0) { 'use strict';
1
+ LWR.define('lwr/init/v/0_12_0-alpha_3', ['exports', 'lwr/metrics/v/0_12_0-alpha_3', 'lwr/profiler/v/0_12_0-alpha_3', 'lwc/v/5_2_1'], (function (exports, _0_12_0Alpha_3$1, _0_12_0Alpha_3, _5_2_1) { 'use strict';
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
4
 
5
5
  // <hydrateComponentProxy> - This code is removed in core
6
6
 
7
7
  function hydrateComponentProxy(customElement, Ctor, props) {
8
- _5_1_0.hydrateComponent(customElement, Ctor, props);
8
+ _5_2_1.hydrateComponent(customElement, Ctor, props);
9
9
  }
10
10
  // </hydrateComponentProxy>
11
11
 
12
12
  function initializeWebComponent(elementName, Ctor) {
13
- return _5_1_0.createElement(elementName, {
13
+ return _5_2_1.createElement(elementName, {
14
14
  is: Ctor
15
15
  });
16
16
  }
@@ -47,13 +47,13 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
47
47
  */
48
48
  function init(rootModules, serverData = {}) {
49
49
  if (typeof customElements === 'undefined' || typeof document === 'undefined') {
50
- _0_12_0Alpha_1.logOperationStart({
51
- id: _0_12_0Alpha_1$1.BOOTSTRAP_END
50
+ _0_12_0Alpha_3.logOperationStart({
51
+ id: _0_12_0Alpha_3$1.BOOTSTRAP_END
52
52
  });
53
53
  return;
54
54
  }
55
- _0_12_0Alpha_1.logOperationStart({
56
- id: _0_12_0Alpha_1$1.INIT
55
+ _0_12_0Alpha_3.logOperationStart({
56
+ id: _0_12_0Alpha_3$1.INIT
57
57
  });
58
58
  let index = 0;
59
59
  for (const [specifier, ctor] of rootModules) {
@@ -61,8 +61,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
61
61
 
62
62
  // initialize and inject the root module into the LWR Root or DOM if it is missing
63
63
  if (!document.body.querySelector(elementName)) {
64
- _0_12_0Alpha_1.logOperationStart({
65
- id: _0_12_0Alpha_1$1.INIT_MODULE,
64
+ _0_12_0Alpha_3.logOperationStart({
65
+ id: _0_12_0Alpha_3$1.INIT_MODULE,
66
66
  specifier,
67
67
  specifierIndex: ++index
68
68
  });
@@ -71,8 +71,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
71
71
  const component = initializeWebComponent(elementName, ctor);
72
72
  const container = document.querySelector('[lwr-root]');
73
73
  container ? container.appendChild(component) : document.body.appendChild(component);
74
- _0_12_0Alpha_1.logOperationEnd({
75
- id: _0_12_0Alpha_1$1.INIT_MODULE,
74
+ _0_12_0Alpha_3.logOperationEnd({
75
+ id: _0_12_0Alpha_3$1.INIT_MODULE,
76
76
  specifier,
77
77
  specifierIndex: index,
78
78
  metadata: {
@@ -85,8 +85,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
85
85
  // the page has been rendered or SSR'd, and each component needs to initialized(or hydrated)
86
86
  const elements = document.querySelectorAll(elementName);
87
87
  for (const element of elements) {
88
- _0_12_0Alpha_1.logOperationStart({
89
- id: _0_12_0Alpha_1$1.INIT_MODULE,
88
+ _0_12_0Alpha_3.logOperationStart({
89
+ id: _0_12_0Alpha_3$1.INIT_MODULE,
90
90
  specifier,
91
91
  specifierIndex: ++index
92
92
  });
@@ -97,8 +97,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
97
97
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
98
98
  // @ts-ignore
99
99
  hydrateComponentProxy(element, ctor, serverData[propsId] || {});
100
- _0_12_0Alpha_1.logOperationEnd({
101
- id: _0_12_0Alpha_1$1.INIT_MODULE,
100
+ _0_12_0Alpha_3.logOperationEnd({
101
+ id: _0_12_0Alpha_3$1.INIT_MODULE,
102
102
  specifier,
103
103
  specifierIndex: index,
104
104
  metadata: {
@@ -136,8 +136,8 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
136
136
  if (parent) {
137
137
  parent.replaceChild(component, element);
138
138
  }
139
- _0_12_0Alpha_1.logOperationEnd({
140
- id: _0_12_0Alpha_1$1.INIT_MODULE,
139
+ _0_12_0Alpha_3.logOperationEnd({
140
+ id: _0_12_0Alpha_3$1.INIT_MODULE,
141
141
  specifier,
142
142
  specifierIndex: index,
143
143
  metadata: {
@@ -146,11 +146,11 @@ LWR.define('lwr/init/v/0_12_0-alpha_1', ['exports', 'lwr/metrics/v/0_12_0-alpha_
146
146
  });
147
147
  }
148
148
  }
149
- _0_12_0Alpha_1.logOperationEnd({
150
- id: _0_12_0Alpha_1$1.INIT
149
+ _0_12_0Alpha_3.logOperationEnd({
150
+ id: _0_12_0Alpha_3$1.INIT
151
151
  });
152
- _0_12_0Alpha_1.logOperationStart({
153
- id: _0_12_0Alpha_1$1.BOOTSTRAP_END
152
+ _0_12_0Alpha_3.logOperationStart({
153
+ id: _0_12_0Alpha_3$1.BOOTSTRAP_END
154
154
  });
155
155
  }
156
156