@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,8 +1,8 @@
|
|
|
1
1
|
const NAMESPACE = 'component-library';
|
|
2
|
-
const BUILD = /* component-library */ {
|
|
2
|
+
const BUILD = /* component-library */ { hydratedSelectorName: "hydrated", lazyLoad: true, slotRelocation: true, updatable: true};
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.30.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -10,6 +10,34 @@ var __export = (target, all) => {
|
|
|
10
10
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
11
|
};
|
|
12
12
|
|
|
13
|
+
// src/utils/constants.ts
|
|
14
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
15
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
16
|
+
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
17
|
+
PrimitiveType2["Undefined"] = "undefined";
|
|
18
|
+
PrimitiveType2["Null"] = "null";
|
|
19
|
+
PrimitiveType2["String"] = "string";
|
|
20
|
+
PrimitiveType2["Number"] = "number";
|
|
21
|
+
PrimitiveType2["SpecialNumber"] = "number";
|
|
22
|
+
PrimitiveType2["Boolean"] = "boolean";
|
|
23
|
+
PrimitiveType2["BigInt"] = "bigint";
|
|
24
|
+
return PrimitiveType2;
|
|
25
|
+
})(PrimitiveType || {});
|
|
26
|
+
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
27
|
+
NonPrimitiveType2["Array"] = "array";
|
|
28
|
+
NonPrimitiveType2["Date"] = "date";
|
|
29
|
+
NonPrimitiveType2["Map"] = "map";
|
|
30
|
+
NonPrimitiveType2["Object"] = "object";
|
|
31
|
+
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
32
|
+
NonPrimitiveType2["Set"] = "set";
|
|
33
|
+
NonPrimitiveType2["Channel"] = "channel";
|
|
34
|
+
NonPrimitiveType2["Symbol"] = "symbol";
|
|
35
|
+
return NonPrimitiveType2;
|
|
36
|
+
})(NonPrimitiveType || {});
|
|
37
|
+
var TYPE_CONSTANT = "type";
|
|
38
|
+
var VALUE_CONSTANT = "value";
|
|
39
|
+
var SERIALIZED_PREFIX = "serialized:";
|
|
40
|
+
|
|
13
41
|
// src/utils/es2022-rewire-class-members.ts
|
|
14
42
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
15
43
|
var _a;
|
|
@@ -104,7 +132,16 @@ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
|
|
|
104
132
|
|
|
105
133
|
// src/client/client-style.ts
|
|
106
134
|
var styles = /* @__PURE__ */ new Map();
|
|
135
|
+
|
|
136
|
+
// src/runtime/runtime-constants.ts
|
|
137
|
+
var CONTENT_REF_ID = "r";
|
|
138
|
+
var ORG_LOCATION_ID = "o";
|
|
139
|
+
var SLOT_NODE_ID = "s";
|
|
140
|
+
var TEXT_NODE_ID = "t";
|
|
141
|
+
var COMMENT_NODE_ID = "c";
|
|
142
|
+
var HYDRATE_ID = "s-id";
|
|
107
143
|
var HYDRATED_STYLE_ID = "sty-id";
|
|
144
|
+
var HYDRATE_CHILD_ID = "c-id";
|
|
108
145
|
var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
|
|
109
146
|
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
110
147
|
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
@@ -199,6 +236,106 @@ function queryNonceMetaTagContent(doc) {
|
|
|
199
236
|
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;
|
|
200
237
|
}
|
|
201
238
|
|
|
239
|
+
// src/utils/regular-expression.ts
|
|
240
|
+
var escapeRegExpSpecialCharacters = (text) => {
|
|
241
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
// src/utils/remote-value.ts
|
|
245
|
+
var RemoteValue = class _RemoteValue {
|
|
246
|
+
/**
|
|
247
|
+
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
248
|
+
*
|
|
249
|
+
* @param serialized The serialized LocalValue object
|
|
250
|
+
* @returns The original JavaScript value/object
|
|
251
|
+
*/
|
|
252
|
+
static fromLocalValue(serialized) {
|
|
253
|
+
const type = serialized[TYPE_CONSTANT];
|
|
254
|
+
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
255
|
+
switch (type) {
|
|
256
|
+
case "string" /* String */:
|
|
257
|
+
return value;
|
|
258
|
+
case "boolean" /* Boolean */:
|
|
259
|
+
return value;
|
|
260
|
+
case "bigint" /* BigInt */:
|
|
261
|
+
return BigInt(value);
|
|
262
|
+
case "undefined" /* Undefined */:
|
|
263
|
+
return void 0;
|
|
264
|
+
case "null" /* Null */:
|
|
265
|
+
return null;
|
|
266
|
+
case "number" /* Number */:
|
|
267
|
+
if (value === "NaN") return NaN;
|
|
268
|
+
if (value === "-0") return -0;
|
|
269
|
+
if (value === "Infinity") return Infinity;
|
|
270
|
+
if (value === "-Infinity") return -Infinity;
|
|
271
|
+
return value;
|
|
272
|
+
case "array" /* Array */:
|
|
273
|
+
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
274
|
+
case "date" /* Date */:
|
|
275
|
+
return new Date(value);
|
|
276
|
+
case "map" /* Map */:
|
|
277
|
+
const map2 = /* @__PURE__ */ new Map();
|
|
278
|
+
for (const [key, val] of value) {
|
|
279
|
+
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
280
|
+
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
281
|
+
map2.set(deserializedKey, deserializedValue);
|
|
282
|
+
}
|
|
283
|
+
return map2;
|
|
284
|
+
case "object" /* Object */:
|
|
285
|
+
const obj = {};
|
|
286
|
+
for (const [key, val] of value) {
|
|
287
|
+
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
288
|
+
}
|
|
289
|
+
return obj;
|
|
290
|
+
case "regexp" /* RegularExpression */:
|
|
291
|
+
const { pattern, flags } = value;
|
|
292
|
+
return new RegExp(pattern, flags);
|
|
293
|
+
case "set" /* Set */:
|
|
294
|
+
const set = /* @__PURE__ */ new Set();
|
|
295
|
+
for (const item of value) {
|
|
296
|
+
set.add(_RemoteValue.fromLocalValue(item));
|
|
297
|
+
}
|
|
298
|
+
return set;
|
|
299
|
+
case "symbol" /* Symbol */:
|
|
300
|
+
return Symbol(value);
|
|
301
|
+
default:
|
|
302
|
+
throw new Error(`Unsupported type: ${type}`);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Utility method to deserialize multiple LocalValues at once
|
|
307
|
+
*
|
|
308
|
+
* @param serializedValues Array of serialized LocalValue objects
|
|
309
|
+
* @returns Array of deserialized JavaScript values
|
|
310
|
+
*/
|
|
311
|
+
static fromLocalValueArray(serializedValues) {
|
|
312
|
+
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
316
|
+
*
|
|
317
|
+
* @param obj Object to verify
|
|
318
|
+
* @returns boolean indicating if the object has LocalValue structure
|
|
319
|
+
*/
|
|
320
|
+
static isLocalValueObject(obj) {
|
|
321
|
+
if (typeof obj !== "object" || obj === null) {
|
|
322
|
+
return false;
|
|
323
|
+
}
|
|
324
|
+
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
325
|
+
return false;
|
|
326
|
+
}
|
|
327
|
+
const type = obj[TYPE_CONSTANT];
|
|
328
|
+
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
329
|
+
if (!hasTypeProperty) {
|
|
330
|
+
return false;
|
|
331
|
+
}
|
|
332
|
+
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
333
|
+
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
334
|
+
}
|
|
335
|
+
return true;
|
|
336
|
+
}
|
|
337
|
+
};
|
|
338
|
+
|
|
202
339
|
// src/utils/result.ts
|
|
203
340
|
var result_exports = {};
|
|
204
341
|
__export(result_exports, {
|
|
@@ -247,6 +384,14 @@ var unwrapErr = (result) => {
|
|
|
247
384
|
throw result.value;
|
|
248
385
|
}
|
|
249
386
|
};
|
|
387
|
+
|
|
388
|
+
// src/utils/serialize.ts
|
|
389
|
+
function deserializeProperty(value) {
|
|
390
|
+
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
391
|
+
return value;
|
|
392
|
+
}
|
|
393
|
+
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
394
|
+
}
|
|
250
395
|
var updateFallbackSlotVisibility = (elm) => {
|
|
251
396
|
const childNodes = internalCall(elm, "childNodes");
|
|
252
397
|
if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
|
|
@@ -284,9 +429,8 @@ function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
|
284
429
|
let childNode;
|
|
285
430
|
for (; i2 < childNodes.length; i2++) {
|
|
286
431
|
childNode = childNodes[i2];
|
|
287
|
-
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0
|
|
432
|
+
if (childNode["s-sr"] && (!hostName || childNode["s-hn"] === hostName) && (slotName === void 0)) {
|
|
288
433
|
slottedNodes.push(childNode);
|
|
289
|
-
if (typeof slotName !== "undefined") return slottedNodes;
|
|
290
434
|
}
|
|
291
435
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
292
436
|
}
|
|
@@ -316,6 +460,34 @@ var isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
|
|
|
316
460
|
}
|
|
317
461
|
return slotName === "";
|
|
318
462
|
};
|
|
463
|
+
var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
464
|
+
if (newChild["s-ol"] && newChild["s-ol"].isConnected) {
|
|
465
|
+
return;
|
|
466
|
+
}
|
|
467
|
+
const slottedNodeLocation = document.createTextNode("");
|
|
468
|
+
slottedNodeLocation["s-nr"] = newChild;
|
|
469
|
+
if (!slotNode["s-cr"] || !slotNode["s-cr"].parentNode) return;
|
|
470
|
+
const parent = slotNode["s-cr"].parentNode;
|
|
471
|
+
const appendMethod = internalCall(parent, "appendChild");
|
|
472
|
+
if (typeof position !== "undefined") {
|
|
473
|
+
slottedNodeLocation["s-oo"] = position;
|
|
474
|
+
const childNodes = internalCall(parent, "childNodes");
|
|
475
|
+
const slotRelocateNodes = [slottedNodeLocation];
|
|
476
|
+
childNodes.forEach((n) => {
|
|
477
|
+
if (n["s-nr"]) slotRelocateNodes.push(n);
|
|
478
|
+
});
|
|
479
|
+
slotRelocateNodes.sort((a, b) => {
|
|
480
|
+
if (!a["s-oo"] || a["s-oo"] < (b["s-oo"] || 0)) return -1;
|
|
481
|
+
else if (!b["s-oo"] || b["s-oo"] < a["s-oo"]) return 1;
|
|
482
|
+
return 0;
|
|
483
|
+
});
|
|
484
|
+
slotRelocateNodes.forEach((n) => appendMethod.call(parent, n));
|
|
485
|
+
} else {
|
|
486
|
+
appendMethod.call(parent, slottedNodeLocation);
|
|
487
|
+
}
|
|
488
|
+
newChild["s-ol"] = slottedNodeLocation;
|
|
489
|
+
newChild["s-sh"] = slotNode["s-hn"];
|
|
490
|
+
};
|
|
319
491
|
var getSlotName = (node) => typeof node["s-sn"] === "string" ? node["s-sn"] : node.nodeType === 1 && node.getAttribute("slot") || void 0;
|
|
320
492
|
function patchSlotNode(node) {
|
|
321
493
|
if (node.assignedElements || node.assignedNodes || !node["s-sr"]) return;
|
|
@@ -479,13 +651,442 @@ var convertToPrivate = (node) => {
|
|
|
479
651
|
vnode.$name$ = node.vname;
|
|
480
652
|
return vnode;
|
|
481
653
|
};
|
|
654
|
+
|
|
655
|
+
// src/runtime/client-hydrate.ts
|
|
656
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
657
|
+
var _a;
|
|
658
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
659
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
660
|
+
const childRenderNodes = [];
|
|
661
|
+
const slotNodes = [];
|
|
662
|
+
const slottedNodes = [];
|
|
663
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
664
|
+
const vnode = newVNode(tagName, null);
|
|
665
|
+
vnode.$elm$ = hostElm;
|
|
666
|
+
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
667
|
+
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
668
|
+
var _a2;
|
|
669
|
+
if (!(memberFlags & 31 /* Prop */)) {
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const attributeName = metaAttributeName || memberName;
|
|
673
|
+
const attrVal = hostElm.getAttribute(attributeName);
|
|
674
|
+
if (attrVal !== null) {
|
|
675
|
+
const attrPropVal = parsePropertyValue(attrVal, memberFlags);
|
|
676
|
+
(_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
|
|
677
|
+
}
|
|
678
|
+
});
|
|
679
|
+
let scopeId2;
|
|
680
|
+
{
|
|
681
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
682
|
+
if (cmpMeta && cmpMeta.$flags$ & 10 /* needsScopedEncapsulation */ && hostElm["s-sc"]) {
|
|
683
|
+
scopeId2 = hostElm["s-sc"];
|
|
684
|
+
hostElm.classList.add(scopeId2 + "-h");
|
|
685
|
+
} else if (hostElm["s-sc"]) {
|
|
686
|
+
delete hostElm["s-sc"];
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
if (win.document && (!plt.$orgLocNodes$ || !plt.$orgLocNodes$.size)) {
|
|
690
|
+
initializeDocumentHydrate(win.document.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
691
|
+
}
|
|
692
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
693
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
694
|
+
hostRef.$vnode$ = clientHydrate(
|
|
695
|
+
vnode,
|
|
696
|
+
childRenderNodes,
|
|
697
|
+
slotNodes,
|
|
698
|
+
shadowRootNodes,
|
|
699
|
+
hostElm,
|
|
700
|
+
hostElm,
|
|
701
|
+
hostId,
|
|
702
|
+
slottedNodes
|
|
703
|
+
);
|
|
704
|
+
let crIndex = 0;
|
|
705
|
+
const crLength = childRenderNodes.length;
|
|
706
|
+
let childRenderNode;
|
|
707
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
708
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
709
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
710
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
711
|
+
const node = childRenderNode.$elm$;
|
|
712
|
+
if (!shadowRoot) {
|
|
713
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
714
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
715
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
719
|
+
childRenderNode.$name$ = childRenderNode.$elm$["s-sn"] || childRenderNode.$elm$["name"] || null;
|
|
720
|
+
if (childRenderNode.$children$) {
|
|
721
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
722
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
723
|
+
childRenderNode.$children$.forEach((c) => {
|
|
724
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
725
|
+
});
|
|
726
|
+
}
|
|
727
|
+
} else {
|
|
728
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
732
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
733
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
734
|
+
}
|
|
735
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
736
|
+
if (!shadowRoot) {
|
|
737
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
741
|
+
}
|
|
742
|
+
const hosts = [];
|
|
743
|
+
const snLen = slottedNodes.length;
|
|
744
|
+
let snIndex = 0;
|
|
745
|
+
let slotGroup;
|
|
746
|
+
let snGroupIdx;
|
|
747
|
+
let snGroupLen;
|
|
748
|
+
let slottedItem;
|
|
749
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
750
|
+
slotGroup = slottedNodes[snIndex];
|
|
751
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
752
|
+
snGroupLen = slotGroup.length;
|
|
753
|
+
snGroupIdx = 0;
|
|
754
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
755
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
756
|
+
if (!hosts[slottedItem.hostId]) {
|
|
757
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
758
|
+
}
|
|
759
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
760
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
761
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
762
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
763
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
764
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
765
|
+
} else {
|
|
766
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
767
|
+
}
|
|
768
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
769
|
+
}
|
|
770
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
771
|
+
hostEle.appendChild(slottedItem.node);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
if (scopeId2 && slotNodes.length) {
|
|
776
|
+
slotNodes.forEach((slot) => {
|
|
777
|
+
slot.$elm$.parentElement.classList.add(scopeId2 + "-s");
|
|
778
|
+
});
|
|
779
|
+
}
|
|
780
|
+
if (shadowRoot && !shadowRoot.childNodes.length) {
|
|
781
|
+
let rnIdex = 0;
|
|
782
|
+
const rnLen = shadowRootNodes.length;
|
|
783
|
+
if (rnLen) {
|
|
784
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
785
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
786
|
+
}
|
|
787
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
788
|
+
if (typeof node["s-sn"] !== "string") {
|
|
789
|
+
if (node.nodeType === 1 /* ElementNode */ && node.slot && node.hidden) {
|
|
790
|
+
node.removeAttribute("hidden");
|
|
791
|
+
} else if (node.nodeType === 8 /* CommentNode */ || node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
792
|
+
node.parentNode.removeChild(node);
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
});
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
plt.$orgLocNodes$.delete(hostElm["s-id"]);
|
|
799
|
+
hostRef.$hostElement$ = hostElm;
|
|
800
|
+
endHydrate();
|
|
801
|
+
};
|
|
802
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
803
|
+
let childNodeType;
|
|
804
|
+
let childIdSplt;
|
|
805
|
+
let childVNode;
|
|
806
|
+
let i2;
|
|
807
|
+
const scopeId2 = hostElm["s-sc"];
|
|
808
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
809
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
810
|
+
if (childNodeType) {
|
|
811
|
+
childIdSplt = childNodeType.split(".");
|
|
812
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
813
|
+
childVNode = createSimpleVNode({
|
|
814
|
+
$flags$: 0,
|
|
815
|
+
$hostId$: childIdSplt[0],
|
|
816
|
+
$nodeId$: childIdSplt[1],
|
|
817
|
+
$depth$: childIdSplt[2],
|
|
818
|
+
$index$: childIdSplt[3],
|
|
819
|
+
$tag$: node.tagName.toLowerCase(),
|
|
820
|
+
$elm$: node,
|
|
821
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
822
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
823
|
+
$attrs$: { class: node.className || "" }
|
|
824
|
+
});
|
|
825
|
+
childRenderNodes.push(childVNode);
|
|
826
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
827
|
+
if (!parentVNode.$children$) {
|
|
828
|
+
parentVNode.$children$ = [];
|
|
829
|
+
}
|
|
830
|
+
if (scopeId2) {
|
|
831
|
+
node["s-si"] = scopeId2;
|
|
832
|
+
childVNode.$attrs$.class += " " + scopeId2;
|
|
833
|
+
}
|
|
834
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
835
|
+
if (typeof slotName === "string") {
|
|
836
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
837
|
+
addSlot(
|
|
838
|
+
slotName,
|
|
839
|
+
childIdSplt[2],
|
|
840
|
+
childVNode,
|
|
841
|
+
node,
|
|
842
|
+
parentVNode,
|
|
843
|
+
childRenderNodes,
|
|
844
|
+
slotNodes,
|
|
845
|
+
shadowRootNodes,
|
|
846
|
+
slottedNodes
|
|
847
|
+
);
|
|
848
|
+
if (scopeId2) {
|
|
849
|
+
node.classList.add(scopeId2);
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
853
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
854
|
+
}
|
|
855
|
+
if (childVNode.$index$ !== void 0) {
|
|
856
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
857
|
+
}
|
|
858
|
+
parentVNode = childVNode;
|
|
859
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
860
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
if (node.shadowRoot) {
|
|
865
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
866
|
+
clientHydrate(
|
|
867
|
+
parentVNode,
|
|
868
|
+
childRenderNodes,
|
|
869
|
+
slotNodes,
|
|
870
|
+
shadowRootNodes,
|
|
871
|
+
hostElm,
|
|
872
|
+
node.shadowRoot.childNodes[i2],
|
|
873
|
+
hostId,
|
|
874
|
+
slottedNodes
|
|
875
|
+
);
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
879
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
880
|
+
clientHydrate(
|
|
881
|
+
parentVNode,
|
|
882
|
+
childRenderNodes,
|
|
883
|
+
slotNodes,
|
|
884
|
+
shadowRootNodes,
|
|
885
|
+
hostElm,
|
|
886
|
+
nonShadowNodes[i2],
|
|
887
|
+
hostId,
|
|
888
|
+
slottedNodes
|
|
889
|
+
);
|
|
890
|
+
}
|
|
891
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
892
|
+
childIdSplt = node.nodeValue.split(".");
|
|
893
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
894
|
+
childNodeType = childIdSplt[0];
|
|
895
|
+
childVNode = createSimpleVNode({
|
|
896
|
+
$hostId$: childIdSplt[1],
|
|
897
|
+
$nodeId$: childIdSplt[2],
|
|
898
|
+
$depth$: childIdSplt[3],
|
|
899
|
+
$index$: childIdSplt[4] || "0",
|
|
900
|
+
$elm$: node,
|
|
901
|
+
$attrs$: null,
|
|
902
|
+
$children$: null,
|
|
903
|
+
$key$: null,
|
|
904
|
+
$name$: null,
|
|
905
|
+
$tag$: null,
|
|
906
|
+
$text$: null
|
|
907
|
+
});
|
|
908
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
909
|
+
childVNode.$elm$ = findCorrespondingNode(node, 3 /* TextNode */);
|
|
910
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
911
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
912
|
+
childRenderNodes.push(childVNode);
|
|
913
|
+
node.remove();
|
|
914
|
+
if (hostId === childVNode.$hostId$) {
|
|
915
|
+
if (!parentVNode.$children$) {
|
|
916
|
+
parentVNode.$children$ = [];
|
|
917
|
+
}
|
|
918
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
919
|
+
}
|
|
920
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
921
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
925
|
+
childVNode.$elm$ = findCorrespondingNode(node, 8 /* CommentNode */);
|
|
926
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
927
|
+
childRenderNodes.push(childVNode);
|
|
928
|
+
node.remove();
|
|
929
|
+
}
|
|
930
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
931
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
932
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
933
|
+
addSlot(
|
|
934
|
+
slotName,
|
|
935
|
+
childIdSplt[2],
|
|
936
|
+
childVNode,
|
|
937
|
+
node,
|
|
938
|
+
parentVNode,
|
|
939
|
+
childRenderNodes,
|
|
940
|
+
slotNodes,
|
|
941
|
+
shadowRootNodes,
|
|
942
|
+
slottedNodes
|
|
943
|
+
);
|
|
944
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
945
|
+
if (shadowRootNodes) {
|
|
946
|
+
node.remove();
|
|
947
|
+
} else {
|
|
948
|
+
hostElm["s-cr"] = node;
|
|
949
|
+
node["s-cn"] = true;
|
|
950
|
+
}
|
|
951
|
+
}
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
955
|
+
const vnode = newVNode(null, node.textContent);
|
|
956
|
+
vnode.$elm$ = node;
|
|
957
|
+
vnode.$index$ = "0";
|
|
958
|
+
parentVNode.$children$ = [vnode];
|
|
959
|
+
} else {
|
|
960
|
+
if (node.nodeType === 3 /* TextNode */ && !node.wholeText.trim()) {
|
|
961
|
+
node.remove();
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
return parentVNode;
|
|
965
|
+
};
|
|
966
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
967
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
968
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
969
|
+
if (componentId) {
|
|
970
|
+
orgLocNodes.set(componentId, node);
|
|
971
|
+
}
|
|
972
|
+
let i2 = 0;
|
|
973
|
+
if (node.shadowRoot) {
|
|
974
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
975
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
976
|
+
}
|
|
977
|
+
}
|
|
978
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
979
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
980
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
981
|
+
}
|
|
982
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
983
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
984
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
985
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
986
|
+
node.nodeValue = "";
|
|
987
|
+
node["s-en"] = childIdSplt[3];
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
};
|
|
991
|
+
var createSimpleVNode = (vnode) => {
|
|
992
|
+
const defaultVNode = {
|
|
993
|
+
$flags$: 0,
|
|
994
|
+
$hostId$: null,
|
|
995
|
+
$nodeId$: null,
|
|
996
|
+
$depth$: null,
|
|
997
|
+
$index$: "0",
|
|
998
|
+
$elm$: null,
|
|
999
|
+
$attrs$: null,
|
|
1000
|
+
$children$: null,
|
|
1001
|
+
$key$: null,
|
|
1002
|
+
$name$: null,
|
|
1003
|
+
$tag$: null,
|
|
1004
|
+
$text$: null
|
|
1005
|
+
};
|
|
1006
|
+
return { ...defaultVNode, ...vnode };
|
|
1007
|
+
};
|
|
1008
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1009
|
+
node["s-sr"] = true;
|
|
1010
|
+
childVNode.$name$ = slotName || null;
|
|
1011
|
+
childVNode.$tag$ = "slot";
|
|
1012
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1013
|
+
if (shadowRootNodes && win.document) {
|
|
1014
|
+
const slot = childVNode.$elm$ = win.document.createElement(childVNode.$tag$);
|
|
1015
|
+
if (childVNode.$name$) {
|
|
1016
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
1017
|
+
}
|
|
1018
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
1019
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1020
|
+
} else {
|
|
1021
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
1022
|
+
}
|
|
1023
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
1024
|
+
node.remove();
|
|
1025
|
+
if (childVNode.$depth$ === "0") {
|
|
1026
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1027
|
+
}
|
|
1028
|
+
} else {
|
|
1029
|
+
const slot = childVNode.$elm$;
|
|
1030
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1031
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1032
|
+
patchSlotNode(node);
|
|
1033
|
+
if (shouldMove) {
|
|
1034
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1035
|
+
}
|
|
1036
|
+
childRenderNodes.push(childVNode);
|
|
1037
|
+
}
|
|
1038
|
+
slotNodes.push(childVNode);
|
|
1039
|
+
if (!parentVNode.$children$) {
|
|
1040
|
+
parentVNode.$children$ = [];
|
|
1041
|
+
}
|
|
1042
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1043
|
+
}
|
|
1044
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1045
|
+
let slottedNode = slotNode.nextSibling;
|
|
1046
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1047
|
+
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 */))) {
|
|
1048
|
+
slottedNode["s-sn"] = slotName;
|
|
1049
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1050
|
+
slottedNode = slottedNode.nextSibling;
|
|
1051
|
+
}
|
|
1052
|
+
};
|
|
1053
|
+
var findCorrespondingNode = (node, type) => {
|
|
1054
|
+
let sibling = node;
|
|
1055
|
+
do {
|
|
1056
|
+
sibling = sibling.nextSibling;
|
|
1057
|
+
} while (sibling && (sibling.nodeType !== type || !sibling.nodeValue));
|
|
1058
|
+
return sibling;
|
|
1059
|
+
};
|
|
1060
|
+
var createSupportsRuleRe = (selector) => {
|
|
1061
|
+
const safeSelector2 = escapeRegExpSpecialCharacters(selector);
|
|
1062
|
+
return new RegExp(
|
|
1063
|
+
// First capture group: match any context before the selector that's not inside @supports selector()
|
|
1064
|
+
// Using negative lookahead to avoid matching inside @supports selector(...) condition
|
|
1065
|
+
`(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
|
|
1066
|
+
"g"
|
|
1067
|
+
);
|
|
1068
|
+
};
|
|
1069
|
+
createSupportsRuleRe("::slotted");
|
|
1070
|
+
createSupportsRuleRe(":host");
|
|
1071
|
+
createSupportsRuleRe(":host-context");
|
|
482
1072
|
var parsePropertyValue = (propValue, propType) => {
|
|
1073
|
+
if (typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
1074
|
+
try {
|
|
1075
|
+
propValue = JSON.parse(propValue);
|
|
1076
|
+
return propValue;
|
|
1077
|
+
} catch (e) {
|
|
1078
|
+
}
|
|
1079
|
+
}
|
|
1080
|
+
if (typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1081
|
+
propValue = deserializeProperty(propValue);
|
|
1082
|
+
return propValue;
|
|
1083
|
+
}
|
|
483
1084
|
if (propValue != null && !isComplexType(propValue)) {
|
|
484
1085
|
if (propType & 4 /* Boolean */) {
|
|
485
1086
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
486
1087
|
}
|
|
487
1088
|
if (propType & 2 /* Number */) {
|
|
488
|
-
return parseFloat(propValue);
|
|
1089
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
489
1090
|
}
|
|
490
1091
|
if (propType & 1 /* String */) {
|
|
491
1092
|
return String(propValue);
|
|
@@ -502,9 +1103,9 @@ var createEvent = (ref, name, flags) => {
|
|
|
502
1103
|
return {
|
|
503
1104
|
emit: (detail) => {
|
|
504
1105
|
return emitEvent(elm, name, {
|
|
505
|
-
bubbles:
|
|
506
|
-
composed:
|
|
507
|
-
cancelable:
|
|
1106
|
+
bubbles: true,
|
|
1107
|
+
composed: true,
|
|
1108
|
+
cancelable: true,
|
|
508
1109
|
detail
|
|
509
1110
|
});
|
|
510
1111
|
}
|
|
@@ -547,7 +1148,9 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
|
547
1148
|
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
548
1149
|
}
|
|
549
1150
|
if (!appliedStyles.has(scopeId2)) {
|
|
550
|
-
{
|
|
1151
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
1152
|
+
styleElm.innerHTML = style;
|
|
1153
|
+
} else {
|
|
551
1154
|
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || win.document.createElement("style");
|
|
552
1155
|
styleElm.innerHTML = style;
|
|
553
1156
|
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
@@ -604,13 +1207,24 @@ var attachStyles = (hostRef) => {
|
|
|
604
1207
|
const scopeId2 = addStyle(
|
|
605
1208
|
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
606
1209
|
cmpMeta);
|
|
607
|
-
if (
|
|
1210
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
608
1211
|
elm["s-sc"] = scopeId2;
|
|
609
1212
|
elm.classList.add(scopeId2 + "-h");
|
|
610
1213
|
}
|
|
611
1214
|
endAttachStyles();
|
|
612
1215
|
};
|
|
613
1216
|
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
1217
|
+
var convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, "$1{");
|
|
1218
|
+
var hydrateScopedToShadow = () => {
|
|
1219
|
+
if (!win.document) {
|
|
1220
|
+
return;
|
|
1221
|
+
}
|
|
1222
|
+
const styles2 = win.document.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
|
|
1223
|
+
let i2 = 0;
|
|
1224
|
+
for (; i2 < styles2.length; i2++) {
|
|
1225
|
+
registerStyle(styles2[i2].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles2[i2].innerHTML), true);
|
|
1226
|
+
}
|
|
1227
|
+
};
|
|
614
1228
|
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
615
1229
|
if (oldValue === newValue) {
|
|
616
1230
|
return;
|
|
@@ -621,7 +1235,14 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
|
|
|
621
1235
|
const classList = elm.classList;
|
|
622
1236
|
const oldClasses = parseClassList(oldValue);
|
|
623
1237
|
let newClasses = parseClassList(newValue);
|
|
624
|
-
{
|
|
1238
|
+
if (elm["s-si"] && initialRender) {
|
|
1239
|
+
newClasses.push(elm["s-si"]);
|
|
1240
|
+
oldClasses.forEach((c) => {
|
|
1241
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1242
|
+
});
|
|
1243
|
+
newClasses = [...new Set(newClasses)];
|
|
1244
|
+
classList.add(...newClasses);
|
|
1245
|
+
} else {
|
|
625
1246
|
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
626
1247
|
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
627
1248
|
}
|
|
@@ -741,7 +1362,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
741
1362
|
oldVnodeAttrs[memberName],
|
|
742
1363
|
void 0,
|
|
743
1364
|
isSvgMode2,
|
|
744
|
-
newVnode.$flags
|
|
1365
|
+
newVnode.$flags$,
|
|
1366
|
+
isInitialRender
|
|
1367
|
+
);
|
|
745
1368
|
}
|
|
746
1369
|
}
|
|
747
1370
|
}
|
|
@@ -752,7 +1375,9 @@ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
|
752
1375
|
oldVnodeAttrs[memberName],
|
|
753
1376
|
newVnodeAttrs[memberName],
|
|
754
1377
|
isSvgMode2,
|
|
755
|
-
newVnode.$flags
|
|
1378
|
+
newVnode.$flags$,
|
|
1379
|
+
isInitialRender
|
|
1380
|
+
);
|
|
756
1381
|
}
|
|
757
1382
|
};
|
|
758
1383
|
function sortedAttrNames(attrNames) {
|
|
@@ -803,14 +1428,21 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
803
1428
|
updateElement(null, newVNode2, isSvgMode);
|
|
804
1429
|
}
|
|
805
1430
|
} else {
|
|
1431
|
+
if (!isSvgMode) {
|
|
1432
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1433
|
+
}
|
|
806
1434
|
if (!win.document) {
|
|
807
1435
|
throw new Error(
|
|
808
1436
|
"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."
|
|
809
1437
|
);
|
|
810
1438
|
}
|
|
811
|
-
elm = newVNode2.$elm$ = win.document.
|
|
1439
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
1440
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
812
1441
|
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
813
|
-
);
|
|
1442
|
+
) ;
|
|
1443
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1444
|
+
isSvgMode = false;
|
|
1445
|
+
}
|
|
814
1446
|
{
|
|
815
1447
|
updateElement(null, newVNode2, isSvgMode);
|
|
816
1448
|
}
|
|
@@ -825,6 +1457,13 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
825
1457
|
}
|
|
826
1458
|
}
|
|
827
1459
|
}
|
|
1460
|
+
{
|
|
1461
|
+
if (newVNode2.$tag$ === "svg") {
|
|
1462
|
+
isSvgMode = false;
|
|
1463
|
+
} else if (elm.tagName === "foreignObject") {
|
|
1464
|
+
isSvgMode = true;
|
|
1465
|
+
}
|
|
1466
|
+
}
|
|
828
1467
|
}
|
|
829
1468
|
elm["s-hn"] = hostTagName;
|
|
830
1469
|
{
|
|
@@ -850,14 +1489,6 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
|
850
1489
|
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
851
1490
|
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
852
1491
|
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
853
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
854
|
-
let node = parentElm;
|
|
855
|
-
while (node = node.nextSibling) {
|
|
856
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
857
|
-
oldSlotChildNodes.push(node);
|
|
858
|
-
}
|
|
859
|
-
}
|
|
860
|
-
}
|
|
861
1492
|
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
862
1493
|
const childNode = oldSlotChildNodes[i2];
|
|
863
1494
|
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
@@ -871,7 +1502,7 @@ var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
|
871
1502
|
putBackInOriginalLocation(childNode, recursive);
|
|
872
1503
|
}
|
|
873
1504
|
}
|
|
874
|
-
plt.$flags$ &=
|
|
1505
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
875
1506
|
};
|
|
876
1507
|
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
877
1508
|
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
@@ -1023,11 +1654,15 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1023
1654
|
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1024
1655
|
const oldChildren = oldVNode.$children$;
|
|
1025
1656
|
const newChildren = newVNode2.$children$;
|
|
1657
|
+
const tag = newVNode2.$tag$;
|
|
1026
1658
|
const text = newVNode2.$text$;
|
|
1027
1659
|
let defaultHolder;
|
|
1028
1660
|
if (text === null) {
|
|
1029
1661
|
{
|
|
1030
|
-
|
|
1662
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1663
|
+
}
|
|
1664
|
+
{
|
|
1665
|
+
updateElement(oldVNode, newVNode2, isSvgMode, isInitialRender);
|
|
1031
1666
|
}
|
|
1032
1667
|
if (oldChildren !== null && newChildren !== null) {
|
|
1033
1668
|
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
@@ -1042,6 +1677,9 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
|
1042
1677
|
) {
|
|
1043
1678
|
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1044
1679
|
}
|
|
1680
|
+
if (isSvgMode && tag === "svg") {
|
|
1681
|
+
isSvgMode = false;
|
|
1682
|
+
}
|
|
1045
1683
|
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1046
1684
|
defaultHolder.parentNode.textContent = text;
|
|
1047
1685
|
} else if (oldVNode.$text$ !== text) {
|
|
@@ -1060,7 +1698,7 @@ var markSlotContentForRelocation = (elm) => {
|
|
|
1060
1698
|
const slotName = childNode["s-sn"];
|
|
1061
1699
|
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1062
1700
|
node = hostContentNodes[j];
|
|
1063
|
-
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (
|
|
1701
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (true)) {
|
|
1064
1702
|
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1065
1703
|
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1066
1704
|
checkSlotFallbackVisibility = true;
|
|
@@ -1138,7 +1776,8 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1138
1776
|
const hostElm = hostRef.$hostElement$;
|
|
1139
1777
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
1140
1778
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1141
|
-
const
|
|
1779
|
+
const isHostElement = isHost(renderFnResults);
|
|
1780
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
1142
1781
|
hostTagName = hostElm.tagName;
|
|
1143
1782
|
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1144
1783
|
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
@@ -1222,7 +1861,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
1222
1861
|
if (checkSlotFallbackVisibility) {
|
|
1223
1862
|
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1224
1863
|
}
|
|
1225
|
-
plt.$flags$ &=
|
|
1864
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
1226
1865
|
relocateNodes.length = 0;
|
|
1227
1866
|
}
|
|
1228
1867
|
contentRef = void 0;
|
|
@@ -1320,7 +1959,7 @@ var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
|
1320
1959
|
renderingRef = instance;
|
|
1321
1960
|
instance = instance.render() ;
|
|
1322
1961
|
{
|
|
1323
|
-
hostRef.$flags$ &=
|
|
1962
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1324
1963
|
}
|
|
1325
1964
|
{
|
|
1326
1965
|
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
@@ -1374,7 +2013,7 @@ var postUpdateComponent = (hostRef) => {
|
|
|
1374
2013
|
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1375
2014
|
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1376
2015
|
}
|
|
1377
|
-
hostRef.$flags$ &=
|
|
2016
|
+
hostRef.$flags$ &= -517;
|
|
1378
2017
|
}
|
|
1379
2018
|
};
|
|
1380
2019
|
var forceUpdate = (ref) => {
|
|
@@ -1637,7 +2276,7 @@ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
|
1637
2276
|
consoleError(e, elm);
|
|
1638
2277
|
}
|
|
1639
2278
|
{
|
|
1640
|
-
hostRef.$flags$ &=
|
|
2279
|
+
hostRef.$flags$ &= -9 /* isConstructingInstance */;
|
|
1641
2280
|
}
|
|
1642
2281
|
{
|
|
1643
2282
|
hostRef.$flags$ |= 128 /* isWatchReady */;
|
|
@@ -1684,7 +2323,21 @@ var connectedCallback = (elm) => {
|
|
|
1684
2323
|
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1685
2324
|
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1686
2325
|
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
2326
|
+
let hostId;
|
|
1687
2327
|
{
|
|
2328
|
+
hostId = elm.getAttribute(HYDRATE_ID);
|
|
2329
|
+
if (hostId) {
|
|
2330
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
2331
|
+
const scopeId2 = addStyle(elm.shadowRoot, cmpMeta);
|
|
2332
|
+
elm.classList.remove(scopeId2 + "-h", scopeId2 + "-s");
|
|
2333
|
+
} else if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
2334
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
2335
|
+
elm["s-sc"] = scopeId2;
|
|
2336
|
+
}
|
|
2337
|
+
initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
|
|
2338
|
+
}
|
|
2339
|
+
}
|
|
2340
|
+
if (!hostId) {
|
|
1688
2341
|
if (// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
|
|
1689
2342
|
cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */)) {
|
|
1690
2343
|
setContentReference(elm);
|
|
@@ -1693,7 +2346,7 @@ var connectedCallback = (elm) => {
|
|
|
1693
2346
|
{
|
|
1694
2347
|
let ancestorComponent = elm;
|
|
1695
2348
|
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1696
|
-
if (ancestorComponent["s-p"]) {
|
|
2349
|
+
if (ancestorComponent.nodeType === 1 /* ElementNode */ && ancestorComponent.hasAttribute("s-id") && ancestorComponent["s-p"] || ancestorComponent["s-p"]) {
|
|
1697
2350
|
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1698
2351
|
break;
|
|
1699
2352
|
}
|
|
@@ -1779,6 +2432,12 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
|
|
|
1779
2432
|
let isBootstrapping = true;
|
|
1780
2433
|
Object.assign(plt, options);
|
|
1781
2434
|
plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
|
|
2435
|
+
{
|
|
2436
|
+
plt.$flags$ |= 2 /* appLoaded */;
|
|
2437
|
+
}
|
|
2438
|
+
{
|
|
2439
|
+
hydrateScopedToShadow();
|
|
2440
|
+
}
|
|
1782
2441
|
let hasSlotRelocation = false;
|
|
1783
2442
|
lazyBundles.map((lazyBundle) => {
|
|
1784
2443
|
lazyBundle[1].map((compactMeta) => {
|
|
@@ -1904,7 +2563,7 @@ var Fragment = (_, children) => children;
|
|
|
1904
2563
|
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1905
2564
|
if (listeners && win.document) {
|
|
1906
2565
|
listeners.map(([flags, name, method]) => {
|
|
1907
|
-
const target = elm;
|
|
2566
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1908
2567
|
const handler = hostListenerProxy(hostRef, method);
|
|
1909
2568
|
const opts = hostListenerOpts(flags);
|
|
1910
2569
|
plt.ael(target, name, handler, opts);
|
|
@@ -1926,6 +2585,12 @@ var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
|
1926
2585
|
consoleError(e, hostRef.$hostElement$);
|
|
1927
2586
|
}
|
|
1928
2587
|
};
|
|
2588
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
2589
|
+
if (flags & 4 /* TargetDocument */) {
|
|
2590
|
+
return doc;
|
|
2591
|
+
}
|
|
2592
|
+
return elm;
|
|
2593
|
+
};
|
|
1929
2594
|
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1930
2595
|
passive: (flags & 1 /* Passive */) !== 0,
|
|
1931
2596
|
capture: (flags & 2 /* Capture */) !== 0
|
|
@@ -1934,4 +2599,4 @@ var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
|
1934
2599
|
// src/runtime/nonce.ts
|
|
1935
2600
|
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1936
2601
|
|
|
1937
|
-
export { Fragment as F,
|
|
2602
|
+
export { Fragment as F, Host as H, getRenderingRef as a, bootstrapLazy as b, createEvent as c, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|