@lwrjs/everywhere 0.12.0-alpha.22 → 0.12.0-alpha.24

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.
Files changed (22) hide show
  1. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/7c3f260b17cfe185b1f9c047326a6923/config.js +7 -0
  2. 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_24/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +14 -0
  3. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwc/v/{6_2_1/s/2670f5386c68fa67ae710174187505e9 → 6_3_1/s/62e57444bb0d15355b145ddacc9d7286}/lwc.js +127 -139
  4. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/everywhereAmd/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js +3 -3
  5. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/init/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js +21 -21
  6. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/metrics/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/274c8343f810353bbad085a79709395f/lwr_metrics.js +1 -1
  7. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/preInit/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js +1 -1
  8. package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/vault/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js +1 -1
  9. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-error-shim.js/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/lwr-error-shim.js +1 -1
  10. package/build/__generated_site_amd_modules__/1/resource/amd/lwr-loader-shim.bundle.js/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/lwr-loader-shim.bundle.js +6 -6
  11. package/build/assets/amd/lwr-everywhere-debug.js +8 -8
  12. package/build/assets/amd/lwr-everywhere-min.js +2 -2
  13. package/build/assets/amd/lwr-everywhere.js +8 -8
  14. package/build/assets/core/lwr-everywhere-debug.js +4 -4
  15. package/build/assets/core/lwr-everywhere.js +4 -4
  16. package/build/assets/esm/lwr-everywhere-debug.js +1 -1
  17. package/build/assets/esm/lwr-everywhere-min.js +1 -1
  18. package/build/assets/esm/lwr-everywhere.js +1 -1
  19. package/package.json +6 -6
  20. package/build/__generated_site_amd_modules__/1/application/amd/l/en-US/ai/amd-bootstrap/configuration/ci/-/-/s/d57750f23bab0eda6f7134272c0014e3/config.js +0 -7
  21. 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_22/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js +0 -14
  22. /package/build/__generated_site_amd_modules__/1/module/amd/1/l/en-US/mi/lwr/profiler/v/{0_12_0-alpha_22 → 0_12_0-alpha_24}/s/a152b8d35f12ca1b5147c5cd1ee155fb/lwr_profiler.js +0 -0
@@ -0,0 +1,7 @@
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_24","autoBoot":true,"imports":{"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_24/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_24"],"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_24/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js":["lwr/preInit/v/0_12_0-alpha_24"],"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_24/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js":["lwr/init/v/0_12_0-alpha_24"],"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_24/s/274c8343f810353bbad085a79709395f/lwr_metrics.js":["lwr/metrics/v/0_12_0-alpha_24"],"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F6_3_1/s/62e57444bb0d15355b145ddacc9d7286/lwc.js":["lwc/v/6_3_1"],"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_24/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js":["lwr/everywhereAmd/v/0_12_0-alpha_24"],"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_24/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js":["lwr/vault/v/0_12_0-alpha_24"]},"index":{"@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/%40lwrjs%2Fapp-service%2Famd-bootstrap%2Fmodule%2Famd%2Fv%2F0_12_0-alpha_24/s/8bce578258518655194bd71d1d72aad5/@lwrjs_app-service_amd-bootstrap_module_amd.js","lwr/preInit/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/lwr%2FpreInit%2Fv%2F0_12_0-alpha_24/s/ec0fad0e38a96bb0b88c9f4553460347/lwr_preInit.js","lwr/init/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/lwr%2Finit%2Fv%2F0_12_0-alpha_24/s/f30361ad8ff7af505bf4d465c8499181/lwr_init.js","lwr/metrics/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/lwr%2Fmetrics%2Fv%2F0_12_0-alpha_24/s/274c8343f810353bbad085a79709395f/lwr_metrics.js","lwc/v/6_3_1":"/1/module/amd/1/l/en-US/mi/lwc%2Fv%2F6_3_1/s/62e57444bb0d15355b145ddacc9d7286/lwc.js","lwr/everywhereAmd/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/lwr%2FeverywhereAmd%2Fv%2F0_12_0-alpha_24/s/cb931ebef2b89dcf8ab51456e3a68864/lwr_everywhereAmd.js","lwr/vault/v/0_12_0-alpha_24":"/1/module/amd/1/l/en-US/mi/lwr%2Fvault%2Fv%2F0_12_0-alpha_24/s/c92abd8c1fec2d7eff62e4b097abbe14/lwr_vault.js"},"rootComponents":["lwr/everywhereAmd/v/0_12_0-alpha_24"],"serverData":{},"requiredModules":["@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_24"],"preloadModules":["lwr/preInit/v/0_12_0-alpha_24","lwr/init/v/0_12_0-alpha_24","lwr/metrics/v/0_12_0-alpha_24","lwc/v/6_3_1","lwr/everywhereAmd/v/0_12_0-alpha_24"],"endpoints":{"uris":{"mapping":"/1/mapping/amd/1/l/en-US/mp/"}}});
5
+ globalThis.LWR = {...globalThis.LWR, env: {"SSR":false,"basePath":"","locale":"en-US","assetBasePath":"","uiBasePath":""}};
6
+ globalThis.process={...globalThis.process,env:{...globalThis.process?.env,...{"NODE_ENV":"compat"}}};
7
+ globalThis.lwcRuntimeFlags = { ENABLE_MIXED_SHADOW_MODE: false };
@@ -0,0 +1,14 @@
1
+ LWR.define('@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_24', ['lwr/loader/v/0_12_0-alpha_24', 'lwr/preInit/v/0_12_0-alpha_24', 'lwr/init/v/0_12_0-alpha_24'], (function (_0_12_0Alpha_24$2, _0_12_0Alpha_24, _0_12_0Alpha_24$1) { 'use strict';
2
+
3
+ const clientBootstrapConfig = _0_12_0Alpha_24.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_24$1.toKebabCase(rootSpecifier);
9
+ return _0_12_0Alpha_24$2.load(rootSpecifier, '@lwrjs/app-service/amd-bootstrap/module/amd/v/0_12_0-alpha_24').then(({default: Ctor}) => {
10
+ _0_12_0Alpha_24$1.init([[element, Ctor]], serverData);
11
+ });
12
+ }));
13
+
14
+ }));
@@ -1,4 +1,4 @@
1
- LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1
+ LWR.define('lwc/v/6_3_1', ['exports'], (function (exports) { 'use strict';
2
2
 
3
3
  /**
4
4
  * Copyright (c) 2024 Salesforce, Inc.
@@ -309,6 +309,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
309
309
  return apiVersion >= 60 /* APIVersion.V60_248_SPRING_24 */;
310
310
  case 6 /* APIFeature.USE_LIGHT_DOM_SLOT_FORWARDING */:
311
311
  case 7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */:
312
+ case 8 /* APIFeature.ENABLE_ELEMENT_INTERNALS */:
312
313
  return apiVersion >= 61 /* APIVersion.V61_250_SUMMER_24 */;
313
314
  }
314
315
  }
@@ -439,9 +440,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
439
440
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
440
441
  */
441
442
  // Increment whenever the LWC template compiler changes
442
- const LWC_VERSION = "6.2.1";
443
+ const LWC_VERSION = "6.3.1";
443
444
  const LWC_VERSION_COMMENT_REGEX = /\/\*LWC compiler v([\d.]+)\*\/\s*}/;
