@stencil/core 4.42.0 → 4.42.1-dev.1770615146.e130b7a

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 (46) hide show
  1. package/cli/index.cjs +1 -1
  2. package/cli/index.js +1 -1
  3. package/cli/package.json +1 -1
  4. package/compiler/package.json +1 -1
  5. package/compiler/stencil.js +289 -20
  6. package/dev-server/client/index.js +1 -1
  7. package/dev-server/client/package.json +1 -1
  8. package/dev-server/connector.html +2 -2
  9. package/dev-server/index.js +1 -1
  10. package/dev-server/package.json +1 -1
  11. package/dev-server/server-process.js +2 -2
  12. package/internal/app-data/package.json +1 -1
  13. package/internal/app-globals/package.json +1 -1
  14. package/internal/client/index.js +201 -166
  15. package/internal/client/package.json +1 -1
  16. package/internal/client/patch-browser.js +1 -1
  17. package/internal/client/shadow-css.js +1 -1
  18. package/internal/hydrate/index.js +202 -167
  19. package/internal/hydrate/package.json +1 -1
  20. package/internal/hydrate/runner.js +56 -22
  21. package/internal/package.json +1 -1
  22. package/internal/stencil-core/index.d.ts +1 -0
  23. package/internal/stencil-private.d.ts +6 -0
  24. package/internal/stencil-public-compiler.d.ts +34 -0
  25. package/internal/stencil-public-runtime.d.ts +0 -4
  26. package/internal/testing/index.js +201 -166
  27. package/internal/testing/package.json +1 -1
  28. package/mock-doc/index.cjs +56 -22
  29. package/mock-doc/index.d.ts +10 -2
  30. package/mock-doc/index.js +56 -22
  31. package/mock-doc/package.json +1 -1
  32. package/package.json +1 -1
  33. package/screenshot/index.js +1 -1
  34. package/screenshot/package.json +1 -1
  35. package/screenshot/pixel-match.js +1 -1
  36. package/sys/node/460.node-fetch.js +3 -3
  37. package/sys/node/autoprefixer.js +2 -2
  38. package/sys/node/glob.js +1 -1
  39. package/sys/node/graceful-fs.js +1 -1
  40. package/sys/node/index.js +28 -28
  41. package/sys/node/node-fetch.js +4 -4
  42. package/sys/node/package.json +1 -1
  43. package/sys/node/prompts.js +1 -1
  44. package/sys/node/worker.js +1 -1
  45. package/testing/index.js +13 -1
  46. package/testing/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.42.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.42.1-dev.1770615146.e130b7a | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-patch-browser.ts
@@ -402,7 +402,7 @@ var scopeCss = (cssText, scopeId, commentOriginalSelector) => {
402
402
  });
403
403
  }
404
404
  scoped.slottedSelectors.forEach((slottedSelector) => {
405
- const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
405
+ const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector) + "(?=\\s*[,{]|$)", "g");
406
406
  cssText = cssText.replace(regex, slottedSelector.updatedSelector);
407
407
  });
408
408
  cssText = expandPartSelectors(cssText);
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Hydrate Platform v4.42.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Platform v4.42.1-dev.1770615146.e130b7a | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -2156,7 +2156,7 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
2156
2156
  });
2157
2157
  }
2158
2158
  scoped.slottedSelectors.forEach((slottedSelector) => {
2159
- const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
2159
+ const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector) + "(?=\\s*[,{]|$)", "g");
2160
2160
  cssText = cssText.replace(regex, slottedSelector.updatedSelector);
2161
2161
  });
2162
2162
  cssText = expandPartSelectors(cssText);
@@ -2419,7 +2419,20 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
2419
2419
  }
2420
2420
  }
