@lwc/engine-core 8.12.0 → 8.12.2

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.
@@ -6,6 +6,7 @@ export { hydrateRoot } from './hydration';
6
6
  export { registerComponent } from './component';
7
7
  export { registerTemplate } from './secure-template';
8
8
  export { registerDecorators } from './decorators/register';
9
+ export { BaseBridgeElement } from './base-bridge-element';
9
10
  export { unwrap } from './membrane';
10
11
  export { sanitizeAttribute } from './secure-template';
11
12
  export { getComponentDef, isComponentConstructor } from './def';
package/dist/index.cjs.js CHANGED
@@ -808,25 +808,6 @@ for (const [attrName, propName] of shared.entries(shared.AriaAttrNameToPropNameM
808
808
  descriptors[propName] = ariaDescriptor(attrName);
809
809
  }
810
810
 
811
- /*
812
- * Copyright (c) 2018, salesforce.com, inc.
813
- * All rights reserved.
814
- * SPDX-License-Identifier: MIT
815
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
816
- */
817
- // These properties get added to LWCElement.prototype publicProps automatically
818
- const defaultDefHTMLPropertyNames = [
819
- 'accessKey',
820
- 'dir',
821
- 'draggable',
822
- 'hidden',
823
- 'id',
824
- 'lang',
825
- 'spellcheck',
826
- 'tabIndex',
827
- 'title',
828
- ];
829
-
830
811
  /*
831
812
  * Copyright (c) 2018, salesforce.com, inc.
832
813
  * All rights reserved.
@@ -848,7 +829,7 @@ shared.forEach.call(shared.keys(shared.AriaPropNameToAttrNameMap), (propName) =>
848
829
  HTMLElementOriginalDescriptors[propName] = descriptor;
849
830
  }
850
831
  });
851
- shared.forEach.call(defaultDefHTMLPropertyNames, (propName) => {
832
+ for (const propName of shared.REFLECTIVE_GLOBAL_PROPERTY_SET) {
852
833
  // Note: intentionally using our in-house getPropertyDescriptor instead of getOwnPropertyDescriptor here because
853
834
  // in IE11, id property is on Element.prototype instead of HTMLElement, and we suspect that more will fall into
854
835
  // this category, so, better to be sure.
@@ -856,7 +837,7 @@ shared.forEach.call(defaultDefHTMLPropertyNames, (propName) => {
856
837
  if (!shared.isUndefined(descriptor)) {
857
838
  HTMLElementOriginalDescriptors[propName] = descriptor;
858
839
  }
859
- });
840
+ }
860
841
 
861
842
  /*
862
843
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1091,18 +1072,6 @@ function updateComponentValue(vm, key, newValue) {
1091
1072
  const { isArray } = Array;
1092
1073
  const { prototype: ObjectDotPrototype, getPrototypeOf, create: ObjectCreate, defineProperty: ObjectDefineProperty, isExtensible, getOwnPropertyDescriptor, getOwnPropertyNames, getOwnPropertySymbols, preventExtensions, hasOwnProperty, } = Object;
1093
1074
  const { push: ArrayPush, concat: ArrayConcat } = Array.prototype;
1094
- const OtS = {}.toString;
1095
- function toString(obj) {
1096
- if (obj && obj.toString) {
1097
- return obj.toString();
1098
- }
1099
- else if (typeof obj === 'object') {
1100
- return OtS.call(obj);
1101
- }
1102
- else {
1103
- return obj + '';
1104
- }
1105
- }
1106
1075
  function isUndefined(obj) {
1107
1076
  return obj === undefined;
1108
1077
  }
@@ -1340,10 +1309,6 @@ class ReactiveProxyHandler extends BaseProxyHandler {
1340
1309
  return true;
1341
1310
  }
1342
1311
  setPrototypeOf(shadowTarget, prototype) {
1343
- /* istanbul ignore else */
1344
- if (process.env.NODE_ENV !== 'production') {
1345
- throw new Error(`Invalid setPrototypeOf invocation for reactive proxy ${toString(this.originalTarget)}. Prototype of reactive objects cannot be changed.`);
1346
- }
1347
1312
  }
