@arcgis/lumina-compiler 5.0.0-next.70 → 5.0.0-next.72
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/index.js +683 -667
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { externalizeDependencies as as, path as u, toSystemPathSeparators as de, retrievePackageJson as R, fetchPackageLocation as
|
|
1
|
+
import { externalizeDependencies as as, path as u, toSystemPathSeparators as de, retrievePackageJson as R, fetchPackageLocation as ki, asyncRetrievePackageJson as Ai, existsAsync as U, findPath as cs, toPosixPathSeparators as De, isPosix as Ni, getCwd as Li } from "@arcgis/components-build-utils";
|
|
2
2
|
import ls from "vite-plugin-dts";
|
|
3
3
|
import o from "typescript";
|
|
4
4
|
import { f as E, l as T } from "./logger-hJvg0JOj.js";
|
|
5
|
-
import { getMemberName as Y, nodeDocToSynthesizedComment as X, apiMemberToNodeDoc as Q, unsafeGetUndocumentedPrinter as
|
|
5
|
+
import { getMemberName as Y, nodeDocToSynthesizedComment as X, apiMemberToNodeDoc as Q, unsafeGetUndocumentedPrinter as Fi, unsafeUndocumentedTs as Re, findReferenceRanges as ds, globalPackageIdentifier as ji, getBasename as ps, setDefaultFromInitializer as ut, setApiDocFromSymbol as Ct, apiExtractorError as Z, extractBooleanInitializer as re, ApiExtractor as ms, compareNamedNodes as tt, hasIgnoredModifier as us, symbolToDocs as Bt, setApiDocFromJsDoc as _t, multipleJsDocTags as fs, findDecorator as Wt, postProcessLinks as M, isApiMethod as gs, isApiProperty as ys } from "@arcgis/api-extractor";
|
|
6
6
|
import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
|
|
7
|
-
import { camelToKebab as $t, kebabToPascal as
|
|
8
|
-
import { lazyMetaSubItemJoiner as
|
|
9
|
-
import { readdir as Ge, readFile as B, rm as
|
|
7
|
+
import { camelToKebab as $t, kebabToPascal as hs, uncapitalize as ft, getPreamble as vs, capitalize as bs } from "@arcgis/toolkit/string";
|
|
8
|
+
import { lazyMetaSubItemJoiner as Ss, lazyMetaItemJoiner as it, lazyMetaGroupJoiner as ws, propertyFlagAttribute as Ht, propertyFlagReflect as Ts, propertyFlagBoolean as Es, propertyFlagNumber as Cs, propertyFlagState as $s, propertyFlagReadOnly as Ps, propertyFlagNoAccessor as xs } from "@arcgis/lumina/config";
|
|
9
|
+
import { readdir as Ge, readFile as B, rm as Is, mkdir as ee, cp as ks, writeFile as F, copyFile as As } from "node:fs/promises";
|
|
10
10
|
import { mappedFind as ve } from "@arcgis/toolkit/array";
|
|
11
|
-
import { build as
|
|
12
|
-
import { identity as
|
|
13
|
-
import { Deferred as
|
|
14
|
-
import { glob as
|
|
15
|
-
import
|
|
16
|
-
import { writeFileSync as
|
|
17
|
-
import
|
|
18
|
-
import { readFile as
|
|
19
|
-
function
|
|
11
|
+
import { build as Ns } from "esbuild";
|
|
12
|
+
import { identity as Di } from "@arcgis/toolkit/function";
|
|
13
|
+
import { Deferred as Ri } from "@arcgis/toolkit/promise";
|
|
14
|
+
import { glob as Ls } from "glob";
|
|
15
|
+
import Fs from "mime-types";
|
|
16
|
+
import { writeFileSync as Oi } from "node:fs";
|
|
17
|
+
import js from "chalk";
|
|
18
|
+
import { readFile as Ds } from "fs/promises";
|
|
19
|
+
function Rs(e) {
|
|
20
20
|
const t = e.options?.build?.dependencies ?? {}, i = as({
|
|
21
21
|
bundleIn: t.bundleIn,
|
|
22
22
|
externalize: [
|
|
@@ -33,8 +33,8 @@ function Ds(e) {
|
|
|
33
33
|
e.isInStorybook && (i.resolveId = void 0);
|
|
34
34
|
}, i;
|
|
35
35
|
}
|
|
36
|
-
const Pt = "customElement.js",
|
|
37
|
-
function
|
|
36
|
+
const Pt = "customElement.js", Mi = "customElement.d.ts";
|
|
37
|
+
function Os(e, t, i) {
|
|
38
38
|
const s = i.split(u.sep).slice(2);
|
|
39
39
|
let r = t._componentPathMapping;
|
|
40
40
|
return s.forEach((a, c) => {
|
|
@@ -44,10 +44,10 @@ function Rs(e, t, i) {
|
|
|
44
44
|
function be(e, t, i) {
|
|
45
45
|
if (!e.startsWith(t))
|
|
46
46
|
return e;
|
|
47
|
-
const n = e.slice(t.length), s =
|
|
47
|
+
const n = e.slice(t.length), s = Ms(n, i);
|
|
48
48
|
return `${t}${s}`;
|
|
49
49
|
}
|
|
50
|
-
function
|
|
50
|
+
function Ms(e, t) {
|
|
51
51
|
const i = e.split(u.sep);
|
|
52
52
|
i.push(".");
|
|
53
53
|
let n = t._componentPathMapping, s = 0;
|
|
@@ -59,36 +59,36 @@ function Os(e, t) {
|
|
|
59
59
|
n = n[r], s += 1;
|
|
60
60
|
return e;
|
|
61
61
|
}
|
|
62
|
-
const
|
|
62
|
+
const Js = ({ filePath: e, content: t }, i) => {
|
|
63
63
|
const n = e.startsWith(i.dir.distComponents) ? be(
|
|
64
|
-
|
|
64
|
+
Ji(i.dir.distComponents, e),
|
|
65
65
|
i.dir.distComponents,
|
|
66
66
|
i
|
|
67
|
-
) : e, s = u.dirname(e), r = n.endsWith(
|
|
67
|
+
) : e, s = u.dirname(e), r = n.endsWith(Mi), a = Ki(
|
|
68
68
|
t,
|
|
69
69
|
i,
|
|
70
70
|
e === n ? s : u.dirname(n),
|
|
71
71
|
s
|
|
72
|
-
), c = r ?
|
|
72
|
+
), c = r ? Ws(a) : a;
|
|
73
73
|
return {
|
|
74
74
|
filePath: n,
|
|
75
75
|
content: c
|
|
76
76
|
};
|
|
77
77
|
};
|
|
78
|
-
function
|
|
78
|
+
function Ji(e, t, i = ".d.ts") {
|
|
79
79
|
if (!t.startsWith(e))
|
|
80
80
|
return t;
|
|
81
81
|
const s = (i === "" ? t : t.slice(0, -i.length)).split(u.sep);
|
|
82
|
-
return s.at(
|
|
82
|
+
return s.at(Ks) !== s.at(Bs) ? t : u.join(
|
|
83
83
|
s.slice(0, -1).join(u.sep),
|
|
84
|
-
i === "" ? Pt :
|
|
84
|
+
i === "" ? Pt : Mi
|
|
85
85
|
);
|
|
86
86
|
}
|
|
87
|
-
const
|
|
87
|
+
const Ks = -1, Bs = -2, _s = /["']\.\.?\/[^'"]+/gu, Ki = (e, t, i, n) => e.replaceAll(_s, (s) => {
|
|
88
88
|
const r = s.slice(1);
|
|
89
89
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
90
90
|
return s;
|
|
91
|
-
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
91
|
+
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Ji(t.dir.distComponents, a, "") : a, d = be(c, t.dir.distComponents, t);
|
|
92
92
|
if (i === n && a === d)
|
|
93
93
|
return s;
|
|
94
94
|
const l = Ce(i, d), p = s.endsWith("/") ? `${l}/` : l;
|
|
@@ -97,15 +97,15 @@ const Js = -1, Ks = -2, Bs = /["']\.\.?\/[^'"]+/gu, Bi = (e, t, i, n) => e.repla
|
|
|
97
97
|
const i = u.relative(e, t);
|
|
98
98
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
99
99
|
};
|
|
100
|
-
function
|
|
100
|
+
function Ws(e) {
|
|
101
101
|
return `/// <reference path="../../index.d.ts" />
|
|
102
102
|
${e}`;
|
|
103
103
|
}
|
|
104
|
-
const Ut = "customElement",
|
|
104
|
+
const Ut = "customElement", Hs = (e, t) => {
|
|
105
105
|
const { filePath: i, content: n } = e;
|
|
106
106
|
if (!i.startsWith(t.dir.distComponents))
|
|
107
107
|
return e;
|
|
108
|
-
const s =
|
|
108
|
+
const s = _i(n);
|
|
109
109
|
if (s === void 0)
|
|
110
110
|
return e;
|
|
111
111
|
{
|
|
@@ -115,7 +115,7 @@ const Ut = "customElement", Ws = (e, t) => {
|
|
|
115
115
|
content: r
|
|
116
116
|
};
|
|
117
117
|
}
|
|
118
|
-
},
|
|
118
|
+
}, Us = (e, t) => {
|
|
119
119
|
const i = [];
|
|
120
120
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
121
121
|
"customElement" in r && i.push(
|
|
@@ -144,12 +144,12 @@ const Ut = "customElement", Ws = (e, t) => {
|
|
|
144
144
|
o.factory.createStringLiteral(n)
|
|
145
145
|
), ...e.statements, ...i];
|
|
146
146
|
};
|
|
147
|
-
function
|
|
148
|
-
const t =
|
|
147
|
+
function Bi(e) {
|
|
148
|
+
const t = _i(e);
|
|
149
149
|
return t === void 0 ? void 0 : t.split(`
|
|
150
150
|
`).filter((n) => n.includes(":")).map((n) => n.replace(";", "").replaceAll('"', "").replaceAll("'", "").split(":")).map(([n, s]) => [n.trim(), s.trim()]).filter(([n]) => !n.startsWith("/") && !n.startsWith("*"))[0];
|
|
151
151
|
}
|
|
152
|
-
function
|
|
152
|
+
function _i(e) {
|
|
153
153
|
const t = e.indexOf("declare global {");
|
|
154
154
|
if (t === -1)
|
|
155
155
|
return;
|
|
@@ -157,39 +157,39 @@ function Wi(e) {
|
|
|
157
157
|
}`, t) + 2;
|
|
158
158
|
return e.slice(t, i);
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const zs = (e) => (t, i) => (
|
|
161
161
|
/*
|
|
162
162
|
* `declarationTextTransformers` arrays can be mutated between plugin
|
|
163
163
|
* initialization and beforeWriteFile() call, so do not read the value
|
|
164
164
|
* of declarationTextTransformers outside of beforeWriteFile
|
|
165
165
|
*/
|
|
166
166
|
[
|
|
167
|
-
zs,
|
|
168
|
-
Vs,
|
|
169
|
-
Gs,
|
|
170
167
|
qs,
|
|
171
|
-
|
|
168
|
+
Gs,
|
|
172
169
|
Xs,
|
|
170
|
+
Vs,
|
|
171
|
+
Js,
|
|
173
172
|
Qs,
|
|
174
|
-
Ws,
|
|
175
173
|
Zs,
|
|
174
|
+
Hs,
|
|
175
|
+
Ys,
|
|
176
176
|
...e.options.types?.declarationTextTransformers ?? [],
|
|
177
177
|
...e._declarationTextTransformers
|
|
178
178
|
].reduce(
|
|
179
179
|
(n, s) => n === !1 ? !1 : s(n, e),
|
|
180
180
|
{ filePath: t, content: i }
|
|
181
181
|
)
|
|
182
|
-
),
|
|
182
|
+
), qs = (e, t) => t.isInStorybook ? !1 : e, Vs = (e, t) => (
|
|
183
183
|
// Short-circuit quickly if file doesn't look like the one we want to exclude
|
|
184
184
|
e.filePath.endsWith(zt) && e.filePath === u.join(t.dir.dist, zt) ? !1 : e
|
|
185
|
-
), zt = "lumina.d.ts",
|
|
185
|
+
), zt = "lumina.d.ts", Gs = (e, t) => {
|
|
186
186
|
const i = t.dir.dist, n = `${i}src/`;
|
|
187
187
|
return e.filePath.startsWith(n) ? { ...e, filePath: `${i}${e.filePath.slice(n.length)}` } : !1;
|
|
188
|
-
},
|
|
188
|
+
}, Wi = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."), Xs = (e) => Wi(e.filePath) || e.filePath.includes(".stories.") || e.filePath.includes(".story.") ? !1 : e, Qs = (e) => e.content.includes("__esri.") ? {
|
|
189
189
|
filePath: e.filePath,
|
|
190
190
|
content: `/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
191
191
|
${e.content}`
|
|
192
|
-
} : e,
|
|
192
|
+
} : e, Zs = (e, t) => {
|
|
193
193
|
t._htmlElementReferencesReplacer ??= {
|
|
194
194
|
regex: new RegExp(
|
|
195
195
|
`(${t.apiJsonComponents.map((n) => n.name).join("|")})\\[['"\`]el['"\`]\\]`,
|
|
@@ -204,8 +204,8 @@ ${e.content}`
|
|
|
204
204
|
filePath: e.filePath,
|
|
205
205
|
content: e.content.replace(i.regex, (n, s) => i.replacements[s])
|
|
206
206
|
};
|
|
207
|
-
},
|
|
208
|
-
const t = e.content.match(
|
|
207
|
+
}, Ys = (e) => {
|
|
208
|
+
const t = e.content.match(er)?.[1] ?? e.content.match(tr)?.[1];
|
|
209
209
|
if (t !== void 0)
|
|
210
210
|
throw Error(
|
|
211
211
|
E(
|
|
@@ -220,22 +220,22 @@ ${e.content}
|
|
|
220
220
|
)
|
|
221
221
|
);
|
|
222
222
|
return e;
|
|
223
|
-
},
|
|
224
|
-
function
|
|
223
|
+
}, er = /^import (?:type \* as )?[^"'\n]+["'](\.[^\n]*?\.json)["'];$/mu, tr = /(?<![.\w\d-])import\(['"]([\w@\-/\\.]+)\.json['"]\)/u;
|
|
224
|
+
function ir(e, t) {
|
|
225
225
|
const i = Y(t.name);
|
|
226
226
|
return e.members.find((n) => n.name === i);
|
|
227
227
|
}
|
|
228
|
-
function
|
|
228
|
+
function nr(e, t, i) {
|
|
229
229
|
const n = u.relative(t, e);
|
|
230
230
|
return i.modules.find((s) => s.sourcePath === n);
|
|
231
231
|
}
|
|
232
|
-
function
|
|
232
|
+
function Hi(e) {
|
|
233
233
|
return e.return.type.text.startsWith("Promise<");
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function Ui(e, t, i, n) {
|
|
236
236
|
const s = {
|
|
237
237
|
compiler: e,
|
|
238
|
-
apiModule: e.apiJsonEnabled ?
|
|
238
|
+
apiModule: e.apiJsonEnabled ? nr(i.fileName, e.dir.root, e.privateApiJson) : void 0,
|
|
239
239
|
transformation: t
|
|
240
240
|
}, r = i.statements;
|
|
241
241
|
let a = i.statements;
|
|
@@ -246,9 +246,9 @@ function zi(e, t, i, n) {
|
|
|
246
246
|
a = c(i, s);
|
|
247
247
|
}), Object.defineProperty(i, "statements", {
|
|
248
248
|
value: r
|
|
249
|
-
}),
|
|
249
|
+
}), sr(i, a);
|
|
250
250
|
}
|
|
251
|
-
const
|
|
251
|
+
const sr = (e, t) => o.factory.updateSourceFile(
|
|
252
252
|
e,
|
|
253
253
|
t,
|
|
254
254
|
/*
|
|
@@ -266,11 +266,11 @@ const nr = (e, t) => o.factory.updateSourceFile(
|
|
|
266
266
|
function Ke(e, t) {
|
|
267
267
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
268
268
|
}
|
|
269
|
-
const
|
|
270
|
-
function
|
|
271
|
-
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text ===
|
|
269
|
+
const rr = (e) => e.statements.map(lr), or = "@arcgis/lumina", ar = "LitElement", cr = "PublicLitElement", zi = "TargetedEvent";
|
|
270
|
+
function lr(e) {
|
|
271
|
+
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text === or && e.importClause?.namedBindings && o.isNamedImports(e.importClause.namedBindings)) {
|
|
272
272
|
const t = e.importClause.namedBindings.elements.findIndex(
|
|
273
|
-
(n) => (n.propertyName ?? n.name).text ===
|
|
273
|
+
(n) => (n.propertyName ?? n.name).text === ar
|
|
274
274
|
);
|
|
275
275
|
if (t === -1)
|
|
276
276
|
return e;
|
|
@@ -287,14 +287,14 @@ function cr(e) {
|
|
|
287
287
|
o.factory.updateImportSpecifier(
|
|
288
288
|
i,
|
|
289
289
|
i.isTypeOnly,
|
|
290
|
-
o.factory.createIdentifier(
|
|
290
|
+
o.factory.createIdentifier(cr),
|
|
291
291
|
i.name
|
|
292
292
|
),
|
|
293
293
|
...e.importClause.namedBindings.elements.slice(t + 1),
|
|
294
294
|
o.factory.createImportSpecifier(
|
|
295
295
|
!e.importClause.isTypeOnly,
|
|
296
296
|
void 0,
|
|
297
|
-
o.factory.createIdentifier(
|
|
297
|
+
o.factory.createIdentifier(zi)
|
|
298
298
|
)
|
|
299
299
|
])
|
|
300
300
|
),
|
|
@@ -304,15 +304,15 @@ function cr(e) {
|
|
|
304
304
|
} else
|
|
305
305
|
return e;
|
|
306
306
|
}
|
|
307
|
-
const
|
|
308
|
-
function
|
|
307
|
+
const qi = "_setterTypes";
|
|
308
|
+
function dr(e, t, i) {
|
|
309
309
|
return o.factory.createPropertyDeclaration(
|
|
310
310
|
[o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword)],
|
|
311
|
-
o.factory.createIdentifier(
|
|
311
|
+
o.factory.createIdentifier(qi),
|
|
312
312
|
void 0,
|
|
313
313
|
o.factory.createTypeLiteralNode(
|
|
314
314
|
e.map((n) => {
|
|
315
|
-
const [s, r] =
|
|
315
|
+
const [s, r] = pr(n.name, n.type, i._typeScriptPrinter, t);
|
|
316
316
|
return o.factory.createPropertySignature(
|
|
317
317
|
void 0,
|
|
318
318
|
s,
|
|
@@ -324,7 +324,7 @@ function lr(e, t, i) {
|
|
|
324
324
|
void 0
|
|
325
325
|
);
|
|
326
326
|
}
|
|
327
|
-
function
|
|
327
|
+
function pr(e, t, i, n) {
|
|
328
328
|
const s = i.printNode(o.EmitHint.Unspecified, e, n), r = i.printNode(o.EmitHint.Unspecified, t, n), a = `declare class A { ${s}: ${r} }`, l = o.createSourceFile(
|
|
329
329
|
"a.d.ts",
|
|
330
330
|
a,
|
|
@@ -334,8 +334,8 @@ function dr(e, t, i, n) {
|
|
|
334
334
|
).statements[0].members[0];
|
|
335
335
|
return [l.name, l.type];
|
|
336
336
|
}
|
|
337
|
-
const
|
|
338
|
-
function
|
|
337
|
+
const mr = (e, t) => t.apiModule === void 0 ? e.statements : e.statements.map((i) => ur(i, e, t));
|
|
338
|
+
function ur(e, t, i) {
|
|
339
339
|
if (o.isClassDeclaration(e)) {
|
|
340
340
|
const n = e, s = n.name?.text, r = i.apiModule.declarations.find(
|
|
341
341
|
(g) => g.name === s && "customElement" in g
|
|
@@ -345,13 +345,13 @@ function mr(e, t, i) {
|
|
|
345
345
|
const a = [], c = /* @__PURE__ */ new Set(), d = [], l = [];
|
|
346
346
|
gt = void 0;
|
|
347
347
|
for (let g = 0; g < n.members.length; g++) {
|
|
348
|
-
const y = n.members[g], h =
|
|
348
|
+
const y = n.members[g], h = gr(y, r, d, c, t);
|
|
349
349
|
h === void 0 ? a.push(y) : Array.isArray(h) ? l.push(...h) : (Ke(h, i), l.push(h));
|
|
350
350
|
}
|
|
351
351
|
c.size > 0 && a.forEach((g) => {
|
|
352
352
|
const y = Y(g.name);
|
|
353
|
-
(y !== void 0 && c.has(y) ||
|
|
354
|
-
}), d.length > 0 && l.push(
|
|
353
|
+
(y !== void 0 && c.has(y) || fr(g)) && l.push(hr(g, i));
|
|
354
|
+
}), d.length > 0 && l.push(dr(d, t, i.compiler));
|
|
355
355
|
const p = o.factory.updateClassDeclaration(
|
|
356
356
|
n,
|
|
357
357
|
n.modifiers,
|
|
@@ -381,13 +381,13 @@ function mr(e, t, i) {
|
|
|
381
381
|
} else
|
|
382
382
|
return e;
|
|
383
383
|
}
|
|
384
|
-
function
|
|
384
|
+
function fr(e) {
|
|
385
385
|
return o.isPropertyDeclaration(e) && e.type !== void 0 && o.isIntersectionTypeNode(e.type) && e.type.types.some(
|
|
386
386
|
(t) => o.isImportTypeNode(t) && t.qualifier !== void 0 && o.isIdentifier(t.qualifier) && t.qualifier.escapedText === "T9nMeta"
|
|
387
387
|
);
|
|
388
388
|
}
|
|
389
389
|
let gt;
|
|
390
|
-
function
|
|
390
|
+
function gr(e, t, i, n, s) {
|
|
391
391
|
const r = Y(e.name);
|
|
392
392
|
if (r === void 0)
|
|
393
393
|
return;
|
|
@@ -405,7 +405,7 @@ function fr(e, t, i, n, s) {
|
|
|
405
405
|
Gt(e.modifiers),
|
|
406
406
|
e.name,
|
|
407
407
|
void 0,
|
|
408
|
-
|
|
408
|
+
vr(e.type, s),
|
|
409
409
|
e.initializer
|
|
410
410
|
);
|
|
411
411
|
return o.setSyntheticLeadingComments(l, X(Q(d))), l;
|
|
@@ -484,13 +484,13 @@ function fr(e, t, i, n, s) {
|
|
|
484
484
|
}
|
|
485
485
|
const qt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
486
486
|
function Vt(e, t, i) {
|
|
487
|
-
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(
|
|
487
|
+
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(yr) ?? [];
|
|
488
488
|
for (const r of s)
|
|
489
489
|
e.add(r);
|
|
490
490
|
return t;
|
|
491
491
|
}
|
|
492
|
-
const
|
|
493
|
-
function
|
|
492
|
+
const yr = /(?<=this.)[\w$]+/gu;
|
|
493
|
+
function hr(e, t) {
|
|
494
494
|
if (Ke(e, t), o.isPropertyDeclaration(e)) {
|
|
495
495
|
const i = Ne(e.modifiers);
|
|
496
496
|
if (i !== e.modifiers)
|
|
@@ -545,11 +545,11 @@ function Ne(e) {
|
|
|
545
545
|
)
|
|
546
546
|
];
|
|
547
547
|
}
|
|
548
|
-
function
|
|
548
|
+
function vr(e, t) {
|
|
549
549
|
if (e === void 0)
|
|
550
550
|
return;
|
|
551
551
|
const i = o.isImportTypeNode(e) && e.qualifier && o.isIdentifier(e.qualifier) && e.qualifier.escapedText === "EventEmitter" ? e.typeArguments ?? [] : o.isTypeReferenceNode(e) && o.isIdentifier(e.typeName) && e.typeName.escapedText === "EventEmitter" ? e.typeArguments ?? [] : void 0;
|
|
552
|
-
return typeof i == "object" ? o.factory.createTypeReferenceNode(
|
|
552
|
+
return typeof i == "object" ? o.factory.createTypeReferenceNode(zi, [
|
|
553
553
|
o.factory.createThisTypeNode(),
|
|
554
554
|
...i
|
|
555
555
|
]) : (T.warn(
|
|
@@ -558,10 +558,10 @@ function hr(e, t) {
|
|
|
558
558
|
t.fileName
|
|
559
559
|
), e);
|
|
560
560
|
}
|
|
561
|
-
const
|
|
562
|
-
function
|
|
561
|
+
const br = [rr, mr], Xt = "@arcgis/lumina:componentDtsTransformer";
|
|
562
|
+
function Sr(e) {
|
|
563
563
|
let t;
|
|
564
|
-
const i =
|
|
564
|
+
const i = wr(e);
|
|
565
565
|
return {
|
|
566
566
|
name: Xt,
|
|
567
567
|
supports(n) {
|
|
@@ -589,22 +589,22 @@ function br(e) {
|
|
|
589
589
|
}
|
|
590
590
|
};
|
|
591
591
|
}
|
|
592
|
-
const
|
|
593
|
-
...
|
|
592
|
+
const wr = (e) => (t) => (i) => Ui(e, t, i, [
|
|
593
|
+
...br,
|
|
594
594
|
...e.options.types?.declarationAstTransformers ?? []
|
|
595
|
-
]),
|
|
596
|
-
get:
|
|
597
|
-
set:
|
|
595
|
+
]), Tr = (e) => new Proxy(e, {
|
|
596
|
+
get: Er,
|
|
597
|
+
set: Cr
|
|
598
598
|
});
|
|
599
|
-
function
|
|
599
|
+
function Er(e, t, i) {
|
|
600
600
|
if (t in e)
|
|
601
601
|
return Reflect.get(e, t, i);
|
|
602
602
|
throw new Error(`Requested unexpected property ${String(t)}`);
|
|
603
603
|
}
|
|
604
|
-
function
|
|
604
|
+
function Cr(e, t) {
|
|
605
605
|
throw new Error(`Unexpectedly tried to set the ${String(t)} property.`);
|
|
606
606
|
}
|
|
607
|
-
function
|
|
607
|
+
function $r(e) {
|
|
608
608
|
const t = e.options.types ?? {};
|
|
609
609
|
let i = !1;
|
|
610
610
|
const n = {
|
|
@@ -625,7 +625,7 @@ function Cr(e) {
|
|
|
625
625
|
}
|
|
626
626
|
return t?.afterDiagnostic?.(r);
|
|
627
627
|
},
|
|
628
|
-
beforeWriteFile:
|
|
628
|
+
beforeWriteFile: zs(e),
|
|
629
629
|
resolvers: [
|
|
630
630
|
/**
|
|
631
631
|
* The vite-plugin-dts does not provide a way to get a reference to the
|
|
@@ -649,7 +649,7 @@ function Cr(e) {
|
|
|
649
649
|
}
|
|
650
650
|
},
|
|
651
651
|
...t?.resolvers ?? [],
|
|
652
|
-
|
|
652
|
+
Sr(e)
|
|
653
653
|
]
|
|
654
654
|
});
|
|
655
655
|
return {
|
|
@@ -670,7 +670,7 @@ function Cr(e) {
|
|
|
670
670
|
if (typeof c != "function")
|
|
671
671
|
throw new Error("Expected transform to be a function");
|
|
672
672
|
if (await a.call(this, r), i = !1, await c.call(
|
|
673
|
-
|
|
673
|
+
Tr({}),
|
|
674
674
|
"",
|
|
675
675
|
/*
|
|
676
676
|
* Have to give it a file that will be matched by the tsconfig's
|
|
@@ -686,7 +686,7 @@ function Cr(e) {
|
|
|
686
686
|
}
|
|
687
687
|
};
|
|
688
688
|
}
|
|
689
|
-
const
|
|
689
|
+
const Pr = "Fragment", nt = "DynamicHtmlTag", st = "DynamicSvgTag", Be = Symbol("dynamic html tag name"), yt = Symbol("dynamic svg tag name"), Vi = /* @__PURE__ */ new Set([
|
|
690
690
|
/**
|
|
691
691
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
692
692
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -716,7 +716,7 @@ const $r = "Fragment", nt = "DynamicHtmlTag", st = "DynamicSvgTag", Be = Symbol(
|
|
|
716
716
|
"resource",
|
|
717
717
|
"typeof",
|
|
718
718
|
"vocab"
|
|
719
|
-
]),
|
|
719
|
+
]), Gi = /* @__PURE__ */ new Set([
|
|
720
720
|
/*
|
|
721
721
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
722
722
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -1556,9 +1556,9 @@ const $r = "Fragment", nt = "DynamicHtmlTag", st = "DynamicSvgTag", Be = Symbol(
|
|
|
1556
1556
|
}
|
|
1557
1557
|
}
|
|
1558
1558
|
};
|
|
1559
|
-
|
|
1560
|
-
Object.values(z.perElement).forEach(
|
|
1561
|
-
function
|
|
1559
|
+
Xi(z.common);
|
|
1560
|
+
Object.values(z.perElement).forEach(Xi);
|
|
1561
|
+
function Xi(e) {
|
|
1562
1562
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
1563
1563
|
/* @__PURE__ */ Object.create(null),
|
|
1564
1564
|
e.stringifiedReflected
|
|
@@ -1567,7 +1567,7 @@ function Qi(e) {
|
|
|
1567
1567
|
e.stringifiedNonReflected
|
|
1568
1568
|
));
|
|
1569
1569
|
}
|
|
1570
|
-
const Qt = /* @__PURE__ */ new Set(["itemScope"]),
|
|
1570
|
+
const Qt = /* @__PURE__ */ new Set(["itemScope"]), Qi = /* @__PURE__ */ new Set([
|
|
1571
1571
|
"abort",
|
|
1572
1572
|
"animationCancel",
|
|
1573
1573
|
"animationEnd",
|
|
@@ -1666,7 +1666,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), Zi = /* @__PURE__ */ new Set(
|
|
|
1666
1666
|
"volumeChange",
|
|
1667
1667
|
"waiting",
|
|
1668
1668
|
"wheel"
|
|
1669
|
-
]),
|
|
1669
|
+
]), xr = /* @__PURE__ */ new Set([
|
|
1670
1670
|
"area",
|
|
1671
1671
|
"base",
|
|
1672
1672
|
"br",
|
|
@@ -1742,7 +1742,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), Zi = /* @__PURE__ */ new Set(
|
|
|
1742
1742
|
"tspan",
|
|
1743
1743
|
"use",
|
|
1744
1744
|
"view"
|
|
1745
|
-
]),
|
|
1745
|
+
]), Ir = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), It = /* @__PURE__ */ new Set([
|
|
1746
1746
|
"annotation-xml",
|
|
1747
1747
|
"annotation",
|
|
1748
1748
|
"maction",
|
|
@@ -1774,7 +1774,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), Zi = /* @__PURE__ */ new Set(
|
|
|
1774
1774
|
"munder",
|
|
1775
1775
|
"munderover",
|
|
1776
1776
|
"semantics"
|
|
1777
|
-
]),
|
|
1777
|
+
]), kr = /* @__PURE__ */ new Set([
|
|
1778
1778
|
"annotation-xml",
|
|
1779
1779
|
"color-profile",
|
|
1780
1780
|
"font-face",
|
|
@@ -1784,7 +1784,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), Zi = /* @__PURE__ */ new Set(
|
|
|
1784
1784
|
"font-face-name",
|
|
1785
1785
|
"missing-glyph"
|
|
1786
1786
|
]);
|
|
1787
|
-
function
|
|
1787
|
+
function Ar(e) {
|
|
1788
1788
|
if (e.length === 0)
|
|
1789
1789
|
return "";
|
|
1790
1790
|
const t = e[0];
|
|
@@ -1797,20 +1797,20 @@ function kr(e) {
|
|
|
1797
1797
|
}
|
|
1798
1798
|
return e.trim().length === 0 ? t : e;
|
|
1799
1799
|
}
|
|
1800
|
-
const
|
|
1800
|
+
const Nr = (e) => e.replaceAll("\\", "\\\\").replace(Lr, "\\${").replaceAll("`", "\\`"), Lr = /\$\{/gu, Fr = (e) => !jr.test(e), jr = /^[^\s"'=<>`]+$/u, Dr = /[&<>]/gu, Rr = {
|
|
1801
1801
|
"&": "&",
|
|
1802
1802
|
"<": "<",
|
|
1803
1803
|
">": ">"
|
|
1804
|
-
},
|
|
1805
|
-
function
|
|
1804
|
+
}, Zi = (e) => e.replace(Dr, (t) => Rr[t]), kt = (e) => typeof e == "string" && e.includes("-") && !kr.has(e);
|
|
1805
|
+
function Or(e) {
|
|
1806
1806
|
const t = [];
|
|
1807
|
-
for (const i of e.matchAll(
|
|
1808
|
-
const n = i.groups.name, s = i.groups.description.replaceAll(
|
|
1807
|
+
for (const i of e.matchAll(Mr)) {
|
|
1808
|
+
const n = i.groups.name, s = i.groups.description.replaceAll(Jr, " ").trim();
|
|
1809
1809
|
t.push({ name: n, description: s.endsWith("*") ? s.slice(0, -1).trim() : s });
|
|
1810
1810
|
}
|
|
1811
1811
|
return t.length === 0 ? void 0 : t;
|
|
1812
1812
|
}
|
|
1813
|
-
const
|
|
1813
|
+
const Mr = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\*? ?/gu, Kr = ["keyed", "ref", "repeat", "live"], pe = "staticHtml", te = "staticSvg", me = "html", ae = "svg", Yi = Symbol("maybe HTML namespace or maybe SVG"), en = "css", tn = "mathml", nn = [en, me, tn, pe, te, ae], Br = new Set(nn), _r = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], Wr = "nothing", Hr = [...Kr, ...nn, ..._r, Wr], Ur = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => Se(t)), Se = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), ce = {
|
|
1814
1814
|
[me]: ["lit", "lit/html.js", "lit-html"],
|
|
1815
1815
|
/**
|
|
1816
1816
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1821,8 +1821,8 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1821
1821
|
[pe]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1822
1822
|
[ae]: ["lit", "lit-html", "lit/html.js"],
|
|
1823
1823
|
[te]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1824
|
-
[
|
|
1825
|
-
[
|
|
1824
|
+
[tn]: ["lit", "lit-html", "lit/html.js"],
|
|
1825
|
+
[en]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
1826
1826
|
safeClassMap: ["@arcgis/lumina"],
|
|
1827
1827
|
safeStyleMap: ["@arcgis/lumina"],
|
|
1828
1828
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -1832,7 +1832,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1832
1832
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1833
1833
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1834
1834
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1835
|
-
},
|
|
1835
|
+
}, zr = /* @__PURE__ */ new Set([
|
|
1836
1836
|
"h",
|
|
1837
1837
|
"Fragment",
|
|
1838
1838
|
"state",
|
|
@@ -1842,7 +1842,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1842
1842
|
"bindProperty",
|
|
1843
1843
|
"bindEvent",
|
|
1844
1844
|
"bindAttribute"
|
|
1845
|
-
]),
|
|
1845
|
+
]), sn = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, fe = "@arcgis/lumina:loadLitCss", _e = "?litCss", ie = "?layeredLitCss", vt = "?globalFileLitCss", qr = (e) => ({
|
|
1846
1846
|
name: fe,
|
|
1847
1847
|
enforce: "pre",
|
|
1848
1848
|
configResolved(t) {
|
|
@@ -1882,7 +1882,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1882
1882
|
if (l && (a = a.slice(0, -vt.length)), !c && !d && !l)
|
|
1883
1883
|
return await n.handler.call(this, r, a);
|
|
1884
1884
|
const p = `${a}?inline`, f = await n.handler.call(this, r, p), { code: m, ...g } = typeof f == "string" ? { code: f } : f ?? {};
|
|
1885
|
-
if (typeof m != "string" || !m.startsWith(
|
|
1885
|
+
if (typeof m != "string" || !m.startsWith(rn) || !m.endsWith(Vr))
|
|
1886
1886
|
return T.warn(
|
|
1887
1887
|
fe,
|
|
1888
1888
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
@@ -1890,9 +1890,9 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1890
1890
|
)}`
|
|
1891
1891
|
), f;
|
|
1892
1892
|
if (l)
|
|
1893
|
-
return e._globalCssString =
|
|
1893
|
+
return e._globalCssString = on(m), { code: "", map: { mappings: "" } };
|
|
1894
1894
|
{
|
|
1895
|
-
const y = e.isFullApiExtraction ?
|
|
1895
|
+
const y = e.isFullApiExtraction ? Or(r) : void 0;
|
|
1896
1896
|
if (y !== void 0) {
|
|
1897
1897
|
e._cssDocs ??= /* @__PURE__ */ new Map(), e._cssDocs.set(a, y);
|
|
1898
1898
|
const h = e._cssImports.get(a);
|
|
@@ -1912,7 +1912,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1912
1912
|
}
|
|
1913
1913
|
return {
|
|
1914
1914
|
...g,
|
|
1915
|
-
code:
|
|
1915
|
+
code: Zr(m, e.hmrEnabled, e.shouldMinify, d),
|
|
1916
1916
|
/**
|
|
1917
1917
|
* Vite's original transform does not generate source maps for inlined
|
|
1918
1918
|
* css, thus we can't either
|
|
@@ -1923,8 +1923,8 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Mr = /\n\s+\
|
|
|
1923
1923
|
}
|
|
1924
1924
|
};
|
|
1925
1925
|
}
|
|
1926
|
-
}),
|
|
1927
|
-
export const styles = css\``,
|
|
1926
|
+
}), rn = 'export default "', Vr = '"', Gr = `import { css } from '${ce.css[0]}';
|
|
1927
|
+
export const styles = css\``, Xr = "`;\nexport default styles;", Qr = `
|
|
1928
1928
|
|
|
1929
1929
|
if(import.meta.hot) {
|
|
1930
1930
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1935,24 +1935,24 @@ if(import.meta.hot) {
|
|
|
1935
1935
|
}
|
|
1936
1936
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1937
1937
|
});
|
|
1938
|
-
}`,
|
|
1939
|
-
function
|
|
1940
|
-
const s =
|
|
1938
|
+
}`, on = (e) => e.slice(rn.length - 1);
|
|
1939
|
+
function Zr(e, t, i, n) {
|
|
1940
|
+
const s = on(e), r = JSON.parse(s), a = Nr(r), c = n ? `@layer{${i ? "" : `
|
|
1941
1941
|
`}${a}${i ? "" : `
|
|
1942
1942
|
`}}` : a;
|
|
1943
|
-
return `${
|
|
1943
|
+
return `${Gr}${c}${Xr}${t ? Qr : ""}`;
|
|
1944
1944
|
}
|
|
1945
|
-
function
|
|
1946
|
-
return `import("${
|
|
1947
|
-
setCustomElementsManifest(${
|
|
1945
|
+
function Yr(e) {
|
|
1946
|
+
return `import("${eo}").then(({ setCustomElementsManifest }) => {
|
|
1947
|
+
setCustomElementsManifest(${to(e)});
|
|
1948
1948
|
});`;
|
|
1949
1949
|
}
|
|
1950
|
-
const
|
|
1951
|
-
function
|
|
1950
|
+
const eo = "@storybook/web-components", to = (e) => `JSON.parse(\`${io(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1951
|
+
function io(e) {
|
|
1952
1952
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1953
1953
|
}
|
|
1954
|
-
function
|
|
1955
|
-
|
|
1954
|
+
function no(e) {
|
|
1955
|
+
so(e);
|
|
1956
1956
|
const t = e.options.css?.globalStylesPath;
|
|
1957
1957
|
if (t === void 0)
|
|
1958
1958
|
return "";
|
|
@@ -1960,21 +1960,21 @@ function io(e) {
|
|
|
1960
1960
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
1961
1961
|
`import globalStyles from "${i}${ie}";`,
|
|
1962
1962
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1963
|
-
|
|
1963
|
+
cn("", e)
|
|
1964
1964
|
].join(`
|
|
1965
1965
|
`) : `import "${i}${vt}";`;
|
|
1966
1966
|
}
|
|
1967
|
-
const
|
|
1968
|
-
function
|
|
1967
|
+
const an = "hydrated";
|
|
1968
|
+
function so(e) {
|
|
1969
1969
|
e._globalHydratedCssString = [
|
|
1970
1970
|
":not([",
|
|
1971
|
-
e.options.css?.hydratedAttribute ??
|
|
1971
|
+
e.options.css?.hydratedAttribute ?? an,
|
|
1972
1972
|
"]):is(",
|
|
1973
1973
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
1974
1974
|
"){visibility:hidden}"
|
|
1975
1975
|
].join("");
|
|
1976
1976
|
}
|
|
1977
|
-
function
|
|
1977
|
+
function cn(e, t) {
|
|
1978
1978
|
return [
|
|
1979
1979
|
"const globalCss = new CSSStyleSheet;",
|
|
1980
1980
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
|
|
@@ -1982,46 +1982,46 @@ function ln(e, t) {
|
|
|
1982
1982
|
].join(`
|
|
1983
1983
|
`);
|
|
1984
1984
|
}
|
|
1985
|
-
const
|
|
1985
|
+
const ro = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1986
1986
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1987
1987
|
|
|
1988
1988
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1989
1989
|
`}}`;
|
|
1990
|
-
function
|
|
1990
|
+
function oo(e) {
|
|
1991
1991
|
const t = [], i = [];
|
|
1992
1992
|
for (const n of e.privateApiJson.modules) {
|
|
1993
1993
|
t.push(n.sourcePath);
|
|
1994
1994
|
for (const s of n.declarations)
|
|
1995
|
-
"customElement" in s && i.push(
|
|
1995
|
+
"customElement" in s && i.push(co(s, e, n.sourcePath));
|
|
1996
1996
|
}
|
|
1997
1997
|
return [
|
|
1998
1998
|
'import { runtime } from "./runtime.ts";',
|
|
1999
1999
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
2000
|
-
|
|
2001
|
-
e.hmrEnabled ?
|
|
2000
|
+
no(e),
|
|
2001
|
+
e.hmrEnabled ? po : "",
|
|
2002
2002
|
"",
|
|
2003
|
-
e.isInStorybook ?
|
|
2003
|
+
e.isInStorybook ? Yr(e.apiJson) : "",
|
|
2004
2004
|
"",
|
|
2005
2005
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
2006
2006
|
i.join(`,
|
|
2007
2007
|
`),
|
|
2008
2008
|
"});",
|
|
2009
|
-
e.hmrEnabled ?
|
|
2009
|
+
e.hmrEnabled ? mo(t) : ""
|
|
2010
2010
|
].join(`
|
|
2011
2011
|
`);
|
|
2012
2012
|
}
|
|
2013
|
-
const
|
|
2014
|
-
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`,
|
|
2013
|
+
const ao = `import "./index.js";
|
|
2014
|
+
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`, co = (e, t, i) => [
|
|
2015
2015
|
` "${e.tagName}": [`,
|
|
2016
2016
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
2017
|
-
|
|
2017
|
+
lo(e),
|
|
2018
2018
|
"]"
|
|
2019
2019
|
].join("");
|
|
2020
|
-
function
|
|
2021
|
-
const { properties: t, asyncMethods: i, syncMethods: n } =
|
|
2022
|
-
return l.length > 0 ? `"${l.join(
|
|
2020
|
+
function lo(e) {
|
|
2021
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = ln(e), s = t.map((p) => p.join(Ss)).join(it), r = i.join(it), a = n.join(it), c = [s, r, a], d = c.findLastIndex((p) => p.length > 0), l = c.slice(0, d + 1);
|
|
2022
|
+
return l.length > 0 ? `"${l.join(ws)}"` : "";
|
|
2023
2023
|
}
|
|
2024
|
-
function
|
|
2024
|
+
function ln(e) {
|
|
2025
2025
|
const t = [], i = [], n = [];
|
|
2026
2026
|
for (let s = 0; s < e.members.length; s++) {
|
|
2027
2027
|
const r = e.members[s];
|
|
@@ -2030,19 +2030,19 @@ function dn(e) {
|
|
|
2030
2030
|
t.push(
|
|
2031
2031
|
a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""]
|
|
2032
2032
|
);
|
|
2033
|
-
} else r.kind === "method" && r.name !== "componentOnReady" && (
|
|
2033
|
+
} else r.kind === "method" && r.name !== "componentOnReady" && (Hi(r) ? i.push(r.name) : n.push(r.name));
|
|
2034
2034
|
}
|
|
2035
2035
|
return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: n };
|
|
2036
2036
|
}
|
|
2037
|
-
const
|
|
2038
|
-
`,
|
|
2037
|
+
const po = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
2038
|
+
`, mo = (e) => `
|
|
2039
2039
|
if(import.meta.hot) {
|
|
2040
2040
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
2041
2041
|
import.meta.hot.accept([
|
|
2042
2042
|
${e.map((t) => ` "/${t}",`).join(`
|
|
2043
2043
|
`)}
|
|
2044
2044
|
], handleHmrUpdate);
|
|
2045
|
-
}`,
|
|
2045
|
+
}`, dn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", Pt.slice(0, -3))), We = async (e, t, i = t) => await Ge(i, { recursive: !0 }).catch((n) => {
|
|
2046
2046
|
if (String(n).includes("ENOENT"))
|
|
2047
2047
|
return T.error("@arcgis/lumina", `Unable to find the ${i} directory (cwd: ${process.cwd()})`), [];
|
|
2048
2048
|
throw n;
|
|
@@ -2060,25 +2060,25 @@ ${e.map((t) => ` "/${t}",`).join(`
|
|
|
2060
2060
|
function we(e, t) {
|
|
2061
2061
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
2062
2062
|
return !1;
|
|
2063
|
-
const [i, n] = e.slice(0, -4).split(u.sep).slice(
|
|
2063
|
+
const [i, n] = e.slice(0, -4).split(u.sep).slice(uo);
|
|
2064
2064
|
return i === n;
|
|
2065
2065
|
}
|
|
2066
|
-
const
|
|
2066
|
+
const uo = -2;
|
|
2067
2067
|
function Zt(e) {
|
|
2068
2068
|
const t = o.isUnionTypeNode(e) ? e.types.map(Yt) : [Yt(e)], i = new Set(t), n = i.delete("true"), s = i.delete("false");
|
|
2069
2069
|
(n || s) && i.add("boolean");
|
|
2070
2070
|
let r = Array.from(i).sort();
|
|
2071
|
-
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length >
|
|
2072
|
-
return r.map(
|
|
2071
|
+
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length > fo))
|
|
2072
|
+
return r.map(ho);
|
|
2073
2073
|
}
|
|
2074
|
-
const
|
|
2074
|
+
const fo = 40, go = (e) => e?.some(
|
|
2075
2075
|
(t) => t.type === "number" || t.type === "boolean" || t.type === "string" || /**
|
|
2076
2076
|
* Treat "any" as possibly literal, but not "unknown". Matches Stencil
|
|
2077
2077
|
* behavior.
|
|
2078
2078
|
*/
|
|
2079
2079
|
t.type === "any"
|
|
2080
|
-
) ?? !1,
|
|
2081
|
-
function
|
|
2080
|
+
) ?? !1, yo = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e, pn = (e) => e.map(mn).join(" | "), mn = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
|
|
2081
|
+
function ho(e) {
|
|
2082
2082
|
return e === "boolean" ? { type: "boolean" } : Number.isNaN(Number.parseFloat(e)) ? e.startsWith('"') || e.startsWith("'") ? {
|
|
2083
2083
|
value: e.slice(1, -1),
|
|
2084
2084
|
type: "string"
|
|
@@ -2092,7 +2092,7 @@ function yo(e) {
|
|
|
2092
2092
|
function He(e, t, i, n, s = !1) {
|
|
2093
2093
|
let { typeNode: r, references: a } = ti(e, t, i, n), c = Zt(r);
|
|
2094
2094
|
c === void 0 && ({ typeNode: r, references: a } = ti(e, t, i, n, !1), c = Zt(r) ?? []);
|
|
2095
|
-
const d = s ? c.filter((m) => m.type !== "null" && m.type !== "undefined") : c, l =
|
|
2095
|
+
const d = s ? c.filter((m) => m.type !== "null" && m.type !== "undefined") : c, l = pn(d), p = yo(d), f = ds(a, l);
|
|
2096
2096
|
return {
|
|
2097
2097
|
text: l,
|
|
2098
2098
|
references: f,
|
|
@@ -2100,21 +2100,21 @@ function He(e, t, i, n, s = !1) {
|
|
|
2100
2100
|
};
|
|
2101
2101
|
}
|
|
2102
2102
|
function Yt(e) {
|
|
2103
|
-
|
|
2103
|
+
vo.writeNode(o.EmitHint.Unspecified, e, void 0, rt);
|
|
2104
2104
|
const t = rt.getText();
|
|
2105
2105
|
return rt.clear(), t;
|
|
2106
2106
|
}
|
|
2107
|
-
const
|
|
2108
|
-
`),
|
|
2109
|
-
function
|
|
2107
|
+
const vo = Fi({ removeComments: !0 }), rt = Re.createTextWriter(`
|
|
2108
|
+
`), un = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, bo = un & o.TypeFormatFlags.NodeBuilderFlagsMask, So = bo | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
2109
|
+
function wo(e, t, i, n = !0) {
|
|
2110
2110
|
const s = /* @__PURE__ */ new Map();
|
|
2111
2111
|
oe(t, s, i, n);
|
|
2112
2112
|
const r = t.flags & o.TypeFlags.Union ? t.types.every(ei) : ei(t), a = e.typeToTypeNode(
|
|
2113
2113
|
t,
|
|
2114
2114
|
void 0,
|
|
2115
|
-
|
|
2115
|
+
So & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
2116
2116
|
);
|
|
2117
|
-
return s.forEach(
|
|
2117
|
+
return s.forEach(To), a === void 0 ? (T.warn("@arcgis/lumina", "Unexpected case: Failed to convert type to type node."), o.factory.createTypeReferenceNode(o.factory.createIdentifier("unknown"), void 0)) : a;
|
|
2118
2118
|
}
|
|
2119
2119
|
const ei = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
2120
2120
|
function ti(e, t, i, n, s = !0) {
|
|
@@ -2146,10 +2146,10 @@ function ti(e, t, i, n, s = !0) {
|
|
|
2146
2146
|
name: m,
|
|
2147
2147
|
package: void 0,
|
|
2148
2148
|
module: "index.js"
|
|
2149
|
-
} :
|
|
2150
|
-
r.push(g), a.add(
|
|
2149
|
+
} : Eo(f, m, i, n);
|
|
2150
|
+
r.push(g), a.add(g.name);
|
|
2151
2151
|
}
|
|
2152
|
-
return { typeNode:
|
|
2152
|
+
return { typeNode: wo(e, t, c, s), references: r };
|
|
2153
2153
|
}
|
|
2154
2154
|
function oe(e, t, i, n = !0) {
|
|
2155
2155
|
if (typeof e != "object" || e === null || !("checker" in e))
|
|
@@ -2179,11 +2179,11 @@ function oe(e, t, i, n = !0) {
|
|
|
2179
2179
|
c !== "resolvedBaseConstructorType" && c !== "resolvedBaseTypes" && c !== "typeParameters" && c !== "typeParameter" && (Array.isArray(d) ? d.forEach((l) => oe(l, t, i, n)) : oe(d, t, i, n));
|
|
2180
2180
|
});
|
|
2181
2181
|
}
|
|
2182
|
-
function
|
|
2182
|
+
function To(e, t) {
|
|
2183
2183
|
e.origin !== void 0 && (t.origin = e.origin), e.aliasSymbol !== void 0 && (t.aliasSymbol = e.aliasSymbol), e.aliasTypeArguments !== void 0 && (t.aliasTypeArguments = e.aliasTypeArguments);
|
|
2184
2184
|
}
|
|
2185
|
-
function
|
|
2186
|
-
const s = e?.declarations?.map((
|
|
2185
|
+
function Eo(e, t, i, n) {
|
|
2186
|
+
const s = e?.declarations?.map((d) => d.getSourceFile()) ?? [];
|
|
2187
2187
|
if (s.length === 0) {
|
|
2188
2188
|
if (t === "Array")
|
|
2189
2189
|
return {
|
|
@@ -2200,26 +2200,26 @@ function To(e, t, i, n) {
|
|
|
2200
2200
|
if (s.length === 0)
|
|
2201
2201
|
return {
|
|
2202
2202
|
name: t,
|
|
2203
|
-
package:
|
|
2203
|
+
package: ji,
|
|
2204
2204
|
module: void 0
|
|
2205
2205
|
};
|
|
2206
|
-
const { packageName: r, moduleName: a } =
|
|
2207
|
-
return r ? {
|
|
2206
|
+
const { packageName: r, moduleName: a } = Co(s[0].fileName, n), c = e.declarations?.[0];
|
|
2207
|
+
return t === "default" && r === "@arcgis/core" && c !== void 0 && "name" in c && typeof c.name == "object" && c.name !== null && "escapedText" in c.name && typeof c.name.escapedText == "string" && (t = c.name.escapedText), r ? {
|
|
2208
2208
|
name: t,
|
|
2209
2209
|
package: r,
|
|
2210
2210
|
module: a.length > 0 ? a : void 0,
|
|
2211
|
-
viewUrl: r === "@arcgis/core"
|
|
2211
|
+
viewUrl: r === "@arcgis/core" ? Io(e, s[0], a) : r === "typescript" ? gn(e, s[0], "typescript") : void 0
|
|
2212
2212
|
} : {
|
|
2213
2213
|
name: t,
|
|
2214
2214
|
package: void 0,
|
|
2215
2215
|
module: a
|
|
2216
2216
|
};
|
|
2217
2217
|
}
|
|
2218
|
-
function
|
|
2218
|
+
function Co(e, t) {
|
|
2219
2219
|
const i = e.split("/node_modules/");
|
|
2220
2220
|
if (i.length > 1) {
|
|
2221
2221
|
const a = i.at(-1);
|
|
2222
|
-
return
|
|
2222
|
+
return fn(a);
|
|
2223
2223
|
}
|
|
2224
2224
|
const s = e.split("/dist/");
|
|
2225
2225
|
if (s.length > 1) {
|
|
@@ -2228,36 +2228,52 @@ function Eo(e, t) {
|
|
|
2228
2228
|
}
|
|
2229
2229
|
return {
|
|
2230
2230
|
packageName: void 0,
|
|
2231
|
-
moduleName: u.relative(t.root, $o(
|
|
2231
|
+
moduleName: u.relative(t.root, Po($o(e, t)))
|
|
2232
2232
|
};
|
|
2233
2233
|
}
|
|
2234
|
-
function
|
|
2235
|
-
return we(e, t.srcComponents) ? u.join(t.dist,
|
|
2234
|
+
function $o(e, t) {
|
|
2235
|
+
return we(e, t.srcComponents) ? u.join(t.dist, dn(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2236
2236
|
}
|
|
2237
|
-
const
|
|
2238
|
-
function
|
|
2237
|
+
const Po = (e) => e.endsWith(".js") || e.endsWith(".d.ts") ? e : `${e.endsWith(".ts") ? e.slice(0, -3) : e.endsWith(".tsx") ? e.slice(0, -4) : e}.d.ts`;
|
|
2238
|
+
function fn(e) {
|
|
2239
2239
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2240
2240
|
return { packageName: s, moduleName: r };
|
|
2241
2241
|
}
|
|
2242
|
-
const
|
|
2243
|
-
function
|
|
2242
|
+
const xo = (e) => e.includes("/node_modules/") || e.includes("/dist/");
|
|
2243
|
+
function Io(e, t, i) {
|
|
2244
|
+
const n = e.declarations?.[0];
|
|
2245
|
+
if (n !== void 0) {
|
|
2246
|
+
if (i === "interfaces.d.ts")
|
|
2247
|
+
return gn(e, t, "core");
|
|
2248
|
+
{
|
|
2249
|
+
const s = `${ko}${ps(i).replaceAll("/", "-")}.html`;
|
|
2250
|
+
return n.kind === o.SyntaxKind.ClassDeclaration ? s : (
|
|
2251
|
+
// Interface, TypeAlias, Function, Variable, or any other future-added
|
|
2252
|
+
// construct that has a name
|
|
2253
|
+
"name" in n && typeof n.name == "object" && n.name !== null && "escapedText" in n.name && typeof n.name.escapedText == "string" ? `${s}#${encodeURIComponent(n.name.escapedText)}` : void 0
|
|
2254
|
+
);
|
|
2255
|
+
}
|
|
2256
|
+
}
|
|
2257
|
+
}
|
|
2258
|
+
const ko = "https://developers.arcgis.com/javascript/latest/api-reference/esri-";
|
|
2259
|
+
function gn(e, t, i) {
|
|
2244
2260
|
const n = e.declarations;
|
|
2245
2261
|
if (n !== void 0)
|
|
2246
2262
|
for (const s of n) {
|
|
2247
|
-
const r =
|
|
2263
|
+
const r = ii(s, t, i);
|
|
2248
2264
|
if (r !== void 0)
|
|
2249
2265
|
return r;
|
|
2250
2266
|
if (!("members" in s))
|
|
2251
2267
|
continue;
|
|
2252
2268
|
const a = s.members;
|
|
2253
2269
|
for (const c of a) {
|
|
2254
|
-
const d =
|
|
2270
|
+
const d = ii(c, t, i);
|
|
2255
2271
|
if (d !== void 0)
|
|
2256
|
-
return i === "core" && d.includes("#event-") ? d :
|
|
2272
|
+
return i === "core" && d.includes("#event-") ? d : Ao(d);
|
|
2257
2273
|
}
|
|
2258
2274
|
}
|
|
2259
2275
|
}
|
|
2260
|
-
function
|
|
2276
|
+
function ii(e, t, i) {
|
|
2261
2277
|
const n = e.jsDoc?.[0];
|
|
2262
2278
|
if (n !== void 0)
|
|
2263
2279
|
return ve([n, ...n.tags ?? []], ({ comment: s }) => {
|
|
@@ -2277,15 +2293,15 @@ function ni(e, t, i) {
|
|
|
2277
2293
|
});
|
|
2278
2294
|
});
|
|
2279
2295
|
}
|
|
2280
|
-
const
|
|
2281
|
-
function
|
|
2296
|
+
const Ao = (e) => e.split("#")[0], No = "@arcgis/lumina:addMethodMetadata";
|
|
2297
|
+
function Lo(e, t, i, n, s) {
|
|
2282
2298
|
const r = i.getSignatureFromDeclaration(e);
|
|
2283
2299
|
if (r === void 0)
|
|
2284
2300
|
return;
|
|
2285
2301
|
for (const l of e.parameters) {
|
|
2286
2302
|
if (!o.isIdentifier(l.name)) {
|
|
2287
2303
|
T.warn(
|
|
2288
|
-
|
|
2304
|
+
No,
|
|
2289
2305
|
`Object binding patterns are not yet supported in the docs. Found ${l.name?.getText(n)} in ${e.name.getText(n)}`,
|
|
2290
2306
|
n.fileName
|
|
2291
2307
|
);
|
|
@@ -2301,16 +2317,16 @@ function ko(e, t, i, n, s) {
|
|
|
2301
2317
|
ut(l, m, n), t.parameters.push(m);
|
|
2302
2318
|
}
|
|
2303
2319
|
t.parameters.length === 0 && (t.parameters = void 0);
|
|
2304
|
-
const a = i.getReturnTypeOfSignature(r), c = He(i, a, n, s), d = i.signatureToString(r, e,
|
|
2320
|
+
const a = i.getReturnTypeOfSignature(r), c = He(i, a, n, s), d = i.signatureToString(r, e, un, o.SignatureKind.Call);
|
|
2305
2321
|
Ct(e.name, i, t), t.return = {
|
|
2306
2322
|
type: c
|
|
2307
2323
|
}, t.signature = d.replace(" =>", ":");
|
|
2308
2324
|
}
|
|
2309
|
-
const
|
|
2325
|
+
const Fo = (e, t, i, n) => {
|
|
2310
2326
|
const s = e.typeScriptTypeChecker, r = o.isSetAccessor(t) ? t.parameters[0] : t, a = s.getTypeAtLocation(r), c = !i;
|
|
2311
2327
|
return He(s, a, n, e.dir, c);
|
|
2312
2328
|
};
|
|
2313
|
-
function
|
|
2329
|
+
function jo(e, t, i, n) {
|
|
2314
2330
|
const s = i.typeScriptTypeChecker, a = s.getTypeAtLocation(e).getProperty("emit");
|
|
2315
2331
|
if (a?.valueDeclaration === void 0)
|
|
2316
2332
|
return;
|
|
@@ -2335,11 +2351,11 @@ function No(e, t, i, n) {
|
|
|
2335
2351
|
composed: void 0,
|
|
2336
2352
|
privacy: void 0
|
|
2337
2353
|
};
|
|
2338
|
-
return Ct(e.name, s, g),
|
|
2354
|
+
return Ct(e.name, s, g), Do(e, g, n), g.privacy === void 0 ? g : void 0;
|
|
2339
2355
|
}
|
|
2340
2356
|
}
|
|
2341
2357
|
const Le = "createEvent";
|
|
2342
|
-
function
|
|
2358
|
+
function Do(e, t, i) {
|
|
2343
2359
|
if (!e.initializer || !o.isCallExpression(e.initializer))
|
|
2344
2360
|
return;
|
|
2345
2361
|
const n = e.initializer;
|
|
@@ -2371,12 +2387,12 @@ function Lo(e, t, i) {
|
|
|
2371
2387
|
!o.isPropertyAssignment(r) || !o.isIdentifier(r.name) || (r.name.text === "cancelable" && !re(r.initializer, i) && (t.cancelable = !1), r.name.text === "bubbles" && !re(r.initializer, i) && (t.bubbles = !1), r.name.text === "composed" && !re(r.initializer, i) && (t.composed = !1));
|
|
2372
2388
|
}
|
|
2373
2389
|
}
|
|
2374
|
-
const
|
|
2375
|
-
name:
|
|
2390
|
+
const Ro = "@arcgis/lumina-compiler", At = {
|
|
2391
|
+
name: Ro
|
|
2376
2392
|
};
|
|
2377
|
-
class Ue extends
|
|
2393
|
+
class Ue extends ms {
|
|
2378
2394
|
constructor(t, i) {
|
|
2379
|
-
super({ sortModules: t.isFullApiExtraction, cwd: t.dir.root, environment: t.environment }), this.localCssImports = void 0, this.localTagName = void 0, this.localClassName = void 0, this.pairedSetter = void 0, this.apiComponent = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.moduleName = "", this.resolveJsDocLink =
|
|
2395
|
+
super({ sortModules: t.isFullApiExtraction, cwd: t.dir.root, environment: t.environment }), this.localCssImports = void 0, this.localTagName = void 0, this.localClassName = void 0, this.pairedSetter = void 0, this.apiComponent = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.moduleName = "", this.resolveJsDocLink = _o(this), this.context = t, this.isPatchOnly = i, this.copyDocDefinitions = t.options.documentation?.copyDefinitions ?? {};
|
|
2380
2396
|
}
|
|
2381
2397
|
extract(t) {
|
|
2382
2398
|
const i = super.extract(t);
|
|
@@ -2388,12 +2404,12 @@ class Ue extends ps {
|
|
|
2388
2404
|
for (const n of i) {
|
|
2389
2405
|
this.moduleName = n.path;
|
|
2390
2406
|
for (const s of n.declarations)
|
|
2391
|
-
"customElement" in s && (this.apiComponent = s, this.context.isFullApiExtraction &&
|
|
2407
|
+
"customElement" in s && (this.apiComponent = s, this.context.isFullApiExtraction && Bo(s, this), this.inheritMembers(n.path, s, i), this.context.isFullApiExtraction && (s.members.sort(tt), s.attributes?.sort(tt), s.events?.sort(tt)));
|
|
2392
2408
|
}
|
|
2393
2409
|
return i;
|
|
2394
2410
|
}
|
|
2395
2411
|
extractModule(t) {
|
|
2396
|
-
const i =
|
|
2412
|
+
const i = Bi(t.text);
|
|
2397
2413
|
return this.localTagName = i?.[0], this.localClassName = i?.[1], super.extractModule(
|
|
2398
2414
|
t,
|
|
2399
2415
|
void 0,
|
|
@@ -2410,7 +2426,7 @@ class Ue extends ps {
|
|
|
2410
2426
|
}
|
|
2411
2427
|
collectCssImports(t) {
|
|
2412
2428
|
const i = t.moduleSpecifier.text;
|
|
2413
|
-
if (!(i.startsWith(".") &&
|
|
2429
|
+
if (!(i.startsWith(".") && sn.test(i)))
|
|
2414
2430
|
return;
|
|
2415
2431
|
const s = u.join(this.file.fileName, "..", i);
|
|
2416
2432
|
this.localCssImports ??= /* @__PURE__ */ new Set(), this.localCssImports.add(s);
|
|
@@ -2436,7 +2452,7 @@ class Ue extends ps {
|
|
|
2436
2452
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2437
2453
|
* Stencil's behavior.
|
|
2438
2454
|
*/
|
|
2439
|
-
pascalCaseName:
|
|
2455
|
+
pascalCaseName: hs(n),
|
|
2440
2456
|
privacy: void 0,
|
|
2441
2457
|
// REFACTOR: remove this deprecated property
|
|
2442
2458
|
importPath: this.apiModule.path,
|
|
@@ -2466,7 +2482,7 @@ class Ue extends ps {
|
|
|
2466
2482
|
});
|
|
2467
2483
|
}
|
|
2468
2484
|
if (this.apiComponent = s, s.members = this.extractComponentMembers(t), this.context.isFullApiExtraction) {
|
|
2469
|
-
if (this.addExport(s, !1), s.attributes = this.inferAttributes(s.members), this.indexedComponents.set(i, s),
|
|
2485
|
+
if (this.addExport(s, !1), s.attributes = this.inferAttributes(s.members), this.indexedComponents.set(i, s), Os(n, this.context, this.apiModule.sourcePath), this.localCssImports !== void 0) {
|
|
2470
2486
|
for (const f of this.localCssImports) {
|
|
2471
2487
|
const m = this.context._cssImports.get(f);
|
|
2472
2488
|
m === void 0 ? this.context._cssImports.set(f, /* @__PURE__ */ new Set([s.tagName])) : m.add(s.tagName);
|
|
@@ -2537,7 +2553,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2537
2553
|
return i;
|
|
2538
2554
|
}
|
|
2539
2555
|
extractComponentMember(t, i) {
|
|
2540
|
-
if (
|
|
2556
|
+
if (us(t) || i === void 0) {
|
|
2541
2557
|
o.isPropertyDeclaration(t) && o.isIdentifier(t.name) && t.name.text === "shadowRootOptions" && t.initializer !== void 0 && o.isIdentifier(t.initializer) && t.initializer.text === "noShadowRoot" && (this.apiComponent.encapsulation = "none");
|
|
2542
2558
|
return;
|
|
2543
2559
|
}
|
|
@@ -2574,13 +2590,13 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2574
2590
|
inheritedFrom: void 0,
|
|
2575
2591
|
privacy: void 0
|
|
2576
2592
|
};
|
|
2577
|
-
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, d), (r === void 0 && (d.type.values === void 0 || !
|
|
2593
|
+
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, d), (r === void 0 && (d.type.values === void 0 || !go(d.type.values)) || d.readonly && !d.reflects) && (d.attribute = void 0)), d;
|
|
2578
2594
|
}
|
|
2579
2595
|
/**
|
|
2580
2596
|
* Based on a `non-@property()` property, extract a public event if it is one.
|
|
2581
2597
|
*/
|
|
2582
2598
|
extractComponentEvent(t, i) {
|
|
2583
|
-
const n =
|
|
2599
|
+
const n = jo(t, i, this.context, this.file);
|
|
2584
2600
|
return n !== void 0 && this.copyDoc(t, this.copyDocDefinitions.events, n, this.apiComponent, this.apiModule), n;
|
|
2585
2601
|
}
|
|
2586
2602
|
/**
|
|
@@ -2597,7 +2613,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2597
2613
|
// in the documentation. The full type is still present in the .d.ts files.
|
|
2598
2614
|
i.name === "messageOverrides" ? {
|
|
2599
2615
|
text: "Record<string, unknown>"
|
|
2600
|
-
} :
|
|
2616
|
+
} : Fo(this.context, l, m, this.file);
|
|
2601
2617
|
const g = o.isPropertyDeclaration(t) && t.type !== void 0 && t.initializer !== void 0 && o.isPropertyAccessExpression(t.initializer) && o.isPropertyAccessExpression(t.initializer.expression) && t.initializer.expression.expression.kind === o.SyntaxKind.ThisKeyword && o.isIdentifier(t.initializer.expression.name) && o.isIdentifier(t.initializer.name);
|
|
2602
2618
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || g) {
|
|
2603
2619
|
const h = t.initializer, v = s.getSymbolAtLocation(h), b = v !== void 0 && ((v.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(v) : v, w = b?.getDeclarations() ?? [];
|
|
@@ -2605,7 +2621,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2605
2621
|
const C = Bt(s, b);
|
|
2606
2622
|
if (C.docsTags.length > 0) {
|
|
2607
2623
|
C.docsTags = C.docsTags.filter(
|
|
2608
|
-
(k) => !c.has(k.name) ||
|
|
2624
|
+
(k) => !c.has(k.name) || fs.has(k.name)
|
|
2609
2625
|
);
|
|
2610
2626
|
const S = i.description;
|
|
2611
2627
|
_t(i, C), C.docsTags.forEach((k) => {
|
|
@@ -2650,7 +2666,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2650
2666
|
description: void 0,
|
|
2651
2667
|
deprecated: void 0,
|
|
2652
2668
|
parameters: [],
|
|
2653
|
-
return: n ?
|
|
2669
|
+
return: n ? Mo : Oo,
|
|
2654
2670
|
inheritedFrom: void 0,
|
|
2655
2671
|
docsTags: void 0,
|
|
2656
2672
|
signature: "",
|
|
@@ -2658,7 +2674,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2658
2674
|
};
|
|
2659
2675
|
if (this.context.isFullApiExtraction) {
|
|
2660
2676
|
const r = this.context.typeScriptTypeChecker;
|
|
2661
|
-
|
|
2677
|
+
Lo(t, s, r, this.file, this.context.dir), n && !Hi(s) && Z("Public method marked as async must have a Promise<SomeType> return type annotation.", {
|
|
2662
2678
|
file: this.file,
|
|
2663
2679
|
node: t
|
|
2664
2680
|
}), this.copyDoc(t, this.copyDocDefinitions.methods, s, this.apiComponent, this.apiModule);
|
|
@@ -2682,7 +2698,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2682
2698
|
description: n.description,
|
|
2683
2699
|
inheritedFrom: n.inheritedFrom,
|
|
2684
2700
|
type: s === void 0 || s.length === 0 ? n.type : {
|
|
2685
|
-
text:
|
|
2701
|
+
text: pn(s),
|
|
2686
2702
|
references: void 0,
|
|
2687
2703
|
values: s
|
|
2688
2704
|
},
|
|
@@ -2719,17 +2735,17 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2719
2735
|
const ot = {
|
|
2720
2736
|
name: "LitElement",
|
|
2721
2737
|
package: "@arcgis/lumina"
|
|
2722
|
-
},
|
|
2723
|
-
async function
|
|
2738
|
+
}, Oo = { type: { text: "unknown" } }, Mo = { type: { text: "Promise<unknown>" } };
|
|
2739
|
+
async function Jo(e, t) {
|
|
2724
2740
|
t && (e.componentFilesPromise = We(e, e.dir.srcComponents));
|
|
2725
|
-
const i = await e.componentFilesPromise, n = await
|
|
2741
|
+
const i = await e.componentFilesPromise, n = await Go(e, i);
|
|
2726
2742
|
await e.componentStoriesPromise, e._componentPathMapping = /* @__PURE__ */ Object.create(null), e._localDefinedComponents = void 0;
|
|
2727
2743
|
const s = yn(n, e, !1);
|
|
2728
2744
|
e.privateApiJson = s;
|
|
2729
2745
|
const [r, a] = hn(s);
|
|
2730
2746
|
return e.apiJsonComponents = a, e.apiJson = r, e._htmlElementReferencesReplacer = void 0, s;
|
|
2731
2747
|
}
|
|
2732
|
-
function
|
|
2748
|
+
function Ko(e, t, i) {
|
|
2733
2749
|
const n = e.getSourceFile(t, i), s = yn([n], e, !0), r = s.modules[0];
|
|
2734
2750
|
{
|
|
2735
2751
|
const m = hn(s)[0].modules[0], g = e.apiJson.modules.findIndex((v) => v.path === m.path), y = e.apiJson.modules[g], h = Array.from(e.apiJson.modules);
|
|
@@ -2774,7 +2790,7 @@ function hn(e) {
|
|
|
2774
2790
|
}
|
|
2775
2791
|
return [t, i];
|
|
2776
2792
|
}
|
|
2777
|
-
function
|
|
2793
|
+
function Bo(e, t) {
|
|
2778
2794
|
M(e, t);
|
|
2779
2795
|
for (const i of e.members) {
|
|
2780
2796
|
if (i.kind === "field")
|
|
@@ -2810,12 +2826,12 @@ function Mo(e, t) {
|
|
|
2810
2826
|
M(i, t);
|
|
2811
2827
|
}
|
|
2812
2828
|
function Fe(e, t) {
|
|
2813
|
-
e !== void 0 && (e.references?.reduce((i, n) =>
|
|
2814
|
-
|
|
2829
|
+
e !== void 0 && (e.references?.reduce((i, n) => Wo(n, t, i), 0), e.text = e.text.replaceAll(
|
|
2830
|
+
Vo,
|
|
2815
2831
|
(i, n) => Nt(t.indexedComponents.get(n)) ?? i
|
|
2816
|
-
), e.values?.forEach(
|
|
2832
|
+
), e.values?.forEach(Ho, t.indexedComponents));
|
|
2817
2833
|
}
|
|
2818
|
-
const
|
|
2834
|
+
const _o = (e) => (t, i) => {
|
|
2819
2835
|
let n = i.indexOf(" ");
|
|
2820
2836
|
n === -1 && (n = i.length);
|
|
2821
2837
|
const s = i.slice(0, n), r = i.slice(n + 1);
|
|
@@ -2823,7 +2839,7 @@ const Jo = (e) => (t, i) => {
|
|
|
2823
2839
|
return `[${r || s}](${s})`;
|
|
2824
2840
|
const [a, c] = s.split("#"), d = e.indexedComponents.get(a);
|
|
2825
2841
|
if (d === void 0)
|
|
2826
|
-
return Z(
|
|
2842
|
+
return i.includes(" /") || Z(
|
|
2827
2843
|
`Failed to find which component is referenced by the following link in ${e.moduleName}: ${t}. Make sure the link follows the pattern {@link ComponentClassName} or {@link ComponentClassName#propertyOrMethodOrEventName}.`,
|
|
2828
2844
|
{
|
|
2829
2845
|
file: void 0,
|
|
@@ -2850,7 +2866,7 @@ const Jo = (e) => (t, i) => {
|
|
|
2850
2866
|
const f = d === e.apiComponent;
|
|
2851
2867
|
return `[${r || (f ? c : `${d.tagName}.${c}`)}](${l}#${c})`;
|
|
2852
2868
|
};
|
|
2853
|
-
function
|
|
2869
|
+
function Wo(e, t, i) {
|
|
2854
2870
|
if (e.viewUrl !== void 0 && (e.viewUrl = e.viewUrl.replace(
|
|
2855
2871
|
t.alternativeDocumentationHost,
|
|
2856
2872
|
t.normalizedDocumentationHost
|
|
@@ -2863,17 +2879,17 @@ function Ko(e, t, i) {
|
|
|
2863
2879
|
if (n !== void 0) {
|
|
2864
2880
|
const s = e.name.length;
|
|
2865
2881
|
e.name = Nt(n);
|
|
2866
|
-
const r = e.name.length - s -
|
|
2867
|
-
e.viewUrl = n.demos?.at(0)?.url.replace(t.alternativeDocumentationHost, t.normalizedDocumentationHost), e.start = e.start -
|
|
2882
|
+
const r = e.name.length - s - ni;
|
|
2883
|
+
e.viewUrl = n.demos?.at(0)?.url.replace(t.alternativeDocumentationHost, t.normalizedDocumentationHost), e.start = e.start - ni, e.end = e.end + r, i += r - qo;
|
|
2868
2884
|
}
|
|
2869
2885
|
}
|
|
2870
2886
|
return i;
|
|
2871
2887
|
}
|
|
2872
|
-
function
|
|
2888
|
+
function Ho(e) {
|
|
2873
2889
|
e.type.startsWith("ToElement<") && (e.type = Nt(this.get(e.type.slice(10, -1))) ?? e.type);
|
|
2874
2890
|
}
|
|
2875
|
-
const Nt = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0,
|
|
2876
|
-
async function
|
|
2891
|
+
const Nt = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0, Uo = "ToElement<", ni = Uo.length, zo = ">", qo = zo.length, Vo = /ToElement<(\w+)>/gu;
|
|
2892
|
+
async function Go(e, t) {
|
|
2877
2893
|
if (e.viteCommand === "serve" && (Object.hasOwn(e, "typeScriptHost") || (e.typeScriptHost = o.createCompilerHost(e.typeScriptConfig, !1))), e.typeScriptProgram !== void 0) {
|
|
2878
2894
|
const i = e.typeScriptProgram.getSourceFiles(), n = new Set(t);
|
|
2879
2895
|
return i.filter((s) => n.has(s.fileName));
|
|
@@ -2886,9 +2902,9 @@ async function zo(e, t) {
|
|
|
2886
2902
|
);
|
|
2887
2903
|
}
|
|
2888
2904
|
async function vn(e, t) {
|
|
2889
|
-
return le ??=
|
|
2905
|
+
return le ??= Qo(e, t), await le;
|
|
2890
2906
|
}
|
|
2891
|
-
function
|
|
2907
|
+
function Xo() {
|
|
2892
2908
|
if (ze === void 0)
|
|
2893
2909
|
throw Error(
|
|
2894
2910
|
E(
|
|
@@ -2908,9 +2924,9 @@ function bn() {
|
|
|
2908
2924
|
);
|
|
2909
2925
|
return bt;
|
|
2910
2926
|
}
|
|
2911
|
-
async function
|
|
2927
|
+
async function Qo(e, t) {
|
|
2912
2928
|
const i = R(e), n = i.dependencies ?? {}, s = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
2913
|
-
[...Object.keys(n), ...Object.keys(s)].filter((l) => !
|
|
2929
|
+
[...Object.keys(n), ...Object.keys(s)].filter((l) => !Zo.has(l)).flatMap(async (l) => await Sn(l, e))
|
|
2914
2930
|
)).filter(j);
|
|
2915
2931
|
ze ??= a, bt = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
2916
2932
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -2918,7 +2934,7 @@ async function Vo(e, t) {
|
|
|
2918
2934
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
2919
2935
|
return ze ??= d, d;
|
|
2920
2936
|
}
|
|
2921
|
-
const
|
|
2937
|
+
const Zo = /* @__PURE__ */ new Set([
|
|
2922
2938
|
"@arcgis/arcade-languageservice",
|
|
2923
2939
|
"@arcgis/components-build-utils",
|
|
2924
2940
|
"@arcgis/toolkit",
|
|
@@ -2956,28 +2972,28 @@ const Go = /* @__PURE__ */ new Set([
|
|
|
2956
2972
|
]);
|
|
2957
2973
|
let ze, bt, le;
|
|
2958
2974
|
async function Sn(e, t) {
|
|
2959
|
-
const i = await
|
|
2975
|
+
const i = await ki(e, t), n = await Ai(i), s = "exports" in n, r = la.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
2960
2976
|
if (a ? await U(c) : !1) {
|
|
2961
|
-
const g = await B(c, "utf8"), y =
|
|
2977
|
+
const g = await B(c, "utf8"), y = Yo(g, "bootstrapLazy("), h = g.indexOf(", options", y), v = g.slice(y, h), b = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
2962
2978
|
try {
|
|
2963
|
-
const w = JSON.parse(b), I =
|
|
2979
|
+
const w = JSON.parse(b), I = aa(w, { packageName: e, getImportPath: r });
|
|
2964
2980
|
return { packageName: e, type: "stencil", components: I, packageLocation: i, packageJson: n };
|
|
2965
2981
|
} catch (w) {
|
|
2966
2982
|
T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
2967
2983
|
Error: ${String(w)}`);
|
|
2968
2984
|
}
|
|
2969
2985
|
}
|
|
2970
|
-
const l =
|
|
2986
|
+
const l = si(n.customElements);
|
|
2971
2987
|
if (l != null) {
|
|
2972
|
-
const g = u.join(i, l), y = JSON.parse(await B(g, "utf-8")), h =
|
|
2988
|
+
const g = u.join(i, l), y = JSON.parse(await B(g, "utf-8")), h = ea(y), v = wn(y, {
|
|
2973
2989
|
packageName: e,
|
|
2974
2990
|
getImportPath: r
|
|
2975
2991
|
});
|
|
2976
2992
|
return { type: h ? "@arcgis/lumina" : "unknown", packageName: e, components: v, packageLocation: i, packageJson: n };
|
|
2977
2993
|
}
|
|
2978
|
-
const p =
|
|
2994
|
+
const p = si(n["web-types"]);
|
|
2979
2995
|
if (p != null) {
|
|
2980
|
-
const g = u.join(i, p), y = JSON.parse(await B(g, "utf-8")), h =
|
|
2996
|
+
const g = u.join(i, p), y = JSON.parse(await B(g, "utf-8")), h = ta(y, {
|
|
2981
2997
|
packageName: e,
|
|
2982
2998
|
getImportPath: r,
|
|
2983
2999
|
packageRoot: i
|
|
@@ -2986,15 +3002,15 @@ Error: ${String(w)}`);
|
|
|
2986
3002
|
}
|
|
2987
3003
|
const f = u.join(i, "dist/components");
|
|
2988
3004
|
if (await U(f)) {
|
|
2989
|
-
const g = await
|
|
3005
|
+
const g = await ca(f, {
|
|
2990
3006
|
packageName: e,
|
|
2991
3007
|
getImportPath: r
|
|
2992
3008
|
});
|
|
2993
3009
|
return { type: "unknown", packageName: e, components: g, packageLocation: i, packageJson: n };
|
|
2994
3010
|
}
|
|
2995
3011
|
}
|
|
2996
|
-
const
|
|
2997
|
-
function
|
|
3012
|
+
const si = (e) => Array.isArray(e) ? e[0] : e;
|
|
3013
|
+
function Yo(e, t) {
|
|
2998
3014
|
const i = e.indexOf(t);
|
|
2999
3015
|
return i === -1 ? -1 : i + t.length;
|
|
3000
3016
|
}
|
|
@@ -3035,7 +3051,7 @@ function wn(e, t, i = !1) {
|
|
|
3035
3051
|
}
|
|
3036
3052
|
return n;
|
|
3037
3053
|
}
|
|
3038
|
-
const
|
|
3054
|
+
const ea = (e) => e.compiler?.name === At.name, ta = (e, t) => Object.fromEntries(
|
|
3039
3055
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
3040
3056
|
(i) => [
|
|
3041
3057
|
i.name,
|
|
@@ -3046,7 +3062,7 @@ const Qo = (e) => e.compiler?.name === At.name, Zo = (e, t) => Object.fromEntrie
|
|
|
3046
3062
|
}
|
|
3047
3063
|
]
|
|
3048
3064
|
) ?? []
|
|
3049
|
-
),
|
|
3065
|
+
), ia = 1, na = 2, sa = 4, ra = 8, oa = ia | na | sa | ra, aa = (e, t) => Object.fromEntries(
|
|
3050
3066
|
e.flatMap(
|
|
3051
3067
|
([i, n]) => n.map(
|
|
3052
3068
|
([s, r, a]) => [
|
|
@@ -3055,13 +3071,13 @@ const Qo = (e) => e.compiler?.name === At.name, Zo = (e, t) => Object.fromEntrie
|
|
|
3055
3071
|
packageName: t.packageName,
|
|
3056
3072
|
moduleName: t.getImportPath(r),
|
|
3057
3073
|
propToAttribute: Object.fromEntries(
|
|
3058
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
3074
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & oa).map(([c, [d, l = c]]) => [c, l])
|
|
3059
3075
|
)
|
|
3060
3076
|
}
|
|
3061
3077
|
]
|
|
3062
3078
|
)
|
|
3063
3079
|
)
|
|
3064
|
-
),
|
|
3080
|
+
), ca = async (e, t) => Object.fromEntries(
|
|
3065
3081
|
(await Ge(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3066
3082
|
const n = i.slice(0, -5);
|
|
3067
3083
|
return [
|
|
@@ -3073,16 +3089,16 @@ const Qo = (e) => e.compiler?.name === At.name, Zo = (e, t) => Object.fromEntrie
|
|
|
3073
3089
|
}
|
|
3074
3090
|
];
|
|
3075
3091
|
})
|
|
3076
|
-
),
|
|
3092
|
+
), la = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, da = (e) => e.startsWith("/") ? e : `/${e}`, Lt = (e, t) => `${e}@fs${da(t)}`;
|
|
3077
3093
|
function Xe(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3078
3094
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3079
3095
|
if (s && n)
|
|
3080
3096
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
3081
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
3097
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = pa(e.name), c = ma(e.version, i);
|
|
3082
3098
|
return a.length === 0 ? `https://${r}/${c}/` : s ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
3083
3099
|
}
|
|
3084
|
-
const
|
|
3085
|
-
function
|
|
3100
|
+
const pa = (e) => e.split("/").pop() ?? e;
|
|
3101
|
+
function ma(e, t) {
|
|
3086
3102
|
if (/\d+\.\d+\.\d+-(?:.*)$/u.test(e))
|
|
3087
3103
|
return "next";
|
|
3088
3104
|
const n = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/u, s = e.match(n);
|
|
@@ -3092,7 +3108,7 @@ function la(e, t) {
|
|
|
3092
3108
|
}
|
|
3093
3109
|
return "next";
|
|
3094
3110
|
}
|
|
3095
|
-
function
|
|
3111
|
+
function ri(e, t, i) {
|
|
3096
3112
|
if (se(e))
|
|
3097
3113
|
return e;
|
|
3098
3114
|
{
|
|
@@ -3111,14 +3127,14 @@ function se(e) {
|
|
|
3111
3127
|
return (
|
|
3112
3128
|
// Inlined string literal
|
|
3113
3129
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3114
|
-
|
|
3130
|
+
ua.has(e.kind) || // Ternary with both branches never undefined
|
|
3115
3131
|
o.isConditionalExpression(e) && se(e.whenTrue) && se(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3116
|
-
o.isBinaryExpression(e) && (
|
|
3132
|
+
o.isBinaryExpression(e) && (fa.has(e.operatorToken.kind) || se(e.left) && se(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3117
3133
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && se(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3118
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3134
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Br.has(e.tag.text)
|
|
3119
3135
|
);
|
|
3120
3136
|
}
|
|
3121
|
-
const
|
|
3137
|
+
const ua = /* @__PURE__ */ new Set([
|
|
3122
3138
|
o.SyntaxKind.NumericLiteral,
|
|
3123
3139
|
o.SyntaxKind.BigIntLiteral,
|
|
3124
3140
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3137,7 +3153,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3137
3153
|
o.SyntaxKind.ClassExpression,
|
|
3138
3154
|
// Trust? Trust.
|
|
3139
3155
|
o.SyntaxKind.NonNullExpression
|
|
3140
|
-
]),
|
|
3156
|
+
]), fa = /* @__PURE__ */ new Set([
|
|
3141
3157
|
o.SyntaxKind.PlusEqualsToken,
|
|
3142
3158
|
o.SyntaxKind.MinusEqualsToken,
|
|
3143
3159
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3172,9 +3188,9 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3172
3188
|
o.SyntaxKind.SlashToken,
|
|
3173
3189
|
o.SyntaxKind.PercentToken,
|
|
3174
3190
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3175
|
-
]),
|
|
3191
|
+
]), ga = {
|
|
3176
3192
|
property(e, t, i, n) {
|
|
3177
|
-
const s =
|
|
3193
|
+
const s = ya(n, i, e), r = s?.type === "stringifiedReflected", a = s?.type === "reflected" || r;
|
|
3178
3194
|
if (a) {
|
|
3179
3195
|
const m = ct(t);
|
|
3180
3196
|
if (m === !0)
|
|
@@ -3187,11 +3203,11 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3187
3203
|
return [s.name, ...c];
|
|
3188
3204
|
const [l, p] = c, f = s?.type === "stringifiedNonReflected";
|
|
3189
3205
|
if (r || f) {
|
|
3190
|
-
const m =
|
|
3206
|
+
const m = ri(
|
|
3191
3207
|
p,
|
|
3192
3208
|
e,
|
|
3193
3209
|
f ? "" : void 0
|
|
3194
|
-
), y = i === "value" && (n === "input" || n === "textarea" || n === Be) ?
|
|
3210
|
+
), y = i === "value" && (n === "input" || n === "textarea" || n === Be) ? va(m, e) : m;
|
|
3195
3211
|
if (y !== p)
|
|
3196
3212
|
return [f ? `.${i}` : s.name, l, y];
|
|
3197
3213
|
}
|
|
@@ -3203,7 +3219,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3203
3219
|
return [i];
|
|
3204
3220
|
if (n === !1)
|
|
3205
3221
|
return [];
|
|
3206
|
-
const s = Oe(e, t, !0), a = s[0] !== "=" ? s : [s[0],
|
|
3222
|
+
const s = Oe(e, t, !0), a = s[0] !== "=" ? s : [s[0], ri(s[1], e)];
|
|
3207
3223
|
return [i, ...a];
|
|
3208
3224
|
},
|
|
3209
3225
|
booleanAttribute(e, t, i) {
|
|
@@ -3216,7 +3232,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3216
3232
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3217
3233
|
);
|
|
3218
3234
|
const n = i.slice(2), s = ft(n);
|
|
3219
|
-
return [`@${
|
|
3235
|
+
return [`@${Qi.has(s) ? n.toLowerCase() : ft(n)}=`, ...Dt(e, t, void 0)];
|
|
3220
3236
|
},
|
|
3221
3237
|
directives(e, t) {
|
|
3222
3238
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3251,8 +3267,8 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3251
3267
|
])
|
|
3252
3268
|
];
|
|
3253
3269
|
},
|
|
3254
|
-
class:
|
|
3255
|
-
style:
|
|
3270
|
+
class: ai,
|
|
3271
|
+
style: ai,
|
|
3256
3272
|
key: (e, t) => [Ft(t, e.sourceFile)],
|
|
3257
3273
|
deferLoad(e, t, i, n) {
|
|
3258
3274
|
if (typeof n != "string")
|
|
@@ -3264,7 +3280,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3264
3280
|
return [o.factory.createIdentifier(s)];
|
|
3265
3281
|
}
|
|
3266
3282
|
};
|
|
3267
|
-
function
|
|
3283
|
+
function ya(e, t, i) {
|
|
3268
3284
|
if (typeof e == "string") {
|
|
3269
3285
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3270
3286
|
if (r !== void 0)
|
|
@@ -3319,10 +3335,10 @@ function Oe(e, t, i = !1) {
|
|
|
3319
3335
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3320
3336
|
);
|
|
3321
3337
|
if (o.isStringLiteral(t))
|
|
3322
|
-
return
|
|
3338
|
+
return oi(t, i);
|
|
3323
3339
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3324
3340
|
if (o.isStringLiteral(t.expression))
|
|
3325
|
-
return
|
|
3341
|
+
return oi(t.expression, i);
|
|
3326
3342
|
if (i) {
|
|
3327
3343
|
if (o.isNumericLiteral(t.expression))
|
|
3328
3344
|
return [`=${t.expression.text}`];
|
|
@@ -3332,14 +3348,14 @@ function Oe(e, t, i = !1) {
|
|
|
3332
3348
|
}
|
|
3333
3349
|
return ["=", ...Dt(e, t, void 0)];
|
|
3334
3350
|
}
|
|
3335
|
-
function
|
|
3351
|
+
function oi(e, t) {
|
|
3336
3352
|
if (!t)
|
|
3337
3353
|
return ["=", e];
|
|
3338
3354
|
const i = e.text;
|
|
3339
3355
|
if (i.length === 0)
|
|
3340
3356
|
return [];
|
|
3341
|
-
const n =
|
|
3342
|
-
if (
|
|
3357
|
+
const n = Zi(i);
|
|
3358
|
+
if (Fr(n)) {
|
|
3343
3359
|
const s = n.replaceAll('"', """);
|
|
3344
3360
|
if (s.length > n.length) {
|
|
3345
3361
|
const r = n.replaceAll("'", "'");
|
|
@@ -3350,7 +3366,7 @@ function ai(e, t) {
|
|
|
3350
3366
|
} else
|
|
3351
3367
|
return [`=${n}`];
|
|
3352
3368
|
}
|
|
3353
|
-
function
|
|
3369
|
+
function ai(e, t, i) {
|
|
3354
3370
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3355
3371
|
return [`${i}="${t.text}"`];
|
|
3356
3372
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3358,7 +3374,7 @@ function ci(e, t, i) {
|
|
|
3358
3374
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3359
3375
|
);
|
|
3360
3376
|
const n = t.expression;
|
|
3361
|
-
if (
|
|
3377
|
+
if (ha(n)) {
|
|
3362
3378
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3363
3379
|
e.neededImports.add(r);
|
|
3364
3380
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3368,18 +3384,18 @@ function ci(e, t, i) {
|
|
|
3368
3384
|
} else
|
|
3369
3385
|
return [i, ...Oe(e, t, !0)];
|
|
3370
3386
|
}
|
|
3371
|
-
const
|
|
3372
|
-
function
|
|
3387
|
+
const ha = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3388
|
+
function va(e, t) {
|
|
3373
3389
|
t.neededImports.add("live");
|
|
3374
3390
|
const i = t.importRenames.live;
|
|
3375
3391
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3376
3392
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3377
3393
|
]);
|
|
3378
3394
|
}
|
|
3379
|
-
function
|
|
3380
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3395
|
+
function ba(e) {
|
|
3396
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in ci && e.expression.arguments.length <= 1)
|
|
3381
3397
|
return {
|
|
3382
|
-
propType:
|
|
3398
|
+
propType: ci[e.expression.expression.text],
|
|
3383
3399
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3384
3400
|
initializer: o.factory.createJsxExpression(
|
|
3385
3401
|
void 0,
|
|
@@ -3388,21 +3404,21 @@ function ya(e) {
|
|
|
3388
3404
|
)
|
|
3389
3405
|
};
|
|
3390
3406
|
}
|
|
3391
|
-
const
|
|
3407
|
+
const ci = {
|
|
3392
3408
|
bindProperty: "property",
|
|
3393
3409
|
bindAttribute: "attribute",
|
|
3394
3410
|
bindBooleanAttribute: "booleanAttribute",
|
|
3395
3411
|
bindEvent: "event"
|
|
3396
3412
|
};
|
|
3397
|
-
function
|
|
3398
|
-
return
|
|
3413
|
+
function Sa(e, t, i) {
|
|
3414
|
+
return Ta.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : Vi.has(e) || e.includes("-") ? "attribute" : !kt(i) && (Gi.has(e) || (i === yt ? !1 : i === Be ? (
|
|
3399
3415
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3400
3416
|
Object.values(ht).some((r) => r.has(e))
|
|
3401
3417
|
) : ht[i]?.has(e) === !0)) ? Qt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === yt || i !== Be && (xt.has(i) || It.has(i)) ? e in z.common.reflected || e in z.common.stringifiedReflected || e in z.common.stringifiedNonReflected ? "property" : Qt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3402
3418
|
}
|
|
3403
|
-
const
|
|
3419
|
+
const wa = ["class", "style", "ref", "directives", "key", "deferLoad"], Ta = new Set(wa), Ea = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3404
3420
|
function Qe({ key: e, parts: t, litTag: i }, n) {
|
|
3405
|
-
const s =
|
|
3421
|
+
const s = Ca(t);
|
|
3406
3422
|
if (s.length % 2 === 0)
|
|
3407
3423
|
throw new Error("Normalized template parts array length must be odd");
|
|
3408
3424
|
const [r, ...a] = s;
|
|
@@ -3423,11 +3439,11 @@ function Qe({ key: e, parts: t, litTag: i }, n) {
|
|
|
3423
3439
|
const d = n.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3424
3440
|
o.factory.createIdentifier(d),
|
|
3425
3441
|
void 0,
|
|
3426
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3442
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), $a(a))
|
|
3427
3443
|
);
|
|
3428
3444
|
return lt(n, e, l);
|
|
3429
3445
|
}
|
|
3430
|
-
const
|
|
3446
|
+
const Ca = (e) => e.reduce(
|
|
3431
3447
|
(t, i, n) => {
|
|
3432
3448
|
const s = t.at(-1), r = typeof s == "string", a = typeof i == "string";
|
|
3433
3449
|
if (r && a)
|
|
@@ -3437,7 +3453,7 @@ const wa = (e) => e.reduce(
|
|
|
3437
3453
|
},
|
|
3438
3454
|
[""]
|
|
3439
3455
|
);
|
|
3440
|
-
function
|
|
3456
|
+
function $a(e) {
|
|
3441
3457
|
if (!(e.length % 2 === 0))
|
|
3442
3458
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3443
3459
|
const i = e.length / 2;
|
|
@@ -3476,13 +3492,13 @@ function En(e, t) {
|
|
|
3476
3492
|
);
|
|
3477
3493
|
}
|
|
3478
3494
|
const jt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3479
|
-
function
|
|
3495
|
+
function Pa(e) {
|
|
3480
3496
|
const t = jt(e);
|
|
3481
3497
|
if (t.length === 0)
|
|
3482
3498
|
return [e || " "];
|
|
3483
3499
|
const i = t.reduceRight(
|
|
3484
3500
|
([s, ...r], a) => {
|
|
3485
|
-
const c =
|
|
3501
|
+
const c = xa(s), d = Cn(c.slice(a.pos, a.end));
|
|
3486
3502
|
return [
|
|
3487
3503
|
c.slice(0, a.pos),
|
|
3488
3504
|
/**
|
|
@@ -3501,12 +3517,12 @@ function Ea(e) {
|
|
|
3501
3517
|
return (typeof n != "string" || n.trim() !== "") && i.push(" "), i;
|
|
3502
3518
|
}
|
|
3503
3519
|
const Cn = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3504
|
-
function
|
|
3520
|
+
function xa(e) {
|
|
3505
3521
|
if (typeof e == "string")
|
|
3506
3522
|
return e;
|
|
3507
3523
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3508
3524
|
}
|
|
3509
|
-
function
|
|
3525
|
+
function Ia(e, t) {
|
|
3510
3526
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3511
3527
|
return t;
|
|
3512
3528
|
const n = t.arguments[0];
|
|
@@ -3518,7 +3534,7 @@ function $a(e, t) {
|
|
|
3518
3534
|
return t;
|
|
3519
3535
|
const c = Te(n.body);
|
|
3520
3536
|
let d = !0, l;
|
|
3521
|
-
if (
|
|
3537
|
+
if (li(c))
|
|
3522
3538
|
l = c;
|
|
3523
3539
|
else {
|
|
3524
3540
|
if (!o.isBlock(c))
|
|
@@ -3527,7 +3543,7 @@ function $a(e, t) {
|
|
|
3527
3543
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
3528
3544
|
return t;
|
|
3529
3545
|
const w = Te(v.expression);
|
|
3530
|
-
if (!
|
|
3546
|
+
if (!li(w))
|
|
3531
3547
|
return t;
|
|
3532
3548
|
const I = c.statements.slice(0, -1);
|
|
3533
3549
|
if (I.some($n))
|
|
@@ -3540,7 +3556,7 @@ function $a(e, t) {
|
|
|
3540
3556
|
const m = p.attributes.properties[f];
|
|
3541
3557
|
if (m === void 0 || !o.isJsxAttribute(m))
|
|
3542
3558
|
return t;
|
|
3543
|
-
const g = Ft(m.initializer, e.sourceFile), y =
|
|
3559
|
+
const g = Ft(m.initializer, e.sourceFile), y = ka(r, n, g, d, e);
|
|
3544
3560
|
if (y === void 0)
|
|
3545
3561
|
return t;
|
|
3546
3562
|
e.liftedKeys.add(m.name), e.neededImports.add("repeat");
|
|
@@ -3562,7 +3578,7 @@ function $a(e, t) {
|
|
|
3562
3578
|
)
|
|
3563
3579
|
]);
|
|
3564
3580
|
}
|
|
3565
|
-
const
|
|
3581
|
+
const li = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3566
3582
|
function $n(e) {
|
|
3567
3583
|
if (o.isReturnStatement(e))
|
|
3568
3584
|
return !0;
|
|
@@ -3573,7 +3589,7 @@ function $n(e) {
|
|
|
3573
3589
|
void 0
|
|
3574
3590
|
), t;
|
|
3575
3591
|
}
|
|
3576
|
-
function
|
|
3592
|
+
function ka(e, t, i, n, s) {
|
|
3577
3593
|
const r = K(i);
|
|
3578
3594
|
if (r === void 0)
|
|
3579
3595
|
return;
|
|
@@ -3589,7 +3605,7 @@ function Pa(e, t, i, n, s) {
|
|
|
3589
3605
|
return;
|
|
3590
3606
|
}
|
|
3591
3607
|
if (!n) {
|
|
3592
|
-
const d =
|
|
3608
|
+
const d = Na(r, a, t);
|
|
3593
3609
|
if (d === void 0)
|
|
3594
3610
|
return;
|
|
3595
3611
|
a = d;
|
|
@@ -3628,7 +3644,7 @@ function K(e) {
|
|
|
3628
3644
|
}
|
|
3629
3645
|
return t;
|
|
3630
3646
|
} else {
|
|
3631
|
-
if (
|
|
3647
|
+
if (Aa.has(e.kind))
|
|
3632
3648
|
return [];
|
|
3633
3649
|
{
|
|
3634
3650
|
const t = Te(e);
|
|
@@ -3636,7 +3652,7 @@ function K(e) {
|
|
|
3636
3652
|
}
|
|
3637
3653
|
}
|
|
3638
3654
|
}
|
|
3639
|
-
const
|
|
3655
|
+
const Aa = /* @__PURE__ */ new Set([
|
|
3640
3656
|
o.SyntaxKind.NumericLiteral,
|
|
3641
3657
|
o.SyntaxKind.BigIntLiteral,
|
|
3642
3658
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3645,12 +3661,12 @@ const xa = /* @__PURE__ */ new Set([
|
|
|
3645
3661
|
o.SyntaxKind.FalseKeyword,
|
|
3646
3662
|
o.SyntaxKind.NullKeyword,
|
|
3647
3663
|
o.SyntaxKind.TrueKeyword
|
|
3648
|
-
]), Te = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Te(e.expression) : e, Pn = (e, t) => o.isObjectBindingPattern(e) ?
|
|
3649
|
-
function
|
|
3664
|
+
]), Te = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Te(e.expression) : e, Pn = (e, t) => o.isObjectBindingPattern(e) ? ja(e, t) : e;
|
|
3665
|
+
function Na(e, t, i) {
|
|
3650
3666
|
if (e.every(qe, t))
|
|
3651
3667
|
return t;
|
|
3652
3668
|
if (o.isIdentifier(t)) {
|
|
3653
|
-
const n = o.isBlock(i.body) ? ve(i.body.statements, (r) =>
|
|
3669
|
+
const n = o.isBlock(i.body) ? ve(i.body.statements, (r) => La(r, t)) : void 0;
|
|
3654
3670
|
if (n === void 0)
|
|
3655
3671
|
return;
|
|
3656
3672
|
const s = Pn(n, e);
|
|
@@ -3658,7 +3674,7 @@ function Ia(e, t, i) {
|
|
|
3658
3674
|
return s;
|
|
3659
3675
|
}
|
|
3660
3676
|
}
|
|
3661
|
-
function
|
|
3677
|
+
function La(e, t) {
|
|
3662
3678
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
3663
3679
|
return;
|
|
3664
3680
|
const i = e.declarationList.declarations[0];
|
|
@@ -3666,19 +3682,19 @@ function ka(e, t) {
|
|
|
3666
3682
|
}
|
|
3667
3683
|
function qe(e) {
|
|
3668
3684
|
const t = this;
|
|
3669
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
3685
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Fa, e);
|
|
3670
3686
|
}
|
|
3671
|
-
function
|
|
3687
|
+
function Fa(e) {
|
|
3672
3688
|
const t = this;
|
|
3673
3689
|
return o.isOmittedExpression(e) ? !1 : qe.call(e.name, t);
|
|
3674
3690
|
}
|
|
3675
|
-
function
|
|
3691
|
+
function ja(e, t) {
|
|
3676
3692
|
let i = !1;
|
|
3677
3693
|
const n = e.elements.filter((s) => o.isIdentifier(s.name) ? t.includes(s.name.text) : (i = !0, !0));
|
|
3678
3694
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3679
3695
|
}
|
|
3680
|
-
const xn = (e, t) => t.liftedKeys.has(e),
|
|
3681
|
-
`),
|
|
3696
|
+
const xn = (e, t) => t.liftedKeys.has(e), Da = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}/index.js";`).join(`
|
|
3697
|
+
`), Ra = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, Ze = (e) => !Ra.test(e), ue = (e) => Ze(e) ? `"${e}"` : e;
|
|
3682
3698
|
function $e(e, t) {
|
|
3683
3699
|
const i = [], n = [];
|
|
3684
3700
|
let s = !1;
|
|
@@ -3692,25 +3708,25 @@ function $e(e, t) {
|
|
|
3692
3708
|
}
|
|
3693
3709
|
f.docsTags?.some((g) => g.name === "required") ? i.push(p.name) : n.push(p.name);
|
|
3694
3710
|
});
|
|
3695
|
-
const r =
|
|
3711
|
+
const r = di(i), a = di(n), c = [
|
|
3696
3712
|
r ? `Required<Pick<${e}, ${r}>>` : "",
|
|
3697
3713
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3698
3714
|
s ? `${e}SetterTypes` : ""
|
|
3699
3715
|
], d = s ? `
|
|
3700
|
-
type ${e}SetterTypes = ${e}["${
|
|
3716
|
+
type ${e}SetterTypes = ${e}["${qi}"]` : "", l = c.filter(Boolean).join(", ");
|
|
3701
3717
|
return [l.length === 0 ? "" : `${l}, `, d];
|
|
3702
3718
|
}
|
|
3703
|
-
const
|
|
3719
|
+
const di = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3704
3720
|
function V(e, t, i) {
|
|
3705
3721
|
if (Se(i))
|
|
3706
3722
|
return In(e, i);
|
|
3707
|
-
const n = o.isCallExpression(i) ?
|
|
3723
|
+
const n = o.isCallExpression(i) ? Ia(e, i) : i, s = o.visitEachChild(
|
|
3708
3724
|
n,
|
|
3709
3725
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
3710
3726
|
V.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
3711
3727
|
e.transformationContext
|
|
3712
3728
|
);
|
|
3713
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Se(Te(i.right)) ||
|
|
3729
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Se(Te(i.right)) || Ur(i.right)) ? Ja(s) : s;
|
|
3714
3730
|
}
|
|
3715
3731
|
function In(e, t) {
|
|
3716
3732
|
const i = kn(e, t);
|
|
@@ -3724,17 +3740,17 @@ function kn(e, t) {
|
|
|
3724
3740
|
if (o.isJsxNamespacedName(r))
|
|
3725
3741
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
3726
3742
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== nt && r.text !== st) {
|
|
3727
|
-
const S = o.isIdentifier(r) && r.text ===
|
|
3743
|
+
const S = o.isIdentifier(r) && r.text === Pr ? Me(i, e) : {
|
|
3728
3744
|
// No need to wrap the function call in a lit-html tag
|
|
3729
3745
|
litTag: void 0,
|
|
3730
|
-
parts: [
|
|
3746
|
+
parts: [Ma(e, t, r, i)]
|
|
3731
3747
|
};
|
|
3732
3748
|
return {
|
|
3733
|
-
key:
|
|
3749
|
+
key: Oa(s, e),
|
|
3734
3750
|
...S
|
|
3735
3751
|
};
|
|
3736
3752
|
}
|
|
3737
|
-
const c = r.text === nt ? Be : r.text === st ? yt : r.text, d = r.text === nt ? pe : r.text === st ? te :
|
|
3753
|
+
const c = r.text === nt ? Be : r.text === st ? yt : r.text, d = r.text === nt ? pe : r.text === st ? te : Ir.has(c) ? Yi : xt.has(c) ? ae : me, l = kt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, f = p === void 0 ? void 0 : new Set(p);
|
|
3738
3754
|
let m;
|
|
3739
3755
|
const g = [];
|
|
3740
3756
|
let y = !1;
|
|
@@ -3747,13 +3763,13 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3747
3763
|
const { name: S, initializer: k } = C;
|
|
3748
3764
|
if (o.isJsxNamespacedName(S))
|
|
3749
3765
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
3750
|
-
const N = S.text, q =
|
|
3766
|
+
const N = S.text, q = ba(k), D = q?.propType ?? Sa(N, k, c);
|
|
3751
3767
|
f?.delete(N);
|
|
3752
|
-
const L =
|
|
3768
|
+
const L = ga[D](e, q?.initializer ?? k, N, c);
|
|
3753
3769
|
if (L.length === 0)
|
|
3754
3770
|
return [];
|
|
3755
|
-
const W = e.compiler.shouldMinifyJsx ? [" "] :
|
|
3756
|
-
return D === "key" ? (m = typeof L[0] == "object" && !xn(S, e) ? L[0] : void 0, W.some(
|
|
3771
|
+
const W = e.compiler.shouldMinifyJsx ? [" "] : Pa(Tn(S, e));
|
|
3772
|
+
return D === "key" ? (m = typeof L[0] == "object" && !xn(S, e) ? L[0] : void 0, W.some(Ea) ? W : []) : D === "directives" || D === "ref" || N === "deferLoad" ? (y ||= D === "deferLoad", g.push(
|
|
3757
3773
|
...W,
|
|
3758
3774
|
...L.flatMap(
|
|
3759
3775
|
(O, J) => typeof O == "string" || J === 0 || typeof L[J - 1] == "string" ? O : [" ", O]
|
|
@@ -3769,7 +3785,7 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3769
3785
|
`JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
|
|
3770
3786
|
);
|
|
3771
3787
|
l && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3772
|
-
const v = typeof c == "string" &&
|
|
3788
|
+
const v = typeof c == "string" && xr.has(c), b = Me(i, e);
|
|
3773
3789
|
if (v && b.parts.length > 0)
|
|
3774
3790
|
throw Error(
|
|
3775
3791
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
@@ -3793,12 +3809,12 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3793
3809
|
];
|
|
3794
3810
|
return { key: m, parts: A, litTag: d };
|
|
3795
3811
|
}
|
|
3796
|
-
function
|
|
3812
|
+
function Oa(e, t) {
|
|
3797
3813
|
const i = e.attributes.properties[An(e)];
|
|
3798
3814
|
return i && o.isJsxAttribute(i) && !xn(i.name, t) ? Ft(i.initializer, t.sourceFile) : void 0;
|
|
3799
3815
|
}
|
|
3800
3816
|
const An = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3801
|
-
function
|
|
3817
|
+
function Ma(e, t, i, n) {
|
|
3802
3818
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
3803
3819
|
if (o.isJsxSpreadAttribute(d))
|
|
3804
3820
|
return En(Tn(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
@@ -3823,13 +3839,13 @@ function Me(e, t) {
|
|
|
3823
3839
|
let i;
|
|
3824
3840
|
const n = e.flatMap((s) => {
|
|
3825
3841
|
if (o.isJsxText(s))
|
|
3826
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
3842
|
+
return [t.compiler.shouldMinifyJsx ? Ar(s.text) : s.text];
|
|
3827
3843
|
if (o.isJsxExpression(s))
|
|
3828
3844
|
return Dt(t, s, s);
|
|
3829
3845
|
{
|
|
3830
3846
|
const r = kn(t, s);
|
|
3831
3847
|
if (r.key === void 0 && r.litTag !== pe && r.litTag !== te) {
|
|
3832
|
-
if (r.litTag ===
|
|
3848
|
+
if (r.litTag === Yi)
|
|
3833
3849
|
return r.parts;
|
|
3834
3850
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
3835
3851
|
throw new Error(
|
|
@@ -3842,7 +3858,7 @@ function Me(e, t) {
|
|
|
3842
3858
|
});
|
|
3843
3859
|
return { litTag: i, parts: n };
|
|
3844
3860
|
}
|
|
3845
|
-
function
|
|
3861
|
+
function Ja(e) {
|
|
3846
3862
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
3847
3863
|
e,
|
|
3848
3864
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -3856,7 +3872,7 @@ function Dt(e, t, i) {
|
|
|
3856
3872
|
const n = t.getText(e.sourceFile).slice(1, -1);
|
|
3857
3873
|
return jt(n).length === 0 ? [] : [En(n, o.factory.createIdentifier("undefined"))];
|
|
3858
3874
|
}
|
|
3859
|
-
return o.isStringLiteral(t.expression) ? [
|
|
3875
|
+
return o.isStringLiteral(t.expression) ? [Zi(t.expression.text)] : (
|
|
3860
3876
|
/**
|
|
3861
3877
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
3862
3878
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -3898,17 +3914,17 @@ const Nn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), L
|
|
|
3898
3914
|
([e, t]) => t.map((i) => [i, e])
|
|
3899
3915
|
)
|
|
3900
3916
|
), Fn = new Set(Object.keys(Ln));
|
|
3901
|
-
function
|
|
3917
|
+
function Ka(e, t) {
|
|
3902
3918
|
const i = t.importClause, n = i === void 0, s = t.moduleSpecifier;
|
|
3903
3919
|
if (!o.isStringLiteral(s))
|
|
3904
3920
|
return t;
|
|
3905
|
-
const r =
|
|
3906
|
-
if (a && e.existingImportedModules.add(r),
|
|
3921
|
+
const r = Ba(e.sourceFile.fileName, s.text, ""), a = !i?.isTypeOnly;
|
|
3922
|
+
if (a && e.existingImportedModules.add(r), sn.test(s.text) && // If id already includes ?, bypass our custom behavior
|
|
3907
3923
|
!s.text.includes("?")) {
|
|
3908
3924
|
if (n) {
|
|
3909
3925
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
3910
3926
|
return t;
|
|
3911
|
-
const l = e.sourceFile.fileName, p =
|
|
3927
|
+
const l = e.sourceFile.fileName, p = xo(l), f = `import "${s.text}"`;
|
|
3912
3928
|
throw Error(
|
|
3913
3929
|
p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${l} is not externalized, and it contains a side-effect CSS import \`${f}\`. How should such CSS import be handled? Options:
|
|
3914
3930
|
1. (suggested) Externalize ${l}, which will make end-user's bundler treat this CSS import as global CSS.
|
|
@@ -3951,7 +3967,7 @@ function Oa(e, t) {
|
|
|
3951
3967
|
let l = !1;
|
|
3952
3968
|
const p = c.elements.filter((m) => {
|
|
3953
3969
|
const g = (m.propertyName ?? m.name).text;
|
|
3954
|
-
return
|
|
3970
|
+
return zr.has(g) ? !1 : (l ||= !m.isTypeOnly, !0);
|
|
3955
3971
|
});
|
|
3956
3972
|
if (p.length === 0)
|
|
3957
3973
|
return;
|
|
@@ -3980,11 +3996,11 @@ function Oa(e, t) {
|
|
|
3980
3996
|
}
|
|
3981
3997
|
return t;
|
|
3982
3998
|
}
|
|
3983
|
-
const jn = (e, t) => e === me && ce.staticHtml.includes(t) ? pe : e === ae && ce.staticSvg.includes(t) ? te : e,
|
|
3984
|
-
function
|
|
3985
|
-
return o.isImportDeclaration(e) ?
|
|
3999
|
+
const jn = (e, t) => e === me && ce.staticHtml.includes(t) ? pe : e === ae && ce.staticSvg.includes(t) ? te : e, Ba = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4000
|
+
function _a(e) {
|
|
4001
|
+
return o.isImportDeclaration(e) ? Wa(this, e) : e;
|
|
3986
4002
|
}
|
|
3987
|
-
function
|
|
4003
|
+
function Wa(e, t) {
|
|
3988
4004
|
const i = t.importClause, n = i?.namedBindings, s = t.moduleSpecifier;
|
|
3989
4005
|
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !Fn.has(s.text))
|
|
3990
4006
|
return t;
|
|
@@ -4009,7 +4025,7 @@ function Ka(e, t) {
|
|
|
4009
4025
|
t.attributes
|
|
4010
4026
|
) : t;
|
|
4011
4027
|
}
|
|
4012
|
-
function
|
|
4028
|
+
function Ha(e) {
|
|
4013
4029
|
const t = Nn(
|
|
4014
4030
|
Array.from(e.neededImports, (i) => [ce[i][0], i])
|
|
4015
4031
|
);
|
|
@@ -4035,12 +4051,12 @@ function Dn(e, t) {
|
|
|
4035
4051
|
o.factory.createIdentifier(n)
|
|
4036
4052
|
);
|
|
4037
4053
|
}
|
|
4038
|
-
function
|
|
4039
|
-
const t =
|
|
4054
|
+
function Ua(e) {
|
|
4055
|
+
const t = Xo().map(({ packageName: i }) => i);
|
|
4040
4056
|
return e.existingImportedModules.forEach((i) => {
|
|
4041
4057
|
if (u.isAbsolute(i))
|
|
4042
4058
|
return;
|
|
4043
|
-
const { packageName: n, moduleName: s } =
|
|
4059
|
+
const { packageName: n, moduleName: s } = fn(i);
|
|
4044
4060
|
if (t.includes(n ?? "") && (s.startsWith("dist/components") || s.startsWith("components"))) {
|
|
4045
4061
|
const r = de(e.sourceFile.fileName);
|
|
4046
4062
|
throw new Error(
|
|
@@ -4049,7 +4065,7 @@ function _a(e) {
|
|
|
4049
4065
|
}
|
|
4050
4066
|
}), [];
|
|
4051
4067
|
}
|
|
4052
|
-
function
|
|
4068
|
+
function za(e) {
|
|
4053
4069
|
if (e.compiler.viteCommand === "serve")
|
|
4054
4070
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4055
4071
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4064,7 +4080,7 @@ function Wa(e) {
|
|
|
4064
4080
|
t[n] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[n].referencedBy.push(e.sourceFile.fileName);
|
|
4065
4081
|
}), [];
|
|
4066
4082
|
}
|
|
4067
|
-
function
|
|
4083
|
+
function qa(e, t, i) {
|
|
4068
4084
|
const n = bn()[t] ?? Rn(e)[t];
|
|
4069
4085
|
if (n === void 0) {
|
|
4070
4086
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
@@ -4079,7 +4095,7 @@ function Ha(e, t, i) {
|
|
|
4079
4095
|
}
|
|
4080
4096
|
return n;
|
|
4081
4097
|
}
|
|
4082
|
-
function
|
|
4098
|
+
function Va(e, t) {
|
|
4083
4099
|
return e.packageName === void 0 ? Ce(t, e.moduleName) : u.join(e.packageName, e.moduleName);
|
|
4084
4100
|
}
|
|
4085
4101
|
function Rn(e) {
|
|
@@ -4094,7 +4110,7 @@ function Rn(e) {
|
|
|
4094
4110
|
e.viteCommand === "build"
|
|
4095
4111
|
), e._localDefinedComponents;
|
|
4096
4112
|
}
|
|
4097
|
-
const
|
|
4113
|
+
const Ga = (e, t) => {
|
|
4098
4114
|
const i = e.pragmas;
|
|
4099
4115
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4100
4116
|
return e.statements;
|
|
@@ -4104,7 +4120,7 @@ const za = (e, t) => {
|
|
|
4104
4120
|
localComponents: Rn(t.compiler),
|
|
4105
4121
|
sourceFile: e,
|
|
4106
4122
|
transformationContext: t.transformation,
|
|
4107
|
-
importRenames:
|
|
4123
|
+
importRenames: Xa(e),
|
|
4108
4124
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4109
4125
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4110
4126
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4120,7 +4136,7 @@ const za = (e, t) => {
|
|
|
4120
4136
|
let s = [];
|
|
4121
4137
|
if (e.statements.every((a) => {
|
|
4122
4138
|
if (o.isImportDeclaration(a)) {
|
|
4123
|
-
const c =
|
|
4139
|
+
const c = Ka(n, a);
|
|
4124
4140
|
if (c === void 0)
|
|
4125
4141
|
return !0;
|
|
4126
4142
|
if (s.push(c), n.hasNonLuminaJsxImport)
|
|
@@ -4130,11 +4146,11 @@ const za = (e, t) => {
|
|
|
4130
4146
|
return !0;
|
|
4131
4147
|
}), n.hasNonLuminaJsxImport)
|
|
4132
4148
|
return e.statements;
|
|
4133
|
-
if (n.neededImports.size > 0 && (s = s.map(
|
|
4149
|
+
if (n.neededImports.size > 0 && (s = s.map(_a, n), n.existingLitImports.size > 0))
|
|
4134
4150
|
throw new Error(
|
|
4135
4151
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
|
|
4136
4152
|
);
|
|
4137
|
-
const r = [
|
|
4153
|
+
const r = [Ha, Ua, za].flatMap(
|
|
4138
4154
|
(a) => a(n)
|
|
4139
4155
|
);
|
|
4140
4156
|
if (n.neededImports.size > 0)
|
|
@@ -4143,18 +4159,18 @@ const za = (e, t) => {
|
|
|
4143
4159
|
);
|
|
4144
4160
|
return [...r, ...s];
|
|
4145
4161
|
};
|
|
4146
|
-
function
|
|
4147
|
-
return
|
|
4148
|
-
|
|
4162
|
+
function Xa(e) {
|
|
4163
|
+
return Qa(e), Object.fromEntries(
|
|
4164
|
+
Hr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4149
4165
|
);
|
|
4150
4166
|
}
|
|
4151
|
-
function
|
|
4167
|
+
function Qa(e) {
|
|
4152
4168
|
if (!("identifiers" in e))
|
|
4153
4169
|
throw new Error(
|
|
4154
4170
|
"Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
|
|
4155
4171
|
);
|
|
4156
4172
|
}
|
|
4157
|
-
function
|
|
4173
|
+
function Za(e, t, i) {
|
|
4158
4174
|
return t.size === 0 ? e : [
|
|
4159
4175
|
o.factory.createPropertyDeclaration(
|
|
4160
4176
|
[
|
|
@@ -4168,7 +4184,7 @@ function Ga(e, t, i) {
|
|
|
4168
4184
|
Array.from(t.entries()).map(
|
|
4169
4185
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4170
4186
|
Ze(n) ? o.factory.createStringLiteral(n) : n,
|
|
4171
|
-
|
|
4187
|
+
Ya(s, i)
|
|
4172
4188
|
)
|
|
4173
4189
|
)
|
|
4174
4190
|
)
|
|
@@ -4176,7 +4192,7 @@ function Ga(e, t, i) {
|
|
|
4176
4192
|
...e
|
|
4177
4193
|
];
|
|
4178
4194
|
}
|
|
4179
|
-
function
|
|
4195
|
+
function Ya(e, t) {
|
|
4180
4196
|
let i = 0, n = !0;
|
|
4181
4197
|
const s = [], r = [];
|
|
4182
4198
|
for (const d of e.properties)
|
|
@@ -4188,18 +4204,18 @@ function Xa(e, t) {
|
|
|
4188
4204
|
if (l === "attribute")
|
|
4189
4205
|
return n = !1, i |= f ? Ht : 0, !f && !m;
|
|
4190
4206
|
if (l === "reflect")
|
|
4191
|
-
return i |= f ?
|
|
4207
|
+
return i |= f ? Ts : 0, !1;
|
|
4192
4208
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4193
4209
|
if (p.text === "Boolean")
|
|
4194
|
-
return i |= Ts, !1;
|
|
4195
|
-
if (p.text === "Number")
|
|
4196
4210
|
return i |= Es, !1;
|
|
4211
|
+
if (p.text === "Number")
|
|
4212
|
+
return i |= Cs, !1;
|
|
4197
4213
|
} else {
|
|
4198
4214
|
if (l === "state")
|
|
4199
|
-
return n = !1, i |= f ?
|
|
4215
|
+
return n = !1, i |= f ? $s : 0, !1;
|
|
4200
4216
|
if (l === "readOnly")
|
|
4201
|
-
return i |= f ?
|
|
4202
|
-
l === "noAccessor" && (i |= f ?
|
|
4217
|
+
return i |= f ? Ps : 0, !1;
|
|
4218
|
+
l === "noAccessor" && (i |= f ? xs : 0);
|
|
4203
4219
|
}
|
|
4204
4220
|
return !0;
|
|
4205
4221
|
}
|
|
@@ -4218,7 +4234,7 @@ function Xa(e, t) {
|
|
|
4218
4234
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4219
4235
|
]);
|
|
4220
4236
|
}
|
|
4221
|
-
function
|
|
4237
|
+
function ec(e, t, i, n, s) {
|
|
4222
4238
|
let r = -1, a = -1, c = -1;
|
|
4223
4239
|
t.options?.properties.forEach((m, g) => {
|
|
4224
4240
|
if (o.isSpreadAssignment(m))
|
|
@@ -4230,23 +4246,23 @@ function Qa(e, t, i, n, s) {
|
|
|
4230
4246
|
y === "type" ? r = g : y === "attribute" ? a = g : y === "readOnly" && (c = g);
|
|
4231
4247
|
}
|
|
4232
4248
|
});
|
|
4233
|
-
const d = s.attribute === void 0 && a === -1, l = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p =
|
|
4249
|
+
const d = s.attribute === void 0 && a === -1, l = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = tc(e, t, i, s, r), f = [
|
|
4234
4250
|
...d ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4235
4251
|
...l ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4236
4252
|
...p !== void 0 ? [p] : []
|
|
4237
4253
|
];
|
|
4238
4254
|
return f.length > 0 ? t.options === void 0 ? o.factory.createObjectLiteralExpression(f, !1) : o.factory.updateObjectLiteralExpression(t.options, [...t.options.properties, ...f]) : t.options;
|
|
4239
4255
|
}
|
|
4240
|
-
function
|
|
4256
|
+
function tc(e, t, i, n, s) {
|
|
4241
4257
|
if (n.attribute === void 0)
|
|
4242
4258
|
return;
|
|
4243
|
-
const r =
|
|
4259
|
+
const r = nc(e), a = i.compiler.viteCommand === "serve" || r !== "Other" ? r : ic(n.type.values);
|
|
4244
4260
|
return a === "Other" || n.readonly && (a !== "Boolean" || !n.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4245
4261
|
o.factory.createIdentifier("type"),
|
|
4246
4262
|
o.factory.createIdentifier(a)
|
|
4247
4263
|
);
|
|
4248
4264
|
}
|
|
4249
|
-
function
|
|
4265
|
+
function ic(e) {
|
|
4250
4266
|
let t = !1, i = !1, n = !1;
|
|
4251
4267
|
if (e?.forEach((s) => {
|
|
4252
4268
|
t ||= s.type === "number", i ||= s.type === "boolean", n ||= s.type === "string" || s.type === "any" || s.type === "unknown";
|
|
@@ -4258,7 +4274,7 @@ function Ya(e) {
|
|
|
4258
4274
|
}
|
|
4259
4275
|
return "Other";
|
|
4260
4276
|
}
|
|
4261
|
-
function
|
|
4277
|
+
function nc(e) {
|
|
4262
4278
|
const t = e.type ?? (o.isSetAccessor(e) ? e.parameters[0].type : void 0);
|
|
4263
4279
|
if (t === void 0) {
|
|
4264
4280
|
if ("initializer" in e && e.initializer !== void 0) {
|
|
@@ -4275,7 +4291,7 @@ function ec(e) {
|
|
|
4275
4291
|
}
|
|
4276
4292
|
return "Other";
|
|
4277
4293
|
}
|
|
4278
|
-
function
|
|
4294
|
+
function sc(e, t, i, n, s) {
|
|
4279
4295
|
if (t.modifiers === void 0)
|
|
4280
4296
|
return t;
|
|
4281
4297
|
let r = -1, a = -1;
|
|
@@ -4285,18 +4301,18 @@ function tc(e, t, i, n, s) {
|
|
|
4285
4301
|
l === "property" && (r = d), l === "state" && (a = d);
|
|
4286
4302
|
}
|
|
4287
4303
|
}), r !== -1) {
|
|
4288
|
-
const c =
|
|
4304
|
+
const c = rc(e, t, i, n), d = pi(t, r, n), l = ec(t, d, e, n, c);
|
|
4289
4305
|
let p = !1;
|
|
4290
|
-
return s.set(c.name, l ?? o.factory.createObjectLiteralExpression()), p = !0, d.options = l,
|
|
4306
|
+
return s.set(c.name, l ?? o.factory.createObjectLiteralExpression()), p = !0, d.options = l, mi(t, d, r, p);
|
|
4291
4307
|
} else if (a !== -1) {
|
|
4292
|
-
const c =
|
|
4308
|
+
const c = pi(t, a, n), d = o.factory.createPropertyAssignment("state", o.factory.createTrue()), l = c.options === void 0 ? o.factory.createObjectLiteralExpression([d]) : o.factory.updateObjectLiteralExpression(c.options, [...c.options.properties, d]), p = Y(t.name);
|
|
4293
4309
|
if (p === void 0)
|
|
4294
4310
|
throw new Error("Failed to statically determine the state property name");
|
|
4295
|
-
return s.set(p, l),
|
|
4311
|
+
return s.set(p, l), mi(t, c, a, !0);
|
|
4296
4312
|
} else
|
|
4297
4313
|
return t;
|
|
4298
4314
|
}
|
|
4299
|
-
function
|
|
4315
|
+
function rc(e, t, i, n) {
|
|
4300
4316
|
const s = e.apiModule?.declarations.find(
|
|
4301
4317
|
(a) => a.name === i
|
|
4302
4318
|
) ?? (e.compiler.isInTest ? {
|
|
@@ -4304,7 +4320,7 @@ function ic(e, t, i, n) {
|
|
|
4304
4320
|
} : void 0);
|
|
4305
4321
|
if (s === void 0)
|
|
4306
4322
|
throw Error(`Failed to find API component for ${i} in ${n.fileName}`);
|
|
4307
|
-
const r =
|
|
4323
|
+
const r = ir(s, t) ?? (e.compiler.isInTest ? { kind: "field", attribute: "", name: "", type: { text: "" } } : void 0);
|
|
4308
4324
|
if (r?.kind !== "field")
|
|
4309
4325
|
throw Error(
|
|
4310
4326
|
`Failed to find API property for ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
@@ -4319,7 +4335,7 @@ function ic(e, t, i, n) {
|
|
|
4319
4335
|
}
|
|
4320
4336
|
return r;
|
|
4321
4337
|
}
|
|
4322
|
-
function
|
|
4338
|
+
function pi(e, t, i) {
|
|
4323
4339
|
const n = e.modifiers[t], s = n.expression, r = s.arguments.at(0);
|
|
4324
4340
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4325
4341
|
throw new Error(
|
|
@@ -4327,7 +4343,7 @@ function mi(e, t, i) {
|
|
|
4327
4343
|
);
|
|
4328
4344
|
return { decorator: n, callExpression: s, options: r };
|
|
4329
4345
|
}
|
|
4330
|
-
function
|
|
4346
|
+
function mi(e, t, i, n) {
|
|
4331
4347
|
const s = n ? void 0 : o.factory.updateDecorator(
|
|
4332
4348
|
t.decorator,
|
|
4333
4349
|
o.factory.updateCallExpression(
|
|
@@ -4363,23 +4379,23 @@ function ui(e, t, i, n) {
|
|
|
4363
4379
|
e.initializer
|
|
4364
4380
|
);
|
|
4365
4381
|
}
|
|
4366
|
-
const
|
|
4382
|
+
const oc = (e, t) => {
|
|
4367
4383
|
if (t.apiModule === void 0 && !t.compiler.isInTest)
|
|
4368
4384
|
return e.statements;
|
|
4369
4385
|
let i;
|
|
4370
4386
|
function n() {
|
|
4371
4387
|
i = /* @__PURE__ */ new Map();
|
|
4372
4388
|
}
|
|
4373
|
-
const s = (c) =>
|
|
4389
|
+
const s = (c) => Za(c, i, t.compiler.shouldMinify);
|
|
4374
4390
|
function r(c, d) {
|
|
4375
|
-
const l =
|
|
4391
|
+
const l = cc(t, c, d, e, i);
|
|
4376
4392
|
return Ke(l, t), l;
|
|
4377
4393
|
}
|
|
4378
4394
|
return e.statements.map(
|
|
4379
4395
|
(c) => On(r, c, t, n, s)
|
|
4380
4396
|
);
|
|
4381
4397
|
};
|
|
4382
|
-
function On(e, t, i, n, s =
|
|
4398
|
+
function On(e, t, i, n, s = Di) {
|
|
4383
4399
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4384
4400
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4385
4401
|
let r = !1;
|
|
@@ -4406,11 +4422,11 @@ function On(e, t, i, n, s = Ri) {
|
|
|
4406
4422
|
i.transformation
|
|
4407
4423
|
) : t;
|
|
4408
4424
|
}
|
|
4409
|
-
const
|
|
4410
|
-
function
|
|
4425
|
+
const ac = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4426
|
+
function cc(e, t, i, n, s) {
|
|
4411
4427
|
if (o.isMethodDeclaration(t)) {
|
|
4412
4428
|
const r = t.modifiers?.filter(
|
|
4413
|
-
(a) => !o.isDecorator(a) || !
|
|
4429
|
+
(a) => !o.isDecorator(a) || !lc(a)
|
|
4414
4430
|
);
|
|
4415
4431
|
if (r?.length !== t.modifiers?.length)
|
|
4416
4432
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4424,7 +4440,7 @@ function rc(e, t, i, n, s) {
|
|
|
4424
4440
|
t.type,
|
|
4425
4441
|
t.body
|
|
4426
4442
|
);
|
|
4427
|
-
if ("text" in t.name &&
|
|
4443
|
+
if ("text" in t.name && ac.has(t.name.text) && t.body) {
|
|
4428
4444
|
const a = t.name.text;
|
|
4429
4445
|
return t.body.statements.some(
|
|
4430
4446
|
(d) => o.isExpressionStatement(d) && o.isCallExpression(d.expression) && o.isPropertyAccessExpression(d.expression.expression) && d.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && d.expression.expression.name.text === a
|
|
@@ -4450,14 +4466,14 @@ function rc(e, t, i, n, s) {
|
|
|
4450
4466
|
);
|
|
4451
4467
|
}
|
|
4452
4468
|
}
|
|
4453
|
-
return o.isPropertyDeclaration(t) || o.isAccessor(t) ?
|
|
4454
|
-
}
|
|
4455
|
-
const
|
|
4456
|
-
|
|
4457
|
-
|
|
4458
|
-
|
|
4459
|
-
],
|
|
4460
|
-
name:
|
|
4469
|
+
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? sc(e, t, i, n, s) : t;
|
|
4470
|
+
}
|
|
4471
|
+
const lc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", dc = [
|
|
4472
|
+
Ga,
|
|
4473
|
+
Us,
|
|
4474
|
+
oc
|
|
4475
|
+
], pc = "@arcgis/lumina:transformComponents", mc = (e) => ({
|
|
4476
|
+
name: pc,
|
|
4461
4477
|
transform: {
|
|
4462
4478
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4463
4479
|
order: "pre",
|
|
@@ -4473,9 +4489,9 @@ const oc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4473
4489
|
e.apiJsonEnabled ? [le, e.apiJsonDeferred.promise] : [le]
|
|
4474
4490
|
);
|
|
4475
4491
|
const r = o.transform(n, [
|
|
4476
|
-
(m) => () =>
|
|
4492
|
+
(m) => () => Ui(e, m, n, [
|
|
4477
4493
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4478
|
-
...
|
|
4494
|
+
...dc
|
|
4479
4495
|
])
|
|
4480
4496
|
]).transformed[0], a = e._compilerOptionsForPrinter, c = e._typeScriptPrinter, d = a.sourceMap ? Re.createSourceMapGenerator(
|
|
4481
4497
|
e.typeScriptHost,
|
|
@@ -4493,7 +4509,7 @@ const oc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4493
4509
|
}
|
|
4494
4510
|
}
|
|
4495
4511
|
});
|
|
4496
|
-
function
|
|
4512
|
+
function uc(e) {
|
|
4497
4513
|
const t = e.typeScriptConfig;
|
|
4498
4514
|
return {
|
|
4499
4515
|
...t,
|
|
@@ -4525,7 +4541,7 @@ function dc(e) {
|
|
|
4525
4541
|
skipLibCheck: !0
|
|
4526
4542
|
};
|
|
4527
4543
|
}
|
|
4528
|
-
function
|
|
4544
|
+
function fc(e) {
|
|
4529
4545
|
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : cs(t ?? "tsconfig.json");
|
|
4530
4546
|
if (i === void 0)
|
|
4531
4547
|
throw Error(
|
|
@@ -4539,7 +4555,7 @@ function pc(e) {
|
|
|
4539
4555
|
if (n.error !== void 0)
|
|
4540
4556
|
throw Error(
|
|
4541
4557
|
o.formatDiagnosticsWithColorAndContext([n.error], {
|
|
4542
|
-
getCanonicalFileName:
|
|
4558
|
+
getCanonicalFileName: Di,
|
|
4543
4559
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
4544
4560
|
getNewLine: () => o.sys.newLine
|
|
4545
4561
|
})
|
|
@@ -4564,11 +4580,11 @@ function Mn(e) {
|
|
|
4564
4580
|
const i = o.ScriptTarget[t].toLowerCase();
|
|
4565
4581
|
return i === "latest" ? "esnext" : i;
|
|
4566
4582
|
}
|
|
4567
|
-
function
|
|
4583
|
+
function gc(e, t) {
|
|
4568
4584
|
if (e.isInStorybook && e.viteCommand === "serve") {
|
|
4569
4585
|
const i = (a, c, d, ...l) => {
|
|
4570
4586
|
const p = a.filter(
|
|
4571
|
-
(f) => (!f.includes(".stories.") || f.endsWith(".tsx")) && !
|
|
4587
|
+
(f) => (!f.includes(".stories.") || f.endsWith(".tsx")) && !Wi(f)
|
|
4572
4588
|
);
|
|
4573
4589
|
return e.typeScriptHost = d, o.createAbstractBuilder(p, c, d, ...l);
|
|
4574
4590
|
}, n = o.createWatchCompilerHost(
|
|
@@ -4583,19 +4599,19 @@ function mc(e, t) {
|
|
|
4583
4599
|
d[0] === "timerToUpdateProgram" ? s : c,
|
|
4584
4600
|
...d
|
|
4585
4601
|
), n.afterProgramCreate = (a) => {
|
|
4586
|
-
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new
|
|
4602
|
+
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Ri();
|
|
4587
4603
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4588
4604
|
}
|
|
4589
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter =
|
|
4605
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = uc(e), e._typeScriptPrinter = Fi(e._compilerOptionsForPrinter);
|
|
4590
4606
|
}
|
|
4591
4607
|
const St = "@arcgis/core", dt = R(), Pe = St in (dt.dependencies ?? {}) || St in (dt.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
4592
4608
|
dt.name === "@arcgis/lumina";
|
|
4593
|
-
async function
|
|
4609
|
+
async function yc(e, t, i) {
|
|
4594
4610
|
if (!Pe)
|
|
4595
4611
|
return [];
|
|
4596
|
-
const n = await
|
|
4612
|
+
const n = await ki(St);
|
|
4597
4613
|
if (t === "cdn") {
|
|
4598
|
-
const s = await
|
|
4614
|
+
const s = await Ai(n), r = Xe({ name: "", version: s.version }, i);
|
|
4599
4615
|
return [
|
|
4600
4616
|
// Use the ESM CDN
|
|
4601
4617
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -4611,23 +4627,23 @@ async function uc(e, t, i) {
|
|
|
4611
4627
|
})
|
|
4612
4628
|
},
|
|
4613
4629
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
4614
|
-
|
|
4630
|
+
ui(r)
|
|
4615
4631
|
];
|
|
4616
4632
|
} else
|
|
4617
|
-
return [
|
|
4633
|
+
return [ui(Lt(e, `${n}/assets/`))];
|
|
4618
4634
|
}
|
|
4619
|
-
const
|
|
4635
|
+
const ui = (e) => ({
|
|
4620
4636
|
// Not using join() because it would turn https:// into https:/
|
|
4621
4637
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
4622
4638
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
4623
4639
|
id: "arcgisCoreStylesheet"
|
|
4624
4640
|
});
|
|
4625
|
-
async function
|
|
4641
|
+
async function hc(e, t, i) {
|
|
4626
4642
|
const n = u.resolve(e.dir.root, t);
|
|
4627
|
-
e.viteConfig.build.emptyOutDir !== !1 && await U(n) && await
|
|
4643
|
+
e.viteConfig.build.emptyOutDir !== !1 && await U(n) && await Is(n, { recursive: !0, force: !0 }), await ee(n, { recursive: !0 }), await ks(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4628
4644
|
const s = [
|
|
4629
4645
|
"index.html",
|
|
4630
|
-
...await
|
|
4646
|
+
...await Ls("**/*.html", {
|
|
4631
4647
|
cwd: e.dir.src,
|
|
4632
4648
|
nodir: !0,
|
|
4633
4649
|
posix: !0
|
|
@@ -4676,7 +4692,7 @@ const Jn = /* @__PURE__ */ new Set([
|
|
|
4676
4692
|
"extras",
|
|
4677
4693
|
"support"
|
|
4678
4694
|
]), _ = "@arcgis/lumina:buildCdn", xe = "cdn", Kn = "index", ne = "main";
|
|
4679
|
-
function
|
|
4695
|
+
function vc(e) {
|
|
4680
4696
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {}, entrypointTransformer: s } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
4681
4697
|
if (a) {
|
|
4682
4698
|
if (i.toLowerCase() !== i)
|
|
@@ -4693,7 +4709,7 @@ function gc(e) {
|
|
|
4693
4709
|
if (e.provideAssets([
|
|
4694
4710
|
{
|
|
4695
4711
|
type: "dynamic",
|
|
4696
|
-
source: () =>
|
|
4712
|
+
source: () => ro(e),
|
|
4697
4713
|
destination: `../${a ? c : ne}.css`
|
|
4698
4714
|
}
|
|
4699
4715
|
]), !t)
|
|
@@ -4709,7 +4725,7 @@ function gc(e) {
|
|
|
4709
4725
|
);
|
|
4710
4726
|
return;
|
|
4711
4727
|
}
|
|
4712
|
-
const d = Pe && R().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(n.entryPoints) ? n.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([g, y]) => ({ in: y, out: g })) : [], f = await
|
|
4728
|
+
const d = Pe && R().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(n.entryPoints) ? n.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([g, y]) => ({ in: y, out: g })) : [], f = await bc(
|
|
4713
4729
|
e,
|
|
4714
4730
|
c,
|
|
4715
4731
|
n,
|
|
@@ -4717,7 +4733,7 @@ function gc(e) {
|
|
|
4717
4733
|
s,
|
|
4718
4734
|
d
|
|
4719
4735
|
);
|
|
4720
|
-
await
|
|
4736
|
+
await Sc(
|
|
4721
4737
|
f,
|
|
4722
4738
|
e,
|
|
4723
4739
|
a ? `${c}.esm` : c,
|
|
@@ -4725,11 +4741,11 @@ function gc(e) {
|
|
|
4725
4741
|
d
|
|
4726
4742
|
);
|
|
4727
4743
|
const m = Date.now();
|
|
4728
|
-
T.info(_, `CDN was built in ${m - l}ms`), r && await
|
|
4744
|
+
T.info(_, `CDN was built in ${m - l}ms`), r && await hc(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
4729
4745
|
}
|
|
4730
4746
|
};
|
|
4731
4747
|
}
|
|
4732
|
-
async function
|
|
4748
|
+
async function bc(e, t, i, n, s, r) {
|
|
4733
4749
|
const a = e.environment;
|
|
4734
4750
|
if (i.minify && r)
|
|
4735
4751
|
throw Error(
|
|
@@ -4752,8 +4768,8 @@ async function yc(e, t, i, n, s, r) {
|
|
|
4752
4768
|
* The script's file name will be stripped inside defineCustomElements.
|
|
4753
4769
|
**/
|
|
4754
4770
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
4755
|
-
${
|
|
4756
|
-
return await
|
|
4771
|
+
${cn(e._globalCssString, e)}`, d = s?.(c, e) ?? c;
|
|
4772
|
+
return await Ns({
|
|
4757
4773
|
bundle: !0,
|
|
4758
4774
|
minify: r ? !0 : a === "production",
|
|
4759
4775
|
treeShaking: !0,
|
|
@@ -4837,7 +4853,7 @@ ${ln(e._globalCssString, e)}`, d = s?.(c, e) ?? c;
|
|
|
4837
4853
|
}
|
|
4838
4854
|
});
|
|
4839
4855
|
}
|
|
4840
|
-
async function
|
|
4856
|
+
async function Sc(e, t, i, n, s) {
|
|
4841
4857
|
const r = t.dir.distCdn, a = `${i}.js`, c = new Map(
|
|
4842
4858
|
e.outputFiles.map((d) => {
|
|
4843
4859
|
const l = {
|
|
@@ -4848,13 +4864,13 @@ async function hc(e, t, i, n, s) {
|
|
|
4848
4864
|
}, p = d.path.slice(r.length);
|
|
4849
4865
|
if (p === "stdin.js") {
|
|
4850
4866
|
if (s) {
|
|
4851
|
-
const m = d.text.match(
|
|
4867
|
+
const m = d.text.match(wc)?.[0];
|
|
4852
4868
|
if (m === void 0)
|
|
4853
4869
|
throw Error(
|
|
4854
4870
|
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. stdin.js contents:
|
|
4855
4871
|
${d.text}`
|
|
4856
4872
|
);
|
|
4857
|
-
l.code = `${l.code.trimEnd()}${
|
|
4873
|
+
l.code = `${l.code.trimEnd()}${Tc(m, n)}`, l.isAsync = !1;
|
|
4858
4874
|
}
|
|
4859
4875
|
return [a, l];
|
|
4860
4876
|
}
|
|
@@ -4865,8 +4881,8 @@ ${d.text}`
|
|
|
4865
4881
|
d.isAsync === void 0 && (l.endsWith(".js") ? Bn(d, c) : d.isAsync = !1);
|
|
4866
4882
|
}), t.options.build?.cdn?.transformer?.(c, t), await Promise.all(Array.from(c.entries(), async ([d, { code: l }]) => await F(r + d, l)));
|
|
4867
4883
|
}
|
|
4868
|
-
const
|
|
4869
|
-
function
|
|
4884
|
+
const wc = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
4885
|
+
function Tc(e, t) {
|
|
4870
4886
|
let i = [
|
|
4871
4887
|
"window.$arcgis",
|
|
4872
4888
|
"||",
|
|
@@ -4909,13 +4925,13 @@ function bc(e, t) {
|
|
|
4909
4925
|
}
|
|
4910
4926
|
function Bn(e, t) {
|
|
4911
4927
|
if (e.isProcessing) {
|
|
4912
|
-
e.isAsync = !0,
|
|
4928
|
+
e.isAsync = !0, fi(e);
|
|
4913
4929
|
return;
|
|
4914
4930
|
}
|
|
4915
4931
|
e.isProcessing = !0;
|
|
4916
4932
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4917
4933
|
let c = 0;
|
|
4918
|
-
const d = e.code.matchAll(
|
|
4934
|
+
const d = e.code.matchAll(Ec);
|
|
4919
4935
|
for (const S of d) {
|
|
4920
4936
|
const [k, N, q, D, L] = S, W = L.startsWith(Ve);
|
|
4921
4937
|
if (c !== 0 && c !== S.index) {
|
|
@@ -4954,10 +4970,10 @@ ${O.code}`
|
|
|
4954
4970
|
e.isProcessing = !1;
|
|
4955
4971
|
const l = e.isAsync === !0;
|
|
4956
4972
|
if (e.isAsync = l || a.length > 0, !e.isAsync) {
|
|
4957
|
-
e.code =
|
|
4973
|
+
e.code = gi(e.code, t);
|
|
4958
4974
|
return;
|
|
4959
4975
|
}
|
|
4960
|
-
const p =
|
|
4976
|
+
const p = Pc(r);
|
|
4961
4977
|
let f = e.code.slice(0, c);
|
|
4962
4978
|
for (let S = a.length - 1; S >= 0; S--) {
|
|
4963
4979
|
const [k, N, q, D] = a[S];
|
|
@@ -4968,14 +4984,14 @@ ${O.code}`
|
|
|
4968
4984
|
}
|
|
4969
4985
|
f = f.slice(0, k) + W + f.slice(k + L);
|
|
4970
4986
|
}
|
|
4971
|
-
const [m, g] =
|
|
4987
|
+
const [m, g] = fi(e), y = i.findLastIndex((S) => S.length > 0), h = i.slice(0, y + 1).join(","), b = `export default $arcgis.t(${i.length === 0 ? "_" : `([${h}])`}=>{`, w = n.join(","), I = `${g}},${w})`;
|
|
4972
4988
|
let A = e.code.slice(c, m);
|
|
4973
|
-
A = `${s.join("")}${A}`, A =
|
|
4989
|
+
A = `${s.join("")}${A}`, A = gi(A, t);
|
|
4974
4990
|
const C = `${f}${b}${A}${I}`;
|
|
4975
4991
|
e.code = C;
|
|
4976
4992
|
}
|
|
4977
|
-
function
|
|
4978
|
-
const t =
|
|
4993
|
+
function fi(e) {
|
|
4994
|
+
const t = Cc.exec(e.code), i = t?.index ?? e.code.length;
|
|
4979
4995
|
let n = "";
|
|
4980
4996
|
if (t !== null) {
|
|
4981
4997
|
const s = t[1].split(",");
|
|
@@ -4991,7 +5007,7 @@ function gi(e) {
|
|
|
4991
5007
|
}
|
|
4992
5008
|
return [i, n];
|
|
4993
5009
|
}
|
|
4994
|
-
const
|
|
5010
|
+
const Ec = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Cc = /export\{([^}]+)\};\n$/u, Ve = "@arcgis/core/";
|
|
4995
5011
|
function _n(e, t) {
|
|
4996
5012
|
if (!e.startsWith("./"))
|
|
4997
5013
|
return;
|
|
@@ -5002,8 +5018,8 @@ function _n(e, t) {
|
|
|
5002
5018
|
throw Error(E(_, `Failed to infer whether the ${e} module has top-level await`));
|
|
5003
5019
|
return n;
|
|
5004
5020
|
}
|
|
5005
|
-
function
|
|
5006
|
-
return e.replaceAll(
|
|
5021
|
+
function gi(e, t) {
|
|
5022
|
+
return e.replaceAll($c, (i, n) => {
|
|
5007
5023
|
if (n.startsWith(Ve))
|
|
5008
5024
|
return `$arcgis.t(m=>m[0],"${Wn(n.slice(Ve.length))}")`;
|
|
5009
5025
|
if (n.startsWith("./")) {
|
|
@@ -5014,28 +5030,28 @@ function yi(e, t) {
|
|
|
5014
5030
|
return i;
|
|
5015
5031
|
});
|
|
5016
5032
|
}
|
|
5017
|
-
const
|
|
5018
|
-
function
|
|
5033
|
+
const $c = /(?<![.\w\d])import\("([^"]+)"\)/gu, Wn = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
5034
|
+
function Pc(e) {
|
|
5019
5035
|
const t = [wt];
|
|
5020
5036
|
return () => {
|
|
5021
5037
|
for (; ; ) {
|
|
5022
|
-
const i =
|
|
5023
|
-
if (
|
|
5038
|
+
const i = kc(t);
|
|
5039
|
+
if (Ac(t), !e.has(i))
|
|
5024
5040
|
return e.add(i), i;
|
|
5025
5041
|
}
|
|
5026
5042
|
};
|
|
5027
5043
|
}
|
|
5028
|
-
const wt = 0, Rt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Hn = `${Rt}0123456789`,
|
|
5029
|
-
function
|
|
5044
|
+
const wt = 0, Rt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Hn = `${Rt}0123456789`, xc = Rt.length, Ic = Hn.length;
|
|
5045
|
+
function kc(e) {
|
|
5030
5046
|
let t = Rt[e[0]];
|
|
5031
5047
|
for (let i = 1; i < e.length; i++)
|
|
5032
5048
|
t += Hn[e[i]];
|
|
5033
5049
|
return t;
|
|
5034
5050
|
}
|
|
5035
|
-
function
|
|
5051
|
+
function Ac(e) {
|
|
5036
5052
|
let t = e.length - 1;
|
|
5037
5053
|
for (; t >= 0; ) {
|
|
5038
|
-
const i = t === 0 ?
|
|
5054
|
+
const i = t === 0 ? xc : Ic;
|
|
5039
5055
|
if (e[t] += 1, e[t] >= i)
|
|
5040
5056
|
e[t] = wt, t--;
|
|
5041
5057
|
else
|
|
@@ -5043,7 +5059,7 @@ function xc(e) {
|
|
|
5043
5059
|
}
|
|
5044
5060
|
e.push(wt);
|
|
5045
5061
|
}
|
|
5046
|
-
async function
|
|
5062
|
+
async function Nc(e, t, i, n, s) {
|
|
5047
5063
|
const r = t.packageName, { hasCss: a, cdnName: c } = await Un(t.packageLocation) ?? {};
|
|
5048
5064
|
if (i === "cdn") {
|
|
5049
5065
|
const f = t.cdnUrl ?? Xe(t.packageJson, s);
|
|
@@ -5095,10 +5111,10 @@ async function Un(e) {
|
|
|
5095
5111
|
a === i
|
|
5096
5112
|
);
|
|
5097
5113
|
return r === void 0 ? await Promise.all(
|
|
5098
|
-
s.map(async (a) => await
|
|
5099
|
-
).then((a) => a.find(j)) : await
|
|
5114
|
+
s.map(async (a) => await yi(t, a))
|
|
5115
|
+
).then((a) => a.find(j)) : await yi(t, r);
|
|
5100
5116
|
}
|
|
5101
|
-
async function
|
|
5117
|
+
async function yi(e, t) {
|
|
5102
5118
|
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), s = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
|
|
5103
5119
|
U(i),
|
|
5104
5120
|
U(n),
|
|
@@ -5109,7 +5125,7 @@ async function hi(e, t) {
|
|
|
5109
5125
|
cdnName: t
|
|
5110
5126
|
} : void 0;
|
|
5111
5127
|
}
|
|
5112
|
-
async function
|
|
5128
|
+
async function Lc(e, t, i, n, s) {
|
|
5113
5129
|
const a = t.packageJson.exports?.[`./${ne}.css`] === void 0 ? await Un(t.packageLocation) : void 0, c = a?.cdnName ?? xe, d = a === void 0 ? `${Kn}.js` : `${a.cdnName}.esm.js`;
|
|
5114
5130
|
if (i === "cdn")
|
|
5115
5131
|
return {
|
|
@@ -5119,7 +5135,7 @@ async function kc(e, t, i, n, s) {
|
|
|
5119
5135
|
src: `${t.cdnUrl ?? Xe(t.packageJson, s)}${d}`
|
|
5120
5136
|
}
|
|
5121
5137
|
};
|
|
5122
|
-
const l =
|
|
5138
|
+
const l = Fc(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${ie}`, f = [
|
|
5123
5139
|
`import styles$${n} from "${p}";`,
|
|
5124
5140
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5125
5141
|
], m = `${t.packageName}/loader`;
|
|
@@ -5138,7 +5154,7 @@ async function kc(e, t, i, n, s) {
|
|
|
5138
5154
|
]
|
|
5139
5155
|
};
|
|
5140
5156
|
}
|
|
5141
|
-
function
|
|
5157
|
+
function Fc(e) {
|
|
5142
5158
|
const { exports: t } = e;
|
|
5143
5159
|
if (t === void 0)
|
|
5144
5160
|
throw new Error(
|
|
@@ -5148,19 +5164,19 @@ function Ac(e) {
|
|
|
5148
5164
|
return n ? n[0] : i.length > 0 ? i[0][0] : `./${ne}.css`;
|
|
5149
5165
|
}
|
|
5150
5166
|
async function Ee(e) {
|
|
5151
|
-
return e._loadersCache ??=
|
|
5167
|
+
return e._loadersCache ??= jc(e), await e._loadersCache;
|
|
5152
5168
|
}
|
|
5153
|
-
async function
|
|
5169
|
+
async function jc(e) {
|
|
5154
5170
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", n = e.viteConfig.base;
|
|
5155
5171
|
let s = 0;
|
|
5156
5172
|
const r = async (l) => (await Promise.all(
|
|
5157
5173
|
l.map(async (p) => {
|
|
5158
5174
|
const f = s++;
|
|
5159
|
-
return p.type === "stencil" ? await
|
|
5175
|
+
return p.type === "stencil" ? await Nc(n, p, t, f, i) : p.type === "@arcgis/lumina" ? await Lc(n, p, t, f, i) : void 0;
|
|
5160
5176
|
})
|
|
5161
5177
|
)).filter(j).flat(), a = await Promise.all([
|
|
5162
5178
|
// This may contain an import map so must be first
|
|
5163
|
-
|
|
5179
|
+
yc(n, t, i),
|
|
5164
5180
|
le.then(r),
|
|
5165
5181
|
zn(e).then(r)
|
|
5166
5182
|
]), c = u.join(e.dir.src, "loader.ts");
|
|
@@ -5200,8 +5216,8 @@ async function zn(e) {
|
|
|
5200
5216
|
})
|
|
5201
5217
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
5202
5218
|
}
|
|
5203
|
-
const
|
|
5204
|
-
async function
|
|
5219
|
+
const Dc = "/@arcgis/lumina-compiler/testSetupFile", Rc = /^\/@arcgis\/lumina-compiler\/testSetupFile/u, pt = [Dc];
|
|
5220
|
+
async function Oc(e) {
|
|
5205
5221
|
if (
|
|
5206
5222
|
/**
|
|
5207
5223
|
* Only import custom element dependencies if we are running in Vitest browser mode.
|
|
@@ -5213,7 +5229,7 @@ async function jc(e) {
|
|
|
5213
5229
|
*/
|
|
5214
5230
|
!e.apiJsonEnabled
|
|
5215
5231
|
)
|
|
5216
|
-
return
|
|
5232
|
+
return hi(e);
|
|
5217
5233
|
const i = (await Ee(e)).map((n, s) => {
|
|
5218
5234
|
if ("javascriptCode" in n)
|
|
5219
5235
|
return n.javascriptCode.join(`
|
|
@@ -5237,14 +5253,14 @@ async function jc(e) {
|
|
|
5237
5253
|
}).join(`
|
|
5238
5254
|
|
|
5239
5255
|
`);
|
|
5240
|
-
return [
|
|
5256
|
+
return [hi(e), i].join("");
|
|
5241
5257
|
}
|
|
5242
|
-
const
|
|
5258
|
+
const hi = (e) => [e.isInPuppeteerTestBackEnd ? Mc : "", Jc].join(""), Mc = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
5243
5259
|
setupPuppeteerTest();
|
|
5244
|
-
`,
|
|
5260
|
+
`, Jc = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
5245
5261
|
setupLuminaTest();
|
|
5246
5262
|
`;
|
|
5247
|
-
function
|
|
5263
|
+
function Kc(e) {
|
|
5248
5264
|
let t = !1, i, n;
|
|
5249
5265
|
const s = /[\\\/]src[\\\/]loader\.ts$/u, r = "@arcgis/lumina:generateLoaderTs", a = {
|
|
5250
5266
|
name: r,
|
|
@@ -5259,18 +5275,18 @@ function Oc(e) {
|
|
|
5259
5275
|
handler: () => n
|
|
5260
5276
|
},
|
|
5261
5277
|
buildStart() {
|
|
5262
|
-
i = void 0, e.apiJsonDeferred = new
|
|
5278
|
+
i = void 0, e.apiJsonDeferred = new Ri(), t = !1, e.isInBuildWatch && this.addWatchFile(e.dir.srcComponents);
|
|
5263
5279
|
},
|
|
5264
5280
|
load: {
|
|
5265
5281
|
filter: {
|
|
5266
5282
|
id: s
|
|
5267
5283
|
},
|
|
5268
5284
|
async handler() {
|
|
5269
|
-
return i === void 0 && e.apiJsonEnabled && (i =
|
|
5285
|
+
return i === void 0 && e.apiJsonEnabled && (i = Jo(e, t), t = !0, await i, e.apiJsonDeferred.resolve()), oo(e);
|
|
5270
5286
|
}
|
|
5271
5287
|
},
|
|
5272
5288
|
async writeBundle() {
|
|
5273
|
-
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"),
|
|
5289
|
+
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"), ao);
|
|
5274
5290
|
},
|
|
5275
5291
|
async handleHotUpdate({ file: m, modules: g, read: y }) {
|
|
5276
5292
|
const h = await c(m, y);
|
|
@@ -5330,11 +5346,11 @@ function Oc(e) {
|
|
|
5330
5346
|
if (!we(m, e.dir.srcComponents))
|
|
5331
5347
|
return;
|
|
5332
5348
|
y ??= await g();
|
|
5333
|
-
const v =
|
|
5349
|
+
const v = Ko(e, m, y);
|
|
5334
5350
|
if (v === void 0)
|
|
5335
5351
|
return !1;
|
|
5336
5352
|
for (const b of v) {
|
|
5337
|
-
const w =
|
|
5353
|
+
const w = ln(b);
|
|
5338
5354
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: w });
|
|
5339
5355
|
}
|
|
5340
5356
|
return l(), !0;
|
|
@@ -5354,9 +5370,9 @@ function Oc(e) {
|
|
|
5354
5370
|
name: "@arcgis/lumina:generateTestSetupVirtualFile",
|
|
5355
5371
|
load: {
|
|
5356
5372
|
filter: {
|
|
5357
|
-
id:
|
|
5373
|
+
id: Rc
|
|
5358
5374
|
},
|
|
5359
|
-
handler: async () => await
|
|
5375
|
+
handler: async () => await Oc(e)
|
|
5360
5376
|
}
|
|
5361
5377
|
}];
|
|
5362
5378
|
}
|
|
@@ -5366,12 +5382,12 @@ function he(e, t, i = Ot) {
|
|
|
5366
5382
|
throw Error(E(Tt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5367
5383
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5368
5384
|
if (t.forEach((r) => {
|
|
5369
|
-
const a = Vn(r), c = Xn(e.dir, Gn(a)), d =
|
|
5385
|
+
const a = Vn(r), c = Xn(e.dir, Gn(a)), d = _c(e.viteConfig.base, c, e.dir.distCdn);
|
|
5370
5386
|
e.server.middlewares.use(d, (l, p, f) => {
|
|
5371
|
-
const m =
|
|
5387
|
+
const m = Wc(l.url), g = a.type === "directory" ? u.resolve(a.source, m.slice(1)) : a.source, y = u.join(c, m), h = i.find((v) => v.match(y, e));
|
|
5372
5388
|
return (typeof g == "function" ? Promise.resolve(g()) : B(g)).then((v) => {
|
|
5373
5389
|
const b = (typeof g == "function" ? void 0 : h?.transform(v.toString("utf8"), y, e)) ?? v;
|
|
5374
|
-
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type",
|
|
5390
|
+
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Fs.lookup(m) || "application/octet-stream"), p.write(b), p.end();
|
|
5375
5391
|
}).catch((v) => {
|
|
5376
5392
|
(a.type !== "directory" || process.env.DEBUG) && T.warn(
|
|
5377
5393
|
Tt,
|
|
@@ -5395,11 +5411,11 @@ async function qn(e, t, i = Ot) {
|
|
|
5395
5411
|
});
|
|
5396
5412
|
await Zn(d.map(([l, p]) => p)), await Promise.all(
|
|
5397
5413
|
d.map(
|
|
5398
|
-
async ([l, p]) => await
|
|
5414
|
+
async ([l, p]) => await vi(l, p, i, e)
|
|
5399
5415
|
)
|
|
5400
5416
|
);
|
|
5401
5417
|
} else if (s.type === "file")
|
|
5402
|
-
await ee(u.dirname(r), { recursive: !0 }), await
|
|
5418
|
+
await ee(u.dirname(r), { recursive: !0 }), await vi(s.source, r, i, e);
|
|
5403
5419
|
else if (s.type === "dynamic") {
|
|
5404
5420
|
await ee(u.dirname(r), { recursive: !0 });
|
|
5405
5421
|
const a = await Promise.resolve(s.source());
|
|
@@ -5408,7 +5424,7 @@ async function qn(e, t, i = Ot) {
|
|
|
5408
5424
|
})
|
|
5409
5425
|
);
|
|
5410
5426
|
}
|
|
5411
|
-
const Vn =
|
|
5427
|
+
const Vn = Ni ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5412
5428
|
...e,
|
|
5413
5429
|
destination: De(e.destination)
|
|
5414
5430
|
} : {
|
|
@@ -5416,10 +5432,10 @@ const Vn = Li ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
5416
5432
|
source: De(e.source),
|
|
5417
5433
|
destination: De(e.destination)
|
|
5418
5434
|
};
|
|
5419
|
-
async function
|
|
5435
|
+
async function vi(e, t, i, n) {
|
|
5420
5436
|
const s = i.find((r) => r.match(t, n));
|
|
5421
5437
|
if (s === void 0)
|
|
5422
|
-
await
|
|
5438
|
+
await As(e, t);
|
|
5423
5439
|
else {
|
|
5424
5440
|
const r = await B(e, "utf8"), a = s.transform(r, t, n);
|
|
5425
5441
|
await F(t, a);
|
|
@@ -5441,33 +5457,33 @@ function Gn(e) {
|
|
|
5441
5457
|
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
5442
5458
|
}
|
|
5443
5459
|
function Xn({ dist: e, distCdnAssets: t }, i) {
|
|
5444
|
-
const n =
|
|
5460
|
+
const n = Bc(i), s = u.join(
|
|
5445
5461
|
t,
|
|
5446
5462
|
n ? u.relative(t, i) : i
|
|
5447
5463
|
), r = u.relative(e, s), a = Qn(r);
|
|
5448
5464
|
return u.join(e, a);
|
|
5449
5465
|
}
|
|
5450
|
-
function
|
|
5466
|
+
function Bc(e) {
|
|
5451
5467
|
if (e.startsWith(u.sep)) {
|
|
5452
|
-
const t =
|
|
5468
|
+
const t = Li(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5453
5469
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5454
5470
|
} else
|
|
5455
|
-
return !!(!
|
|
5471
|
+
return !!(!Ni && u.isAbsolute(e));
|
|
5456
5472
|
}
|
|
5457
|
-
function
|
|
5473
|
+
function _c(e, t, i) {
|
|
5458
5474
|
const n = Qn(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
5459
5475
|
return `${e}${s}`;
|
|
5460
5476
|
}
|
|
5461
|
-
const Qn = (e) => e.replaceAll("../", ""),
|
|
5477
|
+
const Qn = (e) => e.replaceAll("../", ""), Wc = (e = "") => e.split("?")[0].split("#")[0];
|
|
5462
5478
|
async function Zn(e) {
|
|
5463
5479
|
const t = new Set(e.map(u.dirname));
|
|
5464
5480
|
await Promise.all(Array.from(t, async (i) => await ee(i, { recursive: !0 })));
|
|
5465
5481
|
}
|
|
5466
|
-
const
|
|
5482
|
+
const Hc = {
|
|
5467
5483
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5468
5484
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5469
|
-
}, Ot = [
|
|
5470
|
-
function
|
|
5485
|
+
}, Ot = [Hc];
|
|
5486
|
+
function Uc(e) {
|
|
5471
5487
|
let t;
|
|
5472
5488
|
const i = () => [
|
|
5473
5489
|
...e.options.assets?.transformers ?? [],
|
|
@@ -5490,10 +5506,10 @@ function _c(e) {
|
|
|
5490
5506
|
* `configureServer`.
|
|
5491
5507
|
*/
|
|
5492
5508
|
configResolved() {
|
|
5493
|
-
e.viteCommand === "serve" && (t =
|
|
5509
|
+
e.viteCommand === "serve" && (t = bi(e));
|
|
5494
5510
|
},
|
|
5495
5511
|
options() {
|
|
5496
|
-
e.viteCommand === "build" && (t =
|
|
5512
|
+
e.viteCommand === "build" && (t = bi(e));
|
|
5497
5513
|
},
|
|
5498
5514
|
async configureServer(n) {
|
|
5499
5515
|
e.server = n, he(e, await t, i()), n.watcher.on("addDir", (s) => {
|
|
@@ -5508,7 +5524,7 @@ function _c(e) {
|
|
|
5508
5524
|
}
|
|
5509
5525
|
};
|
|
5510
5526
|
}
|
|
5511
|
-
async function
|
|
5527
|
+
async function bi(e) {
|
|
5512
5528
|
const t = U("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5513
5529
|
i.map(async (s) => {
|
|
5514
5530
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
@@ -5521,7 +5537,7 @@ const Yn = (e, t) => ({
|
|
|
5521
5537
|
type: "directory",
|
|
5522
5538
|
source: e,
|
|
5523
5539
|
destination: u.basename(t)
|
|
5524
|
-
}), es = { type: "directory", source: "assets/", destination: "" }, mt = "@arcgis/lumina:printTotalBuildSize",
|
|
5540
|
+
}), es = { type: "directory", source: "assets/", destination: "" }, mt = "@arcgis/lumina:printTotalBuildSize", zc = (e) => ({
|
|
5525
5541
|
name: mt,
|
|
5526
5542
|
apply: () => e.viteCommand === "build",
|
|
5527
5543
|
configResolved(t) {
|
|
@@ -5540,10 +5556,10 @@ const Yn = (e, t) => ({
|
|
|
5540
5556
|
const f = console.log;
|
|
5541
5557
|
console.log = function(...g) {
|
|
5542
5558
|
if (f.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
5543
|
-
const [y, h] = g[0].match(
|
|
5559
|
+
const [y, h] = g[0].match(Vc) ?? [];
|
|
5544
5560
|
if (!y)
|
|
5545
5561
|
return;
|
|
5546
|
-
p || (p = g[0].slice(0, g[0].indexOf(y) + y.length).replaceAll(
|
|
5562
|
+
p || (p = g[0].slice(0, g[0].indexOf(y) + y.length).replaceAll(Gc, "").length);
|
|
5547
5563
|
const v = Number.parseFloat(y.replace(" kB", "").replaceAll(",", ""));
|
|
5548
5564
|
h ? (l += Number.parseFloat(h.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
|
|
5549
5565
|
}
|
|
@@ -5554,27 +5570,27 @@ const Yn = (e, t) => ({
|
|
|
5554
5570
|
console.log = f;
|
|
5555
5571
|
}
|
|
5556
5572
|
if (d > 0) {
|
|
5557
|
-
const g = l > 0 ? d : c, y =
|
|
5573
|
+
const g = l > 0 ? d : c, y = Ti(g), h = e.dir.relativeDist;
|
|
5558
5574
|
console.log(
|
|
5559
5575
|
[
|
|
5560
|
-
|
|
5576
|
+
wi,
|
|
5561
5577
|
h,
|
|
5562
|
-
|
|
5578
|
+
qc,
|
|
5563
5579
|
"*",
|
|
5564
5580
|
" ".repeat(p - `${h}*`.length - y.length),
|
|
5565
5581
|
y,
|
|
5566
|
-
|
|
5567
|
-
l > 0 ? ` ${
|
|
5582
|
+
Si,
|
|
5583
|
+
l > 0 ? ` ${wi}│ gzip: ${Ti(l)}${Si}` : ""
|
|
5568
5584
|
].join("")
|
|
5569
5585
|
);
|
|
5570
5586
|
}
|
|
5571
5587
|
};
|
|
5572
5588
|
}
|
|
5573
|
-
}),
|
|
5589
|
+
}), Si = "\x1B[22m\x1B[1m\x1B[22m", wi = "\x1B[2m", qc = "\x1B[22m\x1B[36m", Vc = /\d+(?:,\d+)?\.\d{2} kB/gu, Gc = /\x1B\[\d+m/gu, Xc = new Intl.NumberFormat("en", {
|
|
5574
5590
|
maximumFractionDigits: 2,
|
|
5575
5591
|
minimumFractionDigits: 2
|
|
5576
|
-
}),
|
|
5577
|
-
name:
|
|
5592
|
+
}), Ti = (e) => `${Xc.format(e)} kB`, Ei = "@arcgis/lumina:configureVite", Qc = (e) => ({
|
|
5593
|
+
name: Ei,
|
|
5578
5594
|
async config({
|
|
5579
5595
|
server: t,
|
|
5580
5596
|
publicDir: i,
|
|
@@ -5676,7 +5692,7 @@ const Yn = (e, t) => ({
|
|
|
5676
5692
|
if (typeof p.setupFiles == "string" ? p.setupFiles = [...pt, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...pt, ...p.setupFiles] : p.setupFiles = [...pt], e.isInPuppeteerTestBackEnd) {
|
|
5677
5693
|
if (g?.enabled === !0)
|
|
5678
5694
|
throw Error(
|
|
5679
|
-
E(
|
|
5695
|
+
E(Ei, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5680
5696
|
);
|
|
5681
5697
|
return {
|
|
5682
5698
|
test: {
|
|
@@ -5771,22 +5787,22 @@ const Yn = (e, t) => ({
|
|
|
5771
5787
|
e._originalRollupInputOptions ??= t.input;
|
|
5772
5788
|
const n = { ...e._originalRollupInputOptions };
|
|
5773
5789
|
i.forEach((s) => {
|
|
5774
|
-
const r =
|
|
5790
|
+
const r = dn(s);
|
|
5775
5791
|
n[r] = s;
|
|
5776
5792
|
}), t.input = n;
|
|
5777
5793
|
}
|
|
5778
|
-
}),
|
|
5794
|
+
}), Zc = (e) => ({
|
|
5779
5795
|
name: "@arcgis/lumina:setAssetPath",
|
|
5780
5796
|
apply: () => e.viteCommand === "build",
|
|
5781
5797
|
config: (t) => ({
|
|
5782
5798
|
base: t.base ?? e.options.assets?.defaultPath ?? Xe()
|
|
5783
5799
|
})
|
|
5784
5800
|
});
|
|
5785
|
-
function
|
|
5801
|
+
function Yc(e = R()) {
|
|
5786
5802
|
const t = e.version ?? "0.0.1";
|
|
5787
|
-
return
|
|
5803
|
+
return vs(t);
|
|
5788
5804
|
}
|
|
5789
|
-
const
|
|
5805
|
+
const el = (e) => `/*! ${e} */`, P = (e) => (t, i) => {
|
|
5790
5806
|
Object.defineProperty(t, i, {
|
|
5791
5807
|
get() {
|
|
5792
5808
|
throw Error(
|
|
@@ -5826,7 +5842,7 @@ const ye = {
|
|
|
5826
5842
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5827
5843
|
};
|
|
5828
5844
|
async function ts(e, t, i, n, s = R()) {
|
|
5829
|
-
const r =
|
|
5845
|
+
const r = tl(e, i, s), a = u.join(t, "lumina.ts"), d = await U(a) ? await B(a, "utf8") : "";
|
|
5830
5846
|
if (d.trim().replaceAll(`\r
|
|
5831
5847
|
`, `
|
|
5832
5848
|
`) === r.trim())
|
|
@@ -5844,9 +5860,9 @@ Current content:
|
|
|
5844
5860
|
${d}`
|
|
5845
5861
|
)
|
|
5846
5862
|
);
|
|
5847
|
-
return
|
|
5863
|
+
return Oi(a, r), !0;
|
|
5848
5864
|
}
|
|
5849
|
-
function
|
|
5865
|
+
function tl(e, t, i = R()) {
|
|
5850
5866
|
const n = e.filter((l) => l.type === "@arcgis/lumina").map((l) => `
|
|
5851
5867
|
/// <reference types="${l.packageName}/types/lumina" />`), s = e.filter((l) => l.type === "stencil"), r = s.map(
|
|
5852
5868
|
(l, p) => `
|
|
@@ -5857,11 +5873,11 @@ declare module "@arcgis/lumina" {
|
|
|
5857
5873
|
interface ImportStencilElements extends ${s.map((l, p) => `JSX$${p}.IntrinsicElements`).join(", ")} {}
|
|
5858
5874
|
}`, c = i.devDependencies ?? {};
|
|
5859
5875
|
return [
|
|
5860
|
-
|
|
5876
|
+
il,
|
|
5861
5877
|
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5862
5878
|
i.name === "@arcgis/lumina" ? "" : `
|
|
5863
5879
|
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5864
|
-
t ?
|
|
5880
|
+
t ? nl : "",
|
|
5865
5881
|
c.vitest ? `
|
|
5866
5882
|
/// <reference types="vitest/config" />
|
|
5867
5883
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -5872,7 +5888,7 @@ declare module "@arcgis/lumina" {
|
|
|
5872
5888
|
`
|
|
5873
5889
|
].join("");
|
|
5874
5890
|
}
|
|
5875
|
-
const
|
|
5891
|
+
const il = `/**
|
|
5876
5892
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5877
5893
|
* Manual edits will be overwritten.
|
|
5878
5894
|
*
|
|
@@ -5880,7 +5896,7 @@ const Yc = `/**
|
|
|
5880
5896
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5881
5897
|
*
|
|
5882
5898
|
* If you need to provide additional typings, create a separate file.
|
|
5883
|
-
*/`,
|
|
5899
|
+
*/`, nl = `
|
|
5884
5900
|
/// <reference types="@arcgis/core/interfaces" />`, Je = "@arcgis/lumina:dependencySupport", is = (e, t) => e.viteCommand === "serve" && /**
|
|
5885
5901
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5886
5902
|
* However, it is a bit buggy (see
|
|
@@ -5892,10 +5908,10 @@ const Yc = `/**
|
|
|
5892
5908
|
* is doing:
|
|
5893
5909
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5894
5910
|
*/
|
|
5895
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
5911
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, sl = (e) => ({
|
|
5896
5912
|
name: Je,
|
|
5897
5913
|
configResolved() {
|
|
5898
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
5914
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = rl(e).catch(
|
|
5899
5915
|
(t) => T.error(Je, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
5900
5916
|
));
|
|
5901
5917
|
},
|
|
@@ -5945,28 +5961,28 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5945
5961
|
await e._updateLuminaTsPromise;
|
|
5946
5962
|
}
|
|
5947
5963
|
});
|
|
5948
|
-
async function
|
|
5964
|
+
async function rl(e) {
|
|
5949
5965
|
const i = (await Promise.all([le, zn(e)])).flat();
|
|
5950
5966
|
if (!await ts(i, e.dir.src, Pe))
|
|
5951
5967
|
return;
|
|
5952
5968
|
let s = !1;
|
|
5953
5969
|
function r() {
|
|
5954
|
-
s || T.warn(Je,
|
|
5970
|
+
s || T.warn(Je, ol), s = !0;
|
|
5955
5971
|
}
|
|
5956
5972
|
process.on("exit", () => {
|
|
5957
5973
|
r(), clearTimeout(c);
|
|
5958
5974
|
});
|
|
5959
5975
|
const c = setTimeout(r, 2e3);
|
|
5960
5976
|
}
|
|
5961
|
-
const
|
|
5977
|
+
const ol = js.greenBright(
|
|
5962
5978
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
5963
5979
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
5964
5980
|
);
|
|
5965
|
-
async function
|
|
5981
|
+
async function al(e, t) {
|
|
5966
5982
|
const i = /* @__PURE__ */ new Map();
|
|
5967
5983
|
await Promise.all(
|
|
5968
5984
|
e.map(async (s) => {
|
|
5969
|
-
const r = await
|
|
5985
|
+
const r = await Ds(s, "utf-8"), a = r.match(cl)?.[1];
|
|
5970
5986
|
if (a === void 0) {
|
|
5971
5987
|
T.warn(
|
|
5972
5988
|
"@arcgis/lumina:parseStoryFiles",
|
|
@@ -5978,14 +5994,14 @@ async function sl(e, t) {
|
|
|
5978
5994
|
let c = i.get(a);
|
|
5979
5995
|
c === void 0 && (c = [], i.set(a, c));
|
|
5980
5996
|
const d = [];
|
|
5981
|
-
for (const l of r.matchAll(
|
|
5982
|
-
const p = l[1], f =
|
|
5997
|
+
for (const l of r.matchAll(ll)) {
|
|
5998
|
+
const p = l[1], f = ul(p), m = r.indexOf("{", l.index), g = r.indexOf("}", m), y = r.slice(0, l.index).trimEnd();
|
|
5983
5999
|
let h = "";
|
|
5984
6000
|
if (y.endsWith("*/")) {
|
|
5985
6001
|
const w = y.lastIndexOf("/**");
|
|
5986
|
-
h = y.slice(w + 3, -2).trim().replaceAll(
|
|
6002
|
+
h = y.slice(w + 3, -2).trim().replaceAll(pl, "");
|
|
5987
6003
|
}
|
|
5988
|
-
const v = r.slice(m, g).match(
|
|
6004
|
+
const v = r.slice(m, g).match(dl)?.[1] || f, b = ml(f);
|
|
5989
6005
|
d.push({
|
|
5990
6006
|
description: `${v}${h ? `
|
|
5991
6007
|
${h}` : ""}`,
|
|
@@ -6010,13 +6026,13 @@ ${h}` : ""}`,
|
|
|
6010
6026
|
}
|
|
6011
6027
|
return n;
|
|
6012
6028
|
}
|
|
6013
|
-
const
|
|
6014
|
-
engines:
|
|
6029
|
+
const cl = /component: ["']([^"']+)["']/u, ll = /export const (\w+)/gu, dl = /name: ["']([^"']+)["']/u, pl = /^\s*\*\s?/gmu, ml = (e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/giu, "-").replace(/-+/gu, "-").replace(/^-+/u, "").replace(/-+$/u, ""), ul = (e) => e.replace(/_/gu, " ").replace(/-/gu, " ").replace(/\./gu, " ").replace(/([^\n])([A-Z])([a-z])/gu, (t, i, n, s) => `${i} ${n}${s}`).replace(/([a-z])([A-Z])/gu, (t, i, n) => `${i} ${n}`).replace(/([a-z])([0-9])/giu, (t, i, n) => `${i} ${n}`).replace(/([0-9])([a-z])/giu, (t, i, n) => `${i} ${n}`).replace(/(\s|^)(\w)/gu, (t, i, n) => `${i}${n.toUpperCase()}`).replace(/ +/gu, " ").trim(), fl = { node: "^24.11" }, G = {
|
|
6030
|
+
engines: fl
|
|
6015
6031
|
};
|
|
6016
|
-
var
|
|
6032
|
+
var gl = Object.defineProperty, x = (e, t, i, n) => {
|
|
6017
6033
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
6018
6034
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
6019
|
-
return s &&
|
|
6035
|
+
return s && gl(t, i, s), s;
|
|
6020
6036
|
};
|
|
6021
6037
|
const H = "@arcgis/lumina:context";
|
|
6022
6038
|
class $ {
|
|
@@ -6042,7 +6058,7 @@ class $ {
|
|
|
6042
6058
|
distComponents: v,
|
|
6043
6059
|
distCdn: b,
|
|
6044
6060
|
distCdnAssets: w
|
|
6045
|
-
}, T.initialize(l.logger, f), l.root !==
|
|
6061
|
+
}, T.initialize(l.logger, f), l.root !== Li())
|
|
6046
6062
|
throw Error(
|
|
6047
6063
|
E(
|
|
6048
6064
|
H,
|
|
@@ -6057,7 +6073,7 @@ class $ {
|
|
|
6057
6073
|
"Vite output directory is outside the root directory. This is not officially supported by Lumina and may lead to unexpected behavior. Contact Lumina maintainers if you need this to be supported."
|
|
6058
6074
|
), this.isInStorybook = l.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(l.server?.hmr ?? !0), this.isInBuildWatch = l.command === "build" && l.build.watch != null;
|
|
6059
6075
|
const I = this.isInTest && l.test?.browser?.enabled === !0 && l.resolve.conditions.includes("node"), A = this.isInTest && l.test?.browser?.enabled !== !0 && l.resolve.conditions.includes("node");
|
|
6060
|
-
this.apiJsonEnabled = !I && !this.isInPuppeteerTestBackEnd && !A, this.apiJsonEnabled || (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0, this.typeScriptHost = o.createCompilerHost({}, !1)), this._startCollectingComponentStories(),
|
|
6076
|
+
this.apiJsonEnabled = !I && !this.isInPuppeteerTestBackEnd && !A, this.apiJsonEnabled || (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0, this.typeScriptHost = o.createCompilerHost({}, !1)), this._startCollectingComponentStories(), gc(this, l.build.sourcemap !== !1), is(this) && Ee(this);
|
|
6061
6077
|
}
|
|
6062
6078
|
},
|
|
6063
6079
|
configureServer: {
|
|
@@ -6099,13 +6115,13 @@ class $ {
|
|
|
6099
6115
|
webTypes: c.jetBrains === !1 ? void 0 : c.jetBrains?.webTypesFileName ? ge(c.jetBrains.webTypesFileName) : ye.webTypes,
|
|
6100
6116
|
vsCodeHtml: c.vsCode === !1 ? void 0 : c.vsCode?.htmlFileName ? ge(c.vsCode.htmlFileName) : ye.vsCodeHtml,
|
|
6101
6117
|
vsCodeCss: c.vsCode === !1 ? void 0 : c.vsCode?.cssFileName ? ge(c.vsCode.cssFileName) : ye.vsCodeCss
|
|
6102
|
-
}, vn(void 0, t), this.componentFilesPromise = We(this, u.resolve("src/components")),
|
|
6103
|
-
const d = t.build?.preamble ??
|
|
6104
|
-
this.banner =
|
|
6118
|
+
}, vn(void 0, t), this.componentFilesPromise = We(this, u.resolve("src/components")), fc(this);
|
|
6119
|
+
const d = t.build?.preamble ?? Yc();
|
|
6120
|
+
this.banner = el(d);
|
|
6105
6121
|
}
|
|
6106
6122
|
_startCollectingComponentStories() {
|
|
6107
6123
|
const t = this.options.documentation?.publicStoryUrlPrefix;
|
|
6108
|
-
this.isFullApiExtraction && typeof t == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await
|
|
6124
|
+
this.isFullApiExtraction && typeof t == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await al(this.componentStoryFiles, t)).then((i) => {
|
|
6109
6125
|
this.componentStories = i;
|
|
6110
6126
|
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0);
|
|
6111
6127
|
}
|
|
@@ -6274,19 +6290,19 @@ x([
|
|
|
6274
6290
|
x([
|
|
6275
6291
|
P("configResolved()")
|
|
6276
6292
|
], $.prototype, "_typeScriptPrinter");
|
|
6277
|
-
const
|
|
6278
|
-
name:
|
|
6293
|
+
const Ci = "makeRuntime(", yl = "@arcgis/core", hl = "@arcgis/lumina:injectRuntimeOptions", vl = (e) => ({
|
|
6294
|
+
name: hl,
|
|
6279
6295
|
transform: {
|
|
6280
6296
|
filter: {
|
|
6281
6297
|
id: /\/src\/runtime\.ts$/u
|
|
6282
6298
|
},
|
|
6283
6299
|
handler(t, i) {
|
|
6284
|
-
const n = t.indexOf(
|
|
6300
|
+
const n = t.indexOf(Ci);
|
|
6285
6301
|
if (n === -1)
|
|
6286
6302
|
throw new Error(
|
|
6287
6303
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
6288
6304
|
);
|
|
6289
|
-
const s = n +
|
|
6305
|
+
const s = n + Ci.length, r = e.options.css?.commonStylesPath;
|
|
6290
6306
|
return {
|
|
6291
6307
|
code: [
|
|
6292
6308
|
r === void 0 ? "" : `import commonStyles from "${Ce(e.dir.src, r)}${_e}";`,
|
|
@@ -6294,13 +6310,13 @@ const $i = "makeRuntime(", ul = "@arcgis/core", fl = "@arcgis/lumina:injectRunti
|
|
|
6294
6310
|
"{",
|
|
6295
6311
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
6296
6312
|
'hydratedAttribute:"',
|
|
6297
|
-
e.options.css?.hydratedAttribute ??
|
|
6313
|
+
e.options.css?.hydratedAttribute ?? an,
|
|
6298
6314
|
'",',
|
|
6299
6315
|
r === void 0 ? "" : "commonStyles",
|
|
6300
6316
|
"}",
|
|
6301
6317
|
t.slice(s),
|
|
6302
6318
|
Pe ? `
|
|
6303
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
6319
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${yl}/applications/Components/reactiveUtils.js";
|
|
6304
6320
|
createObservable,
|
|
6305
6321
|
runtime.t = trackAccess;
|
|
6306
6322
|
runtime.o = createObservable;
|
|
@@ -6312,11 +6328,11 @@ runtime.r = runTracked;` : ""
|
|
|
6312
6328
|
}
|
|
6313
6329
|
}
|
|
6314
6330
|
});
|
|
6315
|
-
function
|
|
6331
|
+
function bl(e) {
|
|
6316
6332
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${xe}/${ne}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
6317
6333
|
`;
|
|
6318
6334
|
}
|
|
6319
|
-
const je = "@arcgis/lumina:addNonLazyImports",
|
|
6335
|
+
const je = "@arcgis/lumina:addNonLazyImports", Sl = (e) => ({
|
|
6320
6336
|
name: je,
|
|
6321
6337
|
apply: () => e.viteCommand === "build",
|
|
6322
6338
|
generateBundle(t, i) {
|
|
@@ -6326,7 +6342,7 @@ const je = "@arcgis/lumina:addNonLazyImports", hl = (e) => ({
|
|
|
6326
6342
|
if (a !== s && (r.fileName = a), r.type === "chunk") {
|
|
6327
6343
|
const c = u.dirname(u.join(e.dir.dist, s)), d = a === s ? c : u.dirname(u.join(e.dir.dist, a));
|
|
6328
6344
|
let l = r.code;
|
|
6329
|
-
l =
|
|
6345
|
+
l = Ki(l, e, d, c), !e.isInStorybook && a === "chunks/runtime.js" && (n = !0, l = bl(e) + l), r.code = l;
|
|
6330
6346
|
}
|
|
6331
6347
|
}), !n && !e.isInStorybook)
|
|
6332
6348
|
throw Error(E(je, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -6363,12 +6379,12 @@ Possible causes:
|
|
|
6363
6379
|
return [];
|
|
6364
6380
|
const d = u.dirname(r), l = be(d, e.dir.srcComponents, e), p = u.relative(e.dir.src, l);
|
|
6365
6381
|
function f(S) {
|
|
6366
|
-
const k =
|
|
6382
|
+
const k = qa(e, S, r);
|
|
6367
6383
|
if (k === void 0)
|
|
6368
6384
|
return;
|
|
6369
|
-
const N =
|
|
6385
|
+
const N = Va(k, p);
|
|
6370
6386
|
if (N !== `./${p}`)
|
|
6371
|
-
return N.startsWith(".") ? `${N}/${
|
|
6387
|
+
return N.startsWith(".") ? `${N}/${$i}` : N;
|
|
6372
6388
|
}
|
|
6373
6389
|
const m = new Set(a), g = new Set(c), y = Array.from(m, f).filter(j), h = (S) => `import "${S}";
|
|
6374
6390
|
`, v = y.map(h).join(""), b = /* @__PURE__ */ new Set(), w = Array.from(g, (S) => {
|
|
@@ -6388,45 +6404,45 @@ Possible causes:
|
|
|
6388
6404
|
${I}
|
|
6389
6405
|
deferredLoaders${w.join("")};` : I;
|
|
6390
6406
|
return [
|
|
6391
|
-
F(u.join(e.dir.dist, p,
|
|
6392
|
-
F(u.join(e.dir.dist, p,
|
|
6407
|
+
F(u.join(e.dir.dist, p, $i), C),
|
|
6408
|
+
F(u.join(e.dir.dist, p, wl), A)
|
|
6393
6409
|
];
|
|
6394
6410
|
});
|
|
6395
6411
|
await Promise.all(s);
|
|
6396
6412
|
}
|
|
6397
|
-
}),
|
|
6413
|
+
}), $i = "index.js", wl = "index.d.ts", ns = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), ns(e, e[s].referencedBy, i, n))), Tl = (e) => ({
|
|
6398
6414
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6399
6415
|
configureServer(t) {
|
|
6400
|
-
e.server = t,
|
|
6416
|
+
e.server = t, Pi(e).forEach(({ assets: i, transformers: n }) => he(e, i, n));
|
|
6401
6417
|
},
|
|
6402
6418
|
async writeBundle() {
|
|
6403
6419
|
await Promise.all(
|
|
6404
|
-
|
|
6420
|
+
Pi(e).map(
|
|
6405
6421
|
async ({ assets: t, transformers: i }) => await qn(e, t, i)
|
|
6406
6422
|
)
|
|
6407
6423
|
);
|
|
6408
6424
|
}
|
|
6409
6425
|
});
|
|
6410
|
-
function
|
|
6426
|
+
function Pi(e) {
|
|
6411
6427
|
const t = [], i = e.assetsToProvide?.filter((n) => n.apply === void 0 || n.apply === e.viteCommand) ?? [];
|
|
6412
6428
|
return e.options.assets?.extra?.forEach((n) => {
|
|
6413
6429
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
6414
6430
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
6415
6431
|
}
|
|
6416
|
-
const Et = "@arcgis/lumina:updatePackageJson",
|
|
6432
|
+
const Et = "@arcgis/lumina:updatePackageJson", El = (e) => ({
|
|
6417
6433
|
name: Et,
|
|
6418
6434
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
6419
6435
|
configResolved() {
|
|
6420
|
-
|
|
6436
|
+
Cl(e).catch(
|
|
6421
6437
|
(t) => T.error(Et, `Failed to update package's package.json:${String(t)}`)
|
|
6422
6438
|
);
|
|
6423
6439
|
}
|
|
6424
6440
|
});
|
|
6425
|
-
async function
|
|
6426
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await B(t, "utf-8")), n =
|
|
6427
|
-
n &&
|
|
6441
|
+
async function Cl(e) {
|
|
6442
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await B(t, "utf-8")), n = $l(i, e);
|
|
6443
|
+
n && Oi(t, JSON.stringify(n, null, 2));
|
|
6428
6444
|
}
|
|
6429
|
-
function
|
|
6445
|
+
function $l(e, t) {
|
|
6430
6446
|
const i = e?.devDependencies ?? {};
|
|
6431
6447
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
6432
6448
|
l in i || T.warn(
|
|
@@ -6465,20 +6481,20 @@ function Tl(e, t) {
|
|
|
6465
6481
|
if (n)
|
|
6466
6482
|
return e;
|
|
6467
6483
|
}
|
|
6468
|
-
const
|
|
6484
|
+
const Pl = (e) => ({
|
|
6469
6485
|
timestamp: e.apiJson.timestamp,
|
|
6470
6486
|
compiler: e.apiJson.compiler,
|
|
6471
|
-
components:
|
|
6487
|
+
components: xl(e),
|
|
6472
6488
|
typeLibrary: {}
|
|
6473
6489
|
});
|
|
6474
|
-
function
|
|
6490
|
+
function xl(e) {
|
|
6475
6491
|
const t = [];
|
|
6476
6492
|
for (const i of e.apiJson.modules)
|
|
6477
6493
|
for (const n of i.declarations)
|
|
6478
|
-
"customElement" in n && t.push(
|
|
6494
|
+
"customElement" in n && t.push(Il(n, i.sourcePath));
|
|
6479
6495
|
return t;
|
|
6480
6496
|
}
|
|
6481
|
-
function
|
|
6497
|
+
function Il(e, t) {
|
|
6482
6498
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6483
6499
|
return {
|
|
6484
6500
|
filePath: t,
|
|
@@ -6493,9 +6509,9 @@ function $l(e, t) {
|
|
|
6493
6509
|
dependencies: [],
|
|
6494
6510
|
dependencyGraph: {},
|
|
6495
6511
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6496
|
-
props: e.members.map(
|
|
6497
|
-
methods: e.members.map(
|
|
6498
|
-
events: e.events?.map(
|
|
6512
|
+
props: e.members.map(kl).filter(j),
|
|
6513
|
+
methods: e.members.map(Al).filter(j),
|
|
6514
|
+
events: e.events?.map(Nl) ?? [],
|
|
6499
6515
|
styles: e.cssProperties?.map((n) => ({
|
|
6500
6516
|
name: n.name,
|
|
6501
6517
|
annotation: "prop",
|
|
@@ -6507,7 +6523,7 @@ function $l(e, t) {
|
|
|
6507
6523
|
listeners: []
|
|
6508
6524
|
};
|
|
6509
6525
|
}
|
|
6510
|
-
function
|
|
6526
|
+
function kl(e) {
|
|
6511
6527
|
if (e.kind !== "field")
|
|
6512
6528
|
return;
|
|
6513
6529
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], n = t.readonly ? [{ name: "readonly", text: "" }] : [], s = t.docsTags?.some((r) => r.name === "required") ?? !1;
|
|
@@ -6541,14 +6557,14 @@ const Mt = (e) => Object.fromEntries(
|
|
|
6541
6557
|
(t) => [
|
|
6542
6558
|
t.name,
|
|
6543
6559
|
{
|
|
6544
|
-
location: t.package ===
|
|
6560
|
+
location: t.package === ji ? "global" : t.package === void 0 ? "local" : "import",
|
|
6545
6561
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
6546
6562
|
id: "notImplemented"
|
|
6547
6563
|
}
|
|
6548
6564
|
]
|
|
6549
6565
|
) ?? []
|
|
6550
6566
|
);
|
|
6551
|
-
function
|
|
6567
|
+
function Al(e) {
|
|
6552
6568
|
if (e.kind !== "method")
|
|
6553
6569
|
return;
|
|
6554
6570
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], n = t.parameters?.map(({ name: s, type: r, description: a }) => ({
|
|
@@ -6579,7 +6595,7 @@ function xl(e) {
|
|
|
6579
6595
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
6580
6596
|
};
|
|
6581
6597
|
}
|
|
6582
|
-
function
|
|
6598
|
+
function Nl(e) {
|
|
6583
6599
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
6584
6600
|
return {
|
|
6585
6601
|
event: e.name,
|
|
@@ -6607,14 +6623,14 @@ const ss = (e) => e.flatMap(
|
|
|
6607
6623
|
name: `::part(${i.name})`,
|
|
6608
6624
|
description: i.description || void 0
|
|
6609
6625
|
})) ?? []
|
|
6610
|
-
),
|
|
6626
|
+
), Ll = (e) => e.attributes?.map((t) => ({
|
|
6611
6627
|
name: t.name ?? "",
|
|
6612
6628
|
description: Ye(t.description, t.deprecated) || void 0,
|
|
6613
6629
|
default: t.default,
|
|
6614
6630
|
value: {
|
|
6615
|
-
type:
|
|
6631
|
+
type: Fl(t.type.values?.map(mn))
|
|
6616
6632
|
}
|
|
6617
|
-
})) ?? [],
|
|
6633
|
+
})) ?? [], Fl = (e) => e?.length === 1 ? e[0] : e, Ye = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, Ie = {
|
|
6618
6634
|
slots: "Slots",
|
|
6619
6635
|
events: "Events",
|
|
6620
6636
|
cssProperties: "CSS Properties",
|
|
@@ -6622,7 +6638,7 @@ const ss = (e) => e.flatMap(
|
|
|
6622
6638
|
methods: "Methods"
|
|
6623
6639
|
};
|
|
6624
6640
|
function os(e) {
|
|
6625
|
-
const t =
|
|
6641
|
+
const t = jl(e.slots), i = Dl(e.events), n = Rl(e.cssProperties), s = Ol(e.cssParts), r = Ml(e.members), a = Ye(e.description, e.deprecated).trim();
|
|
6626
6642
|
return [...a ? [`${a}
|
|
6627
6643
|
--`] : [], i, r, t, n, s].filter(Boolean).join(`
|
|
6628
6644
|
|
|
@@ -6630,28 +6646,28 @@ function os(e) {
|
|
|
6630
6646
|
}
|
|
6631
6647
|
const ke = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6632
6648
|
${t.join(`
|
|
6633
|
-
`)}`,
|
|
6649
|
+
`)}`, jl = (e) => ke(
|
|
6634
6650
|
Ie.slots,
|
|
6635
6651
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6636
|
-
),
|
|
6652
|
+
), Dl = (e) => ke(
|
|
6637
6653
|
Ie.events,
|
|
6638
6654
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6639
|
-
),
|
|
6655
|
+
), Rl = (e = []) => ke(
|
|
6640
6656
|
Ie.cssProperties,
|
|
6641
6657
|
e?.map(
|
|
6642
6658
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6643
6659
|
)
|
|
6644
|
-
),
|
|
6660
|
+
), Ol = (e) => ke(
|
|
6645
6661
|
Ie.cssParts,
|
|
6646
6662
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6647
|
-
),
|
|
6663
|
+
), Ml = (e) => ke(
|
|
6648
6664
|
Ie.methods,
|
|
6649
|
-
e.filter(
|
|
6665
|
+
e.filter(gs).map(
|
|
6650
6666
|
(t) => [`- \`${t.name}${t.signature}\``, Ye(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6651
6667
|
)
|
|
6652
6668
|
);
|
|
6653
|
-
function
|
|
6654
|
-
const i =
|
|
6669
|
+
function Jl(e, t) {
|
|
6670
|
+
const i = Kl(e), n = ss(e), s = rs(e), r = R();
|
|
6655
6671
|
return {
|
|
6656
6672
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
6657
6673
|
name: r.name,
|
|
@@ -6669,52 +6685,52 @@ function Rl(e, t) {
|
|
|
6669
6685
|
}
|
|
6670
6686
|
};
|
|
6671
6687
|
}
|
|
6672
|
-
const
|
|
6688
|
+
const Kl = (e) => e.map((t) => ({
|
|
6673
6689
|
name: t.tagName,
|
|
6674
6690
|
description: os(t),
|
|
6675
6691
|
"doc-url": t.demos?.[0]?.url,
|
|
6676
|
-
attributes:
|
|
6692
|
+
attributes: Ll(t),
|
|
6677
6693
|
slots: t.slots?.map((i) => ({
|
|
6678
6694
|
name: i.name,
|
|
6679
6695
|
description: i.description
|
|
6680
6696
|
})),
|
|
6681
|
-
events:
|
|
6697
|
+
events: xi(t),
|
|
6682
6698
|
js: {
|
|
6683
|
-
properties:
|
|
6684
|
-
events:
|
|
6699
|
+
properties: Bl(t),
|
|
6700
|
+
events: xi(t)
|
|
6685
6701
|
}
|
|
6686
|
-
})),
|
|
6702
|
+
})), Bl = (e) => e.members.filter(ys).map((t) => ({
|
|
6687
6703
|
name: t.name,
|
|
6688
6704
|
description: t.description,
|
|
6689
6705
|
type: t.type?.text
|
|
6690
|
-
})) ?? [],
|
|
6706
|
+
})) ?? [], xi = (e) => e.events?.map((t) => ({
|
|
6691
6707
|
name: t.name,
|
|
6692
6708
|
type: t.type?.text,
|
|
6693
6709
|
description: t.description
|
|
6694
|
-
})) ?? [],
|
|
6710
|
+
})) ?? [], _l = (e) => e.map((t) => ({
|
|
6695
6711
|
name: t.tagName,
|
|
6696
6712
|
description: os(t),
|
|
6697
|
-
attributes:
|
|
6713
|
+
attributes: Wl(t),
|
|
6698
6714
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
6699
|
-
})),
|
|
6715
|
+
})), Wl = (e) => e.attributes?.map((t) => ({
|
|
6700
6716
|
name: t.name,
|
|
6701
6717
|
description: Ye(t.description, t.deprecated) || void 0,
|
|
6702
|
-
values:
|
|
6703
|
-
})) ?? [],
|
|
6718
|
+
values: Hl(t)
|
|
6719
|
+
})) ?? [], Hl = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Ul = (e) => ({
|
|
6704
6720
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
6705
6721
|
version: 1.1,
|
|
6706
|
-
tags:
|
|
6707
|
-
}),
|
|
6722
|
+
tags: _l(e)
|
|
6723
|
+
}), zl = (e) => ({
|
|
6708
6724
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
6709
6725
|
version: 1.1,
|
|
6710
6726
|
properties: ss(e),
|
|
6711
6727
|
pseudoElements: rs(e)
|
|
6712
|
-
}),
|
|
6713
|
-
function
|
|
6728
|
+
}), ql = "@arcgis/lumina:generateDocs";
|
|
6729
|
+
function Vl(e) {
|
|
6714
6730
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
6715
6731
|
{
|
|
6716
6732
|
type: "dynamic",
|
|
6717
|
-
source: () => JSON.stringify(
|
|
6733
|
+
source: () => JSON.stringify(Pl(e), null, 2),
|
|
6718
6734
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
6719
6735
|
}
|
|
6720
6736
|
]), e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
@@ -6724,7 +6740,7 @@ function Ul(e) {
|
|
|
6724
6740
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
6725
6741
|
}
|
|
6726
6742
|
]), {
|
|
6727
|
-
name:
|
|
6743
|
+
name: ql,
|
|
6728
6744
|
async writeBundle() {
|
|
6729
6745
|
if (e.isInStorybook)
|
|
6730
6746
|
return;
|
|
@@ -6734,24 +6750,24 @@ function Ul(e) {
|
|
|
6734
6750
|
await Zn(a);
|
|
6735
6751
|
const c = [];
|
|
6736
6752
|
if (n !== void 0) {
|
|
6737
|
-
const d = JSON.stringify(
|
|
6753
|
+
const d = JSON.stringify(Ul(e.apiJsonComponents), null, 2);
|
|
6738
6754
|
c.push(F(n, d));
|
|
6739
6755
|
}
|
|
6740
6756
|
if (s !== void 0) {
|
|
6741
|
-
const d = JSON.stringify(
|
|
6757
|
+
const d = JSON.stringify(zl(e.apiJsonComponents), null, 2);
|
|
6742
6758
|
c.push(F(s, d));
|
|
6743
6759
|
}
|
|
6744
6760
|
if (r !== void 0) {
|
|
6745
|
-
const d =
|
|
6761
|
+
const d = Jl(e.apiJsonComponents, typeof t == "object" ? t : {});
|
|
6746
6762
|
c.push(F(r, JSON.stringify(d, null, 2)));
|
|
6747
6763
|
}
|
|
6748
6764
|
await Promise.all(c);
|
|
6749
6765
|
}
|
|
6750
6766
|
};
|
|
6751
6767
|
}
|
|
6752
|
-
const
|
|
6768
|
+
const Gl = (e) => `import type { h, EventHandler } from "@arcgis/lumina";
|
|
6753
6769
|
|
|
6754
|
-
${e.map(
|
|
6770
|
+
${e.map(Xl).join(`
|
|
6755
6771
|
|
|
6756
6772
|
`)}
|
|
6757
6773
|
|
|
@@ -6763,7 +6779,7 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6763
6779
|
}
|
|
6764
6780
|
}
|
|
6765
6781
|
}`;
|
|
6766
|
-
function
|
|
6782
|
+
function Xl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6767
6783
|
const [s, r] = $e(e, i);
|
|
6768
6784
|
return [
|
|
6769
6785
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
@@ -6776,7 +6792,7 @@ function ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6776
6792
|
r
|
|
6777
6793
|
].join("");
|
|
6778
6794
|
}
|
|
6779
|
-
function
|
|
6795
|
+
function Ql(e) {
|
|
6780
6796
|
const t = ` interface IntrinsicElements {
|
|
6781
6797
|
${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join(`
|
|
6782
6798
|
`)}
|
|
@@ -6784,7 +6800,7 @@ ${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join
|
|
|
6784
6800
|
return `import { HTMLAttributes } from "preact";
|
|
6785
6801
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6786
6802
|
|
|
6787
|
-
${e.map(
|
|
6803
|
+
${e.map(Zl).join(`
|
|
6788
6804
|
|
|
6789
6805
|
`)}
|
|
6790
6806
|
|
|
@@ -6797,7 +6813,7 @@ ${t}
|
|
|
6797
6813
|
}
|
|
6798
6814
|
}`;
|
|
6799
6815
|
}
|
|
6800
|
-
function
|
|
6816
|
+
function Zl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6801
6817
|
const [s, r] = $e(e, i);
|
|
6802
6818
|
return [
|
|
6803
6819
|
`interface Preact${t} extends ${s}HTMLAttributes<HTML${t}Element> {
|
|
@@ -6810,13 +6826,13 @@ function Gl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6810
6826
|
r
|
|
6811
6827
|
].join("");
|
|
6812
6828
|
}
|
|
6813
|
-
function
|
|
6829
|
+
function Yl(e) {
|
|
6814
6830
|
const t = e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": React${i};`).join(`
|
|
6815
6831
|
`);
|
|
6816
6832
|
return `import type { HTMLProps } from 'react';
|
|
6817
6833
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6818
6834
|
|
|
6819
|
-
${e.map(
|
|
6835
|
+
${e.map(ed).join(`
|
|
6820
6836
|
|
|
6821
6837
|
`)}
|
|
6822
6838
|
|
|
@@ -6842,7 +6858,7 @@ ${t}
|
|
|
6842
6858
|
}
|
|
6843
6859
|
}`;
|
|
6844
6860
|
}
|
|
6845
|
-
function
|
|
6861
|
+
function ed({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6846
6862
|
const [s, r] = $e(e, i);
|
|
6847
6863
|
return [
|
|
6848
6864
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
@@ -6855,10 +6871,10 @@ function Ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6855
6871
|
r
|
|
6856
6872
|
].join("");
|
|
6857
6873
|
}
|
|
6858
|
-
const
|
|
6874
|
+
const td = (e) => `import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
6859
6875
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6860
6876
|
|
|
6861
|
-
${e.map(
|
|
6877
|
+
${e.map(id).join(`
|
|
6862
6878
|
|
|
6863
6879
|
`)}
|
|
6864
6880
|
|
|
@@ -6876,7 +6892,7 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6876
6892
|
interface IntrinsicElements extends ExposedElements {}
|
|
6877
6893
|
}
|
|
6878
6894
|
}`;
|
|
6879
|
-
function
|
|
6895
|
+
function id({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6880
6896
|
const [s, r] = $e(e, i);
|
|
6881
6897
|
return [
|
|
6882
6898
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
@@ -6889,16 +6905,16 @@ function Yl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6889
6905
|
r
|
|
6890
6906
|
].join("");
|
|
6891
6907
|
}
|
|
6892
|
-
const
|
|
6908
|
+
const nd = (e, t, i) => [i, t, sd(e), rd(e)].join(`
|
|
6893
6909
|
|
|
6894
|
-
`),
|
|
6910
|
+
`), sd = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6895
6911
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6896
6912
|
detail: T;
|
|
6897
6913
|
target: HTML${t}Element;
|
|
6898
6914
|
currentTarget: HTML${t}Element;
|
|
6899
6915
|
}`
|
|
6900
6916
|
).join(`
|
|
6901
|
-
`),
|
|
6917
|
+
`), rd = (e) => `export { ToEvents, TargetedEvent } from "@arcgis/lumina";
|
|
6902
6918
|
|
|
6903
6919
|
declare global {
|
|
6904
6920
|
interface HTMLElementTagNameMap {
|
|
@@ -6906,12 +6922,12 @@ ${e.map(({ pascalCaseName: t, tagName: i }) => ` "${i}": HTML${t}Element;`).j
|
|
|
6906
6922
|
`)}
|
|
6907
6923
|
}
|
|
6908
6924
|
|
|
6909
|
-
${e.map(
|
|
6925
|
+
${e.map(od).join(`
|
|
6910
6926
|
`).split(`
|
|
6911
6927
|
`).map((t) => t.length > 0 ? ` ${t}` : t).join(`
|
|
6912
6928
|
`)}
|
|
6913
6929
|
}`;
|
|
6914
|
-
function
|
|
6930
|
+
function od({ name: e, pascalCaseName: t, events: i = [] }) {
|
|
6915
6931
|
const n = i.length > 0, s = `${t}CustomEvent`, r = `HTML${t}Element`;
|
|
6916
6932
|
return [
|
|
6917
6933
|
n ? `interface ${r}EventMap {
|
|
@@ -6930,7 +6946,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6930
6946
|
}`
|
|
6931
6947
|
].join("");
|
|
6932
6948
|
}
|
|
6933
|
-
function
|
|
6949
|
+
function ad(e) {
|
|
6934
6950
|
const t = ` interface IntrinsicElements {
|
|
6935
6951
|
${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join(`
|
|
6936
6952
|
`)}
|
|
@@ -6938,7 +6954,7 @@ ${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join
|
|
|
6938
6954
|
return `import { JSX as PreactJsx } from "preact";
|
|
6939
6955
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6940
6956
|
|
|
6941
|
-
${e.map(
|
|
6957
|
+
${e.map(cd).join(`
|
|
6942
6958
|
|
|
6943
6959
|
`)}
|
|
6944
6960
|
|
|
@@ -6951,7 +6967,7 @@ ${t}
|
|
|
6951
6967
|
}
|
|
6952
6968
|
}`;
|
|
6953
6969
|
}
|
|
6954
|
-
function
|
|
6970
|
+
function cd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6955
6971
|
const [s, r] = $e(e, i);
|
|
6956
6972
|
return [
|
|
6957
6973
|
`/** @deprecated Update to Preact 10.27.2+ or 11+ and consume types/preact file over types/preact10 */
|
|
@@ -6966,7 +6982,7 @@ function rd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6966
6982
|
r
|
|
6967
6983
|
].join("");
|
|
6968
6984
|
}
|
|
6969
|
-
function
|
|
6985
|
+
function ld(e) {
|
|
6970
6986
|
let t;
|
|
6971
6987
|
return {
|
|
6972
6988
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6974,11 +6990,11 @@ function od(e) {
|
|
|
6974
6990
|
generateBundle() {
|
|
6975
6991
|
if (e.isInStorybook)
|
|
6976
6992
|
return;
|
|
6977
|
-
t =
|
|
6993
|
+
t = Da(e);
|
|
6978
6994
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6979
6995
|
e._declarationTextTransformers.push((n) => {
|
|
6980
6996
|
const { filePath: s, content: r } = n;
|
|
6981
|
-
return s === i ? { filePath: s, content:
|
|
6997
|
+
return s === i ? { filePath: s, content: nd(e.apiJsonComponents, r, t) } : n;
|
|
6982
6998
|
});
|
|
6983
6999
|
},
|
|
6984
7000
|
async writeBundle() {
|
|
@@ -6988,11 +7004,11 @@ function od(e) {
|
|
|
6988
7004
|
await ee(i, { recursive: !0 });
|
|
6989
7005
|
const n = `/// <reference types="../index.d.ts" />
|
|
6990
7006
|
${t.replaceAll("./", "../")}`, s = Object.entries({
|
|
6991
|
-
react:
|
|
6992
|
-
preact:
|
|
6993
|
-
preact10:
|
|
6994
|
-
stencil:
|
|
6995
|
-
lumina:
|
|
7007
|
+
react: Yl(e.apiJsonComponents),
|
|
7008
|
+
preact: Ql(e.apiJsonComponents),
|
|
7009
|
+
preact10: ad(e.apiJsonComponents),
|
|
7010
|
+
stencil: td(e.apiJsonComponents),
|
|
7011
|
+
lumina: Gl(e.apiJsonComponents)
|
|
6996
7012
|
}).map(
|
|
6997
7013
|
async ([r, a]) => await F(u.join(i, `${r}.d.ts`), `${n}
|
|
6998
7014
|
${a}`)
|
|
@@ -7001,38 +7017,38 @@ ${a}`)
|
|
|
7001
7017
|
}
|
|
7002
7018
|
};
|
|
7003
7019
|
}
|
|
7004
|
-
function
|
|
7020
|
+
function dd(e) {
|
|
7005
7021
|
return {
|
|
7006
7022
|
name: "@arcgis/lumina:buildWrappers",
|
|
7007
7023
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
7008
7024
|
async writeBundle() {
|
|
7009
7025
|
e.isInStorybook || await Promise.all(
|
|
7010
7026
|
e.options.build?.wrappers?.map(async (t) => {
|
|
7011
|
-
t.type === "react18" && await
|
|
7027
|
+
t.type === "react18" && await ud(e, t);
|
|
7012
7028
|
}) ?? []
|
|
7013
7029
|
);
|
|
7014
7030
|
}
|
|
7015
7031
|
};
|
|
7016
7032
|
}
|
|
7017
|
-
const
|
|
7018
|
-
import React from "${
|
|
7019
|
-
import { createComponent } from "${
|
|
7020
|
-
import type { EventName } from "${
|
|
7033
|
+
const pd = "react", Ii = "@lit/react", md = `
|
|
7034
|
+
import React from "${pd}";
|
|
7035
|
+
import { createComponent } from "${Ii}";
|
|
7036
|
+
import type { EventName } from "${Ii}";
|
|
7021
7037
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
7022
7038
|
|
|
7023
7039
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
7024
7040
|
`;
|
|
7025
|
-
async function
|
|
7041
|
+
async function ud(e, t) {
|
|
7026
7042
|
const { name: i } = R(), n = [];
|
|
7027
7043
|
for (const a of e.apiJson.modules)
|
|
7028
7044
|
for (const c of a.declarations)
|
|
7029
|
-
"customElement" in c && n.push(
|
|
7030
|
-
const s = [`/// <reference types="${i}" preserve="true" />`,
|
|
7045
|
+
"customElement" in c && n.push(fd(c));
|
|
7046
|
+
const s = [`/// <reference types="${i}" preserve="true" />`, md, ...n].join(""), r = u.resolve(t.proxiesFile);
|
|
7031
7047
|
await ee(u.dirname(r), { recursive: !0 }), await F(r, s);
|
|
7032
7048
|
}
|
|
7033
|
-
function
|
|
7049
|
+
function fd(e) {
|
|
7034
7050
|
const t = e.events?.map(
|
|
7035
|
-
(i) => ` ${ue(`on${
|
|
7051
|
+
(i) => ` ${ue(`on${bs(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
7036
7052
|
).join(`
|
|
7037
7053
|
`);
|
|
7038
7054
|
return `
|
|
@@ -7046,46 +7062,46 @@ ${t}
|
|
|
7046
7062
|
);
|
|
7047
7063
|
`;
|
|
7048
7064
|
}
|
|
7049
|
-
function
|
|
7065
|
+
function Fd(e = {}) {
|
|
7050
7066
|
const t = new $(e), n = [
|
|
7051
7067
|
t._plugin,
|
|
7052
|
-
|
|
7053
|
-
|
|
7068
|
+
Qc(t),
|
|
7069
|
+
Zc(t),
|
|
7070
|
+
El(t),
|
|
7071
|
+
$r(t),
|
|
7072
|
+
Kc(t),
|
|
7073
|
+
ld(t),
|
|
7074
|
+
Vl(t),
|
|
7075
|
+
mc(t),
|
|
7076
|
+
vl(t),
|
|
7077
|
+
qr(t),
|
|
7078
|
+
Uc(t),
|
|
7079
|
+
Tl(t),
|
|
7054
7080
|
Sl(t),
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
gl(t),
|
|
7061
|
-
zr(t),
|
|
7062
|
-
_c(t),
|
|
7063
|
-
bl(t),
|
|
7064
|
-
hl(t),
|
|
7065
|
-
tl(t),
|
|
7066
|
-
Ds(t),
|
|
7067
|
-
gc(t),
|
|
7068
|
-
ad(t),
|
|
7069
|
-
Wc(t)
|
|
7081
|
+
sl(t),
|
|
7082
|
+
Rs(t),
|
|
7083
|
+
vc(t),
|
|
7084
|
+
dd(t),
|
|
7085
|
+
zc(t)
|
|
7070
7086
|
].filter(j);
|
|
7071
7087
|
return n.context = t, n;
|
|
7072
7088
|
}
|
|
7073
|
-
const
|
|
7089
|
+
const jd = {
|
|
7074
7090
|
initializeComponentDependencies: vn,
|
|
7075
7091
|
updateLuminaTs: ts,
|
|
7076
7092
|
propertyToAttributeMappings: z,
|
|
7077
|
-
findDeclaredComponent:
|
|
7078
|
-
nativeEvents:
|
|
7093
|
+
findDeclaredComponent: Bi,
|
|
7094
|
+
nativeEvents: Qi,
|
|
7079
7095
|
svgElements: xt,
|
|
7080
7096
|
mathMlElements: It,
|
|
7081
|
-
alwaysAttributes:
|
|
7082
|
-
nativeAlwaysAttributes:
|
|
7097
|
+
alwaysAttributes: Vi,
|
|
7098
|
+
nativeAlwaysAttributes: Gi,
|
|
7083
7099
|
htmlAlwaysAttributes: ht,
|
|
7084
7100
|
isPropertyEscapeNeeded: Ze
|
|
7085
7101
|
};
|
|
7086
7102
|
export {
|
|
7087
7103
|
Ue as LuminaApiExtractor,
|
|
7088
|
-
|
|
7104
|
+
jd as exportsForCodemod,
|
|
7089
7105
|
Xe as inferCdnUrl,
|
|
7090
|
-
|
|
7106
|
+
Fd as useLumina
|
|
7091
7107
|
};
|