2421
2421
  } else if (BUILD12.vdomPropOrAttr && memberName[0] === "a" && memberName.startsWith("attr:")) {
2422
- const attrName = memberName.slice(5);
2422
+ const propName = memberName.slice(5);
2423
+ let attrName;
2424
+ if (BUILD12.member) {
2425
+ const hostRef = getHostRef(elm);
2426
+ if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
2427
+ const memberMeta = hostRef.$cmpMeta$.$members$[propName];
2428
+ if (memberMeta && memberMeta[1]) {
2429
+ attrName = memberMeta[1];
2430
+ }
2431
+ }
2432
+ }
2433
+ if (!attrName) {
2434
+ attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
2435
+ }
2423
2436
  if (newValue == null || newValue === false) {
2424
2437
  if (newValue !== false || elm.getAttribute(attrName) === "") {
2425
2438
  elm.removeAttribute(attrName);
@@ -3275,7 +3288,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3275
3288
  if (childrenPromises.length === 0) {
3276
3289
  postUpdate();
3277
3290
  } else {
3278
- Promise.all(childrenPromises).then(postUpdate);
3291
+ Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
3279
3292
  hostRef.$flags$ |= 4 /* isWaitingForChildren */;
3280
3293
  childrenPromises.length = 0;
3281
3294
  }
@@ -3536,13 +3549,16 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
3536
3549
  });
3537
3550
  }
3538
3551
  }
3539
- if (BUILD16.updatable && (flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3552
+ if (BUILD16.updatable && flags & 2 /* hasRendered */) {
3540
3553
  if (instance.componentShouldUpdate) {
3541
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
3554
+ const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
3555
+ if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
3542
3556
  return;
3543
3557
  }
3544
3558
  }
3545
- scheduleUpdate(hostRef, false);
3559
+ if (!(flags & 16 /* isQueuedForUpdate */)) {
3560
+ scheduleUpdate(hostRef, false);
3561
+ }
3546
3562
  }
3547
3563
  }
3548
3564
  };
@@ -3790,94 +3806,105 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3790
3806
  // src/runtime/initialize-component.ts
3791
3807
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3792
3808
  let Cstr;
