@stencil/core 2.15.0 → 2.15.1

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.
@@ -655,7 +655,7 @@ const templateWindows = new Map, createHydrateBuildId = () => {
655
655
  }, commentre = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g, getCssSelectors = e => {
656
656
  SELECTORS.all.length = SELECTORS.tags.length = SELECTORS.classNames.length = SELECTORS.ids.length = SELECTORS.attrs.length = 0;
657
657
  const t = (e = e.replace(/\./g, " .").replace(/\#/g, " #").replace(/\[/g, " [").replace(/\>/g, " > ").replace(/\+/g, " + ").replace(/\~/g, " ~ ").replace(/\*/g, " * ").replace(/\:not\((.*?)\)/g, " ")).split(" ");
658
- for (let e = 0, r = t.length; e < r; e++) t[e] = t[e].split(":")[0], 0 !== t[e].length && ("." === t[e].charAt(0) ? SELECTORS.classNames.push(t[e].substr(1)) : "#" === t[e].charAt(0) ? SELECTORS.ids.push(t[e].substr(1)) : "[" === t[e].charAt(0) ? (t[e] = t[e].substr(1).split("=")[0].split("]")[0].trim(),
658
+ for (let e = 0, r = t.length; e < r; e++) t[e] = t[e].split(":")[0], 0 !== t[e].length && ("." === t[e].charAt(0) ? SELECTORS.classNames.push(t[e].slice(1)) : "#" === t[e].charAt(0) ? SELECTORS.ids.push(t[e].slice(1)) : "[" === t[e].charAt(0) ? (t[e] = t[e].slice(1).split("=")[0].split("]")[0].trim(),
659
659
  SELECTORS.attrs.push(t[e].toLowerCase())) : /[a-z]/g.test(t[e].charAt(0)) && SELECTORS.tags.push(t[e].toLowerCase()));
660
660
  return SELECTORS.classNames = SELECTORS.classNames.sort(((e, t) => e.length < t.length ? -1 : e.length > t.length ? 1 : 0)),
661
661
  SELECTORS;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
4
4
  "description": "Stencil internal testing platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "private": true
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc (CommonJS) v2.15.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v2.15.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var mockDoc = (function(exports) {
5
5
  'use strict';
@@ -381,7 +381,7 @@ function toDataAttribute(str) {
381
381
  .toLowerCase());
382
382
  }
383
383
  function dashToPascalCase(str) {
384
- str = String(str).substr(5);
384
+ str = String(str).slice(5);
385
385
  return str
386
386
  .split('-')
387
387
  .map((segment, index) => {
@@ -585,7 +585,7 @@ function cssCaseToJsCase(str) {
585
585
  .split('-')
586
586
  .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
587
587
  .join('');
588
- str = str.substr(0, 1).toLowerCase() + str.substr(1);
588
+ str = str.slice(0, 1).toLowerCase() + str.slice(1);
589
589
  }
590
590
  return str;
591
591
  }
@@ -3165,6 +3165,15 @@ class MockResponse {
3165
3165
  }
3166
3166
  }
3167
3167
 
3168
+ class MockDOMParser {
3169
+ parseFromString(htmlToParse, mimeType) {
3170
+ if (mimeType !== 'text/html') {
3171
+ console.error('XML parsing not implemented yet, continuing as html');
3172
+ }
3173
+ return parseHtmlToDocument(htmlToParse);
3174
+ }
3175
+ }
3176
+
3168
3177
  function setupGlobal(gbl) {
3169
3178
  if (gbl.window == null) {
3170
3179
  const win = (gbl.window = new MockWindow());
@@ -3294,6 +3303,7 @@ const GLOBAL_CONSTRUCTORS = [
3294
3303
  ['MouseEvent', MockMouseEvent],
3295
3304
  ['Request', MockRequest],
3296
3305
  ['Response', MockResponse],
3306
+ ['DOMParser', MockDOMParser],
3297
3307
  ['HTMLAnchorElement', MockAnchorElement],
3298
3308
  ['HTMLBaseElement', MockBaseElement],
3299
3309
  ['HTMLButtonElement', MockButtonElement],
@@ -624,6 +624,10 @@ declare function parseHtmlToDocument(html: string, ownerDocument?: MockDocument)
624
624
  declare function parseHtmlToFragment(html: string, ownerDocument?: MockDocument): any;
625
625
  declare function parseDocumentUtil(ownerDocument: any, html: string): any;
626
626
  declare function parseFragmentUtil(ownerDocument: any, html: string): any;
627
+ declare type DOMParserSupportedType = 'text/html' | 'text/xml' | 'application/xml' | 'application/xhtml+xml' | 'image/svg+xml';
628
+ declare class MockDOMParser {
629
+ parseFromString(htmlToParse: string, mimeType: DOMParserSupportedType): MockDocument;
630
+ }
627
631
  /**
628
632
  * https://developer.mozilla.org/en-US/docs/Web/API/Performance
629
633
  */
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v2.15.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v2.15.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  const CONTENT_REF_ID = 'r';
5
5
  const ORG_LOCATION_ID = 'o';
@@ -378,7 +378,7 @@ function toDataAttribute(str) {
378
378
  .toLowerCase());
379
379
  }
380
380
  function dashToPascalCase(str) {
381
- str = String(str).substr(5);
381
+ str = String(str).slice(5);
382
382
  return str
383
383
  .split('-')
384
384
  .map((segment, index) => {
@@ -582,7 +582,7 @@ function cssCaseToJsCase(str) {
582
582
  .split('-')
583
583
  .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
584
584
  .join('');
585
- str = str.substr(0, 1).toLowerCase() + str.substr(1);
585
+ str = str.slice(0, 1).toLowerCase() + str.slice(1);
586
586
  }
587
587
  return str;
588
588
  }
@@ -3162,6 +3162,15 @@ class MockResponse {
3162
3162
  }
3163
3163
  }
3164
3164
 
3165
+ class MockDOMParser {
3166
+ parseFromString(htmlToParse, mimeType) {
3167
+ if (mimeType !== 'text/html') {
3168
+ console.error('XML parsing not implemented yet, continuing as html');
3169
+ }
3170
+ return parseHtmlToDocument(htmlToParse);
3171
+ }
3172
+ }
3173
+
3165
3174
  function setupGlobal(gbl) {
3166
3175
  if (gbl.window == null) {
3167
3176
  const win = (gbl.window = new MockWindow());
@@ -3291,6 +3300,7 @@ const GLOBAL_CONSTRUCTORS = [
3291
3300
  ['MouseEvent', MockMouseEvent],
3292
3301
  ['Request', MockRequest],
3293
3302
  ['Response', MockResponse],
3303
+ ['DOMParser', MockDOMParser],
3294
3304
  ['HTMLAnchorElement', MockAnchorElement],
3295
3305
  ['HTMLBaseElement', MockBaseElement],
3296
3306
  ['HTMLButtonElement', MockButtonElement],
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
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.15.0",
3
+ "version": "2.15.1",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -10,6 +10,8 @@
10
10
  },
11
11
  "files": [
12
12
  "!**/*.map",
13
+ "!**/*.stub.ts",
14
+ "!**/*.stub.tsx",
13
15
  "bin/",
14
16
  "cli/",
15
17
  "compiler/",
@@ -106,7 +108,7 @@
106
108
  "merge-source-map": "^1.1.0",
107
109
  "mime-db": "^1.46.0",
108
110
  "minimatch": "3.0.4",
109
- "node-fetch": "2.6.1",
111
+ "node-fetch": "2.6.7",
110
112
  "open": "8.2.1",
111
113
  "open-in-editor": "2.2.0",
112
114
  "parse5": "6.0.1",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "2.15.0",
3
+ "version": "2.15.1",
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.15.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Node System v2.15.1 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  function _interopDefaultLegacy(e) {
5
5
  return e && "object" == typeof e && "default" in e ? e : {
@@ -255,22 +255,22 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
255
255
  const n = [], i = e => {
256
256
  if (e.length) {
257
257
  const t = new Date, r = "[" + ("0" + t.getMinutes()).slice(-2) + ":" + ("0" + t.getSeconds()).slice(-2) + "." + Math.floor(t.getMilliseconds() / 1e3 * 10) + "]";
258
- e[0] = d(r) + e[0].substr(r.length);
258
+ e[0] = d(r) + e[0].slice(r.length);
259
259
  }
260
260
  }, o = e => {
261
261
  if (e.length) {
262
262
  const t = "[ WARN ]";
263
- e[0] = h(u(t)) + e[0].substr(t.length);
263
+ e[0] = h(u(t)) + e[0].slice(t.length);
264
264
  }
265
265
  }, s = e => {
266
266
  if (e.length) {
267
267
  const t = "[ ERROR ]";
268
- e[0] = h(l(t)) + e[0].substr(t.length);
268
+ e[0] = h(l(t)) + e[0].slice(t.length);
269
269
  }
270
270
  }, a = e => {
271
271
  if (e.length) {
272
272
  const t = new Date, r = "[" + ("0" + t.getMinutes()).slice(-2) + ":" + ("0" + t.getSeconds()).slice(-2) + "." + Math.floor(t.getMilliseconds() / 1e3 * 10) + "]";
273
- e[0] = f(r) + e[0].substr(r.length);
273
+ e[0] = f(r) + e[0].slice(r.length);
274
274
  }
275
275
  }, c = (t, i) => {
276
276
  if (r) {
@@ -279,10 +279,10 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
279
279
  }
280
280
  }, l = t => e.color(t, "red"), u = t => e.color(t, "yellow"), f = t => e.color(t, "cyan"), h = t => e.color(t, "bold"), d = t => e.color(t, "dim"), p = t => e.color(t, "bgRed"), m = e => LOG_LEVELS.indexOf(e) >= LOG_LEVELS.indexOf(t), g = (t, r, n) => {
281
281
  let i = t.length - r + n - 1;
282
- for (;t.length + INDENT$1.length > e.getColumns(); ) if (r > t.length - r + n && r > 5) t = t.substr(1),
282
+ for (;t.length + INDENT$1.length > e.getColumns(); ) if (r > t.length - r + n && r > 5) t = t.slice(1),
283
283
  r--; else {
284
284
  if (!(i > 1)) break;
285
- t = t.substr(0, t.length - 1), i--;
285
+ t = t.slice(0, -1), i--;
286
286
  }
287
287
  const o = [], s = Math.max(t.length, r + n);
288
288
  for (let e = 0; e < s; e++) {
@@ -440,7 +440,7 @@ const fs = require("./graceful-fs.js"), path = require("path"), require$$1 = req
440
440
  const t = JSON.parse(JSON.stringify(e));
441
441
  for (let e = 0; e < 100; e++) {
442
442
  if (!eachLineHasLeadingWhitespace(t)) return t;
443
- for (let e = 0; e < t.length; e++) if (t[e].text = t[e].text.substr(1), t[e].errorCharStart--,
443
+ for (let e = 0; e < t.length; e++) if (t[e].text = t[e].text.slice(1), t[e].errorCharStart--,
444
444
  !t[e].text.length) return t;
445
445
  }
446
446
  return t;
@@ -4957,7 +4957,7 @@ exports.createNodeLogger = e => {
4957
4957
  return _interopNamespace(require("readline"));
4958
4958
  }));
4959
4959
  let t = Promise.resolve();
4960
- const n = n => (n = n.substr(0, r.stdout.columns - 5) + "", t = t.then((() => new Promise((t => {
4960
+ const n = n => (n = n.substring(0, r.stdout.columns - 5) + "", t = t.then((() => new Promise((t => {
4961
4961
  e.clearLine(r.stdout, 0), e.cursorTo(r.stdout, 0, null), r.stdout.write(n, t);
4962
4962
  })))));
4963
4963
  return r.stdout.write("[?25l"), {
@@ -5378,13 +5378,13 @@ exports.createNodeLogger = e => {
5378
5378
  },
5379
5379
  generateContentHash(e, t) {
5380
5380
  let r = require$$3.createHash("sha1").update(e).digest("hex").toLowerCase();
5381
- return "number" == typeof t && (r = r.substr(0, t)), Promise.resolve(r);
5381
+ return "number" == typeof t && (r = r.slice(0, t)), Promise.resolve(r);
5382
5382
  },
5383
5383
  generateFileHash: (e, t) => new Promise(((r, n) => {
5384
5384
  const i = require$$3.createHash("sha1");
5385
5385
  fs__default.default.createReadStream(e).on("error", (e => n(e))).on("data", (e => i.update(e))).on("end", (() => {
5386
5386
  let e = i.digest("hex").toLowerCase();
5387
- "number" == typeof t && (e = e.substr(0, t)), r(e);
5387
+ "number" == typeof t && (e = e.slice(0, t)), r(e);
5388
5388
  }));
5389
5389
  })),
5390
5390
  copy: nodeCopyTasks,