@stencil/core 5.0.0-alpha.2 → 5.0.0-alpha.3
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/{client-DucyoZT4.mjs → client-CSm3x5ke.mjs} +81 -60
- package/dist/compiler/index.d.mts +3 -3
- package/dist/compiler/index.mjs +2 -2
- package/dist/compiler/utils/index.d.mts +2 -2
- package/dist/compiler/utils/index.mjs +3 -3
- package/dist/{compiler-DyK1_szo.mjs → compiler-D6iP7Bzb.mjs} +1390 -1631
- package/dist/declarations/stencil-public-compiler.d.ts +4031 -2
- package/dist/declarations/stencil-public-compiler.js +0 -1
- package/dist/declarations/stencil-public-docs.d.ts +494 -1
- package/dist/declarations/stencil-public-runtime.d.ts +1943 -2
- package/dist/{index-fIuYTL9f.d.mts → index-CXHCTQNt.d.mts} +14 -2
- package/dist/{index-BONzXKJt.d.ts → index-CyrGY82h.d.ts} +5 -7
- package/dist/{index-CHjZtib0.d.ts → index-hS-KBdAP.d.ts} +1 -1
- package/dist/{index-D-LlB2nw.d.mts → index-tUR6pD3J.d.mts} +145 -809
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +2 -2
- package/dist/{jsx-runtime-DBzBJLKk.d.ts → jsx-runtime-DlDkTqps.d.ts} +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +1 -1
- package/dist/{node-BWBQAh8C.mjs → node-Bg-mO5dw.mjs} +3 -14
- package/dist/regular-expression-D5pGVpCu.mjs +415 -0
- package/dist/runtime/app-data/index.d.ts +1 -1
- package/dist/runtime/app-data/index.js +1 -2
- package/dist/runtime/client/index.d.ts +14 -4
- package/dist/runtime/client/index.js +103 -205
- package/dist/runtime/index.d.ts +16 -4
- package/dist/runtime/index.js +2 -2
- package/dist/runtime/server/index.d.mts +1 -3
- package/dist/runtime/server/index.mjs +103 -205
- package/dist/runtime/server/runner.d.mts +1 -17
- package/dist/runtime/server/runner.mjs +12 -394
- package/dist/{runtime-CqlPYKjW.js → runtime-BBCnuprF.js} +103 -205
- package/dist/sys/node/index.d.mts +1 -1
- package/dist/sys/node/index.mjs +1 -1
- package/dist/sys/node/worker.mjs +2 -2
- package/dist/testing/index.d.mts +3 -3
- package/dist/testing/index.mjs +18 -17
- package/dist/{validation-BR7tMYEv.mjs → validation-Byxie0Uk.mjs} +28 -24
- package/package.json +9 -13
- package/dist/serialize-o-Sj1lvg.mjs +0 -792
- package/dist/stencil-public-compiler-C_X1iolo.d.ts +0 -4455
- package/dist/stencil-public-runtime-DlV8o7-z.d.ts +0 -1845
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { A as
|
|
2
|
-
export { AttachInternals, AttrDeserialize, Build, Component, Element, Event, Fragment, Host, Listen, Method, Mixin, Prop, PropSerialize, State, Watch, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, h, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
|
|
1
|
+
import { A as Element, C as setPlatformHelpers, D as AttachInternals, F as PropSerialize, I as State, L as Watch, M as Listen, N as Method, O as AttrDeserialize, P as Prop, R as resolveVar, S as writeTask, T as setErrorHandler, _ as getElement, a as Mixin, b as setAssetPath, c as forceUpdate, f as getMode, g as h, h as Host, i as render, j as Event, k as Component, l as getRenderingRef, n as setTagTransformer, o as Fragment, p as setMode, r as transformTag, v as getShadowRoot, x as readTask, y as getAssetPath, z as Build } from "./client-CSm3x5ke.mjs";
|
|
2
|
+
export { AttachInternals, AttrDeserialize, Build, Component, Element, Event, Fragment, Host, Listen, Method, Mixin, Prop, PropSerialize, State, Watch, forceUpdate, getAssetPath, getElement, getMode, getRenderingRef, getShadowRoot, h, readTask, render, resolveVar, setAssetPath, setErrorHandler, setMode, setPlatformHelpers, setTagTransformer, transformTag, writeTask };
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-
|
|
1
|
+
import { n as jsxs, r as Fragment, t as jsx } from "./jsx-runtime-DlDkTqps.js";
|
|
2
2
|
export { Fragment, jsx, jsxs };
|
package/dist/jsx-runtime.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { d as Fragment, n as jsx, r as jsxs } from "./runtime-
|
|
1
|
+
import { d as Fragment, n as jsx, r as jsxs } from "./runtime-BBCnuprF.js";
|
|
2
2
|
export { Fragment, jsx, jsxs };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { n as __require } from "./chunk-CjcI7cDX.mjs";
|
|
2
|
-
import "./client-
|
|
3
|
-
import {
|
|
4
|
-
import { bt as isGlob, dt as TASK_CANCELED_MSG, ft as buildError, ht as catchError, rt as normalizePath, vt as shouldIgnoreError } from "./validation-
|
|
2
|
+
import "./client-CSm3x5ke.mjs";
|
|
3
|
+
import { h as noop, i as flatOne, l as isFunction, p as isString } from "./regular-expression-D5pGVpCu.mjs";
|
|
4
|
+
import { bt as isGlob, dt as TASK_CANCELED_MSG, ft as buildError, ht as catchError, rt as normalizePath, vt as shouldIgnoreError } from "./validation-Byxie0Uk.mjs";
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
import { pathToFileURL } from "node:url";
|
|
7
7
|
import path$1 from "path";
|
|
@@ -1494,17 +1494,6 @@ function createNodeSys(c = {}) {
|
|
|
1494
1494
|
encodeToBase64(str) {
|
|
1495
1495
|
return Buffer.from(str).toString("base64");
|
|
1496
1496
|
},
|
|
1497
|
-
async ensureDependencies() {
|
|
1498
|
-
console.warn(`ensureDependencies will be removed in a future version of Stencil.`);
|
|
1499
|
-
console.warn(`To get the stencilPath, please use getCompilerExecutingPath().`);
|
|
1500
|
-
return {
|
|
1501
|
-
stencilPath: sys.getCompilerExecutingPath(),
|
|
1502
|
-
diagnostics: []
|
|
1503
|
-
};
|
|
1504
|
-
},
|
|
1505
|
-
async ensureResources() {
|
|
1506
|
-
console.warn(`ensureResources is a no-op, and will be removed in a future version of Stencil`);
|
|
1507
|
-
},
|
|
1508
1497
|
exit: async (exitCode) => {
|
|
1509
1498
|
await runInterruptsCallbacks();
|
|
1510
1499
|
process.exitCode = exitCode;
|
|
@@ -0,0 +1,415 @@
|
|
|
1
|
+
const MEMBER_FLAGS = {
|
|
2
|
+
String: 1,
|
|
3
|
+
Number: 2,
|
|
4
|
+
Boolean: 4,
|
|
5
|
+
Any: 8,
|
|
6
|
+
Unknown: 16,
|
|
7
|
+
State: 32,
|
|
8
|
+
Method: 64,
|
|
9
|
+
Event: 128,
|
|
10
|
+
Element: 256,
|
|
11
|
+
ReflectAttr: 512,
|
|
12
|
+
Mutable: 1024,
|
|
13
|
+
Getter: 2048,
|
|
14
|
+
Setter: 4096,
|
|
15
|
+
Prop: 31,
|
|
16
|
+
HasAttribute: 31,
|
|
17
|
+
PropLike: 63
|
|
18
|
+
};
|
|
19
|
+
const WATCH_FLAGS = { Immediate: 1 };
|
|
20
|
+
const EVENT_FLAGS = {
|
|
21
|
+
Cancellable: 1,
|
|
22
|
+
Composed: 2,
|
|
23
|
+
Bubbles: 4
|
|
24
|
+
};
|
|
25
|
+
const LISTENER_FLAGS = {
|
|
26
|
+
Passive: 1,
|
|
27
|
+
Capture: 2,
|
|
28
|
+
TargetDocument: 4,
|
|
29
|
+
TargetWindow: 8,
|
|
30
|
+
TargetBody: 16
|
|
31
|
+
};
|
|
32
|
+
const HOST_FLAGS = {
|
|
33
|
+
hasConnected: 1,
|
|
34
|
+
hasRendered: 2,
|
|
35
|
+
isWaitingForChildren: 4,
|
|
36
|
+
isConstructingInstance: 8,
|
|
37
|
+
isQueuedForUpdate: 16,
|
|
38
|
+
hasInitializedComponent: 32,
|
|
39
|
+
hasLoadedComponent: 64,
|
|
40
|
+
isWatchReady: 128,
|
|
41
|
+
isListenReady: 256,
|
|
42
|
+
needsRerender: 512,
|
|
43
|
+
devOnRender: 1024,
|
|
44
|
+
devOnDidLoad: 2048
|
|
45
|
+
};
|
|
46
|
+
const CF_scopedCssEncapsulation = 2;
|
|
47
|
+
const CF_needsShadowDomShim = 8;
|
|
48
|
+
/**
|
|
49
|
+
* A set of flags used for bitwise calculations against {@link ComponentRuntimeMeta#$flags$}.
|
|
50
|
+
*
|
|
51
|
+
* These flags should only be used in conjunction with {@link ComponentRuntimeMeta#$flags$}.
|
|
52
|
+
* They should _not_ be used for calculations against other fields/numbers
|
|
53
|
+
*/
|
|
54
|
+
const CMP_FLAGS = {
|
|
55
|
+
shadowDomEncapsulation: 1,
|
|
56
|
+
scopedCssEncapsulation: CF_scopedCssEncapsulation,
|
|
57
|
+
hasSlotRelocation: 4,
|
|
58
|
+
needsShadowDomShim: CF_needsShadowDomShim,
|
|
59
|
+
shadowDelegatesFocus: 16,
|
|
60
|
+
hasMode: 32,
|
|
61
|
+
needsScopedEncapsulation: CF_scopedCssEncapsulation | CF_needsShadowDomShim,
|
|
62
|
+
formAssociated: 64,
|
|
63
|
+
shadowNeedsScopedCss: 128,
|
|
64
|
+
hasSlot: 256,
|
|
65
|
+
hasModernPropertyDecls: 512,
|
|
66
|
+
shadowSlotAssignmentManual: 1024,
|
|
67
|
+
shadowModeClosed: 2048,
|
|
68
|
+
patchChildren: 4096,
|
|
69
|
+
patchClone: 8192,
|
|
70
|
+
patchInsert: 16384,
|
|
71
|
+
patchAll: 32768
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Default style mode id
|
|
75
|
+
*/
|
|
76
|
+
const DEFAULT_STYLE_MODE = "$";
|
|
77
|
+
/**
|
|
78
|
+
* Namespaces
|
|
79
|
+
*/
|
|
80
|
+
const SVG_NS = "http://www.w3.org/2000/svg";
|
|
81
|
+
const HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
82
|
+
const XLINK_NS = "http://www.w3.org/1999/xlink";
|
|
83
|
+
/**
|
|
84
|
+
* File names and value
|
|
85
|
+
*/
|
|
86
|
+
const COLLECTION_MANIFEST_FILE_NAME = "collection-manifest.json";
|
|
87
|
+
/**
|
|
88
|
+
* Constant for the 'copy' output target
|
|
89
|
+
*/
|
|
90
|
+
const COPY = "copy";
|
|
91
|
+
/**
|
|
92
|
+
* Constant for the 'custom' output target
|
|
93
|
+
*/
|
|
94
|
+
const CUSTOM = "custom";
|
|
95
|
+
/**
|
|
96
|
+
* Constant for the 'dist' output target
|
|
97
|
+
*/
|
|
98
|
+
const DIST = "dist";
|
|
99
|
+
/**
|
|
100
|
+
* Constant for the 'dist-collection' output target
|
|
101
|
+
*/
|
|
102
|
+
const DIST_COLLECTION = "dist-collection";
|
|
103
|
+
/**
|
|
104
|
+
* Constant for the 'dist-custom-elements' output target
|
|
105
|
+
*/
|
|
106
|
+
const DIST_CUSTOM_ELEMENTS = "dist-custom-elements";
|
|
107
|
+
/**
|
|
108
|
+
* Constant for the 'dist-types' output target
|
|
109
|
+
*/
|
|
110
|
+
const DIST_TYPES = "dist-types";
|
|
111
|
+
/**
|
|
112
|
+
* Constant for the 'dist-hydrate-script' output target
|
|
113
|
+
*/
|
|
114
|
+
const DIST_HYDRATE_SCRIPT = "dist-hydrate-script";
|
|
115
|
+
/**
|
|
116
|
+
* Constant for the 'dist-lazy' output target
|
|
117
|
+
*/
|
|
118
|
+
const DIST_LAZY = "dist-lazy";
|
|
119
|
+
/**
|
|
120
|
+
* Constant for the 'dist-lazy-loader' output target
|
|
121
|
+
*/
|
|
122
|
+
const DIST_LAZY_LOADER = "dist-lazy-loader";
|
|
123
|
+
/**
|
|
124
|
+
* Constant for the 'dist-global-styles' output target
|
|
125
|
+
*/
|
|
126
|
+
const DIST_GLOBAL_STYLES = "dist-global-styles";
|
|
127
|
+
/**
|
|
128
|
+
* Constant for the 'docs-custom' output target
|
|
129
|
+
*/
|
|
130
|
+
const DOCS_CUSTOM = "docs-custom";
|
|
131
|
+
/**
|
|
132
|
+
* Constant for the 'docs-json' output target
|
|
133
|
+
*/
|
|
134
|
+
const DOCS_JSON = "docs-json";
|
|
135
|
+
/**
|
|
136
|
+
* Constant for the 'docs-readme' output target
|
|
137
|
+
*/
|
|
138
|
+
const DOCS_README = "docs-readme";
|
|
139
|
+
/**
|
|
140
|
+
* Constant for the 'docs-vscode' output target
|
|
141
|
+
*/
|
|
142
|
+
const DOCS_VSCODE = "docs-vscode";
|
|
143
|
+
/**
|
|
144
|
+
* Constant for the 'docs-custom-elements-manifest' output target
|
|
145
|
+
*/
|
|
146
|
+
const DOCS_CUSTOM_ELEMENTS_MANIFEST = "docs-custom-elements-manifest";
|
|
147
|
+
/**
|
|
148
|
+
* Constant for the 'stats' output target
|
|
149
|
+
*/
|
|
150
|
+
const STATS = "stats";
|
|
151
|
+
/**
|
|
152
|
+
* Constant for the 'www' output target
|
|
153
|
+
*/
|
|
154
|
+
const WWW = "www";
|
|
155
|
+
/**
|
|
156
|
+
* Valid output targets to specify in a Stencil config.
|
|
157
|
+
*
|
|
158
|
+
* Note that there are some output targets (e.g. `DIST_TYPES`) which are
|
|
159
|
+
* programmatically set as output targets by the compiler when other output
|
|
160
|
+
* targets (in that case `DIST`) are set, but which are _not_ supported in a
|
|
161
|
+
* Stencil config. This is enforced in the output target validation code.
|
|
162
|
+
*/
|
|
163
|
+
const VALID_CONFIG_OUTPUT_TARGETS = [
|
|
164
|
+
"www",
|
|
165
|
+
DIST,
|
|
166
|
+
DIST_COLLECTION,
|
|
167
|
+
DIST_CUSTOM_ELEMENTS,
|
|
168
|
+
DIST_LAZY,
|
|
169
|
+
DIST_HYDRATE_SCRIPT,
|
|
170
|
+
DOCS_JSON,
|
|
171
|
+
DOCS_README,
|
|
172
|
+
DOCS_VSCODE,
|
|
173
|
+
DOCS_CUSTOM,
|
|
174
|
+
DOCS_CUSTOM_ELEMENTS_MANIFEST,
|
|
175
|
+
COPY,
|
|
176
|
+
CUSTOM,
|
|
177
|
+
STATS
|
|
178
|
+
];
|
|
179
|
+
const GENERATED_DTS = "components.d.ts";
|
|
180
|
+
/**
|
|
181
|
+
* DOM Node types
|
|
182
|
+
*
|
|
183
|
+
* See https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
184
|
+
*
|
|
185
|
+
* Note: this is a duplicate of the `NODE_TYPES` enum in mock-doc, it's
|
|
186
|
+
* copied over here so that we do not need to introduce a dependency on the
|
|
187
|
+
* mock-doc bundle in the runtime. See
|
|
188
|
+
* https://github.com/stenciljs/core/pull/5705 for more details.
|
|
189
|
+
*/
|
|
190
|
+
const NODE_TYPES = {
|
|
191
|
+
ELEMENT_NODE: 1,
|
|
192
|
+
ATTRIBUTE_NODE: 2,
|
|
193
|
+
TEXT_NODE: 3,
|
|
194
|
+
CDATA_SECTION_NODE: 4,
|
|
195
|
+
ENTITY_REFERENCE_NODE: 5,
|
|
196
|
+
ENTITY_NODE: 6,
|
|
197
|
+
PROCESSING_INSTRUCTION_NODE: 7,
|
|
198
|
+
COMMENT_NODE: 8,
|
|
199
|
+
DOCUMENT_NODE: 9,
|
|
200
|
+
DOCUMENT_TYPE_NODE: 10,
|
|
201
|
+
DOCUMENT_FRAGMENT_NODE: 11,
|
|
202
|
+
NOTATION_NODE: 12
|
|
203
|
+
};
|
|
204
|
+
//#endregion
|
|
205
|
+
//#region src/utils/query-nonce-meta-tag-content.ts
|
|
206
|
+
/**
|
|
207
|
+
* Helper method for querying a `meta` tag that contains a nonce value
|
|
208
|
+
* out of a DOM's head.
|
|
209
|
+
*
|
|
210
|
+
* @param doc The DOM containing the `head` to query against
|
|
211
|
+
* @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
|
|
212
|
+
* exists or the tag has no content.
|
|
213
|
+
*/
|
|
214
|
+
function queryNonceMetaTagContent(doc) {
|
|
215
|
+
return doc.head?.querySelector("meta[name=\"csp-nonce\"]")?.getAttribute("content") ?? void 0;
|
|
216
|
+
}
|
|
217
|
+
//#endregion
|
|
218
|
+
//#region src/utils/helpers.ts
|
|
219
|
+
/**
|
|
220
|
+
* Check if a value is defined (not null and not undefined).
|
|
221
|
+
*
|
|
222
|
+
* @param v - the value to check
|
|
223
|
+
* @returns true if the value is defined
|
|
224
|
+
*/
|
|
225
|
+
const isDef = (v) => v != null && v !== void 0;
|
|
226
|
+
/**
|
|
227
|
+
* Convert a string from PascalCase to dash-case
|
|
228
|
+
*
|
|
229
|
+
* @param str the string to convert
|
|
230
|
+
* @returns a converted string
|
|
231
|
+
*/
|
|
232
|
+
const toDashCase = (str) => str.replace(/([A-Z0-9])/g, (match) => ` ${match[0]}`).trim().split(" ").join("-").toLowerCase();
|
|
233
|
+
/**
|
|
234
|
+
* Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
|
|
235
|
+
* or whatever you call it!)
|
|
236
|
+
*
|
|
237
|
+
* @param str a string to convert
|
|
238
|
+
* @returns a converted string
|
|
239
|
+
*/
|
|
240
|
+
const dashToPascalCase = (str) => str.toLowerCase().split("-").map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1)).join("");
|
|
241
|
+
/**
|
|
242
|
+
* Convert a string to 'camelCase'
|
|
243
|
+
*
|
|
244
|
+
* @param str the string to convert
|
|
245
|
+
* @returns the converted string
|
|
246
|
+
*/
|
|
247
|
+
const toCamelCase = (str) => {
|
|
248
|
+
const pascalCase = dashToPascalCase(str);
|
|
249
|
+
return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Capitalize the first letter of a string
|
|
253
|
+
*
|
|
254
|
+
* @param str the string to capitalize
|
|
255
|
+
* @returns a capitalized string
|
|
256
|
+
*/
|
|
257
|
+
const toTitleCase = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
|
258
|
+
/**
|
|
259
|
+
* Escapes all occurrences of a specified pattern in a string.
|
|
260
|
+
* This function replaces all matches of a given pattern in the input text with a specified replacement string.
|
|
261
|
+
* It can handle both string and regular expression patterns and allows toggling between global and single-match replacements.
|
|
262
|
+
*
|
|
263
|
+
* @param text - The input string to process.
|
|
264
|
+
* @param pattern - The pattern to search for in the input string. Can be a regular expression or a string.
|
|
265
|
+
* @param replacement - The string to replace each match with.
|
|
266
|
+
* @param replaceAll - Whether to replace all occurrences (true) or just the first occurrence (false). Defaults to true.
|
|
267
|
+
* @returns The processed string with the replacements applied.
|
|
268
|
+
*/
|
|
269
|
+
const escapeWithPattern = (text, pattern, replacement, replaceAll = true) => {
|
|
270
|
+
let regex;
|
|
271
|
+
if (typeof pattern === "string") {
|
|
272
|
+
const escaped = pattern.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
273
|
+
regex = new RegExp(escaped, replaceAll ? "g" : "");
|
|
274
|
+
} else {
|
|
275
|
+
const flags = pattern.flags;
|
|
276
|
+
const hasG = flags.includes("g");
|
|
277
|
+
const newFlags = replaceAll ? hasG ? flags : flags + "g" : hasG ? flags.replace(/g/g, "") : flags;
|
|
278
|
+
regex = new RegExp(pattern.source, newFlags);
|
|
279
|
+
}
|
|
280
|
+
return text.replace(regex, replacement);
|
|
281
|
+
};
|
|
282
|
+
/**
|
|
283
|
+
* This is just a no-op, don't expect it to do anything.
|
|
284
|
+
*/
|
|
285
|
+
const noop = () => {};
|
|
286
|
+
/**
|
|
287
|
+
* Check whether a value is a 'complex type', defined here as an object or a
|
|
288
|
+
* function.
|
|
289
|
+
*
|
|
290
|
+
* @param o the value to check
|
|
291
|
+
* @returns whether it's a complex type or not
|
|
292
|
+
*/
|
|
293
|
+
const isComplexType = (o) => {
|
|
294
|
+
o = typeof o;
|
|
295
|
+
return o === "object" || o === "function";
|
|
296
|
+
};
|
|
297
|
+
/**
|
|
298
|
+
* Sort an array without mutating it in-place (as `Array.prototype.sort`
|
|
299
|
+
* unfortunately does)
|
|
300
|
+
*
|
|
301
|
+
* @param array the array you'd like to sort
|
|
302
|
+
* @param prop a function for deriving sortable values (strings or numbers)
|
|
303
|
+
* from array members
|
|
304
|
+
* @returns a new array of all items `x` in `array` ordered by `prop(x)`
|
|
305
|
+
*/
|
|
306
|
+
const sortBy = (array, prop) => {
|
|
307
|
+
return array.slice().sort((a, b) => {
|
|
308
|
+
const nameA = prop(a);
|
|
309
|
+
const nameB = prop(b);
|
|
310
|
+
if (nameA < nameB) return -1;
|
|
311
|
+
if (nameA > nameB) return 1;
|
|
312
|
+
return 0;
|
|
313
|
+
});
|
|
314
|
+
};
|
|
315
|
+
/**
|
|
316
|
+
* A polyfill of sorts for `Array.prototype.flat` which will return the result
|
|
317
|
+
* of calling that method if present and, if not, return an equivalent based on
|
|
318
|
+
* `Array.prototype.reduce`.
|
|
319
|
+
*
|
|
320
|
+
* @param array the array to flatten (one level)
|
|
321
|
+
* @returns a flattened array
|
|
322
|
+
*/
|
|
323
|
+
const flatOne = (array) => {
|
|
324
|
+
if (array.flat) return array.flat(1);
|
|
325
|
+
return array.reduce((result, item) => {
|
|
326
|
+
result.push(...item);
|
|
327
|
+
return result;
|
|
328
|
+
}, []);
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Deduplicate an array, retaining items at the earliest position in which
|
|
332
|
+
* they appear.
|
|
333
|
+
*
|
|
334
|
+
* So `unique([1,3,2,1,1,4])` would be `[1,3,2,4]`.
|
|
335
|
+
*
|
|
336
|
+
* @param array the array to deduplicate
|
|
337
|
+
* @param predicate an optional function used to generate the key used to
|
|
338
|
+
* determine uniqueness
|
|
339
|
+
* @returns a new, deduplicated array
|
|
340
|
+
*/
|
|
341
|
+
const unique = (array, predicate = (i) => i) => {
|
|
342
|
+
const set = /* @__PURE__ */ new Set();
|
|
343
|
+
return array.filter((item) => {
|
|
344
|
+
const key = predicate(item);
|
|
345
|
+
if (key == null) return true;
|
|
346
|
+
if (set.has(key)) return false;
|
|
347
|
+
set.add(key);
|
|
348
|
+
return true;
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
/**
|
|
352
|
+
* Merge elements of an array into an existing array, using a predicate to
|
|
353
|
+
* determine uniqueness and only adding elements when they are not present in
|
|
354
|
+
* the first array.
|
|
355
|
+
*
|
|
356
|
+
* **Note**: this mutates the target array! This is intentional to avoid
|
|
357
|
+
* unnecessary array allocation, but be sure that it's what you want!
|
|
358
|
+
*
|
|
359
|
+
* @param target the target array, to which new unique items should be added
|
|
360
|
+
* @param newItems a list of new items, some (or all!) of which may be added
|
|
361
|
+
* @param mergeWith a predicate function which reduces the items in `target`
|
|
362
|
+
* and `newItems` to a value which can be equated with `===` for the purposes
|
|
363
|
+
* of determining uniqueness
|
|
364
|
+
*/
|
|
365
|
+
function mergeIntoWith(target, newItems, mergeWith) {
|
|
366
|
+
for (const item of newItems) if (!target.find((existingItem) => mergeWith(existingItem) === mergeWith(item))) target.push(item);
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* A utility for building an object from an iterable very similar to
|
|
370
|
+
* `Object.fromEntries`
|
|
371
|
+
*
|
|
372
|
+
* @param entries an iterable object holding entries (key-value tuples) to
|
|
373
|
+
* plop into a new object
|
|
374
|
+
* @returns an object containing those entries
|
|
375
|
+
*/
|
|
376
|
+
const fromEntries = (entries) => {
|
|
377
|
+
const object = {};
|
|
378
|
+
for (const [key, value] of entries) object[key] = value;
|
|
379
|
+
return object;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Based on a given object, create a new object which has only the specified
|
|
383
|
+
* key-value pairs included in it.
|
|
384
|
+
*
|
|
385
|
+
* @param obj the object from which to take values
|
|
386
|
+
* @param keys a set of keys to take
|
|
387
|
+
* @returns an object mapping `key` to `obj[key]` if `obj[key]` is truthy for
|
|
388
|
+
* every `key` in `keys`
|
|
389
|
+
*/
|
|
390
|
+
const pluck = (obj, keys) => {
|
|
391
|
+
return keys.reduce((final, key) => {
|
|
392
|
+
if (obj[key]) final[key] = obj[key];
|
|
393
|
+
return final;
|
|
394
|
+
}, {});
|
|
395
|
+
};
|
|
396
|
+
const isDefined = (v) => v !== null && v !== void 0;
|
|
397
|
+
const isBoolean = (v) => typeof v === "boolean";
|
|
398
|
+
const isFunction = (v) => typeof v === "function";
|
|
399
|
+
const isNumber = (v) => typeof v === "number";
|
|
400
|
+
const isObject = (val) => val != null && typeof val === "object" && Array.isArray(val) === false;
|
|
401
|
+
const isString = (v) => typeof v === "string";
|
|
402
|
+
const isIterable = (v) => isDefined(v) && isFunction(v[Symbol.iterator]);
|
|
403
|
+
//#endregion
|
|
404
|
+
//#region src/utils/regular-expression.ts
|
|
405
|
+
/**
|
|
406
|
+
* Utility function that will escape all regular expression special characters in a string.
|
|
407
|
+
*
|
|
408
|
+
* @param text The string potentially containing special characters.
|
|
409
|
+
* @returns The string with all special characters escaped.
|
|
410
|
+
*/
|
|
411
|
+
const escapeRegExpSpecialCharacters = (text) => {
|
|
412
|
+
return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
413
|
+
};
|
|
414
|
+
//#endregion
|
|
415
|
+
export { XLINK_NS as $, DIST_CUSTOM_ELEMENTS as A, DOCS_VSCODE as B, CMP_FLAGS as C, DEFAULT_STYLE_MODE as D, CUSTOM as E, DIST_TYPES as F, LISTENER_FLAGS as G, GENERATED_DTS as H, DOCS_CUSTOM as I, STATS as J, MEMBER_FLAGS as K, DOCS_CUSTOM_ELEMENTS_MANIFEST as L, DIST_HYDRATE_SCRIPT as M, DIST_LAZY as N, DIST as O, DIST_LAZY_LOADER as P, WWW as Q, DOCS_JSON as R, queryNonceMetaTagContent as S, COPY as T, HOST_FLAGS as U, EVENT_FLAGS as V, HTML_NS as W, VALID_CONFIG_OUTPUT_TARGETS as X, SVG_NS as Y, WATCH_FLAGS as Z, sortBy as _, fromEntries as a, toTitleCase as b, isDef as c, isNumber as d, isObject as f, pluck as g, noop as h, flatOne as i, DIST_GLOBAL_STYLES as j, DIST_COLLECTION as k, isFunction as l, mergeIntoWith as m, dashToPascalCase as n, isBoolean as o, isString as p, NODE_TYPES as q, escapeWithPattern as r, isComplexType as s, escapeRegExpSpecialCharacters as t, isIterable as u, toCamelCase as v, COLLECTION_MANIFEST_FILE_NAME as w, unique as x, toDashCase as y, DOCS_README as z };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-
|
|
1
|
+
import { n as Env, r as NAMESPACE, t as BUILD } from "../../index-hS-KBdAP.js";
|
|
2
2
|
export { BUILD, Env, NAMESPACE };
|
|
@@ -30,7 +30,6 @@ const BUILD = {
|
|
|
30
30
|
hostListenerTargetWindow: true,
|
|
31
31
|
hostListenerTargetDocument: true,
|
|
32
32
|
hostListenerTargetBody: true,
|
|
33
|
-
hostListenerTargetParent: false,
|
|
34
33
|
hostListenerTarget: true,
|
|
35
34
|
member: true,
|
|
36
35
|
method: true,
|
|
@@ -41,6 +40,7 @@ const BUILD = {
|
|
|
41
40
|
reflect: true,
|
|
42
41
|
scoped: true,
|
|
43
42
|
shadowDom: true,
|
|
43
|
+
shadowModeClosed: false,
|
|
44
44
|
slot: true,
|
|
45
45
|
cssAnnotations: true,
|
|
46
46
|
state: true,
|
|
@@ -89,7 +89,6 @@ const BUILD = {
|
|
|
89
89
|
initializeNextTick: false,
|
|
90
90
|
asyncLoading: true,
|
|
91
91
|
asyncQueue: false,
|
|
92
|
-
transformTagName: false,
|
|
93
92
|
attachStyles: true,
|
|
94
93
|
experimentalSlotFixes: false
|
|
95
94
|
};
|
|
@@ -1276,8 +1276,6 @@ interface JSXAttributes<T = Element$2> {
|
|
|
1276
1276
|
interface CustomElementsDefineOptions {
|
|
1277
1277
|
exclude?: string[];
|
|
1278
1278
|
syncQueue?: boolean;
|
|
1279
|
-
/** @deprecated in-favour of `setTagTransformer` and `transformTag` */
|
|
1280
|
-
transformTagName?: (tagName: string) => string;
|
|
1281
1279
|
jmp?: (c: Function) => any;
|
|
1282
1280
|
raf?: (c: FrameRequestCallback) => number;
|
|
1283
1281
|
ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
|
|
@@ -2172,6 +2170,18 @@ declare const disconnectedCallback: (elm: HostElement) => Promise<void>;
|
|
|
2172
2170
|
//#endregion
|
|
2173
2171
|
//#region src/runtime/element.d.ts
|
|
2174
2172
|
declare const getElement: (ref: any) => HostElement;
|
|
2173
|
+
/**
|
|
2174
|
+
* Get the shadow root for a Stencil component's host element.
|
|
2175
|
+
* This works for both open and closed shadow DOM modes.
|
|
2176
|
+
*
|
|
2177
|
+
* For closed shadow DOM, `element.shadowRoot` returns `null` by design,
|
|
2178
|
+
* but Stencil stores the reference internally so components can still
|
|
2179
|
+
* access their own shadow root.
|
|
2180
|
+
*
|
|
2181
|
+
* @param element The host element (from @Element() decorator)
|
|
2182
|
+
* @returns The shadow root, or null if no shadow root exists
|
|
2183
|
+
*/
|
|
2184
|
+
declare const getShadowRoot: (element: HTMLElement) => ShadowRoot | null;
|
|
2175
2185
|
//#endregion
|
|
2176
2186
|
//#region src/runtime/event-emitter.d.ts
|
|
2177
2187
|
declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
@@ -2182,7 +2192,7 @@ declare const createEvent: (ref: RuntimeRef, name: string, flags: number) => {
|
|
|
2182
2192
|
declare const Fragment: FunctionalComponent;
|
|
2183
2193
|
//#endregion
|
|
2184
2194
|
//#region src/runtime/host-listener.d.ts
|
|
2185
|
-
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]
|
|
2195
|
+
declare const addHostEventListeners: (elm: HostElement, hostRef: HostRef, listeners?: ComponentRuntimeHostListener[]) => void;
|
|
2186
2196
|
//#endregion
|
|
2187
2197
|
//#region src/runtime/mixin.d.ts
|
|
2188
2198
|
type Ctor<T = {}> = new (...args: any[]) => T;
|
|
@@ -2355,4 +2365,4 @@ declare const insertVdomAnnotations: (doc: Document, staticComponents: string[])
|
|
|
2355
2365
|
*/
|
|
2356
2366
|
declare const renderVdom: (hostRef: HostRef, renderFnResults: VNode | VNode[], isInitialLoad?: boolean) => void;
|
|
2357
2367
|
//#endregion
|
|
2358
|
-
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
|
|
2368
|
+
export { AttachInternals, AttrDeserialize, BUILD, Build, Component, Element$1 as Element, Env, Event, Fragment, H, H as HTMLElement, type HTMLStencilElement, HYDRATED_STYLE_ID, Host, type JSXBase, Listen, Method, Mixin, NAMESPACE, Prop, PropSerialize, STENCIL_DEV_MODE, State, Watch, addHostEventListeners, bootstrapLazy, cmpModules, connectedCallback, consoleDevError, consoleDevInfo, consoleDevWarn, consoleError, createEvent, defineCustomElement, disconnectedCallback, forceModeUpdate, forceUpdate, getAssetPath, getElement, getHostRef, getMode, getRenderingRef, getShadowRoot, getValue, h, insertVdomAnnotations, isMemberInElement, jsx, jsxs, loadModule, modeResolutionChain, needsScopedSSR, nextTick, parsePropertyValue, plt, postUpdateComponent, promiseResolve, proxyComponent, proxyCustomElement, readTask, registerHost, registerInstance, render, renderVdom, resolveVar, setAssetPath, setErrorHandler, setMode, setNonce, setPlatformHelpers, setPlatformOptions, setScopedSSR, setTagTransformer, setValue, styles, supportsConstructableStylesheets, supportsListenerOptions, supportsMutableAdoptedStyleSheets, supportsShadow, transformTag, win, writeTask };
|