3793
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3794
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3795
- const bundleId = cmpMeta.$lazyBundleId$;
3796
- if (BUILD18.lazyLoad && bundleId) {
3797
- const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3798
- if (CstrImport && "then" in CstrImport) {
3799
- const endLoad = uniqueTime(
3800
- `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3801
- `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3802
- );
3803
- Cstr = await CstrImport;
3804
- endLoad();
3805
- } else {
3806
- Cstr = CstrImport;
3807
- }
3808
- if (!Cstr) {
3809
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3810
- }
3811
- if (BUILD18.member && !Cstr.isProxied) {
3809
+ try {
3810
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3811
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3812
+ const bundleId = cmpMeta.$lazyBundleId$;
3813
+ if (BUILD18.lazyLoad && bundleId) {
3814
+ const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3815
+ if (CstrImport && "then" in CstrImport) {
3816
+ const endLoad = uniqueTime(
3817
+ `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3818
+ `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3819
+ );
3820
+ Cstr = await CstrImport;
3821
+ endLoad();
3822
+ } else {
3823
+ Cstr = CstrImport;
3824
+ }
3825
+ if (!Cstr) {
3826
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3827
+ }
3828
+ if (BUILD18.member && !Cstr.isProxied) {
3829
+ if (BUILD18.propChangeCallback) {
3830
+ cmpMeta.$watchers$ = Cstr.watchers;
3831
+ cmpMeta.$serializers$ = Cstr.serializers;
3832
+ cmpMeta.$deserializers$ = Cstr.deserializers;
3833
+ }
3834
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3835
+ Cstr.isProxied = true;
3836
+ }
3837
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3838
+ if (BUILD18.member) {
3839
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
3840
+ }
3841
+ try {
3842
+ new Cstr(hostRef);
3843
+ } catch (e) {
3844
+ consoleError(e, elm);
3845
+ }
3846
+ if (BUILD18.member) {
3847
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3848
+ }
3812
3849
  if (BUILD18.propChangeCallback) {
3813
- cmpMeta.$watchers$ = Cstr.watchers;
3814
- cmpMeta.$serializers$ = Cstr.serializers;
3815
- cmpMeta.$deserializers$ = Cstr.deserializers;
3850
+ hostRef.$flags$ |= 128 /* isWatchReady */;
3851
+ }
3852
+ endNewInstance();
3853
+ const needsDeferredCallback = BUILD18.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
3854
+ if (!needsDeferredCallback) {
3855
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3856
+ } else {
3857
+ hostRef.$deferredConnectedCallback$ = true;
3816
3858
  }
3817
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3818
- Cstr.isProxied = true;
3819
- }
3820
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3821
- if (BUILD18.member) {
3822
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
3823
- }
3824
- try {
3825
- new Cstr(hostRef);
3826
- } catch (e) {
3827
- consoleError(e, elm);
3828
- }
3829
- if (BUILD18.member) {
3830
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3831
- }
3832
- if (BUILD18.propChangeCallback) {
3833
- hostRef.$flags$ |= 128 /* isWatchReady */;
3834
- }
3835
- endNewInstance();
3836
- const needsDeferredCallback = BUILD18.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
3837
- if (!needsDeferredCallback) {
3838
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
3839
3859
  } else {
3840
- hostRef.$deferredConnectedCallback$ = true;
3841
- }
3842
- } else {
3843
- Cstr = elm.constructor;
3844
- const cmpTag = elm.localName;
3845
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3846
- }
3847
- if (BUILD18.style && Cstr && Cstr.style) {
3848
- let style;
3849
- if (typeof Cstr.style === "string") {
3850
- style = Cstr.style;
3851
- } else if (BUILD18.mode && typeof Cstr.style !== "string") {
3852
- hostRef.$modeName$ = computeMode(elm);
3853
- if (hostRef.$modeName$) {
3854
- style = Cstr.style[hostRef.$modeName$];
3855
- }
3856
- if (BUILD18.hydrateServerSide && hostRef.$modeName$) {
3857
- elm.setAttribute("s-mode", hostRef.$modeName$);
3858
- }
3859
- }
3860
- const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3861
- if (!styles.has(scopeId2) || BUILD18.hotModuleReplacement && hmrVersionId) {
3862
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3863
- if (BUILD18.hydrateServerSide && BUILD18.shadowDom) {
3864
- if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3865
- style = scopeCss(style, scopeId2, true);
3866
- } else if (needsScopedSSR()) {
3867
- style = expandPartSelectors(style);
3860
+ Cstr = elm.constructor;
3861
+ const cmpTag = elm.localName;
3862
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3863
+ }
3864
+ if (BUILD18.style && Cstr && Cstr.style) {
3865
+ let style;
3866
+ if (typeof Cstr.style === "string") {
3867
+ style = Cstr.style;
3868
+ } else if (BUILD18.mode && typeof Cstr.style !== "string") {
3869
+ hostRef.$modeName$ = computeMode(elm);
3870
+ if (hostRef.$modeName$) {
3871
+ style = Cstr.style[hostRef.$modeName$];
3872
+ }
3873
+ if (BUILD18.hydrateServerSide && hostRef.$modeName$) {
3874
+ elm.setAttribute("s-mode", hostRef.$modeName$);
3875
+ }
3876
+ }
3877
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3878
+ if (!styles.has(scopeId2) || BUILD18.hotModuleReplacement && hmrVersionId) {
3879
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3880
+ if (BUILD18.hydrateServerSide && BUILD18.shadowDom) {
3881
+ if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3882
+ style = scopeCss(style, scopeId2, true);
3883
+ } else if (needsScopedSSR()) {
3884
+ style = expandPartSelectors(style);
3885
+ }
3868
3886
  }
3887
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3888
+ endRegisterStyles();
3869
3889
  }
3870
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3871
- endRegisterStyles();
3872
3890
  }
3873
3891
  }
3874
- }
3875
- const ancestorComponent = hostRef.$ancestorComponent$;
3876
- const schedule = () => scheduleUpdate(hostRef, true);
3877
- if (BUILD18.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3878
- ancestorComponent["s-rc"].push(schedule);
3879
- } else {
3880
- schedule();
3892
+ const ancestorComponent = hostRef.$ancestorComponent$;
3893
+ const schedule = () => scheduleUpdate(hostRef, true);
3894
+ if (BUILD18.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3895
+ ancestorComponent["s-rc"].push(schedule);
3896
+ } else {
3897
+ schedule();
3898
+ }
3899
+ } catch (e) {
3900
+ consoleError(e, elm);
3901
+ if (BUILD18.asyncLoading && hostRef.$onRenderResolve$) {
3902
+ hostRef.$onRenderResolve$();
3903
+ hostRef.$onRenderResolve$ = void 0;
3904
+ }
3905
+ if (BUILD18.asyncLoading && hostRef.$onReadyResolve$) {
3906
+ hostRef.$onReadyResolve$(elm);
3907
+ }
3881
3908
  }
3882
3909
  };
