@stencil/core 2.17.2 → 2.18.0

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 (65) hide show
  1. package/cli/index.cjs +32 -16
  2. package/cli/index.js +32 -16
  3. package/cli/package.json +1 -1
  4. package/compiler/lib.dom.d.ts +620 -89
  5. package/compiler/lib.dom.iterable.d.ts +27 -3
  6. package/compiler/lib.es2015.core.d.ts +3 -3
  7. package/compiler/lib.es2015.iterable.d.ts +2 -1
  8. package/compiler/lib.es2015.reflect.d.ts +1 -1
  9. package/compiler/lib.es2020.bigint.d.ts +7 -5
  10. package/compiler/lib.es2020.d.ts +2 -0
  11. package/compiler/lib.es2020.date.d.ts +44 -0
  12. package/compiler/lib.es2020.intl.d.ts +51 -11
  13. package/compiler/lib.es2020.number.d.ts +30 -0
  14. package/compiler/lib.es2021.intl.d.ts +106 -4
  15. package/compiler/lib.es2022.array.d.ts +123 -0
  16. package/compiler/lib.es2022.d.ts +26 -0
  17. package/compiler/lib.es2022.error.d.ts +75 -0
  18. package/compiler/lib.es2022.full.d.ts +25 -0
  19. package/compiler/lib.es2022.intl.d.ts +111 -0
  20. package/compiler/lib.es2022.object.d.ts +28 -0
  21. package/compiler/lib.es2022.string.d.ts +27 -0
  22. package/compiler/lib.es5.d.ts +25 -19
  23. package/compiler/lib.esnext.d.ts +1 -1
  24. package/compiler/lib.esnext.intl.d.ts +4 -1
  25. package/compiler/lib.webworker.d.ts +236 -40
  26. package/compiler/lib.webworker.iterable.d.ts +10 -3
  27. package/compiler/package.json +1 -1
  28. package/compiler/stencil.js +689 -232
  29. package/compiler/stencil.min.js +2 -2
  30. package/compiler/sys/in-memory-fs.d.ts +218 -0
  31. package/dependencies.json +10 -1
  32. package/dev-server/client/index.js +1 -1
  33. package/dev-server/client/package.json +1 -1
  34. package/dev-server/connector.html +2 -2
  35. package/dev-server/index.js +1 -1
  36. package/dev-server/package.json +1 -1
  37. package/dev-server/server-process.js +13 -13
  38. package/internal/app-data/package.json +1 -1
  39. package/internal/client/css-shim.js +1 -1
  40. package/internal/client/dom.js +1 -1
  41. package/internal/client/index.js +337 -157
  42. package/internal/client/package.json +1 -1
  43. package/internal/client/patch-browser.js +1 -1
  44. package/internal/client/patch-esm.js +1 -1
  45. package/internal/client/shadow-css.js +1 -1
  46. package/internal/hydrate/package.json +1 -1
  47. package/internal/hydrate/runner.d.ts +1 -1
  48. package/internal/package.json +1 -1
  49. package/internal/stencil-private.d.ts +2 -106
  50. package/internal/stencil-public-compiler.d.ts +42 -8
  51. package/internal/testing/package.json +1 -1
  52. package/mock-doc/index.cjs +77 -61
  53. package/mock-doc/index.d.ts +13 -12
  54. package/mock-doc/index.js +77 -61
  55. package/mock-doc/package.json +1 -1
  56. package/package.json +5 -7
  57. package/screenshot/index.js +10 -10
  58. package/screenshot/package.json +1 -1
  59. package/sys/node/index.js +1 -1
  60. package/sys/node/package.json +1 -1
  61. package/sys/node/worker.js +1 -1
  62. package/testing/index.js +96 -106
  63. package/testing/jest/jest-config.d.ts +1 -1
  64. package/testing/package.json +1 -1
  65. package/testing/testing-utils.d.ts +5 -4
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v2.17.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v2.18.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -279,7 +279,7 @@ const proxyElements = new WeakMap();
279
279
  const upgradedElements = new WeakSet();
