@stencil/core 4.28.2-dev.1742453865.0e5a479 → 4.28.2-dev.1742533303.37ac3fc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli/index.cjs +1 -1
- package/cli/index.js +1 -1
- package/cli/package.json +1 -1
- package/compiler/package.json +1 -1
- package/compiler/stencil.js +7 -10
- package/dev-server/client/index.js +1 -1
- package/dev-server/client/package.json +1 -1
- package/dev-server/connector.html +2 -2
- package/dev-server/index.js +1 -1
- package/dev-server/package.json +1 -1
- package/dev-server/server-process.js +2 -2
- package/internal/app-data/package.json +1 -1
- package/internal/client/index.js +3 -156
- package/internal/client/package.json +1 -1
- package/internal/client/patch-browser.js +1 -1
- package/internal/hydrate/index.js +14 -161
- package/internal/hydrate/package.json +1 -1
- package/internal/hydrate/runner.d.ts +0 -12
- package/internal/hydrate/runner.js +1 -365
- package/internal/package.json +1 -1
- package/internal/testing/index.js +2 -155
- package/internal/testing/package.json +1 -1
- package/mock-doc/index.cjs +1 -1
- package/mock-doc/index.js +1 -1
- package/mock-doc/package.json +1 -1
- package/package.json +1 -1
- package/screenshot/index.js +1 -1
- package/screenshot/package.json +1 -1
- package/screenshot/pixel-match.js +1 -1
- package/sys/node/index.js +38 -38
- package/sys/node/package.json +1 -1
- package/sys/node/worker.js +1 -1
- package/testing/index.js +2 -3
- package/testing/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Platform v4.28.2-dev.
|
|
2
|
+
Stencil Hydrate Platform v4.28.2-dev.1742533303.37ac3fc | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -16,30 +16,6 @@ import { BUILD } from "@stencil/core/internal/app-data";
|
|
|
16
16
|
// src/utils/constants.ts
|
|
17
17
|
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
18
18
|
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
19
|
-
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
20
|
-
PrimitiveType2["Undefined"] = "undefined";
|
|
21
|
-
PrimitiveType2["Null"] = "null";
|
|
22
|
-
PrimitiveType2["String"] = "string";
|
|
23
|
-
PrimitiveType2["Number"] = "number";
|
|
24
|
-
PrimitiveType2["SpecialNumber"] = "number";
|
|
25
|
-
PrimitiveType2["Boolean"] = "boolean";
|
|
26
|
-
PrimitiveType2["BigInt"] = "bigint";
|
|
27
|
-
return PrimitiveType2;
|
|
28
|
-
})(PrimitiveType || {});
|
|
29
|
-
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
30
|
-
NonPrimitiveType2["Array"] = "array";
|
|
31
|
-
NonPrimitiveType2["Date"] = "date";
|
|
32
|
-
NonPrimitiveType2["Map"] = "map";
|
|
33
|
-
NonPrimitiveType2["Object"] = "object";
|
|
34
|
-
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
35
|
-
NonPrimitiveType2["Set"] = "set";
|
|
36
|
-
NonPrimitiveType2["Channel"] = "channel";
|
|
37
|
-
NonPrimitiveType2["Symbol"] = "symbol";
|
|
38
|
-
return NonPrimitiveType2;
|
|
39
|
-
})(NonPrimitiveType || {});
|
|
40
|
-
var TYPE_CONSTANT = "type";
|
|
41
|
-
var VALUE_CONSTANT = "value";
|
|
42
|
-
var SERIALIZED_PREFIX = "serialized:";
|
|
43
19
|
|
|
44
20
|
// src/utils/es2022-rewire-class-members.ts
|
|
45
21
|
var reWireGetterSetter = (instance, hostRef) => {
|
|
@@ -93,101 +69,6 @@ var escapeRegExpSpecialCharacters = (text) => {
|
|
|
93
69
|
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
94
70
|
};
|
|
95
71
|
|
|
96
|
-
// src/utils/remote-value.ts
|
|
97
|
-
var RemoteValue = class _RemoteValue {
|
|
98
|
-
/**
|
|
99
|
-
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
100
|
-
*
|
|
101
|
-
* @param serialized The serialized LocalValue object
|
|
102
|
-
* @returns The original JavaScript value/object
|
|
103
|
-
*/
|
|
104
|
-
static fromLocalValue(serialized) {
|
|
105
|
-
const type = serialized[TYPE_CONSTANT];
|
|
106
|
-
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
107
|
-
switch (type) {
|
|
108
|
-
case "string" /* String */:
|
|
109
|
-
return value;
|
|
110
|
-
case "boolean" /* Boolean */:
|
|
111
|
-
return value;
|
|
112
|
-
case "bigint" /* BigInt */:
|
|
113
|
-
return BigInt(value);
|
|
114
|
-
case "undefined" /* Undefined */:
|
|
115
|
-
return void 0;
|
|
116
|
-
case "null" /* Null */:
|
|
117
|
-
return null;
|
|
118
|
-
case "number" /* Number */:
|
|
119
|
-
if (value === "NaN") return NaN;
|
|
120
|
-
if (value === "-0") return -0;
|
|
121
|
-
if (value === "Infinity") return Infinity;
|
|
122
|
-
if (value === "-Infinity") return -Infinity;
|
|
123
|
-
return value;
|
|
124
|
-
case "array" /* Array */:
|
|
125
|
-
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
126
|
-
case "date" /* Date */:
|
|
127
|
-
return new Date(value);
|
|
128
|
-
case "map" /* Map */:
|
|
129
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
130
|
-
for (const [key, val] of value) {
|
|
131
|
-
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
132
|
-
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
133
|
-
map2.set(deserializedKey, deserializedValue);
|
|
134
|
-
}
|
|
135
|
-
return map2;
|
|
136
|
-
case "object" /* Object */:
|
|
137
|
-
const obj = {};
|
|
138
|
-
for (const [key, val] of value) {
|
|
139
|
-
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
140
|
-
}
|
|
141
|
-
return obj;
|
|
142
|
-
case "regexp" /* RegularExpression */:
|
|
143
|
-
const { pattern, flags } = value;
|
|
144
|
-
return new RegExp(pattern, flags);
|
|
145
|
-
case "set" /* Set */:
|
|
146
|
-
const set = /* @__PURE__ */ new Set();
|
|
147
|
-
for (const item of value) {
|
|
148
|
-
set.add(_RemoteValue.fromLocalValue(item));
|
|
149
|
-
}
|
|
150
|
-
return set;
|
|
151
|
-
case "symbol" /* Symbol */:
|
|
152
|
-
return Symbol(value);
|
|
153
|
-
default:
|
|
154
|
-
throw new Error(`Unsupported type: ${type}`);
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
159
|
-
*
|
|
160
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
161
|
-
* @returns Array of deserialized JavaScript values
|
|
162
|
-
*/
|
|
163
|
-
static fromLocalValueArray(serializedValues) {
|
|
164
|
-
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
165
|
-
}
|
|
166
|
-
/**
|
|
167
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
168
|
-
*
|
|
169
|
-
* @param obj Object to verify
|
|
170
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
171
|
-
*/
|
|
172
|
-
static isLocalValueObject(obj) {
|
|
173
|
-
if (typeof obj !== "object" || obj === null) {
|
|
174
|
-
return false;
|
|
175
|
-
}
|
|
176
|
-
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
177
|
-
return false;
|
|
178
|
-
}
|
|
179
|
-
const type = obj[TYPE_CONSTANT];
|
|
180
|
-
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
181
|
-
if (!hasTypeProperty) {
|
|
182
|
-
return false;
|
|
183
|
-
}
|
|
184
|
-
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
185
|
-
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
186
|
-
}
|
|
187
|
-
return true;
|
|
188
|
-
}
|
|
189
|
-
};
|
|
190
|
-
|
|
191
72
|
// src/utils/result.ts
|
|
192
73
|
var result_exports = {};
|
|
193
74
|
__export(result_exports, {
|
|
@@ -237,14 +118,6 @@ var unwrapErr = (result) => {
|
|
|
237
118
|
}
|
|
238
119
|
};
|
|
239
120
|
|
|
240
|
-
// src/utils/serialize.ts
|
|
241
|
-
function deserializeProperty(value) {
|
|
242
|
-
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
243
|
-
return value;
|
|
244
|
-
}
|
|
245
|
-
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
246
|
-
}
|
|
247
|
-
|
|
248
121
|
// src/utils/util.ts
|
|
249
122
|
var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
|
|
250
123
|
var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
|
|
@@ -1039,7 +912,6 @@ var validateInputProperties = (inputElm) => {
|
|
|
1039
912
|
|
|
1040
913
|
// src/runtime/client-hydrate.ts
|
|
1041
914
|
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
1042
|
-
var _a;
|
|
1043
915
|
const endHydrate = createTime("hydrateClient", tagName);
|
|
1044
916
|
const shadowRoot = hostElm.shadowRoot;
|
|
1045
917
|
const childRenderNodes = [];
|
|
@@ -1048,19 +920,6 @@ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
|
1048
920
|
const shadowRootNodes = BUILD6.shadowDom && shadowRoot ? [] : null;
|
|
1049
921
|
const vnode = newVNode(tagName, null);
|
|
1050
922
|
vnode.$elm$ = hostElm;
|
|
1051
|
-
const members = Object.entries(((_a = hostRef.$cmpMeta$) == null ? void 0 : _a.$members$) || {});
|
|
1052
|
-
members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
|
|
1053
|
-
var _a2;
|
|
1054
|
-
if (!(memberFlags & 31 /* Prop */)) {
|
|
1055
|
-
return;
|
|
1056
|
-
}
|
|
1057
|
-
const attributeName = metaAttributeName || memberName;
|
|
1058
|
-
const attrVal = hostElm.getAttribute(attributeName);
|
|
1059
|
-
if (attrVal !== null) {
|
|
1060
|
-
const attrPropVal = parsePropertyValue(attrVal, memberFlags);
|
|
1061
|
-
(_a2 = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a2.set(memberName, attrPropVal);
|
|
1062
|
-
}
|
|
1063
|
-
});
|
|
1064
923
|
let scopeId2;
|
|
1065
924
|
if (BUILD6.scoped) {
|
|
1066
925
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
@@ -1813,23 +1672,12 @@ import { BUILD as BUILD15 } from "@stencil/core/internal/app-data";
|
|
|
1813
1672
|
// src/runtime/parse-property-value.ts
|
|
1814
1673
|
import { BUILD as BUILD7 } from "@stencil/core/internal/app-data";
|
|
1815
1674
|
var parsePropertyValue = (propValue, propType) => {
|
|
1816
|
-
if ((BUILD7.hydrateClientSide || BUILD7.hydrateServerSide) && typeof propValue === "string" && (propValue.startsWith("{") && propValue.endsWith("}") || propValue.startsWith("[") && propValue.endsWith("]"))) {
|
|
1817
|
-
try {
|
|
1818
|
-
propValue = JSON.parse(propValue);
|
|
1819
|
-
return propValue;
|
|
1820
|
-
} catch (e) {
|
|
1821
|
-
}
|
|
1822
|
-
}
|
|
1823
|
-
if ((BUILD7.hydrateClientSide || BUILD7.hydrateServerSide) && typeof propValue === "string" && propValue.startsWith(SERIALIZED_PREFIX)) {
|
|
1824
|
-
propValue = deserializeProperty(propValue);
|
|
1825
|
-
return propValue;
|
|
1826
|
-
}
|
|
1827
1675
|
if (propValue != null && !isComplexType(propValue)) {
|
|
1828
1676
|
if (BUILD7.propBoolean && propType & 4 /* Boolean */) {
|
|
1829
1677
|
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
1830
1678
|
}
|
|
1831
1679
|
if (BUILD7.propNumber && propType & 2 /* Number */) {
|
|
1832
|
-
return
|
|
1680
|
+
return parseFloat(propValue);
|
|
1833
1681
|
}
|
|
1834
1682
|
if (BUILD7.propString && propType & 1 /* String */) {
|
|
1835
1683
|
return String(propValue);
|
|
@@ -2604,8 +2452,7 @@ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
|
2604
2452
|
const hostElm = hostRef.$hostElement$;
|
|
2605
2453
|
const cmpMeta = hostRef.$cmpMeta$;
|
|
2606
2454
|
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
2607
|
-
const
|
|
2608
|
-
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
2455
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
2609
2456
|
hostTagName = hostElm.tagName;
|
|
2610
2457
|
if (BUILD13.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
|
|
2611
2458
|
throw new Error(`The <Host> must be the single root component.
|
|
@@ -4031,15 +3878,21 @@ function proxyHostElement(elm, cstr) {
|
|
|
4031
3878
|
var _a;
|
|
4032
3879
|
if (memberFlags & 31 /* Prop */) {
|
|
4033
3880
|
const attributeName = metaAttributeName || memberName;
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
3881
|
+
let attrValue = elm.getAttribute(attributeName);
|
|
3882
|
+
if ((attrValue == null ? void 0 : attrValue.startsWith("{")) && attrValue.endsWith("}") || (attrValue == null ? void 0 : attrValue.startsWith("[")) && attrValue.endsWith("]")) {
|
|
3883
|
+
try {
|
|
3884
|
+
attrValue = JSON.parse(attrValue);
|
|
3885
|
+
} catch (e) {
|
|
3886
|
+
}
|
|
3887
|
+
}
|
|
4037
3888
|
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(cstr.prototype, memberName) || {};
|
|
3889
|
+
let attrPropVal;
|
|
4038
3890
|
if (attrValue != null) {
|
|
4039
3891
|
attrPropVal = parsePropertyValue(attrValue, memberFlags);
|
|
4040
3892
|
}
|
|
4041
|
-
|
|
4042
|
-
|
|
3893
|
+
const ownValue = elm[memberName];
|
|
3894
|
+
if (ownValue !== void 0) {
|
|
3895
|
+
attrPropVal = ownValue;
|
|
4043
3896
|
delete elm[memberName];
|
|
4044
3897
|
}
|
|
4045
3898
|
if (attrPropVal !== void 0) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal/hydrate",
|
|
3
|
-
"version": "4.28.2-dev.
|
|
3
|
+
"version": "4.28.2-dev.1742533303.37ac3fc",
|
|
4
4
|
"description": "Stencil internal hydrate platform to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"private": true
|
|
@@ -3,18 +3,6 @@
|
|
|
3
3
|
import { Readable } from 'node:stream';
|
|
4
4
|
|
|
5
5
|
export declare function createWindowFromHtml(templateHtml: string, uniqueId: string): any;
|
|
6
|
-
/**
|
|
7
|
-
* Serialize a value to a string that can be deserialized later.
|
|
8
|
-
* @param {unknown} value - The value to serialize.
|
|
9
|
-
* @returns {string} A string that can be deserialized later.
|
|
10
|
-
*/
|
|
11
|
-
export declare function serializeProperty(value: unknown): string | number | boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Deserialize a value from a string that was serialized earlier.
|
|
14
|
-
* @param {string} value - The string to deserialize.
|
|
15
|
-
* @returns {unknown} The deserialized value.
|
|
16
|
-
*/
|
|
17
|
-
export declare function deserializeProperty(value: string): any;
|
|
18
6
|
export type ResolutionHandler = (elm: HTMLElement) => string | undefined | null;
|
|
19
7
|
export interface HydrateDocumentOptions {
|
|
20
8
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
Stencil Hydrate Runner v4.28.2-dev.
|
|
2
|
+
Stencil Hydrate Runner v4.28.2-dev.1742533303.37ac3fc | MIT Licensed | https://stenciljs.com
|
|
3
3
|
*/
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __export = (target, all) => {
|
|
@@ -14087,32 +14087,6 @@ import { BUILD as BUILD3 } from "@stencil/core/internal/app-data";
|
|
|
14087
14087
|
// src/utils/es2022-rewire-class-members.ts
|
|
14088
14088
|
import { BUILD as BUILD2 } from "@stencil/core/internal/app-data";
|
|
14089
14089
|
|
|
14090
|
-
// src/utils/constants.ts
|
|
14091
|
-
var PrimitiveType = /* @__PURE__ */ ((PrimitiveType2) => {
|
|
14092
|
-
PrimitiveType2["Undefined"] = "undefined";
|
|
14093
|
-
PrimitiveType2["Null"] = "null";
|
|
14094
|
-
PrimitiveType2["String"] = "string";
|
|
14095
|
-
PrimitiveType2["Number"] = "number";
|
|
14096
|
-
PrimitiveType2["SpecialNumber"] = "number";
|
|
14097
|
-
PrimitiveType2["Boolean"] = "boolean";
|
|
14098
|
-
PrimitiveType2["BigInt"] = "bigint";
|
|
14099
|
-
return PrimitiveType2;
|
|
14100
|
-
})(PrimitiveType || {});
|
|
14101
|
-
var NonPrimitiveType = /* @__PURE__ */ ((NonPrimitiveType2) => {
|
|
14102
|
-
NonPrimitiveType2["Array"] = "array";
|
|
14103
|
-
NonPrimitiveType2["Date"] = "date";
|
|
14104
|
-
NonPrimitiveType2["Map"] = "map";
|
|
14105
|
-
NonPrimitiveType2["Object"] = "object";
|
|
14106
|
-
NonPrimitiveType2["RegularExpression"] = "regexp";
|
|
14107
|
-
NonPrimitiveType2["Set"] = "set";
|
|
14108
|
-
NonPrimitiveType2["Channel"] = "channel";
|
|
14109
|
-
NonPrimitiveType2["Symbol"] = "symbol";
|
|
14110
|
-
return NonPrimitiveType2;
|
|
14111
|
-
})(NonPrimitiveType || {});
|
|
14112
|
-
var TYPE_CONSTANT = "type";
|
|
14113
|
-
var VALUE_CONSTANT = "value";
|
|
14114
|
-
var SERIALIZED_PREFIX = "serialized:";
|
|
14115
|
-
|
|
14116
14090
|
// src/client/client-load-module.ts
|
|
14117
14091
|
import { BUILD as BUILD5 } from "@stencil/core/internal/app-data";
|
|
14118
14092
|
|
|
@@ -14153,232 +14127,6 @@ import { BUILD as BUILD26 } from "@stencil/core/internal/app-data";
|
|
|
14153
14127
|
// src/utils/helpers.ts
|
|
14154
14128
|
var isString = (v) => typeof v === "string";
|
|
14155
14129
|
|
|
14156
|
-
// src/utils/local-value.ts
|
|
14157
|
-
var LocalValue = class _LocalValue {
|
|
14158
|
-
constructor(type, value) {
|
|
14159
|
-
if (type === "undefined" /* Undefined */ || type === "null" /* Null */) {
|
|
14160
|
-
this.type = type;
|
|
14161
|
-
} else {
|
|
14162
|
-
this.type = type;
|
|
14163
|
-
this.value = value;
|
|
14164
|
-
}
|
|
14165
|
-
}
|
|
14166
|
-
/**
|
|
14167
|
-
* Creates a new LocalValue object with a string value.
|
|
14168
|
-
*
|
|
14169
|
-
* @param {string} value - The string value to be stored in the LocalValue object.
|
|
14170
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14171
|
-
*/
|
|
14172
|
-
static createStringValue(value) {
|
|
14173
|
-
return new _LocalValue("string" /* String */, value);
|
|
14174
|
-
}
|
|
14175
|
-
/**
|
|
14176
|
-
* Creates a new LocalValue object with a number value.
|
|
14177
|
-
*
|
|
14178
|
-
* @param {number} value - The number value.
|
|
14179
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14180
|
-
*/
|
|
14181
|
-
static createNumberValue(value) {
|
|
14182
|
-
return new _LocalValue("number" /* Number */, value);
|
|
14183
|
-
}
|
|
14184
|
-
/**
|
|
14185
|
-
* Creates a new LocalValue object with a special number value.
|
|
14186
|
-
*
|
|
14187
|
-
* @param {number} value - The value of the special number.
|
|
14188
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14189
|
-
*/
|
|
14190
|
-
static createSpecialNumberValue(value) {
|
|
14191
|
-
if (Number.isNaN(value)) {
|
|
14192
|
-
return new _LocalValue("number" /* SpecialNumber */, "NaN");
|
|
14193
|
-
}
|
|
14194
|
-
if (Object.is(value, -0)) {
|
|
14195
|
-
return new _LocalValue("number" /* SpecialNumber */, "-0");
|
|
14196
|
-
}
|
|
14197
|
-
if (value === Infinity) {
|
|
14198
|
-
return new _LocalValue("number" /* SpecialNumber */, "Infinity");
|
|
14199
|
-
}
|
|
14200
|
-
if (value === -Infinity) {
|
|
14201
|
-
return new _LocalValue("number" /* SpecialNumber */, "-Infinity");
|
|
14202
|
-
}
|
|
14203
|
-
return new _LocalValue("number" /* SpecialNumber */, value);
|
|
14204
|
-
}
|
|
14205
|
-
/**
|
|
14206
|
-
* Creates a new LocalValue object with an undefined value.
|
|
14207
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14208
|
-
*/
|
|
14209
|
-
static createUndefinedValue() {
|
|
14210
|
-
return new _LocalValue("undefined" /* Undefined */);
|
|
14211
|
-
}
|
|
14212
|
-
/**
|
|
14213
|
-
* Creates a new LocalValue object with a null value.
|
|
14214
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14215
|
-
*/
|
|
14216
|
-
static createNullValue() {
|
|
14217
|
-
return new _LocalValue("null" /* Null */);
|
|
14218
|
-
}
|
|
14219
|
-
/**
|
|
14220
|
-
* Creates a new LocalValue object with a boolean value.
|
|
14221
|
-
*
|
|
14222
|
-
* @param {boolean} value - The boolean value.
|
|
14223
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14224
|
-
*/
|
|
14225
|
-
static createBooleanValue(value) {
|
|
14226
|
-
return new _LocalValue("boolean" /* Boolean */, value);
|
|
14227
|
-
}
|
|
14228
|
-
/**
|
|
14229
|
-
* Creates a new LocalValue object with a BigInt value.
|
|
14230
|
-
*
|
|
14231
|
-
* @param {BigInt} value - The BigInt value.
|
|
14232
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14233
|
-
*/
|
|
14234
|
-
static createBigIntValue(value) {
|
|
14235
|
-
return new _LocalValue("bigint" /* BigInt */, value.toString());
|
|
14236
|
-
}
|
|
14237
|
-
/**
|
|
14238
|
-
* Creates a new LocalValue object with an array.
|
|
14239
|
-
*
|
|
14240
|
-
* @param {Array} value - The array.
|
|
14241
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14242
|
-
*/
|
|
14243
|
-
static createArrayValue(value) {
|
|
14244
|
-
return new _LocalValue("array" /* Array */, value);
|
|
14245
|
-
}
|
|
14246
|
-
/**
|
|
14247
|
-
* Creates a new LocalValue object with date value.
|
|
14248
|
-
*
|
|
14249
|
-
* @param {string} value - The date.
|
|
14250
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14251
|
-
*/
|
|
14252
|
-
static createDateValue(value) {
|
|
14253
|
-
return new _LocalValue("date" /* Date */, value);
|
|
14254
|
-
}
|
|
14255
|
-
/**
|
|
14256
|
-
* Creates a new LocalValue object of map value.
|
|
14257
|
-
* @param {Map} map - The map.
|
|
14258
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14259
|
-
*/
|
|
14260
|
-
static createMapValue(map2) {
|
|
14261
|
-
const value = [];
|
|
14262
|
-
Array.from(map2.entries()).forEach(([key, val]) => {
|
|
14263
|
-
value.push([_LocalValue.getArgument(key), _LocalValue.getArgument(val)]);
|
|
14264
|
-
});
|
|
14265
|
-
return new _LocalValue("map" /* Map */, value);
|
|
14266
|
-
}
|
|
14267
|
-
/**
|
|
14268
|
-
* Creates a new LocalValue object from the passed object.
|
|
14269
|
-
*
|
|
14270
|
-
* @param object the object to create a LocalValue from
|
|
14271
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14272
|
-
*/
|
|
14273
|
-
static createObjectValue(object) {
|
|
14274
|
-
const value = [];
|
|
14275
|
-
Object.entries(object).forEach(([key, val]) => {
|
|
14276
|
-
value.push([key, _LocalValue.getArgument(val)]);
|
|
14277
|
-
});
|
|
14278
|
-
return new _LocalValue("object" /* Object */, value);
|
|
14279
|
-
}
|
|
14280
|
-
/**
|
|
14281
|
-
* Creates a new LocalValue object of regular expression value.
|
|
14282
|
-
*
|
|
14283
|
-
* @param {string} value - The value of the regular expression.
|
|
14284
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14285
|
-
*/
|
|
14286
|
-
static createRegularExpressionValue(value) {
|
|
14287
|
-
return new _LocalValue("regexp" /* RegularExpression */, value);
|
|
14288
|
-
}
|
|
14289
|
-
/**
|
|
14290
|
-
* Creates a new LocalValue object with the specified value.
|
|
14291
|
-
* @param {Set} value - The value to be set.
|
|
14292
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14293
|
-
*/
|
|
14294
|
-
static createSetValue(value) {
|
|
14295
|
-
return new _LocalValue("set" /* Set */, value);
|
|
14296
|
-
}
|
|
14297
|
-
/**
|
|
14298
|
-
* Creates a new LocalValue object with the given channel value
|
|
14299
|
-
*
|
|
14300
|
-
* @param {ChannelValue} value - The channel value.
|
|
14301
|
-
* @returns {LocalValue} - The created LocalValue object.
|
|
14302
|
-
*/
|
|
14303
|
-
static createChannelValue(value) {
|
|
14304
|
-
return new _LocalValue("channel" /* Channel */, value);
|
|
14305
|
-
}
|
|
14306
|
-
/**
|
|
14307
|
-
* Creates a new LocalValue object with a Symbol value.
|
|
14308
|
-
*
|
|
14309
|
-
* @param {Symbol} symbol - The Symbol value
|
|
14310
|
-
* @returns {LocalValue} - The created LocalValue object
|
|
14311
|
-
*/
|
|
14312
|
-
static createSymbolValue(symbol) {
|
|
14313
|
-
const description = symbol.description || "Symbol()";
|
|
14314
|
-
return new _LocalValue("symbol" /* Symbol */, description);
|
|
14315
|
-
}
|
|
14316
|
-
static getArgument(argument) {
|
|
14317
|
-
const type = typeof argument;
|
|
14318
|
-
switch (type) {
|
|
14319
|
-
case "string" /* String */:
|
|
14320
|
-
return _LocalValue.createStringValue(argument);
|
|
14321
|
-
case "number" /* Number */:
|
|
14322
|
-
if (Number.isNaN(argument) || Object.is(argument, -0) || !Number.isFinite(argument)) {
|
|
14323
|
-
return _LocalValue.createSpecialNumberValue(argument);
|
|
14324
|
-
}
|
|
14325
|
-
return _LocalValue.createNumberValue(argument);
|
|
14326
|
-
case "boolean" /* Boolean */:
|
|
14327
|
-
return _LocalValue.createBooleanValue(argument);
|
|
14328
|
-
case "bigint" /* BigInt */:
|
|
14329
|
-
return _LocalValue.createBigIntValue(argument);
|
|
14330
|
-
case "undefined" /* Undefined */:
|
|
14331
|
-
return _LocalValue.createUndefinedValue();
|
|
14332
|
-
case "symbol" /* Symbol */:
|
|
14333
|
-
return _LocalValue.createSymbolValue(argument);
|
|
14334
|
-
case "object" /* Object */:
|
|
14335
|
-
if (argument === null) {
|
|
14336
|
-
return _LocalValue.createNullValue();
|
|
14337
|
-
}
|
|
14338
|
-
if (argument instanceof Date) {
|
|
14339
|
-
return _LocalValue.createDateValue(argument);
|
|
14340
|
-
}
|
|
14341
|
-
if (argument instanceof Map) {
|
|
14342
|
-
const map2 = [];
|
|
14343
|
-
argument.forEach((value, key) => {
|
|
14344
|
-
const objectKey = typeof key === "string" ? key : _LocalValue.getArgument(key);
|
|
14345
|
-
const objectValue = _LocalValue.getArgument(value);
|
|
14346
|
-
map2.push([objectKey, objectValue]);
|
|
14347
|
-
});
|
|
14348
|
-
return _LocalValue.createMapValue(argument);
|
|
14349
|
-
}
|
|
14350
|
-
if (argument instanceof Set) {
|
|
14351
|
-
const set = [];
|
|
14352
|
-
argument.forEach((value) => {
|
|
14353
|
-
set.push(_LocalValue.getArgument(value));
|
|
14354
|
-
});
|
|
14355
|
-
return _LocalValue.createSetValue(set);
|
|
14356
|
-
}
|
|
14357
|
-
if (argument instanceof Array) {
|
|
14358
|
-
const arr = [];
|
|
14359
|
-
argument.forEach((value) => {
|
|
14360
|
-
arr.push(_LocalValue.getArgument(value));
|
|
14361
|
-
});
|
|
14362
|
-
return _LocalValue.createArrayValue(arr);
|
|
14363
|
-
}
|
|
14364
|
-
if (argument instanceof RegExp) {
|
|
14365
|
-
return _LocalValue.createRegularExpressionValue({
|
|
14366
|
-
pattern: argument.source,
|
|
14367
|
-
flags: argument.flags
|
|
14368
|
-
});
|
|
14369
|
-
}
|
|
14370
|
-
return _LocalValue.createObjectValue(argument);
|
|
14371
|
-
}
|
|
14372
|
-
throw new Error(`Unsupported type: ${type}`);
|
|
14373
|
-
}
|
|
14374
|
-
asMap() {
|
|
14375
|
-
return {
|
|
14376
|
-
[TYPE_CONSTANT]: this.type,
|
|
14377
|
-
...!(this.type === "null" /* Null */ || this.type === "undefined" /* Undefined */) ? { [VALUE_CONSTANT]: this.value } : {}
|
|
14378
|
-
};
|
|
14379
|
-
}
|
|
14380
|
-
};
|
|
14381
|
-
|
|
14382
14130
|
// src/utils/message-utils.ts
|
|
14383
14131
|
var catchError = (diagnostics, err2, msg) => {
|
|
14384
14132
|
const diagnostic = {
|
|
@@ -14417,101 +14165,6 @@ var shouldIgnoreError = (msg) => {
|
|
|
14417
14165
|
};
|
|
14418
14166
|
var TASK_CANCELED_MSG = `task canceled`;
|
|
14419
14167
|
|
|
14420
|
-
// src/utils/remote-value.ts
|
|
14421
|
-
var RemoteValue = class _RemoteValue {
|
|
14422
|
-
/**
|
|
14423
|
-
* Deserializes a LocalValue serialized object back to its original JavaScript representation
|
|
14424
|
-
*
|
|
14425
|
-
* @param serialized The serialized LocalValue object
|
|
14426
|
-
* @returns The original JavaScript value/object
|
|
14427
|
-
*/
|
|
14428
|
-
static fromLocalValue(serialized) {
|
|
14429
|
-
const type = serialized[TYPE_CONSTANT];
|
|
14430
|
-
const value = VALUE_CONSTANT in serialized ? serialized[VALUE_CONSTANT] : void 0;
|
|
14431
|
-
switch (type) {
|
|
14432
|
-
case "string" /* String */:
|
|
14433
|
-
return value;
|
|
14434
|
-
case "boolean" /* Boolean */:
|
|
14435
|
-
return value;
|
|
14436
|
-
case "bigint" /* BigInt */:
|
|
14437
|
-
return BigInt(value);
|
|
14438
|
-
case "undefined" /* Undefined */:
|
|
14439
|
-
return void 0;
|
|
14440
|
-
case "null" /* Null */:
|
|
14441
|
-
return null;
|
|
14442
|
-
case "number" /* Number */:
|
|
14443
|
-
if (value === "NaN") return NaN;
|
|
14444
|
-
if (value === "-0") return -0;
|
|
14445
|
-
if (value === "Infinity") return Infinity;
|
|
14446
|
-
if (value === "-Infinity") return -Infinity;
|
|
14447
|
-
return value;
|
|
14448
|
-
case "array" /* Array */:
|
|
14449
|
-
return value.map((item) => _RemoteValue.fromLocalValue(item));
|
|
14450
|
-
case "date" /* Date */:
|
|
14451
|
-
return new Date(value);
|
|
14452
|
-
case "map" /* Map */:
|
|
14453
|
-
const map2 = /* @__PURE__ */ new Map();
|
|
14454
|
-
for (const [key, val] of value) {
|
|
14455
|
-
const deserializedKey = typeof key === "object" && key !== null ? _RemoteValue.fromLocalValue(key) : key;
|
|
14456
|
-
const deserializedValue = _RemoteValue.fromLocalValue(val);
|
|
14457
|
-
map2.set(deserializedKey, deserializedValue);
|
|
14458
|
-
}
|
|
14459
|
-
return map2;
|
|
14460
|
-
case "object" /* Object */:
|
|
14461
|
-
const obj = {};
|
|
14462
|
-
for (const [key, val] of value) {
|
|
14463
|
-
obj[key] = _RemoteValue.fromLocalValue(val);
|
|
14464
|
-
}
|
|
14465
|
-
return obj;
|
|
14466
|
-
case "regexp" /* RegularExpression */:
|
|
14467
|
-
const { pattern, flags } = value;
|
|
14468
|
-
return new RegExp(pattern, flags);
|
|
14469
|
-
case "set" /* Set */:
|
|
14470
|
-
const set = /* @__PURE__ */ new Set();
|
|
14471
|
-
for (const item of value) {
|
|
14472
|
-
set.add(_RemoteValue.fromLocalValue(item));
|
|
14473
|
-
}
|
|
14474
|
-
return set;
|
|
14475
|
-
case "symbol" /* Symbol */:
|
|
14476
|
-
return Symbol(value);
|
|
14477
|
-
default:
|
|
14478
|
-
throw new Error(`Unsupported type: ${type}`);
|
|
14479
|
-
}
|
|
14480
|
-
}
|
|
14481
|
-
/**
|
|
14482
|
-
* Utility method to deserialize multiple LocalValues at once
|
|
14483
|
-
*
|
|
14484
|
-
* @param serializedValues Array of serialized LocalValue objects
|
|
14485
|
-
* @returns Array of deserialized JavaScript values
|
|
14486
|
-
*/
|
|
14487
|
-
static fromLocalValueArray(serializedValues) {
|
|
14488
|
-
return serializedValues.map((value) => _RemoteValue.fromLocalValue(value));
|
|
14489
|
-
}
|
|
14490
|
-
/**
|
|
14491
|
-
* Verifies if the given object matches the structure of a serialized LocalValue
|
|
14492
|
-
*
|
|
14493
|
-
* @param obj Object to verify
|
|
14494
|
-
* @returns boolean indicating if the object has LocalValue structure
|
|
14495
|
-
*/
|
|
14496
|
-
static isLocalValueObject(obj) {
|
|
14497
|
-
if (typeof obj !== "object" || obj === null) {
|
|
14498
|
-
return false;
|
|
14499
|
-
}
|
|
14500
|
-
if (!obj.hasOwnProperty(TYPE_CONSTANT)) {
|
|
14501
|
-
return false;
|
|
14502
|
-
}
|
|
14503
|
-
const type = obj[TYPE_CONSTANT];
|
|
14504
|
-
const hasTypeProperty = Object.values({ ...PrimitiveType, ...NonPrimitiveType }).includes(type);
|
|
14505
|
-
if (!hasTypeProperty) {
|
|
14506
|
-
return false;
|
|
14507
|
-
}
|
|
14508
|
-
if (type !== "null" /* Null */ && type !== "undefined" /* Undefined */) {
|
|
14509
|
-
return obj.hasOwnProperty(VALUE_CONSTANT);
|
|
14510
|
-
}
|
|
14511
|
-
return true;
|
|
14512
|
-
}
|
|
14513
|
-
};
|
|
14514
|
-
|
|
14515
14168
|
// src/utils/result.ts
|
|
14516
14169
|
var result_exports = {};
|
|
14517
14170
|
__export(result_exports, {
|
|
@@ -14561,21 +14214,6 @@ var unwrapErr = (result) => {
|
|
|
14561
14214
|
}
|
|
14562
14215
|
};
|
|
14563
14216
|
|
|
14564
|
-
// src/utils/serialize.ts
|
|
14565
|
-
function serializeProperty(value) {
|
|
14566
|
-
if (["string", "boolean", "undefined"].includes(typeof value) || typeof value === "number" && value !== Infinity && value !== -Infinity && !isNaN(value)) {
|
|
14567
|
-
return value;
|
|
14568
|
-
}
|
|
14569
|
-
const arg = LocalValue.getArgument(value);
|
|
14570
|
-
return SERIALIZED_PREFIX + btoa(JSON.stringify(arg));
|
|
14571
|
-
}
|
|
14572
|
-
function deserializeProperty(value) {
|
|
14573
|
-
if (typeof value !== "string" || !value.startsWith(SERIALIZED_PREFIX)) {
|
|
14574
|
-
return value;
|
|
14575
|
-
}
|
|
14576
|
-
return RemoteValue.fromLocalValue(JSON.parse(atob(value.slice(SERIALIZED_PREFIX.length))));
|
|
14577
|
-
}
|
|
14578
|
-
|
|
14579
14217
|
// src/utils/util.ts
|
|
14580
14218
|
var lowerPathParam = (fn) => (p) => fn(p.toLowerCase());
|
|
14581
14219
|
var isDtsFile = lowerPathParam((p) => p.endsWith(".d.ts") || p.endsWith(".d.mts") || p.endsWith(".d.cts"));
|
|
@@ -16051,10 +15689,8 @@ function removeScripts(elm) {
|
|
|
16051
15689
|
}
|
|
16052
15690
|
export {
|
|
16053
15691
|
createWindowFromHtml,
|
|
16054
|
-
deserializeProperty,
|
|
16055
15692
|
hydrateDocument,
|
|
16056
15693
|
renderToString,
|
|
16057
15694
|
serializeDocumentToString,
|
|
16058
|
-
serializeProperty,
|
|
16059
15695
|
streamToString
|
|
16060
15696
|
};
|
package/internal/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stencil/core/internal",
|
|
3
|
-
"version": "4.28.2-dev.
|
|
3
|
+
"version": "4.28.2-dev.1742533303.37ac3fc",
|
|
4
4
|
"description": "Stencil internals only to be imported by the Stencil Compiler. Breaking changes can and will happen at any time.",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"types": "./index.d.ts",
|