@stencil/core 4.42.0-dev.1770096324.69d331e → 4.42.0-dev.1770269227.50ad901

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.
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Platform v4.42.0-dev.1770096324.69d331e | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Platform v4.42.0-dev.1770269227.50ad901 | MIT Licensed | https://stenciljs.com
3
3
  */
4
4
 
5
5
  // src/client/client-build.ts
@@ -2150,7 +2150,7 @@ var scopeCss = (cssText, scopeId2, commentOriginalSelector) => {
2150
2150
  });
2151
2151
  }
2152
2152
  scoped.slottedSelectors.forEach((slottedSelector) => {
2153
- const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector), "g");
2153
+ const regex = new RegExp(escapeRegExpSpecialCharacters(slottedSelector.orgSelector) + "(?=\\s*[,{]|$)", "g");
2154
2154
  cssText = cssText.replace(regex, slottedSelector.updatedSelector);
2155
2155
  });
2156
2156
  cssText = expandPartSelectors(cssText);
@@ -3269,7 +3269,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3269
3269
  if (childrenPromises.length === 0) {
3270
3270
  postUpdate();
3271
3271
  } else {
3272
- Promise.all(childrenPromises).then(postUpdate);
3272
+ Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
3273
3273
  hostRef.$flags$ |= 4 /* isWaitingForChildren */;
3274
3274
  childrenPromises.length = 0;
3275
3275
  }
@@ -3784,94 +3784,105 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
3784
3784
  // src/runtime/initialize-component.ts
3785
3785
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3786
3786
  let Cstr;