444
- /** version: 6.2.1 */
445
+ /** version: 6.3.1 */
445
446
 
446
447
  /**
447
448
  * Copyright (c) 2024 Salesforce, Inc.
@@ -455,6 +456,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
455
456
  */
456
457
  // When deprecating a feature flag, ensure that it is also no longer set in the application. For
457
458
  // example, in core, the flag should be removed from LwcPermAndPrefUtilImpl.java
459
+ /** List of all feature flags available, with the default value `null`. */
458
460
  const features = {
459
461
  PLACEHOLDER_TEST_FLAG: null,
460
462
  ENABLE_FORCE_NATIVE_SHADOW_MODE_FOR_TEST: null,
@@ -472,6 +474,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
472
474
  value: create(null)
473
475
  });
474
476
  }
477
+ /** Feature flags that have been set. */
475
478
  const flags = globalThis.lwcRuntimeFlags;
476
479
  /**
477
480
  * Set the value at runtime of a given feature flag. This method only be invoked once per feature
@@ -527,7 +530,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
527
530
  setFeatureFlag(name, value);
528
531
  }
529
532
  }
530
- /** version: 6.2.1 */
533
+ /** version: 6.3.1 */
531
534
 
532
535
  /**
533
536
  * Copyright (c) 2024 Salesforce, Inc.
@@ -655,7 +658,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
655
658
  }
656
659
 
657
660
  /*
658
- * Copyright (c) 2018, salesforce.com, inc.
661
+ * Copyright (c) 2024, Salesforce, Inc.
659
662
  * All rights reserved.
660
663
  * SPDX-License-Identifier: MIT
661
664
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
@@ -663,7 +666,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
663
666
  const alreadyLoggedMessages = new Set();
664
667
  // Only used in LWC's Karma tests
665
668
  if (process.env.NODE_ENV === 'test-karma-lwc') {
666
- // @ts-ignore
667
669
  window.__lwcResetAlreadyLoggedMessages = () => {
668
670
  alreadyLoggedMessages.clear();
669
671
  };
@@ -1295,7 +1297,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1295
1297
  logError('The `addEventListener` method on ShadowRoot does not support any options.', getAssociatedVMIfPresent(this));
1296
1298
  }
1297
1299
  // Typescript does not like it when you treat the `arguments` object as an array
1298
- // @ts-ignore type-mismatch
1300
+ // @ts-expect-error type-mismatch
1299
1301
  return originalAddEventListener.apply(this, arguments);
1300
1302
  }
1301
1303
  })
@@ -1344,7 +1346,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1344
1346
  logError('The `addEventListener` method in `LightningElement` does not support any options.', getAssociatedVMIfPresent(this));
1345
1347
  }
1346
1348
  // Typescript does not like it when you treat the `arguments` object as an array
1347
- // @ts-ignore type-mismatch
1349
+ // @ts-expect-error type-mismatch
1348
1350
  return originalAddEventListener.apply(this, arguments);
1349
1351
  }
1350
1352
  })
@@ -1736,7 +1738,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1736
1738
  valueMutated(originalTarget, key);
1737
1739
  return true;
1738
1740
  }
1739
- /*LWC compiler v6.2.1*/
1741
+ /*LWC compiler v6.3.1*/
1740
1742
  }
