@uh-design-system/component-library 0.5.2 → 0.6.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.
- package/dist/cjs/{utils-3412cbed.js → attributes-BMbXzbwU.js} +2 -28
- package/dist/cjs/component-library.cjs.js +7 -7
- package/dist/cjs/controlUtils-ofqiQxRF.js +42 -0
- package/dist/cjs/ds-accordion.cjs.entry.js +79 -0
- package/dist/cjs/ds-button.cjs.entry.js +107 -0
- package/dist/cjs/ds-card.cjs.entry.js +58 -0
- package/dist/cjs/ds-checkbox-group.cjs.entry.js +109 -49
- package/dist/cjs/ds-checkbox.cjs.entry.js +88 -79
- package/dist/cjs/ds-icon.cjs.entry.js +943 -0
- package/dist/cjs/ds-input-validity.cjs.entry.js +14 -15
- package/dist/cjs/ds-link-with-arrow.cjs.entry.js +21 -20
- package/dist/cjs/ds-link.cjs.entry.js +34 -31
- package/dist/cjs/ds-radio-button-group.cjs.entry.js +153 -0
- package/dist/cjs/ds-radio-button.cjs.entry.js +151 -0
- package/dist/cjs/ds-spinner.cjs.entry.js +62 -0
- package/dist/cjs/ds-text-input.cjs.entry.js +90 -77
- package/dist/cjs/ds-visually-hidden.cjs.entry.js +3 -6
- package/dist/cjs/index-Bp6Dd2i1.js +94 -0
- package/dist/cjs/{store-9bd20f3c.js → index-DwLFyR5p.js} +6 -2
- package/dist/cjs/{index-bf84b124.js → index-Mjp9Y-Sw.js} +701 -55
- package/dist/cjs/index.cjs.js +3 -5
- package/dist/cjs/{linkUtils-695da37c.js → linkUtils-onlbgKdI.js} +4 -2
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/utils-BjZTECpy.js +29 -0
- package/dist/collection/accessibility/stories/naming.stories.js +3 -3
- package/dist/collection/collection-manifest.json +78 -3
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.css +18 -17
- package/dist/collection/components/01-base-components/ds-accordion/ds-accordion.js +91 -50
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.examples.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.features.stories.js +14 -14
- package/dist/collection/components/01-base-components/ds-accordion/stories/ds-accordion.stories.js +24 -66
- package/dist/collection/components/01-base-components/ds-button/ds-button.css +124 -145
- package/dist/collection/components/01-base-components/ds-button/ds-button.js +150 -65
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.examples.stories.js +121 -23
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.features.stories.js +49 -42
- package/dist/collection/components/01-base-components/ds-button/stories/ds-button.stories.js +16 -72
- package/dist/collection/components/01-base-components/ds-card/ds-card.css +127 -0
- package/dist/collection/components/01-base-components/ds-card/ds-card.js +303 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.examples.stories.js +92 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.features.stories.js +66 -0
- package/dist/collection/components/01-base-components/ds-card/stories/ds-card.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.css +46 -46
- package/dist/collection/components/01-base-components/ds-checkbox/ds-checkbox.js +120 -111
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.features.stories.js +20 -20
- package/dist/collection/components/01-base-components/ds-checkbox/stories/ds-checkbox.stories.js +12 -25
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.css +2 -3
- package/dist/collection/components/01-base-components/ds-checkbox-group/ds-checkbox-group.js +214 -63
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.js +215 -50
- package/dist/collection/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.stories.js +30 -28
- package/dist/collection/components/01-base-components/ds-icon/ds-icon.js +36 -31
- package/dist/collection/components/01-base-components/ds-icon/stories/ds-icon.stories.js +10 -37
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.css +2 -2
- package/dist/collection/components/01-base-components/ds-input-validity/ds-input-validity.js +60 -30
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.features.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-input-validity/stories/ds-input-validity.stories.js +4 -9
- package/dist/collection/components/01-base-components/ds-link/ds-link.css +24 -14
- package/dist/collection/components/01-base-components/ds-link/ds-link.js +74 -75
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.examples.stories.js +27 -27
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.features.stories.js +38 -21
- package/dist/collection/components/01-base-components/ds-link/stories/ds-link.stories.js +8 -67
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.css +10 -12
- package/dist/collection/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.js +30 -52
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.examples.stories.js +4 -4
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.features.stories.js +6 -6
- package/dist/collection/components/01-base-components/ds-link-with-arrow/stories/ds-link-with-arrow.stories.js +4 -28
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.css +115 -0
- package/dist/collection/components/01-base-components/ds-radio-button/ds-radio-button.js +449 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.js +72 -0
- package/dist/collection/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.js +22 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.css +30 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/ds-radio-button-group.js +360 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.js +42 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.js +71 -0
- package/dist/collection/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.js +60 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.css +279 -0
- package/dist/collection/components/01-base-components/ds-spinner/ds-spinner.js +221 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.js +120 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.js +107 -0
- package/dist/collection/components/01-base-components/ds-spinner/stories/ds-spinner.stories.js +14 -0
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.css +85 -118
- package/dist/collection/components/01-base-components/ds-text-input/ds-text-input.js +230 -155
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.examples.stories.js +26 -21
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.features.stories.js +40 -40
- package/dist/collection/components/01-base-components/ds-text-input/stories/ds-text-input.stories.js +30 -56
- package/dist/collection/components/01-base-components/ds-visually-hidden/ds-visually-hidden.js +1 -1
- package/dist/collection/store.js +7 -1
- package/dist/collection/utils/attributes/attributes.js +2 -2
- package/dist/collection/utils/button/buttonUtils.js +14 -0
- package/dist/collection/utils/colours/colourTypes.js +3 -3
- package/dist/collection/utils/colours/colourUtils.js +5 -3
- package/dist/collection/utils/controls/controlUtils.js +35 -1
- package/dist/collection/utils/link/linkUtils.js +3 -2
- package/dist/collection/utils/spinner/spinnerUtils.js +20 -0
- package/dist/collection/utils/tests/testUtils.js +1 -0
- package/dist/collection/utils/typography/typographyUtils.js +3 -3
- package/dist/collection/utils/utils.js +10 -9
- package/dist/component-library/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +1 -1
- package/dist/component-library/component-library.css +1 -1
- package/dist/component-library/component-library.esm.js +1 -1
- package/dist/component-library/controlUtils-CNER0MvM.js +1 -0
- package/dist/component-library/ds-accordion.entry.js +1 -0
- package/dist/component-library/ds-button.entry.js +1 -0
- package/dist/component-library/ds-card.entry.js +1 -0
- package/dist/component-library/ds-checkbox-group.entry.js +1 -1
- package/dist/component-library/ds-checkbox.entry.js +1 -1
- package/dist/component-library/ds-icon.entry.js +1 -0
- package/dist/component-library/ds-input-validity.entry.js +1 -1
- package/dist/component-library/ds-link-with-arrow.entry.js +1 -1
- package/dist/component-library/ds-link.entry.js +1 -1
- package/dist/component-library/ds-radio-button-group.entry.js +1 -0
- package/dist/component-library/ds-radio-button.entry.js +1 -0
- package/dist/component-library/ds-spinner.entry.js +1 -0
- package/dist/component-library/ds-text-input.entry.js +1 -1
- package/dist/component-library/ds-visually-hidden.entry.js +1 -1
- package/dist/component-library/index-BfTCfPZ1.js +6 -0
- package/dist/component-library/index-Cm7V4EAn.js +2 -0
- package/dist/component-library/index-DuYjhvTn.js +1 -0
- package/dist/component-library/index.esm.js +1 -1
- package/dist/component-library/linkUtils-02nCfO0F.js +1 -0
- package/dist/component-library/utils-CqaqnfY4.js +1 -0
- package/dist/components/attributes.js +3 -3
- package/dist/components/controlUtils.js +35 -2
- package/dist/components/ds-accordion.js +58 -42
- package/dist/components/ds-button2.js +78 -39
- package/dist/components/ds-card.d.ts +11 -0
- package/dist/components/ds-card.js +91 -0
- package/dist/components/ds-checkbox-group.js +116 -56
- package/dist/components/ds-checkbox2.js +93 -80
- package/dist/components/ds-icon2.js +292 -292
- package/dist/components/ds-input-validity2.js +17 -14
- package/dist/components/ds-link-with-arrow.js +22 -22
- package/dist/components/ds-link.js +43 -40
- package/dist/components/ds-radio-button-group.d.ts +11 -0
- package/dist/components/ds-radio-button-group.js +185 -0
- package/dist/components/ds-radio-button.d.ts +11 -0
- package/dist/components/ds-radio-button.js +198 -0
- package/dist/components/ds-spinner.d.ts +11 -0
- package/dist/components/ds-spinner.js +6 -0
- package/dist/components/ds-spinner2.js +89 -0
- package/dist/components/ds-text-input.js +126 -104
- package/dist/components/ds-visually-hidden2.js +2 -3
- package/dist/components/index.js +208 -2
- package/dist/components/index2.js +713 -39
- package/dist/components/index3.js +69 -57
- package/dist/components/linkUtils.js +4 -2
- package/dist/docs.d.ts +443 -0
- package/dist/docs.json +4790 -0
- package/dist/esm/{utils-cfc536bc.js → attributes-BD_lNRxn.js} +3 -26
- package/dist/esm/component-library.js +6 -5
- package/dist/esm/controlUtils-CNER0MvM.js +37 -0
- package/dist/esm/ds-accordion.entry.js +77 -0
- package/dist/esm/ds-button.entry.js +105 -0
- package/dist/esm/ds-card.entry.js +56 -0
- package/dist/esm/ds-checkbox-group.entry.js +108 -46
- package/dist/esm/ds-checkbox.entry.js +78 -67
- package/dist/esm/ds-icon.entry.js +941 -0
- package/dist/esm/ds-input-validity.entry.js +14 -13
- package/dist/esm/ds-link-with-arrow.entry.js +21 -18
- package/dist/esm/ds-link.entry.js +34 -29
- package/dist/esm/ds-radio-button-group.entry.js +151 -0
- package/dist/esm/ds-radio-button.entry.js +149 -0
- package/dist/esm/ds-spinner.entry.js +60 -0
- package/dist/esm/ds-text-input.entry.js +88 -73
- package/dist/esm/ds-visually-hidden.entry.js +3 -4
- package/dist/esm/index-BfTCfPZ1.js +92 -0
- package/dist/esm/{index-434995e1.js → index-Cm7V4EAn.js} +699 -34
- package/dist/{components/store.js → esm/index-DuYjhvTn.js} +6 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/{linkUtils-3d1b28cf.js → linkUtils-02nCfO0F.js} +4 -2
- package/dist/esm/loader.js +4 -4
- package/dist/esm/utils-CqaqnfY4.js +25 -0
- package/dist/hydrate/index.d.ts +271 -0
- package/dist/hydrate/index.js +22280 -0
- package/dist/hydrate/index.mjs +22272 -0
- package/dist/hydrate/package.json +12 -0
- package/dist/styles/helpers.css +15 -0
- package/dist/styles/helpers.css.map +1 -0
- package/dist/styles/mixins/_breakpoints.scss +13 -0
- package/dist/styles/mixins/_focus.scss +26 -0
- package/dist/styles/mixins/_wrapper.scss +5 -0
- package/dist/styles/mixins/imports-default/_imports.scss +2 -0
- package/dist/styles/mixins/tokens/_breakpoints.scss +13 -0
- package/dist/styles/mixins/tokens/_semantic-colours.scss +75 -0
- package/dist/styles/mixins.scss +12 -0
- package/dist/styles/variables.css +176 -0
- package/dist/styles/variables.css.map +1 -0
- package/dist/types/components/01-base-components/ds-accordion/ds-accordion.d.ts +11 -8
- package/dist/types/components/01-base-components/ds-button/ds-button.d.ts +16 -11
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.examples.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-button/stories/ds-button.features.stories.d.ts +1 -0
- package/dist/types/components/01-base-components/ds-card/ds-card.d.ts +20 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.examples.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.features.stories.d.ts +8 -0
- package/dist/types/components/01-base-components/ds-card/stories/ds-card.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-checkbox/ds-checkbox.d.ts +21 -22
- package/dist/types/components/01-base-components/ds-checkbox-group/ds-checkbox-group.d.ts +21 -11
- package/dist/types/components/01-base-components/ds-checkbox-group/stories/ds-checkbox-group.features.stories.d.ts +3 -0
- package/dist/types/components/01-base-components/ds-icon/ds-icon.d.ts +7 -5
- package/dist/types/components/01-base-components/ds-input-validity/ds-input-validity.d.ts +5 -6
- package/dist/types/components/01-base-components/ds-link/ds-link.d.ts +13 -14
- package/dist/types/components/01-base-components/ds-link/stories/ds-link.features.stories.d.ts +2 -0
- package/dist/types/components/01-base-components/ds-link-with-arrow/ds-link-with-arrow.d.ts +5 -7
- package/dist/types/components/01-base-components/ds-radio-button/ds-radio-button.d.ts +44 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.features.stories.d.ts +15 -0
- package/dist/types/components/01-base-components/ds-radio-button/stories/ds-radio-button.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/ds-radio-button-group.d.ts +34 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.examples.stories.d.ts +6 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.features.stories.d.ts +11 -0
- package/dist/types/components/01-base-components/ds-radio-button-group/stories/ds-radio-button-group.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/ds-spinner.d.ts +17 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.examples.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.features.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-spinner/stories/ds-spinner.stories.d.ts +7 -0
- package/dist/types/components/01-base-components/ds-text-input/ds-text-input.d.ts +37 -32
- package/dist/types/components.d.ts +1287 -228
- package/dist/types/stencil-public-runtime.d.ts +22 -0
- package/dist/types/store.d.ts +6 -1
- package/dist/types/utils/attributes/attributes.d.ts +1 -1
- package/dist/types/utils/button/buttonUtils.d.ts +1 -0
- package/dist/types/utils/colours/colourTypes.d.ts +3 -3
- package/dist/types/utils/controls/controlUtils.d.ts +2 -0
- package/dist/types/utils/link/linkUtils.d.ts +1 -1
- package/dist/types/utils/spinner/spinnerUtils.d.ts +1 -0
- package/dist/types/utils/tests/testUtils.d.ts +1 -0
- package/dist/types/utils/utils.d.ts +2 -1
- package/package.json +40 -36
- package/dist/cjs/controlUtils-041de0fd.js +0 -7
- package/dist/cjs/ds-accordion_3.cjs.entry.js +0 -1095
- package/dist/cjs/index-5b0b9d4c.js +0 -82
- package/dist/component-library/controlUtils-9ca4087b.js +0 -1
- package/dist/component-library/ds-accordion_3.entry.js +0 -1
- package/dist/component-library/index-434995e1.js +0 -2
- package/dist/component-library/index-72ac5051.js +0 -6
- package/dist/component-library/linkUtils-3d1b28cf.js +0 -1
- package/dist/component-library/store-b8d17c10.js +0 -1
- package/dist/esm/controlUtils-9ca4087b.js +0 -4
- package/dist/esm/ds-accordion_3.entry.js +0 -1089
- package/dist/esm/index-72ac5051.js +0 -80
- package/dist/esm/store-b8d17c10.js +0 -204
- package/dist/loader/package.json +0 -11
- /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
- /package/dist/component-library/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
- /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
|
@@ -1,30 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
function _interopNamespace(e) {
|
|
4
|
-
if (e && e.__esModule) return e;
|
|
5
|
-
var n = Object.create(null);
|
|
6
|
-
if (e) {
|
|
7
|
-
Object.keys(e).forEach(function (k) {
|
|
8
|
-
if (k !== 'default') {
|
|
9
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
10
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function () {
|
|
13
|
-
return e[k];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n['default'] = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
3
|
const NAMESPACE = 'component-library';
|
|
24
|
-
const BUILD = /* component-library */ {
|
|
4
|
+
const BUILD = /* component-library */ { hydratedSelectorName: "hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
25
5
|
|
|
26
6
|
/*
|
|
27
|
-
Stencil Client Platform v4.
|
|
7
|
+
Stencil Client Platform v4.30.0 | MIT Licensed | https://stenciljs.com
|
|
28
8
|
*/
|
|
29
9
|
var __defProp = Object.defineProperty;
|
|
30
10
|
var __export = (target, all) => {
|
|
@@ -32,6 +12,34 @@ var __export = (target, all) => {
|
|
|
32
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
33
13
|
};
|
|
34
14
|
|
|
15
|
+
// src/utils/constants.ts
|
|
16
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
17
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
18
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
19
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
20
|
+
PrimitiveType2["Null"] = "null";
|
|
21
|
+
PrimitiveType2["String"] = "string";
|
|
22
|
+
PrimitiveType2["Number"] = "number";
|
|
23
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
24
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
25
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
26
|
+
return PrimitiveType2;
|
|
27
|
+
})(PrimitiveType || {});
|
|
28
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
29
|
+
NonPrimitiveType2["Array"] = "array";
|
|
30
|
+
NonPrimitiveType2["Date"] = "date";
|
|
31
|
+
NonPrimitiveType2["Map"] = "map";
|
|
32
|
+
NonPrimitiveType2["Object"] = "object";
|
|
33
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
34
|
+
NonPrimitiveType2["Set"] = "set";
|
|
35
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
36
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
37
|
+
return NonPrimitiveType2;
|
|
38
|
+
})(NonPrimitiveType || {});
|
|
39
|
+
var TYPE_CONSTANT = "type";
|
|
40
|
+
var VALUE_CONSTANT = "value";
|
|
41
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
42
|
+
|
|
35
43
|
// src/utils/es2022-rewire-class-members.ts
|
|
36
44
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
37
45
|
var _a;
|
|
@@ -105,13 +113,13 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
105
113
|
return module[exportName];
|
|
106
114
|
}
|
|
107
115
|
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/
|
|
108
|
-
return
|
|
116
|
+
return import(
|
|
109
117
|
/* @vite-ignore */
|
|
110
118
|
/* webpackInclude: /\.entry\.js$/ */
|
|
111
119
|
/* webpackExclude: /\.system\.entry\.js$/ */
|
|
112
120
|
/* webpackMode: "lazy" */
|
|
113
121
|
`./${bundleId}.entry.js${""}`
|
|
114
|
-
)
|
|
122
|
+
).then(
|
|
115
123
|
(importedModule) => {
|
|
116
124
|
{
|
|
117
125
|
cmpModules.set(bundleId, importedModule);
|
|
@@ -126,7 +134,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
126
134
|
|
|
127
135
|
// src/client/client-style.ts
|
|
128
136
|
var styles = /* @__PURE__ */ new Map();
|
|
137
|
+
|
|
138
|
+
// src/runtime/runtime-constants.ts
|
|
139
|
+
var CONTENT_REF_ID = "r";
|
|
140
|
+
var ORG_LOCATION_ID = "o";
|
|
141
|
+
var SLOT_NODE_ID = "s";
|
|
142
|
+
var TEXT_NODE_ID = "t";
|
|
143
|
+
var COMMENT_NODE_ID = "c";
|
|
144
|
+
var HYDRATE_ID = "s-id";
|
|
129
145
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
146
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
130
147
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
131
148
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
132
149
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
@@ -221,6 +238,106 @@ function queryNonceMetaTagContent(doc) {
|
|
|
221
238
|
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
222
239
|
}
|
|
223
240
|
|
|
241
|
+
// src/utils/regular-expression.ts
|
|
242
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
243
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
244
|
+
};
|
|
245
|
+
|
|
246
|
+
// src/utils/remote-value.ts
|
|
247
|
+
var RemoteValue = class _RemoteValue {
|
|
248
|
+
/**
|
|
249
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
250
|
+
*
|
|
251
|
+
* @param serialized The serialized LocalValue object
|
|
252
|
+
* @returns The original JavaScript value/object
|
|
253
|
+
*/
|
|
254
|
+
static fromLocalValue(serialized) {
|
|
255
|
+
const type = serialized[TYPE_CONSTANT];
|
|
256
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
257
|
+
switch (type) {
|
|
258
|
+
case "string" /* String */:
|
|
259
|
+
return value;
|
|
260
|
+
case "boolean" /* Boolean */:
|
|
261
|
+
return value;
|
|
262
|
+
case "bigint" /* BigInt */:
|
|
263
|
+
return BigInt(value);
|
|
264
|
+
case "undefined" /* Undefined */:
|
|
265
|
+
return void 0;
|
|
266
|
+
case "null" /* Null */:
|
|
267
|
+
return null;
|
|
268
|
+
case "number" /* Number */:
|
|
269
|
+
if (value === "NaN") return NaN;
|
|
270
|
+
if (value === "-0") return -0;
|
|
271
|
+
if (value === "Infinity") return Infinity;
|
|
272
|
+
if (value === "-Infinity") return -Infinity;
|
|
273
|
+
return value;
|
|
274
|
+
case "array" /* Array */:
|
|
275
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
276
|
+
case "date" /* Date */:
|
|
277
|
+
return new Date(value);
|
|
278
|
+
case "map" /* Map */:
|
|
279
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
280
|
+
for (const [key, val] of value) {
|
|
281
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
282
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
283
|
+
map2.set(deserializedKey, deserializedValue);
|
|
284
|
+
}
|
|
285
|
+
return map2;
|
|
286
|
+
case "object" /* Object */:
|
|
287
|
+
const obj = {};
|
|
288
|
+
for (const [key, val] of value) {
|
|
289
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
290
|
+
}
|
|
291
|
+
return obj;
|
|
292
|
+
case "regexp" /* RegularExpression */:
|
|
293
|
+
const { pattern, flags } = value;
|
|
294
|
+
return new RegExp(pattern, flags);
|
|
295
|
+
case "set" /* Set */:
|
|
296
|
+
const set = /* @__PURE__ */ new Set();
|
|
297
|
+
for (const item of value) {
|
|
298
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
299
|
+
}
|
|
300
|
+
return set;
|
|
301
|
+
case "symbol" /* Symbol */:
|
|
302
|
+
return Symbol(value);
|
|
303
|
+
default:
|
|
304
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
309
|
+
*
|
|
310
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
311
|
+
* @returns Array of deserialized JavaScript values
|
|
312
|
+
*/
|
|
313
|
+
static fromLocalValueArray(serializedValues) {
|
|
314
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
318
|
+
*
|
|
319
|
+
* @param obj Object to verify
|
|
320
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
321
|
+
*/
|
|
322
|
+
static isLocalValueObject(obj) {
|
|
323
|
+
if (typeof obj !== "object" || obj === null) {
|
|
324
|
+
return false;
|
|
325
|
+
}
|
|
326
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
327
|
+
return false;
|
|
328
|
+
}
|
|
329
|
+
const type = obj[TYPE_CONSTANT];
|
|
330
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
331
|
+
if (!hasTypeProperty) {
|
|
332
|
+
return false;
|
|
333
|
+
}
|
|
334
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
335
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
336
|
+
}
|
|
337
|
+
return true;
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
|
|
224
341
|
// src/utils/result.ts
|
|
225
342
|
var result_exports = {};
|
|
226
343
|
__export(result_exports, {
|
|
@@ -269,6 +386,14 @@ var unwrapErr = (result) => {
|
|
|
269
386
|
throw result.value;
|
|
270
387
|
}
|
|
271
388
|
};
|
|
389
|
+
|
|
390
|
+
// src/utils/serialize.ts
|
|
391
|
+
function deserializeProperty(value) {
|
|
392
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
393
|
+
return value;
|
|
394
|
+
}
|
|
395
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
396
|
+
}
|
|
272
397
|
var updateFallbackSlotVisibility = (elm) => {
|
|
273
398
|
const childNodes = internalCall(elm, "childNodes");
|
|
274
399
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
@@ -306,9 +431,8 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
306
431
|
let childNode;
|
|
307
432
|
for (; i2 < childNodes.length; i2++) {
|
|
308
433
|
childNode = childNodes[i2];
|
|
309
|
-
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0
|
|
434
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
310
435
|
slottedNodes.push(childNode);
|
|
311
|
-
if (typeof slotName !== "undefined") return slottedNodes;
|
|
312
436
|
}
|
|
313
437
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
314
438
|
}
|
|
@@ -338,6 +462,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
338
462
|
}
|
|
339
463
|
return slotName === "";
|
|
340
464
|
};
|
|
465
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
466
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
470
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
471
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
472
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
473
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
474
|
+
if (typeof position !== "undefined") {
|
|
475
|
+
slottedNodeLocation["s-oo"] = position;
|
|
476
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
477
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
478
|
+
childNodes.forEach((n) => {
|
|
479
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
480
|
+
});
|
|
481
|
+
slotRelocateNodes.sort((a, b) => {
|
|
482
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
483
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
484
|
+
return 0;
|
|
485
|
+
});
|
|
486
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
487
|
+
} else {
|
|
488
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
489
|
+
}
|
|
490
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
491
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
492
|
+
};
|
|
341
493
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
342
494
|
function patchSlotNode(node) {
|
|
343
495
|
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
@@ -501,13 +653,442 @@ var convertToPrivate = (node) => {
|
|
|
501
653
|
vnode.$name$ = node.vname;
|
|
502
654
|
return vnode;
|
|
503
655
|
};
|
|
656
|
+
|
|
657
|
+
// src/runtime/client-hydrate.ts
|
|
658
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
659
|
+
var _a;
|
|
660
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
661
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
662
|
+
const childRenderNodes = [];
|
|
663
|
+
const slotNodes = [];
|
|
664
|
+
const slottedNodes = [];
|
|
665
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
666
|
+
const vnode = newVNode(tagName, null);
|
|
667
|
+
vnode.$elm$ = hostElm;
|
|
668
|
+
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
669
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
670
|
+
var _a2;
|
|
671
|
+
if (!(memberFlags & 31 /* Prop */)) {
|
|
672
|
+
return;
|
|
673
|
+
}
|
|
674
|
+
const attributeName = metaAttributeName || memberName;
|
|
675
|
+
const attrVal = hostElm.getAttribute(attributeName);
|
|
676
|
+
if (attrVal !== null) {
|
|
677
|
+
const attrPropVal = parsePropertyValue(attrVal, memberFlags);
|
|
678
|
+
(_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
|
|
679
|
+
}
|
|
680
|
+
});
|
|
681
|
+
let scopeId2;
|
|
682
|
+
{
|
|
683
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
684
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
685
|
+
scopeId2 = hostElm["s-sc"];
|
|
686
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
687
|
+
} else if (hostElm["s-sc"]) {
|
|
688
|
+
delete hostElm["s-sc"];
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
692
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
693
|
+
}
|
|
694
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
695
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
696
|
+
hostRef.$vnode$ = clientHydrate(
|
|
697
|
+
vnode,
|
|
698
|
+
childRenderNodes,
|
|
699
|
+
slotNodes,
|
|
700
|
+
shadowRootNodes,
|
|
701
|
+
hostElm,
|
|
702
|
+
hostElm,
|
|
703
|
+
hostId,
|
|
704
|
+
slottedNodes
|
|
705
|
+
);
|
|
706
|
+
let crIndex = 0;
|
|
707
|
+
const crLength = childRenderNodes.length;
|
|
708
|
+
let childRenderNode;
|
|
709
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
710
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
711
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
712
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
713
|
+
const node = childRenderNode.$elm$;
|
|
714
|
+
if (!shadowRoot) {
|
|
715
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
716
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
717
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
721
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
722
|
+
if (childRenderNode.$children$) {
|
|
723
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
724
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
725
|
+
childRenderNode.$children$.forEach((c) => {
|
|
726
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
727
|
+
});
|
|
728
|
+
}
|
|
729
|
+
} else {
|
|
730
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
731
|
+
}
|
|
732
|
+
}
|
|
733
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
734
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
735
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
736
|
+
}
|
|
737
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
738
|
+
if (!shadowRoot) {
|
|
739
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
743
|
+
}
|
|
744
|
+
const hosts = [];
|
|
745
|
+
const snLen = slottedNodes.length;
|
|
746
|
+
let snIndex = 0;
|
|
747
|
+
let slotGroup;
|
|
748
|
+
let snGroupIdx;
|
|
749
|
+
let snGroupLen;
|
|
750
|
+
let slottedItem;
|
|
751
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
752
|
+
slotGroup = slottedNodes[snIndex];
|
|
753
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
754
|
+
snGroupLen = slotGroup.length;
|
|
755
|
+
snGroupIdx = 0;
|
|
756
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
757
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
758
|
+
if (!hosts[slottedItem.hostId]) {
|
|
759
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
760
|
+
}
|
|
761
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
762
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
763
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
764
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
765
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
766
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
767
|
+
} else {
|
|
768
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
769
|
+
}
|
|
770
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
771
|
+
}
|
|
772
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
773
|
+
hostEle.appendChild(slottedItem.node);
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
if (scopeId2 && slotNodes.length) {
|
|
778
|
+
slotNodes.forEach((slot) => {
|
|
779
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
780
|
+
});
|
|
781
|
+
}
|
|
782
|
+
if (shadowRoot && !shadowRoot.childNodes.length) {
|
|
783
|
+
let rnIdex = 0;
|
|
784
|
+
const rnLen = shadowRootNodes.length;
|
|
785
|
+
if (rnLen) {
|
|
786
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
787
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
788
|
+
}
|
|
789
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
790
|
+
if (typeof node["s-sn"] !== "string") {
|
|
791
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
792
|
+
node.removeAttribute("hidden");
|
|
793
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
794
|
+
node.parentNode.removeChild(node);
|
|
795
|
+
}
|
|
796
|
+
}
|
|
797
|
+
});
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
801
|
+
hostRef.$hostElement$ = hostElm;
|
|
802
|
+
endHydrate();
|
|
803
|
+
};
|
|
804
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
805
|
+
let childNodeType;
|
|
806
|
+
let childIdSplt;
|
|
807
|
+
let childVNode;
|
|
808
|
+
let i2;
|
|
809
|
+
const scopeId2 = hostElm["s-sc"];
|
|
810
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
811
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
812
|
+
if (childNodeType) {
|
|
813
|
+
childIdSplt = childNodeType.split(".");
|
|
814
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
815
|
+
childVNode = createSimpleVNode({
|
|
816
|
+
$flags$: 0,
|
|
817
|
+
$hostId$: childIdSplt[0],
|
|
818
|
+
$nodeId$: childIdSplt[1],
|
|
819
|
+
$depth$: childIdSplt[2],
|
|
820
|
+
$index$: childIdSplt[3],
|
|
821
|
+
$tag$: node.tagName.toLowerCase(),
|
|
822
|
+
$elm$: node,
|
|
823
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
824
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
825
|
+
$attrs$: { class: node.className || "" }
|
|
826
|
+
});
|
|
827
|
+
childRenderNodes.push(childVNode);
|
|
828
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
829
|
+
if (!parentVNode.$children$) {
|
|
830
|
+
parentVNode.$children$ = [];
|
|
831
|
+
}
|
|
832
|
+
if (scopeId2) {
|
|
833
|
+
node["s-si"] = scopeId2;
|
|
834
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
835
|
+
}
|
|
836
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
837
|
+
if (typeof slotName === "string") {
|
|
838
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
839
|
+
addSlot(
|
|
840
|
+
slotName,
|
|
841
|
+
childIdSplt[2],
|
|
842
|
+
childVNode,
|
|
843
|
+
node,
|
|
844
|
+
parentVNode,
|
|
845
|
+
childRenderNodes,
|
|
846
|
+
slotNodes,
|
|
847
|
+
shadowRootNodes,
|
|
848
|
+
slottedNodes
|
|
849
|
+
);
|
|
850
|
+
if (scopeId2) {
|
|
851
|
+
node.classList.add(scopeId2);
|
|
852
|
+
}
|
|
853
|
+
}
|
|
854
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
855
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
856
|
+
}
|
|
857
|
+
if (childVNode.$index$ !== void 0) {
|
|
858
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
859
|
+
}
|
|
860
|
+
parentVNode = childVNode;
|
|
861
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
862
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
if (node.shadowRoot) {
|
|
867
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
868
|
+
clientHydrate(
|
|
869
|
+
parentVNode,
|
|
870
|
+
childRenderNodes,
|
|
871
|
+
slotNodes,
|
|
872
|
+
shadowRootNodes,
|
|
873
|
+
hostElm,
|
|
874
|
+
node.shadowRoot.childNodes[i2],
|
|
875
|
+
hostId,
|
|
876
|
+
slottedNodes
|
|
877
|
+
);
|
|
878
|
+
}
|
|
879
|
+
}
|
|
880
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
881
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
882
|
+
clientHydrate(
|
|
883
|
+
parentVNode,
|
|
884
|
+
childRenderNodes,
|
|
885
|
+
slotNodes,
|
|
886
|
+
shadowRootNodes,
|
|
887
|
+
hostElm,
|
|
888
|
+
nonShadowNodes[i2],
|
|
889
|
+
hostId,
|
|
890
|
+
slottedNodes
|
|
891
|
+
);
|
|
892
|
+
}
|
|
893
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
894
|
+
childIdSplt = node.nodeValue.split(".");
|
|
895
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
896
|
+
childNodeType = childIdSplt[0];
|
|
897
|
+
childVNode = createSimpleVNode({
|
|
898
|
+
$hostId$: childIdSplt[1],
|
|
899
|
+
$nodeId$: childIdSplt[2],
|
|
900
|
+
$depth$: childIdSplt[3],
|
|
901
|
+
$index$: childIdSplt[4] || "0",
|
|
902
|
+
$elm$: node,
|
|
903
|
+
$attrs$: null,
|
|
904
|
+
$children$: null,
|
|
905
|
+
$key$: null,
|
|
906
|
+
$name$: null,
|
|
907
|
+
$tag$: null,
|
|
908
|
+
$text$: null
|
|
909
|
+
});
|
|
910
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
911
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
912
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
913
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
914
|
+
childRenderNodes.push(childVNode);
|
|
915
|
+
node.remove();
|
|
916
|
+
if (hostId === childVNode.$hostId$) {
|
|
917
|
+
if (!parentVNode.$children$) {
|
|
918
|
+
parentVNode.$children$ = [];
|
|
919
|
+
}
|
|
920
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
921
|
+
}
|
|
922
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
923
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
924
|
+
}
|
|
925
|
+
}
|
|
926
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
927
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
928
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
929
|
+
childRenderNodes.push(childVNode);
|
|
930
|
+
node.remove();
|
|
931
|
+
}
|
|
932
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
933
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
934
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
935
|
+
addSlot(
|
|
936
|
+
slotName,
|
|
937
|
+
childIdSplt[2],
|
|
938
|
+
childVNode,
|
|
939
|
+
node,
|
|
940
|
+
parentVNode,
|
|
941
|
+
childRenderNodes,
|
|
942
|
+
slotNodes,
|
|
943
|
+
shadowRootNodes,
|
|
944
|
+
slottedNodes
|
|
945
|
+
);
|
|
946
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
947
|
+
if (shadowRootNodes) {
|
|
948
|
+
node.remove();
|
|
949
|
+
} else {
|
|
950
|
+
hostElm["s-cr"] = node;
|
|
951
|
+
node["s-cn"] = true;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
957
|
+
const vnode = newVNode(null, node.textContent);
|
|
958
|
+
vnode.$elm$ = node;
|
|
959
|
+
vnode.$index$ = "0";
|
|
960
|
+
parentVNode.$children$ = [vnode];
|
|
961
|
+
} else {
|
|
962
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
963
|
+
node.remove();
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
return parentVNode;
|
|
967
|
+
};
|
|
968
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
969
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
970
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
971
|
+
if (componentId) {
|
|
972
|
+
orgLocNodes.set(componentId, node);
|
|
973
|
+
}
|
|
974
|
+
let i2 = 0;
|
|
975
|
+
if (node.shadowRoot) {
|
|
976
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
977
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
981
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
982
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
983
|
+
}
|
|
984
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
985
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
986
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
987
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
988
|
+
node.nodeValue = "";
|
|
989
|
+
node["s-en"] = childIdSplt[3];
|
|
990
|
+
}
|
|
991
|
+
}
|
|
992
|
+
};
|
|
993
|
+
var createSimpleVNode = (vnode) => {
|
|
994
|
+
const defaultVNode = {
|
|
995
|
+
$flags$: 0,
|
|
996
|
+
$hostId$: null,
|
|
997
|
+
$nodeId$: null,
|
|
998
|
+
$depth$: null,
|
|
999
|
+
$index$: "0",
|
|
1000
|
+
$elm$: null,
|
|
1001
|
+
$attrs$: null,
|
|
1002
|
+
$children$: null,
|
|
1003
|
+
$key$: null,
|
|
1004
|
+
$name$: null,
|
|
1005
|
+
$tag$: null,
|
|
1006
|
+
$text$: null
|
|
1007
|
+
};
|
|
1008
|
+
return { ...defaultVNode, ...vnode };
|
|
1009
|
+
};
|
|
1010
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1011
|
+
node["s-sr"] = true;
|
|
1012
|
+
childVNode.$name$ = slotName || null;
|
|
1013
|
+
childVNode.$tag$ = "slot";
|
|
1014
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1015
|
+
if (shadowRootNodes && win.document) {
|
|
1016
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1017
|
+
if (childVNode.$name$) {
|
|
1018
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1019
|
+
}
|
|
1020
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1021
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1022
|
+
} else {
|
|
1023
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1024
|
+
}
|
|
1025
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1026
|
+
node.remove();
|
|
1027
|
+
if (childVNode.$depth$ === "0") {
|
|
1028
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1029
|
+
}
|
|
1030
|
+
} else {
|
|
1031
|
+
const slot = childVNode.$elm$;
|
|
1032
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1033
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1034
|
+
patchSlotNode(node);
|
|
1035
|
+
if (shouldMove) {
|
|
1036
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1037
|
+
}
|
|
1038
|
+
childRenderNodes.push(childVNode);
|
|
1039
|
+
}
|
|
1040
|
+
slotNodes.push(childVNode);
|
|
1041
|
+
if (!parentVNode.$children$) {
|
|
1042
|
+
parentVNode.$children$ = [];
|
|
1043
|
+
}
|
|
1044
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1045
|
+
}
|
|
1046
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1047
|
+
let slottedNode = slotNode.nextSibling;
|
|
1048
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1049
|
+
while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
|
|
1050
|
+
slottedNode["s-sn"] = slotName;
|
|
1051
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1052
|
+
slottedNode = slottedNode.nextSibling;
|
|
1053
|
+
}
|
|
1054
|
+
};
|
|
1055
|
+
var findCorrespondingNode = (node, type) => {
|
|
1056
|
+
let sibling = node;
|
|
1057
|
+
do {
|
|
1058
|
+
sibling = sibling.nextSibling;
|
|
1059
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
1060
|
+
return sibling;
|
|
1061
|
+
};
|
|
1062
|
+
var createSupportsRuleRe = (selector) => {
|
|
1063
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
1064
|
+
return new RegExp(
|
|
1065
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
1066
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
1067
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
1068
|
+
"g"
|
|
1069
|
+
);
|
|
1070
|
+
};
|
|
1071
|
+
createSupportsRuleRe("::slotted");
|
|
1072
|
+
createSupportsRuleRe(":host");
|
|
1073
|
+
createSupportsRuleRe(":host-context");
|
|
504
1074
|
var parsePropertyValue = (propValue, propType) => {
|
|
1075
|
+
if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
1076
|
+
try {
|
|
1077
|
+
propValue = JSON.parse(propValue);
|
|
1078
|
+
return propValue;
|
|
1079
|
+
} catch (e) {
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1083
|
+
propValue = deserializeProperty(propValue);
|
|
1084
|
+
return propValue;
|
|
1085
|
+
}
|
|
505
1086
|
if (propValue != null && !isComplexType(propValue)) {
|
|
506
1087
|
if (propType & 4 /* Boolean */) {
|
|
507
1088
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
508
1089
|
}
|
|
509
1090
|
if (propType & 2 /* Number */) {
|
|
510
|
-
return parseFloat(propValue);
|
|
1091
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
511
1092
|
}
|
|
512
1093
|
if (propType & 1 /* String */) {
|
|
513
1094
|
return String(propValue);
|
|
@@ -524,9 +1105,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
524
1105
|
return {
|
|
525
1106
|
emit: (detail) => {
|
|
526
1107
|
return emitEvent(elm, name, {
|
|
527
|
-
bubbles:
|
|
528
|
-
composed:
|
|
529
|
-
cancelable:
|
|
1108
|
+
bubbles: true,
|
|
1109
|
+
composed: true,
|
|
1110
|
+
cancelable: true,
|
|
530
1111
|
detail
|
|
531
1112
|
});
|
|
532
1113
|
}
|
|
@@ -569,7 +1150,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
569
1150
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
570
1151
|
}
|
|
571
1152
|
if (!appliedStyles.has(scopeId2)) {
|
|
572
|
-
{
|
|
1153
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1154
|
+
styleElm.innerHTML = style;
|
|
1155
|
+
} else {
|
|
573
1156
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
574
1157
|
styleElm.innerHTML = style;
|
|
575
1158
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
@@ -626,13 +1209,24 @@ var attachStyles = (hostRef) => {
|
|
|
626
1209
|
const scopeId2 = addStyle(
|
|
627
1210
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
628
1211
|
cmpMeta);
|
|
629
|
-
if (
|
|
1212
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
630
1213
|
elm["s-sc"] = scopeId2;
|
|
631
1214
|
elm.classList.add(scopeId2 + "-h");
|
|
632
1215
|
}
|
|
633
1216
|
endAttachStyles();
|
|
634
1217
|
};
|
|
635
1218
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
1219
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1220
|
+
var hydrateScopedToShadow = () => {
|
|
1221
|
+
if (!win.document) {
|
|
1222
|
+
return;
|
|
1223
|
+
}
|
|
1224
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1225
|
+
let i2 = 0;
|
|
1226
|
+
for (; i2 < styles2.length; i2++) {
|
|
1227
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1228
|
+
}
|
|
1229
|
+
};
|
|
636
1230
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
637
1231
|
if (oldValue === newValue) {
|
|
638
1232
|
return;
|
|
@@ -643,7 +1237,14 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
643
1237
|
const classList = elm.classList;
|
|
644
1238
|
const oldClasses = parseClassList(oldValue);
|
|
645
1239
|
let newClasses = parseClassList(newValue);
|
|
646
|
-
{
|
|
1240
|
+
if (elm["s-si"] && initialRender) {
|
|
1241
|
+
newClasses.push(elm["s-si"]);
|
|
1242
|
+
oldClasses.forEach((c) => {
|
|
1243
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1244
|
+
});
|
|
1245
|
+
newClasses = [...new Set(newClasses)];
|
|
1246
|
+
classList.add(...newClasses);
|
|
1247
|
+
} else {
|
|
647
1248
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
648
1249
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
649
1250
|
}
|
|
@@ -763,7 +1364,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
763
1364
|
oldVnodeAttrs[memberName],
|
|
764
1365
|
void 0,
|
|
765
1366
|
isSvgMode2,
|
|
766
|
-
newVnode.$flags
|
|
1367
|
+
newVnode.$flags$,
|
|
1368
|
+
isInitialRender
|
|
1369
|
+
);
|
|
767
1370
|
}
|
|
768
1371
|
}
|
|
769
1372
|
}
|
|
@@ -774,7 +1377,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
774
1377
|
oldVnodeAttrs[memberName],
|
|
775
1378
|
newVnodeAttrs[memberName],
|
|
776
1379
|
isSvgMode2,
|
|
777
|
-
newVnode.$flags
|
|
1380
|
+
newVnode.$flags$,
|
|
1381
|
+
isInitialRender
|
|
1382
|
+
);
|
|
778
1383
|
}
|
|
779
1384
|
};
|
|
780
1385
|
function sortedAttrNames(attrNames) {
|
|
@@ -825,14 +1430,21 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
825
1430
|
updateElement(null, newVNode2, isSvgMode);
|
|
826
1431
|
}
|
|
827
1432
|
} else {
|
|
1433
|
+
if (!isSvgMode) {
|
|
1434
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1435
|
+
}
|
|
828
1436
|
if (!win.document) {
|
|
829
1437
|
throw new Error(
|
|
830
1438
|
"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."
|
|
831
1439
|
);
|
|
832
1440
|
}
|
|
833
|
-
elm = newVNode2.$elm$ = win.document.
|
|
1441
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
1442
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
834
1443
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
835
|
-
);
|
|
1444
|
+
) ;
|
|
1445
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1446
|
+
isSvgMode = false;
|
|
1447
|
+
}
|
|
836
1448
|
{
|
|
837
1449
|
updateElement(null, newVNode2, isSvgMode);
|
|
838
1450
|
}
|
|
@@ -847,6 +1459,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
847
1459
|
}
|
|
848
1460
|
}
|
|
849
1461
|
}
|
|
1462
|
+
{
|
|
1463
|
+
if (newVNode2.$tag$ === "svg") {
|
|
1464
|
+
isSvgMode = false;
|
|
1465
|
+
} else if (elm.tagName === "foreignObject") {
|
|
1466
|
+
isSvgMode = true;
|
|
1467
|
+
}
|
|
1468
|
+
}
|
|
850
1469
|
}
|
|
851
1470
|
elm["s-hn"] = hostTagName;
|
|
852
1471
|
{
|
|
@@ -872,14 +1491,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
872
1491
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
873
1492
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
874
1493
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
875
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
876
|
-
let node = parentElm;
|
|
877
|
-
while (node = node.nextSibling) {
|
|
878
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
879
|
-
oldSlotChildNodes.push(node);
|
|
880
|
-
}
|
|
881
|
-
}
|
|
882
|
-
}
|
|
883
1494
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
884
1495
|
const childNode = oldSlotChildNodes[i2];
|
|
885
1496
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
@@ -893,7 +1504,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
893
1504
|
putBackInOriginalLocation(childNode, recursive);
|
|
894
1505
|
}
|
|
895
1506
|
}
|
|
896
|
-
plt.$flags$ &=
|
|
1507
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
897
1508
|
};
|
|
898
1509
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
899
1510
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
@@ -1045,11 +1656,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1045
1656
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1046
1657
|
const oldChildren = oldVNode.$children$;
|
|
1047
1658
|
const newChildren = newVNode2.$children$;
|
|
1659
|
+
const tag = newVNode2.$tag$;
|
|
1048
1660
|
const text = newVNode2.$text$;
|
|
1049
1661
|
let defaultHolder;
|
|
1050
1662
|
if (text === null) {
|
|
1051
1663
|
{
|
|
1052
|
-
|
|
1664
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1665
|
+
}
|
|
1666
|
+
{
|
|
1667
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
1053
1668
|
}
|
|
1054
1669
|
if (oldChildren !== null && newChildren !== null) {
|
|
1055
1670
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1064,6 +1679,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1064
1679
|
) {
|
|
1065
1680
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1066
1681
|
}
|
|
1682
|
+
if (isSvgMode && tag === "svg") {
|
|
1683
|
+
isSvgMode = false;
|
|
1684
|
+
}
|
|
1067
1685
|
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1068
1686
|
defaultHolder.parentNode.textContent = text;
|
|
1069
1687
|
} else if (oldVNode.$text$ !== text) {
|
|
@@ -1082,7 +1700,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1082
1700
|
const slotName = childNode["s-sn"];
|
|
1083
1701
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1084
1702
|
node = hostContentNodes[j];
|
|
1085
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (
|
|
1703
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
1086
1704
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1087
1705
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1088
1706
|
checkSlotFallbackVisibility = true;
|
|
@@ -1160,7 +1778,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1160
1778
|
const hostElm = hostRef.$hostElement$;
|
|
1161
1779
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1162
1780
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1163
|
-
const
|
|
1781
|
+
const isHostElement = isHost(renderFnResults);
|
|
1782
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1164
1783
|
hostTagName = hostElm.tagName;
|
|
1165
1784
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1166
1785
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
@@ -1244,7 +1863,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1244
1863
|
if (checkSlotFallbackVisibility) {
|
|
1245
1864
|
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1246
1865
|
}
|
|
1247
|
-
plt.$flags$ &=
|
|
1866
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1248
1867
|
relocateNodes.length = 0;
|
|
1249
1868
|
}
|
|
1250
1869
|
contentRef = void 0;
|
|
@@ -1342,7 +1961,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1342
1961
|
renderingRef = instance;
|
|
1343
1962
|
instance = instance.render() ;
|
|
1344
1963
|
{
|
|
1345
|
-
hostRef.$flags$ &=
|
|
1964
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1346
1965
|
}
|
|
1347
1966
|
{
|
|
1348
1967
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -1396,7 +2015,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1396
2015
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1397
2016
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1398
2017
|
}
|
|
1399
|
-
hostRef.$flags$ &=
|
|
2018
|
+
hostRef.$flags$ &= -517;
|
|
1400
2019
|
}
|
|
1401
2020
|
};
|
|
1402
2021
|
var forceUpdate = (ref) => {
|
|
@@ -1659,7 +2278,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1659
2278
|
consoleError(e, elm);
|
|
1660
2279
|
}
|
|
1661
2280
|
{
|
|
1662
|
-
hostRef.$flags$ &=
|
|
2281
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1663
2282
|
}
|
|
1664
2283
|
{
|
|
1665
2284
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
@@ -1706,7 +2325,21 @@ var connectedCallback = (elm) => {
|
|
|
1706
2325
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1707
2326
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1708
2327
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2328
|
+
let hostId;
|
|
1709
2329
|
{
|
|
2330
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2331
|
+
if (hostId) {
|
|
2332
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2333
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2334
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2335
|
+
} else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2336
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
2337
|
+
elm["s-sc"] = scopeId2;
|
|
2338
|
+
}
|
|
2339
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2340
|
+
}
|
|
2341
|
+
}
|
|
2342
|
+
if (!hostId) {
|
|
1710
2343
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1711
2344
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1712
2345
|
setContentReference(elm);
|
|
@@ -1715,7 +2348,7 @@ var connectedCallback = (elm) => {
|
|
|
1715
2348
|
{
|
|
1716
2349
|
let ancestorComponent = elm;
|
|
1717
2350
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1718
|
-
if (ancestorComponent["s-p"]) {
|
|
2351
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1719
2352
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1720
2353
|
break;
|
|
1721
2354
|
}
|
|
@@ -1801,6 +2434,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1801
2434
|
let isBootstrapping = true;
|
|
1802
2435
|
Object.assign(plt, options);
|
|
1803
2436
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
2437
|
+
{
|
|
2438
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
2439
|
+
}
|
|
2440
|
+
{
|
|
2441
|
+
hydrateScopedToShadow();
|
|
2442
|
+
}
|
|
1804
2443
|
let hasSlotRelocation = false;
|
|
1805
2444
|
lazyBundles.map((lazyBundle) => {
|
|
1806
2445
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1926,7 +2565,7 @@ var Fragment = (_, children) => children;
|
|
|
1926
2565
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1927
2566
|
if (listeners && win.document) {
|
|
1928
2567
|
listeners.map(([flags, name, method]) => {
|
|
1929
|
-
const target = elm;
|
|
2568
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1930
2569
|
const handler = hostListenerProxy(hostRef, method);
|
|
1931
2570
|
const opts = hostListenerOpts(flags);
|
|
1932
2571
|
plt.ael(target, name, handler, opts);
|
|
@@ -1948,6 +2587,12 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1948
2587
|
consoleError(e, hostRef.$hostElement$);
|
|
1949
2588
|
}
|
|
1950
2589
|
};
|
|
2590
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2591
|
+
if (flags & 4 /* TargetDocument */) {
|
|
2592
|
+
return doc;
|
|
2593
|
+
}
|
|
2594
|
+
return elm;
|
|
2595
|
+
};
|
|
1951
2596
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1952
2597
|
passive: (flags & 1 /* Passive */) !== 0,
|
|
1953
2598
|
capture: (flags & 2 /* Capture */) !== 0
|
|
@@ -1957,6 +2602,7 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1957
2602
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1958
2603
|
|
|
1959
2604
|
exports.Fragment = Fragment;
|
|
2605
|
+
exports.Host = Host;
|
|
1960
2606
|
exports.bootstrapLazy = bootstrapLazy;
|
|
1961
2607
|
exports.createEvent = createEvent;
|
|
1962
2608
|
exports.forceUpdate = forceUpdate;
|