280
280
  function connectNode(ownerDocument, node) {
281
281
  node.ownerDocument = ownerDocument;
282
- if (node.nodeType === 1 /* ELEMENT_NODE */) {
282
+ if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
283
283
  if (ownerDocument != null && node.nodeName.includes('-')) {
284
284
  const win = ownerDocument.defaultView;
285
285
  if (win != null && typeof node.connectedCallback === 'function' && node.isConnected) {
@@ -315,7 +315,7 @@ function fireConnectedCallback(node) {
315
315
  }
316
316
  }
317
317
  function disconnectNode(node) {
318
- if (node.nodeType === 1 /* ELEMENT_NODE */) {
318
+ if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
319
319
  if (node.nodeName.includes('-') === true && typeof node.disconnectedCallback === 'function') {
320
320
  if (tempDisableCallbacks.has(node.ownerDocument) === false) {
321
321
  try {
@@ -631,7 +631,7 @@ class MockEvent {
631
631
  let currentElement = this.target;
632
632
  while (currentElement) {
633
633
  composedPath.push(currentElement);
634
- if (!currentElement.parentElement && currentElement.nodeName === "#document" /* DOCUMENT_NODE */) {
634
+ if (!currentElement.parentElement && currentElement.nodeName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
635
635
  // the current element doesn't have a parent, but we've detected it's our root document node. push the window
636
636
  // object associated with the document onto the path
637
637
  composedPath.push(currentElement.defaultView);
@@ -753,7 +753,7 @@ function triggerEventListener(elm, ev) {
753
753
  if (ev.bubbles === false) {
754
754
  return;
755
755
  }
756
- if (elm.nodeName === "#document" /* DOCUMENT_NODE */) {
756
+ if (elm.nodeName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
757
757
  triggerEventListener(elm.defaultView, ev);
758
758
  }
759
759
  else {
@@ -826,7 +826,7 @@ function serializeNodeToHtml(elm, opts = {}) {
826
826
  return output.text.join('');
827
827
  }
828
828
  function serializeToHtml(node, opts, output, isShadowRoot) {
829
- if (node.nodeType === 1 /* ELEMENT_NODE */ || isShadowRoot) {
829
+ if (node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ || isShadowRoot) {
830
830
  const tagName = isShadowRoot ? 'mock:shadow-root' : getTagName(node);
831
831
  if (tagName === 'body') {
832
832
  output.isWithinBody = true;
@@ -943,7 +943,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
943
943
  if (opts.newLines &&
944
944
  (node.childNodes.length === 0 ||
945
945
  (node.childNodes.length === 1 &&
946
- node.childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
946
+ node.childNodes[0].nodeType === 3 /* NODE_TYPES.TEXT_NODE */ &&
947
947
  node.childNodes[0].nodeValue.trim() === ''))) {
948
948
  output.text.push('\n');
949
949
  output.currentLineWidth = 0;
@@ -958,7 +958,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
958
958
  const childNodeLength = childNodes.length;
959
959
  if (childNodeLength > 0) {
960
960
  if (childNodeLength === 1 &&
961
- childNodes[0].nodeType === 3 /* TEXT_NODE */ &&
961
+ childNodes[0].nodeType === 3 /* NODE_TYPES.TEXT_NODE */ &&
962
962
  (typeof childNodes[0].nodeValue !== 'string' || childNodes[0].nodeValue.trim() === '')) ;
963
963
  else {
964
964
  const isWithinWhitespaceSensitiveNode = opts.newLines || opts.indentSpaces > 0 ? isWithinWhitespaceSensitive(node) : false;
@@ -997,7 +997,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
997
997
  output.isWithinBody = false;
998
998
  }
999
999
  }
1000
- else if (node.nodeType === 3 /* TEXT_NODE */) {
1000
+ else if (node.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
1001
1001
  let textContent = node.nodeValue;
1002
1002
  if (typeof textContent === 'string') {
1003
1003
  const trimmedTextContent = textContent.trim();
@@ -1044,7 +1044,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
1044
1044
  let textContentLength = textContent.length;
1045
1045
  if (textContentLength > 0) {
1046
1046
  // this text node has text content
1047
- const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* ELEMENT_NODE */
1047
+ const parentTagName = node.parentNode != null && node.parentNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */
1048
1048
  ? node.parentNode.nodeName
1049
1049
  : null;
1050
1050
  if (NON_ESCAPABLE_CONTENT.has(parentTagName)) {
@@ -1099,7 +1099,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
1099
1099
  }
1100
1100
  }
1101
1101
  }
1102
- else if (node.nodeType === 8 /* COMMENT_NODE */) {
1102
+ else if (node.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */) {
1103
1103
  const nodeValue = node.nodeValue;
1104
1104
  if (opts.removeHtmlComments) {
1105
1105
  const isHydrateAnnotation = nodeValue.startsWith(CONTENT_REF_ID + '.') ||
@@ -1124,7 +1124,7 @@ function serializeToHtml(node, opts, output, isShadowRoot) {
1124
1124
  output.text.push('<!--' + nodeValue + '-->');
1125
1125
  output.currentLineWidth += nodeValue.length + 7;
1126
1126
  }
1127
- else if (node.nodeType === 10 /* DOCUMENT_TYPE_NODE */) {
1127
+ else if (node.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */) {
1128
1128
  output.text.push('<!doctype html>');
1129
1129
  }
1130
1130
  }
@@ -1283,7 +1283,7 @@ function getParser(ownerDocument) {
1283
1283
  }
1284
1284
  const treeAdapter = {
1285
1285
  createDocument() {
1286
- const doc = ownerDocument.createElement("#document" /* DOCUMENT_NODE */);
1286
+ const doc = ownerDocument.createElement("#document" /* NODE_NAMES.DOCUMENT_NODE */);
1287
1287
  doc['x-mode'] = 'no-quirks';
1288
1288
  return doc;
1289
1289
  },
@@ -1325,7 +1325,7 @@ function getParser(ownerDocument) {
1325
1325
  return templateElement.content;
1326
1326
  },
1327
1327
  setDocumentType(doc, name, publicId, systemId) {
1328
- let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* DOCUMENT_TYPE_NODE */);
1328
+ let doctypeNode = doc.childNodes.find((n) => n.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */);
1329
1329
  if (doctypeNode == null) {
1330
1330
  doctypeNode = ownerDocument.createDocumentTypeNode();
1331
1331
  doc.insertBefore(doctypeNode, doc.firstChild);
@@ -1346,7 +1346,7 @@ function getParser(ownerDocument) {
1346
1346
  },
1347
1347
  insertText(parentNode, text) {
1348
1348
  const lastChild = parentNode.lastChild;
1349
- if (lastChild != null && lastChild.nodeType === 3 /* TEXT_NODE */) {
1349
+ if (lastChild != null && lastChild.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
1350
1350
  lastChild.nodeValue += text;
1351
1351
  }
1352
1352
  else {
@@ -1355,7 +1355,7 @@ function getParser(ownerDocument) {
1355
1355
  },
1356
1356
  insertTextBefore(parentNode, text, referenceNode) {
1357
1357
  const prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1];
1358
- if (prevNode != null && prevNode.nodeType === 3 /* TEXT_NODE */) {
1358
+ if (prevNode != null && prevNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
1359
1359
  prevNode.nodeValue += text;
1360
1360
  }
1361
1361
  else {
@@ -1417,16 +1417,16 @@ function getParser(ownerDocument) {
1417
1417
  return doctypeNode['x-systemId'];
1418
1418
  },
1419
1419
  isTextNode(node) {
1420
- return node.nodeType === 3 /* TEXT_NODE */;
1420
+ return node.nodeType === 3 /* NODE_TYPES.TEXT_NODE */;
1421
1421
  },
1422
1422
  isCommentNode(node) {
1423
- return node.nodeType === 8 /* COMMENT_NODE */;
1423
+ return node.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */;
1424
1424
  },
1425
1425
  isDocumentTypeNode(node) {
1426
- return node.nodeType === 10 /* DOCUMENT_TYPE_NODE */;
1426
+ return node.nodeType === 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */;
1427
1427
  },
1428
1428
  isElementNode(node) {
1429
- return node.nodeType === 1 /* ELEMENT_NODE */;
1429
+ return node.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */;
1430
1430
  },
1431
1431
  };
1432
1432
  parseOptions = {
@@ -1446,7 +1446,7 @@ class MockNode {
1446
1446
  this.childNodes = [];
1447
1447
  }
1448
1448
  appendChild(newNode) {
1449
- if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
1449
+ if (newNode.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
1450
1450
  const nodes = newNode.childNodes.slice();
1451
1451
  for (const child of nodes) {
1452
1452
  this.appendChild(child);
@@ -1470,7 +1470,9 @@ class MockNode {
1470
1470
  const firstChild = this.firstChild;
1471
1471
  items.forEach((item) => {
1472
1472
  const isNode = typeof item === 'object' && item !== null && 'nodeType' in item;
1473
- this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
1473
+ if (firstChild) {
1474
+ this.insertBefore(isNode ? item : this.ownerDocument.createTextNode(String(item)), firstChild);
1475
+ }
1474
1476
  });
1475
1477
  }
1476
1478
  cloneNode(deep) {
@@ -1485,7 +1487,7 @@ class MockNode {
1485
1487
  return this.childNodes[0] || null;
1486
1488
  }
1487
1489
  insertBefore(newNode, referenceNode) {
1488
- if (newNode.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
1490
+ if (newNode.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
1489
1491
  for (let i = 0, ii = newNode.childNodes.length; i < ii; i++) {
1490
1492
  insertBefore(this, newNode.childNodes[i], referenceNode);
1491
1493
  }
@@ -1498,11 +1500,11 @@ class MockNode {
1498
1500
  get isConnected() {
1499
1501
  let node = this;
1500
1502
  while (node != null) {
1501
- if (node.nodeType === 9 /* DOCUMENT_NODE */) {
1503
+ if (node.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */) {
1502
1504
  return true;
1503
1505
  }
1504
1506
  node = node.parentNode;
1505
- if (node != null && node.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */) {
1507
+ if (node != null && node.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */) {
1506
1508
  node = node.host;
1507
1509
  }
1508
1510
  }
@@ -1522,7 +1524,8 @@ class MockNode {
1522
1524
  return null;
1523
1525
  }
1524
1526
  get nodeValue() {
1525
- return this._nodeValue;
1527
+ var _a;
1528
+ return (_a = this._nodeValue) !== null && _a !== void 0 ? _a : '';
1526
1529
  }
1527
1530
  set nodeValue(value) {
1528
1531
  this._nodeValue = value;
@@ -1554,7 +1557,7 @@ class MockNode {
1554
1557
  const index = this.childNodes.indexOf(childNode);
1555
1558
  if (index > -1) {
1556
1559
  this.childNodes.splice(index, 1);
1557
- if (this.nodeType === 1 /* ELEMENT_NODE */) {
1560
+ if (this.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
1558
1561
  const wasConnected = this.isConnected;
1559
1562
  childNode.parentNode = null;
1560
1563
  if (wasConnected === true) {
@@ -1584,7 +1587,8 @@ class MockNode {
1584
1587
  return null;
1585
1588
  }
1586
1589
  get textContent() {
1587
- return this._nodeValue;
1590
+ var _a;
1591
+ return (_a = this._nodeValue) !== null && _a !== void 0 ? _a : '';
1588
1592
  }
1589
1593
  set textContent(value) {
1590
1594
  this._nodeValue = String(value);
@@ -1606,8 +1610,10 @@ class MockNodeList {
1606
1610
  }
1607
1611
  class MockElement extends MockNode {
1608
1612
  constructor(ownerDocument, nodeName) {
1609
- super(ownerDocument, 1 /* ELEMENT_NODE */, typeof nodeName === 'string' ? nodeName : null, null);
1613
+ super(ownerDocument, 1 /* NODE_TYPES.ELEMENT_NODE */, typeof nodeName === 'string' ? nodeName : null, null);
1610
1614
  this.namespaceURI = null;
1615
+ this.__shadowRoot = null;
1616
+ this.__attributeMap = null;
1611
1617
  }
1612
1618
  addEventListener(type, handler) {
1613
1619
  addEventListener(this, type, handler);
@@ -1634,7 +1640,9 @@ class MockElement extends MockNode {
1634
1640
  }
1635
1641
  get attributes() {
1636
1642
  if (this.__attributeMap == null) {
1637
- this.__attributeMap = createAttributeProxy(false);
1643
+ const attrMap = createAttributeProxy(false);
1644
+ this.__attributeMap = attrMap;
1645
+ return attrMap;
1638
1646
  }
1639
1647
  return this.__attributeMap;
1640
1648
  }
@@ -1642,10 +1650,10 @@ class MockElement extends MockNode {
1642
1650
  this.__attributeMap = attrs;
1643
1651
  }
1644
1652
  get children() {
1645
- return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */);
1653
+ return this.childNodes.filter((n) => n.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */);
1646
1654
  }
1647
1655
  get childElementCount() {
1648
- return this.childNodes.filter((n) => n.nodeType === 1 /* ELEMENT_NODE */).length;
1656
+ return this.childNodes.filter((n) => n.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */).length;
1649
1657
  }
1650
1658
  get className() {
1651
1659
  return this.getAttributeNS(null, 'class') || '';
@@ -1661,6 +1669,7 @@ class MockElement extends MockNode {
1661
1669
  }
1662
1670
  cloneNode(_deep) {
1663
1671
  // implemented on MockElement.prototype from within element.ts
1672
+ // @ts-ignore - implemented on MockElement.prototype from within element.ts
1664
1673
  return null;
1665
1674
  }
1666
1675
  closest(selector) {
@@ -1750,7 +1759,8 @@ class MockElement extends MockNode {
1750
1759
  });
1751
1760
  }
1752
1761
  set innerHTML(html) {
1753
- if (NON_ESCAPABLE_CONTENT.has(this.nodeName) === true) {
1762
+ var _a;
1763
+ if (NON_ESCAPABLE_CONTENT.has((_a = this.nodeName) !== null && _a !== void 0 ? _a : '') === true) {
1754
1764
  setTextContent(this, html);
1755
1765
  }
1756
1766
  else {
@@ -1862,9 +1872,9 @@ class MockElement extends MockNode {
1862
1872
  get nextElementSibling() {
1863
1873
  const parentElement = this.parentElement;
1864
1874
  if (parentElement != null &&
1865
- (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
1866
- parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
1867
- parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
1875
+ (parentElement.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
1876
+ parentElement.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */ ||
1877
+ parentElement.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */)) {
1868
1878
  const children = parentElement.children;
1869
1879
  const index = children.indexOf(this) + 1;
1870
1880
  return parentElement.children[index] || null;
@@ -1881,9 +1891,9 @@ class MockElement extends MockNode {
1881
1891
  get previousElementSibling() {
1882
1892
  const parentElement = this.parentElement;
1883
1893
  if (parentElement != null &&
1884
- (parentElement.nodeType === 1 /* ELEMENT_NODE */ ||
1885
- parentElement.nodeType === 11 /* DOCUMENT_FRAGMENT_NODE */ ||
1886
- parentElement.nodeType === 9 /* DOCUMENT_NODE */)) {
1894
+ (parentElement.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
1895
+ parentElement.nodeType === 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */ ||
1896
+ parentElement.nodeType === 9 /* NODE_TYPES.DOCUMENT_NODE */)) {
1887
1897
  const children = parentElement.children;
1888
1898
  const index = children.indexOf(this) - 1;
1889
1899
  return parentElement.children[index] || null;
@@ -2016,7 +2026,8 @@ class MockElement extends MockNode {
2016
2026
  this.setAttributeNS(null, 'tabindex', value);
2017
2027
  }
2018
2028
  get tagName() {
2019
- return this.nodeName;
2029
+ var _a;
2030
+ return (_a = this.nodeName) !== null && _a !== void 0 ? _a : '';
2020
2031
  }
2021
2032
  set tagName(value) {
2022
2033
  this.nodeName = value;
@@ -2331,10 +2342,11 @@ function getElementsByClassName(elm, classNames, foundElms) {
2331
2342
  }
2332
2343
  }
2333
2344
  function getElementsByTagName(elm, tagName, foundElms) {
2345
+ var _a;
2334
2346
  const children = elm.children;
2335
2347
  for (let i = 0, ii = children.length; i < ii; i++) {
2336
2348
  const childElm = children[i];
2337
- if (tagName === '*' || childElm.nodeName.toLowerCase() === tagName) {
2349
+ if (tagName === '*' || ((_a = childElm.nodeName) !== null && _a !== void 0 ? _a : '').toLowerCase() === tagName) {
2338
2350
  foundElms.push(childElm);
2339
2351
  }
2340
2352
  getElementsByTagName(childElm, tagName, foundElms);
@@ -2373,14 +2385,17 @@ class MockHTMLElement extends MockElement {
2373
2385
  this.namespaceURI = 'http://www.w3.org/1999/xhtml';
2374
2386
  }
2375
2387
  get tagName() {
2376
- return this.nodeName;
2388
+ var _a;
2389
+ return (_a = this.nodeName) !== null && _a !== void 0 ? _a : '';
2377
2390
  }
2378
2391
  set tagName(value) {
2379
2392
  this.nodeName = value;
2380
2393
  }
2381
2394
  get attributes() {
2382
2395
  if (this.__attributeMap == null) {
2383
- this.__attributeMap = createAttributeProxy(true);
2396
+ const attrMap = createAttributeProxy(true);
2397
+ this.__attributeMap = attrMap;
2398
+ return attrMap;
2384
2399
  }
2385
2400
  return this.__attributeMap;
2386
2401
  }
@@ -2390,7 +2405,7 @@ class MockHTMLElement extends MockElement {
2390
2405
  }
2391
2406
  class MockTextNode extends MockNode {
2392
2407
  constructor(ownerDocument, text) {
2393
- super(ownerDocument, 3 /* TEXT_NODE */, "#text" /* TEXT_NODE */, text);
2408
+ super(ownerDocument, 3 /* NODE_TYPES.TEXT_NODE */, "#text" /* NODE_NAMES.TEXT_NODE */, text);
2394
2409
  }
2395
2410
  cloneNode(_deep) {
2396
2411
  return new MockTextNode(null, this.nodeValue);
@@ -2412,7 +2427,7 @@ class MockTextNode extends MockNode {
2412
2427
  const text = [];
2413
2428
  for (let i = 0, ii = this.parentNode.childNodes.length; i < ii; i++) {
2414
2429
  const childNode = this.parentNode.childNodes[i];
2415
- if (childNode.nodeType === 3 /* TEXT_NODE */) {
2430
+ if (childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
2416
2431
  text.push(childNode.nodeValue);
2417
2432
  }
2418
2433
  }
@@ -2424,10 +2439,10 @@ class MockTextNode extends MockNode {
2424
2439
  function getTextContent(childNodes, text) {
2425
2440
  for (let i = 0, ii = childNodes.length; i < ii; i++) {
2426
2441
  const childNode = childNodes[i];
2427
- if (childNode.nodeType === 3 /* TEXT_NODE */) {
2442
+ if (childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */) {
2428
2443
  text.push(childNode.nodeValue);
2429
2444
  }
2430
- else if (childNode.nodeType === 1 /* ELEMENT_NODE */) {
2445
+ else if (childNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
2431
2446
  getTextContent(childNode.childNodes, text);
2432
2447
  }
2433
2448
  }
@@ -2442,7 +2457,7 @@ function setTextContent(elm, text) {
2442
2457
 
2443
2458
  class MockComment extends MockNode {
2444
2459
  constructor(ownerDocument, data) {
2445
- super(ownerDocument, 8 /* COMMENT_NODE */, "#comment" /* COMMENT_NODE */, data);
2460
+ super(ownerDocument, 8 /* NODE_TYPES.COMMENT_NODE */, "#comment" /* NODE_NAMES.COMMENT_NODE */, data);
2446
2461
  }
2447
2462
  cloneNode(_deep) {
2448
2463
  return new MockComment(null, this.nodeValue);
@@ -2458,8 +2473,8 @@ class MockComment extends MockNode {
2458
2473
  class MockDocumentFragment extends MockHTMLElement {
2459
2474
  constructor(ownerDocument) {
2460
2475
  super(ownerDocument, null);
2461
- this.nodeName = "#document-fragment" /* DOCUMENT_FRAGMENT_NODE */;
2462
- this.nodeType = 11 /* DOCUMENT_FRAGMENT_NODE */;
2476
+ this.nodeName = "#document-fragment" /* NODE_NAMES.DOCUMENT_FRAGMENT_NODE */;
2477
+ this.nodeType = 11 /* NODE_TYPES.DOCUMENT_FRAGMENT_NODE */;
2463
2478
  }
2464
2479
  getElementById(id) {
2465
2480
  return getElementById(this, id);
@@ -2469,9 +2484,9 @@ class MockDocumentFragment extends MockHTMLElement {
2469
2484
  if (deep) {
2470
2485
  for (let i = 0, ii = this.childNodes.length; i < ii; i++) {
2471
2486
  const childNode = this.childNodes[i];
2472
- if (childNode.nodeType === 1 /* ELEMENT_NODE */ ||
2473
- childNode.nodeType === 3 /* TEXT_NODE */ ||
2474
- childNode.nodeType === 8 /* COMMENT_NODE */) {
2487
+ if (childNode.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */ ||
2488
+ childNode.nodeType === 3 /* NODE_TYPES.TEXT_NODE */ ||
2489
+ childNode.nodeType === 8 /* NODE_TYPES.COMMENT_NODE */) {
2475
2490
  const clonedChildNode = this.childNodes[i].cloneNode(true);
2476
2491
  cloned.appendChild(clonedChildNode);
2477
2492
  }
@@ -2484,7 +2499,7 @@ class MockDocumentFragment extends MockHTMLElement {
2484
2499
  class MockDocumentTypeNode extends MockHTMLElement {
2485
2500
  constructor(ownerDocument) {
2486
2501
  super(ownerDocument, '!DOCTYPE');
2487
- this.nodeType = 10 /* DOCUMENT_TYPE_NODE */;
2502
+ this.nodeType = 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */;
2488
2503
  this.setAttribute('html', '');
2489
2504
  }
2490
2505
  }
@@ -3629,6 +3644,7 @@ class MockNavigator {
3629
3644
  class MockPerformance {
3630
3645
  constructor() {
3631
3646
  this.timeOrigin = Date.now();
3647
+ this.eventCounts = new Map();
3632
3648
  }
3633
3649
  addEventListener() {
3634
3650
  //
@@ -4518,8 +4534,8 @@ function resetWindowDimensions(win) {
4518
4534
  class MockDocument extends MockHTMLElement {
4519
4535
  constructor(html = null, win = null) {
4520
4536
  super(null, null);
4521
- this.nodeName = "#document" /* DOCUMENT_NODE */;
4522
- this.nodeType = 9 /* DOCUMENT_NODE */;
4537
+ this.nodeName = "#document" /* NODE_NAMES.DOCUMENT_NODE */;
4538
+ this.nodeType = 9 /* NODE_TYPES.DOCUMENT_NODE */;
4523
4539
  this.defaultView = win;
4524
4540
  this.cookie = '';
4525
4541
  this.referrer = '';
@@ -4593,7 +4609,7 @@ class MockDocument extends MockHTMLElement {
4593
4609
  }
4594
4610
  set documentElement(documentElement) {
4595
4611
  for (let i = this.childNodes.length - 1; i >= 0; i--) {
4596
- if (this.childNodes[i].nodeType !== 10 /* DOCUMENT_TYPE_NODE */) {
4612
+ if (this.childNodes[i].nodeType !== 10 /* NODE_TYPES.DOCUMENT_TYPE_NODE */) {
4597
4613
  this.childNodes[i].remove();
4598
4614
  }
4599
4615
  }
@@ -4664,7 +4680,7 @@ class MockDocument extends MockHTMLElement {
4664
4680
  return new MockAttr(attrName, '', namespaceURI);
4665
4681
  }
4666
4682
  createElement(tagName) {
4667
- if (tagName === "#document" /* DOCUMENT_NODE */) {
4683
+ if (tagName === "#document" /* NODE_NAMES.DOCUMENT_NODE */) {
4668
4684
  const doc = new MockDocument(false);
4669
4685
  doc.nodeName = tagName;
4670
4686
  doc.parentNode = null;
@@ -4733,11 +4749,11 @@ function resetDocument(doc) {
4733
4749
  }
4734
4750
  }
4735
4751
  try {
4736
- doc.nodeName = "#document" /* DOCUMENT_NODE */;
4752
+ doc.nodeName = "#document" /* NODE_NAMES.DOCUMENT_NODE */;
4737
4753
  }
4738
4754
  catch (e) { }
4739
4755
  try {
4740
- doc.nodeType = 9 /* DOCUMENT_NODE */;
4756
+ doc.nodeType = 9 /* NODE_TYPES.DOCUMENT_NODE */;
4741
4757
  }
4742
4758
  catch (e) { }
4743
4759
  try {
@@ -4787,7 +4803,7 @@ function getElementsByName(elm, elmName, foundElms = []) {
4787
4803
  function setOwnerDocument(elm, ownerDocument) {
4788
4804
  for (let i = 0, ii = elm.childNodes.length; i < ii; i++) {
4789
4805
  elm.childNodes[i].ownerDocument = ownerDocument;
4790
- if (elm.childNodes[i].nodeType === 1 /* ELEMENT_NODE */) {
4806
+ if (elm.childNodes[i].nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
4791
4807
  setOwnerDocument(elm.childNodes[i], ownerDocument);
4792
4808
  }
4793
4809
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.17.2",
3
+ "version": "2.18.0",
4
4
  "description": "Mock window, document and DOM outside of a browser environment.",
5
5
  "main": "./index.cjs",
6
6
  "module": "./index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core",
3
- "version": "2.17.2",
3
+ "version": "2.18.0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -71,7 +71,6 @@
71
71
  "@types/glob": "^7.1.2",
72
72
  "@types/graceful-fs": "^4.1.5",
73
73
  "@types/inquirer": "^7.3.1",
74
- "@types/is-glob": "^4.0.1",
75
74
  "@types/jest": "^27.0.3",
76
75
  "@types/listr": "^0.14.2",
77
76
  "@types/mime-types": "^2.1.0",
@@ -95,7 +94,7 @@
95
94
  "conventional-changelog-cli": "^2.1.1",
96
95
  "core-js-builder": "~3.6.5",
97
96
  "css": "^3.0.0",
98
- "dts-bundle-generator": "~5.3.0",
97
+ "dts-bundle-generator": "~6.12.0",
99
98
  "eslint": "^8.13.0",
100
99
  "eslint-config-prettier": "^8.5.0",
101
100
  "eslint-plugin-jest": "^26.5.3",
@@ -103,7 +102,7 @@
103
102
  "execa": "4.1.0",
104
103
  "exit": "^0.1.2",
105
104
  "fast-deep-equal": "3.1.3",
106
- "fs-extra": "^9.1.0",
105
+ "fs-extra": "^10.1.0",
107
106
  "glob": "7.1.6",
108
107
  "graceful-fs": "~4.2.6",
109
108
  "hash.js": "^1.1.7",
@@ -123,7 +122,7 @@
123
122
  "path-browserify": "^1.0.1",
124
123
  "pixelmatch": "4.0.2",
125
124
  "postcss": "^8.2.8",
126
- "prettier": "2.5.1",
125
+ "prettier": "2.7.1",
127
126
  "prompts": "2.4.0",
128
127
  "puppeteer": "~10.0.0",
129
128
  "rollup": "2.42.3",
@@ -131,8 +130,7 @@
131
130
  "semver": "7.3.4",
132
131
  "sizzle": "^2.3.6",
133
132
  "terser": "5.6.1",
134
- "tslib": "^2.1.0",
135
- "typescript": "4.5.4",
133
+ "typescript": "4.7.4",
136
134
  "webpack": "^4.46.0",
137
135
  "ws": "7.4.6"
138
136
  },
@@ -500,18 +500,18 @@ const getEncodedRootLength = (path) => {
500
500
  return 0;
501
501
  const ch0 = path.charCodeAt(0);
502
502
  // POSIX or UNC
503
- if (ch0 === 47 /* slash */ || ch0 === 92 /* backslash */) {
503
+ if (ch0 === 47 /* CharacterCodes.slash */ || ch0 === 92 /* CharacterCodes.backslash */) {
504
504
  if (path.charCodeAt(1) !== ch0)
505
505
  return 1; // POSIX: "/" (or non-normalized "\")
506
- const p1 = path.indexOf(ch0 === 47 /* slash */ ? '/' : altDirectorySeparator, 2);
506
+ const p1 = path.indexOf(ch0 === 47 /* CharacterCodes.slash */ ? '/' : altDirectorySeparator, 2);
507
507
  if (p1 < 0)
508
508
  return path.length; // UNC: "//server" or "\\server"
509
509
  return p1 + 1; // UNC: "//server/" or "\\server\"
510
510
  }
511
511
  // DOS
512
- if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* colon */) {
512
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* CharacterCodes.colon */) {
513
513
  const ch2 = path.charCodeAt(2);
514
- if (ch2 === 47 /* slash */ || ch2 === 92 /* backslash */)
514
+ if (ch2 === 47 /* CharacterCodes.slash */ || ch2 === 92 /* CharacterCodes.backslash */)
515
515
  return 3; // DOS: "c:/" or "c:\"
516
516
  if (path.length === 2)
517
517
  return 2; // DOS: "c:" (but not "c:d")
@@ -533,7 +533,7 @@ const getEncodedRootLength = (path) => {
533
533
  isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
534
534
  const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
535
535
  if (volumeSeparatorEnd !== -1) {
536
- if (path.charCodeAt(volumeSeparatorEnd) === 47 /* slash */) {
536
+ if (path.charCodeAt(volumeSeparatorEnd) === 47 /* CharacterCodes.slash */) {
537
537
  // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/"
538
538
  return ~(volumeSeparatorEnd + 1);
539
539
  }
@@ -551,15 +551,15 @@ const getEncodedRootLength = (path) => {
551
551
  // relative
552
552
  return 0;
553
553
  };
554
- const isVolumeCharacter = (charCode) => (charCode >= 97 /* a */ && charCode <= 122 /* z */) ||
555
- (charCode >= 65 /* A */ && charCode <= 90 /* Z */);
554
+ const isVolumeCharacter = (charCode) => (charCode >= 97 /* CharacterCodes.a */ && charCode <= 122 /* CharacterCodes.z */) ||
555
+ (charCode >= 65 /* CharacterCodes.A */ && charCode <= 90 /* CharacterCodes.Z */);
556
556
  const getFileUrlVolumeSeparatorEnd = (url, start) => {
557
557
  const ch0 = url.charCodeAt(start);
558
- if (ch0 === 58 /* colon */)
558
+ if (ch0 === 58 /* CharacterCodes.colon */)
559
559
  return start + 1;
560
- if (ch0 === 37 /* percent */ && url.charCodeAt(start + 1) === 51 /* _3 */) {
560
+ if (ch0 === 37 /* CharacterCodes.percent */ && url.charCodeAt(start + 1) === 51 /* CharacterCodes._3 */) {
561
561
  const ch2 = url.charCodeAt(start + 2);
562
- if (ch2 === 97 /* a */ || ch2 === 65 /* A */)
562
+ if (ch2 === 97 /* CharacterCodes.a */ || ch2 === 65 /* CharacterCodes.A */)
563
563
  return start + 3;
564
564
  }
565
565
  return -1;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "2.17.2",
3
+ "version": "2.18.0",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/sys/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Node System v2.17.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System v2.18.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopDefaultLegacy(e) {
5
5
  return e && "object" == typeof e && "default" in e ? e : {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/sys/node",
3
- "version": "2.17.2",
3
+ "version": "2.18.0",
4
4
  "description": "Stencil Node System.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Node System Worker v2.17.2 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System Worker v2.18.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopNamespace(e) {
5
5
  if (e && e.__esModule) return e;