@stencil/core 4.41.1-dev.1768367277.5fd0ceb → 4.41.1-dev.1768540084.3de7ba6

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.
@@ -344,7 +344,7 @@ var queuedLoadModules = [];
344
344
  var caughtErrors = [];
345
345
 
346
346
  // src/runtime/event-emitter.ts
347
- var import_app_data3 = require("@stencil/core/internal/app-data");
347
+ var import_app_data2 = require("@stencil/core/internal/app-data");
348
348
 
349
349
  // src/utils/constants.ts
350
350
  var SVG_NS = "http://www.w3.org/2000/svg";
@@ -374,6 +374,36 @@ var TYPE_CONSTANT = "type";
374
374
  var VALUE_CONSTANT = "value";
375
375
  var SERIALIZED_PREFIX = "serialized:";
376
376
 
377
+ // src/runtime/element.ts
378
+ var import_app_data = require("@stencil/core/internal/app-data");
379
+ var getElement = (ref) => {
380
+ var _a;
381
+ return import_app_data.BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
382
+ };
383
+
384
+ // src/runtime/event-emitter.ts
385
+ var createEvent = (ref, name, flags) => {
386
+ const elm = getElement(ref);
387
+ return {
388
+ emit: (detail) => {
389
+ if (import_app_data2.BUILD.isDev && !elm.isConnected) {
390
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
391
+ }
392
+ return emitEvent(elm, name, {
393
+ bubbles: !!(flags & 4 /* Bubbles */),
394
+ composed: !!(flags & 2 /* Composed */),
395
+ cancelable: !!(flags & 1 /* Cancellable */),
396
+ detail
397
+ });
398
+ }
399
+ };
400
+ };
401
+ var emitEvent = (elm, name, opts) => {
402
+ const ev = plt.ce(name, opts);
403
+ elm.dispatchEvent(ev);
404
+ return ev;
405
+ };
406
+
377
407
  // src/utils/helpers.ts
378
408
  var isDef = (v) => v != null && v !== void 0;