1741
1743
  const getterMap = new WeakMap();
1742
1744
  const setterMap = new WeakMap();
@@ -1829,7 +1831,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
1829
1831
  /* istanbul ignore next */
1830
1832
  return false;
1831
1833
  }
1832
- /*LWC compiler v6.2.1*/
1834
+ /*LWC compiler v6.3.1*/
1833
1835
  }
1834
1836
  function extract(objectOrArray) {
1835
1837
  if (isArray(objectOrArray)) {
@@ -2186,7 +2188,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2186
2188
  * This class is the base class for any LWC element.
2187
2189
  * Some elements directly extends this class, others implement it via inheritance.
2188
2190
  */
2189
- // @ts-ignore
2191
+ // @ts-expect-error When exported, it will conform, but we need to build it first!
2190
2192
  const LightningElement = function () {
2191
2193
  // This should be as performant as possible, while any initialization should be done lazily
2192
2194
  if (isNull(vmBeingConstructed)) {
@@ -2273,69 +2275,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2273
2275
  logError(`this.${methodOrPropName} should not be called during the construction of the custom element for ${getComponentTag(vm)} because the element is not yet in the DOM or has no children yet.`);
2274
2276
  }
2275
2277
  }
2276
- // List of properties on ElementInternals that are formAssociated can be found in the spec:
2277
- // https://html.spec.whatwg.org/multipage/custom-elements.html#form-associated-custom-elements
2278
- const formAssociatedProps = new Set(['setFormValue', 'form', 'setValidity', 'willValidate', 'validity', 'validationMessage', 'checkValidity', 'reportValidity', 'labels']);
2279
- // Verify that access to a form-associated property of the ElementInternals proxy has formAssociated set in the LWC.
2280
- function verifyPropForFormAssociation(propertyKey, isFormAssociated) {
2281
- if (isString(propertyKey) && formAssociatedProps.has(propertyKey) && !isFormAssociated) {
2282
- //Note this error message mirrors Chrome and Firefox error messages, in Safari the error is slightly different.
2283
- throw new DOMException(`Failed to execute '${propertyKey}' on 'ElementInternals': The target element is not a form-associated custom element.`);
2284
- }
2285
- }
2286
- const elementInternalsAccessorAllowList = new Set(['shadowRoot', 'role', ...formAssociatedProps]);
2287
- // Prevent access to properties not defined in the HTML spec in case browsers decide to
2288
- // provide new APIs that provide access to form associated properties.
2289
- // This can be removed along with UpgradeableConstructor.
2290
- function isAllowedElementInternalAccessor(propertyKey) {
2291
- let isAllowedAccessor = false;
2292
- // As of this writing all ElementInternal property keys as described in the spec are implemented with strings
2293
- // in Chrome, Firefox, and Safari
2294
- if (isString(propertyKey)) {
2295
- // Allow list is based on HTML spec:
2296
- // https://html.spec.whatwg.org/multipage/custom-elements.html#the-elementinternals-interface
2297
- isAllowedAccessor = elementInternalsAccessorAllowList.has(propertyKey) || /^aria/.test(propertyKey);
2298
- if (!isAllowedAccessor && process.env.NODE_ENV !== 'production') {
2299
- logWarn('Only properties defined in the ElementInternals HTML spec are available.');
2300
- }
2301
- }
2302
- return isAllowedAccessor;
2303
- }
2304
- // Wrap all ElementInternal objects in a proxy to prevent form association when `formAssociated` is not set on an LWC.
2305
- // This is needed because the 1UpgradeableConstructor1 always sets `formAssociated=true`, which means all
2306
- // ElementInternal objects will have form-associated properties set when an LWC is placed in a form.
2307
- // We are doing this to guard against customers taking a dependency on form elements being associated to ElementInternals
2308
- // when 'formAssociated' has not been set on the LWC.
2309
- function createElementInternalsProxy(elementInternals, isFormAssociated) {
2310
- const elementInternalsProxy = new Proxy(elementInternals, {
2311
- set(target, propertyKey, newValue) {
2312
- if (isAllowedElementInternalAccessor(propertyKey)) {
2313
- // Verify that formAssociated is set for form associated properties
2314
- verifyPropForFormAssociation(propertyKey, isFormAssociated);
2315
- return Reflect.set(target, propertyKey, newValue);
2316
- }
2317
- // As of this writing ElementInternals do not have non-string properties that can be set.
2318
- return false;
2319
- },
2320
- get(target, propertyKey) {
2321
- if (
2322
- // Pass through Object.prototype methods such as toString()
2323
- hasOwnProperty$1.call(Object.prototype, propertyKey) ||
2324
- // As of this writing, ElementInternals only uses Symbol.toStringTag which is called
2325
- // on Object.hasOwnProperty invocations
2326
- Symbol.for('Symbol.toStringTag') === propertyKey ||
2327
- // ElementInternals allow listed properties
2328
- isAllowedElementInternalAccessor(propertyKey)) {
2329
- // Verify that formAssociated is set for form associated properties
2330
- verifyPropForFormAssociation(propertyKey, isFormAssociated);
2331
- const propertyValue = Reflect.get(target, propertyKey);
2332
- return isFunction$1(propertyValue) ? propertyValue.bind(target) : propertyValue;
2333
- }
2334
- }
2335
- });
2336
- return elementInternalsProxy;
2337
- }
2338
- // @ts-ignore
2278
+ // Type assertion because we need to build the prototype before it satisfies the interface.
2339
2279
  LightningElement.prototype = {
2340
2280
  constructor: LightningElement,
2341
2281
  dispatchEvent(event) {
@@ -2488,19 +2428,18 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2488
2428
  const vm = getAssociatedVM(this);
2489
2429
  const {
2490
2430
  elm,
2491
- def: {
2492
- formAssociated
2493
- },
2431
+ apiVersion,
2494
2432
  renderer: {
2495
2433
  attachInternals
2496
2434
  }
2497
2435
  } = vm;
2436
+ if (!isAPIFeatureEnabled(8 /* APIFeature.ENABLE_ELEMENT_INTERNALS */, apiVersion)) {
2437
+ throw new Error(`The attachInternals API is only supported in API version 61 and above. To use this API please update the LWC component API version.`);
2438
+ }
2498
2439
  if (vm.shadowMode === 1 /* ShadowMode.Synthetic */) {
2499
- throw new Error('attachInternals API is not supported in light DOM or synthetic shadow.');
2440
+ throw new Error('attachInternals API is not supported in synthetic shadow.');
2500
2441
  }
2501
- const internals = attachInternals(elm);
2502
- // #TODO[2970]: remove proxy once `UpgradeableConstructor` has been removed
2503
- return createElementInternalsProxy(internals, Boolean(formAssociated));
2442
+ return attachInternals(elm);
2504
2443
  },
2505
2444
  get isConnected() {
2506
2445
  const vm = getAssociatedVM(this);
@@ -2612,6 +2551,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2612
2551
  if (process.env.NODE_ENV !== 'production') {
2613
2552
  warnIfInvokedDuringConstruction(vm, 'childNodes');
2614
2553
  }
2554
+ // getChildNodes returns a NodeList, which has `item(index: number): Node | null`.
2555
+ // NodeListOf<T> extends NodeList, but claims to not return null. That seems inaccurate,
2556
+ // but these are built-in types, so ultimately not our problem.
2615
2557
  return renderer.getChildNodes(vm.elm);
2616
2558
  },
2617
2559
  get firstChild() {
@@ -2863,7 +2805,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2863
2805
  ro.observe(() => config = configCallback(component));
2864
2806
  // eslint-disable-next-line @lwc/lwc-internal/no-invalid-todo
2865
2807
  // TODO: dev-mode validation of config based on the adapter.configSchema
2866
- // @ts-ignore it is assigned in the observe() callback
2808
+ // @ts-expect-error it is assigned in the observe() callback
2867
2809
  callbackWhenConfigIsReady(config);
2868
2810
  };
2869
2811
  return {
@@ -2947,7 +2889,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
2947
2889
  });
2948
2890
  }
2949
2891
  return {
2950
- // @ts-ignore the boundary protection executes sync, connector is always defined
2892
+ // @ts-expect-error the boundary protection executes sync, connector is always defined
2951
2893
  connector,
2952
2894
  computeConfigAndUpdate,
2953
2895
  resetConfigWatcher: () => ro.reset()
@@ -3448,7 +3390,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3448
3390
  let warned = false;
3449
3391
  // Only used in LWC's Karma tests
3450
3392
  if (process.env.NODE_ENV === 'test-karma-lwc') {
3451
- // @ts-ignore
3452
3393
  window.__lwcResetWarnedOnVersionMismatch = () => {
3453
3394
  warned = false;
3454
3395
  };
@@ -3572,7 +3513,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3572
3513
  if (!isUndefined$1(superAttributeChangedCallback)) {
3573
3514
  // delegate unknown attributes to the super.
3574
3515
  // Typescript does not like it when you treat the `arguments` object as an array
3575
- // @ts-ignore type-mismatch
3516
+ // @ts-expect-error type-mismatch
3576
3517
  superAttributeChangedCallback.apply(this, arguments);
3577
3518
  }
3578
3519
  return;
@@ -3598,7 +3539,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
3598
3539
  }
3599
3540
  function HTMLBridgeElementFactory(SuperClass, publicProperties, methods, observedFields, proto, hasCustomSuperClass) {
3600
3541
  const HTMLBridgeElement = class extends SuperClass {
3601
- /*LWC compiler v6.2.1*/
3542
+ /*LWC compiler v6.3.1*/
3602
3543
  };
3603
3544
  // generating the hash table for attributes to avoid duplicate fields and facilitate validation
3604
3545
  // and false positives in case of inheritance.
@@ -5161,7 +5102,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
5161
5102
  // compatibility, we lower case the tagname here.
5162
5103
  const normalizedTagname = sel.toLowerCase();
5163
5104
  const useNativeLifecycle = shouldUseNativeCustomElementLifecycle(ctor);
5164
- const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle);
5105
+ const isFormAssociated = Boolean(ctor.formAssociated);
5106
+ const elm = createCustomElement(normalizedTagname, upgradeCallback, useNativeLifecycle, isFormAssociated);
5165
5107
  vnode.elm = elm;
5166
5108
  vnode.vm = vm;
5167
5109
  linkNodeToShadow(elm, owner, renderer);
@@ -6471,9 +6413,27 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
6471
6413
  }
6472
6414
  }
