@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.
- package/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +5 -5
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/app-globals/package.json +1 -1
- package/internal/client/index.js +181 -162
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/client/shadow-css.js +1 -1
- package/internal/hydrate/index.js +182 -163
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.js +56 -22
- package/internal/package.json +1 -1
- package/internal/testing/index.js +181 -162
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +56 -22
- package/mock-doc/index.d.ts +10 -2
- package/mock-doc/index.js +56 -22
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +23 -23
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +1 -1
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.42.0-dev.
|
|
2
|
+
Stencil Hydrate Platform v4.42.0-dev.1770269227.50ad901 | 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);
|
|
@@ -3275,7 +3275,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
|
3275
3275
|
if (childrenPromises.length === 0) {
|
|
3276
3276
|
postUpdate();
|
|
3277
3277
|
} else {
|
|
3278
|
-
Promise.all(childrenPromises).then(postUpdate);
|
|
3278
|
+
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
|
|
3279
3279
|
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
3280
3280
|
childrenPromises.length = 0;
|
|
3281
3281
|
}
|
|
@@ -3790,94 +3790,105 @@ More information: https://stenciljs.com/docs/properties#prop-mutability`
|
|
|
3790
3790
|
// src/runtime/initialize-component.ts
|
|
3791
3791
|
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
3792
3792
|
let Cstr;
|
|
3793
|
-
|
|
3794
|
-
hostRef.$flags$
|
|
3795
|
-
|
|
3796
|
-
|
|
3797
|
-
|
|
3798
|
-
|
|
3799
|
-
|
|
3800
|
-
|
|
3801
|
-
|
|
3802
|
-
|
|
3803
|
-
|
|
3804
|
-
|
|
3805
|
-
|
|
3806
|
-
|
|
3807
|
-
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3793
|
+
try {
|
|
3794
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
3795
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
3796
|
+
const bundleId = cmpMeta.$lazyBundleId$;
|
|
3797
|
+
if (BUILD18.lazyLoad && bundleId) {
|
|
3798
|
+
const CstrImport = loadModule(cmpMeta, hostRef, hmrVersionId);
|
|
3799
|
+
if (CstrImport && "then" in CstrImport) {
|
|
3800
|
+
const endLoad = uniqueTime(
|
|
3801
|
+
`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`,
|
|
3802
|
+
`[Stencil] Load module for <${cmpMeta.$tagName$}>`
|
|
3803
|
+
);
|
|
3804
|
+
Cstr = await CstrImport;
|
|
3805
|
+
endLoad();
|
|
3806
|
+
} else {
|
|
3807
|
+
Cstr = CstrImport;
|
|
3808
|
+
}
|
|
3809
|
+
if (!Cstr) {
|
|
3810
|
+
throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
|
|
3811
|
+
}
|
|
3812
|
+
if (BUILD18.member && !Cstr.isProxied) {
|
|
3813
|
+
if (BUILD18.propChangeCallback) {
|
|
3814
|
+
cmpMeta.$watchers$ = Cstr.watchers;
|
|
3815
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
3816
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
3817
|
+
}
|
|
3818
|
+
proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
|
|
3819
|
+
Cstr.isProxied = true;
|
|
3820
|
+
}
|
|
3821
|
+
const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
|
|
3822
|
+
if (BUILD18.member) {
|
|
3823
|
+
hostRef.$flags$ |= 8 /* isConstructingInstance */;
|
|
3824
|
+
}
|
|
3825
|
+
try {
|
|
3826
|
+
new Cstr(hostRef);
|
|
3827
|
+
} catch (e) {
|
|
3828
|
+
consoleError(e, elm);
|
|
3829
|
+
}
|
|
3830
|
+
if (BUILD18.member) {
|
|
3831
|
+
hostRef.$flags$ &= ~8 /* isConstructingInstance */;
|
|
3832
|
+
}
|
|
3812
3833
|
if (BUILD18.propChangeCallback) {
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3834
|
+
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
3835
|
+
}
|
|
3836
|
+
endNewInstance();
|
|
3837
|
+
const needsDeferredCallback = BUILD18.slotRelocation && cmpMeta.$flags$ & 4 /* hasSlotRelocation */;
|
|
3838
|
+
if (!needsDeferredCallback) {
|
|
3839
|
+
fireConnectedCallback(hostRef.$lazyInstance$, elm);
|
|
3840
|
+
} else {
|
|
3841
|
+
hostRef.$deferredConnectedCallback$ = true;
|
|
3816
3842
|
}
|
|
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
3843
|
} else {
|
|
3840
|
-
|
|
3841
|
-
|
|
3842
|
-
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
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);
|
|
3844
|
+
Cstr = elm.constructor;
|
|
3845
|
+
const cmpTag = elm.localName;
|
|
3846
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
3847
|
+
}
|
|
3848
|
+
if (BUILD18.style && Cstr && Cstr.style) {
|
|
3849
|
+
let style;
|
|
3850
|
+
if (typeof Cstr.style === "string") {
|
|
3851
|
+
style = Cstr.style;
|
|
3852
|
+
} else if (BUILD18.mode && typeof Cstr.style !== "string") {
|
|
3853
|
+
hostRef.$modeName$ = computeMode(elm);
|
|
3854
|
+
if (hostRef.$modeName$) {
|
|
3855
|
+
style = Cstr.style[hostRef.$modeName$];
|
|
3856
|
+
}
|
|
3857
|
+
if (BUILD18.hydrateServerSide && hostRef.$modeName$) {
|
|
3858
|
+
elm.setAttribute("s-mode", hostRef.$modeName$);
|
|
3868
3859
|
}
|
|
3869
3860
|
}
|
|
3870
|
-
|
|
3871
|
-
|
|
3861
|
+
const scopeId2 = getScopeId(cmpMeta, hostRef.$modeName$);
|
|
3862
|
+
if (!styles.has(scopeId2) || BUILD18.hotModuleReplacement && hmrVersionId) {
|
|
3863
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
3864
|
+
if (BUILD18.hydrateServerSide && BUILD18.shadowDom) {
|
|
3865
|
+
if (cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */) {
|
|
3866
|
+
style = scopeCss(style, scopeId2, true);
|
|
3867
|
+
} else if (needsScopedSSR()) {
|
|
3868
|
+
style = expandPartSelectors(style);
|
|
3869
|
+
}
|
|
3870
|
+
}
|
|
3871
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
3872
|
+
endRegisterStyles();
|
|
3873
|
+
}
|
|
3872
3874
|
}
|
|
3873
3875
|
}
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3878
|
-
|
|
3879
|
-
|
|
3880
|
-
|
|
3876
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
3877
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
3878
|
+
if (BUILD18.asyncLoading && ancestorComponent && ancestorComponent["s-rc"]) {
|
|
3879
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
3880
|
+
} else {
|
|
3881
|
+
schedule();
|
|
3882
|
+
}
|
|
3883
|
+
} catch (e) {
|
|
3884
|
+
consoleError(e, elm);
|
|
3885
|
+
if (BUILD18.asyncLoading && hostRef.$onRenderResolve$) {
|
|
3886
|
+
hostRef.$onRenderResolve$();
|
|
3887
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
3888
|
+
}
|
|
3889
|
+
if (BUILD18.asyncLoading && hostRef.$onReadyResolve$) {
|
|
3890
|
+
hostRef.$onReadyResolve$(elm);
|
|
3891
|
+
}
|
|
3881
3892
|
}
|
|
3882
3893
|
};
|
|
3883
3894
|
var fireConnectedCallback = (instance, elm) => {
|
|
@@ -4009,91 +4020,99 @@ var proxyCustomElement = (Cstr, compactMeta) => {
|
|
|
4009
4020
|
$flags$: compactMeta[0],
|
|
4010
4021
|
$tagName$: compactMeta[1]
|
|
4011
4022
|
};
|
|
4012
|
-
|
|
4013
|
-
|
|
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
|
-
}
|
|
4023
|
+
try {
|
|
4024
|
+
if (BUILD21.member) {
|
|
4025
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
4045
4026
|
}
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4027
|
+
if (BUILD21.hostListener) {
|
|
4028
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
4029
|
+
}
|
|
4030
|
+
if (BUILD21.propChangeCallback) {
|
|
4031
|
+
cmpMeta.$watchers$ = Cstr.$watchers$;
|
|
4032
|
+
cmpMeta.$deserializers$ = Cstr.$deserializers$;
|
|
4033
|
+
cmpMeta.$serializers$ = Cstr.$serializers$;
|
|
4034
|
+
}
|
|
4035
|
+
if (BUILD21.reflect) {
|
|
4036
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
4037
|
+
}
|
|
4038
|
+
if (BUILD21.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
4039
|
+
cmpMeta.$flags$ |= 8 /* needsShadowDomShim */;
|
|
4040
|
+
}
|
|
4041
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && cmpMeta.$flags$ & 256 /* hasSlot */) {
|
|
4042
|
+
if (BUILD21.experimentalSlotFixes) {
|
|
4043
|
+
patchPseudoShadowDom(Cstr.prototype);
|
|
4044
|
+
} else {
|
|
4045
|
+
if (BUILD21.slotChildNodesFix) {
|
|
4046
|
+
patchChildSlotNodes(Cstr.prototype);
|
|
4047
|
+
}
|
|
4048
|
+
if (BUILD21.cloneNodeFix) {
|
|
4049
|
+
patchCloneNode(Cstr.prototype);
|
|
4050
|
+
}
|
|
4051
|
+
if (BUILD21.appendChildSlotFix) {
|
|
4052
|
+
patchSlotAppendChild(Cstr.prototype);
|
|
4053
|
+
}
|
|
4054
|
+
if (BUILD21.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
4055
|
+
patchTextContent(Cstr.prototype);
|
|
4064
4056
|
}
|
|
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
4057
|
}
|
|
4078
|
-
}
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4058
|
+
} else if (BUILD21.cloneNodeFix) {
|
|
4059
|
+
patchCloneNode(Cstr.prototype);
|
|
4060
|
+
}
|
|
4061
|
+
if (BUILD21.hydrateClientSide && BUILD21.shadowDom) {
|
|
4062
|
+
hydrateScopedToShadow();
|
|
4063
|
+
}
|
|
4064
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
4065
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
4066
|
+
Object.assign(Cstr.prototype, {
|
|
4067
|
+
__hasHostListenerAttached: false,
|
|
4068
|
+
__registerHost() {
|
|
4069
|
+
registerHost(this, cmpMeta);
|
|
4070
|
+
},
|
|
4071
|
+
connectedCallback() {
|
|
4072
|
+
if (!this.__hasHostListenerAttached) {
|
|
4073
|
+
const hostRef = getHostRef(this);
|
|
4074
|
+
if (!hostRef) {
|
|
4075
|
+
return;
|
|
4088
4076
|
}
|
|
4077
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$, false);
|
|
4078
|
+
this.__hasHostListenerAttached = true;
|
|
4079
|
+
}
|
|
4080
|
+
connectedCallback(this);
|
|
4081
|
+
if (originalConnectedCallback) {
|
|
4082
|
+
originalConnectedCallback.call(this);
|
|
4083
|
+
}
|
|
4084
|
+
},
|
|
4085
|
+
disconnectedCallback() {
|
|
4086
|
+
disconnectedCallback(this);
|
|
4087
|
+
if (originalDisconnectedCallback) {
|
|
4088
|
+
originalDisconnectedCallback.call(this);
|
|
4089
|
+
}
|
|
4090
|
+
},
|
|
4091
|
+
__attachShadow() {
|
|
4092
|
+
if (supportsShadow) {
|
|
4093
|
+
if (!this.shadowRoot) {
|
|
4094
|
+
createShadowRoot.call(this, cmpMeta);
|
|
4095
|
+
} else {
|
|
4096
|
+
if (this.shadowRoot.mode !== "open") {
|
|
4097
|
+
throw new Error(
|
|
4098
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
4099
|
+
);
|
|
4100
|
+
}
|
|
4101
|
+
}
|
|
4102
|
+
} else {
|
|
4103
|
+
this.shadowRoot = this;
|
|
4089
4104
|
}
|
|
4090
|
-
} else {
|
|
4091
|
-
this.shadowRoot = this;
|
|
4092
4105
|
}
|
|
4093
|
-
}
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4106
|
+
});
|
|
4107
|
+
Object.defineProperty(Cstr, "is", {
|
|
4108
|
+
value: cmpMeta.$tagName$,
|
|
4109
|
+
configurable: true
|
|
4110
|
+
});
|
|
4111
|
+
return proxyComponent(Cstr, cmpMeta, 1 /* isElementConstructor */ | 2 /* proxyState */);
|
|
4112
|
+
} catch (e) {
|
|
4113
|
+
consoleError(e);
|
|
4114
|
+
return Cstr;
|
|
4115
|
+
}
|
|
4097
4116
|
};
|
|
4098
4117
|
var forceModeUpdate = (elm) => {
|
|
4099
4118
|
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-dev.
|
|
3
|
+
"version": "4.42.0-dev.1770269227.50ad901",
|
|
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-dev.
|
|
2
|
+
Stencil Hydrate Runner v4.42.0-dev.1770269227.50ad901 | 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
|
-
|
|
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
|
-
|
|
13676
|
-
|
|
13709
|
+
get SVGElement() {
|
|
13710
|
+
return MockSVGElement;
|
|
13677
13711
|
}
|
|
13678
13712
|
get IntersectionObserver() {
|
|
13679
13713
|
return MockIntersectionObserver;
|
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "4.42.0-dev.
|
|
3
|
+
"version": "4.42.0-dev.1770269227.50ad901",
|
|
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",
|