@stencil/core 4.35.3 → 4.36.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.
@@ -80,6 +80,7 @@ __export(index_exports, {
80
80
  styles: () => styles,
81
81
  supportsConstructableStylesheets: () => supportsConstructableStylesheets,
82
82
  supportsListenerOptions: () => supportsListenerOptions,
83
+ supportsMutableAdoptedStyleSheets: () => supportsMutableAdoptedStyleSheets,
83
84
  supportsShadow: () => supportsShadow,
84
85
  win: () => win,
85
86
  writeTask: () => writeTask
@@ -310,6 +311,7 @@ var setPlatformHelpers = (helpers) => {
310
311
  };
311
312
  var supportsListenerOptions = true;
312
313
  var supportsConstructableStylesheets = false;
314
+ var supportsMutableAdoptedStyleSheets = false;
313
315
  var setSupportsShadowDom = (supports) => {
314
316
  supportsShadow = supports;
315
317
  };
@@ -609,7 +611,13 @@ function createShadowRoot(cmpMeta) {
609
611
  delegatesFocus: !!(cmpMeta.$flags$ & 16 /* shadowDelegatesFocus */)
610
612
  }) : this.attachShadow({ mode: "open" });
611
613
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported(globalStyles)) != null ? _a : null;
612
- if (globalStyleSheet) shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
614
+ if (globalStyleSheet) {
615
+ if (supportsMutableAdoptedStyleSheets) {
616
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
617
+ } else {
618
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
619
+ }
620
+ }
613
621
  }
614
622
 
615
623
  // src/utils/util.ts
@@ -1156,6 +1164,9 @@ var validNodesPatches = [
1156
1164
  "parentNode"
1157
1165
  ];
1158
1166
  function patchHostOriginalAccessor(accessorName, node) {
1167
+ if (!globalThis.Node || !globalThis.Element) {
1168
+ return;
1169
+ }
1159
1170
  let accessor;
1160
1171
  if (validElementPatches.includes(accessorName)) {
1161
1172
  accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
@@ -1322,7 +1333,11 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1322
1333
  if (supportsConstructableStylesheets) {
1323
1334
  const stylesheet = new CSSStyleSheet();
1324
1335
  stylesheet.replaceSync(style);
1325
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1336
+ if (supportsMutableAdoptedStyleSheets) {
1337
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
1338
+ } else {
1339
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
1340
+ }
1326
1341
  } else {
1327
1342
  const existingStyleContainer = styleContainerNode.querySelector("style");
1328
1343
  if (existingStyleContainer) {
@@ -1347,7 +1362,11 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
1347
1362
  }
1348
1363
  }
1349
1364
  } else if (import_app_data5.BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
1350
- styleContainerNode.adoptedStyleSheets.push(style);
1365
+ if (supportsMutableAdoptedStyleSheets) {
1366
+ styleContainerNode.adoptedStyleSheets.push(style);
1367
+ } else {
1368
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
1369
+ }
1351
1370
  }
1352
1371
  }
1353
1372
  return scopeId2;
@@ -1523,7 +1542,7 @@ var validateInputProperties = (inputElm) => {
1523
1542
 
1524
1543
  // src/runtime/client-hydrate.ts
1525
1544
  var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1526
- var _a, _b;
1545
+ var _a, _b, _c;
1527
1546
  const endHydrate = createTime("hydrateClient", tagName);
1528
1547
  const shadowRoot = hostElm.shadowRoot;
1529
1548
  const childRenderNodes = [];
@@ -1587,15 +1606,17 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1587
1606
  if (childRenderNode.$tag$ === "slot") {
1588
1607
  node["s-cr"] = hostElm["s-cr"];
1589
1608
  }
1590
- } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && !childRenderNode.$elm$.shadowRoot) {
1609
+ } else if (((_b = childRenderNode.$tag$) == null ? void 0 : _b.toString().includes("-")) && childRenderNode.$tag$ !== "slot-fb" && !childRenderNode.$elm$.shadowRoot) {
1591
1610
  const cmpMeta = getHostRef(childRenderNode.$elm$);
1592
- const scopeId3 = getScopeId(
1593
- cmpMeta.$cmpMeta$,
1594
- import_app_data7.BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1595
- );
1596
- const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1597
- if (styleSheet) {
1598
- hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1611
+ if (cmpMeta) {
1612
+ const scopeId3 = getScopeId(
1613
+ cmpMeta.$cmpMeta$,
1614
+ import_app_data7.BUILD.mode ? childRenderNode.$elm$.getAttribute("s-mode") : void 0
1615
+ );
1616
+ const styleSheet = win.document.querySelector(`style[sty-id="${scopeId3}"]`);
1617
+ if (styleSheet) {
1618
+ hostElm.shadowRoot.append(styleSheet.cloneNode(true));
1619
+ }
1599
1620
  }
1600
1621
  }
1601
1622
  if (childRenderNode.$tag$ === "slot") {
@@ -1643,6 +1664,9 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1643
1664
  }
1644
1665
  if (!hosts[slottedItem.hostId]) continue;
1645
1666
  const hostEle = hosts[slottedItem.hostId];
1667
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1668
+ hostEle.appendChild(slottedItem.node);
1669
+ }
1646
1670
  if (!hostEle.shadowRoot || !shadowRoot) {
1647
1671
  if (!slottedItem.slot["s-cr"]) {
1648
1672
  slottedItem.slot["s-cr"] = hostEle["s-cr"];
@@ -1653,13 +1677,13 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1653
1677
  }
1654
1678
  }