3787
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3788
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3789
- const bundleId = cmpMeta.$lazyBundleId$;
3790
- if (BUILD24.lazyLoad && bundleId) {
3791
- const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3792
- if (CstrImport && "then" in CstrImport) {
3793
- const endLoad = uniqueTime(
3794
- `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3795
- `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3796
- );
3797
- Cstr = await CstrImport;
3798
- endLoad();
3799
- } else {
3800
- Cstr = CstrImport;
3801
- }
3802
- if (!Cstr) {
3803
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3804
- }
3805
- if (BUILD24.member && !Cstr.isProxied) {
3787
+ try {
3788
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3789
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3790
+ const bundleId = cmpMeta.$lazyBundleId$;
3791
+ if (BUILD24.lazyLoad && bundleId) {
3792
+ const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
3793
+ if (CstrImport && "then" in CstrImport) {
3794
+ const endLoad = uniqueTime(
3795
+ `st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
3796
+ `[Stencil] Load module for <${cmpMeta.$tagName$}>`
3797
+ );
3798
+ Cstr = await CstrImport;
3799
+ endLoad();
3800
+ } else {
3801
+ Cstr = CstrImport;
3802
+ }
3803
+ if (!Cstr) {
3804
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3805
+ }
3806
+ if (BUILD24.member && !Cstr.isProxied) {
3807
+ if (BUILD24.propChangeCallback) {
3808
+ cmpMeta.$watchers$ = Cstr.watchers;
3809
+ cmpMeta.$serializers$ = Cstr.serializers;
3810
+ cmpMeta.$deserializers$ = Cstr.deserializers;
3811
+ }
3812
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3813
+ Cstr.isProxied = true;
3814
+ }
3815
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3816
+ if (BUILD24.member) {
3817
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
3818
+ }
3819
+ try {
3820
+ new Cstr(hostRef);
3821
+ } catch (e) {
3822
+ consoleError(e, elm);
3823
+ }
3824
+ if (BUILD24.member) {
3825
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3826
+ }
3806
3827
  if (BUILD24.propChangeCallback) {
3807
- cmpMeta.$watchers$ = Cstr.watchers;
3808
- cmpMeta.$serializers$ = Cstr.serializers;
3809
- cmpMeta.$deserializers$ = Cstr.deserializers;
3828
+ hostRef.$flags$ |= 128 /* isWatchReady */;
3810
3829
  }
3811
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3812
- Cstr.isProxied = true;
3813
- }
3814
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3815
- if (BUILD24.member) {
3816
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
3817
- }
3818
- try {
3819
- new Cstr(hostRef);
3820
- } catch (e) {
3821
- consoleError(e, elm);
3822
- }
3823
- if (BUILD24.member) {
3824
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
3825
- }
3826
- if (BUILD24.propChangeCallback) {
3827
- hostRef.$flags$ |= 128 /* isWatchReady */;
3828
- }
3829
- endNewInstance();
3830
- const needsDeferredCallback = BUILD24.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
3831
- if (!needsDeferredCallback) {
3832
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
3833
- } else {
3834
- hostRef.$deferredConnectedCallback$ = true;
3835
- }
3836
- } else {
3837
- Cstr = elm.constructor;
3838
- const cmpTag = elm.localName;
3839
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3840
- }
3841
- if (BUILD24.style && Cstr && Cstr.style) {
3842
- let style;
3843
- if (typeof Cstr.style === "string") {
3844
- style = Cstr.style;
3845
- } else if (BUILD24.mode && typeof Cstr.style !== "string") {
3846
- hostRef.$modeName$ = computeMode(elm);
3847
- if (hostRef.$modeName$) {
3848
- style = Cstr.style[hostRef.$modeName$];
3830
+ endNewInstance();
3831
+ const needsDeferredCallback = BUILD24.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
3832
+ if (!needsDeferredCallback) {
3833
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3834
+ } else {
3835
+ hostRef.$deferredConnectedCallback$ = true;
3849
3836
  }
3850
- if (BUILD24.hydrateServerSide && hostRef.$modeName$) {
3851
- elm.setAttribute("s-mode", hostRef.$modeName$);
3837
+ } else {
3838
+ Cstr = elm.constructor;
3839
+ const cmpTag = elm.localName;
3840
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3841
+ }
3842
+ if (BUILD24.style && Cstr && Cstr.style) {
3843
+ let style;
3844
+ if (typeof Cstr.style === "string") {
3845
+ style = Cstr.style;
3846
+ } else if (BUILD24.mode && typeof Cstr.style !== "string") {
3847
+ hostRef.$modeName$ = computeMode(elm);
3848
+ if (hostRef.$modeName$) {
3849
+ style = Cstr.style[hostRef.$modeName$];
3850
+ }
3851
+ if (BUILD24.hydrateServerSide && hostRef.$modeName$) {
3852
+ elm.setAttribute("s-mode", hostRef.$modeName$);
3853
+ }
3852
3854
  }
3853
- }
3854
- const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3855
- if (!styles.has(scopeId2) || BUILD24.hotModuleReplacement && hmrVersionId) {
3856
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3857
- if (BUILD24.hydrateServerSide && BUILD24.shadowDom) {
3858
- if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3859
- style = scopeCss(style, scopeId2, true);
3860
- } else if (needsScopedSSR()) {
3861
- style = expandPartSelectors(style);
3855
+ const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
3856
+ if (!styles.has(scopeId2) || BUILD24.hotModuleReplacement && hmrVersionId) {
3857
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3858
+ if (BUILD24.hydrateServerSide && BUILD24.shadowDom) {
3859
+ if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
3860
+ style = scopeCss(style, scopeId2, true);
3861
+ } else if (needsScopedSSR()) {
3862
+ style = expandPartSelectors(style);
3863
+ }
3862
3864
  }
3865
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3866
+ endRegisterStyles();
3863
3867
  }
3864
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3865
- endRegisterStyles();
3866
3868
  }
3867
3869
  }
3868
- }
3869
- const ancestorComponent = hostRef.$ancestorComponent$;
3870
- const schedule = () => scheduleUpdate(hostRef, true);
3871
- if (BUILD24.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3872
- ancestorComponent["s-rc"].push(schedule);
3873
- } else {
3874
- schedule();
3870
+ const ancestorComponent = hostRef.$ancestorComponent$;
3871
+ const schedule = () => scheduleUpdate(hostRef, true);
3872
+ if (BUILD24.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
3873
+ ancestorComponent["s-rc"].push(schedule);
3874
+ } else {
3875
+ schedule();
3876
+ }
3877
+ } catch (e) {
3878
+ consoleError(e, elm);
3879
+ if (BUILD24.asyncLoading && hostRef.$onRenderResolve$) {
3880
+ hostRef.$onRenderResolve$();
3881
+ hostRef.$onRenderResolve$ = void 0;
3882
+ }
3883
+ if (BUILD24.asyncLoading && hostRef.$onReadyResolve$) {
3884
+ hostRef.$onReadyResolve$(elm);
3885
+ }
3875
3886
  }
3876
3887
  };
3877
3888
  var fireConnectedCallback = (instance, elm) => {
@@ -4003,91 +4014,99 @@ var proxyCustomElement = (Cstr, compactMeta) => {
4003
4014
  $flags$: compactMeta[0],
4004
4015
  $tagName$: compactMeta[1]
4005
4016
  };
4006
- if (BUILD27.member) {
4007
- cmpMeta.$members$ = compactMeta[2];
4008
- }
4009
- if (BUILD27.hostListener) {
4010
- cmpMeta.$listeners$ = compactMeta[3];
4011
- }
4012
- if (BUILD27.propChangeCallback) {
4013
- cmpMeta.$watchers$ = Cstr.$watchers$;
4014
- cmpMeta.$deserializers$ = Cstr.$deserializers$;
4015
- cmpMeta.$serializers$ = Cstr.$serializers$;
4016
- }
4017
- if (BUILD27.reflect) {
4018
- cmpMeta.$attrsToReflect$ = [];
4019
- }
4020
- if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4021
- cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
4022
- }
4023
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4024
- if (BUILD27.experimentalSlotFixes) {
4025
- patchPseudoShadowDom(Cstr.prototype);
4026
- } else {
4027
- if (BUILD27.slotChildNodesFix) {
4028
- patchChildSlotNodes(Cstr.prototype);
4029
- }
4030
- if (BUILD27.cloneNodeFix) {
4031
- patchCloneNode(Cstr.prototype);
4032
- }
4033
- if (BUILD27.appendChildSlotFix) {
4034
- patchSlotAppendChild(Cstr.prototype);
4035
- }
4036
- if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4037
- patchTextContent(Cstr.prototype);
4038
- }
4017
+ try {
4018
+ if (BUILD27.member) {
4019
+ cmpMeta.$members$ = compactMeta[2];
4039
4020
  }
4040
- } else if (BUILD27.cloneNodeFix) {
4041
- patchCloneNode(Cstr.prototype);
4042
- }
4043
- if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {
4044
- hydrateScopedToShadow();
4045
- }
4046
- const originalConnectedCallback = Cstr.prototype.connectedCallback;
4047
- const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
4048
- Object.assign(Cstr.prototype, {
4049
- __hasHostListenerAttached: false,
4050
- __registerHost() {
4051
- registerHost(this, cmpMeta);
4052
- },
4053
- connectedCallback() {
4054
- if (!this.__hasHostListenerAttached) {
4055
- const hostRef = getHostRef(this);
4056
- if (!hostRef) {
4057
- return;
4021
+ if (BUILD27.hostListener) {
4022
+ cmpMeta.$listeners$ = compactMeta[3];
4023
+ }
4024
+ if (BUILD27.propChangeCallback) {
4025
+ cmpMeta.$watchers$ = Cstr.$watchers$;
4026
+ cmpMeta.$deserializers$ = Cstr.$deserializers$;
4027
+ cmpMeta.$serializers$ = Cstr.$serializers$;
4028
+ }
4029
+ if (BUILD27.reflect) {
4030
+ cmpMeta.$attrsToReflect$ = [];
4031
+ }
4032
+ if (BUILD27.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
4033
+ cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
4034
+ }
4035
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
4036
+ if (BUILD27.experimentalSlotFixes) {
4037
+ patchPseudoShadowDom(Cstr.prototype);
4038
+ } else {
4039
+ if (BUILD27.slotChildNodesFix) {
4040
+ patchChildSlotNodes(Cstr.prototype);
4041
+ }
4042
+ if (BUILD27.cloneNodeFix) {
4043
+ patchCloneNode(Cstr.prototype);
4044
+ }
4045
+ if (BUILD27.appendChildSlotFix) {
4046
+ patchSlotAppendChild(Cstr.prototype);
4047
+ }
4048
+ if (BUILD27.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
4049
+ patchTextContent(Cstr.prototype);
4058
4050
  }
4059
- addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
4060
- this.__hasHostListenerAttached = true;
4061
- }
4062
- connectedCallback(this);
4063
- if (originalConnectedCallback) {
4064
- originalConnectedCallback.call(this);
4065
- }
4066
- },
4067
- disconnectedCallback() {
4068
- disconnectedCallback(this);
4069
- if (originalDisconnectedCallback) {
4070
- originalDisconnectedCallback.call(this);
4071
4051
  }
4072
- },
4073
- __attachShadow() {
4074
- if (supportsShadow) {
4075
- if (!this.shadowRoot) {
4076
- createShadowRoot.call(this, cmpMeta);
4077
- } else {
4078
- if (this.shadowRoot.mode !== "open") {
4079
- throw new Error(
4080
- `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
4081
- );
4052
+ } else if (BUILD27.cloneNodeFix) {
4053
+ patchCloneNode(Cstr.prototype);
4054
+ }
4055
+ if (BUILD27.hydrateClientSide && BUILD27.shadowDom) {
4056
+ hydrateScopedToShadow();
4057
+ }
4058
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
4059
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
4060
+ Object.assign(Cstr.prototype, {
4061
+ __hasHostListenerAttached: false,
4062
+ __registerHost() {
4063
+ registerHost(this, cmpMeta);
4064
+ },
4065
+ connectedCallback() {
4066
+ if (!this.__hasHostListenerAttached) {
4067
+ const hostRef = getHostRef(this);
4068
+ if (!hostRef) {
4069
+ return;
4082
4070
  }
4071
+ addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
4072
+ this.__hasHostListenerAttached = true;
4073
+ }
4074
+ connectedCallback(this);
4075
+ if (originalConnectedCallback) {
4076
+ originalConnectedCallback.call(this);
4077
+ }
4078
+ },
4079
+ disconnectedCallback() {
4080
+ disconnectedCallback(this);
4081
+ if (originalDisconnectedCallback) {
4082
+ originalDisconnectedCallback.call(this);
4083
+ }
4084
+ },
4085
+ __attachShadow() {
4086
+ if (supportsShadow) {
4087
+ if (!this.shadowRoot) {
4088
+ createShadowRoot.call(this, cmpMeta);
4089
+ } else {
4090
+ if (this.shadowRoot.mode !== "open") {
4091
+ throw new Error(
4092
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
4093
+ );
4094
+ }
4095
+ }
4096
+ } else {
4097
+ this.shadowRoot = this;
4083
4098
  }
4084
- } else {
4085
- this.shadowRoot = this;
4086
4099
  }
4087
- }
4088
- });
4089
- Cstr.is = cmpMeta.$tagName$;
4090
- return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4100
+ });
4101
+ Object.defineProperty(Cstr, "is", {
4102
+ value: cmpMeta.$tagName$,
4103
+ configurable: true
4104
+ });
4105
+ return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
4106
+ } catch (e) {
4107
+ consoleError(e);
4108
+ return Cstr;
4109
+ }
4091
4110
  };
4092
4111
  var forceModeUpdate = (elm) => {
4093
4112
  if (BUILD27.style && BUILD27.mode && !BUILD27.lazyLoad) {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stencil/core/internal/client",
3
- "version": "4.42.0-dev.1770096324.69d331e",
3
+ "version": "4.42.0-dev.1770269227.50ad901",
4
4
  "description": "Stencil internal client platform to be imported by the Stencil Compiler and internal runtime. Breaking changes can and will happen at any time.",
5
5
  "main": "./index.js",
6
6
  "exports": "./index.js",
@@ -1,5 +1,5 @@
1
1
  /*
2
- Stencil Client Patch Browser v4.42.0-dev.1770096324.69d331e | MIT Licensed | https://stenciljs.com
2
+ Stencil Client Patch Browser v4.42.0-dev.1770269227.50ad901 | 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);