6473
6415
  }
6416
+ // This should be a no-op outside of LWC's Karma tests, where it's not needed
6417
+ let registerFragmentCache = noop;
6418
+ // Only used in LWC's Karma tests
6419
+ if (process.env.NODE_ENV === 'test-karma-lwc') {
6420
+ // Keep track of fragmentCaches, so we can clear them in LWC's Karma tests
6421
+ const fragmentCaches = [];
6422
+ registerFragmentCache = fragmentCache => {
6423
+ fragmentCaches.push(fragmentCache);
6424
+ };
6425
+ window.__lwcResetFragmentCaches = () => {
6426
+ for (const fragmentCache of fragmentCaches) {
6427
+ for (const key of keys(fragmentCache)) {
6428
+ delete fragmentCache[key];
6429
+ }
6430
+ }
6431
+ };
6432
+ }
6474
6433
  function buildParseFragmentFn(createFragmentFn) {
6475
6434
  return (strings, ...keys) => {
6476
6435
  const cache = create(null);
6436
+ registerFragmentCache(cache);
6477
6437
  return function () {
6478
6438
  const {
6479
6439
  context: {
@@ -6494,11 +6454,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
6494
6454
  if (hasStyleToken && isSyntheticShadow) {
6495
6455
  cacheKey |= 2 /* FragmentCache.SHADOW_MODE_SYNTHETIC */;
6496
6456
  }
6497
- if (hasLegacyToken) {
6498
- // This isn't strictly required for prod, but it's required for our karma tests
6499
- // since the lwcRuntimeFlag may change over time
6500
- cacheKey |= 4 /* FragmentCache.HAS_LEGACY_SCOPE_TOKEN */;
6501
- }
6502
6457
  if (!isUndefined$1(cache[cacheKey])) {
6503
6458
  return cache[cacheKey];
6504
6459
  }
@@ -7463,18 +7418,8 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
7463
7418
  function runFormAssociatedCustomElementCallback(vm, faceCb) {
7464
7419
  const {
7465
7420
  renderMode,
7466
- shadowMode,
7467
- def: {
7468
- formAssociated
7469
- }
7421
+ shadowMode
7470
7422
  } = vm;
7471
- // Technically the UpgradableConstructor always sets `static formAssociated = true` but silently fail here to match browser behavior.
7472
- if (isUndefined$1(formAssociated) || isFalse(formAssociated)) {
7473
- if (process.env.NODE_ENV !== 'production') {
7474
- logWarn(`Form associated lifecycle methods must have the 'static formAssociated' value set in the component's prototype chain.`);
7475
- }
7476
- return;
7477
- }
7478
7423
  if (shadowMode === 1 /* ShadowMode.Synthetic */ && renderMode !== 0 /* RenderMode.Light */) {
7479
7424
  throw new Error('Form associated lifecycle methods are not available in synthetic shadow. Please use native shadow or light DOM.');
7480
7425
  }
@@ -7750,7 +7695,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
7750
7695
  throw new Error('detect-non-standard-aria.ts loaded before @lwc/aria-reflection');
7751
7696
  }
7752
7697
  }
7753
- // @ts-ignore
7754
7698
  const {
7755
7699
  get,
7756
7700
  set
@@ -8005,7 +7949,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8005
7949
  defineCustomElement,
8006
7950
  getTagName
8007
7951
  } = renderer;
8008
- defineCustomElement(StringToLowerCase.call(getTagName(elm)));
7952
+ defineCustomElement(StringToLowerCase.call(getTagName(elm)), Boolean(ctor.formAssociated));
8009
7953
  const vm = createVM(elm, ctor, renderer, {
8010
7954
  mode,
8011
7955
  owner,
@@ -8421,7 +8365,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8421
8365
  const originalArrayMethod = getOriginalArrayMethod(prop);
8422
8366
  stylesheets[prop] = function arrayMutationWarningWrapper() {
8423
8367
  reportTemplateViolation('stylesheets');
8424
- // @ts-ignore
8368
+ // @ts-expect-error can't properly determine the right `this`
8425
8369
  return originalArrayMethod.apply(this, arguments);
8426
8370
  };
8427
8371
  }
@@ -8603,7 +8547,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8603
8547
  }
8604
8548
  return getReadOnlyProxy(obj);
8605
8549
  }
8606
- /** version: 6.2.1 */
8550
+ /** version: 6.3.1 */
8607
8551
 
8608
8552
  /*
8609
8553
  * Copyright (c) 2018, salesforce.com, inc.
@@ -8700,7 +8644,6 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8700
8644
  //
8701
8645
  // Only used in LWC's Karma tests
8702
8646
  if (process.env.NODE_ENV === 'test-karma-lwc') {
8703
- // @ts-ignore
8704
8647
  window.__lwcResetGlobalStylesheets = () => {
8705
8648
  stylesheetCache.clear();
8706
8649
  };
@@ -8833,11 +8776,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8833
8776
  // Another benefit is that only LWC can create components that actually do anything – if you do
8834
8777
  // `customElements.define('x-foo')`, then you don't have access to the upgradeCallback, so it's a dummy custom element.
8835
8778
  // This class should be created once per tag name.
8836
- const createUpgradableConstructor = () => {
8779
+ const createUpgradableConstructor = isFormAssociated => {
8837
8780
  // TODO [#2972]: this class should expose observedAttributes as necessary
8838
8781
  class UpgradableConstructor extends HTMLElement {
8839
- // TODO [#3983]: Re-enable formAssociated once there is a solution for the observable behavior it introduces.
8840
- // static formAssociated = true;
8841
8782
  constructor(upgradeCallback, useNativeLifecycle) {
8842
8783
  super();
8843
8784
  if (useNativeLifecycle) {
@@ -8854,8 +8795,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8854
8795
  // TODO [#2970]: LWC elements cannot be upgraded via new Ctor()
8855
8796
  // Do we want to support this? Throw an error? Currently for backwards compat it's a no-op.
8856
8797
  }
8857
- /*LWC compiler v6.2.1*/
8798
+ /*LWC compiler v6.3.1*/
8858
8799
  }
8800
+ UpgradableConstructor.formAssociated = isFormAssociated;
8859
8801
  for (const [propName, callback] of entries(LIFECYCLE_CALLBACKS)) {
8860
8802
  UpgradableConstructor.prototype[propName] = function () {
8861
8803
  // If the element is in the WeakMap (i.e. it's marked as native lifecycle), and if it was upgraded by LWC,
@@ -8867,22 +8809,25 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8867
8809
  }
8868
8810
  return UpgradableConstructor;
8869
8811
  };
8870
- function getUpgradableConstructor(tagName) {
8812
+ function getUpgradableConstructor(tagName, isFormAssociated) {
8871
8813
  let UpgradableConstructor = cachedConstructors.get(tagName);
8872
8814
  if (isUndefined$1(UpgradableConstructor)) {
8873
8815
  if (!isUndefined$1(customElements.get(tagName))) {
8874
8816
  throw new Error(`Unexpected tag name "${tagName}". This name is a registered custom element, preventing LWC to upgrade the element.`);
8875
8817
  }
8876
- UpgradableConstructor = createUpgradableConstructor();
8818
+ UpgradableConstructor = createUpgradableConstructor(isFormAssociated);
8877
8819
  customElements.define(tagName, UpgradableConstructor);
8878
8820
  cachedConstructors.set(tagName, UpgradableConstructor);
8879
8821
  }
8880
8822
  return UpgradableConstructor;
8881
8823
  }
8882
- const createCustomElement = (tagName, upgradeCallback, useNativeLifecycle) => {
8883
- const UpgradableConstructor = getUpgradableConstructor(tagName);
8824
+ const createCustomElement = (tagName, upgradeCallback, useNativeLifecycle, isFormAssociated) => {
8825
+ const UpgradableConstructor = getUpgradableConstructor(tagName, isFormAssociated);
8884
8826
  elementBeingUpgradedByLWC = true;
8885
8827
  try {
8828
+ if (UpgradableConstructor.formAssociated !== isFormAssociated) {
8829
+ throw new Error(`<${tagName}> was already registered with formAssociated=${UpgradableConstructor.formAssociated}. It cannot be re-registered with formAssociated=${isFormAssociated}. Please rename your component to have a different name than <${tagName}>`);
8830
+ }
8886
8831
  return new UpgradableConstructor(upgradeCallback, useNativeLifecycle);
8887
8832
  } finally {
8888
8833
  elementBeingUpgradedByLWC = false;
@@ -8899,12 +8844,15 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8899
8844
  * A factory function that produces a renderer.
8900
8845
  * Renderer encapsulates operations that are required to render an LWC component into the underlying
8901
8846
  * runtime environment. In the case of @lwc/enigne-dom, it is meant to be used in a DOM environment.
8902
- * Example usage:
8847
+ * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8848
+ * @returns The created renderer
8849
+ * @example
8903
8850
  * import { renderer, rendererFactory } from 'lwc';
8904
8851
  * const customRenderer = rendererFactory(renderer);
8905
- * @param baseRenderer Either null or the base renderer imported from 'lwc'.
8906
8852
  */
8907
8853
  function rendererFactory(baseRenderer) {
8854
+ // Type assertion because this is replaced by rollup with an object, not a string.
8855
+ // See `injectInlineRenderer` in /scripts/rollup/rollup.config.js
8908
8856
  const renderer = function (exports) {
8909
8857
  /**
8910
8858
  * Copyright (c) 2024 Salesforce, Inc.
@@ -8975,7 +8923,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8975
8923
  function isNull(obj) {
8976
8924
  return obj === null;
8977
8925
  }
8978
- /** version: 6.2.1 */
8926
+ /** version: 6.3.1 */
8979
8927
 
8980
8928
  /*
8981
8929
  * Copyright (c) 2023, salesforce.com, inc.
@@ -8995,7 +8943,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
8995
8943
  this.setNewContext = setNewContext;
8996
8944
  this.setDisconnectedCallback = setDisconnectedCallback;
8997
8945
  }
8998
- /*LWC compiler v6.2.1*/
8946
+ /*LWC compiler v6.3.1*/
8999
8947
  }
9000
8948
  function registerContextConsumer(elm, adapterContextToken, subscriptionPayload) {
9001
8949
  dispatchEvent(elm, new WireContextSubscriptionEvent(adapterContextToken, subscriptionPayload));
@@ -9254,6 +9202,18 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9254
9202
  }
9255
9203
  return vm;
9256
9204
  }
9205
+ /**
9206
+ * Replaces an existing DOM node with an LWC component.
9207
+ * @param element The existing node in the DOM that where the root component should be attached.
9208
+ * @param Ctor The LWC class to use as the root component.
9209
+ * @param props Any props for the root component as part of initial client-side rendering. The props must be identical to those passed to renderComponent during SSR.
9210
+ * @throws Throws when called with invalid parameters.
9211
+ * @example
9212
+ * import { hydrateComponent } from 'lwc';
9213
+ * import App from 'x/App';
9214
+ * const elm = document.querySelector('x-app');
9215
+ * hydrateComponent(elm, App, { name: 'Hello World' });
9216
+ */
9257
9217
  function hydrateComponent(element, Ctor, props = {}) {
9258
9218
  if (!(element instanceof Element)) {
9259
9219
  throw new TypeError(`"hydrateComponent" expects a valid DOM element as the first parameter but instead received ${element}.`);
@@ -9274,7 +9234,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9274
9234
  defineCustomElement,
9275
9235
  getTagName
9276
9236
  } = renderer;
9277
- defineCustomElement(StringToLowerCase.call(getTagName(element)));
9237
+ defineCustomElement(StringToLowerCase.call(getTagName(element)), Boolean(Ctor.formAssociated));
9278
9238
  const vm = createVMWithProps(element, Ctor, props);
9279
9239
  hydrateRoot(vm);
9280
9240
  } catch (e) {
@@ -9299,15 +9259,14 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9299
9259
  /**
9300
9260
  * This function builds a Web Component class from a LWC constructor so it can be
9301
9261
  * registered as a new element via customElements.define() at any given time.
9302
- * @param Ctor
9262
+ * @param Ctor LWC constructor to build
9263
+ * @returns A Web Component class
9303
9264
  * @example
9304
- * ```
9305
9265
  * import { buildCustomElementConstructor } from 'lwc';
9306
9266
  * import Foo from 'ns/foo';
9307
9267
  * const WC = buildCustomElementConstructor(Foo);
9308
9268
  * customElements.define('x-foo', WC);
9309
9269
  * const elm = document.createElement('x-foo');
9310
- * ```
9311
9270
  * @deprecated since version 1.3.11
9312
9271
  */
9313
9272
  function deprecatedBuildCustomElementConstructor(Ctor) {
@@ -9323,6 +9282,13 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9323
9282
  renderer.remove(childNodes[i], node);
9324
9283
  }
9325
9284
  }
9285
+ /**
9286
+ * The real `buildCustomElementConstructor`. Should not be accessible to external users!
9287
+ * @internal
9288
+ * @param Ctor LWC constructor to build
9289
+ * @returns A Web Component class
9290
+ * @see {@linkcode deprecatedBuildCustomElementConstructor}
9291
+ */
9326
9292
  function buildCustomElementConstructor(Ctor) {
9327
9293
  var _a;
9328
9294
  const HtmlPrototype = getComponentHtmlPrototype(Ctor);
@@ -9374,8 +9340,23 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9374
9340
  attributeChangedCallback(name, oldValue, newValue) {
9375
9341
  attributeChangedCallback.call(this, name, oldValue, newValue);
9376
9342
  }
9377
- /*LWC compiler v6.2.1*/
9378
- }, _a.observedAttributes = observedAttributes, _a;
9343
+ formAssociatedCallback() {
9344
+ runFormAssociatedCallback(this);
9345
+ }
9346
+ formDisabledCallback() {
9347
+ runFormDisabledCallback(this);
9348
+ }
9349
+ formResetCallback() {
9350
+ runFormResetCallback(this);
9351
+ }
9352
+ formStateRestoreCallback() {
9353
+ runFormStateRestoreCallback(this);
9354
+ }
9355
+ /*LWC compiler v6.3.1*/
9356
+ }, _a.observedAttributes = observedAttributes,
9357
+ // Note CustomElementConstructor is not upgraded by LWC and inherits directly from HTMLElement which means it calls the native
9358
+ // attachInternals API.
9359
+ _a.formAssociated = Boolean(Ctor.formAssociated), _a;
9379
9360
  }
9380
9361
 
9381
9362
  /*
@@ -9443,17 +9424,17 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9443
9424
  * difference that in the options, you can pass the `is` property set to a Constructor instead of
9444
9425
  * just a string value. The intent is to allow the creation of an element controlled by LWC without
9445
9426
  * having to register the element as a custom element.
9446
- * @param sel
9447
- * @param options
9448
- * @param options.is description
9449
- * @param options.mode
9427
+ * @param sel The tagname of the element to create
9428
+ * @param options Control the behavior of the created element
9429
+ * @param options.is The LWC component that the element should be
9430
+ * @param options.mode What kind of shadow root to use
9431
+ * @returns The created HTML element
9432
+ * @throws Throws when called with invalid parameters.
9450
9433
  * @example
9451
- * ```
9452
9434
  * const el = createElement('x-foo', { is: FooCtor });
9453
- * ```
9454
9435
  */
9455
- /* eslint-enable jsdoc/valid-types */
9456
- function createElement(sel, options) {
9436
+ function createElement( /* eslint-enable jsdoc/valid-types */
9437
+ sel, options) {
9457
9438
  if (!isObject(options) || isNull(options)) {
9458
9439
  throw new TypeError(`"createElement" function expects an object as second parameter but received "${toString$1(options)}".`);
9459
9440
  }
@@ -9472,13 +9453,13 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9472
9453
  const useNativeCustomElementLifecycle =
9473
9454
  // temporary "kill switch"
9474
9455
  !lwcRuntimeFlags.DISABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE && isAPIFeatureEnabled(7 /* APIFeature.ENABLE_NATIVE_CUSTOM_ELEMENT_LIFECYCLE */, apiVersion);
9456
+ const isFormAssociated = Boolean(Ctor.formAssociated);
9475
9457
  // the custom element from the registry is expecting an upgrade callback
9476
- /**
9458
+ /*
9477
9459
  * Note: if the upgradable constructor does not expect, or throw when we new it
9478
9460
  * with a callback as the first argument, we could implement a more advanced
9479
9461
  * mechanism that only passes that argument if the constructor is known to be
9480
9462
  * an upgradable custom element.
9481
- * @param elm
9482
9463
  */
9483
9464
  const upgradeCallback = elm => {
9484
9465
  createVM(elm, Ctor, renderer, {
@@ -9494,7 +9475,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9494
9475
  DisconnectingSlot.set(elm, disconnectRootElement);
9495
9476
  }
9496
9477
  };
9497
- return createCustomElement(tagName, upgradeCallback, useNativeCustomElementLifecycle);
9478
+ return createCustomElement(tagName, upgradeCallback, useNativeCustomElementLifecycle, isFormAssociated);
9498
9479
  }
9499
9480
 
9500
9481
  /*
@@ -9509,7 +9490,9 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9509
9490
  /**
9510
9491
  * EXPERIMENTAL: The purpose of this function is to detect shadowed nodes. THIS API WILL BE REMOVED
9511
9492
  * ONCE LOCKER V1 IS NO LONGER SUPPORTED.
9512
- * @param node
9493
+ * @param node Node to check
9494
+ * @returns `true` if the the node is shadowed
9495
+ * @example isNodeShadowed(document.querySelector('my-component'))
9513
9496
  */
9514
9497
  function isNodeShadowed(node) {
9515
9498
  if (isFalse(node instanceof _Node)) {
@@ -9581,6 +9564,11 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9581
9564
  * SPDX-License-Identifier: MIT
9582
9565
  * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
9583
9566
  */
9567
+ /**
9568
+ * Creates a context provider, given a wire adapter constructor.
9569
+ * @param adapter The wire adapter to create a context provider for.
9570
+ * @returns A new context provider.
9571
+ */
9584
9572
  function createContextProvider(adapter) {
9585
9573
  return createContextProviderWithRegister(adapter, registerContextProvider);
9586
9574
  }
@@ -9597,7 +9585,7 @@ LWR.define('lwc/v/6_2_1', ['exports'], (function (exports) { 'use strict';
9597
9585
  });
9598
9586
  });
9599
9587
  }
9600
- /** version: 6.2.1 */
9588
+ /** version: 6.3.1 */
9601
9589
 
9602
9590
  exports.LightningElement = LightningElement;
9603
9591
  exports.__unstable__ProfilerControl = profilerControl;