1655
1679
  addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1680
+ if (((_c = slottedItem.node.parentElement) == null ? void 0 : _c.shadowRoot) && slottedItem.node["getAttribute"] && slottedItem.node.getAttribute("slot")) {
1681
+ slottedItem.node.removeAttribute("slot");
1682
+ }
1656
1683
  if (import_app_data7.BUILD.experimentalSlotFixes) {
1657
1684
  patchSlottedNode(slottedItem.node);
1658
1685
  }
1659
1686
  }
1660
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1661
- hostEle.appendChild(slottedItem.node);
1662
- }
1663
1687
  }
1664
1688
  }
1665
1689
  if (import_app_data7.BUILD.scoped && scopeId2 && slotNodes.length) {
@@ -1672,7 +1696,10 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1672
1696
  const rnLen = shadowRootNodes.length;
1673
1697
  if (rnLen) {
1674
1698
  for (rnIdex; rnIdex < rnLen; rnIdex++) {
1675
- shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1699
+ const node = shadowRootNodes[rnIdex];
1700
+ if (node) {
1701
+ shadowRoot.appendChild(node);
1702
+ }
1676
1703
  }
1677
1704
  Array.from(hostElm.childNodes).forEach((node) => {
1678
1705
  if (typeof node["s-en"] !== "string" && typeof node["s-sn"] !== "string") {
@@ -1931,13 +1958,17 @@ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNod
1931
1958
  parentVNode.$children$[childVNode.$index$] = childVNode;
1932
1959
  }
1933
1960
  var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1961
+ var _a, _b;
1934
1962
  let slottedNode = slotNode.nextSibling;
1935
1963
  slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1936
- while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */ || slottedNode.tagName === "SLOT"))) {
1937
- slottedNode["s-sn"] = slotName;
1938
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1939
- slottedNode = slottedNode.nextSibling;
1940
- }
1964
+ if (!slottedNode || ((_a = slottedNode.nodeValue) == null ? void 0 : _a.startsWith(SLOT_NODE_ID + "."))) return;
1965
+ do {
1966
+ if (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (!slottedNode["getAttribute"] || !slottedNode.getAttribute("slot")) && (slottedNode.nodeType === 8 /* CommentNode */ || slottedNode.nodeType === 3 /* TextNode */))) {
1967
+ slottedNode["s-sn"] = slotName;
1968
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1969
+ }
1970
+ slottedNode = slottedNode == null ? void 0 : slottedNode.nextSibling;
1971
+ } while (slottedNode && !((_b = slottedNode.nodeValue) == null ? void 0 : _b.startsWith(SLOT_NODE_ID + ".")));
1941
1972
  };