3883
3910
  var fireConnectedCallback = (instance, elm) => {
@@ -4009,91 +4036,99 @@ var proxyCustomElement = (Cstr, compactMeta) => {
4009
4036
  $flags$: compactMeta[0],
4010
4037
  $tagName$: compactMeta[1]
4011
4038
  };
4012
- if (BUILD21.member) {
4013
- cmpMeta.$members$ = compactMeta[2];
4014
- }
4015
- if (BUILD21.hostListener) {
4016
- cmpMeta.$listeners$ = compactMeta[3];
4017
- }
4018
- if (BUILD21.propChangeCallback) {
4019
- cmpMeta.$watchers$ = Cstr.$watchers$;
4020
- cmpMeta.$deserializers$ = Cstr.$deserializers$;
4021
- cmpMeta.$serializers$ = Cstr.$serializers$;
4022
- }
4023
- if (BUILD21.reflect) {
4024
- cmpMeta.$attrsToReflect$ = [];
4025
- }
4026
- if (BUILD21.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4027
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
4028
- }
4029
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4030
- if (BUILD21.experimentalSlotFixes) {
4031
- patchPseudoShadowDom(Cstr.prototype);
4032
- } else {
4033
- if (BUILD21.slotChildNodesFix) {
4034
- patchChildSlotNodes(Cstr.prototype);
4035
- }
4036
- if (BUILD21.cloneNodeFix) {
4037
- patchCloneNode(Cstr.prototype);
4038
- }
4039
- if (BUILD21.appendChildSlotFix) {
4040
- patchSlotAppendChild(Cstr.prototype);
4041
- }
4042
- if (BUILD21.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4043
- patchTextContent(Cstr.prototype);
4044
- }
4039
+ try {
4040
+ if (BUILD21.member) {
4041
+ cmpMeta.$members$ = compactMeta[2];
4045
4042
  }
4046
- } else if (BUILD21.cloneNodeFix) {
4047
- patchCloneNode(Cstr.prototype);
4048
- }
4049
- if (BUILD21.hydrateClientSide && BUILD21.shadowDom) {
4050
- hydrateScopedToShadow();
4051
- }
4052
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
4053
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
4054
- Object.assign(Cstr.prototype, {
4055
- __hasHostListenerAttached: false,
4056
- __registerHost() {
4057
- registerHost(this, cmpMeta);
4058
- },
4059
- connectedCallback() {
4060
- if (!this.__hasHostListenerAttached) {
4061
- const hostRef = getHostRef(this);
4062
- if (!hostRef) {
4063
- return;
4043
+ if (BUILD21.hostListener) {
4044
+ cmpMeta.$listeners$ = compactMeta[3];
4045
+ }
4046
+ if (BUILD21.propChangeCallback) {
4047
+ cmpMeta.$watchers$ = Cstr.$watchers$;
4048
+ cmpMeta.$deserializers$ = Cstr.$deserializers$;
4049
+ cmpMeta.$serializers$ = Cstr.$serializers$;
4050
+ }
4051
+ if (BUILD21.reflect) {
4052
+ cmpMeta.$attrsToReflect$ = [];
4053
+ }
4054
+ if (BUILD21.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4055
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
4056
+ }
4057
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4058
+ if (BUILD21.experimentalSlotFixes) {
4059
+ patchPseudoShadowDom(Cstr.prototype);
4060
+ } else {
4061
+ if (BUILD21.slotChildNodesFix) {
4062
+ patchChildSlotNodes(Cstr.prototype);
4063
+ }
4064
+ if (BUILD21.cloneNodeFix) {
4065
+ patchCloneNode(Cstr.prototype);
4066
+ }
4067
+ if (BUILD21.appendChildSlotFix) {
4068
+ patchSlotAppendChild(Cstr.prototype);
4069
+ }
4070
+ if (BUILD21.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4071
+ patchTextContent(Cstr.prototype);
4064
4072
  }
4065
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
4066
- this.__hasHostListenerAttached = true;
4067
- }
4068
- connectedCallback(this);
4069
- if (originalConnectedCallback) {
4070
- originalConnectedCallback.call(this);
4071
- }
4072
- },
4073
- disconnectedCallback() {
4074
- disconnectedCallback(this);
4075
- if (originalDisconnectedCallback) {
4076
- originalDisconnectedCallback.call(this);
4077
4073
  }
4078
- },
4079
- __attachShadow() {
4080
- if (supportsShadow) {
4081
- if (!this.shadowRoot) {
4082
- createShadowRoot.call(this, cmpMeta);
4083
- } else {
4084
- if (this.shadowRoot.mode !== "open") {
4085
- throw new Error(
4086
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
4087
- );
4074
+ } else if (BUILD21.cloneNodeFix) {
4075
+ patchCloneNode(Cstr.prototype);
4076
+ }
4077
+ if (BUILD21.hydrateClientSide && BUILD21.shadowDom) {
4078
+ hydrateScopedToShadow();
4079
+ }
4080
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
4081
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
4082
+ Object.assign(Cstr.prototype, {
4083
+ __hasHostListenerAttached: false,
4084
+ __registerHost() {
4085
+ registerHost(this, cmpMeta);
4086
+ },
4087
+ connectedCallback() {
4088
+ if (!this.__hasHostListenerAttached) {
4089
+ const hostRef = getHostRef(this);
4090
+ if (!hostRef) {
4091
+ return;
4088
4092
  }
4093
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
4094
+ this.__hasHostListenerAttached = true;
4095
+ }
4096
+ connectedCallback(this);
4097
+ if (originalConnectedCallback) {
4098
+ originalConnectedCallback.call(this);
4099
+ }
4100
+ },
4101
+ disconnectedCallback() {
4102
+ disconnectedCallback(this);
4103
+ if (originalDisconnectedCallback) {
4104
+ originalDisconnectedCallback.call(this);
4105
+ }
4106
+ },
4107
+ __attachShadow() {
4108
+ if (supportsShadow) {
4109
+ if (!this.shadowRoot) {
4110
+ createShadowRoot.call(this, cmpMeta);
4111
+ } else {
4112
+ if (this.shadowRoot.mode !== "open") {
4113
+ throw new Error(
4114
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
4115
+ );
4116
+ }
4117
+ }
4118
+ } else {
4119
+ this.shadowRoot = this;
4089
4120
  }
4090
- } else {
4091
- this.shadowRoot = this;
4092
4121
  }
4093
- }
4094
- });
4095
- Cstr.is = cmpMeta.$tagName$;
4096
- return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4122
+ });
4123
+ Object.defineProperty(Cstr, "is", {
4124
+ value: cmpMeta.$tagName$,
4125
+ configurable: true
4126
+ });
4127
+ return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4128
+ } catch (e) {
4129
+ consoleError(e);
4130
+ return Cstr;
4131
+ }
4097
4132
  };
4098
4133
  var forceModeUpdate = (elm) => {
4099
4134
  if (BUILD21.style && BUILD21.mode && !BUILD21.lazyLoad) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/hydrate",
3
- "version": "4.42.0",
3
+ "version": "4.42.1-dev.1770615146.e130b7a",
4
4
  "description": "Stencil internal hydrate 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 Hydrate Runner v4.42.0 | MIT Licensed | https://stenciljs.com
2
+ Stencil Hydrate Runner v4.42.1-dev.1770615146.e130b7a | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
  var __create = Object.create;
5
5
  var __defProp = Object.defineProperty;
@@ -12173,6 +12173,8 @@ function createElement(ownerDocument, tagName) {
12173
12173
  return new MockImageElement(ownerDocument);
12174
12174
  case "input":
12175
12175
  return new MockInputElement(ownerDocument);
12176
+ case "label":
12177
+ return new MockLabelElement(ownerDocument);
12176
12178
  case "link":
12177
12179
  return new MockLinkElement(ownerDocument);
12178
12180
  case "meta":
@@ -12251,6 +12253,9 @@ var MockButtonElement = class extends MockHTMLElement {
12251
12253
  constructor(ownerDocument) {
12252
12254
  super(ownerDocument, "button");
12253
12255
  }
12256
+ get labels() {
12257
+ return getLabelsForElement(this);
12258
+ }
12254
12259
  };
12255
12260
  patchPropAttributes(
12256
12261
  MockButtonElement.prototype,
@@ -12298,6 +12303,9 @@ var MockInputElement = class extends MockHTMLElement {
12298
12303
  }
12299
12304
  return null;
12300
12305
  }
12306
+ get labels() {
12307
+ return getLabelsForElement(this);
12308
+ }
12301
12309
  };
12302
12310
  patchPropAttributes(
12303
12311
  MockInputElement.prototype,
@@ -12346,6 +12354,26 @@ var MockFormElement = class extends MockHTMLElement {
12346
12354
  patchPropAttributes(MockFormElement.prototype, {
12347
12355
  name: String
12348
12356
  });
12357
+ var MockLabelElement = class extends MockHTMLElement {
12358
+ constructor(ownerDocument) {
12359
+ super(ownerDocument, "label");
12360
+ }
12361
+ get htmlFor() {
12362
+ return this.getAttributeNS(null, "for") || "";
12363
+ }
12364
+ set htmlFor(value) {
12365
+ this.setAttributeNS(null, "for", value);
12366
+ }
12367
+ get control() {
12368
+ var _a2, _b;
12369
+ const forAttr = this.htmlFor;
12370
+ if (forAttr) {
12371
+ return (_b = (_a2 = this.ownerDocument) == null ? void 0 : _a2.getElementById(forAttr)) != null ? _b : null;
12372
+ }
12373
+ const labelableSelector = 'button, input:not([type="hidden"]), meter, output, progress, select, textarea';
12374
+ return this.querySelector(labelableSelector);
12375
+ }
12376
+ };
12349
12377
  var MockLinkElement = class extends MockHTMLElement {
12350
12378
  constructor(ownerDocument) {
12351
12379
  super(ownerDocument, "link");
@@ -12756,6 +12784,30 @@ function fullUrl(elm, attrName) {
12756
12784
  }
12757
12785
  return val.replace(/\'|\"/g, "").trim();
12758
12786
  }
12787
+ function getLabelsForElement(elm) {
12788
+ const labels = [];
12789
+ const id = elm.id;
12790
+ const doc = elm.ownerDocument;
12791
+ if (doc) {
12792
+ if (id) {
12793
+ const allLabels = doc.getElementsByTagName("label");
12794
+ for (let i = 0; i < allLabels.length; i++) {
12795
+ const label = allLabels[i];
12796
+ if (label.htmlFor === id) {
12797
+ labels.push(label);
12798
+ }
12799
+ }
12800
+ }
12801
+ let parent = elm.parentNode;
12802
+ while (parent) {
12803
+ if (parent.nodeName === "LABEL" && !labels.includes(parent)) {
12804
+ labels.push(parent);
12805
+ }
12806
+ parent = parent.parentNode;
12807
+ }
12808
+ }
12809
+ return labels;
12810
+ }
12759
12811
  function patchPropAttributes(prototype, attrs, defaults2 = {}) {
12760
12812
  Object.keys(attrs).forEach((propName) => {
12761
12813
  const attr = attrs[propName];
@@ -13446,7 +13498,6 @@ var MockWindow = class {
13446
13498
  __timeouts;
13447
13499
  __history;
13448
13500
  __elementCstr;
13449
- __htmlElementCstr;
13450
13501
  __charDataCstr;
13451
13502
  __docTypeCstr;
13452
13503
  __docCstr;
@@ -13653,27 +13704,10 @@ var MockWindow = class {
13653
13704
  return JSON;
13654
13705
  }
13655
13706
  get HTMLElement() {
13656
- if (this.__htmlElementCstr == null) {
13657
- const ownerDocument = this.document;
13658
- this.__htmlElementCstr = class extends MockHTMLElement {
13659
- constructor() {
13660
- super(ownerDocument, "");
13661
- const observedAttributes = this.constructor.observedAttributes;
13662
- if (Array.isArray(observedAttributes) && typeof this.attributeChangedCallback === "function") {
13663
- observedAttributes.forEach((attrName) => {
13664
- const attrValue = this.getAttribute(attrName);
13665
- if (attrValue != null) {
13666
- this.attributeChangedCallback(attrName, null, attrValue);
13667
- }
13668
- });
13669
- }
13670
- }
13671
- };
13672
- }
13673
- return this.__htmlElementCstr;
13707
+ return MockHTMLElement;
13674
13708
  }
13675
- set HTMLElement(htmlElementCstr) {
13676
- this.__htmlElementCstr = htmlElementCstr;
13709
+ get SVGElement() {
13710
+ return MockSVGElement;
13677
13711
  }
13678
13712
  get IntersectionObserver() {
13679
13713
  return MockIntersectionObserver;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal",
3
- "version": "4.42.0",
3
+ "version": "4.42.1-dev.1770615146.e130b7a",
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",
@@ -47,6 +47,7 @@ export {
47
47
  Prop,
48
48
  readTask,
49
49
  render,
50
+ resolveVar,
50
51
  setAssetPath,
51
52
  setErrorHandler,
52
53
  setMode,
@@ -1160,6 +1160,12 @@ export interface Module {
1160
1160
  isLegacy: boolean;
1161
1161
  jsFilePath: string;
1162
1162
  localImports: string[];
1163
+ /**
1164
+ * Source file paths of functional components that are used in JSX/h() calls.
1165
+ * This is used to ensure htmlTagNames are properly propagated from functional
1166
+ * component dependencies even when they're accessed indirectly (e.g., via barrel files).
1167
+ */
1168
+ functionalComponentDeps: string[];
1163
1169
  originalImports: string[];
1164
1170
  originalCollectionComponentPath: string;
1165
1171
  potentialCmpRefs: string[];
@@ -2337,6 +2337,40 @@ export interface OutputTargetDistCustomElements extends OutputTargetValidationCo
2337
2337
  * If omitted, no auto-definition behavior or re-exporting will happen.
2338
2338
  */
2339
2339
  customElementsExportBehavior?: CustomElementsExportBehavior;
2340
+ /**
2341
+ * Generate an auto-loader script that uses MutationObserver to lazily load
2342
+ * and define custom elements as they appear in the DOM.
2343
+ *
2344
+ * When set to `true`, generates a `loader.js` file that auto-starts on import.
2345
+ * Can also be configured with an object for more control:
2346
+ * - `fileName`: Custom filename for the loader (default: 'loader.js')
2347
+ * - `autoStart`: Whether to auto-start the loader on import (default: true)
2348
+ *
2349
+ * @example
2350
+ * ```typescript
2351
+ * // Simple usage
2352
+ * autoLoader: true
2353
+ *
2354
+ * // With options
2355
+ * autoLoader: {
2356
+ * fileName: 'my-loader.js',
2357
+ * autoStart: false
2358
+ * }
2359
+ * ```
2360
+ */
2361
+ autoLoader?: boolean | {
2362
+ /**
2363
+ * Custom filename for the generated loader script.
2364
+ * @default 'loader.js'
2365
+ */
2366
+ fileName?: string;
2367
+ /**
2368
+ * Whether to automatically start the loader when the script is imported.
2369
+ * If false, you must call `start()` manually.
2370
+ * @default true
2371
+ */
2372
+ autoStart?: boolean;
2373
+ };
2340
2374
  }
2341
2375
  /**
2342
2376
  * The base type for output targets. All output targets should extend this base type.