379
409
  var isComplexType = (o) => {
@@ -1898,7 +1928,7 @@ function deserializeProperty(value) {
1898
1928
  }
1899
1929
 
1900
1930
  // src/utils/shadow-root.ts
1901
- var import_app_data = require("@stencil/core/internal/app-data");
1931
+ var import_app_data3 = require("@stencil/core/internal/app-data");
1902
1932
 
1903
1933
  // src/app-globals/index.ts
1904
1934
  var globalStyles = (
@@ -1945,10 +1975,10 @@ var GLOBAL_STYLE_ID = "sc-global";
1945
1975
  function createShadowRoot(cmpMeta) {
1946
1976
  var _a;
1947
1977
  const opts = { mode: "open" };
1948
- if (import_app_data.BUILD.shadowDelegatesFocus) {
1978
+ if (import_app_data3.BUILD.shadowDelegatesFocus) {
1949
1979
  opts.delegatesFocus = !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */);
1950
1980
  }
1951
- if (import_app_data.BUILD.shadowSlotAssignmentManual) {
1981
+ if (import_app_data3.BUILD.shadowSlotAssignmentManual) {
1952
1982
  const isManual = !!(cmpMeta.$flags$ & 1024 /* shadowSlotAssignmentManual */);
1953
1983
  if (isManual) {
1954
1984
  opts.slotAssignment = "manual";
@@ -1965,7 +1995,7 @@ function createShadowRoot(cmpMeta) {
1965
1995
  } else if (globalStyles && !supportsConstructableStylesheets) {
1966
1996
  const styleElm = document.createElement("style");
1967
1997
  styleElm.innerHTML = globalStyles;
1968
- if (import_app_data.BUILD.hotModuleReplacement) {
1998
+ if (import_app_data3.BUILD.hotModuleReplacement) {
1969
1999
  styleElm.setAttribute(HYDRATED_STYLE_ID, GLOBAL_STYLE_ID);
1970
2000
  }
1971
2001
  shadowRoot.prepend(styleElm);
@@ -1986,36 +2016,6 @@ var isJsxFile = lowerPathParam(
1986
2016
  );
1987
2017
  var isJsFile = lowerPathParam((p) => p.endsWith(".js") || p.endsWith(".mjs") || p.endsWith(".cjs"));
1988
2018
 
1989
- // src/runtime/element.ts
1990
- var import_app_data2 = require("@stencil/core/internal/app-data");
1991
- var getElement = (ref) => {
1992
- var _a;
1993
- return import_app_data2.BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
1994
- };
1995
-
1996
- // src/runtime/event-emitter.ts
1997
- var createEvent = (ref, name, flags) => {
1998
- const elm = getElement(ref);
1999
- return {
2000
- emit: (detail) => {
2001
- if (import_app_data3.BUILD.isDev && !elm.isConnected) {
2002
- consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
2003
- }
2004
- return emitEvent(elm, name, {
2005
- bubbles: !!(flags & 4 /* Bubbles */),
2006
- composed: !!(flags & 2 /* Composed */),
2007
- cancelable: !!(flags & 1 /* Cancellable */),
2008
- detail
2009
- });
2010
- }
2011
- };
2012
- };
2013
- var emitEvent = (elm, name, opts) => {
2014
- const ev = plt.ce(name, opts);
2015
- elm.dispatchEvent(ev);
2016
- return ev;
2017
- };
2018
-
2019
2019
  // src/testing/platform/testing-host-ref.ts
2020
2020
  var getHostRef = (elm) => {
2021
2021
  if (elm.__stencil__getHostRef) {
@@ -3728,9 +3728,6 @@ var createSupportsRuleRe = (selector) => {
3728
3728
  "g"
3729
3729
  );
3730
3730
  };
3731
- var _colonSlottedRe = createSupportsRuleRe("::slotted");
3732
- var _colonHostRe = createSupportsRuleRe(":host");
3733
- var _colonHostContextRe = createSupportsRuleRe(":host-context");
3734
3731
  var _commentRe = /\/\*\s*[\s\S]*?\*\//g;
3735
3732
  var stripComments = (input) => {
3736
3733
  return input.replace(_commentRe, "");
@@ -3808,6 +3805,9 @@ var insertPolyfillHostInCssText = (cssText) => {
3808
3805
  supportsBlocks.push(selectorContent);
3809
3806
  return `@supports selector(${placeholder})`;
3810
3807
  });
3808
+ const _colonSlottedRe = createSupportsRuleRe("::slotted");
3809
+ const _colonHostRe = createSupportsRuleRe(":host");
3810
+ const _colonHostContextRe = createSupportsRuleRe(":host-context");
3811
3811
  cssText = cssText.replace(_colonHostContextRe, `$1${_polyfillHostContext}`).replace(_colonHostRe, `$1${_polyfillHost}`).replace(_colonSlottedRe, `$1${_polyfillSlotted}`);
3812
3812
  supportsBlocks.forEach((originalSelector, index) => {
3813
3813
  cssText = cssText.replace(`__supports_${index}__`, originalSelector);
@@ -4334,9 +4334,7 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
4334
4334
  isSvgMode = newVNode2.$tag$ === "svg";
4335
4335
  }
4336
4336
  if (!win.document) {
4337
- throw new Error(
4338
- "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
4339
- );
4337
+ throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
4340
4338
  }
4341
4339
  elm = newVNode2.$elm$ = import_app_data13.BUILD.svg ? win.document.createElementNS(
4342
4340
  isSvgMode ? SVG_NS : HTML_NS,
@@ -4688,16 +4686,18 @@ var nullifyVNodeRefs = (vNode) => {
4688
4686
  }
4689
4687
  };
4690
4688
  var insertBefore = (parent, newNode, reference, isInitialLoad) => {
4691
- if (import_app_data13.BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
4692
- addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
4693
- } else if (typeof newNode["s-sn"] === "string") {
4694
- if (import_app_data13.BUILD.experimentalSlotFixes && parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4695
- patchParentNode(newNode);
4689
+ if (import_app_data13.BUILD.slotRelocation) {
4690
+ if (import_app_data13.BUILD.scoped && typeof newNode["s-sn"] === "string" && !!newNode["s-sr"] && !!newNode["s-cr"]) {
4691
+ addRemoveSlotScopedClass(newNode["s-cr"], newNode, parent, newNode.parentElement);
4692
+ } else if (typeof newNode["s-sn"] === "string") {
4693
+ if (import_app_data13.BUILD.experimentalSlotFixes && parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
4694
+ patchParentNode(newNode);
4695
+ }
4696
+ parent.insertBefore(newNode, reference);
4697
+ const { slotNode } = findSlotFromSlottedNode(newNode);
4698
+ if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
4699
+ return newNode;
4696
4700
  }
4697
- parent.insertBefore(newNode, reference);
4698
- const { slotNode } = findSlotFromSlottedNode(newNode);
4699
- if (slotNode && !isInitialLoad) dispatchSlotChangeEvent(slotNode);
4700
- return newNode;
4701
4701
  }
4702
4702
  if (parent.__insertBefore) {
4703
4703
  return parent.__insertBefore(newNode, reference);
@@ -6025,7 +6025,7 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
6025
6025
  });
6026
6026
  });
6027
6027
  if (cmpTags.length > 0) {
6028
- if (hasSlotRelocation) {
6028
+ if (import_app_data21.BUILD.slotRelocation && hasSlotRelocation) {
6029
6029
  dataStyles.textContent += SLOT_FB_CSS;
6030
6030
  }
6031
6031
  if (import_app_data21.BUILD.invisiblePrehydration && (import_app_data21.BUILD.hydratedClass || import_app_data21.BUILD.hydratedAttribute)) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.41.1-dev.1768367277.5fd0ceb",
3
+ "version": "4.41.1-dev.1768540084.3de7ba6",
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) v4.41.1-dev.1768367277.5fd0ceb | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.41.1-dev.1768540084.3de7ba6 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.41.1-dev.1768367277.5fd0ceb | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.41.1-dev.1768540084.3de7ba6 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __defProp = Object.defineProperty;
5
5
  var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.41.1-dev.1768367277.5fd0ceb",
3
+ "version": "4.41.1-dev.1768540084.3de7ba6",
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": "4.41.1-dev.1768367277.5fd0ceb",
3
+ "version": "4.41.1-dev.1768540084.3de7ba6",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -135,7 +135,8 @@
135
135
  "spellcheck.code": "cspell --config cspell-code.json --no-progress \"src/**/*.ts\" \"src/**/*.tsx\" \"scripts/**/*.ts\"",
136
136
  "spellcheck.markdown": "cspell --config cspell-markdown.json --no-progress \"*.md\" \"**/*.md\"",
137
137
  "test": "node --experimental-vm-modules ./node_modules/jest/bin/jest.js --coverage",
138
- "test.analysis": "cd test && npm run analysis.build-and-analyze",
138
+ "test.analysis": "cd test && npm ci && npm run analysis.build-and-analyze",
139
+ "test.bundle-size": "cd test/bundle-size && npm test",
139
140
  "test.bundlers": "cd test && npm run bundlers",
140
141
  "test.copytask": "cd test/copy-task && npm ci && npm run test",
141
142
  "test.dist": "npm run ts scripts/index.ts -- --validate-build",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot v4.41.1-dev.1768367277.5fd0ceb | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.41.1-dev.1768540084.3de7ba6 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -2128,11 +2128,6 @@ minimatch.Minimatch = Minimatch;
2128
2128
  minimatch.escape = escape;
2129
2129
  minimatch.unescape = unescape;
2130
2130
 
2131
- // src/utils/regular-expression.ts
2132
- var escapeRegExpSpecialCharacters = (text) => {
2133
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2134
- };
2135
-
2136
2131
  // src/utils/result.ts
2137
2132
  var result_exports = {};
2138
2133
  __export(result_exports, {
@@ -2316,18 +2311,6 @@ var _cssColonHostRe = new RegExp("(" + _polyfillHost + _parenSuffix, "gim");
2316
2311
  var _cssColonHostContextRe = new RegExp("(" + _polyfillHostContext + _parenSuffix, "gim");
2317
2312
  var _cssColonSlottedRe = new RegExp("(" + _polyfillSlotted + _parenSuffix, "gim");
2318
2313
  var _polyfillHostNoCombinator = _polyfillHost + "-no-combinator";
2319
- var createSupportsRuleRe = (selector) => {
2320
- const safeSelector = escapeRegExpSpecialCharacters(selector);
2321
- return new RegExp(
2322
- // First capture group: match any context before the selector that's not inside @supports selector()
2323
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
2324
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector}))(${safeSelector}\\b)`,
2325
- "g"
2326
- );
2327
- };
2328
- var _colonSlottedRe = createSupportsRuleRe("::slotted");
2329
- var _colonHostRe = createSupportsRuleRe(":host");
2330
- var _colonHostContextRe = createSupportsRuleRe(":host-context");
2331
2314
 
2332
2315
  // src/runtime/vdom/set-accessor.ts
2333
2316
  var CAPTURE_EVENT_SUFFIX = "Capture";
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "4.41.1-dev.1768367277.5fd0ceb",
3
+ "version": "4.41.1-dev.1768540084.3de7ba6",
4
4
  "description": "Stencil Screenshot.",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot Pixel Match v4.41.1-dev.1768367277.5fd0ceb | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.41.1-dev.1768540084.3de7ba6 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;