1942
1973
  var findCorrespondingNode = (node, type) => {
1943
1974
  let sibling = node;
@@ -2359,7 +2390,10 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
2359
2390
  // src/runtime/mode.ts
2360
2391
  var computeMode = (elm) => modeResolutionChain.map((h2) => h2(elm)).find((m) => !!m);
2361
2392
  var setMode = (handler) => modeResolutionChain.push(handler);
2362
- var getMode = (ref) => getHostRef(ref).$modeName$;
2393
+ var getMode = (ref) => {
2394
+ var _a;
2395
+ return (_a = getHostRef(ref)) == null ? void 0 : _a.$modeName$;
2396
+ };
2363
2397
 
2364
2398
  // src/runtime/proxy-component.ts
2365
2399
  var import_app_data16 = require("@stencil/core/internal/app-data");
@@ -2408,7 +2442,10 @@ var import_app_data10 = require("@stencil/core/internal/app-data");
2408
2442
 
2409
2443
  // src/runtime/element.ts
2410
2444
  var import_app_data9 = require("@stencil/core/internal/app-data");
2411
- var getElement = (ref) => import_app_data9.BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref;
2445
+ var getElement = (ref) => {
2446
+ var _a;
2447
+ return import_app_data9.BUILD.lazyLoad ? (_a = getHostRef(ref)) == null ? void 0 : _a.$hostElement$ : ref;
2448
+ };
2412
2449
 
2413
2450
  // src/runtime/event-emitter.ts
2414
2451
  var createEvent = (ref, name, flags) => {
@@ -3208,6 +3245,12 @@ var scheduleUpdate = (hostRef, isInitialLoad) => {
3208
3245
  }
3209
3246
  attachToAncestor(hostRef, hostRef.$ancestorComponent$);
3210
3247
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
3248
+ if (isInitialLoad) {
3249
+ queueMicrotask(() => {
3250
+ dispatch();
3251
+ });
3252
+ return;
3253
+ }
3211
3254
  return import_app_data14.BUILD.taskQueue ? writeTask(dispatch) : dispatch();
3212
3255
  };
3213
3256
  var dispatchHooks = (hostRef, isInitialLoad) => {
@@ -3397,9 +3440,10 @@ var postUpdateComponent = (hostRef) => {
3397
3440
  }
3398
3441
  };
3399
3442
  var forceUpdate = (ref) => {
3443
+ var _a;
3400
3444
  if (import_app_data14.BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
3401
3445
  const hostRef = getHostRef(ref);
3402
- const isConnected = hostRef.$hostElement$.isConnected;
3446
+ const isConnected = (_a = hostRef == null ? void 0 : hostRef.$hostElement$) == null ? void 0 : _a.isConnected;
3403
3447
  if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3404
3448
  scheduleUpdate(hostRef, false);
3405
3449
  }
@@ -3464,6 +3508,9 @@ var serverSideConnected = (elm) => {
3464
3508
  var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
3465
3509
  var setValue = (ref, propName, newVal, cmpMeta) => {
3466
3510
  const hostRef = getHostRef(ref);
3511
+ if (!hostRef) {
3512
+ return;
3513
+ }
3467
3514
  if (import_app_data15.BUILD.lazyLoad && !hostRef) {
3468
3515
  throw new Error(
3469
3516
  `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
@@ -3545,10 +3592,11 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3545
3592
  const originalFormAssociatedCallback = prototype[cbName];
3546
3593
  Object.defineProperty(prototype, cbName, {
3547
3594
  value(...args) {
3595
+ var _a2;
3548
3596
  const hostRef = getHostRef(this);
3549
- const instance = import_app_data16.BUILD.lazyLoad ? hostRef.$lazyInstance$ : this;
3597
+ const instance = import_app_data16.BUILD.lazyLoad ? hostRef == null ? void 0 : hostRef.$lazyInstance$ : this;
3550
3598
  if (!instance) {
3551
- hostRef.$onReadyPromise$.then((asyncInstance) => {
3599
+ (_a2 = hostRef == null ? void 0 : hostRef.$onReadyPromise$) == null ? void 0 : _a2.then((asyncInstance) => {
3552
3600
  const cb = asyncInstance[cbName];
3553
3601
  typeof cb === "function" && cb.call(asyncInstance, ...args);
3554
3602
  });
@@ -3593,6 +3641,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
3593
3641
  Object.defineProperty(prototype, memberName, {
3594
3642
  set(newValue) {
3595
3643
  const ref = getHostRef(this);
3644
+ if (!ref) {
3645
+ return;
3646
+ }
3596
3647
  if (import_app_data16.BUILD.isDev) {
3597
3648
  if (
3598
3649
  // we are proxying the instance (not element)
@@ -3690,7 +3741,7 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3690
3741
  } else if (propName == null) {
3691
3742
  const hostRef = getHostRef(this);
3692
3743
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
3693
- if (flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
3744
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
3694
3745
  const elm = import_app_data16.BUILD.lazyLoad ? hostRef.$hostElement$ : this;
3695
3746
  const instance = import_app_data16.BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
3696
3747
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
@@ -3824,6 +3875,9 @@ var fireConnectedCallback = (instance, elm) => {
3824
3875
  var connectedCallback = (elm) => {
3825
3876
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3826
3877
  const hostRef = getHostRef(elm);
3878
+ if (!hostRef) {
3879
+ return;
3880
+ }
3827
3881
  const cmpMeta = hostRef.$cmpMeta$;
3828
3882
  const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3829
3883
  if (import_app_data18.BUILD.hostListenerTargetParent) {
@@ -3849,11 +3903,6 @@ var connectedCallback = (elm) => {
3849
3903
  if (import_app_data18.BUILD.hydrateServerSide || (import_app_data18.BUILD.slot || import_app_data18.BUILD.shadowDom) && // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3850
3904
  cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
3851
3905
  setContentReference(elm);
3852
- } else if (import_app_data18.BUILD.hydrateClientSide && !(cmpMeta.$flags$ & 4 /* hasSlotRelocation */)) {
3853
- const commendPlaceholder = elm.firstChild;
3854
- if ((commendPlaceholder == null ? void 0 : commendPlaceholder.nodeType) === 8 /* CommentNode */ && !commendPlaceholder["s-cn"] && !commendPlaceholder.nodeValue) {
3855
- elm.removeChild(commendPlaceholder);
3856
- }
3857
3906
  }
3858
3907
  }
3859
3908
  if (import_app_data18.BUILD.asyncLoading) {
@@ -3912,7 +3961,7 @@ var disconnectedCallback = async (elm) => {
3912
3961
  if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3913
3962
  const hostRef = getHostRef(elm);
3914
3963
  if (import_app_data19.BUILD.hostListener) {
3915
- if (hostRef.$rmListeners$) {
3964
+ if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
3916
3965
  hostRef.$rmListeners$.map((rmListener) => rmListener());
3917
3966
  hostRef.$rmListeners$ = void 0;
3918
3967
  }
@@ -3958,7 +4007,7 @@ var proxyCustomElement = (Cstr, compactMeta) => {
3958
4007
  cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
3959
4008
  }
3960
4009
  if (import_app_data20.BUILD.experimentalSlotFixes) {
3961
- if (import_app_data20.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4010
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
3962
4011
  patchPseudoShadowDom(Cstr.prototype);
3963
4012
  }
3964
4013
  } else {
@@ -3988,6 +4037,9 @@ var proxyCustomElement = (Cstr, compactMeta) => {
3988
4037
  connectedCallback() {
3989
4038
  if (!this.__hasHostListenerAttached) {
3990
4039
  const hostRef = getHostRef(this);
4040
+ if (!hostRef) {
4041
+ return;
4042
+ }
3991
4043
  addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
3992
4044
  this.__hasHostListenerAttached = true;
3993
4045
  }
@@ -4025,7 +4077,7 @@ var forceModeUpdate = (elm) => {
4025
4077
  if (import_app_data20.BUILD.style && import_app_data20.BUILD.mode && !import_app_data20.BUILD.lazyLoad) {
4026
4078
  const mode = computeMode(elm);
4027
4079
  const hostRef = getHostRef(elm);
4028
- if (hostRef.$modeName$ !== mode) {
4080
+ if (hostRef && hostRef.$modeName$ !== mode) {
4029
4081
  const cmpMeta = hostRef.$cmpMeta$;
4030
4082
  const oldScopeId = elm["s-sc"];
4031
4083
  const scopeId2 = getScopeId(cmpMeta, mode);
@@ -4050,6 +4102,9 @@ var import_app_data21 = require("@stencil/core/internal/app-data");
4050
4102
  // src/runtime/hmr-component.ts
4051
4103
  var hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
4052
4104
  const hostRef = getHostRef(hostElement);
4105
+ if (!hostRef) {
4106
+ return;
4107
+ }
4053
4108
  hostRef.$flags$ = 1 /* hasConnected */;
4054
4109
  initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
4055
4110
  };
@@ -4142,6 +4197,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4142
4197
  }
4143
4198
  connectedCallback() {
4144
4199
  const hostRef = getHostRef(this);
4200
+ if (!hostRef) {
4201
+ return;
4202
+ }
4145
4203
  if (!this.hasRegisteredEventListeners) {
4146
4204
  this.hasRegisteredEventListeners = true;
4147
4205
  addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
@@ -4161,6 +4219,9 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4161
4219
  plt.raf(() => {
4162
4220
  var _a3;
4163
4221
  const hostRef = getHostRef(this);
4222
+ if (!hostRef) {
4223
+ return;
4224
+ }
4164
4225
  const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
4165
4226
  if (i2 > -1) {
4166
4227
  deferredConnectedCallbacks.splice(i2, 1);
@@ -4171,11 +4232,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
4171
4232
  });
4172
4233
  }
4173
4234
  componentOnReady() {
4174
- return getHostRef(this).$onReadyPromise$;
4235
+ var _a3;
4236
+ return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
4175
4237
  }
4176
4238
  };
4177
4239
  if (import_app_data21.BUILD.experimentalSlotFixes) {
4178
- if (import_app_data21.BUILD.scoped && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4240
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
4179
4241
  patchPseudoShadowDom(HostElement.prototype);
4180
4242
  }
4181
4243
  } else {
@@ -4531,6 +4593,7 @@ var scopedSSR = false;
4531
4593
  styles,
4532
4594
  supportsConstructableStylesheets,
4533
4595
  supportsListenerOptions,
4596
+ supportsMutableAdoptedStyleSheets,
4534
4597
  supportsShadow,
4535
4598
  win,
4536
4599
  writeTask
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/testing",
3
- "version": "4.35.3",
3
+ "version": "4.36.0",
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.35.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc (CommonJS) v4.36.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __defProp = Object.defineProperty;
@@ -6263,6 +6263,11 @@ function* streamToHtml(node, opts, output) {
6263
6263
  const mode = ` shadowrootmode="open"`;
6264
6264
  yield mode;
6265
6265
  output.currentLineWidth += mode.length;
6266
+ if (node.delegatesFocus) {
6267
+ const delegatesFocusAttr = " shadowrootdelegatesfocus";
6268
+ yield delegatesFocusAttr;
6269
+ output.currentLineWidth += delegatesFocusAttr.length;
6270
+ }
6266
6271
  }
6267
6272
  const attrsLength = node.attributes.length;
6268
6273
  const attributes = opts.prettyHtml && attrsLength > 1 ? cloneAttributes(node.attributes, true) : node.attributes;
@@ -6828,7 +6833,9 @@ var MockElement = class extends MockNode2 {
6828
6833
  addEventListener(this, type, handler);
6829
6834
  }
6830
6835
  attachShadow(_opts) {
6836
+ var _a;
6831
6837
  const shadowRoot = this.ownerDocument.createDocumentFragment();
6838
+ shadowRoot.delegatesFocus = (_a = _opts.delegatesFocus) != null ? _a : false;
6832
6839
  this.shadowRoot = shadowRoot;
6833
6840
  return shadowRoot;
6834
6841
  }
package/mock-doc/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- Stencil Mock Doc v4.35.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Mock Doc v4.36.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/runtime/runtime-constants.ts
@@ -6210,6 +6210,11 @@ function* streamToHtml(node, opts, output) {
6210
6210
  const mode = ` shadowrootmode="open"`;
6211
6211
  yield mode;
6212
6212
  output.currentLineWidth += mode.length;
6213
+ if (node.delegatesFocus) {
6214
+ const delegatesFocusAttr = " shadowrootdelegatesfocus";
6215
+ yield delegatesFocusAttr;
6216
+ output.currentLineWidth += delegatesFocusAttr.length;
6217
+ }
6213
6218
  }
6214
6219
  const attrsLength = node.attributes.length;
6215
6220
  const attributes = opts.prettyHtml && attrsLength > 1 ? cloneAttributes(node.attributes, true) : node.attributes;
@@ -6775,7 +6780,9 @@ var MockElement = class extends MockNode2 {
6775
6780
  addEventListener(this, type, handler);
6776
6781
  }
6777
6782
  attachShadow(_opts) {
6783
+ var _a;
6778
6784
  const shadowRoot = this.ownerDocument.createDocumentFragment();
6785
+ shadowRoot.delegatesFocus = (_a = _opts.delegatesFocus) != null ? _a : false;
6779
6786
  this.shadowRoot = shadowRoot;
6780
6787
  return shadowRoot;
6781
6788
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/mock-doc",
3
- "version": "4.35.3",
3
+ "version": "4.36.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": "4.35.3",
3
+ "version": "4.36.0",
4
4
  "license": "MIT",
5
5
  "main": "./internal/stencil-core/index.cjs",
6
6
  "module": "./internal/stencil-core/index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Screenshot v4.35.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot v4.36.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/screenshot",
3
- "version": "4.35.3",
3
+ "version": "4.36.0",
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.35.3 | MIT Licensed | https://stenciljs.com
2
+ Stencil Screenshot Pixel Match v4.36.0 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  "use strict";
5
5
  var __create = Object.create;