1348
1313
  preventExtensions(shadowTarget) {
1349
1314
  if (isExtensible(shadowTarget)) {
@@ -1407,147 +1372,31 @@ class ReadOnlyHandler extends BaseProxyHandler {
1407
1372
  if (!isUndefined(wrappedSetter)) {
1408
1373
  return wrappedSetter;
1409
1374
  }
1410
- const handler = this;
1411
1375
  const set = function (v) {
1412
- /* istanbul ignore else */
1413
- if (process.env.NODE_ENV !== 'production') {
1414
- const { originalTarget } = handler;
1415
- throw new Error(`Invalid mutation: Cannot invoke a setter on "${originalTarget}". "${originalTarget}" is read-only.`);
1416
- }
1417
1376
  };
1418
1377
  setterMap.set(originalSet, set);
1419
1378
  return set;
1420
1379
  }
1421
1380
  set(shadowTarget, key, value) {
1422
- /* istanbul ignore else */
1423
- if (process.env.NODE_ENV !== 'production') {
1424
- const { originalTarget } = this;
1425
- const msg = isArray(originalTarget)
1426
- ? `Invalid mutation: Cannot mutate array at index ${key.toString()}. Array is read-only.`
1427
- : `Invalid mutation: Cannot set "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`;
1428
- throw new Error(msg);
1429
- }
1430
1381
  /* istanbul ignore next */
1431
1382
  return false;
1432
1383
  }
1433
1384
  deleteProperty(shadowTarget, key) {
1434
- /* istanbul ignore else */
1435
- if (process.env.NODE_ENV !== 'production') {
1436
- const { originalTarget } = this;
1437
- throw new Error(`Invalid mutation: Cannot delete "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
1438
- }
1439
1385
  /* istanbul ignore next */
1440
1386
  return false;
1441
1387
  }
1442
1388
  setPrototypeOf(shadowTarget, prototype) {
1443
- /* istanbul ignore else */
1444
- if (process.env.NODE_ENV !== 'production') {
1445
- const { originalTarget } = this;
1446
- throw new Error(`Invalid prototype mutation: Cannot set prototype on "${originalTarget}". "${originalTarget}" prototype is read-only.`);
1447
- }
1448
1389
  }
1449
1390
  preventExtensions(shadowTarget) {
1450
- /* istanbul ignore else */
1451
- if (process.env.NODE_ENV !== 'production') {
1452
- const { originalTarget } = this;
1453
- throw new Error(`Invalid mutation: Cannot preventExtensions on ${originalTarget}". "${originalTarget} is read-only.`);
1454
- }
1455
1391
  /* istanbul ignore next */
1456
1392
  return false;
1457
1393
  }
1458
1394
  defineProperty(shadowTarget, key, descriptor) {
1459
- /* istanbul ignore else */
1460
- if (process.env.NODE_ENV !== 'production') {
1461
- const { originalTarget } = this;
1462
- throw new Error(`Invalid mutation: Cannot defineProperty "${key.toString()}" on "${originalTarget}". "${originalTarget}" is read-only.`);
1463
- }
1464
1395
  /* istanbul ignore next */
1465
1396
  return false;
1466
1397
  }
1467
1398
  }
1468
1399
 
1469
- function extract(objectOrArray) {
1470
- if (isArray(objectOrArray)) {
1471
- return objectOrArray.map((item) => {
1472
- const original = unwrap$1(item);
1473
- if (original !== item) {
1474
- return extract(original);
1475
- }
1476
- return item;
1477
- });
1478
- }
1479
- const obj = ObjectCreate(getPrototypeOf(objectOrArray));
1480
- const names = getOwnPropertyNames(objectOrArray);
1481
- return ArrayConcat.call(names, getOwnPropertySymbols(objectOrArray)).reduce((seed, key) => {
1482
- const item = objectOrArray[key];
1483
- const original = unwrap$1(item);
1484
- if (original !== item) {
1485
- seed[key] = extract(original);
1486
- }
1487
- else {
1488
- seed[key] = item;
1489
- }
1490
- return seed;
1491
- }, obj);
1492
- }
1493
- const formatter = {
1494
- header: (plainOrProxy) => {
1495
- const originalTarget = unwrap$1(plainOrProxy);
1496
- // if originalTarget is falsy or not unwrappable, exit
1497
- if (!originalTarget || originalTarget === plainOrProxy) {
1498
- return null;
1499
- }
1500
- const obj = extract(plainOrProxy);
1501
- return ['object', { object: obj }];
1502
- },
1503
- hasBody: () => {
1504
- return false;
1505
- },
1506
- body: () => {
1507
- return null;
1508
- },
1509
- };
1510
- // Inspired from paulmillr/es6-shim
1511
- // https://github.com/paulmillr/es6-shim/blob/master/es6-shim.js#L176-L185
1512
- /* istanbul ignore next */
1513
- function getGlobal() {
1514
- // the only reliable means to get the global object is `Function('return this')()`
1515
- // However, this causes CSP violations in Chrome apps.
1516
- if (typeof globalThis !== 'undefined') {
1517
- return globalThis;
1518
- }
1519
- if (typeof self !== 'undefined') {
1520
- return self;
1521
- }
1522
- if (typeof window !== 'undefined') {
1523
- return window;
1524
- }
1525
- if (typeof global !== 'undefined') {
1526
- return global;
1527
- }
1528
- // Gracefully degrade if not able to locate the global object
1529
- return {};
1530
- }
1531
- function init() {
1532
- /* istanbul ignore if */
1533
- if (process.env.NODE_ENV === 'production') {
1534
- // this method should never leak to prod
1535
- throw new ReferenceError();
1536
- }
1537
- const global = getGlobal();
1538
- // Custom Formatter for Dev Tools. To enable this, open Chrome Dev Tools
1539
- // - Go to Settings,
1540
- // - Under console, select "Enable custom formatters"
1541
- // For more information, https://docs.google.com/document/d/1FTascZXT9cxfetuPRT2eXPQKXui4nWFivUnS_335T3U/preview
1542
- const devtoolsFormatters = global.devtoolsFormatters || [];
1543
- ArrayPush.call(devtoolsFormatters, formatter);
1544
- global.devtoolsFormatters = devtoolsFormatters;
1545
- }
1546
-
1547
- /* istanbul ignore else */
1548
- if (process.env.NODE_ENV !== 'production') {
1549
- init();
1550
- }
1551
1400
  function defaultValueIsObservable(value) {
1552
1401
  // intentionally checking for null
1553
1402
  if (value === null) {
@@ -8536,6 +8385,7 @@ Object.defineProperty(exports, "setFeatureFlagForTest", {
8536
8385
  enumerable: true,
8537
8386
  get: function () { return features.setFeatureFlagForTest; }
8538
8387
  });
8388
+ exports.BaseBridgeElement = BaseBridgeElement;
8539
8389
  exports.LightningElement = LightningElement;
8540
8390
  exports.__unstable__ProfilerControl = profilerControl;
8541
8391
  exports.__unstable__ReportingControl = reportingControl;
@@ -8571,5 +8421,5 @@ exports.swapTemplate = swapTemplate;
8571
8421
  exports.track = track;
8572
8422
  exports.unwrap = unwrap;
8573
8423
  exports.wire = wire;
8574
- /** version: 8.12.0 */
8424
+ /** version: 8.12.2 */
8575
8425
  //# sourceMappingURL=index.cjs.js.map