@arcgis/lumina-compiler 4.34.0-next.3 → 4.34.0-next.31
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
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { nodeExternals as
|
|
2
|
-
import { stringToStartsWithGlob as Kt, path as u, toSystemPathSeparators as Y, retrievePackageJson as R, fetchPackageLocation as _e, asyncRetrievePackageJson as He, existsAsync as U, findPath as
|
|
3
|
-
import
|
|
1
|
+
import { nodeExternals as ds } from "rollup-plugin-node-externals";
|
|
2
|
+
import { stringToStartsWithGlob as Kt, path as u, toSystemPathSeparators as Y, retrievePackageJson as R, fetchPackageLocation as _e, asyncRetrievePackageJson as He, existsAsync as U, findPath as ps, toPosixPathSeparators as Le, isPosix as Ri, getCwd as Mi } from "@arcgis/components-build-utils";
|
|
3
|
+
import us from "vite-plugin-dts";
|
|
4
4
|
import o from "typescript";
|
|
5
5
|
import { f as w, l as C } from "./logger-KpGU2b3R.js";
|
|
6
|
-
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as
|
|
7
|
-
import { isNotUndefined as j, mappedFind as ye, camelToKebab as wt, kebabToPascal as
|
|
8
|
-
import { readdir as Ue, readFile as J, rm as
|
|
9
|
-
import { lazyMetaSubItemJoiner as
|
|
10
|
-
import { build as
|
|
11
|
-
import { glob as
|
|
12
|
-
import
|
|
13
|
-
import { writeFileSync as
|
|
14
|
-
import
|
|
15
|
-
function
|
|
6
|
+
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as Oi, setApiDocFromJsDoc as ue, ApiExtractor as ms, hasIgnoredModifier as fs, symbolToDocs as Wt, setDefaultFromInitializer as Bt, multipleJsDocTags as ys, findDecorator as _t, isApiMethod as gs, isApiProperty as hs } from "@arcgis/api-extractor";
|
|
7
|
+
import { isNotUndefined as j, mappedFind as ye, camelToKebab as wt, kebabToPascal as vs, uncapitalize as ut, identity as Ji, Deferred as Ss, getPreamble as bs, capitalize as ws } from "@arcgis/components-utils";
|
|
8
|
+
import { readdir as Ue, readFile as J, rm as Ts, mkdir as z, cp as Es, writeFile as F, copyFile as Cs } from "node:fs/promises";
|
|
9
|
+
import { lazyMetaSubItemJoiner as $s, lazyMetaItemJoiner as Ye, lazyMetaGroupJoiner as Ps, propertyFlagAttribute as Ht, propertyFlagReflect as xs, propertyFlagBoolean as ks, propertyFlagNumber as As, propertyFlagState as Is, propertyFlagReadOnly as Ls, propertyFlagNoAccessor as Fs } from "@arcgis/lumina/config";
|
|
10
|
+
import { build as Ns } from "esbuild";
|
|
11
|
+
import { glob as Ds } from "glob";
|
|
12
|
+
import js from "mime-types";
|
|
13
|
+
import { writeFileSync as Ki } from "node:fs";
|
|
14
|
+
import Rs from "chalk";
|
|
15
|
+
function Ms(e) {
|
|
16
16
|
const { externalize: t = [], bundleIn: i = [], ...n } = e.options?.build?.dependencies ?? {}, r = {
|
|
17
|
-
...
|
|
17
|
+
...ds({
|
|
18
18
|
...n,
|
|
19
19
|
/*
|
|
20
20
|
* This property name is a bit confusing. "include" means "externalize these"
|
|
@@ -36,8 +36,8 @@ function Ks(e) {
|
|
|
36
36
|
};
|
|
37
37
|
return r;
|
|
38
38
|
}
|
|
39
|
-
const Tt = "customElement.js",
|
|
40
|
-
function
|
|
39
|
+
const Tt = "customElement.js", Wi = "customElement.d.ts", Os = "playwright";
|
|
40
|
+
function Js(e, t, i) {
|
|
41
41
|
const s = i.split(u.sep).slice(2);
|
|
42
42
|
let r = t._componentPathMapping;
|
|
43
43
|
return s.forEach((a, c) => {
|
|
@@ -47,10 +47,10 @@ function Ws(e, t, i) {
|
|
|
47
47
|
function ge(e, t, i) {
|
|
48
48
|
if (!e.startsWith(t))
|
|
49
49
|
return e;
|
|
50
|
-
const n = e.slice(t.length), s =
|
|
50
|
+
const n = e.slice(t.length), s = Ks(n, i);
|
|
51
51
|
return `${t}${s}`;
|
|
52
52
|
}
|
|
53
|
-
function
|
|
53
|
+
function Ks(e, t) {
|
|
54
54
|
const i = e.split(u.sep);
|
|
55
55
|
i.push(".");
|
|
56
56
|
let n = t._componentPathMapping, s = 0;
|
|
@@ -62,36 +62,36 @@ function _s(e, t) {
|
|
|
62
62
|
n = n[r], s += 1;
|
|
63
63
|
return e;
|
|
64
64
|
}
|
|
65
|
-
const
|
|
65
|
+
const Ws = ({ filePath: e, content: t }, i) => {
|
|
66
66
|
const n = e.startsWith(i.dir.distComponents) ? ge(
|
|
67
|
-
|
|
67
|
+
Bi(i.dir.distComponents, e),
|
|
68
68
|
i.dir.distComponents,
|
|
69
69
|
i
|
|
70
|
-
) : e, s = u.dirname(e), r = n.endsWith(
|
|
70
|
+
) : e, s = u.dirname(e), r = n.endsWith(Wi), a = _i(
|
|
71
71
|
t,
|
|
72
72
|
i,
|
|
73
73
|
e === n ? s : u.dirname(n),
|
|
74
74
|
s
|
|
75
|
-
), c = r ?
|
|
75
|
+
), c = r ? Us(a) : a;
|
|
76
76
|
return {
|
|
77
77
|
filePath: n,
|
|
78
78
|
content: c
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function Bi(e, t, i = ".d.ts") {
|
|
82
82
|
if (!t.startsWith(e))
|
|
83
83
|
return t;
|
|
84
84
|
const s = (i === "" ? t : t.slice(0, -i.length)).split(u.sep);
|
|
85
|
-
return s.at(
|
|
85
|
+
return s.at(Bs) !== s.at(_s) ? t : u.join(
|
|
86
86
|
s.slice(0, -1).join(u.sep),
|
|
87
|
-
i === "" ? Tt :
|
|
87
|
+
i === "" ? Tt : Wi
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
|
-
const
|
|
90
|
+
const Bs = -1, _s = -2, Hs = /["']\.\.?\/[^'"]+/gu, _i = (e, t, i, n) => e.replaceAll(Hs, (s) => {
|
|
91
91
|
const r = s.slice(1);
|
|
92
92
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
93
93
|
return s;
|
|
94
|
-
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
94
|
+
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Bi(t.dir.distComponents, a, "") : a, l = ge(c, t.dir.distComponents, t);
|
|
95
95
|
if (i === n && a === l)
|
|
96
96
|
return s;
|
|
97
97
|
const d = ee(i, l);
|
|
@@ -100,15 +100,15 @@ const Us = -1, zs = -2, qs = /["']\.\.?\/[^'"]+/gu, Ui = (e, t, i, n) => e.repla
|
|
|
100
100
|
const i = u.relative(e, t);
|
|
101
101
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
102
102
|
};
|
|
103
|
-
function
|
|
103
|
+
function Us(e) {
|
|
104
104
|
return `/// <reference types="../../index.d.ts" />
|
|
105
105
|
${e}`;
|
|
106
106
|
}
|
|
107
|
-
const Ut = "customElement",
|
|
107
|
+
const Ut = "customElement", zs = (e, t) => {
|
|
108
108
|
const { filePath: i, content: n } = e;
|
|
109
109
|
if (!i.startsWith(t.dir.distComponents))
|
|
110
110
|
return e;
|
|
111
|
-
const s =
|
|
111
|
+
const s = Ui(n);
|
|
112
112
|
if (s === void 0)
|
|
113
113
|
return e;
|
|
114
114
|
{
|
|
@@ -118,7 +118,7 @@ const Ut = "customElement", Vs = (e, t) => {
|
|
|
118
118
|
content: r
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
},
|
|
121
|
+
}, qs = (e, t) => {
|
|
122
122
|
const i = [];
|
|
123
123
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
124
124
|
"customElement" in r && i.push(
|
|
@@ -147,12 +147,12 @@ const Ut = "customElement", Vs = (e, t) => {
|
|
|
147
147
|
o.factory.createStringLiteral(n)
|
|
148
148
|
), ...e.statements, ...i];
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
const t =
|
|
150
|
+
function Hi(e) {
|
|
151
|
+
const t = Ui(e);
|
|
152
152
|
return t === void 0 ? void 0 : t.split(`
|
|
153
153
|
`).filter((n) => n.includes(":")).map((n) => n.replace(";", "").replaceAll('"', "").replaceAll("'", "").split(":")).map(([n, s]) => [n.trim(), s.trim()]).filter(([n]) => !n.startsWith("/") && !n.startsWith("*"));
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function Ui(e) {
|
|
156
156
|
const t = e.indexOf("declare global {");
|
|
157
157
|
if (t === -1)
|
|
158
158
|
return;
|
|
@@ -160,39 +160,39 @@ function qi(e) {
|
|
|
160
160
|
}`, t) + 2;
|
|
161
161
|
return e.slice(t, i);
|
|
162
162
|
}
|
|
163
|
-
const
|
|
163
|
+
const Gs = (e) => (t, i) => (
|
|
164
164
|
/*
|
|
165
165
|
* `declarationTextTransformers` arrays can be mutated between plugin
|
|
166
166
|
* initialization and beforeWriteFile() call, so do not read the value
|
|
167
167
|
* of declarationTextTransformers outside of beforeWriteFile
|
|
168
168
|
*/
|
|
169
169
|
[
|
|
170
|
+
Vs,
|
|
171
|
+
Qs,
|
|
170
172
|
Zs,
|
|
173
|
+
Xs,
|
|
174
|
+
Ws,
|
|
175
|
+
Ys,
|
|
171
176
|
er,
|
|
177
|
+
zs,
|
|
172
178
|
tr,
|
|
173
|
-
Ys,
|
|
174
|
-
Hs,
|
|
175
|
-
ir,
|
|
176
|
-
nr,
|
|
177
|
-
Vs,
|
|
178
|
-
sr,
|
|
179
179
|
...e.options.types?.declarationTextTransformers ?? [],
|
|
180
180
|
...e._declarationTextTransformers
|
|
181
181
|
].reduce(
|
|
182
182
|
(n, s) => n === !1 ? !1 : s(n, e),
|
|
183
183
|
{ filePath: t, content: i }
|
|
184
184
|
)
|
|
185
|
-
),
|
|
185
|
+
), Vs = (e, t) => t.isInStorybook ? !1 : e, Xs = (e, t) => (
|
|
186
186
|
// Short-circuit quickly if file doesn't look like the one we want to exclude
|
|
187
187
|
e.filePath.endsWith(zt) && e.filePath === u.join(t.dir.dist, zt) ? !1 : e
|
|
188
|
-
), zt = "lumina.d.ts",
|
|
188
|
+
), zt = "lumina.d.ts", Qs = (e, t) => {
|
|
189
189
|
const i = t.dir.dist, n = `${i}src/`;
|
|
190
190
|
return e.filePath.startsWith(n) ? { ...e, filePath: `${i}${e.filePath.slice(n.length)}` } : !1;
|
|
191
|
-
}, Et = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."),
|
|
191
|
+
}, Et = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."), Zs = (e) => Et(e.filePath) || e.filePath.includes(".stories.") || e.filePath.includes(".story.") ? !1 : e, Ys = (e) => e.content.includes("__esri.") ? {
|
|
192
192
|
filePath: e.filePath,
|
|
193
193
|
content: `/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
194
194
|
${e.content}`
|
|
195
|
-
} : e,
|
|
195
|
+
} : e, er = (e, t) => {
|
|
196
196
|
t._htmlElementReferencesReplacer ??= {
|
|
197
197
|
regex: new RegExp(
|
|
198
198
|
`(${t.apiJsonComponents.map((n) => n.name).join("|")})\\[['"\`]el['"\`]\\]`,
|
|
@@ -207,8 +207,8 @@ ${e.content}`
|
|
|
207
207
|
filePath: e.filePath,
|
|
208
208
|
content: e.content.replace(i.regex, (n, s) => i.replacements[s])
|
|
209
209
|
};
|
|
210
|
-
},
|
|
211
|
-
const t = e.content.match(
|
|
210
|
+
}, tr = (e) => {
|
|
211
|
+
const t = e.content.match(ir)?.[1] ?? e.content.match(nr)?.[1];
|
|
212
212
|
if (t !== void 0)
|
|
213
213
|
throw Error(
|
|
214
214
|
w(
|
|
@@ -223,19 +223,19 @@ ${e.content}
|
|
|
223
223
|
)
|
|
224
224
|
);
|
|
225
225
|
return e;
|
|
226
|
-
},
|
|
227
|
-
function
|
|
226
|
+
}, ir = /^import (?:type \* as )?[^"'\n]+["'](\.[^\n]*?\.json)["'];$/mu, nr = /(?<![.\w\d-])import\(['"]([\w@\-/\\.]+)\.json['"]\)/u;
|
|
227
|
+
function sr(e, t) {
|
|
228
228
|
const i = X(t.name);
|
|
229
229
|
return e.members.find((n) => n.name === i);
|
|
230
230
|
}
|
|
231
|
-
function
|
|
231
|
+
function rr(e, t, i) {
|
|
232
232
|
const n = u.relative(t, e);
|
|
233
233
|
return i.modules.find((s) => s.path === n);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
235
|
+
function zi(e, t, i, n) {
|
|
236
236
|
const s = {
|
|
237
237
|
compiler: e,
|
|
238
|
-
apiModule: e.isInPuppeteerTestBackEnd ? void 0 :
|
|
238
|
+
apiModule: e.isInPuppeteerTestBackEnd ? void 0 : rr(i.fileName, e.dir.root, e.privateApiJson),
|
|
239
239
|
transformation: t
|
|
240
240
|
}, r = i.statements;
|
|
241
241
|
let a = i.statements;
|
|
@@ -246,9 +246,9 @@ function Gi(e, t, i, n) {
|
|
|
246
246
|
a = c(i, s);
|
|
247
247
|
}), Object.defineProperty(i, "statements", {
|
|
248
248
|
value: r
|
|
249
|
-
}),
|
|
249
|
+
}), or(i, a);
|
|
250
250
|
}
|
|
251
|
-
const
|
|
251
|
+
const or = (e, t) => o.factory.updateSourceFile(
|
|
252
252
|
e,
|
|
253
253
|
t,
|
|
254
254
|
/*
|
|
@@ -262,11 +262,11 @@ const lr = (e, t) => o.factory.updateSourceFile(
|
|
|
262
262
|
e.typeReferenceDirectives,
|
|
263
263
|
e.hasNoDefaultLib,
|
|
264
264
|
e.libReferenceDirectives
|
|
265
|
-
),
|
|
266
|
-
function
|
|
267
|
-
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text ===
|
|
265
|
+
), ar = (e) => `${qt}${" ".repeat(e.length - qt.length - Gt.length)}${Gt}`, qt = "/*", Gt = "*/", cr = (e) => e.statements.map(ur), lr = "@arcgis/lumina", dr = "LitElement", pr = "PublicLitElement", qi = "TargetedEvent";
|
|
266
|
+
function ur(e) {
|
|
267
|
+
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text === lr && e.importClause?.namedBindings && o.isNamedImports(e.importClause.namedBindings)) {
|
|
268
268
|
const t = e.importClause.namedBindings.elements.findIndex(
|
|
269
|
-
(n) => (n.propertyName ?? n.name).text ===
|
|
269
|
+
(n) => (n.propertyName ?? n.name).text === dr
|
|
270
270
|
);
|
|
271
271
|
if (t === -1)
|
|
272
272
|
return e;
|
|
@@ -283,14 +283,14 @@ function yr(e) {
|
|
|
283
283
|
o.factory.updateImportSpecifier(
|
|
284
284
|
i,
|
|
285
285
|
i.isTypeOnly,
|
|
286
|
-
o.factory.createIdentifier(
|
|
286
|
+
o.factory.createIdentifier(pr),
|
|
287
287
|
i.name
|
|
288
288
|
),
|
|
289
289
|
...e.importClause.namedBindings.elements.slice(t + 1),
|
|
290
290
|
o.factory.createImportSpecifier(
|
|
291
291
|
!e.importClause.isTypeOnly,
|
|
292
292
|
void 0,
|
|
293
|
-
o.factory.createIdentifier(
|
|
293
|
+
o.factory.createIdentifier(qi)
|
|
294
294
|
)
|
|
295
295
|
])
|
|
296
296
|
),
|
|
@@ -300,15 +300,15 @@ function yr(e) {
|
|
|
300
300
|
} else
|
|
301
301
|
return e;
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
function
|
|
303
|
+
const Gi = "_setterTypes";
|
|
304
|
+
function mr(e, t, i) {
|
|
305
305
|
return o.factory.createPropertyDeclaration(
|
|
306
306
|
[o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword)],
|
|
307
|
-
o.factory.createIdentifier(
|
|
307
|
+
o.factory.createIdentifier(Gi),
|
|
308
308
|
void 0,
|
|
309
309
|
o.factory.createTypeLiteralNode(
|
|
310
310
|
e.map((n) => {
|
|
311
|
-
const [s, r] =
|
|
311
|
+
const [s, r] = fr(n.name, n.type, i._typeScriptPrinter, t);
|
|
312
312
|
return o.factory.createPropertySignature(
|
|
313
313
|
void 0,
|
|
314
314
|
s,
|
|
@@ -320,7 +320,7 @@ function gr(e, t, i) {
|
|
|
320
320
|
void 0
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function fr(e, t, i, n) {
|
|
324
324
|
const s = i.printNode(o.EmitHint.Unspecified, e, n), r = i.printNode(o.EmitHint.Unspecified, t, n), a = `declare class A { ${s}: ${r} }`, d = o.createSourceFile(
|
|
325
325
|
"a.d.ts",
|
|
326
326
|
a,
|
|
@@ -330,8 +330,8 @@ function hr(e, t, i, n) {
|
|
|
330
330
|
).statements[0].members[0];
|
|
331
331
|
return [d.name, d.type];
|
|
332
332
|
}
|
|
333
|
-
const
|
|
334
|
-
function
|
|
333
|
+
const yr = (e, t) => t.apiModule === void 0 ? e.statements : e.statements.map((i) => gr(i, e, t));
|
|
334
|
+
function gr(e, t, i) {
|
|
335
335
|
if (o.isClassDeclaration(e)) {
|
|
336
336
|
const n = e, s = n.name?.text, r = i.apiModule.declarations.find(
|
|
337
337
|
(y) => y.name === s && "customElement" in y
|
|
@@ -341,13 +341,13 @@ function Sr(e, t, i) {
|
|
|
341
341
|
const a = [], c = /* @__PURE__ */ new Set(), l = [], d = [];
|
|
342
342
|
mt = void 0;
|
|
343
343
|
for (let y = 0; y < n.members.length; y++) {
|
|
344
|
-
const g = n.members[y], h =
|
|
344
|
+
const g = n.members[y], h = hr(g, r, l, c, t);
|
|
345
345
|
h === void 0 ? a.push(g) : Array.isArray(h) ? d.push(...h) : (o.setEmitFlags(h, o.EmitFlags.NoComments), d.push(h));
|
|
346
346
|
}
|
|
347
347
|
c.size > 0 && a.forEach((y) => {
|
|
348
348
|
const g = X(y.name);
|
|
349
|
-
g !== void 0 && c.has(g) && d.push(
|
|
350
|
-
}), l.length > 0 && d.push(
|
|
349
|
+
g !== void 0 && c.has(g) && d.push(Sr(y));
|
|
350
|
+
}), l.length > 0 && d.push(mr(l, t, i.compiler));
|
|
351
351
|
const p = o.factory.updateClassDeclaration(
|
|
352
352
|
n,
|
|
353
353
|
n.modifiers,
|
|
@@ -378,7 +378,7 @@ function Sr(e, t, i) {
|
|
|
378
378
|
return e;
|
|
379
379
|
}
|
|
380
380
|
let mt;
|
|
381
|
-
function
|
|
381
|
+
function hr(e, t, i, n, s) {
|
|
382
382
|
const r = X(e.name);
|
|
383
383
|
if (r === void 0)
|
|
384
384
|
return;
|
|
@@ -396,7 +396,7 @@ function br(e, t, i, n, s) {
|
|
|
396
396
|
Qt(e.modifiers),
|
|
397
397
|
e.name,
|
|
398
398
|
void 0,
|
|
399
|
-
|
|
399
|
+
br(e.type, s),
|
|
400
400
|
e.initializer
|
|
401
401
|
);
|
|
402
402
|
return o.setSyntheticLeadingComments(d, V(l)), d;
|
|
@@ -475,13 +475,13 @@ function br(e, t, i, n, s) {
|
|
|
475
475
|
}
|
|
476
476
|
const Vt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
477
477
|
function Xt(e, t, i) {
|
|
478
|
-
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(
|
|
478
|
+
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(vr) ?? [];
|
|
479
479
|
for (const r of s)
|
|
480
480
|
e.add(r);
|
|
481
481
|
return t;
|
|
482
482
|
}
|
|
483
|
-
const
|
|
484
|
-
function
|
|
483
|
+
const vr = /(?<=this.)[\w$]+/gu;
|
|
484
|
+
function Sr(e) {
|
|
485
485
|
if (o.setEmitFlags(e, o.EmitFlags.NoComments), o.isPropertyDeclaration(e)) {
|
|
486
486
|
const t = ke(e.modifiers);
|
|
487
487
|
if (t !== e.modifiers)
|
|
@@ -536,11 +536,11 @@ function ke(e) {
|
|
|
536
536
|
)
|
|
537
537
|
];
|
|
538
538
|
}
|
|
539
|
-
function
|
|
539
|
+
function br(e, t) {
|
|
540
540
|
if (e === void 0)
|
|
541
541
|
return;
|
|
542
542
|
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;
|
|
543
|
-
return typeof i == "object" ? o.factory.createTypeReferenceNode(
|
|
543
|
+
return typeof i == "object" ? o.factory.createTypeReferenceNode(qi, [
|
|
544
544
|
o.factory.createThisTypeNode(),
|
|
545
545
|
...i
|
|
546
546
|
]) : (C.warn(
|
|
@@ -549,10 +549,10 @@ function Er(e, t) {
|
|
|
549
549
|
t.fileName
|
|
550
550
|
), e);
|
|
551
551
|
}
|
|
552
|
-
const
|
|
553
|
-
function
|
|
552
|
+
const wr = [cr, yr], Zt = "@arcgis/lumina:componentDtsTransformer";
|
|
553
|
+
function Tr(e) {
|
|
554
554
|
let t;
|
|
555
|
-
const i =
|
|
555
|
+
const i = Er(e);
|
|
556
556
|
return {
|
|
557
557
|
name: Zt,
|
|
558
558
|
supports(n) {
|
|
@@ -580,22 +580,22 @@ function $r(e) {
|
|
|
580
580
|
}
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
const
|
|
584
|
-
...
|
|
583
|
+
const Er = (e) => (t) => (i) => zi(e, t, i, [
|
|
584
|
+
...wr,
|
|
585
585
|
...e.options.types?.declarationAstTransformers ?? []
|
|
586
|
-
]),
|
|
587
|
-
get:
|
|
588
|
-
set:
|
|
586
|
+
]), Cr = (e) => new Proxy(e, {
|
|
587
|
+
get: $r,
|
|
588
|
+
set: Pr
|
|
589
589
|
});
|
|
590
|
-
function
|
|
590
|
+
function $r(e, t, i) {
|
|
591
591
|
if (t in e)
|
|
592
592
|
return Reflect.get(e, t, i);
|
|
593
593
|
throw new Error(`Requested unexpected property ${String(t)}`);
|
|
594
594
|
}
|
|
595
|
-
function
|
|
595
|
+
function Pr(e, t) {
|
|
596
596
|
throw new Error(`Unexpectedly tried to set the ${String(t)} property.`);
|
|
597
597
|
}
|
|
598
|
-
function
|
|
598
|
+
function xr(e) {
|
|
599
599
|
const t = e.options.types ?? {};
|
|
600
600
|
let i = !1;
|
|
601
601
|
const n = {
|
|
@@ -603,7 +603,7 @@ function Ir(e) {
|
|
|
603
603
|
// For details, see comment above excludeOutsideFiles in
|
|
604
604
|
// https://devtopia.esri.com/WebGIS/arcgis-web-components/blob/main/packages/support-packages/lit-compiler/src/types/textTransformers.ts
|
|
605
605
|
rootDir: "."
|
|
606
|
-
}, s =
|
|
606
|
+
}, s = us({
|
|
607
607
|
...t,
|
|
608
608
|
compilerOptions: n,
|
|
609
609
|
tsconfigPath: e.options.types?.tsconfigPath,
|
|
@@ -616,7 +616,7 @@ function Ir(e) {
|
|
|
616
616
|
}
|
|
617
617
|
return t?.afterDiagnostic?.(r);
|
|
618
618
|
},
|
|
619
|
-
beforeWriteFile:
|
|
619
|
+
beforeWriteFile: Gs(e),
|
|
620
620
|
resolvers: [
|
|
621
621
|
/**
|
|
622
622
|
* The vite-plugin-dts does not provide a way to get a reference to the
|
|
@@ -640,7 +640,7 @@ function Ir(e) {
|
|
|
640
640
|
}
|
|
641
641
|
},
|
|
642
642
|
...t?.resolvers ?? [],
|
|
643
|
-
|
|
643
|
+
Tr(e)
|
|
644
644
|
]
|
|
645
645
|
});
|
|
646
646
|
return {
|
|
@@ -661,7 +661,7 @@ function Ir(e) {
|
|
|
661
661
|
if (typeof c != "function")
|
|
662
662
|
throw new Error("Expected transform to be a function");
|
|
663
663
|
if (await a.call(this, r), await c.call(
|
|
664
|
-
|
|
664
|
+
Cr({}),
|
|
665
665
|
"",
|
|
666
666
|
/*
|
|
667
667
|
* Have to give it a file that will be matched by the tsconfig's
|
|
@@ -673,7 +673,7 @@ function Ir(e) {
|
|
|
673
673
|
}
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
const
|
|
676
|
+
const kr = "Fragment", et = "DynamicHtmlTag", tt = "DynamicSvgTag", Re = Symbol("dynamic html tag name"), ft = Symbol("dynamic svg tag name"), Vi = /* @__PURE__ */ new Set([
|
|
677
677
|
/**
|
|
678
678
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
679
679
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -694,7 +694,7 @@ const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Re = Symbol(
|
|
|
694
694
|
"resource",
|
|
695
695
|
"typeof",
|
|
696
696
|
"vocab"
|
|
697
|
-
]),
|
|
697
|
+
]), Xi = /* @__PURE__ */ new Set([
|
|
698
698
|
/*
|
|
699
699
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
700
700
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -721,7 +721,7 @@ const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Re = Symbol(
|
|
|
721
721
|
meta: /* @__PURE__ */ new Set(["charset"]),
|
|
722
722
|
math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
|
|
723
723
|
menu: /* @__PURE__ */ new Set(["label", "type"])
|
|
724
|
-
},
|
|
724
|
+
}, B = {
|
|
725
725
|
common: {
|
|
726
726
|
reflected: {
|
|
727
727
|
hidden: "hidden",
|
|
@@ -1534,9 +1534,9 @@ const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Re = Symbol(
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
|
-
|
|
1538
|
-
Object.values(
|
|
1539
|
-
function
|
|
1537
|
+
Qi(B.common);
|
|
1538
|
+
Object.values(B.perElement).forEach(Qi);
|
|
1539
|
+
function Qi(e) {
|
|
1540
1540
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
1541
1541
|
/* @__PURE__ */ Object.create(null),
|
|
1542
1542
|
e.stringifiedReflected
|
|
@@ -1545,7 +1545,7 @@ function Yi(e) {
|
|
|
1545
1545
|
e.stringifiedNonReflected
|
|
1546
1546
|
));
|
|
1547
1547
|
}
|
|
1548
|
-
const Yt = /* @__PURE__ */ new Set(["itemScope"]),
|
|
1548
|
+
const Yt = /* @__PURE__ */ new Set(["itemScope"]), Zi = /* @__PURE__ */ new Set([
|
|
1549
1549
|
"abort",
|
|
1550
1550
|
"animationCancel",
|
|
1551
1551
|
"animationEnd",
|
|
@@ -1644,7 +1644,7 @@ const Yt = /* @__PURE__ */ new Set(["itemScope"]), en = /* @__PURE__ */ new Set(
|
|
|
1644
1644
|
"volumeChange",
|
|
1645
1645
|
"waiting",
|
|
1646
1646
|
"wheel"
|
|
1647
|
-
]),
|
|
1647
|
+
]), Ar = /* @__PURE__ */ new Set([
|
|
1648
1648
|
"area",
|
|
1649
1649
|
"base",
|
|
1650
1650
|
"br",
|
|
@@ -1720,7 +1720,7 @@ const Yt = /* @__PURE__ */ new Set(["itemScope"]), en = /* @__PURE__ */ new Set(
|
|
|
1720
1720
|
"tspan",
|
|
1721
1721
|
"use",
|
|
1722
1722
|
"view"
|
|
1723
|
-
]),
|
|
1723
|
+
]), Ir = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), $t = /* @__PURE__ */ new Set([
|
|
1724
1724
|
"annotation-xml",
|
|
1725
1725
|
"annotation",
|
|
1726
1726
|
"maction",
|
|
@@ -1752,7 +1752,7 @@ const Yt = /* @__PURE__ */ new Set(["itemScope"]), en = /* @__PURE__ */ new Set(
|
|
|
1752
1752
|
"munder",
|
|
1753
1753
|
"munderover",
|
|
1754
1754
|
"semantics"
|
|
1755
|
-
]),
|
|
1755
|
+
]), Lr = /* @__PURE__ */ new Set([
|
|
1756
1756
|
"annotation-xml",
|
|
1757
1757
|
"color-profile",
|
|
1758
1758
|
"font-face",
|
|
@@ -1761,47 +1761,8 @@ const Yt = /* @__PURE__ */ new Set(["itemScope"]), en = /* @__PURE__ */ new Set(
|
|
|
1761
1761
|
"font-face-format",
|
|
1762
1762
|
"font-face-name",
|
|
1763
1763
|
"missing-glyph"
|
|
1764
|
-
])
|
|
1765
|
-
|
|
1766
|
-
" ": "\\t",
|
|
1767
|
-
"\v": "\\v",
|
|
1768
|
-
"\f": "\\f",
|
|
1769
|
-
"\b": "\\b",
|
|
1770
|
-
"\r": "\\r",
|
|
1771
|
-
// Bug fix: do not escape new line
|
|
1772
|
-
"\n": `
|
|
1773
|
-
`,
|
|
1774
|
-
"\\": "\\\\",
|
|
1775
|
-
'"': '\\"',
|
|
1776
|
-
"'": "\\'",
|
|
1777
|
-
"`": "\\`",
|
|
1778
|
-
"\u2028": "\\u2028",
|
|
1779
|
-
// lineSeparator
|
|
1780
|
-
"\u2029": "\\u2029",
|
|
1781
|
-
// paragraphSeparator
|
|
1782
|
-
"
": "\\u0085",
|
|
1783
|
-
// nextLine
|
|
1784
|
-
"\r\n": "\\r\\n"
|
|
1785
|
-
// special case for CRLFs in backticks
|
|
1786
|
-
})
|
|
1787
|
-
);
|
|
1788
|
-
function tn(e) {
|
|
1789
|
-
return `\\u${`0000${e.toString(Mr).toUpperCase()}`.slice(-4)}`;
|
|
1790
|
-
}
|
|
1791
|
-
const Mr = 16;
|
|
1792
|
-
function Or(e, t, i) {
|
|
1793
|
-
if (e.charCodeAt(0) === Wr) {
|
|
1794
|
-
const n = i.charCodeAt(t + e.length);
|
|
1795
|
-
return n >= _r && n <= Hr ? "\\x00" : "\\0";
|
|
1796
|
-
}
|
|
1797
|
-
return Rr.get(e) || tn(e.charCodeAt(0));
|
|
1798
|
-
}
|
|
1799
|
-
const Jr = (e) => e.replace(jr, Or), ei = /[^\u0000-\u007F]/g;
|
|
1800
|
-
function Kr(e) {
|
|
1801
|
-
return e = Jr(e), ei.test(e) ? e.replace(ei, (t) => tn(t.charCodeAt(0))) : e;
|
|
1802
|
-
}
|
|
1803
|
-
const Br = Kr, Wr = 0, _r = 48, Hr = 57, Ur = /\$\{/gu, zr = (e) => e.replace(Ur, "\\${");
|
|
1804
|
-
function qr(e) {
|
|
1764
|
+
]);
|
|
1765
|
+
function Fr(e) {
|
|
1805
1766
|
if (e.length === 0)
|
|
1806
1767
|
return "";
|
|
1807
1768
|
const t = e[0];
|
|
@@ -1814,13 +1775,13 @@ function qr(e) {
|
|
|
1814
1775
|
}
|
|
1815
1776
|
return e.trim().length === 0 ? t : e;
|
|
1816
1777
|
}
|
|
1817
|
-
const
|
|
1778
|
+
const Nr = (e) => jr(e).replaceAll("`", "\\`"), Dr = /\$\{/gu, jr = (e) => e.replace(Dr, "\\${"), Rr = (e) => !Mr.test(e), Mr = /^[^\s"'=<>`]+$/u, Or = /[&<>]/gu, Jr = {
|
|
1818
1779
|
"&": "&",
|
|
1819
1780
|
"<": "<",
|
|
1820
1781
|
">": ">"
|
|
1821
|
-
},
|
|
1822
|
-
(await e.componentFilesPromise).map((t) => [
|
|
1823
|
-
),
|
|
1782
|
+
}, Yi = (e) => e.replace(Or, (t) => Jr[t]), Pt = (e) => typeof e == "string" && e.includes("-") && !Lr.has(e), Kr = async (e) => Object.fromEntries(
|
|
1783
|
+
(await e.componentFilesPromise).map((t) => [en(t), t])
|
|
1784
|
+
), en = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", Tt.slice(0, -3))), xt = async (e, t, i = t) => await Ue(i, { recursive: !0 }).catch((n) => {
|
|
1824
1785
|
if (String(n).includes("ENOENT"))
|
|
1825
1786
|
return C.error("@arcgis/lumina", `Unable to find the ${i} directory (cwd: ${process.cwd()})`), [];
|
|
1826
1787
|
throw n;
|
|
@@ -1838,83 +1799,83 @@ const ze = (e) => zr(Br(e)), Gr = (e) => !Vr.test(e), Vr = /^[^\s"'=<>`]+$/u, Xr
|
|
|
1838
1799
|
function he(e, t) {
|
|
1839
1800
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
1840
1801
|
return !1;
|
|
1841
|
-
const [i, n] = e.slice(0, -4).split(u.sep).slice(
|
|
1802
|
+
const [i, n] = e.slice(0, -4).split(u.sep).slice(Wr);
|
|
1842
1803
|
return i === n;
|
|
1843
1804
|
}
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
const me =
|
|
1849
|
-
function
|
|
1805
|
+
const Wr = -2, ei = 5, ti = 1, ii = 1, ni = 3, si = 4, ze = o;
|
|
1806
|
+
Br(ze.createSourceMapGenerator);
|
|
1807
|
+
_r(ze.createTextWriter);
|
|
1808
|
+
Hr(ze.getNewLineCharacter);
|
|
1809
|
+
const me = ze;
|
|
1810
|
+
function Br(e) {
|
|
1850
1811
|
if (typeof e != "function")
|
|
1851
1812
|
throw new Error(
|
|
1852
1813
|
"Failed to find ts.createSourceMapGenerator() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1853
1814
|
);
|
|
1854
|
-
if (e.length !==
|
|
1815
|
+
if (e.length !== ei)
|
|
1855
1816
|
throw new Error(
|
|
1856
|
-
`ts.createSourceMapGenerator() signature changed. Expected ${
|
|
1817
|
+
`ts.createSourceMapGenerator() signature changed. Expected ${ei} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1857
1818
|
);
|
|
1858
1819
|
}
|
|
1859
|
-
function
|
|
1820
|
+
function _r(e) {
|
|
1860
1821
|
if (typeof e != "function")
|
|
1861
1822
|
throw new Error(
|
|
1862
1823
|
"Failed to find ts.createTextWriter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1863
1824
|
);
|
|
1864
|
-
if (e.length !==
|
|
1825
|
+
if (e.length !== ti)
|
|
1865
1826
|
throw new Error(
|
|
1866
|
-
`ts.createTextWriter() signature changed. Expected ${
|
|
1827
|
+
`ts.createTextWriter() signature changed. Expected ${ti} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1867
1828
|
);
|
|
1868
1829
|
}
|
|
1869
|
-
function
|
|
1830
|
+
function Hr(e) {
|
|
1870
1831
|
if (typeof e != "function")
|
|
1871
1832
|
throw new Error(
|
|
1872
1833
|
"Failed to find ts.getNewLineCharacter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1873
1834
|
);
|
|
1874
|
-
if (e.length !==
|
|
1835
|
+
if (e.length !== ii)
|
|
1875
1836
|
throw new Error(
|
|
1876
|
-
`ts.getNewLineCharacter() signature changed. Expected ${
|
|
1837
|
+
`ts.getNewLineCharacter() signature changed. Expected ${ii} argument. Lumina needs to be updated to support the new TypeScript version`
|
|
1877
1838
|
);
|
|
1878
1839
|
}
|
|
1879
|
-
function
|
|
1840
|
+
function Ur(e) {
|
|
1880
1841
|
if (typeof e != "function")
|
|
1881
1842
|
throw new Error(
|
|
1882
1843
|
"Failed to find ts.Printer.writeFile() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1883
1844
|
);
|
|
1884
|
-
if (e.length !==
|
|
1845
|
+
if (e.length !== ni)
|
|
1885
1846
|
throw new Error(
|
|
1886
|
-
`ts.Printer.writeFile() signature changed. Expected ${
|
|
1847
|
+
`ts.Printer.writeFile() signature changed. Expected ${ni} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1887
1848
|
);
|
|
1888
1849
|
}
|
|
1889
|
-
function
|
|
1850
|
+
function zr(e) {
|
|
1890
1851
|
if (typeof e != "function")
|
|
1891
1852
|
throw new Error(
|
|
1892
1853
|
"Failed to find ts.Printer.writeNode() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1893
1854
|
);
|
|
1894
|
-
if (e.length !==
|
|
1855
|
+
if (e.length !== si)
|
|
1895
1856
|
throw new Error(
|
|
1896
|
-
`ts.Printer.writeNode() signature changed. Expected ${
|
|
1857
|
+
`ts.Printer.writeNode() signature changed. Expected ${si} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1897
1858
|
);
|
|
1898
1859
|
}
|
|
1899
|
-
function
|
|
1860
|
+
function tn(e) {
|
|
1900
1861
|
const t = me.createPrinter(e);
|
|
1901
|
-
return
|
|
1862
|
+
return Ur(t.writeFile), zr(t.writeNode), t;
|
|
1902
1863
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const t = o.isUnionTypeNode(e) ? e.types.map(
|
|
1864
|
+
function ri(e) {
|
|
1865
|
+
const t = o.isUnionTypeNode(e) ? e.types.map(oi) : [oi(e)], i = new Set(t), n = i.delete("true"), s = i.delete("false");
|
|
1905
1866
|
(n || s) && i.add("boolean");
|
|
1906
1867
|
let r = Array.from(i).sort();
|
|
1907
|
-
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length >
|
|
1908
|
-
return r.map(
|
|
1868
|
+
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length > qr))
|
|
1869
|
+
return r.map(Xr);
|
|
1909
1870
|
}
|
|
1910
|
-
const
|
|
1871
|
+
const qr = 40, Gr = (e) => e?.some(
|
|
1911
1872
|
(t) => t.type === "number" || t.type === "boolean" || t.type === "string" || /**
|
|
1912
1873
|
* Treat "any" as possibly literal, but not "unknown". Matches Stencil
|
|
1913
1874
|
* behavior.
|
|
1914
1875
|
*/
|
|
1915
1876
|
t.type === "any"
|
|
1916
|
-
) ?? !1,
|
|
1917
|
-
function
|
|
1877
|
+
) ?? !1, Vr = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e, nn = (e) => e.map(sn).join(" | "), sn = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
|
|
1878
|
+
function Xr(e) {
|
|
1918
1879
|
return e === "boolean" ? { type: "boolean" } : Number.isNaN(Number.parseFloat(e)) ? e.startsWith('"') || e.startsWith("'") ? {
|
|
1919
1880
|
value: e.slice(1, -1),
|
|
1920
1881
|
type: "string"
|
|
@@ -1925,50 +1886,50 @@ function co(e) {
|
|
|
1925
1886
|
type: "number"
|
|
1926
1887
|
};
|
|
1927
1888
|
}
|
|
1928
|
-
const
|
|
1889
|
+
const Qr = (e, t, i, n) => {
|
|
1929
1890
|
const s = e.typeScriptTypeChecker, r = o.isSetAccessor(t) ? t.parameters[0] : t, a = s.getTypeAtLocation(r), c = !i;
|
|
1930
1891
|
return Me(s, a, n, e.dir, c);
|
|
1931
1892
|
};
|
|
1932
|
-
function
|
|
1893
|
+
function Zr(e, t) {
|
|
1933
1894
|
if (e.length === 0)
|
|
1934
1895
|
return;
|
|
1935
|
-
const i = t.matchAll(
|
|
1896
|
+
const i = t.matchAll(Yr), n = [];
|
|
1936
1897
|
for (const s of i) {
|
|
1937
1898
|
const r = e.find((a) => a.name === s[0]);
|
|
1938
1899
|
r !== void 0 && n.push({ ...r, start: s.index, end: s.index + r.name.length });
|
|
1939
1900
|
}
|
|
1940
1901
|
return n.length === 0 ? void 0 : n;
|
|
1941
1902
|
}
|
|
1942
|
-
const
|
|
1903
|
+
const Yr = /"[^"]+"|'[^"]+'|\w+/gu;
|
|
1943
1904
|
function Me(e, t, i, n, s = !1) {
|
|
1944
|
-
let { typeNode: r, references: a } =
|
|
1945
|
-
c === void 0 && ({ typeNode: r, references: a } =
|
|
1946
|
-
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d =
|
|
1905
|
+
let { typeNode: r, references: a } = ci(e, t, i, n), c = ri(r);
|
|
1906
|
+
c === void 0 && ({ typeNode: r, references: a } = ci(e, t, i, n, !1), c = ri(r) ?? []);
|
|
1907
|
+
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d = nn(l), p = Vr(l), m = Zr(a, d);
|
|
1947
1908
|
return {
|
|
1948
1909
|
text: d,
|
|
1949
1910
|
references: m,
|
|
1950
1911
|
values: p
|
|
1951
1912
|
};
|
|
1952
1913
|
}
|
|
1953
|
-
function
|
|
1954
|
-
|
|
1955
|
-
const t =
|
|
1956
|
-
return
|
|
1914
|
+
function oi(e) {
|
|
1915
|
+
eo.writeNode(o.EmitHint.Unspecified, e, void 0, it);
|
|
1916
|
+
const t = it.getText();
|
|
1917
|
+
return it.clear(), t;
|
|
1957
1918
|
}
|
|
1958
|
-
const
|
|
1959
|
-
`),
|
|
1960
|
-
function
|
|
1919
|
+
const eo = tn({ removeComments: !0 }), it = me.createTextWriter(`
|
|
1920
|
+
`), rn = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, to = rn & o.TypeFormatFlags.NodeBuilderFlagsMask, io = to | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
1921
|
+
function no(e, t, i, n = !0) {
|
|
1961
1922
|
const s = /* @__PURE__ */ new Map();
|
|
1962
1923
|
se(t, s, i, n);
|
|
1963
|
-
const r = t.flags & o.TypeFlags.Union ? t.types.every(
|
|
1924
|
+
const r = t.flags & o.TypeFlags.Union ? t.types.every(ai) : ai(t), a = e.typeToTypeNode(
|
|
1964
1925
|
t,
|
|
1965
1926
|
void 0,
|
|
1966
|
-
|
|
1927
|
+
io & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
1967
1928
|
);
|
|
1968
|
-
return s.forEach(
|
|
1929
|
+
return s.forEach(so), a === void 0 ? (C.warn("@arcgis/lumina", "Unexpected case: Failed to convert type to type node."), o.factory.createTypeReferenceNode(o.factory.createIdentifier("unknown"), void 0)) : a;
|
|
1969
1930
|
}
|
|
1970
|
-
const
|
|
1971
|
-
function
|
|
1931
|
+
const ai = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
1932
|
+
function ci(e, t, i, n, s = !0) {
|
|
1972
1933
|
const r = [], a = /* @__PURE__ */ new Set();
|
|
1973
1934
|
function c(d, p) {
|
|
1974
1935
|
const m = d.aliasSymbol ?? d.symbol;
|
|
@@ -1997,10 +1958,10 @@ function li(e, t, i, n, s = !0) {
|
|
|
1997
1958
|
name: f,
|
|
1998
1959
|
package: void 0,
|
|
1999
1960
|
module: "index.js"
|
|
2000
|
-
} :
|
|
1961
|
+
} : ro(m, f, i, n);
|
|
2001
1962
|
r.push(y), a.add(f);
|
|
2002
1963
|
}
|
|
2003
|
-
return { typeNode:
|
|
1964
|
+
return { typeNode: no(e, t, c, s), references: r };
|
|
2004
1965
|
}
|
|
2005
1966
|
function se(e, t, i, n = !0) {
|
|
2006
1967
|
if (typeof e != "object" || e === null || !("checker" in e))
|
|
@@ -2030,10 +1991,10 @@ function se(e, t, i, n = !0) {
|
|
|
2030
1991
|
c !== "resolvedBaseConstructorType" && c !== "resolvedBaseTypes" && c !== "typeParameters" && c !== "typeParameter" && (Array.isArray(l) ? l.forEach((d) => se(d, t, i, n)) : se(l, t, i, n));
|
|
2031
1992
|
});
|
|
2032
1993
|
}
|
|
2033
|
-
function
|
|
1994
|
+
function so(e, t) {
|
|
2034
1995
|
e.origin !== void 0 && (t.origin = e.origin), e.aliasSymbol !== void 0 && (t.aliasSymbol = e.aliasSymbol), e.aliasTypeArguments !== void 0 && (t.aliasTypeArguments = e.aliasTypeArguments);
|
|
2035
1996
|
}
|
|
2036
|
-
function
|
|
1997
|
+
function ro(e, t, i, n) {
|
|
2037
1998
|
const s = e?.declarations?.map((c) => c.getSourceFile()) ?? [];
|
|
2038
1999
|
if (s.length === 0) {
|
|
2039
2000
|
if (t === "Array")
|
|
@@ -2051,26 +2012,26 @@ function vo(e, t, i, n) {
|
|
|
2051
2012
|
if (s.length === 0)
|
|
2052
2013
|
return {
|
|
2053
2014
|
name: t,
|
|
2054
|
-
package:
|
|
2015
|
+
package: Oi,
|
|
2055
2016
|
module: void 0
|
|
2056
2017
|
};
|
|
2057
|
-
const { packageName: r, moduleName: a } =
|
|
2018
|
+
const { packageName: r, moduleName: a } = oo(s[0].fileName, n);
|
|
2058
2019
|
return r ? {
|
|
2059
2020
|
name: t,
|
|
2060
2021
|
package: r,
|
|
2061
2022
|
module: a.length > 0 ? a : void 0,
|
|
2062
|
-
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ?
|
|
2023
|
+
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ? li(e, s[0], "core") : r === "typescript" ? li(e, s[0], "typescript") : void 0
|
|
2063
2024
|
} : {
|
|
2064
2025
|
name: t,
|
|
2065
2026
|
package: void 0,
|
|
2066
2027
|
module: a
|
|
2067
2028
|
};
|
|
2068
2029
|
}
|
|
2069
|
-
function
|
|
2030
|
+
function oo(e, t) {
|
|
2070
2031
|
const i = e.split("/node_modules/");
|
|
2071
2032
|
if (i.length > 1) {
|
|
2072
2033
|
const a = i.at(-1);
|
|
2073
|
-
return
|
|
2034
|
+
return on(a);
|
|
2074
2035
|
}
|
|
2075
2036
|
const s = e.split("/dist/");
|
|
2076
2037
|
if (s.length > 1) {
|
|
@@ -2079,36 +2040,36 @@ function So(e, t) {
|
|
|
2079
2040
|
}
|
|
2080
2041
|
return {
|
|
2081
2042
|
packageName: void 0,
|
|
2082
|
-
moduleName: u.relative(t.root,
|
|
2043
|
+
moduleName: u.relative(t.root, co(ao(e, t)))
|
|
2083
2044
|
};
|
|
2084
2045
|
}
|
|
2085
|
-
function
|
|
2086
|
-
return he(e, t.srcComponents) ? u.join(t.dist,
|
|
2046
|
+
function ao(e, t) {
|
|
2047
|
+
return he(e, t.srcComponents) ? u.join(t.dist, en(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2087
2048
|
}
|
|
2088
|
-
const
|
|
2089
|
-
function
|
|
2049
|
+
const co = (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`;
|
|
2050
|
+
function on(e) {
|
|
2090
2051
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2091
2052
|
return { packageName: s, moduleName: r };
|
|
2092
2053
|
}
|
|
2093
|
-
const
|
|
2094
|
-
function
|
|
2054
|
+
const lo = (e) => e.includes("/node_modules/") || e.includes("/dist/");
|
|
2055
|
+
function li(e, t, i) {
|
|
2095
2056
|
const n = e.declarations;
|
|
2096
2057
|
if (n !== void 0)
|
|
2097
2058
|
for (const s of n) {
|
|
2098
|
-
const r =
|
|
2059
|
+
const r = di(s, t, i);
|
|
2099
2060
|
if (r !== void 0)
|
|
2100
2061
|
return r;
|
|
2101
2062
|
if (!("members" in s))
|
|
2102
2063
|
continue;
|
|
2103
2064
|
const a = s.members;
|
|
2104
2065
|
for (const c of a) {
|
|
2105
|
-
const l =
|
|
2066
|
+
const l = di(c, t, i);
|
|
2106
2067
|
if (l !== void 0)
|
|
2107
|
-
return
|
|
2068
|
+
return po(l);
|
|
2108
2069
|
}
|
|
2109
2070
|
}
|
|
2110
2071
|
}
|
|
2111
|
-
function
|
|
2072
|
+
function di(e, t, i) {
|
|
2112
2073
|
const n = e.jsDoc?.[0];
|
|
2113
2074
|
if (n !== void 0)
|
|
2114
2075
|
return ye([n, ...n.tags ?? []], ({ comment: s }) => {
|
|
@@ -2128,16 +2089,16 @@ function pi(e, t, i) {
|
|
|
2128
2089
|
});
|
|
2129
2090
|
});
|
|
2130
2091
|
}
|
|
2131
|
-
const
|
|
2132
|
-
function
|
|
2092
|
+
const po = (e) => e.split("#")[0];
|
|
2093
|
+
function uo(e) {
|
|
2133
2094
|
const t = [];
|
|
2134
|
-
for (const i of e.matchAll(
|
|
2135
|
-
const n = i.groups.name, s = i.groups.description.replaceAll(
|
|
2095
|
+
for (const i of e.matchAll(mo)) {
|
|
2096
|
+
const n = i.groups.name, s = i.groups.description.replaceAll(fo, " ").trim();
|
|
2136
2097
|
t.push({ name: n, description: s.endsWith("*") ? s.slice(0, -1).trim() : s });
|
|
2137
2098
|
}
|
|
2138
2099
|
return t.length === 0 ? void 0 : t;
|
|
2139
2100
|
}
|
|
2140
|
-
const
|
|
2101
|
+
const mo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, fo = /\n\s+\*? ?/gu, yo = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], Oe = new RegExp(`\\.(${yo.join("|")})(\\?|$)`, "u"), go = /^import ["'](?<specifier>[^"']+)["'];$/gmu, ho = () => "throwError", te = "@arcgis/lumina:loadLitCss", Q = "?layered", Fe = "?global", vo = (e) => ({
|
|
2141
2102
|
name: te,
|
|
2142
2103
|
enforce: "pre",
|
|
2143
2104
|
configResolved(t) {
|
|
@@ -2154,7 +2115,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2154
2115
|
if (l && (a = a.slice(0, -Fe.length)), !Oe.test(a) || a.includes("?"))
|
|
2155
2116
|
return await n.call(this, r, a);
|
|
2156
2117
|
const d = `${a}?inline`, p = await n.call(this, r, d), { code: m, ...f } = typeof p == "string" ? { code: p } : p ?? {};
|
|
2157
|
-
if (typeof m != "string" || !m.startsWith(
|
|
2118
|
+
if (typeof m != "string" || !m.startsWith(an) || !m.endsWith(cn))
|
|
2158
2119
|
return C.warn(
|
|
2159
2120
|
te,
|
|
2160
2121
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
@@ -2162,9 +2123,9 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2162
2123
|
)}`
|
|
2163
2124
|
), p;
|
|
2164
2125
|
if (l)
|
|
2165
|
-
return e._globalCssString =
|
|
2126
|
+
return e._globalCssString = ln(m), { code: "", map: { mappings: "" } };
|
|
2166
2127
|
{
|
|
2167
|
-
const y = e.isFullApiExtraction ?
|
|
2128
|
+
const y = e.isFullApiExtraction ? uo(r) : void 0;
|
|
2168
2129
|
if (y !== void 0) {
|
|
2169
2130
|
e._cssDocs ??= /* @__PURE__ */ new Map(), e._cssDocs.set(a, y);
|
|
2170
2131
|
const g = e._cssImports.get(a);
|
|
@@ -2184,7 +2145,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2184
2145
|
}
|
|
2185
2146
|
return {
|
|
2186
2147
|
...f,
|
|
2187
|
-
code:
|
|
2148
|
+
code: To(m, e.hmrEnabled, e.shouldMinify, c),
|
|
2188
2149
|
/**
|
|
2189
2150
|
* Vite's original transform does not generate source maps for inlined
|
|
2190
2151
|
* css, thus we can't either
|
|
@@ -2198,14 +2159,14 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2198
2159
|
if (!(i.endsWith(".js") || i.endsWith(".ts") || i.endsWith(".tsx") || e.isInStorybook && i.endsWith(".mdx")))
|
|
2199
2160
|
return;
|
|
2200
2161
|
let s = 0;
|
|
2201
|
-
const r =
|
|
2162
|
+
const r = lo(i);
|
|
2202
2163
|
let a = !1;
|
|
2203
|
-
const c = t.replaceAll(
|
|
2164
|
+
const c = t.replaceAll(go, (l, d) => {
|
|
2204
2165
|
if (!Oe.test(d) || d.includes("?"))
|
|
2205
2166
|
return l;
|
|
2206
2167
|
if (r) {
|
|
2207
|
-
if ((e.options.css?.sideEffectImportHandling ??
|
|
2208
|
-
return a = !0,
|
|
2168
|
+
if ((e.options.css?.sideEffectImportHandling ?? ho)(d, i) === "drop")
|
|
2169
|
+
return a = !0, ar(l);
|
|
2209
2170
|
throw Error(
|
|
2210
2171
|
w(
|
|
2211
2172
|
te,
|
|
@@ -2213,7 +2174,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2213
2174
|
i
|
|
2214
2175
|
)
|
|
2215
2176
|
);
|
|
2216
|
-
} else if (e.isInStorybook &&
|
|
2177
|
+
} else if (e.isInStorybook && Co(i, e)) {
|
|
2217
2178
|
a = !0;
|
|
2218
2179
|
const p = `storybookCss$${s}`;
|
|
2219
2180
|
return s += 1, [
|
|
@@ -2244,7 +2205,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2244
2205
|
map: null
|
|
2245
2206
|
} : void 0;
|
|
2246
2207
|
}
|
|
2247
|
-
}),
|
|
2208
|
+
}), an = 'export default "', cn = '"', So = "import { css } from '@lit/reactive-element/css-tag.js';\nexport const styles = css`", bo = "`;\nexport default styles;", wo = `
|
|
2248
2209
|
|
|
2249
2210
|
if(import.meta.hot) {
|
|
2250
2211
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -2255,26 +2216,26 @@ if(import.meta.hot) {
|
|
|
2255
2216
|
}
|
|
2256
2217
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
2257
2218
|
});
|
|
2258
|
-
}`,
|
|
2259
|
-
function
|
|
2260
|
-
const r =
|
|
2219
|
+
}`, ln = (e) => e.slice(an.length, -cn.length);
|
|
2220
|
+
function To(e, t, i, n) {
|
|
2221
|
+
const r = ln(e).replaceAll('\\"', '"'), a = Nr(Eo(r)), c = n ? `@layer{${i ? "" : `
|
|
2261
2222
|
`}${a}${i ? "" : `
|
|
2262
2223
|
`}}` : a;
|
|
2263
|
-
return `${
|
|
2224
|
+
return `${So}${c}${bo}${t ? wo : ""}`;
|
|
2264
2225
|
}
|
|
2265
|
-
const
|
|
2266
|
-
`),
|
|
2267
|
-
function
|
|
2268
|
-
return `import("${
|
|
2269
|
-
setCustomElementsManifest(${
|
|
2226
|
+
const Eo = (e) => e.replaceAll("\\r", "").replaceAll("\\n", `
|
|
2227
|
+
`), Co = (e, t) => e.endsWith(".mdx") || e.includes(".stories.") || e.includes(".story.") || e.startsWith(`${t.dir.root}stories/`);
|
|
2228
|
+
function $o(e) {
|
|
2229
|
+
return `import("${Po}").then(({ setCustomElementsManifest }) => {
|
|
2230
|
+
setCustomElementsManifest(${xo(e)});
|
|
2270
2231
|
});`;
|
|
2271
2232
|
}
|
|
2272
|
-
const
|
|
2273
|
-
function
|
|
2233
|
+
const Po = "@storybook/web-components", xo = (e) => `JSON.parse(\`${ko(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
2234
|
+
function ko(e) {
|
|
2274
2235
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
2275
2236
|
}
|
|
2276
|
-
function
|
|
2277
|
-
|
|
2237
|
+
function Ao(e) {
|
|
2238
|
+
Io(e);
|
|
2278
2239
|
const t = e.options.css?.globalStylesPath;
|
|
2279
2240
|
if (t === void 0)
|
|
2280
2241
|
return "";
|
|
@@ -2282,21 +2243,21 @@ function Bo(e) {
|
|
|
2282
2243
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
2283
2244
|
`import globalStyles from "${i}${Q}";`,
|
|
2284
2245
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
2285
|
-
|
|
2246
|
+
pn("", e)
|
|
2286
2247
|
].join(`
|
|
2287
2248
|
`) : `import "${i}${Fe}";`;
|
|
2288
2249
|
}
|
|
2289
|
-
const
|
|
2290
|
-
function
|
|
2250
|
+
const dn = "hydrated";
|
|
2251
|
+
function Io(e) {
|
|
2291
2252
|
e._globalHydratedCssString = [
|
|
2292
2253
|
":not([",
|
|
2293
|
-
e.options.css?.hydratedAttribute ??
|
|
2254
|
+
e.options.css?.hydratedAttribute ?? dn,
|
|
2294
2255
|
"]):is(",
|
|
2295
2256
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
2296
2257
|
"){visibility:hidden}"
|
|
2297
2258
|
].join("");
|
|
2298
2259
|
}
|
|
2299
|
-
function
|
|
2260
|
+
function pn(e, t) {
|
|
2300
2261
|
return [
|
|
2301
2262
|
"const globalCss = new CSSStyleSheet;",
|
|
2302
2263
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e || ""}`}}");`,
|
|
@@ -2304,15 +2265,15 @@ function fn(e, t) {
|
|
|
2304
2265
|
].join(`
|
|
2305
2266
|
`);
|
|
2306
2267
|
}
|
|
2307
|
-
const
|
|
2268
|
+
const Lo = (e) => `${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
2308
2269
|
|
|
2309
2270
|
`}${e._globalCssString ? JSON.parse(`"${e._globalCssString}"`) : ""}`;
|
|
2310
|
-
function
|
|
2271
|
+
function Fo(e) {
|
|
2311
2272
|
const t = [], i = [];
|
|
2312
2273
|
for (const s of e.privateApiJson.modules) {
|
|
2313
2274
|
t.push(s.path);
|
|
2314
2275
|
for (const r of s.declarations)
|
|
2315
|
-
"customElement" in r && i.push(
|
|
2276
|
+
"customElement" in r && i.push(Do(r, e, s.path));
|
|
2316
2277
|
}
|
|
2317
2278
|
return [
|
|
2318
2279
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
@@ -2320,31 +2281,31 @@ function Ho(e) {
|
|
|
2320
2281
|
e.viteCommand === "build" && e.options.build?.ssr?.stencilCompatibility?.enabled === !0 ? 'import "@lit-labs/ssr-client/lit-element-hydrate-support.js";' : "",
|
|
2321
2282
|
'import { runtime } from "./runtime";',
|
|
2322
2283
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
2323
|
-
|
|
2324
|
-
e.hmrEnabled ?
|
|
2284
|
+
Ao(e),
|
|
2285
|
+
e.hmrEnabled ? Ro : "",
|
|
2325
2286
|
"",
|
|
2326
|
-
e.isInStorybook ?
|
|
2287
|
+
e.isInStorybook ? $o(e.apiJson) : "",
|
|
2327
2288
|
"",
|
|
2328
2289
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
2329
2290
|
i.join(`,
|
|
2330
2291
|
`),
|
|
2331
2292
|
"});",
|
|
2332
|
-
e.hmrEnabled ?
|
|
2293
|
+
e.hmrEnabled ? Mo(t) : ""
|
|
2333
2294
|
].join(`
|
|
2334
2295
|
`);
|
|
2335
2296
|
}
|
|
2336
|
-
const
|
|
2337
|
-
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`,
|
|
2297
|
+
const No = `import "./index";
|
|
2298
|
+
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`, Do = (e, t, i) => [
|
|
2338
2299
|
` "${e.tagName}": [`,
|
|
2339
2300
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
2340
|
-
|
|
2301
|
+
jo(e),
|
|
2341
2302
|
"]"
|
|
2342
2303
|
].join("");
|
|
2343
|
-
function
|
|
2344
|
-
const { properties: t, asyncMethods: i, syncMethods: n } =
|
|
2345
|
-
return d.length > 0 ? `"${d.join(
|
|
2304
|
+
function jo(e) {
|
|
2305
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = un(e), s = t.map((p) => p.join($s)).join(Ye), r = i.join(Ye), a = n.join(Ye), c = [s, r, a], l = c.findLastIndex((p) => p.length > 0), d = c.slice(0, l + 1);
|
|
2306
|
+
return d.length > 0 ? `"${d.join(Ps)}"` : "";
|
|
2346
2307
|
}
|
|
2347
|
-
function
|
|
2308
|
+
function un(e) {
|
|
2348
2309
|
const t = e.members.filter((r) => r.kind === "field").map((r) => {
|
|
2349
2310
|
const a = typeof r.attribute == "string", c = a && r.attribute !== wt(r.name);
|
|
2350
2311
|
return a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""];
|
|
@@ -2357,23 +2318,23 @@ function yn(e) {
|
|
|
2357
2318
|
), n = i.filter((r) => r.async === !0).map((r) => r.name), s = i.filter((r) => r.async !== !0).map((r) => r.name);
|
|
2358
2319
|
return { tagName: e.tagName, properties: t, asyncMethods: n, syncMethods: s };
|
|
2359
2320
|
}
|
|
2360
|
-
const
|
|
2361
|
-
`,
|
|
2321
|
+
const Ro = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
2322
|
+
`, Mo = (e) => `
|
|
2362
2323
|
if(import.meta.hot) {
|
|
2363
2324
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
2364
2325
|
import.meta.hot.accept([
|
|
2365
2326
|
${e.map((t) => ` "/${t}",`).join(`
|
|
2366
2327
|
`)}
|
|
2367
2328
|
], handleHmrUpdate);
|
|
2368
|
-
}`,
|
|
2369
|
-
function
|
|
2329
|
+
}`, Oo = "@arcgis/lumina:addMethodMetadata";
|
|
2330
|
+
function Jo(e, t, i, n, s) {
|
|
2370
2331
|
const r = i.getSignatureFromDeclaration(e);
|
|
2371
2332
|
if (r === void 0)
|
|
2372
2333
|
return;
|
|
2373
2334
|
for (const d of e.parameters) {
|
|
2374
2335
|
if (!o.isIdentifier(d.name)) {
|
|
2375
2336
|
C.warn(
|
|
2376
|
-
|
|
2337
|
+
Oo,
|
|
2377
2338
|
`Object binding patterns are not yet supported in the docs. Found ${d.name?.getText(n)} in ${e.name.getText(n)}`,
|
|
2378
2339
|
n.fileName
|
|
2379
2340
|
);
|
|
@@ -2389,13 +2350,13 @@ function Qo(e, t, i, n, s) {
|
|
|
2389
2350
|
});
|
|
2390
2351
|
}
|
|
2391
2352
|
t.parameters.length === 0 && (t.parameters = void 0);
|
|
2392
|
-
const a = i.getReturnTypeOfSignature(r), c = Me(i, a, n, s), l = i.signatureToString(r, e,
|
|
2353
|
+
const a = i.getReturnTypeOfSignature(r), c = Me(i, a, n, s), l = i.signatureToString(r, e, rn, o.SignatureKind.Call);
|
|
2393
2354
|
ue(e.name, i, t), t.return = {
|
|
2394
2355
|
type: c
|
|
2395
2356
|
}, t.signature = l.replace(" =>", ":");
|
|
2396
2357
|
}
|
|
2397
|
-
const
|
|
2398
|
-
function
|
|
2358
|
+
const Ko = (e) => e.modifiers?.some?.((t) => t.kind === o.SyntaxKind.AsyncKeyword) ?? !1;
|
|
2359
|
+
function Wo(e, t, i, n) {
|
|
2399
2360
|
const s = i.typeScriptTypeChecker, a = s.getTypeAtLocation(e).getProperty("emit");
|
|
2400
2361
|
if (a?.valueDeclaration === void 0)
|
|
2401
2362
|
return;
|
|
@@ -2420,11 +2381,11 @@ function Yo(e, t, i, n) {
|
|
|
2420
2381
|
composed: void 0,
|
|
2421
2382
|
privacy: void 0
|
|
2422
2383
|
};
|
|
2423
|
-
return ue(e.name, s, y),
|
|
2384
|
+
return ue(e.name, s, y), Bo(e, y, n), y.privacy === void 0 ? y : void 0;
|
|
2424
2385
|
}
|
|
2425
2386
|
}
|
|
2426
2387
|
const Ae = "createEvent";
|
|
2427
|
-
function
|
|
2388
|
+
function Bo(e, t, i) {
|
|
2428
2389
|
if (!e.initializer || !o.isCallExpression(e.initializer))
|
|
2429
2390
|
return;
|
|
2430
2391
|
const n = e.initializer;
|
|
@@ -2463,7 +2424,7 @@ function re(e, t) {
|
|
|
2463
2424
|
);
|
|
2464
2425
|
}
|
|
2465
2426
|
const kt = "@arcgis/lumina-compiler";
|
|
2466
|
-
class Je extends
|
|
2427
|
+
class Je extends ms {
|
|
2467
2428
|
constructor(t, i) {
|
|
2468
2429
|
super({ isFullApiExtraction: t.isFullApiExtraction, cwd: t.dir.root }), this.context = t, this.isPathOnly = i, this.localCssImports = void 0, this.localDeclaredComponents = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.apiComponent = void 0, this.pairedSetter = void 0, this.copyDocDefinitions = void 0, this._resolvedInheritance = /* @__PURE__ */ new Map(), this.copyDocDefinitions = t.options.documentation?.copyDefinitions;
|
|
2469
2430
|
}
|
|
@@ -2475,12 +2436,12 @@ class Je extends gs {
|
|
|
2475
2436
|
const i = super.extractModules(t);
|
|
2476
2437
|
for (const n of i)
|
|
2477
2438
|
for (const s of n.declarations)
|
|
2478
|
-
"customElement" in s && (this.context.isFullApiExtraction &&
|
|
2439
|
+
"customElement" in s && (this.context.isFullApiExtraction && Uo(s, this.context, this.indexedComponents), this.inheritMembers(s, i), this.context.isFullApiExtraction && (s.members.sort(nt), s.attributes?.sort(nt), s.events?.sort(nt)));
|
|
2479
2440
|
return i;
|
|
2480
2441
|
}
|
|
2481
2442
|
extractDeclarations(t) {
|
|
2482
2443
|
return this.localDeclaredComponents = new Map(
|
|
2483
|
-
|
|
2444
|
+
Hi(t.text)?.map(([i, n]) => [n, i]) ?? []
|
|
2484
2445
|
), this.localDeclaredComponents.size === 0 ? [] : super.extractDeclarations(t);
|
|
2485
2446
|
}
|
|
2486
2447
|
extractDeclaration(t) {
|
|
@@ -2522,7 +2483,7 @@ class Je extends gs {
|
|
|
2522
2483
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2523
2484
|
* Stencil's behavior.
|
|
2524
2485
|
*/
|
|
2525
|
-
pascalCaseName:
|
|
2486
|
+
pascalCaseName: vs(n),
|
|
2526
2487
|
privacy: void 0,
|
|
2527
2488
|
importPath: "",
|
|
2528
2489
|
members: [],
|
|
@@ -2548,7 +2509,7 @@ class Je extends gs {
|
|
|
2548
2509
|
}
|
|
2549
2510
|
if (this.apiComponent = s, s.members = this.extractComponentMembers(t), this.context.isFullApiExtraction) {
|
|
2550
2511
|
s.attributes = this.inferAttributes(s.members), this.indexedComponents.set(i, s);
|
|
2551
|
-
const a =
|
|
2512
|
+
const a = Js(n, this.context, this.apiModule.path);
|
|
2552
2513
|
if (s.importPath = `components/${a}`, this.localCssImports !== void 0) {
|
|
2553
2514
|
for (const f of this.localCssImports) {
|
|
2554
2515
|
const y = this.context._cssImports.get(f);
|
|
@@ -2584,11 +2545,12 @@ class Je extends gs {
|
|
|
2584
2545
|
docsTags: [
|
|
2585
2546
|
{
|
|
2586
2547
|
name: "example",
|
|
2587
|
-
text:
|
|
2548
|
+
text: `\`\`\`js
|
|
2549
|
+
const ${c} = document.querySelector("${s.tagName}");
|
|
2588
2550
|
document.body.append(${c});
|
|
2589
|
-
${c}.componentOnReady()
|
|
2590
|
-
|
|
2591
|
-
|
|
2551
|
+
await ${c}.componentOnReady();
|
|
2552
|
+
console.log("${s.tagName} is ready to go!");
|
|
2553
|
+
\`\`\``
|
|
2592
2554
|
}
|
|
2593
2555
|
]
|
|
2594
2556
|
});
|
|
@@ -2620,7 +2582,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2620
2582
|
return i;
|
|
2621
2583
|
}
|
|
2622
2584
|
extractComponentMember(t, i) {
|
|
2623
|
-
if (
|
|
2585
|
+
if (fs(t) || i === void 0) {
|
|
2624
2586
|
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");
|
|
2625
2587
|
return;
|
|
2626
2588
|
}
|
|
@@ -2657,53 +2619,53 @@ ${c}.componentOnReady().then(() => {
|
|
|
2657
2619
|
inheritedFrom: void 0,
|
|
2658
2620
|
privacy: void 0
|
|
2659
2621
|
};
|
|
2660
|
-
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, l), (r === void 0 && (l.type.values === void 0 || !
|
|
2622
|
+
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, l), (r === void 0 && (l.type.values === void 0 || !Gr(l.type.values)) || l.readonly && !l.reflects) && (l.attribute = void 0)), l;
|
|
2661
2623
|
}
|
|
2662
2624
|
/**
|
|
2663
2625
|
* Based on a `non-@property()` property, extract a public event if it is one.
|
|
2664
2626
|
*/
|
|
2665
2627
|
extractComponentEvent(t, i) {
|
|
2666
|
-
const n =
|
|
2628
|
+
const n = Wo(t, i, this.context, this.file);
|
|
2667
2629
|
return n !== void 0 && this.copyDoc(this.copyDocDefinitions?.events?.[i], n, this.apiComponent), n;
|
|
2668
2630
|
}
|
|
2669
2631
|
/**
|
|
2670
2632
|
* When doing full API extraction, extract additional details for a field.
|
|
2671
2633
|
*/
|
|
2672
2634
|
extractComponentFieldDetails(t, i) {
|
|
2673
|
-
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 :
|
|
2635
|
+
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 : Wt(s, r), c = new Set(a?.docsTags.map((h) => h.name) ?? []);
|
|
2674
2636
|
ue(t.name, this.context.typeScriptTypeChecker, i, a);
|
|
2675
2637
|
let l = !n && i.readonly === !0;
|
|
2676
2638
|
const d = this.pairedSetter ?? t, p = i.default;
|
|
2677
|
-
|
|
2639
|
+
Bt(t, i, this.file);
|
|
2678
2640
|
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((h) => h.name === "required") ?? !1;
|
|
2679
2641
|
i.type = // Messages overrides type can be verbose, so we display a simplified type
|
|
2680
2642
|
// in the documentation. The full type is still present in the .d.ts files.
|
|
2681
2643
|
i.name === "messageOverrides" ? {
|
|
2682
2644
|
text: "Record<string, unknown>"
|
|
2683
|
-
} :
|
|
2645
|
+
} : Qr(this.context, d, f, this.file);
|
|
2684
2646
|
const y = 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);
|
|
2685
2647
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
|
|
2686
|
-
const h = t.initializer, v = s.getSymbolAtLocation(h), S = v !== void 0 && ((v.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(v) : v,
|
|
2648
|
+
const h = t.initializer, v = s.getSymbolAtLocation(h), S = v !== void 0 && ((v.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(v) : v, T = S?.getDeclarations() ?? [];
|
|
2687
2649
|
if (S !== void 0) {
|
|
2688
|
-
const $ =
|
|
2650
|
+
const $ = Wt(s, S);
|
|
2689
2651
|
if ($.docsTags.length > 0) {
|
|
2690
2652
|
$.docsTags = $.docsTags.filter(
|
|
2691
|
-
(
|
|
2653
|
+
(E) => !c.has(E.name) || ys.has(E.name)
|
|
2692
2654
|
);
|
|
2693
2655
|
const b = i.description;
|
|
2694
|
-
ue(t.name, s, i, $), $.docsTags.forEach((
|
|
2695
|
-
c.add(
|
|
2656
|
+
ue(t.name, s, i, $), $.docsTags.forEach((E) => {
|
|
2657
|
+
c.add(E.name);
|
|
2696
2658
|
}), i.description = b ?? i.description;
|
|
2697
2659
|
} else
|
|
2698
2660
|
i.description ||= $.description;
|
|
2699
2661
|
}
|
|
2700
|
-
let x,
|
|
2701
|
-
|
|
2702
|
-
if (x ??= o.isGetAccessor($) ? $ : void 0,
|
|
2662
|
+
let x, L;
|
|
2663
|
+
T.forEach(($) => {
|
|
2664
|
+
if (x ??= o.isGetAccessor($) ? $ : void 0, L ??= o.isSetAccessor($) ? $ : void 0, !("initializer" in $))
|
|
2703
2665
|
return;
|
|
2704
2666
|
const b = $;
|
|
2705
|
-
l ||= b.modifiers?.some((
|
|
2706
|
-
}), y && x !== void 0 &&
|
|
2667
|
+
l ||= b.modifiers?.some((E) => E.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, Bt(b, i, b.getSourceFile());
|
|
2668
|
+
}), y && x !== void 0 && L !== void 0 && x.type?.getText() !== L.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${h.getText(this.file)}` });
|
|
2707
2669
|
}
|
|
2708
2670
|
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((h) => h.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && (Je.loggedBooleanWarning || this.context.logLintWarning(
|
|
2709
2671
|
`Boolean properties should default to "false". Found default value "true" in ${this.apiComponent.name}.${i.name}. See https://qawebgis.esri.com/components/lumina/properties#boolean-properties`
|
|
@@ -2737,12 +2699,12 @@ ${c}.componentOnReady().then(() => {
|
|
|
2737
2699
|
inheritedFrom: void 0,
|
|
2738
2700
|
docsTags: void 0,
|
|
2739
2701
|
signature: "",
|
|
2740
|
-
async:
|
|
2702
|
+
async: Ko(t) ? !0 : void 0,
|
|
2741
2703
|
privacy: void 0
|
|
2742
2704
|
};
|
|
2743
2705
|
if (this.context.isFullApiExtraction) {
|
|
2744
2706
|
const s = this.context.typeScriptTypeChecker;
|
|
2745
|
-
|
|
2707
|
+
Jo(t, n, s, this.file, this.context.dir), this.copyDoc(this.copyDocDefinitions?.methods?.[i], n, this.apiComponent);
|
|
2746
2708
|
}
|
|
2747
2709
|
return n;
|
|
2748
2710
|
}
|
|
@@ -2763,7 +2725,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2763
2725
|
description: n.description,
|
|
2764
2726
|
inheritedFrom: n.inheritedFrom,
|
|
2765
2727
|
type: s === void 0 || s.length === 0 ? n.type : {
|
|
2766
|
-
text:
|
|
2728
|
+
text: nn(s),
|
|
2767
2729
|
references: void 0,
|
|
2768
2730
|
values: s
|
|
2769
2731
|
},
|
|
@@ -2836,20 +2798,20 @@ ${c}.componentOnReady().then(() => {
|
|
|
2836
2798
|
const le = {
|
|
2837
2799
|
name: "LitElement",
|
|
2838
2800
|
package: "@arcgis/lumina"
|
|
2839
|
-
},
|
|
2840
|
-
async function
|
|
2801
|
+
}, nt = (e, t) => e.name.localeCompare(t.name);
|
|
2802
|
+
async function _o(e, t) {
|
|
2841
2803
|
t || (e.componentFilesPromise = xt(e, e.dir.srcComponents));
|
|
2842
|
-
const i = await e.componentFilesPromise, n = await
|
|
2804
|
+
const i = await e.componentFilesPromise, n = await Yo(e, i);
|
|
2843
2805
|
await e.componentStoriesPromise, e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2844
|
-
const s =
|
|
2806
|
+
const s = mn(n, e, !1);
|
|
2845
2807
|
e.privateApiJson = s;
|
|
2846
|
-
const [r, a] =
|
|
2808
|
+
const [r, a] = fn(s);
|
|
2847
2809
|
return e.apiJsonComponents = a, e.apiJson = r, s;
|
|
2848
2810
|
}
|
|
2849
|
-
function
|
|
2850
|
-
const n = e.getSourceFile(t, i), s =
|
|
2811
|
+
function Ho(e, t, i) {
|
|
2812
|
+
const n = e.getSourceFile(t, i), s = mn([n], e, !0), r = s.modules[0];
|
|
2851
2813
|
{
|
|
2852
|
-
const f =
|
|
2814
|
+
const f = fn(s)[0].modules[0], y = e.apiJson.modules.findIndex((v) => v.path === f.path), g = e.apiJson.modules[y], h = Array.from(e.apiJson.modules);
|
|
2853
2815
|
h.splice(y, 1, f), e.apiJson = { ...e.apiJson, modules: h }, e.apiJsonComponents = e.apiJsonComponents.filter(
|
|
2854
2816
|
(v) => !g.declarations.includes(v)
|
|
2855
2817
|
);
|
|
@@ -2871,11 +2833,11 @@ function ia(e, t, i) {
|
|
|
2871
2833
|
}
|
|
2872
2834
|
return d ||= m.length !== p.length, d ? void 0 : m;
|
|
2873
2835
|
}
|
|
2874
|
-
function
|
|
2836
|
+
function mn(e, t, i) {
|
|
2875
2837
|
const n = t.options.apiJson?.Extractor ?? Je, r = new n(t, i).extract(e);
|
|
2876
2838
|
return t.options.apiJson?.afterCreate?.(r, i), r;
|
|
2877
2839
|
}
|
|
2878
|
-
function
|
|
2840
|
+
function fn(e) {
|
|
2879
2841
|
const t = { ...e, modules: [] }, i = [];
|
|
2880
2842
|
for (const n of e.modules) {
|
|
2881
2843
|
const s = { ...n, declarations: [] };
|
|
@@ -2891,8 +2853,8 @@ function hn(e) {
|
|
|
2891
2853
|
}
|
|
2892
2854
|
return [t, i];
|
|
2893
2855
|
}
|
|
2894
|
-
function
|
|
2895
|
-
const n =
|
|
2856
|
+
function Uo(e, t, i) {
|
|
2857
|
+
const n = zo(i, e);
|
|
2896
2858
|
O(e, n, t);
|
|
2897
2859
|
for (const s of e.members) {
|
|
2898
2860
|
if (s.kind === "field")
|
|
@@ -2929,23 +2891,20 @@ function na(e, t, i) {
|
|
|
2929
2891
|
}
|
|
2930
2892
|
function Ie(e, t, i) {
|
|
2931
2893
|
e !== void 0 && (e.references?.reduce(
|
|
2932
|
-
(n, s) =>
|
|
2894
|
+
(n, s) => qo(s, t, i, n),
|
|
2933
2895
|
0
|
|
2934
2896
|
), e.text = e.text.replaceAll(
|
|
2935
|
-
|
|
2897
|
+
Zo,
|
|
2936
2898
|
(n, s) => At(t.get(s)) ?? n
|
|
2937
|
-
), e.values?.forEach(
|
|
2899
|
+
), e.values?.forEach(Go, t));
|
|
2938
2900
|
}
|
|
2939
2901
|
function O(e, t, i) {
|
|
2940
|
-
if (e.description && (e.description = e.description.replaceAll(
|
|
2902
|
+
if (e.description && (e.description = e.description.replaceAll(st, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl)), e.docsTags)
|
|
2941
2903
|
for (const n of e.docsTags)
|
|
2942
|
-
n.text && (n.text = n.text.replaceAll(
|
|
2943
|
-
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(
|
|
2944
|
-
i.alternativeDocumentationUrl,
|
|
2945
|
-
i.normalizedDocumentationUrl
|
|
2946
|
-
));
|
|
2904
|
+
n.text && (n.text = n.text.replaceAll(st, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2905
|
+
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(st, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2947
2906
|
}
|
|
2948
|
-
const
|
|
2907
|
+
const st = /\{@link ([^}]+)\}/gu, zo = (e, t) => (i, n) => {
|
|
2949
2908
|
let s = n.indexOf(" ");
|
|
2950
2909
|
s === -1 && (s = n.length);
|
|
2951
2910
|
const r = n.slice(0, s), a = n.slice(s + 1);
|
|
@@ -2969,7 +2928,7 @@ const ui = /\{@link ([^}]+)\}/gu, sa = (e, t) => (i, n) => {
|
|
|
2969
2928
|
);
|
|
2970
2929
|
return `[${a || (d === t ? l : `${d.tagName}.${l}`)}](${p}#${l})`;
|
|
2971
2930
|
};
|
|
2972
|
-
function
|
|
2931
|
+
function qo(e, t, i, n) {
|
|
2973
2932
|
if (e.viewUrl !== void 0 && (e.viewUrl = e.viewUrl.replace(
|
|
2974
2933
|
i.alternativeDocumentationUrl,
|
|
2975
2934
|
i.normalizedDocumentationUrl
|
|
@@ -2982,17 +2941,17 @@ function ra(e, t, i, n) {
|
|
|
2982
2941
|
if (s !== void 0) {
|
|
2983
2942
|
const r = e.name.length;
|
|
2984
2943
|
e.name = At(s);
|
|
2985
|
-
const a = e.name.length - r -
|
|
2986
|
-
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start -
|
|
2944
|
+
const a = e.name.length - r - pi;
|
|
2945
|
+
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start - pi, e.end = e.end + a, n += a - Qo;
|
|
2987
2946
|
}
|
|
2988
2947
|
}
|
|
2989
2948
|
return n;
|
|
2990
2949
|
}
|
|
2991
|
-
function
|
|
2950
|
+
function Go(e) {
|
|
2992
2951
|
e.type.startsWith("ToElement<") && (e.type = At(this.get(e.type.slice(10, -1))) ?? e.type);
|
|
2993
2952
|
}
|
|
2994
|
-
const At = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0,
|
|
2995
|
-
async function
|
|
2953
|
+
const At = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0, Vo = "ToElement<", pi = Vo.length, Xo = ">", Qo = Xo.length, Zo = /ToElement<(\w+)>/gu;
|
|
2954
|
+
async function Yo(e, t) {
|
|
2996
2955
|
if (e.viteCommand === "serve" && (Object.hasOwn(e, "typeScriptHost") || (e.typeScriptHost = o.createCompilerHost(e.typeScriptConfig, !1))), e.typeScriptProgram !== void 0) {
|
|
2997
2956
|
const i = e.typeScriptProgram.getSourceFiles(), n = new Set(t);
|
|
2998
2957
|
return i.filter((s) => n.has(s.fileName));
|
|
@@ -3004,10 +2963,10 @@ async function pa(e, t) {
|
|
|
3004
2963
|
})
|
|
3005
2964
|
);
|
|
3006
2965
|
}
|
|
3007
|
-
async function
|
|
3008
|
-
return ve ??=
|
|
2966
|
+
async function yn(e) {
|
|
2967
|
+
return ve ??= ta(e), await ve;
|
|
3009
2968
|
}
|
|
3010
|
-
function
|
|
2969
|
+
function ea() {
|
|
3011
2970
|
if (gt === void 0)
|
|
3012
2971
|
throw Error(
|
|
3013
2972
|
w(
|
|
@@ -3017,7 +2976,7 @@ function ua() {
|
|
|
3017
2976
|
);
|
|
3018
2977
|
return gt;
|
|
3019
2978
|
}
|
|
3020
|
-
function
|
|
2979
|
+
function gn() {
|
|
3021
2980
|
if (ht === void 0)
|
|
3022
2981
|
throw Error(
|
|
3023
2982
|
w(
|
|
@@ -3027,13 +2986,13 @@ function Sn() {
|
|
|
3027
2986
|
);
|
|
3028
2987
|
return ht;
|
|
3029
2988
|
}
|
|
3030
|
-
async function
|
|
2989
|
+
async function ta(e) {
|
|
3031
2990
|
const t = R(e), i = t.dependencies ?? {}, n = t.peerDependencies ?? {}, r = (await Promise.all(
|
|
3032
|
-
[...Object.keys(i), ...Object.keys(n)].filter((a) => !
|
|
2991
|
+
[...Object.keys(i), ...Object.keys(n)].filter((a) => !ia.has(a)).flatMap(async (a) => await hn(a, e))
|
|
3033
2992
|
)).filter(j);
|
|
3034
2993
|
return gt ??= r, ht = Object.fromEntries(r.flatMap((a) => Object.entries(a.components))), r;
|
|
3035
2994
|
}
|
|
3036
|
-
const
|
|
2995
|
+
const ia = /* @__PURE__ */ new Set([
|
|
3037
2996
|
"@arcgis/arcade-languageservice",
|
|
3038
2997
|
"@arcgis/components-build-utils",
|
|
3039
2998
|
"@arcgis/components-utils",
|
|
@@ -3070,29 +3029,29 @@ const fa = /* @__PURE__ */ new Set([
|
|
|
3070
3029
|
"vscode-languageserver-types"
|
|
3071
3030
|
]);
|
|
3072
3031
|
let gt, ht, ve;
|
|
3073
|
-
async function
|
|
3074
|
-
const i = await _e(e, t), n = await He(i), s = "exports" in n, r =
|
|
3032
|
+
async function hn(e, t) {
|
|
3033
|
+
const i = await _e(e, t), n = await He(i), s = "exports" in n, r = ca.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3075
3034
|
if (a ? await U(c) : !1) {
|
|
3076
|
-
const y = await J(c, "utf8"), g =
|
|
3035
|
+
const y = await J(c, "utf8"), g = na(y, "bootstrapLazy("), h = y.indexOf(", options", g), v = y.slice(g, h), S = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
3077
3036
|
try {
|
|
3078
|
-
const
|
|
3037
|
+
const T = JSON.parse(S), x = oa(T, { packageName: e, getImportPath: r });
|
|
3079
3038
|
return { packageName: e, type: "stencil", components: x };
|
|
3080
|
-
} catch (
|
|
3039
|
+
} catch (T) {
|
|
3081
3040
|
C.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
3082
|
-
Error: ${String(
|
|
3041
|
+
Error: ${String(T)}`);
|
|
3083
3042
|
}
|
|
3084
3043
|
}
|
|
3085
|
-
const d =
|
|
3044
|
+
const d = ui(n.customElements);
|
|
3086
3045
|
if (d != null) {
|
|
3087
|
-
const y = u.join(i, d), g = JSON.parse(await J(y, "utf-8")), h =
|
|
3046
|
+
const y = u.join(i, d), g = JSON.parse(await J(y, "utf-8")), h = sa(g), v = vn(g, {
|
|
3088
3047
|
packageName: e,
|
|
3089
3048
|
getImportPath: r
|
|
3090
3049
|
});
|
|
3091
3050
|
return { type: h ? "@arcgis/lumina" : "unknown", packageName: e, components: v };
|
|
3092
3051
|
}
|
|
3093
|
-
const p =
|
|
3052
|
+
const p = ui(n["web-types"]);
|
|
3094
3053
|
if (p != null) {
|
|
3095
|
-
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), h =
|
|
3054
|
+
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), h = ra(g, {
|
|
3096
3055
|
packageName: e,
|
|
3097
3056
|
getImportPath: r,
|
|
3098
3057
|
packageRoot: i
|
|
@@ -3101,19 +3060,19 @@ Error: ${String(E)}`);
|
|
|
3101
3060
|
}
|
|
3102
3061
|
const m = u.join(i, "dist/components");
|
|
3103
3062
|
if (await U(m)) {
|
|
3104
|
-
const y = await
|
|
3063
|
+
const y = await aa(m, {
|
|
3105
3064
|
packageName: e,
|
|
3106
3065
|
getImportPath: r
|
|
3107
3066
|
});
|
|
3108
3067
|
return { type: "unknown", packageName: e, components: y };
|
|
3109
3068
|
}
|
|
3110
3069
|
}
|
|
3111
|
-
const
|
|
3112
|
-
function
|
|
3070
|
+
const ui = (e) => Array.isArray(e) ? e[0] : e;
|
|
3071
|
+
function na(e, t) {
|
|
3113
3072
|
const i = e.indexOf(t);
|
|
3114
3073
|
return i === -1 ? -1 : i + t.length;
|
|
3115
3074
|
}
|
|
3116
|
-
function
|
|
3075
|
+
function vn(e, t) {
|
|
3117
3076
|
const i = {};
|
|
3118
3077
|
for (const n of e.modules ?? [])
|
|
3119
3078
|
if (n.declarations !== void 0)
|
|
@@ -3131,7 +3090,7 @@ function wn(e, t) {
|
|
|
3131
3090
|
}
|
|
3132
3091
|
return i;
|
|
3133
3092
|
}
|
|
3134
|
-
const
|
|
3093
|
+
const sa = (e) => e.compiler?.name === kt, ra = (e, t) => Object.fromEntries(
|
|
3135
3094
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
3136
3095
|
(i) => [
|
|
3137
3096
|
i.name,
|
|
@@ -3142,7 +3101,7 @@ const ga = (e) => e.compiler?.name === kt, ha = (e, t) => Object.fromEntries(
|
|
|
3142
3101
|
}
|
|
3143
3102
|
]
|
|
3144
3103
|
) ?? []
|
|
3145
|
-
),
|
|
3104
|
+
), oa = (e, t) => Object.fromEntries(
|
|
3146
3105
|
e.flatMap(
|
|
3147
3106
|
([i, n]) => n.map(
|
|
3148
3107
|
([s, r, a]) => [
|
|
@@ -3160,7 +3119,7 @@ const ga = (e) => e.compiler?.name === kt, ha = (e, t) => Object.fromEntries(
|
|
|
3160
3119
|
]
|
|
3161
3120
|
)
|
|
3162
3121
|
)
|
|
3163
|
-
),
|
|
3122
|
+
), aa = async (e, t) => Object.fromEntries(
|
|
3164
3123
|
(await Ue(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3165
3124
|
const n = i.slice(0, -5);
|
|
3166
3125
|
return [
|
|
@@ -3172,16 +3131,16 @@ const ga = (e) => e.compiler?.name === kt, ha = (e, t) => Object.fromEntries(
|
|
|
3172
3131
|
}
|
|
3173
3132
|
];
|
|
3174
3133
|
})
|
|
3175
|
-
),
|
|
3176
|
-
function
|
|
3134
|
+
), ca = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, la = (e) => e.startsWith("/") ? e : `/${e}`, It = (e, t) => `${e}@fs${la(t)}`;
|
|
3135
|
+
function qe(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3177
3136
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3178
3137
|
if (s && n)
|
|
3179
3138
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
3180
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
3139
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = da(e.name), c = pa(e.version, i);
|
|
3181
3140
|
return a.length === 0 ? `https://${r}/${c}/` : s ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
3182
3141
|
}
|
|
3183
|
-
const
|
|
3184
|
-
function
|
|
3142
|
+
const da = (e) => e.split("/").pop() ?? e;
|
|
3143
|
+
function pa(e, t) {
|
|
3185
3144
|
if (/\d+\.\d+\.\d+-(?:.*)$/u.test(e))
|
|
3186
3145
|
return "next";
|
|
3187
3146
|
const n = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/u, s = e.match(n);
|
|
@@ -3191,8 +3150,8 @@ function Ea(e, t) {
|
|
|
3191
3150
|
}
|
|
3192
3151
|
return "next";
|
|
3193
3152
|
}
|
|
3194
|
-
const
|
|
3195
|
-
function
|
|
3153
|
+
const ua = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Z = "staticSvg", ce = "html", oe = "svg", Sn = Symbol("maybe HTML namespace or maybe SVG"), bn = "css", wn = "mathml", Tn = [bn, ce, wn, ae, Z, oe], ma = new Set(Tn), fa = ["safeClassMap", "safeStyleMap", "deferLoad"], ya = "nothing", ga = [...ua, ...Tn, ...fa, ya], Ke = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e);
|
|
3154
|
+
function mi(e, t, i) {
|
|
3196
3155
|
if (ne(e))
|
|
3197
3156
|
return e;
|
|
3198
3157
|
{
|
|
@@ -3211,14 +3170,14 @@ function ne(e) {
|
|
|
3211
3170
|
return (
|
|
3212
3171
|
// Inlined string literal
|
|
3213
3172
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3214
|
-
|
|
3173
|
+
ha.has(e.kind) || // Ternary with both branches never undefined
|
|
3215
3174
|
o.isConditionalExpression(e) && ne(e.whenTrue) && ne(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3216
|
-
o.isBinaryExpression(e) && (
|
|
3175
|
+
o.isBinaryExpression(e) && (va.has(e.operatorToken.kind) || ne(e.left) && ne(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3217
3176
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ne(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3218
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3177
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && ma.has(e.tag.text)
|
|
3219
3178
|
);
|
|
3220
3179
|
}
|
|
3221
|
-
const
|
|
3180
|
+
const ha = /* @__PURE__ */ new Set([
|
|
3222
3181
|
o.SyntaxKind.NumericLiteral,
|
|
3223
3182
|
o.SyntaxKind.BigIntLiteral,
|
|
3224
3183
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3237,7 +3196,7 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3237
3196
|
o.SyntaxKind.ClassExpression,
|
|
3238
3197
|
// Trust? Trust.
|
|
3239
3198
|
o.SyntaxKind.NonNullExpression
|
|
3240
|
-
]),
|
|
3199
|
+
]), va = /* @__PURE__ */ new Set([
|
|
3241
3200
|
o.SyntaxKind.PlusEqualsToken,
|
|
3242
3201
|
o.SyntaxKind.MinusEqualsToken,
|
|
3243
3202
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3272,9 +3231,9 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3272
3231
|
o.SyntaxKind.SlashToken,
|
|
3273
3232
|
o.SyntaxKind.PercentToken,
|
|
3274
3233
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3275
|
-
]),
|
|
3234
|
+
]), Sa = {
|
|
3276
3235
|
property(e, t, i, n) {
|
|
3277
|
-
const s =
|
|
3236
|
+
const s = ba(n, i, e), r = s?.type === "stringifiedReflected", a = s?.type === "reflected" || r;
|
|
3278
3237
|
if (a) {
|
|
3279
3238
|
const f = ot(t);
|
|
3280
3239
|
if (f === !0)
|
|
@@ -3287,11 +3246,11 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3287
3246
|
return [s.name, ...c];
|
|
3288
3247
|
const [d, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
3289
3248
|
if (r || m) {
|
|
3290
|
-
const f =
|
|
3249
|
+
const f = mi(
|
|
3291
3250
|
p,
|
|
3292
3251
|
e,
|
|
3293
3252
|
m ? "" : void 0
|
|
3294
|
-
), g = i === "value" && (n === "input" || n === "textarea" || n === Re) ?
|
|
3253
|
+
), g = i === "value" && (n === "input" || n === "textarea" || n === Re) ? Ta(f, e) : f;
|
|
3295
3254
|
if (g !== p)
|
|
3296
3255
|
return [m ? `.${i}` : s.name, d, g];
|
|
3297
3256
|
}
|
|
@@ -3303,7 +3262,7 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3303
3262
|
return [i];
|
|
3304
3263
|
if (n === !1)
|
|
3305
3264
|
return [];
|
|
3306
|
-
const s = Ne(e, t, !0), a = s[0] !== "=" ? s : [s[0],
|
|
3265
|
+
const s = Ne(e, t, !0), a = s[0] !== "=" ? s : [s[0], mi(s[1], e)];
|
|
3307
3266
|
return [i, ...a];
|
|
3308
3267
|
},
|
|
3309
3268
|
booleanAttribute(e, t, i) {
|
|
@@ -3316,7 +3275,7 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3316
3275
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3317
3276
|
);
|
|
3318
3277
|
const n = i.slice(2), s = ut(n);
|
|
3319
|
-
return [`@${
|
|
3278
|
+
return [`@${Zi.has(s) ? n.toLowerCase() : ut(n)}=`, ...Nt(e, t, void 0)];
|
|
3320
3279
|
},
|
|
3321
3280
|
directives(e, t) {
|
|
3322
3281
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3348,8 +3307,8 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3348
3307
|
])
|
|
3349
3308
|
];
|
|
3350
3309
|
},
|
|
3351
|
-
class:
|
|
3352
|
-
style:
|
|
3310
|
+
class: yi,
|
|
3311
|
+
style: yi,
|
|
3353
3312
|
key: (e, t) => [Lt(t, e.sourceFile)],
|
|
3354
3313
|
deferLoad(e, t, i, n) {
|
|
3355
3314
|
if (typeof n != "string")
|
|
@@ -3361,21 +3320,21 @@ const Aa = /* @__PURE__ */ new Set([
|
|
|
3361
3320
|
return [o.factory.createIdentifier(s)];
|
|
3362
3321
|
}
|
|
3363
3322
|
};
|
|
3364
|
-
function
|
|
3323
|
+
function ba(e, t, i) {
|
|
3365
3324
|
if (typeof e == "string") {
|
|
3366
3325
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3367
3326
|
if (r !== void 0)
|
|
3368
3327
|
return { name: r, type: "reflected" };
|
|
3369
3328
|
}
|
|
3370
|
-
const n = rt(
|
|
3329
|
+
const n = rt(B.common, t);
|
|
3371
3330
|
if (n !== void 0)
|
|
3372
3331
|
return n;
|
|
3373
3332
|
if (typeof e == "string") {
|
|
3374
|
-
const s = rt(
|
|
3333
|
+
const s = rt(B.perElement[e], t);
|
|
3375
3334
|
if (s !== void 0)
|
|
3376
3335
|
return s;
|
|
3377
3336
|
} else {
|
|
3378
|
-
const s = Object.values(
|
|
3337
|
+
const s = Object.values(B.perElement).map(
|
|
3379
3338
|
(a) => rt(a, t)
|
|
3380
3339
|
), r = ye(s, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ye(s, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3381
3340
|
if (r !== void 0)
|
|
@@ -3416,10 +3375,10 @@ function Ne(e, t, i = !1) {
|
|
|
3416
3375
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3417
3376
|
);
|
|
3418
3377
|
if (o.isStringLiteral(t))
|
|
3419
|
-
return
|
|
3378
|
+
return fi(t, i);
|
|
3420
3379
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3421
3380
|
if (o.isStringLiteral(t.expression))
|
|
3422
|
-
return
|
|
3381
|
+
return fi(t.expression, i);
|
|
3423
3382
|
if (i) {
|
|
3424
3383
|
if (o.isNumericLiteral(t.expression))
|
|
3425
3384
|
return [`=${t.expression.text}`];
|
|
@@ -3429,14 +3388,14 @@ function Ne(e, t, i = !1) {
|
|
|
3429
3388
|
}
|
|
3430
3389
|
return ["=", ...Nt(e, t, void 0)];
|
|
3431
3390
|
}
|
|
3432
|
-
function
|
|
3391
|
+
function fi(e, t) {
|
|
3433
3392
|
if (!t)
|
|
3434
3393
|
return ["=", e];
|
|
3435
3394
|
const i = e.text;
|
|
3436
3395
|
if (i.length === 0)
|
|
3437
3396
|
return [];
|
|
3438
|
-
const n =
|
|
3439
|
-
if (
|
|
3397
|
+
const n = Yi(i);
|
|
3398
|
+
if (Rr(n)) {
|
|
3440
3399
|
const s = n.replaceAll('"', """);
|
|
3441
3400
|
if (s.length > n.length) {
|
|
3442
3401
|
const r = n.replaceAll("'", "'");
|
|
@@ -3447,7 +3406,7 @@ function gi(e, t) {
|
|
|
3447
3406
|
} else
|
|
3448
3407
|
return [`=${n}`];
|
|
3449
3408
|
}
|
|
3450
|
-
function
|
|
3409
|
+
function yi(e, t, i) {
|
|
3451
3410
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3452
3411
|
return [`${i}="${t.text}"`];
|
|
3453
3412
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3455,7 +3414,7 @@ function hi(e, t, i) {
|
|
|
3455
3414
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3456
3415
|
);
|
|
3457
3416
|
const n = t.expression;
|
|
3458
|
-
if (
|
|
3417
|
+
if (wa(n)) {
|
|
3459
3418
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3460
3419
|
e.neededImports.add(r);
|
|
3461
3420
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3465,18 +3424,18 @@ function hi(e, t, i) {
|
|
|
3465
3424
|
} else
|
|
3466
3425
|
return [i, ...Ne(e, t, !0)];
|
|
3467
3426
|
}
|
|
3468
|
-
const
|
|
3469
|
-
function
|
|
3427
|
+
const wa = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3428
|
+
function Ta(e, t) {
|
|
3470
3429
|
t.neededImports.add("live");
|
|
3471
3430
|
const i = t.importRenames.live;
|
|
3472
3431
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3473
3432
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3474
3433
|
]);
|
|
3475
3434
|
}
|
|
3476
|
-
function
|
|
3477
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3435
|
+
function Ea(e) {
|
|
3436
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in gi && e.expression.arguments.length <= 1)
|
|
3478
3437
|
return {
|
|
3479
|
-
propType:
|
|
3438
|
+
propType: gi[e.expression.expression.text],
|
|
3480
3439
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3481
3440
|
initializer: o.factory.createJsxExpression(
|
|
3482
3441
|
void 0,
|
|
@@ -3485,21 +3444,21 @@ function ja(e) {
|
|
|
3485
3444
|
)
|
|
3486
3445
|
};
|
|
3487
3446
|
}
|
|
3488
|
-
const
|
|
3447
|
+
const gi = {
|
|
3489
3448
|
bindProperty: "property",
|
|
3490
3449
|
bindAttribute: "attribute",
|
|
3491
3450
|
bindBooleanAttribute: "booleanAttribute",
|
|
3492
3451
|
bindEvent: "event"
|
|
3493
3452
|
};
|
|
3494
|
-
function
|
|
3495
|
-
return
|
|
3453
|
+
function Ca(e, t, i) {
|
|
3454
|
+
return Pa.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (Vi.has(e) || e.includes("-")) && (e !== "itemId" || i !== "arcgis-map" && i !== "arcgis-scene") ? "attribute" : !Pt(i) && (Xi.has(e) || (i === ft ? !1 : i === Re ? (
|
|
3496
3455
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3497
3456
|
Object.values(yt).some((r) => r.has(e))
|
|
3498
|
-
) : yt[i]?.has(e) === !0)) ? Yt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === ft || i !== Re && (Ct.has(i) || $t.has(i)) ? e in
|
|
3457
|
+
) : yt[i]?.has(e) === !0)) ? Yt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === ft || i !== Re && (Ct.has(i) || $t.has(i)) ? e in B.common.reflected || e in B.common.stringifiedReflected || e in B.common.stringifiedNonReflected ? "property" : Yt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3499
3458
|
}
|
|
3500
|
-
const
|
|
3501
|
-
function
|
|
3502
|
-
const s =
|
|
3459
|
+
const $a = ["class", "style", "ref", "directives", "key", "deferLoad"], Pa = new Set($a), xa = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3460
|
+
function Ge({ key: e, parts: t, litTag: i }, n) {
|
|
3461
|
+
const s = ka(t);
|
|
3503
3462
|
if (s.length % 2 === 0)
|
|
3504
3463
|
throw new Error("Normalized template parts array length must be odd");
|
|
3505
3464
|
const [r, ...a] = s;
|
|
@@ -3517,17 +3476,14 @@ function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
|
3517
3476
|
}
|
|
3518
3477
|
const c = typeof i == "string" ? i : ce;
|
|
3519
3478
|
n.neededImports.add(c);
|
|
3520
|
-
const l = n.importRenames[c], d =
|
|
3479
|
+
const l = n.importRenames[c], d = o.factory.createTaggedTemplateExpression(
|
|
3521
3480
|
o.factory.createIdentifier(l),
|
|
3522
3481
|
void 0,
|
|
3523
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(
|
|
3524
|
-
o.factory.createTemplateHead(d, d),
|
|
3525
|
-
Ba(a)
|
|
3526
|
-
)
|
|
3482
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Aa(a))
|
|
3527
3483
|
);
|
|
3528
|
-
return at(n, e,
|
|
3484
|
+
return at(n, e, d);
|
|
3529
3485
|
}
|
|
3530
|
-
const
|
|
3486
|
+
const ka = (e) => e.reduce(
|
|
3531
3487
|
(t, i, n) => {
|
|
3532
3488
|
const s = t.at(-1), r = typeof s == "string", a = typeof i == "string";
|
|
3533
3489
|
if (r && a)
|
|
@@ -3537,7 +3493,7 @@ const Ka = (e) => e.reduce(
|
|
|
3537
3493
|
},
|
|
3538
3494
|
[""]
|
|
3539
3495
|
);
|
|
3540
|
-
function
|
|
3496
|
+
function Aa(e) {
|
|
3541
3497
|
if (!(e.length % 2 === 0))
|
|
3542
3498
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3543
3499
|
const i = e.length / 2;
|
|
@@ -3548,17 +3504,10 @@ function Ba(e) {
|
|
|
3548
3504
|
const c = r + 1, l = e[c];
|
|
3549
3505
|
if (typeof l != "string")
|
|
3550
3506
|
throw new Error("Expected to receive a normalized array of parts");
|
|
3551
|
-
const d = s === i - 1
|
|
3507
|
+
const d = s === i - 1;
|
|
3552
3508
|
return o.factory.createTemplateSpan(
|
|
3553
3509
|
a,
|
|
3554
|
-
|
|
3555
|
-
* We pass the 2nd parameter (rawText), or else new-line characters will
|
|
3556
|
-
* be escaped. Technically the first parameter should be escaped string in
|
|
3557
|
-
* such case, but if rawText is present, first parameter is ignored
|
|
3558
|
-
* according to the source code:
|
|
3559
|
-
* https://github.com/microsoft/TypeScript/blob/0b37062eb07d1666245a02471b7d0e80c5d5aa5d/src/services/inlayHints.ts#L882
|
|
3560
|
-
*/
|
|
3561
|
-
d ? o.factory.createTemplateTail(p, p) : o.factory.createTemplateMiddle(p, p)
|
|
3510
|
+
d ? o.factory.createTemplateTail(l) : o.factory.createTemplateMiddle(l)
|
|
3562
3511
|
);
|
|
3563
3512
|
});
|
|
3564
3513
|
}
|
|
@@ -3569,8 +3518,8 @@ function at(e, t, i) {
|
|
|
3569
3518
|
const n = e.importRenames.keyed;
|
|
3570
3519
|
return o.factory.createCallExpression(o.factory.createIdentifier(n), void 0, [t, i]);
|
|
3571
3520
|
}
|
|
3572
|
-
const
|
|
3573
|
-
function
|
|
3521
|
+
const En = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
3522
|
+
function Cn(e, t) {
|
|
3574
3523
|
const i = Ft(e);
|
|
3575
3524
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
3576
3525
|
t,
|
|
@@ -3578,25 +3527,25 @@ function xn(e, t) {
|
|
|
3578
3527
|
...n,
|
|
3579
3528
|
pos: -1,
|
|
3580
3529
|
end: -1,
|
|
3581
|
-
text:
|
|
3530
|
+
text: $n(e.slice(n.pos, n.end))
|
|
3582
3531
|
}))
|
|
3583
3532
|
);
|
|
3584
3533
|
}
|
|
3585
3534
|
const Ft = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3586
|
-
function
|
|
3535
|
+
function Ia(e) {
|
|
3587
3536
|
const t = Ft(e);
|
|
3588
3537
|
if (t.length === 0)
|
|
3589
3538
|
return [e || " "];
|
|
3590
3539
|
const i = t.reduceRight(
|
|
3591
3540
|
([s, ...r], a) => {
|
|
3592
|
-
const c =
|
|
3541
|
+
const c = La(s), l = $n(c.slice(a.pos, a.end));
|
|
3593
3542
|
return [
|
|
3594
3543
|
c.slice(0, a.pos),
|
|
3595
3544
|
/**
|
|
3596
3545
|
* Literal values (like this) in place of directives are ignored by Lit:
|
|
3597
3546
|
* https://github.com/lit/lit/blob/56cb2ca4a86f2c7f6af757c612f05e50d1966615/packages/lit-html/src/lit-html.ts#L1111
|
|
3598
3547
|
*/
|
|
3599
|
-
o.factory.createNoSubstitutionTemplateLiteral(l
|
|
3548
|
+
o.factory.createNoSubstitutionTemplateLiteral(l),
|
|
3600
3549
|
c.slice(a.end),
|
|
3601
3550
|
...r
|
|
3602
3551
|
];
|
|
@@ -3607,13 +3556,13 @@ function Wa(e) {
|
|
|
3607
3556
|
const n = i.at(-1);
|
|
3608
3557
|
return (typeof n != "string" || n.trim() !== "") && i.push(" "), i;
|
|
3609
3558
|
}
|
|
3610
|
-
const
|
|
3611
|
-
function
|
|
3559
|
+
const $n = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3560
|
+
function La(e) {
|
|
3612
3561
|
if (typeof e == "string")
|
|
3613
3562
|
return e;
|
|
3614
3563
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3615
3564
|
}
|
|
3616
|
-
function
|
|
3565
|
+
function Fa(e, t) {
|
|
3617
3566
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3618
3567
|
return t;
|
|
3619
3568
|
const n = t.arguments[0];
|
|
@@ -3625,7 +3574,7 @@ function Ha(e, t) {
|
|
|
3625
3574
|
return t;
|
|
3626
3575
|
const c = Se(n.body);
|
|
3627
3576
|
let l = !0, d;
|
|
3628
|
-
if (
|
|
3577
|
+
if (hi(c))
|
|
3629
3578
|
d = c;
|
|
3630
3579
|
else {
|
|
3631
3580
|
if (!o.isBlock(c))
|
|
@@ -3633,21 +3582,21 @@ function Ha(e, t) {
|
|
|
3633
3582
|
const v = c.statements.at(-1);
|
|
3634
3583
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
3635
3584
|
return t;
|
|
3636
|
-
const
|
|
3637
|
-
if (!
|
|
3585
|
+
const T = Se(v.expression);
|
|
3586
|
+
if (!hi(T))
|
|
3638
3587
|
return t;
|
|
3639
3588
|
const x = c.statements.slice(0, -1);
|
|
3640
|
-
if (x.some(
|
|
3589
|
+
if (x.some(Pn))
|
|
3641
3590
|
return t;
|
|
3642
|
-
l = x.length === 0, d =
|
|
3591
|
+
l = x.length === 0, d = T;
|
|
3643
3592
|
}
|
|
3644
|
-
const p = o.isJsxElement(d) ? d.openingElement : d, m =
|
|
3593
|
+
const p = o.isJsxElement(d) ? d.openingElement : d, m = Ln(p);
|
|
3645
3594
|
if (m === -1)
|
|
3646
3595
|
return t;
|
|
3647
3596
|
const f = p.attributes.properties[m];
|
|
3648
3597
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3649
3598
|
return t;
|
|
3650
|
-
const y = Lt(f.initializer, e.sourceFile), g =
|
|
3599
|
+
const y = Lt(f.initializer, e.sourceFile), g = Na(r, n, y, l, e);
|
|
3651
3600
|
if (g === void 0)
|
|
3652
3601
|
return t;
|
|
3653
3602
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3669,25 +3618,25 @@ function Ha(e, t) {
|
|
|
3669
3618
|
)
|
|
3670
3619
|
]);
|
|
3671
3620
|
}
|
|
3672
|
-
const
|
|
3673
|
-
function
|
|
3621
|
+
const hi = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3622
|
+
function Pn(e) {
|
|
3674
3623
|
if (o.isReturnStatement(e))
|
|
3675
3624
|
return !0;
|
|
3676
3625
|
let t = !1;
|
|
3677
3626
|
return o.visitEachChild(
|
|
3678
3627
|
e,
|
|
3679
|
-
(i) => (t ||=
|
|
3628
|
+
(i) => (t ||= Pn(i), i),
|
|
3680
3629
|
void 0
|
|
3681
3630
|
), t;
|
|
3682
3631
|
}
|
|
3683
|
-
function
|
|
3684
|
-
const r =
|
|
3632
|
+
function Na(e, t, i, n, s) {
|
|
3633
|
+
const r = W(i);
|
|
3685
3634
|
if (r === void 0)
|
|
3686
3635
|
return;
|
|
3687
|
-
let a =
|
|
3636
|
+
let a = xn(e.name, r);
|
|
3688
3637
|
const c = t.parameters.at(1);
|
|
3689
3638
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
3690
|
-
r.every(
|
|
3639
|
+
r.every(We, c.name)) {
|
|
3691
3640
|
C.warn(
|
|
3692
3641
|
"@arcgis/lumina:jsxToLitHtml",
|
|
3693
3642
|
"It looks like you are trying to use .map() index as a key={} prop value. Doing so is potentially pointless and may cause performance degradation. In Lit it is safe to omit the key={} prop. If you really mean to use index as the key, then use the keyed() Lit directive directly, rather than the JSX key={} prop.",
|
|
@@ -3696,7 +3645,7 @@ function Ua(e, t, i, n, s) {
|
|
|
3696
3645
|
return;
|
|
3697
3646
|
}
|
|
3698
3647
|
if (!n) {
|
|
3699
|
-
const l =
|
|
3648
|
+
const l = ja(r, a, t);
|
|
3700
3649
|
if (l === void 0)
|
|
3701
3650
|
return;
|
|
3702
3651
|
a = l;
|
|
@@ -3712,29 +3661,29 @@ function Ua(e, t, i, n, s) {
|
|
|
3712
3661
|
e.initializer
|
|
3713
3662
|
);
|
|
3714
3663
|
}
|
|
3715
|
-
function
|
|
3664
|
+
function W(e) {
|
|
3716
3665
|
if (o.isIdentifier(e))
|
|
3717
3666
|
return [e.text];
|
|
3718
3667
|
if (o.isPropertyAccessExpression(e))
|
|
3719
|
-
return
|
|
3668
|
+
return W(e.expression);
|
|
3720
3669
|
if (o.isElementAccessExpression(e))
|
|
3721
|
-
return
|
|
3670
|
+
return W(e.argumentExpression);
|
|
3722
3671
|
if (o.isConditionalExpression(e)) {
|
|
3723
|
-
const t =
|
|
3672
|
+
const t = W(e.condition), i = W(e.whenTrue), n = W(e.whenFalse);
|
|
3724
3673
|
return t === void 0 || i === void 0 || n === void 0 ? void 0 : [...t, ...i, ...n];
|
|
3725
3674
|
} else if (o.isBinaryExpression(e)) {
|
|
3726
|
-
const t =
|
|
3675
|
+
const t = W(e.left), i = W(e.right);
|
|
3727
3676
|
return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
|
|
3728
3677
|
} else {
|
|
3729
|
-
if (
|
|
3678
|
+
if (Da.has(e.kind))
|
|
3730
3679
|
return [];
|
|
3731
3680
|
{
|
|
3732
3681
|
const t = Se(e);
|
|
3733
|
-
return t !== e ?
|
|
3682
|
+
return t !== e ? W(t) : void 0;
|
|
3734
3683
|
}
|
|
3735
3684
|
}
|
|
3736
3685
|
}
|
|
3737
|
-
const
|
|
3686
|
+
const Da = /* @__PURE__ */ new Set([
|
|
3738
3687
|
o.SyntaxKind.NumericLiteral,
|
|
3739
3688
|
o.SyntaxKind.BigIntLiteral,
|
|
3740
3689
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3743,41 +3692,41 @@ const za = /* @__PURE__ */ new Set([
|
|
|
3743
3692
|
o.SyntaxKind.FalseKeyword,
|
|
3744
3693
|
o.SyntaxKind.NullKeyword,
|
|
3745
3694
|
o.SyntaxKind.TrueKeyword
|
|
3746
|
-
]), Se = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Se(e.expression) : e,
|
|
3747
|
-
function
|
|
3748
|
-
if (e.every(
|
|
3695
|
+
]), Se = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Se(e.expression) : e, xn = (e, t) => o.isObjectBindingPattern(e) ? Oa(e, t) : e;
|
|
3696
|
+
function ja(e, t, i) {
|
|
3697
|
+
if (e.every(We, t))
|
|
3749
3698
|
return t;
|
|
3750
3699
|
if (o.isIdentifier(t)) {
|
|
3751
|
-
const n = o.isBlock(i.body) ? ye(i.body.statements, (r) =>
|
|
3700
|
+
const n = o.isBlock(i.body) ? ye(i.body.statements, (r) => Ra(r, t)) : void 0;
|
|
3752
3701
|
if (n === void 0)
|
|
3753
3702
|
return;
|
|
3754
|
-
const s =
|
|
3755
|
-
if (e.every(
|
|
3703
|
+
const s = xn(n, e);
|
|
3704
|
+
if (e.every(We, s))
|
|
3756
3705
|
return s;
|
|
3757
3706
|
}
|
|
3758
3707
|
}
|
|
3759
|
-
function
|
|
3708
|
+
function Ra(e, t) {
|
|
3760
3709
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
3761
3710
|
return;
|
|
3762
3711
|
const i = e.declarationList.declarations[0];
|
|
3763
3712
|
return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
|
|
3764
3713
|
}
|
|
3765
|
-
function
|
|
3714
|
+
function We(e) {
|
|
3766
3715
|
const t = this;
|
|
3767
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
3716
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Ma, e);
|
|
3768
3717
|
}
|
|
3769
|
-
function
|
|
3718
|
+
function Ma(e) {
|
|
3770
3719
|
const t = this;
|
|
3771
|
-
return o.isOmittedExpression(e) ? !1 :
|
|
3720
|
+
return o.isOmittedExpression(e) ? !1 : We.call(e.name, t);
|
|
3772
3721
|
}
|
|
3773
|
-
function
|
|
3722
|
+
function Oa(e, t) {
|
|
3774
3723
|
let i = !1;
|
|
3775
3724
|
const n = e.elements.filter((s) => o.isIdentifier(s.name) ? t.includes(s.name.text) : (i = !0, !0));
|
|
3776
3725
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3777
3726
|
}
|
|
3778
|
-
const
|
|
3779
|
-
`),
|
|
3780
|
-
function
|
|
3727
|
+
const kn = (e, t) => t.liftedKeys.has(e), Ja = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}";`).join(`
|
|
3728
|
+
`), Ka = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, Ve = (e) => !Ka.test(e), Ee = (e) => Ve(e) ? `"${e}"` : e;
|
|
3729
|
+
function Xe(e, t) {
|
|
3781
3730
|
const i = [], n = [];
|
|
3782
3731
|
let s = !1;
|
|
3783
3732
|
t?.forEach((p) => {
|
|
@@ -3790,70 +3739,70 @@ function Qe(e, t) {
|
|
|
3790
3739
|
}
|
|
3791
3740
|
m.docsTags?.some((y) => y.name === "required") ? i.push(p.name) : n.push(p.name);
|
|
3792
3741
|
});
|
|
3793
|
-
const r =
|
|
3742
|
+
const r = vi(i), a = vi(n), c = [
|
|
3794
3743
|
r ? `Required<Pick<${e}, ${r}>>` : "",
|
|
3795
3744
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3796
3745
|
s ? `${e}SetterTypes` : ""
|
|
3797
3746
|
], l = s ? `
|
|
3798
|
-
type ${e}SetterTypes = ${e}["${
|
|
3747
|
+
type ${e}SetterTypes = ${e}["${Gi}"]` : "", d = c.filter(Boolean).join(", ");
|
|
3799
3748
|
return [d.length === 0 ? "" : `${d}, `, l];
|
|
3800
3749
|
}
|
|
3801
|
-
const
|
|
3750
|
+
const vi = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3802
3751
|
function q(e, t, i) {
|
|
3803
3752
|
if (Ke(i))
|
|
3804
|
-
return
|
|
3805
|
-
const n = o.isCallExpression(i) ?
|
|
3753
|
+
return An(e, i);
|
|
3754
|
+
const n = o.isCallExpression(i) ? Fa(e, i) : i, s = o.visitEachChild(
|
|
3806
3755
|
n,
|
|
3807
3756
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
3808
3757
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
3809
3758
|
e.transformationContext
|
|
3810
3759
|
);
|
|
3811
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Ke(Se(i.right))) ?
|
|
3760
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Ke(Se(i.right))) ? _a(s) : s;
|
|
3812
3761
|
}
|
|
3813
|
-
function
|
|
3814
|
-
const i =
|
|
3815
|
-
return
|
|
3762
|
+
function An(e, t) {
|
|
3763
|
+
const i = In(e, t);
|
|
3764
|
+
return Ge(i, e);
|
|
3816
3765
|
}
|
|
3817
|
-
function
|
|
3766
|
+
function In(e, t) {
|
|
3818
3767
|
const i = "children" in t ? t.children : [];
|
|
3819
3768
|
if (o.isJsxFragment(t))
|
|
3820
3769
|
return { key: void 0, ...De(i, e) };
|
|
3821
3770
|
const s = o.isJsxElement(t) ? t.openingElement : t, r = s.tagName;
|
|
3822
3771
|
if (o.isJsxNamespacedName(r))
|
|
3823
3772
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
3824
|
-
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !==
|
|
3825
|
-
const $ = o.isIdentifier(r) && r.text ===
|
|
3773
|
+
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== et && r.text !== tt) {
|
|
3774
|
+
const $ = o.isIdentifier(r) && r.text === kr ? De(i, e) : {
|
|
3826
3775
|
// No need to wrap the function call in a lit-html tag
|
|
3827
3776
|
litTag: void 0,
|
|
3828
|
-
parts: [
|
|
3777
|
+
parts: [Ba(e, t, r, i)]
|
|
3829
3778
|
};
|
|
3830
3779
|
return {
|
|
3831
|
-
key:
|
|
3780
|
+
key: Wa(s, e),
|
|
3832
3781
|
...$
|
|
3833
3782
|
};
|
|
3834
3783
|
}
|
|
3835
|
-
const c = r.text ===
|
|
3784
|
+
const c = r.text === et ? Re : r.text === tt ? ft : r.text, l = r.text === et ? ae : r.text === tt ? Z : Ir.has(c) ? Sn : Ct.has(c) ? oe : ce, d = Pt(c);
|
|
3836
3785
|
let p;
|
|
3837
|
-
d && e.compiler.viteCommand === "build" && (p =
|
|
3786
|
+
d && e.compiler.viteCommand === "build" && (p = Ha(e, c));
|
|
3838
3787
|
let m;
|
|
3839
3788
|
const f = [];
|
|
3840
3789
|
let y = !1;
|
|
3841
|
-
const g = s.attributes.properties.flatMap((
|
|
3842
|
-
if (o.isJsxSpreadAttribute(
|
|
3790
|
+
const g = s.attributes.properties.flatMap((L) => {
|
|
3791
|
+
if (o.isJsxSpreadAttribute(L))
|
|
3843
3792
|
throw Error(
|
|
3844
3793
|
`JSX spread attribute syntax is not supported. See alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes
|
|
3845
|
-
Found ${
|
|
3794
|
+
Found ${L.getText(e.sourceFile)}`
|
|
3846
3795
|
);
|
|
3847
|
-
const { name: $, initializer: b } =
|
|
3796
|
+
const { name: $, initializer: b } = L;
|
|
3848
3797
|
if (o.isJsxNamespacedName($))
|
|
3849
3798
|
throw Error(`JSX namespaced attributes are not supported. Found ${$.getText(e.sourceFile)}`);
|
|
3850
|
-
const
|
|
3851
|
-
p?.delete(
|
|
3852
|
-
const D =
|
|
3799
|
+
const E = $.text, I = Ea(b), N = I?.propType ?? Ca(E, b, c);
|
|
3800
|
+
p?.delete(E);
|
|
3801
|
+
const D = Sa[N](e, I?.initializer ?? b, E, c);
|
|
3853
3802
|
if (D.length === 0)
|
|
3854
3803
|
return [];
|
|
3855
|
-
const M = e.compiler.shouldMinifyJsx ? [" "] :
|
|
3856
|
-
return N === "key" ? (m = typeof D[0] == "object" && !
|
|
3804
|
+
const M = e.compiler.shouldMinifyJsx ? [" "] : Ia(En($, e));
|
|
3805
|
+
return N === "key" ? (m = typeof D[0] == "object" && !kn($, e) ? D[0] : void 0, M.some(xa) ? M : []) : N === "directives" || N === "ref" || E === "deferLoad" ? (y ||= N === "deferLoad", f.push(
|
|
3857
3806
|
...M,
|
|
3858
3807
|
...D.flatMap(
|
|
3859
3808
|
(H, K) => typeof H == "string" || K === 0 || typeof D[K - 1] == "string" ? H : [" ", H]
|
|
@@ -3869,51 +3818,51 @@ Found ${I.getText(e.sourceFile)}`
|
|
|
3869
3818
|
`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`
|
|
3870
3819
|
);
|
|
3871
3820
|
d && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3872
|
-
const h = typeof c == "string" &&
|
|
3821
|
+
const h = typeof c == "string" && Ar.has(c), v = De(i, e);
|
|
3873
3822
|
if (h && v.parts.length > 0)
|
|
3874
3823
|
throw Error(
|
|
3875
3824
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
3876
3825
|
);
|
|
3877
|
-
const S = (l === oe || l === Z) && v.parts.length === 0,
|
|
3826
|
+
const S = (l === oe || l === Z) && v.parts.length === 0, T = [
|
|
3878
3827
|
"<",
|
|
3879
3828
|
typeof c == "string" ? c : r,
|
|
3880
3829
|
...g,
|
|
3881
3830
|
S ? `${g.length === 0 ? "" : " "}/>` : ">"
|
|
3882
|
-
], x = h || S ?
|
|
3883
|
-
...
|
|
3831
|
+
], x = h || S ? T : [
|
|
3832
|
+
...T,
|
|
3884
3833
|
/**
|
|
3885
3834
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
3886
3835
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
3887
3836
|
* tagged template literal (e.g. svg``)
|
|
3888
3837
|
*/
|
|
3889
|
-
...v.litTag !== void 0 && v.litTag !== l ? [
|
|
3838
|
+
...v.litTag !== void 0 && v.litTag !== l ? [Ge({ key: void 0, ...v }, e)] : v.parts,
|
|
3890
3839
|
"</",
|
|
3891
3840
|
typeof c == "string" ? c : r,
|
|
3892
3841
|
">"
|
|
3893
3842
|
];
|
|
3894
3843
|
return { key: m, parts: x, litTag: l };
|
|
3895
3844
|
}
|
|
3896
|
-
function
|
|
3897
|
-
const i = e.attributes.properties[
|
|
3898
|
-
return i && o.isJsxAttribute(i) && !
|
|
3845
|
+
function Wa(e, t) {
|
|
3846
|
+
const i = e.attributes.properties[Ln(e)];
|
|
3847
|
+
return i && o.isJsxAttribute(i) && !kn(i.name, t) ? Lt(i.initializer, t.sourceFile) : void 0;
|
|
3899
3848
|
}
|
|
3900
|
-
const
|
|
3901
|
-
function
|
|
3849
|
+
const Ln = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3850
|
+
function Ba(e, t, i, n) {
|
|
3902
3851
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((l) => {
|
|
3903
3852
|
if (o.isJsxSpreadAttribute(l))
|
|
3904
|
-
return
|
|
3853
|
+
return Cn(En(l, e), o.factory.createSpreadAssignment(l.expression));
|
|
3905
3854
|
const { name: d, initializer: p } = l;
|
|
3906
3855
|
if (o.isJsxNamespacedName(d))
|
|
3907
3856
|
throw Error(`JSX namespaced attributes are not supported. Found ${d.getText(e.sourceFile)}`);
|
|
3908
3857
|
if (d.text === "key")
|
|
3909
3858
|
return;
|
|
3910
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Ke(p) ?
|
|
3859
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Ke(p) ? An(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Ve(d.text) ? o.factory.createStringLiteral(d.text) : d;
|
|
3911
3860
|
return o.factory.createPropertyAssignment(f, m);
|
|
3912
3861
|
}), { parts: a, litTag: c } = De(n, e);
|
|
3913
3862
|
return a.length > 0 && r.push(
|
|
3914
3863
|
o.factory.createPropertyAssignment(
|
|
3915
3864
|
o.factory.createIdentifier("children"),
|
|
3916
|
-
|
|
3865
|
+
Ge({ key: void 0, parts: a, litTag: c }, e)
|
|
3917
3866
|
)
|
|
3918
3867
|
), o.factory.createCallExpression(i, void 0, [
|
|
3919
3868
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
@@ -3923,13 +3872,13 @@ function De(e, t) {
|
|
|
3923
3872
|
let i;
|
|
3924
3873
|
const n = e.flatMap((s) => {
|
|
3925
3874
|
if (o.isJsxText(s))
|
|
3926
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
3875
|
+
return [t.compiler.shouldMinifyJsx ? Fr(s.text) : s.text];
|
|
3927
3876
|
if (o.isJsxExpression(s))
|
|
3928
3877
|
return Nt(t, s, s);
|
|
3929
3878
|
{
|
|
3930
|
-
const r =
|
|
3879
|
+
const r = In(t, s);
|
|
3931
3880
|
if (r.key === void 0 && r.litTag !== ae && r.litTag !== Z) {
|
|
3932
|
-
if (r.litTag ===
|
|
3881
|
+
if (r.litTag === Sn)
|
|
3933
3882
|
return r.parts;
|
|
3934
3883
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
3935
3884
|
throw new Error(
|
|
@@ -3937,12 +3886,12 @@ function De(e, t) {
|
|
|
3937
3886
|
);
|
|
3938
3887
|
return i = r.litTag, r.parts;
|
|
3939
3888
|
} else
|
|
3940
|
-
return [
|
|
3889
|
+
return [Ge(r, t)];
|
|
3941
3890
|
}
|
|
3942
3891
|
});
|
|
3943
3892
|
return { litTag: i, parts: n };
|
|
3944
3893
|
}
|
|
3945
|
-
function
|
|
3894
|
+
function _a(e) {
|
|
3946
3895
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
3947
3896
|
e,
|
|
3948
3897
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -3954,9 +3903,9 @@ function Nt(e, t, i) {
|
|
|
3954
3903
|
if (e.compiler.shouldMinifyJsx)
|
|
3955
3904
|
return [];
|
|
3956
3905
|
const n = t.getText(e.sourceFile).slice(1, -1);
|
|
3957
|
-
return Ft(n).length === 0 ? [] : [
|
|
3906
|
+
return Ft(n).length === 0 ? [] : [Cn(n, o.factory.createIdentifier("undefined"))];
|
|
3958
3907
|
}
|
|
3959
|
-
return o.isStringLiteral(t.expression) ? [
|
|
3908
|
+
return o.isStringLiteral(t.expression) ? [Yi(t.expression.text)] : (
|
|
3960
3909
|
/**
|
|
3961
3910
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
3962
3911
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -3993,7 +3942,7 @@ function Nt(e, t, i) {
|
|
|
3993
3942
|
] : [q(e, i, t.expression)]
|
|
3994
3943
|
);
|
|
3995
3944
|
}
|
|
3996
|
-
function
|
|
3945
|
+
function Ha(e, t) {
|
|
3997
3946
|
if (t in e.localComponents)
|
|
3998
3947
|
for (const n of e.compiler.privateApiJson.modules)
|
|
3999
3948
|
for (const s of n.declarations) {
|
|
@@ -4005,7 +3954,7 @@ function ic(e, t) {
|
|
|
4005
3954
|
return r;
|
|
4006
3955
|
}
|
|
4007
3956
|
}
|
|
4008
|
-
const
|
|
3957
|
+
const Fn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), be = {
|
|
4009
3958
|
[ce]: ["lit-html", "lit/html.js", "lit"],
|
|
4010
3959
|
/**
|
|
4011
3960
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -4016,8 +3965,8 @@ const jn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), b
|
|
|
4016
3965
|
[ae]: ["lit-html/static.js", "lit/static-html.js"],
|
|
4017
3966
|
[oe]: ["lit-html", "lit/html.js", "lit"],
|
|
4018
3967
|
[Z]: ["lit-html/static.js", "lit/static-html.js"],
|
|
4019
|
-
[
|
|
4020
|
-
[
|
|
3968
|
+
[wn]: ["lit-html", "lit/html.js", "lit"],
|
|
3969
|
+
[bn]: ["@lit/reactive-element/css-tag.js", "@lit/reactive-element", "lit"],
|
|
4021
3970
|
safeClassMap: ["@arcgis/lumina"],
|
|
4022
3971
|
safeStyleMap: ["@arcgis/lumina"],
|
|
4023
3972
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -4026,14 +3975,14 @@ const jn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), b
|
|
|
4026
3975
|
repeat: ["lit-html/directives/repeat.js", "lit/directives/repeat.js"],
|
|
4027
3976
|
ref: ["lit-html/directives/ref.js", "lit/directives/ref.js"],
|
|
4028
3977
|
nothing: ["lit-html", "lit/html.js", "lit-element/lit-element.js", "lit", "@arcgis/lumina"]
|
|
4029
|
-
},
|
|
3978
|
+
}, Nn = Fn(
|
|
4030
3979
|
Object.entries(be).flatMap(([e, t]) => t.map((i) => [i, e]))
|
|
4031
|
-
),
|
|
4032
|
-
function
|
|
3980
|
+
), Dn = new Set(Object.keys(Nn));
|
|
3981
|
+
function Ua(e, t) {
|
|
4033
3982
|
const i = t.importClause, n = t.moduleSpecifier;
|
|
4034
3983
|
if (!o.isStringLiteral(n))
|
|
4035
3984
|
return t;
|
|
4036
|
-
const s =
|
|
3985
|
+
const s = za(e.sourceFile.fileName, n.text, ""), r = !i?.isTypeOnly;
|
|
4037
3986
|
if (r && e.existingImportedModules.add(s), i === void 0)
|
|
4038
3987
|
return t;
|
|
4039
3988
|
if (e.isInLightDomComponent && n.text.startsWith(".") && Oe.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
@@ -4052,12 +4001,12 @@ function nc(e, t) {
|
|
|
4052
4001
|
const a = i.namedBindings;
|
|
4053
4002
|
if (a === void 0 || !o.isNamedImports(a))
|
|
4054
4003
|
return t;
|
|
4055
|
-
const c =
|
|
4004
|
+
const c = Dn.has(n.text);
|
|
4056
4005
|
return a.elements.forEach((l) => {
|
|
4057
4006
|
const d = (l.propertyName ?? l.name).text, p = be[d];
|
|
4058
4007
|
if (c) {
|
|
4059
4008
|
if (p?.some((y) => y === n.text)) {
|
|
4060
|
-
const y =
|
|
4009
|
+
const y = jn(d, s);
|
|
4061
4010
|
e.existingLitImports.add(y), e.importRenames[y] = l.name?.text ?? y;
|
|
4062
4011
|
}
|
|
4063
4012
|
} else (l.name.text === "h" || l.name.text === "createElement") && (e.hasNonLuminaJsxImport = !0);
|
|
@@ -4065,22 +4014,22 @@ function nc(e, t) {
|
|
|
4065
4014
|
r && !l.isTypeOnly && m && f && e.importedFunctionComponentsFromModules.add(s);
|
|
4066
4015
|
}), t;
|
|
4067
4016
|
}
|
|
4068
|
-
const
|
|
4069
|
-
function
|
|
4070
|
-
return o.isImportDeclaration(e) ?
|
|
4017
|
+
const jn = (e, t) => e === ce && be.staticHtml.includes(t) ? ae : e === oe && be.staticSvg.includes(t) ? Z : e, za = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4018
|
+
function qa(e) {
|
|
4019
|
+
return o.isImportDeclaration(e) ? Ga(this, e) : e;
|
|
4071
4020
|
}
|
|
4072
|
-
function
|
|
4021
|
+
function Ga(e, t) {
|
|
4073
4022
|
const i = t.importClause, n = i?.namedBindings, s = t.moduleSpecifier;
|
|
4074
|
-
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !
|
|
4023
|
+
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !Dn.has(s.text))
|
|
4075
4024
|
return t;
|
|
4076
4025
|
const r = i.isTypeOnly;
|
|
4077
4026
|
let a = !1;
|
|
4078
4027
|
const c = n.elements.map((l) => {
|
|
4079
|
-
const d = (l.propertyName ?? l.name).text, p =
|
|
4028
|
+
const d = (l.propertyName ?? l.name).text, p = jn(d, s.text);
|
|
4080
4029
|
return e.existingLitImports.delete(p), e.neededImports.has(p) ? (e.neededImports.delete(p), a = !0, o.factory.updateImportSpecifier(l, !1, l.propertyName, l.name)) : r ? o.factory.updateImportSpecifier(l, !0, l.propertyName, l.name) : l;
|
|
4081
4030
|
});
|
|
4082
|
-
return
|
|
4083
|
-
!e.neededImports.has(l) || e.existingLitImports.has(l) || (e.neededImports.delete(l), a = !0, c.push(
|
|
4031
|
+
return Nn[s.text]?.forEach((l) => {
|
|
4032
|
+
!e.neededImports.has(l) || e.existingLitImports.has(l) || (e.neededImports.delete(l), a = !0, c.push(Rn(l, e)));
|
|
4084
4033
|
}), a ? o.factory.updateImportDeclaration(
|
|
4085
4034
|
t,
|
|
4086
4035
|
t.modifiers,
|
|
@@ -4094,8 +4043,8 @@ function oc(e, t) {
|
|
|
4094
4043
|
t.attributes
|
|
4095
4044
|
) : t;
|
|
4096
4045
|
}
|
|
4097
|
-
function
|
|
4098
|
-
const t =
|
|
4046
|
+
function Va(e) {
|
|
4047
|
+
const t = Fn(Array.from(e.neededImports, (i) => [be[i][0], i]));
|
|
4099
4048
|
return Object.entries(t).map(
|
|
4100
4049
|
([i, n]) => o.factory.createImportDeclaration(
|
|
4101
4050
|
void 0,
|
|
@@ -4103,14 +4052,14 @@ function ac(e) {
|
|
|
4103
4052
|
!1,
|
|
4104
4053
|
void 0,
|
|
4105
4054
|
o.factory.createNamedImports(
|
|
4106
|
-
n.map((s) => (e.neededImports.delete(s),
|
|
4055
|
+
n.map((s) => (e.neededImports.delete(s), Rn(s, e)))
|
|
4107
4056
|
)
|
|
4108
4057
|
),
|
|
4109
4058
|
o.factory.createStringLiteral(i)
|
|
4110
4059
|
)
|
|
4111
4060
|
);
|
|
4112
4061
|
}
|
|
4113
|
-
function
|
|
4062
|
+
function Rn(e, t) {
|
|
4114
4063
|
const i = e === ae ? ce : e === Z ? oe : e, n = t.importRenames[e];
|
|
4115
4064
|
return n === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4116
4065
|
!1,
|
|
@@ -4118,12 +4067,12 @@ function Jn(e, t) {
|
|
|
4118
4067
|
o.factory.createIdentifier(n)
|
|
4119
4068
|
);
|
|
4120
4069
|
}
|
|
4121
|
-
function
|
|
4122
|
-
const t =
|
|
4070
|
+
function Xa(e) {
|
|
4071
|
+
const t = ea().map(({ packageName: i }) => i);
|
|
4123
4072
|
return e.existingImportedModules.forEach((i) => {
|
|
4124
4073
|
if (u.isAbsolute(i))
|
|
4125
4074
|
return;
|
|
4126
|
-
const { packageName: n, moduleName: s } =
|
|
4075
|
+
const { packageName: n, moduleName: s } = on(i);
|
|
4127
4076
|
if (t.includes(n ?? "") && (s.startsWith("dist/components") || s.startsWith("components"))) {
|
|
4128
4077
|
const r = Y(e.sourceFile.fileName);
|
|
4129
4078
|
throw new Error(
|
|
@@ -4132,7 +4081,7 @@ function cc(e) {
|
|
|
4132
4081
|
}
|
|
4133
4082
|
}), [];
|
|
4134
4083
|
}
|
|
4135
|
-
function
|
|
4084
|
+
function Qa(e) {
|
|
4136
4085
|
if (e.compiler.viteCommand === "serve")
|
|
4137
4086
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4138
4087
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4147,9 +4096,11 @@ function lc(e) {
|
|
|
4147
4096
|
t[n] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[n].referencedBy.push(e.sourceFile.fileName);
|
|
4148
4097
|
}), [];
|
|
4149
4098
|
}
|
|
4150
|
-
function
|
|
4151
|
-
const n =
|
|
4099
|
+
function Za(e, t, i) {
|
|
4100
|
+
const n = gn()[t] ?? Mn(e)[t];
|
|
4152
4101
|
if (n === void 0) {
|
|
4102
|
+
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
4103
|
+
return;
|
|
4153
4104
|
const s = Y(i);
|
|
4154
4105
|
throw Error(
|
|
4155
4106
|
w(
|
|
@@ -4160,28 +4111,28 @@ function dc(e, t, i) {
|
|
|
4160
4111
|
}
|
|
4161
4112
|
return n;
|
|
4162
4113
|
}
|
|
4163
|
-
function
|
|
4114
|
+
function Ya(e, t) {
|
|
4164
4115
|
return e.packageName === void 0 ? ee(t, e.moduleName) : u.join(e.packageName, e.moduleName);
|
|
4165
4116
|
}
|
|
4166
|
-
function
|
|
4167
|
-
return e._localDefinedComponents ??=
|
|
4117
|
+
function Mn(e) {
|
|
4118
|
+
return e._localDefinedComponents ??= vn(e.privateApiJson, {
|
|
4168
4119
|
packageName: void 0,
|
|
4169
4120
|
getImportPath() {
|
|
4170
4121
|
throw new Error("Not supposed to be called for local components");
|
|
4171
4122
|
}
|
|
4172
4123
|
}), e._localDefinedComponents;
|
|
4173
4124
|
}
|
|
4174
|
-
const
|
|
4125
|
+
const ec = (e, t) => {
|
|
4175
4126
|
const i = e.pragmas;
|
|
4176
4127
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4177
4128
|
return e.statements;
|
|
4178
4129
|
const n = {
|
|
4179
4130
|
compiler: t.compiler,
|
|
4180
|
-
externalComponents:
|
|
4181
|
-
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} :
|
|
4131
|
+
externalComponents: gn(),
|
|
4132
|
+
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : Mn(t.compiler),
|
|
4182
4133
|
sourceFile: e,
|
|
4183
4134
|
transformationContext: t.transformation,
|
|
4184
|
-
importRenames:
|
|
4135
|
+
importRenames: tc(e),
|
|
4185
4136
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4186
4137
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4187
4138
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4197,18 +4148,18 @@ const uc = (e, t) => {
|
|
|
4197
4148
|
let s = [];
|
|
4198
4149
|
if (e.statements.every((a) => {
|
|
4199
4150
|
if (o.isImportDeclaration(a)) {
|
|
4200
|
-
if (s.push(
|
|
4151
|
+
if (s.push(Ua(n, a)), n.hasNonLuminaJsxImport)
|
|
4201
4152
|
return !1;
|
|
4202
4153
|
} else
|
|
4203
4154
|
s.push(q(n, void 0, a));
|
|
4204
4155
|
return !0;
|
|
4205
4156
|
}), n.hasNonLuminaJsxImport)
|
|
4206
4157
|
return e.statements;
|
|
4207
|
-
if (n.neededImports.size > 0 && (s = s.map(
|
|
4158
|
+
if (n.neededImports.size > 0 && (s = s.map(qa, n), n.existingLitImports.size > 0))
|
|
4208
4159
|
throw new Error(
|
|
4209
4160
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
|
|
4210
4161
|
);
|
|
4211
|
-
const r = [
|
|
4162
|
+
const r = [Va, Xa, Qa].flatMap(
|
|
4212
4163
|
(a) => a(n)
|
|
4213
4164
|
);
|
|
4214
4165
|
if (n.neededImports.size > 0)
|
|
@@ -4217,18 +4168,18 @@ const uc = (e, t) => {
|
|
|
4217
4168
|
);
|
|
4218
4169
|
return [...r, ...s];
|
|
4219
4170
|
};
|
|
4220
|
-
function
|
|
4221
|
-
return
|
|
4222
|
-
|
|
4171
|
+
function tc(e) {
|
|
4172
|
+
return ic(e), Object.fromEntries(
|
|
4173
|
+
ga.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4223
4174
|
);
|
|
4224
4175
|
}
|
|
4225
|
-
function
|
|
4176
|
+
function ic(e) {
|
|
4226
4177
|
if (!("identifiers" in e))
|
|
4227
4178
|
throw new Error(
|
|
4228
4179
|
"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."
|
|
4229
4180
|
);
|
|
4230
4181
|
}
|
|
4231
|
-
function
|
|
4182
|
+
function nc(e, t, i) {
|
|
4232
4183
|
return t.size === 0 ? e : [
|
|
4233
4184
|
o.factory.createPropertyDeclaration(
|
|
4234
4185
|
[
|
|
@@ -4241,8 +4192,8 @@ function yc(e, t, i) {
|
|
|
4241
4192
|
o.factory.createObjectLiteralExpression(
|
|
4242
4193
|
Array.from(t.entries()).map(
|
|
4243
4194
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4244
|
-
|
|
4245
|
-
|
|
4195
|
+
Ve(n) ? o.factory.createStringLiteral(n) : n,
|
|
4196
|
+
sc(s, i)
|
|
4246
4197
|
)
|
|
4247
4198
|
)
|
|
4248
4199
|
)
|
|
@@ -4250,7 +4201,7 @@ function yc(e, t, i) {
|
|
|
4250
4201
|
...e
|
|
4251
4202
|
];
|
|
4252
4203
|
}
|
|
4253
|
-
function
|
|
4204
|
+
function sc(e, t) {
|
|
4254
4205
|
let i = 0, n = !0;
|
|
4255
4206
|
const s = [], r = [];
|
|
4256
4207
|
for (const l of e.properties)
|
|
@@ -4262,18 +4213,18 @@ function gc(e, t) {
|
|
|
4262
4213
|
if (d === "attribute")
|
|
4263
4214
|
return n = !1, i |= m ? Ht : 0, !m && !f;
|
|
4264
4215
|
if (d === "reflect")
|
|
4265
|
-
return i |= m ?
|
|
4216
|
+
return i |= m ? xs : 0, !1;
|
|
4266
4217
|
if (d === "type" && o.isIdentifier(p)) {
|
|
4267
4218
|
if (p.text === "Boolean")
|
|
4268
|
-
return i |=
|
|
4219
|
+
return i |= ks, !1;
|
|
4269
4220
|
if (p.text === "Number")
|
|
4270
|
-
return i |=
|
|
4221
|
+
return i |= As, !1;
|
|
4271
4222
|
} else {
|
|
4272
4223
|
if (d === "state")
|
|
4273
|
-
return n = !1, i |= m ?
|
|
4224
|
+
return n = !1, i |= m ? Is : 0, !1;
|
|
4274
4225
|
if (d === "readOnly")
|
|
4275
|
-
return i |= m ?
|
|
4276
|
-
d === "noAccessor" && (i |= m ?
|
|
4226
|
+
return i |= m ? Ls : 0, !1;
|
|
4227
|
+
d === "noAccessor" && (i |= m ? Fs : 0);
|
|
4277
4228
|
}
|
|
4278
4229
|
return !0;
|
|
4279
4230
|
}
|
|
@@ -4292,7 +4243,7 @@ function gc(e, t) {
|
|
|
4292
4243
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4293
4244
|
]);
|
|
4294
4245
|
}
|
|
4295
|
-
function
|
|
4246
|
+
function rc(e, t, i, n, s) {
|
|
4296
4247
|
let r = -1, a = -1, c = -1;
|
|
4297
4248
|
t.options?.properties.forEach((f, y) => {
|
|
4298
4249
|
if (o.isSpreadAssignment(f))
|
|
@@ -4304,23 +4255,23 @@ function hc(e, t, i, n, s) {
|
|
|
4304
4255
|
g === "type" ? r = y : g === "attribute" ? a = y : g === "readOnly" && (c = y);
|
|
4305
4256
|
}
|
|
4306
4257
|
});
|
|
4307
|
-
const l = s.attribute === void 0 && a === -1, d = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p =
|
|
4258
|
+
const l = s.attribute === void 0 && a === -1, d = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = oc(e, t, i, s, r), m = [
|
|
4308
4259
|
...l ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4309
4260
|
...d ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4310
4261
|
...p !== void 0 ? [p] : []
|
|
4311
4262
|
];
|
|
4312
4263
|
return m.length > 0 ? t.options === void 0 ? o.factory.createObjectLiteralExpression(m, !1) : o.factory.updateObjectLiteralExpression(t.options, [...t.options.properties, ...m]) : t.options;
|
|
4313
4264
|
}
|
|
4314
|
-
function
|
|
4265
|
+
function oc(e, t, i, n, s) {
|
|
4315
4266
|
if (n.attribute === void 0)
|
|
4316
4267
|
return;
|
|
4317
|
-
const r =
|
|
4268
|
+
const r = cc(e), a = i.compiler.viteCommand === "serve" || r !== "Other" ? r : ac(n.type.values);
|
|
4318
4269
|
return a === "Other" || n.readonly && (a !== "Boolean" || !n.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4319
4270
|
o.factory.createIdentifier("type"),
|
|
4320
4271
|
o.factory.createIdentifier(a)
|
|
4321
4272
|
);
|
|
4322
4273
|
}
|
|
4323
|
-
function
|
|
4274
|
+
function ac(e) {
|
|
4324
4275
|
let t = !1, i = !1, n = !1;
|
|
4325
4276
|
if (e?.forEach((s) => {
|
|
4326
4277
|
t ||= s.type === "number", i ||= s.type === "boolean", n ||= s.type === "string" || s.type === "any" || s.type === "unknown";
|
|
@@ -4332,7 +4283,7 @@ function Sc(e) {
|
|
|
4332
4283
|
}
|
|
4333
4284
|
return "Other";
|
|
4334
4285
|
}
|
|
4335
|
-
function
|
|
4286
|
+
function cc(e) {
|
|
4336
4287
|
const t = e.type ?? (o.isSetAccessor(e) ? e.parameters[0].type : void 0);
|
|
4337
4288
|
if (t === void 0) {
|
|
4338
4289
|
if ("initializer" in e && e.initializer !== void 0) {
|
|
@@ -4349,7 +4300,7 @@ function bc(e) {
|
|
|
4349
4300
|
}
|
|
4350
4301
|
return "Other";
|
|
4351
4302
|
}
|
|
4352
|
-
function
|
|
4303
|
+
function lc(e, t, i, n, s) {
|
|
4353
4304
|
if (t.modifiers === void 0)
|
|
4354
4305
|
return t;
|
|
4355
4306
|
let r = -1, a = -1;
|
|
@@ -4359,18 +4310,18 @@ function wc(e, t, i, n, s) {
|
|
|
4359
4310
|
d === "property" && (r = l), d === "state" && (a = l);
|
|
4360
4311
|
}
|
|
4361
4312
|
}), r !== -1) {
|
|
4362
|
-
const c =
|
|
4313
|
+
const c = dc(e, t, i, n), l = Si(t, r, n), d = rc(t, l, e, n, c);
|
|
4363
4314
|
let p = !1;
|
|
4364
|
-
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d,
|
|
4315
|
+
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, bi(t, l, r, p);
|
|
4365
4316
|
} else if (a !== -1) {
|
|
4366
|
-
const c =
|
|
4317
|
+
const c = Si(t, a, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), d = c.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(c.options, [...c.options.properties, l]), p = X(t.name);
|
|
4367
4318
|
if (p === void 0)
|
|
4368
4319
|
throw new Error("Failed to statically determine the state property name");
|
|
4369
|
-
return s.set(p, d),
|
|
4320
|
+
return s.set(p, d), bi(t, c, a, !0);
|
|
4370
4321
|
} else
|
|
4371
4322
|
return t;
|
|
4372
4323
|
}
|
|
4373
|
-
function
|
|
4324
|
+
function dc(e, t, i, n) {
|
|
4374
4325
|
const s = e.apiModule?.declarations.find(
|
|
4375
4326
|
(a) => a.name === i
|
|
4376
4327
|
) ?? (e.compiler.isInTest ? {
|
|
@@ -4378,7 +4329,7 @@ function Tc(e, t, i, n) {
|
|
|
4378
4329
|
} : void 0);
|
|
4379
4330
|
if (s === void 0)
|
|
4380
4331
|
throw Error(`Failed to find API component for ${i} in ${n.fileName}`);
|
|
4381
|
-
const r =
|
|
4332
|
+
const r = sr(s, t) ?? (e.compiler.isInTest ? { kind: "field", attribute: "", readonly: !1, name: "", type: { text: "" } } : void 0);
|
|
4382
4333
|
if (r === void 0 || r.kind !== "field")
|
|
4383
4334
|
throw Error(
|
|
4384
4335
|
`Failed to find API property for ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
@@ -4393,7 +4344,7 @@ function Tc(e, t, i, n) {
|
|
|
4393
4344
|
}
|
|
4394
4345
|
return r;
|
|
4395
4346
|
}
|
|
4396
|
-
function
|
|
4347
|
+
function Si(e, t, i) {
|
|
4397
4348
|
const n = e.modifiers[t], s = n.expression, r = s.arguments.at(0);
|
|
4398
4349
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4399
4350
|
throw new Error(
|
|
@@ -4401,7 +4352,7 @@ function wi(e, t, i) {
|
|
|
4401
4352
|
);
|
|
4402
4353
|
return { decorator: n, callExpression: s, options: r };
|
|
4403
4354
|
}
|
|
4404
|
-
function
|
|
4355
|
+
function bi(e, t, i, n) {
|
|
4405
4356
|
const s = n ? void 0 : o.factory.updateDecorator(
|
|
4406
4357
|
t.decorator,
|
|
4407
4358
|
o.factory.updateCallExpression(
|
|
@@ -4437,23 +4388,23 @@ function Ti(e, t, i, n) {
|
|
|
4437
4388
|
e.initializer
|
|
4438
4389
|
);
|
|
4439
4390
|
}
|
|
4440
|
-
const
|
|
4391
|
+
const pc = (e, t) => {
|
|
4441
4392
|
if (t.apiModule === void 0 && !t.compiler.isInTest)
|
|
4442
4393
|
return e.statements;
|
|
4443
4394
|
let i;
|
|
4444
4395
|
function n() {
|
|
4445
4396
|
i = /* @__PURE__ */ new Map();
|
|
4446
4397
|
}
|
|
4447
|
-
const s = (c) =>
|
|
4398
|
+
const s = (c) => nc(c, i, t.compiler.shouldMinify);
|
|
4448
4399
|
function r(c, l) {
|
|
4449
|
-
const d =
|
|
4400
|
+
const d = mc(t, c, l, e, i);
|
|
4450
4401
|
return t.compiler.viteCommand === "build" && o.setEmitFlags(d, o.EmitFlags.NoComments), d;
|
|
4451
4402
|
}
|
|
4452
4403
|
return e.statements.map(
|
|
4453
|
-
(c) =>
|
|
4404
|
+
(c) => On(r, c, t, n, s)
|
|
4454
4405
|
);
|
|
4455
4406
|
};
|
|
4456
|
-
function
|
|
4407
|
+
function On(e, t, i, n, s = Ji) {
|
|
4457
4408
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4458
4409
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4459
4410
|
let r = !1;
|
|
@@ -4476,15 +4427,15 @@ function Bn(e, t, i, n, s = Bi) {
|
|
|
4476
4427
|
} else
|
|
4477
4428
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4478
4429
|
t,
|
|
4479
|
-
(a) =>
|
|
4430
|
+
(a) => On(e, a, i, n, s),
|
|
4480
4431
|
i.transformation
|
|
4481
4432
|
) : t;
|
|
4482
4433
|
}
|
|
4483
|
-
const
|
|
4484
|
-
function
|
|
4434
|
+
const uc = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4435
|
+
function mc(e, t, i, n, s) {
|
|
4485
4436
|
if (o.isMethodDeclaration(t)) {
|
|
4486
4437
|
const r = t.modifiers?.filter(
|
|
4487
|
-
(a) => !o.isDecorator(a) || !
|
|
4438
|
+
(a) => !o.isDecorator(a) || !fc(a)
|
|
4488
4439
|
);
|
|
4489
4440
|
if (r?.length !== t.modifiers?.length)
|
|
4490
4441
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4498,7 +4449,7 @@ function $c(e, t, i, n, s) {
|
|
|
4498
4449
|
t.type,
|
|
4499
4450
|
t.body
|
|
4500
4451
|
);
|
|
4501
|
-
if ("text" in t.name &&
|
|
4452
|
+
if ("text" in t.name && uc.has(t.name.text) && t.body) {
|
|
4502
4453
|
const a = t.name.text;
|
|
4503
4454
|
return t.body.statements.some(
|
|
4504
4455
|
(l) => o.isExpressionStatement(l) && o.isCallExpression(l.expression) && o.isPropertyAccessExpression(l.expression.expression) && l.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && l.expression.expression.name.text === a
|
|
@@ -4524,16 +4475,16 @@ function $c(e, t, i, n, s) {
|
|
|
4524
4475
|
);
|
|
4525
4476
|
}
|
|
4526
4477
|
}
|
|
4527
|
-
return o.isPropertyDeclaration(t) || o.isAccessor(t) ?
|
|
4478
|
+
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? lc(e, t, i, n, s) : t;
|
|
4528
4479
|
}
|
|
4529
|
-
const
|
|
4480
|
+
const fc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", vt = "@arcgis/core", ct = R(), Ce = vt in (ct.dependencies ?? {}) || vt in (ct.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
4530
4481
|
ct.name === "@arcgis/lumina";
|
|
4531
|
-
async function
|
|
4482
|
+
async function yc(e, t) {
|
|
4532
4483
|
if (!Ce)
|
|
4533
4484
|
return [];
|
|
4534
4485
|
const i = await _e(vt);
|
|
4535
4486
|
if (t === "cdn") {
|
|
4536
|
-
const n = await He(i), s =
|
|
4487
|
+
const n = await He(i), s = qe({ name: "", version: n.version }, !0);
|
|
4537
4488
|
return [
|
|
4538
4489
|
// Use the ESM CDN
|
|
4539
4490
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -4549,22 +4500,22 @@ async function xc(e, t) {
|
|
|
4549
4500
|
})
|
|
4550
4501
|
},
|
|
4551
4502
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
4552
|
-
|
|
4503
|
+
wi(s)
|
|
4553
4504
|
];
|
|
4554
4505
|
} else
|
|
4555
|
-
return [
|
|
4506
|
+
return [wi(It(e, `${i}/assets/`))];
|
|
4556
4507
|
}
|
|
4557
|
-
const
|
|
4508
|
+
const wi = (e) => ({
|
|
4558
4509
|
// Not using join() because it would turn https:// into https:/
|
|
4559
4510
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
4560
4511
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
4561
4512
|
id: "arcgisCoreStylesheet"
|
|
4562
|
-
}),
|
|
4563
|
-
function
|
|
4564
|
-
const i = e.indexOf(
|
|
4513
|
+
}), Ti = "makeRuntime(", gc = "@arcgis/core";
|
|
4514
|
+
function hc(e, t) {
|
|
4515
|
+
const i = e.indexOf(Ti);
|
|
4565
4516
|
if (i === -1)
|
|
4566
4517
|
throw new Error("Failed to find makeRuntime() function call in src/runtime.ts");
|
|
4567
|
-
const n = i +
|
|
4518
|
+
const n = i + Ti.length, s = t.options.css?.commonStylesPath;
|
|
4568
4519
|
return {
|
|
4569
4520
|
code: [
|
|
4570
4521
|
s === void 0 ? "" : `import commonStyles from "${ee(t.dir.src, s)}";`,
|
|
@@ -4572,13 +4523,13 @@ function Ac(e, t) {
|
|
|
4572
4523
|
"{",
|
|
4573
4524
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
4574
4525
|
'hydratedAttribute:"',
|
|
4575
|
-
t.options.css?.hydratedAttribute ??
|
|
4526
|
+
t.options.css?.hydratedAttribute ?? dn,
|
|
4576
4527
|
'",',
|
|
4577
4528
|
s === void 0 ? "" : "commonStyles",
|
|
4578
4529
|
"}",
|
|
4579
4530
|
e.slice(n),
|
|
4580
4531
|
Ce ? `
|
|
4581
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
4532
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${gc}/applications/Components/reactiveUtils.js";
|
|
4582
4533
|
createObservable,
|
|
4583
4534
|
runtime.t = trackAccess;
|
|
4584
4535
|
runtime.o = createObservable;
|
|
@@ -4588,12 +4539,12 @@ runtime.r = runTracked;` : ""
|
|
|
4588
4539
|
map: null
|
|
4589
4540
|
};
|
|
4590
4541
|
}
|
|
4591
|
-
const
|
|
4592
|
-
|
|
4593
|
-
|
|
4594
|
-
|
|
4595
|
-
],
|
|
4596
|
-
name:
|
|
4542
|
+
const vc = [
|
|
4543
|
+
ec,
|
|
4544
|
+
qs,
|
|
4545
|
+
pc
|
|
4546
|
+
], Ei = "@arcgis/lumina:transformComponents", Sc = (e) => ({
|
|
4547
|
+
name: Ei,
|
|
4597
4548
|
transform: {
|
|
4598
4549
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4599
4550
|
order: "pre",
|
|
@@ -4601,20 +4552,20 @@ const Ic = [
|
|
|
4601
4552
|
if (!i.endsWith(".tsx")) {
|
|
4602
4553
|
if (e.isInTest && i.endsWith(".ts") && Et(i) && t.includes("extends LitElement"))
|
|
4603
4554
|
C.warn(
|
|
4604
|
-
|
|
4555
|
+
Ei,
|
|
4605
4556
|
"It looks like you may be trying to define a component inside a test file. This is supported, but you must use the .tsx file extension for you test",
|
|
4606
4557
|
i
|
|
4607
4558
|
);
|
|
4608
4559
|
else if (i === `${e.dir.src}runtime.ts`)
|
|
4609
|
-
return
|
|
4560
|
+
return hc(t, e);
|
|
4610
4561
|
return;
|
|
4611
4562
|
}
|
|
4612
4563
|
const n = e.getSourceFile(i, t);
|
|
4613
4564
|
await ve;
|
|
4614
4565
|
const r = o.transform(n, [
|
|
4615
|
-
(f) => () =>
|
|
4566
|
+
(f) => () => zi(e, f, n, [
|
|
4616
4567
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4617
|
-
...
|
|
4568
|
+
...vc
|
|
4618
4569
|
])
|
|
4619
4570
|
]).transformed[0], a = e._compilerOptionsForPrinter, c = e._typeScriptPrinter, l = a.sourceMap ? me.createSourceMapGenerator(
|
|
4620
4571
|
e.typeScriptHost,
|
|
@@ -4632,7 +4583,7 @@ const Ic = [
|
|
|
4632
4583
|
}
|
|
4633
4584
|
}
|
|
4634
4585
|
});
|
|
4635
|
-
function
|
|
4586
|
+
function bc(e) {
|
|
4636
4587
|
const t = e.typeScriptConfig;
|
|
4637
4588
|
return {
|
|
4638
4589
|
...t,
|
|
@@ -4664,8 +4615,8 @@ function Fc(e) {
|
|
|
4664
4615
|
skipLibCheck: !0
|
|
4665
4616
|
};
|
|
4666
4617
|
}
|
|
4667
|
-
function
|
|
4668
|
-
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t :
|
|
4618
|
+
function wc(e) {
|
|
4619
|
+
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : ps(t ?? "tsconfig.json");
|
|
4669
4620
|
if (i === void 0)
|
|
4670
4621
|
throw Error(
|
|
4671
4622
|
w(
|
|
@@ -4678,7 +4629,7 @@ function Nc(e) {
|
|
|
4678
4629
|
if (n.error !== void 0)
|
|
4679
4630
|
throw Error(
|
|
4680
4631
|
o.formatDiagnosticsWithColorAndContext([n.error], {
|
|
4681
|
-
getCanonicalFileName:
|
|
4632
|
+
getCanonicalFileName: Ji,
|
|
4682
4633
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
4683
4634
|
getNewLine: () => o.sys.newLine
|
|
4684
4635
|
})
|
|
@@ -4691,7 +4642,7 @@ function Nc(e) {
|
|
|
4691
4642
|
}, r = o.parseJsonConfigFileContent(s, o.sys, u.dirname(i));
|
|
4692
4643
|
e.typeScriptConfig = r.options, e.typeScriptConfigPath = i;
|
|
4693
4644
|
}
|
|
4694
|
-
function
|
|
4645
|
+
function Jn(e) {
|
|
4695
4646
|
const t = e.target;
|
|
4696
4647
|
if (t === void 0)
|
|
4697
4648
|
throw Error(
|
|
@@ -4703,7 +4654,7 @@ function Wn(e) {
|
|
|
4703
4654
|
const i = o.ScriptTarget[t].toLowerCase();
|
|
4704
4655
|
return i === "latest" ? "esnext" : i;
|
|
4705
4656
|
}
|
|
4706
|
-
function
|
|
4657
|
+
function Tc(e, t) {
|
|
4707
4658
|
if (e.isInStorybook && e.viteCommand === "serve") {
|
|
4708
4659
|
const i = (a, c, l, ...d) => {
|
|
4709
4660
|
const p = a.filter(
|
|
@@ -4722,17 +4673,17 @@ function Dc(e, t) {
|
|
|
4722
4673
|
l[0] === "timerToUpdateProgram" ? s : c,
|
|
4723
4674
|
...l
|
|
4724
4675
|
), n.afterProgramCreate = (a) => {
|
|
4725
|
-
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new
|
|
4676
|
+
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Ss();
|
|
4726
4677
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4727
4678
|
}
|
|
4728
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter =
|
|
4679
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = bc(e), e._typeScriptPrinter = tn(e._compilerOptionsForPrinter);
|
|
4729
4680
|
}
|
|
4730
|
-
async function
|
|
4681
|
+
async function Ec(e, t, i) {
|
|
4731
4682
|
const n = u.resolve(e.dir.root, t);
|
|
4732
|
-
await U(n) && await
|
|
4683
|
+
await U(n) && await Ts(n, { recursive: !0, force: !0 }), await z(n, { recursive: !0 }), await Es(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4733
4684
|
const s = [
|
|
4734
4685
|
"index.html",
|
|
4735
|
-
...await
|
|
4686
|
+
...await Ds("**/*.html", {
|
|
4736
4687
|
cwd: e.dir.src,
|
|
4737
4688
|
nodir: !0,
|
|
4738
4689
|
posix: !0
|
|
@@ -4756,15 +4707,15 @@ async function jc(e, t, i) {
|
|
|
4756
4707
|
await z(u.dirname(g), { recursive: !0 });
|
|
4757
4708
|
const h = await J(y, "utf-8"), v = ee(u.dirname(f), `build/${i}`), S = `${l}<script type="module" src="${v}"><\/script>
|
|
4758
4709
|
`;
|
|
4759
|
-
let
|
|
4760
|
-
if (
|
|
4710
|
+
let T = h.indexOf("<style>");
|
|
4711
|
+
if (T === -1 && (T = h.indexOf("</head>")), T === -1)
|
|
4761
4712
|
throw Error(w("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
|
|
4762
|
-
const x = h.slice(0,
|
|
4713
|
+
const x = h.slice(0, T) + S + h.slice(T);
|
|
4763
4714
|
await F(g, x, "utf-8");
|
|
4764
4715
|
})
|
|
4765
4716
|
);
|
|
4766
4717
|
}
|
|
4767
|
-
const
|
|
4718
|
+
const Kn = /* @__PURE__ */ new Set([
|
|
4768
4719
|
"chunks",
|
|
4769
4720
|
"components",
|
|
4770
4721
|
"docs",
|
|
@@ -4777,13 +4728,13 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
4777
4728
|
"collection",
|
|
4778
4729
|
"extras",
|
|
4779
4730
|
"support"
|
|
4780
|
-
]), _ = "@arcgis/lumina:buildCdn", Dt = "cdn",
|
|
4781
|
-
function
|
|
4731
|
+
]), _ = "@arcgis/lumina:buildCdn", Dt = "cdn", Wn = "index", we = "main";
|
|
4732
|
+
function Cc(e) {
|
|
4782
4733
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4783
4734
|
if (r) {
|
|
4784
4735
|
if (i.toLowerCase() !== i)
|
|
4785
4736
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
4786
|
-
if (
|
|
4737
|
+
if (Kn.has(i))
|
|
4787
4738
|
throw new Error(
|
|
4788
4739
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
4789
4740
|
);
|
|
@@ -4791,11 +4742,11 @@ function Rc(e) {
|
|
|
4791
4742
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
4792
4743
|
);
|
|
4793
4744
|
}
|
|
4794
|
-
const a = i ??
|
|
4745
|
+
const a = i ?? Wn;
|
|
4795
4746
|
if (e.provideAssets([
|
|
4796
4747
|
{
|
|
4797
4748
|
type: "dynamic",
|
|
4798
|
-
source: () =>
|
|
4749
|
+
source: () => Lo(e),
|
|
4799
4750
|
destination: `../${r ? a : we}.css`
|
|
4800
4751
|
}
|
|
4801
4752
|
]), !t)
|
|
@@ -4804,8 +4755,8 @@ function Rc(e) {
|
|
|
4804
4755
|
async writeBundle() {
|
|
4805
4756
|
if (e.isInStorybook)
|
|
4806
4757
|
return;
|
|
4807
|
-
const c = Ce && R().name !== "@arcgis/embeddable-components", l = Date.now(), d = Array.isArray(n.entryPoints) ? n.entryPoints.map((f) => typeof f == "string" ? { in: f, out: "" } : f) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([f, y]) => ({ in: y, out: f })) : [], p = await
|
|
4808
|
-
await
|
|
4758
|
+
const c = Ce && R().name !== "@arcgis/embeddable-components", l = Date.now(), d = Array.isArray(n.entryPoints) ? n.entryPoints.map((f) => typeof f == "string" ? { in: f, out: "" } : f) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([f, y]) => ({ in: y, out: f })) : [], p = await $c(e, a, n, d, c);
|
|
4759
|
+
await Pc(
|
|
4809
4760
|
p,
|
|
4810
4761
|
e,
|
|
4811
4762
|
r ? `${a}.esm` : a,
|
|
@@ -4813,11 +4764,11 @@ function Rc(e) {
|
|
|
4813
4764
|
c
|
|
4814
4765
|
);
|
|
4815
4766
|
const m = Date.now();
|
|
4816
|
-
C.info(_, `CDN was built in ${m - l}ms`), s && await
|
|
4767
|
+
C.info(_, `CDN was built in ${m - l}ms`), s && await Ec(e, s, `${r ? `${a}.esm` : a}.js`);
|
|
4817
4768
|
}
|
|
4818
4769
|
};
|
|
4819
4770
|
}
|
|
4820
|
-
async function
|
|
4771
|
+
async function $c(e, t, i, n, s) {
|
|
4821
4772
|
const r = e.environment;
|
|
4822
4773
|
if (i.minify && s)
|
|
4823
4774
|
throw Error(
|
|
@@ -4833,7 +4784,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4833
4784
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4834
4785
|
)
|
|
4835
4786
|
);
|
|
4836
|
-
return await
|
|
4787
|
+
return await Ns({
|
|
4837
4788
|
bundle: !0,
|
|
4838
4789
|
minify: s ? !0 : r === "production",
|
|
4839
4790
|
treeShaking: !0,
|
|
@@ -4859,7 +4810,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4859
4810
|
chunkNames: "[hash]",
|
|
4860
4811
|
resolveExtensions: [".js", ".json"],
|
|
4861
4812
|
banner: { js: e.banner },
|
|
4862
|
-
target:
|
|
4813
|
+
target: Jn(e.typeScriptConfig),
|
|
4863
4814
|
...i,
|
|
4864
4815
|
plugins: [
|
|
4865
4816
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
@@ -4904,7 +4855,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4904
4855
|
* The script's file name will be stripped inside defineCustomElements.
|
|
4905
4856
|
**/
|
|
4906
4857
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
4907
|
-
${
|
|
4858
|
+
${pn(e._globalCssString, e)}`,
|
|
4908
4859
|
sourcefile: `${t}.esm.js`,
|
|
4909
4860
|
resolveDir: e.dir.dist,
|
|
4910
4861
|
loader: "js",
|
|
@@ -4912,7 +4863,7 @@ ${fn(e._globalCssString, e)}`,
|
|
|
4912
4863
|
}
|
|
4913
4864
|
});
|
|
4914
4865
|
}
|
|
4915
|
-
async function
|
|
4866
|
+
async function Pc(e, t, i, n, s) {
|
|
4916
4867
|
const r = t.dir.distCdn, a = `${i}.js`, c = new Map(
|
|
4917
4868
|
e.outputFiles.map((l) => {
|
|
4918
4869
|
const d = {
|
|
@@ -4922,12 +4873,12 @@ async function Oc(e, t, i, n, s) {
|
|
|
4922
4873
|
}, p = l.path.slice(r.length);
|
|
4923
4874
|
if (p === "stdin.js") {
|
|
4924
4875
|
if (s) {
|
|
4925
|
-
const f = l.text.match(
|
|
4876
|
+
const f = l.text.match(xc)?.[0];
|
|
4926
4877
|
if (f === void 0)
|
|
4927
4878
|
throw Error(
|
|
4928
4879
|
"Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina"
|
|
4929
4880
|
);
|
|
4930
|
-
d.code = `${d.code.trimEnd()}${
|
|
4881
|
+
d.code = `${d.code.trimEnd()}${kc(f, n)}`, d.isAsync = !1;
|
|
4931
4882
|
}
|
|
4932
4883
|
return [a, d];
|
|
4933
4884
|
}
|
|
@@ -4935,11 +4886,11 @@ async function Oc(e, t, i, n, s) {
|
|
|
4935
4886
|
})
|
|
4936
4887
|
);
|
|
4937
4888
|
s && c.forEach((l, d) => {
|
|
4938
|
-
l.isAsync === void 0 && (d.endsWith(".js") ?
|
|
4889
|
+
l.isAsync === void 0 && (d.endsWith(".js") ? Bn(l, c) : l.isAsync = !1);
|
|
4939
4890
|
}), t.options.build?.cdn?.transformer?.(c, t), await Promise.all(Array.from(c.entries(), async ([l, { code: d }]) => await F(r + l, d)));
|
|
4940
4891
|
}
|
|
4941
|
-
const
|
|
4942
|
-
function
|
|
4892
|
+
const xc = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
4893
|
+
function kc(e, t) {
|
|
4943
4894
|
let i = [
|
|
4944
4895
|
"window.$arcgis",
|
|
4945
4896
|
"||",
|
|
@@ -4968,7 +4919,7 @@ function Kc(e, t) {
|
|
|
4968
4919
|
// Start loading from reactiveUtils the modules we need to enable integration.
|
|
4969
4920
|
// Store the promise on the runtime object so that the lazy loader awaits
|
|
4970
4921
|
// this before beginning hydration.
|
|
4971
|
-
'r.p=a.t(m=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")}',
|
|
4922
|
+
'r.p=a.t(([m])=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")}',
|
|
4972
4923
|
// We use `a` variable as a shorter alias to `$arcgis` to save bytes.
|
|
4973
4924
|
// We pass runtime as an argument rather than access it directly inside the
|
|
4974
4925
|
// closure to avoid possible collisions (in case runtime variable was
|
|
@@ -4980,29 +4931,29 @@ function Kc(e, t) {
|
|
|
4980
4931
|
}
|
|
4981
4932
|
return i += ")", i;
|
|
4982
4933
|
}
|
|
4983
|
-
function
|
|
4934
|
+
function Bn(e, t) {
|
|
4984
4935
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4985
4936
|
let c = 0;
|
|
4986
|
-
const l = e.code.matchAll(
|
|
4937
|
+
const l = e.code.matchAll(Ac);
|
|
4987
4938
|
for (const b of l) {
|
|
4988
|
-
const [
|
|
4939
|
+
const [E, I, N, D, M] = b, H = M.startsWith(Be);
|
|
4989
4940
|
if (c !== 0 && c !== b.index) {
|
|
4990
4941
|
const K = e.code.slice(c, b.index);
|
|
4991
4942
|
s.push(K), a.push([c, K.length, 0, ""]);
|
|
4992
4943
|
}
|
|
4993
|
-
if (c = b.index +
|
|
4994
|
-
a.push([b.index,
|
|
4944
|
+
if (c = b.index + E.length, H)
|
|
4945
|
+
a.push([b.index, E.length, 0, ""]), n.push(`"${Hn(M.slice(Be.length))}"`), i.push(I?.replaceAll(" as ", ":") ?? N ?? D ?? "");
|
|
4995
4946
|
else {
|
|
4996
|
-
const K =
|
|
4997
|
-
if (
|
|
4947
|
+
const K = _n(M, t), G = K?.isAsync === !0;
|
|
4948
|
+
if (I !== void 0) {
|
|
4998
4949
|
const xe = [];
|
|
4999
|
-
for (const
|
|
5000
|
-
const [Ot, Jt = Ot] =
|
|
4950
|
+
for (const Ze of I.slice(1, -1).split(",")) {
|
|
4951
|
+
const [Ot, Jt = Ot] = Ze.split(" as ");
|
|
5001
4952
|
G || r.add(Jt), xe.push(`${Ot}:${Jt}`);
|
|
5002
4953
|
}
|
|
5003
4954
|
if (G) {
|
|
5004
|
-
const
|
|
5005
|
-
a.push([b.index + 6, 0,
|
|
4955
|
+
const Ze = K.oldSingleExportName === void 0 ? `{${xe.join(",")}}` : xe[0].split(":")[1];
|
|
4956
|
+
a.push([b.index + 6, 0, I.length, Ze]);
|
|
5006
4957
|
}
|
|
5007
4958
|
} else if (N === void 0 && D === void 0)
|
|
5008
4959
|
G && a.push([b.index + 6, 0, 0, ""]);
|
|
@@ -5011,7 +4962,7 @@ function Un(e, t) {
|
|
|
5011
4962
|
throw Error(
|
|
5012
4963
|
w(
|
|
5013
4964
|
_,
|
|
5014
|
-
`Expected local import specifiers to use only named or side-effect import syntax. Found ${
|
|
4965
|
+
`Expected local import specifiers to use only named or side-effect import syntax. Found ${E}`
|
|
5015
4966
|
)
|
|
5016
4967
|
);
|
|
5017
4968
|
r.add(D ?? N);
|
|
@@ -5019,96 +4970,96 @@ function Un(e, t) {
|
|
|
5019
4970
|
}
|
|
5020
4971
|
}
|
|
5021
4972
|
if (e.isAsync = a.length > 0, !e.isAsync) {
|
|
5022
|
-
e.code =
|
|
4973
|
+
e.code = Ci(e.code, t);
|
|
5023
4974
|
return;
|
|
5024
4975
|
}
|
|
5025
|
-
const d =
|
|
4976
|
+
const d = Fc(r);
|
|
5026
4977
|
let p = e.code.slice(0, c);
|
|
5027
4978
|
for (let b = a.length - 1; b >= 0; b--) {
|
|
5028
|
-
const [
|
|
5029
|
-
let M =
|
|
5030
|
-
if (
|
|
4979
|
+
const [E, I, N, D] = a[b];
|
|
4980
|
+
let M = I, H = "";
|
|
4981
|
+
if (I === 0) {
|
|
5031
4982
|
const G = d();
|
|
5032
4983
|
n.push(G), H = ` ${G} from`, D !== "" ? (M = N + 4, i.push(D)) : i.push("");
|
|
5033
4984
|
}
|
|
5034
|
-
p = p.slice(0,
|
|
4985
|
+
p = p.slice(0, E) + H + p.slice(E + M);
|
|
5035
4986
|
}
|
|
5036
|
-
const m =
|
|
4987
|
+
const m = Ic.exec(e.code), f = m?.index ?? e.code.length;
|
|
5037
4988
|
let y = "";
|
|
5038
4989
|
if (m !== null) {
|
|
5039
4990
|
const b = m[1].split(",");
|
|
5040
4991
|
if (b.length > 1)
|
|
5041
|
-
y = `return{${b.map((
|
|
5042
|
-
const [
|
|
5043
|
-
return `${N}:${
|
|
4992
|
+
y = `return{${b.map((E) => {
|
|
4993
|
+
const [I, N = I] = E.split(" as ");
|
|
4994
|
+
return `${N}:${I}`;
|
|
5044
4995
|
}).join(",")}}`;
|
|
5045
4996
|
else {
|
|
5046
|
-
const [
|
|
5047
|
-
e.oldSingleExportName =
|
|
4997
|
+
const [E, I = E] = b[0].split(" as ");
|
|
4998
|
+
e.oldSingleExportName = I, y = `return ${E}`;
|
|
5048
4999
|
}
|
|
5049
5000
|
}
|
|
5050
|
-
const g = i.findLastIndex((b) => b.length > 0), h = i.slice(0, g + 1).join(","), S = `export default $arcgis.t(${i.length === 0 ? "_" : `([${h}])`}=>{`,
|
|
5051
|
-
let
|
|
5052
|
-
|
|
5053
|
-
const $ = `${p}${S}${
|
|
5001
|
+
const g = i.findLastIndex((b) => b.length > 0), h = i.slice(0, g + 1).join(","), S = `export default $arcgis.t(${i.length === 0 ? "_" : `([${h}])`}=>{`, T = n.join(","), x = `${y}},${T})`;
|
|
5002
|
+
let L = e.code.slice(c, f);
|
|
5003
|
+
L = `${s.join("")}${L}`, L = Ci(L, t);
|
|
5004
|
+
const $ = `${p}${S}${L}${x}`;
|
|
5054
5005
|
e.code = $;
|
|
5055
5006
|
}
|
|
5056
|
-
const
|
|
5057
|
-
function
|
|
5007
|
+
const Ac = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, Ic = /export\{([^}]+)\};\n$/u, Be = "@arcgis/core/";
|
|
5008
|
+
function _n(e, t) {
|
|
5058
5009
|
if (!e.startsWith("./"))
|
|
5059
5010
|
return;
|
|
5060
5011
|
const i = e.slice(2), n = t.get(i);
|
|
5061
5012
|
if (n === void 0)
|
|
5062
5013
|
throw Error(w(_, `Failed to find the ${e} module`));
|
|
5063
|
-
if (n.isAsync === void 0 &&
|
|
5014
|
+
if (n.isAsync === void 0 && Bn(n, t), n.isAsync === void 0)
|
|
5064
5015
|
throw Error(w(_, `Failed to infer whether the ${e} module has top-level await`));
|
|
5065
5016
|
return n;
|
|
5066
5017
|
}
|
|
5067
|
-
function
|
|
5068
|
-
return e.replaceAll(
|
|
5069
|
-
if (n.startsWith(
|
|
5070
|
-
return `$arcgis.t(m=>m[0],"${
|
|
5018
|
+
function Ci(e, t) {
|
|
5019
|
+
return e.replaceAll(Lc, (i, n) => {
|
|
5020
|
+
if (n.startsWith(Be))
|
|
5021
|
+
return `$arcgis.t(m=>m[0],"${Hn(n.slice(Be.length))}")`;
|
|
5071
5022
|
if (n.startsWith("./")) {
|
|
5072
|
-
const s =
|
|
5023
|
+
const s = _n(n, t);
|
|
5073
5024
|
if (s?.isAsync === !0)
|
|
5074
5025
|
return `${i}.then(m=>m.default${s.oldSingleExportName === void 0 ? "" : `.then(e=>({${s.oldSingleExportName}:e}))`})`;
|
|
5075
5026
|
}
|
|
5076
5027
|
return i;
|
|
5077
5028
|
});
|
|
5078
5029
|
}
|
|
5079
|
-
const
|
|
5080
|
-
function
|
|
5081
|
-
const t = [
|
|
5030
|
+
const Lc = /(?<![.\w\d])import\("([^"]+)"\)/gu, Hn = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
5031
|
+
function Fc(e) {
|
|
5032
|
+
const t = [Un];
|
|
5082
5033
|
return () => {
|
|
5083
5034
|
for (; ; ) {
|
|
5084
|
-
const i =
|
|
5085
|
-
if (
|
|
5035
|
+
const i = jc(t);
|
|
5036
|
+
if (Rc(t), !e.has(i))
|
|
5086
5037
|
return e.add(i), i;
|
|
5087
5038
|
}
|
|
5088
5039
|
};
|
|
5089
5040
|
}
|
|
5090
|
-
const
|
|
5091
|
-
function
|
|
5041
|
+
const Un = 0, jt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", zn = `${jt}0123456789`, Nc = jt.length, Dc = zn.length;
|
|
5042
|
+
function jc(e) {
|
|
5092
5043
|
let t = jt[e[0]];
|
|
5093
5044
|
for (let i = 1; i < e.length; i++)
|
|
5094
|
-
t +=
|
|
5045
|
+
t += zn[e[i]];
|
|
5095
5046
|
return t;
|
|
5096
5047
|
}
|
|
5097
|
-
function
|
|
5048
|
+
function Rc(e) {
|
|
5098
5049
|
let t = e.length - 1;
|
|
5099
5050
|
for (; t >= 0; ) {
|
|
5100
|
-
const i = t === 0 ?
|
|
5051
|
+
const i = t === 0 ? Nc : Dc;
|
|
5101
5052
|
if (e[t] += 1, e[t] >= i)
|
|
5102
5053
|
e[t] = 0, t--;
|
|
5103
5054
|
else
|
|
5104
5055
|
return;
|
|
5105
5056
|
}
|
|
5106
|
-
e = new Array(e.length + 1).fill(
|
|
5057
|
+
e = new Array(e.length + 1).fill(Un);
|
|
5107
5058
|
}
|
|
5108
|
-
async function
|
|
5109
|
-
const s = t.packageName, r = await _e(s), { hasCss: a, cdnName: c } = await
|
|
5059
|
+
async function Mc(e, t, i, n) {
|
|
5060
|
+
const s = t.packageName, r = await _e(s), { hasCss: a, cdnName: c } = await qn(u.join(r, "dist")) ?? {};
|
|
5110
5061
|
if (i === "cdn") {
|
|
5111
|
-
const m = await He(r), f = t.cdnUrl ??
|
|
5062
|
+
const m = await He(r), f = t.cdnUrl ?? qe(m, !0);
|
|
5112
5063
|
return [
|
|
5113
5064
|
...a ? [
|
|
5114
5065
|
{
|
|
@@ -5149,34 +5100,34 @@ async function Vc(e, t, i, n) {
|
|
|
5149
5100
|
}
|
|
5150
5101
|
];
|
|
5151
5102
|
}
|
|
5152
|
-
async function
|
|
5103
|
+
async function qn(e) {
|
|
5153
5104
|
const i = (await Ue(e)).filter(
|
|
5154
|
-
(s) => !
|
|
5105
|
+
(s) => !Kn.has(s) && !s.includes(".")
|
|
5155
5106
|
), n = i.find((s) => s.startsWith("arcgis-"));
|
|
5156
5107
|
return n === void 0 ? await Promise.all(
|
|
5157
|
-
i.map(async (s) => await
|
|
5158
|
-
).then((s) => s.find(j)) : await
|
|
5108
|
+
i.map(async (s) => await $i(e, s))
|
|
5109
|
+
).then((s) => s.find(j)) : await $i(e, n);
|
|
5159
5110
|
}
|
|
5160
|
-
async function
|
|
5111
|
+
async function $i(e, t) {
|
|
5161
5112
|
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), [s, r] = await Promise.all([U(i), U(n)]);
|
|
5162
5113
|
return s || r ? {
|
|
5163
5114
|
hasCss: s,
|
|
5164
5115
|
cdnName: t
|
|
5165
5116
|
} : void 0;
|
|
5166
5117
|
}
|
|
5167
|
-
async function
|
|
5168
|
-
const s = t.packageName, r = await _e(s), a = await He(r), c = await
|
|
5118
|
+
async function Oc(e, t, i, n) {
|
|
5119
|
+
const s = t.packageName, r = await _e(s), a = await He(r), c = await qn(u.join(r, "dist"));
|
|
5169
5120
|
if (i === "cdn") {
|
|
5170
|
-
const y = a.exports?.[`./${we}.css`] === void 0, g = y ? c.cdnName :
|
|
5121
|
+
const y = a.exports?.[`./${we}.css`] === void 0, g = y ? c.cdnName : Wn;
|
|
5171
5122
|
return {
|
|
5172
5123
|
tag: "script",
|
|
5173
5124
|
attrs: {
|
|
5174
5125
|
type: "module",
|
|
5175
|
-
src: `${t.cdnUrl ??
|
|
5126
|
+
src: `${t.cdnUrl ?? qe(a, !0)}${g}${y ? ".esm" : ""}.js`
|
|
5176
5127
|
}
|
|
5177
5128
|
};
|
|
5178
5129
|
}
|
|
5179
|
-
const l = c?.cdnName ?? Dt, d =
|
|
5130
|
+
const l = c?.cdnName ?? Dt, d = Jc(a), p = `${s}/${u.normalize(d)}${Q}`, m = [
|
|
5180
5131
|
`import styles$${n} from "${p}";`,
|
|
5181
5132
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5182
5133
|
], f = `${s}/loader`;
|
|
@@ -5195,7 +5146,7 @@ async function Xc(e, t, i, n) {
|
|
|
5195
5146
|
]
|
|
5196
5147
|
};
|
|
5197
5148
|
}
|
|
5198
|
-
function
|
|
5149
|
+
function Jc(e) {
|
|
5199
5150
|
const { exports: t } = e;
|
|
5200
5151
|
if (t === void 0)
|
|
5201
5152
|
throw new Error(
|
|
@@ -5205,21 +5156,24 @@ function Qc(e) {
|
|
|
5205
5156
|
return n ? n[0] : i.length > 0 ? i[0][0] : `./${we}.css`;
|
|
5206
5157
|
}
|
|
5207
5158
|
async function Te(e) {
|
|
5208
|
-
return e._loadersCache ??=
|
|
5209
|
-
}
|
|
5210
|
-
async function
|
|
5211
|
-
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.viteConfig.base
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
)
|
|
5215
|
-
|
|
5159
|
+
return e._loadersCache ??= Kc(e), await e._loadersCache;
|
|
5160
|
+
}
|
|
5161
|
+
async function Kc(e) {
|
|
5162
|
+
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.viteConfig.base;
|
|
5163
|
+
let n = 0;
|
|
5164
|
+
const s = async (l) => (await Promise.all(
|
|
5165
|
+
l.map(async (d) => {
|
|
5166
|
+
const p = n++;
|
|
5167
|
+
return d.type === "stencil" ? await Mc(i, d, t, p) : d.type === "@arcgis/lumina" ? await Oc(i, d, t, p) : void 0;
|
|
5168
|
+
})
|
|
5169
|
+
)).filter(j).flat(), r = await Promise.all([
|
|
5216
5170
|
// This may contain an import map so must be first
|
|
5217
|
-
|
|
5218
|
-
ve.then(
|
|
5219
|
-
|
|
5220
|
-
]),
|
|
5171
|
+
yc(i, t),
|
|
5172
|
+
ve.then(s),
|
|
5173
|
+
Gn(e).then(s)
|
|
5174
|
+
]), a = u.join(e.dir.src, "loader.ts");
|
|
5221
5175
|
return [
|
|
5222
|
-
...
|
|
5176
|
+
...r.flat(),
|
|
5223
5177
|
{
|
|
5224
5178
|
optimizableImports: [
|
|
5225
5179
|
/**
|
|
@@ -5228,18 +5182,18 @@ async function Zc(e) {
|
|
|
5228
5182
|
*/
|
|
5229
5183
|
],
|
|
5230
5184
|
javascriptCode: [
|
|
5231
|
-
`import { defineCustomElements } from "${
|
|
5185
|
+
`import { defineCustomElements } from "${a}";`,
|
|
5232
5186
|
"globalThis.devOnly$ownTagNames = new Set();",
|
|
5233
5187
|
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? Dt}/"}` : ""});`
|
|
5234
5188
|
]
|
|
5235
5189
|
}
|
|
5236
5190
|
];
|
|
5237
5191
|
}
|
|
5238
|
-
async function
|
|
5192
|
+
async function Gn(e) {
|
|
5239
5193
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
5240
5194
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
5241
5195
|
t.map(async (i) => {
|
|
5242
|
-
const n = typeof i == "string" ? i : i.name, s = await
|
|
5196
|
+
const n = typeof i == "string" ? i : i.name, s = await hn(n);
|
|
5243
5197
|
if (s === void 0)
|
|
5244
5198
|
throw Error(
|
|
5245
5199
|
w(
|
|
@@ -5254,10 +5208,10 @@ async function Qn(e) {
|
|
|
5254
5208
|
})
|
|
5255
5209
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
5256
5210
|
}
|
|
5257
|
-
const
|
|
5258
|
-
async function
|
|
5211
|
+
const Vn = "/@arcgis/lumina-compiler/testSetupFile", lt = [Vn];
|
|
5212
|
+
async function Wc(e) {
|
|
5259
5213
|
if (!e.viteConfig.test?.browser?.enabled)
|
|
5260
|
-
return
|
|
5214
|
+
return Pi(e);
|
|
5261
5215
|
const i = (await Te(e)).map((n, s) => {
|
|
5262
5216
|
if ("javascriptCode" in n)
|
|
5263
5217
|
return n.javascriptCode.join(`
|
|
@@ -5281,14 +5235,14 @@ async function Yc(e) {
|
|
|
5281
5235
|
}).join(`
|
|
5282
5236
|
|
|
5283
5237
|
`);
|
|
5284
|
-
return [
|
|
5238
|
+
return [Pi(e), i].join("");
|
|
5285
5239
|
}
|
|
5286
|
-
const
|
|
5240
|
+
const Pi = (e) => [e.isInPuppeteerTestBackEnd ? Bc : "", _c].join(""), Bc = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
5287
5241
|
setupPuppeteerTest();
|
|
5288
|
-
`,
|
|
5242
|
+
`, _c = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
5289
5243
|
setupLuminaTest();
|
|
5290
5244
|
`;
|
|
5291
|
-
function
|
|
5245
|
+
function Hc(e) {
|
|
5292
5246
|
let t = !0, i = !1, n, s, r, a, c;
|
|
5293
5247
|
const l = "@arcgis/lumina:generateVirtualFiles", d = {
|
|
5294
5248
|
name: l,
|
|
@@ -5298,20 +5252,20 @@ function il(e) {
|
|
|
5298
5252
|
},
|
|
5299
5253
|
resolveId: (g) => g === a || g === c ? a : void 0,
|
|
5300
5254
|
async load(g) {
|
|
5301
|
-
const h = g.startsWith(
|
|
5255
|
+
const h = g.startsWith(Vn);
|
|
5302
5256
|
if (!(!g.endsWith(".tsx") && g !== a && !h)) {
|
|
5303
5257
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5304
|
-
r === void 0 && clearTimeout(n), r ??=
|
|
5258
|
+
r === void 0 && clearTimeout(n), r ??= _o(e, t).catch((S) => {
|
|
5305
5259
|
throw i = !0, S;
|
|
5306
5260
|
}), t = !1;
|
|
5307
5261
|
const v = await r;
|
|
5308
5262
|
s ??= v;
|
|
5309
5263
|
}
|
|
5310
|
-
return g === a ?
|
|
5264
|
+
return g === a ? Fo(e) : h ? await Wc(e) : void 0;
|
|
5311
5265
|
}
|
|
5312
5266
|
},
|
|
5313
5267
|
async writeBundle() {
|
|
5314
|
-
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"),
|
|
5268
|
+
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"), No);
|
|
5315
5269
|
},
|
|
5316
5270
|
async handleHotUpdate({ file: g, modules: h, read: v }) {
|
|
5317
5271
|
const S = await p(g, v);
|
|
@@ -5334,7 +5288,7 @@ function il(e) {
|
|
|
5334
5288
|
(S) => S.length > 0 ? m() : void 0
|
|
5335
5289
|
) : void 0
|
|
5336
5290
|
), g.watcher.on("unlinkDir", (v) => {
|
|
5337
|
-
e.componentFiles.some((
|
|
5291
|
+
e.componentFiles.some((T) => T.startsWith(v)) && m();
|
|
5338
5292
|
});
|
|
5339
5293
|
function h(v) {
|
|
5340
5294
|
he(v, e.dir.srcComponents) && m();
|
|
@@ -5359,29 +5313,29 @@ function il(e) {
|
|
|
5359
5313
|
if (x === void 0)
|
|
5360
5314
|
return;
|
|
5361
5315
|
if (!(x.text === v)) {
|
|
5362
|
-
let
|
|
5316
|
+
let E;
|
|
5363
5317
|
await Promise.race([
|
|
5364
5318
|
e._typeScriptReload.promise,
|
|
5365
|
-
new Promise((
|
|
5366
|
-
|
|
5319
|
+
new Promise((I) => {
|
|
5320
|
+
E = setTimeout(() => {
|
|
5367
5321
|
C.info(
|
|
5368
5322
|
l,
|
|
5369
5323
|
"Timed out waiting for TypeScript to finish type-checking. This may be a bug"
|
|
5370
|
-
),
|
|
5324
|
+
), I(void 0);
|
|
5371
5325
|
}, 1e4);
|
|
5372
5326
|
})
|
|
5373
|
-
]), clearTimeout(
|
|
5327
|
+
]), clearTimeout(E);
|
|
5374
5328
|
}
|
|
5375
5329
|
}
|
|
5376
5330
|
if (!he(g, e.dir.srcComponents))
|
|
5377
5331
|
return;
|
|
5378
5332
|
v ??= await h();
|
|
5379
|
-
const
|
|
5380
|
-
if (
|
|
5333
|
+
const T = Ho(e, g, v);
|
|
5334
|
+
if (T === void 0)
|
|
5381
5335
|
return !1;
|
|
5382
|
-
for (const x of
|
|
5383
|
-
const
|
|
5384
|
-
e.server.ws.send({ type: "custom", event: "component-meta-update", data:
|
|
5336
|
+
for (const x of T) {
|
|
5337
|
+
const L = un(x);
|
|
5338
|
+
e.server.ws.send({ type: "custom", event: "component-meta-update", data: L });
|
|
5385
5339
|
}
|
|
5386
5340
|
return f(), !0;
|
|
5387
5341
|
}
|
|
@@ -5404,12 +5358,12 @@ function fe(e, t, i = Rt) {
|
|
|
5404
5358
|
throw Error(w(St, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5405
5359
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5406
5360
|
if (t.forEach((r) => {
|
|
5407
|
-
const a =
|
|
5361
|
+
const a = Qn(r), c = Yn(e.dir, Zn(a)), l = zc(e.viteConfig.base, c, e.dir.distCdn);
|
|
5408
5362
|
e.server.middlewares.use(l, (d, p, m) => {
|
|
5409
|
-
const f =
|
|
5363
|
+
const f = qc(d.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, g = u.join(c, f), h = i.find((v) => v.match(g, e));
|
|
5410
5364
|
return (typeof y == "function" ? Promise.resolve(y()) : J(y)).then((v) => {
|
|
5411
5365
|
const S = (typeof y == "function" ? void 0 : h?.transform(v.toString("utf8"), g, e)) ?? v;
|
|
5412
|
-
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type",
|
|
5366
|
+
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", js.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
5413
5367
|
}).catch((v) => {
|
|
5414
5368
|
(a.type !== "directory" || process.env.DEBUG) && C.warn(
|
|
5415
5369
|
St,
|
|
@@ -5422,22 +5376,22 @@ function fe(e, t, i = Rt) {
|
|
|
5422
5376
|
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
5423
5377
|
}
|
|
5424
5378
|
}
|
|
5425
|
-
async function
|
|
5379
|
+
async function Xn(e, t, i = Rt) {
|
|
5426
5380
|
await Promise.all(
|
|
5427
5381
|
t.map(async (n) => {
|
|
5428
|
-
const s =
|
|
5382
|
+
const s = Qn(n), r = Yn(e.dir, Zn(s));
|
|
5429
5383
|
if (s.type === "directory") {
|
|
5430
5384
|
const a = u.resolve(s.source), l = (await Ue(a, { recursive: !0, withFileTypes: !0 })).filter((d) => d.isFile()).map((d) => {
|
|
5431
5385
|
const p = u.resolve(d.parentPath, d.name), m = u.relative(a, p), f = u.join(r, m);
|
|
5432
5386
|
return [p, f];
|
|
5433
5387
|
});
|
|
5434
|
-
await
|
|
5388
|
+
await ts(l.map(([d, p]) => p)), await Promise.all(
|
|
5435
5389
|
l.map(
|
|
5436
|
-
async ([d, p]) => await
|
|
5390
|
+
async ([d, p]) => await xi(d, p, i, e)
|
|
5437
5391
|
)
|
|
5438
5392
|
);
|
|
5439
5393
|
} else if (s.type === "file")
|
|
5440
|
-
await z(u.dirname(r), { recursive: !0 }), await
|
|
5394
|
+
await z(u.dirname(r), { recursive: !0 }), await xi(s.source, r, i, e);
|
|
5441
5395
|
else if (s.type === "dynamic") {
|
|
5442
5396
|
await z(u.dirname(r), { recursive: !0 });
|
|
5443
5397
|
const a = await Promise.resolve(s.source());
|
|
@@ -5446,7 +5400,7 @@ async function Yn(e, t, i = Rt) {
|
|
|
5446
5400
|
})
|
|
5447
5401
|
);
|
|
5448
5402
|
}
|
|
5449
|
-
const
|
|
5403
|
+
const Qn = Ri ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5450
5404
|
...e,
|
|
5451
5405
|
destination: Le(e.destination)
|
|
5452
5406
|
} : {
|
|
@@ -5454,16 +5408,16 @@ const es = Oi ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
5454
5408
|
source: Le(e.source),
|
|
5455
5409
|
destination: Le(e.destination)
|
|
5456
5410
|
};
|
|
5457
|
-
async function
|
|
5411
|
+
async function xi(e, t, i, n) {
|
|
5458
5412
|
const s = i.find((r) => r.match(t, n));
|
|
5459
5413
|
if (s === void 0)
|
|
5460
|
-
await
|
|
5414
|
+
await Cs(e, t);
|
|
5461
5415
|
else {
|
|
5462
5416
|
const r = await J(e, "utf8"), a = s.transform(r, t, n);
|
|
5463
5417
|
await F(t, a);
|
|
5464
5418
|
}
|
|
5465
5419
|
}
|
|
5466
|
-
function
|
|
5420
|
+
function Zn(e) {
|
|
5467
5421
|
if (e.type === "dynamic")
|
|
5468
5422
|
return e.destination;
|
|
5469
5423
|
if (e.source.endsWith(u.sep)) {
|
|
@@ -5478,34 +5432,34 @@ function ts(e) {
|
|
|
5478
5432
|
}
|
|
5479
5433
|
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;
|
|
5480
5434
|
}
|
|
5481
|
-
function
|
|
5482
|
-
const n =
|
|
5435
|
+
function Yn({ dist: e, distCdnAssets: t }, i) {
|
|
5436
|
+
const n = Uc(i), s = u.join(
|
|
5483
5437
|
t,
|
|
5484
5438
|
n ? u.relative(t, i) : i
|
|
5485
|
-
), r = u.relative(e, s), a =
|
|
5439
|
+
), r = u.relative(e, s), a = es(r);
|
|
5486
5440
|
return u.join(e, a);
|
|
5487
5441
|
}
|
|
5488
|
-
function
|
|
5442
|
+
function Uc(e) {
|
|
5489
5443
|
if (e.startsWith(u.sep)) {
|
|
5490
|
-
const t =
|
|
5444
|
+
const t = Mi(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5491
5445
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5492
5446
|
} else
|
|
5493
|
-
return !!(!
|
|
5447
|
+
return !!(!Ri && u.isAbsolute(e));
|
|
5494
5448
|
}
|
|
5495
|
-
function
|
|
5496
|
-
const n =
|
|
5449
|
+
function zc(e, t, i) {
|
|
5450
|
+
const n = es(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
5497
5451
|
return `${e}${s}`;
|
|
5498
5452
|
}
|
|
5499
|
-
const
|
|
5500
|
-
async function
|
|
5453
|
+
const es = (e) => e.replaceAll("../", ""), qc = (e = "") => e.split("?")[0].split("#")[0];
|
|
5454
|
+
async function ts(e) {
|
|
5501
5455
|
const t = new Set(e.map(u.dirname));
|
|
5502
5456
|
await Promise.all(Array.from(t, async (i) => await z(i, { recursive: !0 })));
|
|
5503
5457
|
}
|
|
5504
|
-
const
|
|
5458
|
+
const Gc = {
|
|
5505
5459
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5506
5460
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5507
|
-
}, Rt = [
|
|
5508
|
-
function
|
|
5461
|
+
}, Rt = [Gc];
|
|
5462
|
+
function Vc(e) {
|
|
5509
5463
|
let t;
|
|
5510
5464
|
const i = () => [
|
|
5511
5465
|
...e.options.assets?.transformers ?? [],
|
|
@@ -5514,36 +5468,36 @@ function al(e) {
|
|
|
5514
5468
|
return {
|
|
5515
5469
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
5516
5470
|
configResolved() {
|
|
5517
|
-
t =
|
|
5471
|
+
t = Xc(e);
|
|
5518
5472
|
},
|
|
5519
5473
|
async configureServer(n) {
|
|
5520
5474
|
e.server = n, !e.isInPuppeteerTestBackEnd && (fe(e, await t, i()), n.watcher.on("addDir", (s) => {
|
|
5521
5475
|
if (s.endsWith("assets")) {
|
|
5522
5476
|
const r = u.dirname(s);
|
|
5523
|
-
u.join(r, "/") === e.dir.root ? fe(e, [
|
|
5477
|
+
u.join(r, "/") === e.dir.root ? fe(e, [ns], i()) : s.startsWith(e.dir.srcComponents) && fe(e, [is(s, r)], i());
|
|
5524
5478
|
}
|
|
5525
5479
|
}));
|
|
5526
5480
|
},
|
|
5527
5481
|
async writeBundle() {
|
|
5528
|
-
await
|
|
5482
|
+
await Xn(e, await t, i());
|
|
5529
5483
|
}
|
|
5530
5484
|
};
|
|
5531
5485
|
}
|
|
5532
|
-
async function
|
|
5486
|
+
async function Xc(e) {
|
|
5533
5487
|
const t = U("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5534
5488
|
i.map(async (s) => {
|
|
5535
5489
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
5536
|
-
return await U(a) ?
|
|
5490
|
+
return await U(a) ? is(a, r) : void 0;
|
|
5537
5491
|
})
|
|
5538
5492
|
);
|
|
5539
|
-
return await t && n.push(
|
|
5493
|
+
return await t && n.push(ns), n.filter(j);
|
|
5540
5494
|
}
|
|
5541
|
-
const
|
|
5495
|
+
const is = (e, t) => ({
|
|
5542
5496
|
type: "directory",
|
|
5543
5497
|
source: e,
|
|
5544
5498
|
destination: u.basename(t)
|
|
5545
|
-
}),
|
|
5546
|
-
function
|
|
5499
|
+
}), ns = { type: "directory", source: "assets/", destination: "" };
|
|
5500
|
+
function Qc(e) {
|
|
5547
5501
|
const { stencilCompatibility: t } = e.options.build?.ssr ?? {};
|
|
5548
5502
|
if (t?.enabled === !0)
|
|
5549
5503
|
return {
|
|
@@ -5595,7 +5549,7 @@ export * from "@arcgis/lumina/stencilSsrCompatibility";`;
|
|
|
5595
5549
|
}
|
|
5596
5550
|
};
|
|
5597
5551
|
}
|
|
5598
|
-
const dt = "@arcgis/lumina:printTotalBuildSize",
|
|
5552
|
+
const dt = "@arcgis/lumina:printTotalBuildSize", Zc = (e) => ({
|
|
5599
5553
|
name: dt,
|
|
5600
5554
|
apply: () => e.viteCommand === "build",
|
|
5601
5555
|
configResolved(t) {
|
|
@@ -5612,10 +5566,10 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5612
5566
|
const m = console.log;
|
|
5613
5567
|
console.log = function(...y) {
|
|
5614
5568
|
if (m.apply(console, y), y.length === 1 && typeof y[0] == "string") {
|
|
5615
|
-
const [g, h] = y[0].match(
|
|
5569
|
+
const [g, h] = y[0].match(el) ?? [];
|
|
5616
5570
|
if (!g)
|
|
5617
5571
|
return;
|
|
5618
|
-
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(
|
|
5572
|
+
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(tl, "").length);
|
|
5619
5573
|
const v = Number.parseFloat(g.replace(" kB", "").replaceAll(",", ""));
|
|
5620
5574
|
h ? (d += Number.parseFloat(h.replace(" kB", "").replaceAll(",", "")), l += v) : c += v;
|
|
5621
5575
|
}
|
|
@@ -5626,27 +5580,27 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5626
5580
|
console.log = m;
|
|
5627
5581
|
}
|
|
5628
5582
|
if (l > 0) {
|
|
5629
|
-
const y = d > 0 ? l : c, g =
|
|
5583
|
+
const y = d > 0 ? l : c, g = Ii(y), h = e.dir.relativeDist;
|
|
5630
5584
|
console.log(
|
|
5631
5585
|
[
|
|
5632
|
-
|
|
5586
|
+
Ai,
|
|
5633
5587
|
h,
|
|
5634
|
-
|
|
5588
|
+
Yc,
|
|
5635
5589
|
"*",
|
|
5636
5590
|
" ".repeat(p - `${h}*`.length - g.length),
|
|
5637
5591
|
g,
|
|
5638
|
-
|
|
5639
|
-
d > 0 ? ` ${
|
|
5592
|
+
ki,
|
|
5593
|
+
d > 0 ? ` ${Ai}│ gzip: ${Ii(d)}${ki}` : ""
|
|
5640
5594
|
].join("")
|
|
5641
5595
|
);
|
|
5642
5596
|
}
|
|
5643
5597
|
};
|
|
5644
5598
|
}
|
|
5645
|
-
}),
|
|
5599
|
+
}), ki = "\x1B[22m\x1B[1m\x1B[22m", Ai = "\x1B[2m", Yc = "\x1B[22m\x1B[36m", el = /\d+(?:,\d+)?\.\d{2} kB/gu, tl = /\x1B\[\d+m/gu, il = new Intl.NumberFormat("en", {
|
|
5646
5600
|
maximumFractionDigits: 2,
|
|
5647
5601
|
minimumFractionDigits: 2
|
|
5648
|
-
}),
|
|
5649
|
-
name:
|
|
5602
|
+
}), Ii = (e) => `${il.format(e)} kB`, Li = "@arcgis/lumina:configureVite", nl = (e) => ({
|
|
5603
|
+
name: Li,
|
|
5650
5604
|
async config({
|
|
5651
5605
|
server: t,
|
|
5652
5606
|
publicDir: i,
|
|
@@ -5662,10 +5616,10 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5662
5616
|
*/
|
|
5663
5617
|
loader: "src/loader.ts",
|
|
5664
5618
|
// Entrypoint for bundling used components only:
|
|
5665
|
-
...await
|
|
5619
|
+
...await Kr(e)
|
|
5666
5620
|
}, { loader: g, ...h } = y, v = e.environment === "development" || e.isInTest ? {
|
|
5667
5621
|
"process.env.ESRI_INTERNAL": "true"
|
|
5668
|
-
} : void 0, S = !import.meta.url.includes("node_modules"),
|
|
5622
|
+
} : void 0, S = !import.meta.url.includes("node_modules"), T = {
|
|
5669
5623
|
/**
|
|
5670
5624
|
* Dependency pre-bundling by default scouts all index.html files to find
|
|
5671
5625
|
* what dependencies are used. Since Lumina adds imports to index.html
|
|
@@ -5711,19 +5665,21 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5711
5665
|
* used by a package from outside the monorepo (eg @arcgis/lumina is used
|
|
5712
5666
|
* inside the package, and by Calcite outside the package).
|
|
5713
5667
|
*/
|
|
5714
|
-
exclude:
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5668
|
+
exclude: [
|
|
5669
|
+
...S ? [
|
|
5670
|
+
"@arcgis/lumina",
|
|
5671
|
+
"@arcgis/components-controllers",
|
|
5672
|
+
"@arcgis/components-utils",
|
|
5673
|
+
"@arcgis/core-adapter",
|
|
5674
|
+
"@arcgis/map-components",
|
|
5675
|
+
"@arcgis/common-components",
|
|
5676
|
+
"@arcgis/charts-components",
|
|
5677
|
+
"@arcgis/embeddable-components",
|
|
5678
|
+
"@arcgis/imagery-components",
|
|
5679
|
+
"@arcgis/map-config-components",
|
|
5680
|
+
"@arcgis/portal-components"
|
|
5681
|
+
] : [],
|
|
5682
|
+
// By excluding Lumina above, we also disable discovery of packages
|
|
5727
5683
|
// used by it (Lit), which are then discovered at runtime and cause
|
|
5728
5684
|
// dev-server reload. We could manually include all Lit packages,
|
|
5729
5685
|
// but because Lit has so many entry points and barrel files,
|
|
@@ -5731,6 +5687,12 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5731
5687
|
// rather than decrease them (620 vs 621)), defeating the point of
|
|
5732
5688
|
// dependency optimization. Add to it that debugging is easier for
|
|
5733
5689
|
// non-optimized dependencies, so we exclude it.
|
|
5690
|
+
//
|
|
5691
|
+
// For users outside the monorepo, we choose to exclude Lit for similar
|
|
5692
|
+
// reasons - the benefits of pre-bundling are nil. Otherwise, we would
|
|
5693
|
+
// have to explicitly include the Lit imports that are added dynamically
|
|
5694
|
+
// by the JSX to lit-html transformation
|
|
5695
|
+
//
|
|
5734
5696
|
// Even though lit/ is a barrel package, we still need to explicitly
|
|
5735
5697
|
// exclude the sub-packages to prevent them from being optimized at
|
|
5736
5698
|
// runtime.
|
|
@@ -5739,12 +5701,12 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5739
5701
|
"lit-element",
|
|
5740
5702
|
"@lit/reactive-element",
|
|
5741
5703
|
"@lit/context"
|
|
5742
|
-
]
|
|
5704
|
+
]
|
|
5743
5705
|
};
|
|
5744
5706
|
if (typeof l.setupFiles == "string" ? l.setupFiles = [...lt, l.setupFiles] : Array.isArray(l.setupFiles) ? l.setupFiles = [...lt, ...l.setupFiles] : l.setupFiles = [...lt], e.isInPuppeteerTestBackEnd) {
|
|
5745
5707
|
if (p?.enabled === !0)
|
|
5746
5708
|
throw Error(
|
|
5747
|
-
w(
|
|
5709
|
+
w(Li, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5748
5710
|
);
|
|
5749
5711
|
return {
|
|
5750
5712
|
test: {
|
|
@@ -5766,7 +5728,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5766
5728
|
*/
|
|
5767
5729
|
forceRerunTriggers: f === void 0 ? ["**/*.{ts,tsx}"] : void 0
|
|
5768
5730
|
},
|
|
5769
|
-
optimizeDeps:
|
|
5731
|
+
optimizeDeps: T,
|
|
5770
5732
|
define: v
|
|
5771
5733
|
};
|
|
5772
5734
|
}
|
|
@@ -5778,7 +5740,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5778
5740
|
publicDir: i ?? !1,
|
|
5779
5741
|
build: {
|
|
5780
5742
|
cssMinify: n ?? (e.environment === "production" ? !0 : void 0),
|
|
5781
|
-
target: s ??
|
|
5743
|
+
target: s ?? Jn(e.typeScriptConfig),
|
|
5782
5744
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
5783
5745
|
lib: {
|
|
5784
5746
|
entry: y,
|
|
@@ -5796,7 +5758,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5796
5758
|
}
|
|
5797
5759
|
}
|
|
5798
5760
|
},
|
|
5799
|
-
optimizeDeps:
|
|
5761
|
+
optimizeDeps: T,
|
|
5800
5762
|
define: v,
|
|
5801
5763
|
test: {
|
|
5802
5764
|
/*
|
|
@@ -5807,23 +5769,23 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5807
5769
|
browser: {
|
|
5808
5770
|
enabled: e.isInPuppeteerTestFrontEnd ? !1 : p?.enabled ?? !0,
|
|
5809
5771
|
instances: p?.instances === void 0 ? [{ browser: "chromium" }] : void 0,
|
|
5810
|
-
provider: p?.provider ??
|
|
5772
|
+
provider: p?.provider ?? Os
|
|
5811
5773
|
}
|
|
5812
5774
|
}
|
|
5813
5775
|
};
|
|
5814
5776
|
}
|
|
5815
|
-
}),
|
|
5777
|
+
}), sl = (e) => ({
|
|
5816
5778
|
name: "@arcgis/lumina:setAssetPath",
|
|
5817
5779
|
apply: () => e.viteCommand === "build",
|
|
5818
5780
|
config: (t) => ({
|
|
5819
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
5781
|
+
base: t.base ?? e.options.assets?.defaultPath ?? qe()
|
|
5820
5782
|
})
|
|
5821
5783
|
});
|
|
5822
|
-
function
|
|
5784
|
+
function rl(e = R()) {
|
|
5823
5785
|
const t = e.version ?? "0.0.1";
|
|
5824
|
-
return
|
|
5786
|
+
return bs(t);
|
|
5825
5787
|
}
|
|
5826
|
-
const
|
|
5788
|
+
const ol = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
5827
5789
|
Object.defineProperty(t, i, {
|
|
5828
5790
|
get() {
|
|
5829
5791
|
throw Error(
|
|
@@ -5862,12 +5824,13 @@ const pe = {
|
|
|
5862
5824
|
apiJson: "docs/api.json",
|
|
5863
5825
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5864
5826
|
};
|
|
5865
|
-
async function
|
|
5866
|
-
const r =
|
|
5867
|
-
if (l
|
|
5827
|
+
async function ss(e, t, i, n, s = R()) {
|
|
5828
|
+
const r = al(e, i, n, s), a = u.join(t, "lumina.ts"), l = await U(a) ? await J(a, "utf8") : "";
|
|
5829
|
+
if (l.trim().replaceAll(`\r
|
|
5830
|
+
`, `
|
|
5831
|
+
`) === r.trim())
|
|
5868
5832
|
return !1;
|
|
5869
|
-
if (process.env.CI)
|
|
5870
|
-
const d = (p) => Array.from(p, (m) => m.codePointAt(0).toString(16).padStart(4, "0")).join(",");
|
|
5833
|
+
if (process.env.CI)
|
|
5871
5834
|
throw Error(
|
|
5872
5835
|
w(
|
|
5873
5836
|
"@arcgis/lumina:updateLuminaTs",
|
|
@@ -5877,15 +5840,12 @@ ${r}
|
|
|
5877
5840
|
|
|
5878
5841
|
Current content:
|
|
5879
5842
|
|
|
5880
|
-
${l}
|
|
5881
|
-
Hex new content: ${d(r)}
|
|
5882
|
-
Hex current content: ${d(l)}`
|
|
5843
|
+
${l}`
|
|
5883
5844
|
)
|
|
5884
5845
|
);
|
|
5885
|
-
|
|
5886
|
-
return Wi(a, r), !0;
|
|
5846
|
+
return Ki(a, r), !0;
|
|
5887
5847
|
}
|
|
5888
|
-
function
|
|
5848
|
+
function al(e, t, i, n = R()) {
|
|
5889
5849
|
"@arcgis/components-controllers" in (n.dependencies ?? {}) && C.warn(
|
|
5890
5850
|
"@arcgis/components-controllers",
|
|
5891
5851
|
"Deprecation warning: the @arcgis/components-controllers package was merged into @arcgis/lumina. Please remove it from your package.json and rewrite code to import from @arcgis/lumina/controllers and @arcgis/lumina/controllers/accessor instead."
|
|
@@ -5900,11 +5860,11 @@ declare module "@arcgis/lumina" {
|
|
|
5900
5860
|
interface ImportStencilElements extends ${r.map((m, f) => `JSX$${f}.IntrinsicElements`).join(", ")} {}
|
|
5901
5861
|
}`, l = n.devDependencies ?? {}, d = i === "preview" ? "matchers" : i === "webdriverio" ? "webdriverio" : "playwright";
|
|
5902
5862
|
return [
|
|
5903
|
-
|
|
5863
|
+
cl,
|
|
5904
5864
|
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5905
5865
|
n.name === "@arcgis/lumina" ? "" : `
|
|
5906
5866
|
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5907
|
-
t ?
|
|
5867
|
+
t ? ll : "",
|
|
5908
5868
|
l.vitest ? `
|
|
5909
5869
|
/// <reference types="vitest/config" />` : "",
|
|
5910
5870
|
l["@vitest/browser"] ? `
|
|
@@ -5918,7 +5878,7 @@ declare module "@arcgis/lumina" {
|
|
|
5918
5878
|
`
|
|
5919
5879
|
].join("");
|
|
5920
5880
|
}
|
|
5921
|
-
const
|
|
5881
|
+
const cl = `/**
|
|
5922
5882
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5923
5883
|
* Manual edits will be overwritten.
|
|
5924
5884
|
*
|
|
@@ -5926,8 +5886,8 @@ const bl = `/**
|
|
|
5926
5886
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5927
5887
|
*
|
|
5928
5888
|
* If you need to provide additional typings, create a separate file.
|
|
5929
|
-
*/`,
|
|
5930
|
-
/// <reference types="@arcgis/core/interfaces" />`, je = "@arcgis/lumina:dependencySupport",
|
|
5889
|
+
*/`, ll = `
|
|
5890
|
+
/// <reference types="@arcgis/core/interfaces" />`, je = "@arcgis/lumina:dependencySupport", rs = (e, t) => e.viteCommand === "serve" && /**
|
|
5931
5891
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5932
5892
|
* However, it is a bit buggy (see
|
|
5933
5893
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5938,10 +5898,10 @@ const bl = `/**
|
|
|
5938
5898
|
* is doing:
|
|
5939
5899
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5940
5900
|
*/
|
|
5941
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
5901
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, dl = (e) => ({
|
|
5942
5902
|
name: je,
|
|
5943
5903
|
configResolved() {
|
|
5944
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
5904
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = pl(e).catch(
|
|
5945
5905
|
(t) => C.error(je, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
5946
5906
|
));
|
|
5947
5907
|
},
|
|
@@ -5949,7 +5909,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5949
5909
|
// Add imports to index.html before Vite starts resolving imports
|
|
5950
5910
|
order: "pre",
|
|
5951
5911
|
async handler(t, i) {
|
|
5952
|
-
return
|
|
5912
|
+
return rs(e, i) ? (await Te(e)).map(
|
|
5953
5913
|
(s) => "javascriptCode" in s ? {
|
|
5954
5914
|
tag: "script",
|
|
5955
5915
|
attrs: {
|
|
@@ -5989,9 +5949,9 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5989
5949
|
await e._updateLuminaTsPromise;
|
|
5990
5950
|
}
|
|
5991
5951
|
});
|
|
5992
|
-
async function
|
|
5993
|
-
const i = (await Promise.all([ve,
|
|
5994
|
-
if (!await
|
|
5952
|
+
async function pl(e) {
|
|
5953
|
+
const i = (await Promise.all([ve, Gn(e)])).flat();
|
|
5954
|
+
if (!await ss(
|
|
5995
5955
|
i,
|
|
5996
5956
|
e.dir.src,
|
|
5997
5957
|
Ce,
|
|
@@ -6000,22 +5960,22 @@ async function El(e) {
|
|
|
6000
5960
|
return;
|
|
6001
5961
|
let s = !1;
|
|
6002
5962
|
function r() {
|
|
6003
|
-
s || C.warn(je,
|
|
5963
|
+
s || C.warn(je, ul), s = !0;
|
|
6004
5964
|
}
|
|
6005
5965
|
process.on("exit", () => {
|
|
6006
5966
|
r(), clearTimeout(c);
|
|
6007
5967
|
});
|
|
6008
5968
|
const c = setTimeout(r, 2e3);
|
|
6009
5969
|
}
|
|
6010
|
-
const
|
|
5970
|
+
const ul = Rs.greenBright(
|
|
6011
5971
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
6012
5972
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
6013
5973
|
);
|
|
6014
|
-
async function
|
|
5974
|
+
async function ml(e, t) {
|
|
6015
5975
|
const i = /* @__PURE__ */ new Map();
|
|
6016
5976
|
await Promise.all(
|
|
6017
5977
|
e.map(async (s) => {
|
|
6018
|
-
const r = await J(s, "utf-8"), a = r.match(
|
|
5978
|
+
const r = await J(s, "utf-8"), a = r.match(fl)?.[1];
|
|
6019
5979
|
if (a === void 0) {
|
|
6020
5980
|
C.warn(
|
|
6021
5981
|
"@arcgis/lumina:parseStoryFiles",
|
|
@@ -6027,14 +5987,14 @@ async function $l(e, t) {
|
|
|
6027
5987
|
let c = i.get(a);
|
|
6028
5988
|
c === void 0 && (c = [], i.set(a, c));
|
|
6029
5989
|
const l = [];
|
|
6030
|
-
for (const d of r.matchAll(
|
|
6031
|
-
const p = d[1], m =
|
|
5990
|
+
for (const d of r.matchAll(yl)) {
|
|
5991
|
+
const p = d[1], m = Sl(p), f = r.indexOf("{", d.index), y = r.indexOf("}", f), g = r.slice(0, d.index).trimEnd();
|
|
6032
5992
|
let h = "";
|
|
6033
5993
|
if (g.endsWith("*/")) {
|
|
6034
|
-
const
|
|
6035
|
-
h = g.slice(
|
|
5994
|
+
const T = g.lastIndexOf("/**");
|
|
5995
|
+
h = g.slice(T + 3, -2).trim().replaceAll(hl, "");
|
|
6036
5996
|
}
|
|
6037
|
-
const v = r.slice(f, y).match(
|
|
5997
|
+
const v = r.slice(f, y).match(gl)?.[1] || m, S = vl(m);
|
|
6038
5998
|
l.push({
|
|
6039
5999
|
description: `${v}${h ? `
|
|
6040
6000
|
${h}` : ""}`,
|
|
@@ -6059,11 +6019,11 @@ ${h}` : ""}`,
|
|
|
6059
6019
|
}
|
|
6060
6020
|
return n;
|
|
6061
6021
|
}
|
|
6062
|
-
const
|
|
6063
|
-
var
|
|
6022
|
+
const fl = /component: ["']([^"']+)["']/u, yl = /export const (\w+)/gu, gl = /name: ["']([^"']+)["']/u, hl = /^\s*\*\s?/gmu, vl = (e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/giu, "-").replace(/-+/gu, "-").replace(/^-+/u, "").replace(/-+$/u, ""), Sl = (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();
|
|
6023
|
+
var bl = Object.defineProperty, A = (e, t, i, n) => {
|
|
6064
6024
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
6065
6025
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
6066
|
-
return s &&
|
|
6026
|
+
return s && bl(t, i, s), s;
|
|
6067
6027
|
};
|
|
6068
6028
|
const ie = "@arcgis/lumina:context";
|
|
6069
6029
|
class P {
|
|
@@ -6089,7 +6049,7 @@ class P {
|
|
|
6089
6049
|
distComponents: m,
|
|
6090
6050
|
distCdn: f,
|
|
6091
6051
|
distCdnAssets: y
|
|
6092
|
-
}, C.initialize(s.logger, a), s.root !==
|
|
6052
|
+
}, C.initialize(s.logger, a), s.root !== Mi())
|
|
6093
6053
|
throw Error(
|
|
6094
6054
|
w(
|
|
6095
6055
|
ie,
|
|
@@ -6104,9 +6064,9 @@ class P {
|
|
|
6104
6064
|
"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."
|
|
6105
6065
|
), this.isInStorybook = s.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(s.server?.hmr ?? !0);
|
|
6106
6066
|
const g = this.options.documentation?.publicStoryUrlPrefix;
|
|
6107
|
-
this.isFullApiExtraction && typeof g == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await
|
|
6067
|
+
this.isFullApiExtraction && typeof g == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await ml(this.componentStoryFiles, g)).then((h) => {
|
|
6108
6068
|
this.componentStories = h;
|
|
6109
|
-
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0),
|
|
6069
|
+
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0), Tc(this, s.build.sourcemap !== !1), rs(this) && Te(this);
|
|
6110
6070
|
}
|
|
6111
6071
|
},
|
|
6112
6072
|
configureServer: {
|
|
@@ -6114,8 +6074,19 @@ class P {
|
|
|
6114
6074
|
handler: () => {
|
|
6115
6075
|
this._serverConfigured = !0;
|
|
6116
6076
|
}
|
|
6077
|
+
},
|
|
6078
|
+
/**
|
|
6079
|
+
* Workaround for a Vite bug.
|
|
6080
|
+
* See https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/5414
|
|
6081
|
+
*/
|
|
6082
|
+
transformIndexHtml: (s) => {
|
|
6083
|
+
if (this.isInStorybook && this.viteCommand === "build")
|
|
6084
|
+
return s.replace(
|
|
6085
|
+
'<script type="module" crossorigin src="@arcgis/core/applications/Components/reactiveUtils.js"><\/script>',
|
|
6086
|
+
""
|
|
6087
|
+
);
|
|
6117
6088
|
}
|
|
6118
|
-
}, this._localDefinedComponents = void 0, this._cssImports = /* @__PURE__ */ new Map(), this._cssDocs = void 0, this.isInCi = !!process.env.CI, this._declarationTextTransformers = [], this._serverConfigured = !1, this.assetsToProvide = [], this._globalCssString = void 0, this._loadersCache = void 0, this._serveOnlyDependencies = void 0, this._customElementDependencies = {}, this._htmlElementReferencesReplacer = void 0, this._silencedRules = void 0, this._updateLuminaTsPromise = void 0, this.normalizedDocumentationUrl = "developers.arcgis.com", this.alternativeDocumentationUrl = "next.
|
|
6089
|
+
}, this._localDefinedComponents = void 0, this._cssImports = /* @__PURE__ */ new Map(), this._cssDocs = void 0, this.isInCi = !!process.env.CI, this._declarationTextTransformers = [], this._serverConfigured = !1, this.assetsToProvide = [], this._globalCssString = void 0, this._loadersCache = void 0, this._serveOnlyDependencies = void 0, this._customElementDependencies = {}, this._htmlElementReferencesReplacer = void 0, this._silencedRules = void 0, this._updateLuminaTsPromise = void 0, this.normalizedDocumentationUrl = "developers.arcgis.com", this.alternativeDocumentationUrl = "next.gha.afd.arcgis.com", this.options = t;
|
|
6119
6090
|
const i = t.documentation ?? {};
|
|
6120
6091
|
this._documentationFileNames = {
|
|
6121
6092
|
apiJson: i.apiJsonFileName === !1 ? void 0 : i.apiJsonFileName ? de(i.apiJsonFileName) : pe.apiJson,
|
|
@@ -6123,9 +6094,9 @@ class P {
|
|
|
6123
6094
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? de(i.jetBrains.webTypesFileName) : pe.webTypes,
|
|
6124
6095
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? de(i.vsCode.htmlFileName) : pe.vsCodeHtml,
|
|
6125
6096
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? de(i.vsCode.cssFileName) : pe.vsCodeCss
|
|
6126
|
-
},
|
|
6127
|
-
const n = t.build?.preamble ??
|
|
6128
|
-
this.banner =
|
|
6097
|
+
}, yn(), this.componentFilesPromise = xt(this, u.resolve("src/components")), wc(this);
|
|
6098
|
+
const n = t.build?.preamble ?? rl();
|
|
6099
|
+
this.banner = ol(n);
|
|
6129
6100
|
}
|
|
6130
6101
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
6131
6102
|
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (C.warn(kt, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -6283,7 +6254,7 @@ A([
|
|
|
6283
6254
|
A([
|
|
6284
6255
|
k("configResolved()")
|
|
6285
6256
|
], P.prototype, "_typeScriptPrinter");
|
|
6286
|
-
const pt = "@arcgis/lumina:addNonLazyImports",
|
|
6257
|
+
const pt = "@arcgis/lumina:addNonLazyImports", wl = (e) => ({
|
|
6287
6258
|
name: pt,
|
|
6288
6259
|
apply: () => e.viteCommand === "build",
|
|
6289
6260
|
generateBundle(t, i) {
|
|
@@ -6291,7 +6262,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6291
6262
|
const r = ge(n, "components/", e);
|
|
6292
6263
|
if (r !== n && (s.fileName = r), s.type === "chunk") {
|
|
6293
6264
|
const a = u.dirname(u.join(e.dir.dist, n)), c = r === n ? a : u.dirname(u.join(e.dir.dist, r));
|
|
6294
|
-
s.code =
|
|
6265
|
+
s.code = _i(s.code, e, c, a);
|
|
6295
6266
|
}
|
|
6296
6267
|
});
|
|
6297
6268
|
},
|
|
@@ -6304,7 +6275,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6304
6275
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: l }]) => {
|
|
6305
6276
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
6306
6277
|
return;
|
|
6307
|
-
const d =
|
|
6278
|
+
const d = os(t, l, n);
|
|
6308
6279
|
if (d.forEach((p) => {
|
|
6309
6280
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
6310
6281
|
}), (a.length > 0 || c.length > 0) && d.length === 0) {
|
|
@@ -6322,14 +6293,17 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6322
6293
|
return [];
|
|
6323
6294
|
const l = u.dirname(r), d = ge(l, e.dir.srcComponents, e), p = u.relative(e.dir.src, d);
|
|
6324
6295
|
function m(b) {
|
|
6325
|
-
const
|
|
6326
|
-
if (
|
|
6327
|
-
return
|
|
6296
|
+
const E = Za(e, b, r);
|
|
6297
|
+
if (E === void 0)
|
|
6298
|
+
return;
|
|
6299
|
+
const I = Ya(E, p);
|
|
6300
|
+
if (I !== `./${p}`)
|
|
6301
|
+
return I.startsWith(".") ? `${I}/${Fi}` : I;
|
|
6328
6302
|
}
|
|
6329
6303
|
const f = new Set(a), y = new Set(c), g = Array.from(f, m).filter(j), h = (b) => `import "${b}";
|
|
6330
|
-
`, v = g.map(h).join(""), S = /* @__PURE__ */ new Set(),
|
|
6331
|
-
const
|
|
6332
|
-
if (
|
|
6304
|
+
`, v = g.map(h).join(""), S = /* @__PURE__ */ new Set(), T = Array.from(y, (b) => {
|
|
6305
|
+
const E = m(b);
|
|
6306
|
+
if (E !== void 0) {
|
|
6333
6307
|
if (f.has(b)) {
|
|
6334
6308
|
C.warn(
|
|
6335
6309
|
pt,
|
|
@@ -6337,52 +6311,52 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6337
6311
|
);
|
|
6338
6312
|
return;
|
|
6339
6313
|
}
|
|
6340
|
-
return S.add(h(
|
|
6314
|
+
return S.add(h(E)), `.set("${b}", () => import("${E}"))
|
|
6341
6315
|
`;
|
|
6342
6316
|
}
|
|
6343
|
-
}).filter(j), x = `${v}export * from "./${Tt}";`,
|
|
6317
|
+
}).filter(j), x = `${v}export * from "./${Tt}";`, L = Array.from(S).join("") + x, $ = T.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
6344
6318
|
${x}
|
|
6345
|
-
deferredLoaders${
|
|
6319
|
+
deferredLoaders${T.join("")};` : x;
|
|
6346
6320
|
return [
|
|
6347
|
-
F(u.join(e.dir.dist, p,
|
|
6348
|
-
F(u.join(e.dir.dist, p,
|
|
6321
|
+
F(u.join(e.dir.dist, p, Fi), $),
|
|
6322
|
+
F(u.join(e.dir.dist, p, Tl), L)
|
|
6349
6323
|
];
|
|
6350
6324
|
});
|
|
6351
6325
|
await Promise.all(s);
|
|
6352
6326
|
}
|
|
6353
|
-
}),
|
|
6327
|
+
}), Fi = "index.js", Tl = "index.d.ts", os = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), os(e, e[s].referencedBy, i, n))), El = (e) => ({
|
|
6354
6328
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6355
6329
|
configureServer(t) {
|
|
6356
|
-
e.server = t, !e.isInPuppeteerTestBackEnd &&
|
|
6330
|
+
e.server = t, !e.isInPuppeteerTestBackEnd && Ni(e).forEach(({ assets: i, transformers: n }) => fe(e, i, n));
|
|
6357
6331
|
},
|
|
6358
6332
|
async writeBundle() {
|
|
6359
6333
|
await Promise.all(
|
|
6360
|
-
|
|
6361
|
-
async ({ assets: t, transformers: i }) => await
|
|
6334
|
+
Ni(e).map(
|
|
6335
|
+
async ({ assets: t, transformers: i }) => await Xn(e, t, i)
|
|
6362
6336
|
)
|
|
6363
6337
|
);
|
|
6364
6338
|
}
|
|
6365
6339
|
});
|
|
6366
|
-
function
|
|
6340
|
+
function Ni(e) {
|
|
6367
6341
|
const t = [], i = e.assetsToProvide?.filter((n) => n.apply === void 0 || n.apply === e.viteCommand) ?? [];
|
|
6368
6342
|
return e.options.assets?.extra?.forEach((n) => {
|
|
6369
6343
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
6370
6344
|
}), t.length > 0 && i.push({ assets: t }), e.assetsToProvide = void 0, i;
|
|
6371
6345
|
}
|
|
6372
|
-
const bt = "@arcgis/lumina:updatePackageJson",
|
|
6346
|
+
const bt = "@arcgis/lumina:updatePackageJson", Cl = (e) => ({
|
|
6373
6347
|
name: bt,
|
|
6374
6348
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
6375
6349
|
configResolved() {
|
|
6376
|
-
|
|
6350
|
+
$l(e).catch(
|
|
6377
6351
|
(t) => C.error(bt, `Failed to update package's package.json:${String(t)}`)
|
|
6378
6352
|
);
|
|
6379
6353
|
}
|
|
6380
6354
|
});
|
|
6381
|
-
async function
|
|
6382
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n =
|
|
6383
|
-
n &&
|
|
6355
|
+
async function $l(e) {
|
|
6356
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n = Pl(i, e);
|
|
6357
|
+
n && Ki(t, JSON.stringify(n, null, 2));
|
|
6384
6358
|
}
|
|
6385
|
-
function
|
|
6359
|
+
function Pl(e, t) {
|
|
6386
6360
|
const i = e?.devDependencies ?? {};
|
|
6387
6361
|
Object.keys(e?.peerDependencies ?? {}).forEach((d) => {
|
|
6388
6362
|
d in i || C.warn(
|
|
@@ -6421,20 +6395,20 @@ function Ol(e, t) {
|
|
|
6421
6395
|
if (n)
|
|
6422
6396
|
return e;
|
|
6423
6397
|
}
|
|
6424
|
-
const
|
|
6398
|
+
const xl = (e) => ({
|
|
6425
6399
|
timestamp: e.apiJson.timestamp,
|
|
6426
6400
|
compiler: e.apiJson.compiler,
|
|
6427
|
-
components:
|
|
6401
|
+
components: kl(e),
|
|
6428
6402
|
typeLibrary: {}
|
|
6429
6403
|
});
|
|
6430
|
-
function
|
|
6404
|
+
function kl(e) {
|
|
6431
6405
|
const t = [];
|
|
6432
6406
|
for (const i of e.apiJson.modules)
|
|
6433
6407
|
for (const n of i.declarations)
|
|
6434
|
-
"customElement" in n && t.push(
|
|
6408
|
+
"customElement" in n && t.push(Al(n, i.path));
|
|
6435
6409
|
return t;
|
|
6436
6410
|
}
|
|
6437
|
-
function
|
|
6411
|
+
function Al(e, t) {
|
|
6438
6412
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6439
6413
|
return {
|
|
6440
6414
|
filePath: t,
|
|
@@ -6449,9 +6423,9 @@ function Bl(e, t) {
|
|
|
6449
6423
|
dependencies: [],
|
|
6450
6424
|
dependencyGraph: {},
|
|
6451
6425
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6452
|
-
props: e.members.map(
|
|
6453
|
-
methods: e.members.map(
|
|
6454
|
-
events: e.events?.map(
|
|
6426
|
+
props: e.members.map(Il).filter(j),
|
|
6427
|
+
methods: e.members.map(Ll).filter(j),
|
|
6428
|
+
events: e.events?.map(Fl) ?? [],
|
|
6455
6429
|
styles: e.cssProperties?.map((n) => ({
|
|
6456
6430
|
name: n.name,
|
|
6457
6431
|
annotation: "prop",
|
|
@@ -6463,7 +6437,7 @@ function Bl(e, t) {
|
|
|
6463
6437
|
listeners: []
|
|
6464
6438
|
};
|
|
6465
6439
|
}
|
|
6466
|
-
function
|
|
6440
|
+
function Il(e) {
|
|
6467
6441
|
if (e.kind !== "field")
|
|
6468
6442
|
return;
|
|
6469
6443
|
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;
|
|
@@ -6497,14 +6471,14 @@ const Mt = (e) => Object.fromEntries(
|
|
|
6497
6471
|
(t) => [
|
|
6498
6472
|
t.name,
|
|
6499
6473
|
{
|
|
6500
|
-
location: t.package ===
|
|
6474
|
+
location: t.package === Oi ? "global" : t.package === void 0 ? "local" : "import",
|
|
6501
6475
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
6502
6476
|
id: "notImplemented"
|
|
6503
6477
|
}
|
|
6504
6478
|
]
|
|
6505
6479
|
) ?? []
|
|
6506
6480
|
);
|
|
6507
|
-
function
|
|
6481
|
+
function Ll(e) {
|
|
6508
6482
|
if (e.kind !== "method")
|
|
6509
6483
|
return;
|
|
6510
6484
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], n = t.parameters?.map(({ name: s, type: r, description: a }) => ({
|
|
@@ -6535,7 +6509,7 @@ function _l(e) {
|
|
|
6535
6509
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
6536
6510
|
};
|
|
6537
6511
|
}
|
|
6538
|
-
function
|
|
6512
|
+
function Fl(e) {
|
|
6539
6513
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
6540
6514
|
return {
|
|
6541
6515
|
event: e.name,
|
|
@@ -6553,32 +6527,32 @@ function Hl(e) {
|
|
|
6553
6527
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated
|
|
6554
6528
|
};
|
|
6555
6529
|
}
|
|
6556
|
-
const
|
|
6530
|
+
const as = (e) => e.flatMap(
|
|
6557
6531
|
(t) => t.cssProperties?.map((i) => ({
|
|
6558
6532
|
name: i.name,
|
|
6559
6533
|
description: i.description || void 0
|
|
6560
6534
|
})) ?? []
|
|
6561
|
-
),
|
|
6535
|
+
), cs = (e) => e.flatMap(
|
|
6562
6536
|
(t) => t.cssParts?.map((i) => ({
|
|
6563
6537
|
name: `::part(${i.name})`,
|
|
6564
6538
|
description: i.description || void 0
|
|
6565
6539
|
})) ?? []
|
|
6566
|
-
),
|
|
6540
|
+
), Nl = (e) => e.attributes?.map((t) => ({
|
|
6567
6541
|
name: t.name ?? "",
|
|
6568
|
-
description:
|
|
6542
|
+
description: Qe(t.description, t.deprecated) || void 0,
|
|
6569
6543
|
default: t.default,
|
|
6570
6544
|
value: {
|
|
6571
|
-
type:
|
|
6545
|
+
type: Dl(t.type.values?.map(sn))
|
|
6572
6546
|
}
|
|
6573
|
-
})) ?? [],
|
|
6547
|
+
})) ?? [], Dl = (e) => e?.length === 1 ? e[0] : e, Qe = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, $e = {
|
|
6574
6548
|
slots: "Slots",
|
|
6575
6549
|
events: "Events",
|
|
6576
6550
|
cssProperties: "CSS Properties",
|
|
6577
6551
|
cssParts: "CSS Parts",
|
|
6578
6552
|
methods: "Methods"
|
|
6579
6553
|
};
|
|
6580
|
-
function
|
|
6581
|
-
const t =
|
|
6554
|
+
function ls(e) {
|
|
6555
|
+
const t = jl(e.slots), i = Rl(e.events), n = Ml(e.cssProperties), s = Ol(e.cssParts), r = Jl(e.members), a = Qe(e.description, e.deprecated).trim();
|
|
6582
6556
|
return [...a ? [`${a}
|
|
6583
6557
|
--`] : [], i, r, t, n, s].filter(Boolean).join(`
|
|
6584
6558
|
|
|
@@ -6586,28 +6560,28 @@ function us(e) {
|
|
|
6586
6560
|
}
|
|
6587
6561
|
const Pe = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6588
6562
|
${t.join(`
|
|
6589
|
-
`)}`,
|
|
6563
|
+
`)}`, jl = (e) => Pe(
|
|
6590
6564
|
$e.slots,
|
|
6591
6565
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6592
|
-
),
|
|
6566
|
+
), Rl = (e) => Pe(
|
|
6593
6567
|
$e.events,
|
|
6594
6568
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6595
|
-
),
|
|
6569
|
+
), Ml = (e = []) => Pe(
|
|
6596
6570
|
$e.cssProperties,
|
|
6597
6571
|
e?.map(
|
|
6598
6572
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6599
6573
|
)
|
|
6600
|
-
),
|
|
6574
|
+
), Ol = (e) => Pe(
|
|
6601
6575
|
$e.cssParts,
|
|
6602
6576
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6603
|
-
),
|
|
6577
|
+
), Jl = (e) => Pe(
|
|
6604
6578
|
$e.methods,
|
|
6605
|
-
e.filter(
|
|
6606
|
-
(t) => [`- \`${t.name}${t.signature}\``,
|
|
6579
|
+
e.filter(gs).map(
|
|
6580
|
+
(t) => [`- \`${t.name}${t.signature}\``, Qe(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6607
6581
|
)
|
|
6608
6582
|
);
|
|
6609
|
-
function
|
|
6610
|
-
const i =
|
|
6583
|
+
function Kl(e, t) {
|
|
6584
|
+
const i = Wl(e), n = as(e), s = cs(e), r = R();
|
|
6611
6585
|
return {
|
|
6612
6586
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
6613
6587
|
name: r.name,
|
|
@@ -6625,52 +6599,52 @@ function Zl(e, t) {
|
|
|
6625
6599
|
}
|
|
6626
6600
|
};
|
|
6627
6601
|
}
|
|
6628
|
-
const
|
|
6602
|
+
const Wl = (e) => e.map((t) => ({
|
|
6629
6603
|
name: t.tagName,
|
|
6630
|
-
description:
|
|
6604
|
+
description: ls(t),
|
|
6631
6605
|
"doc-url": t.demos?.[0]?.url,
|
|
6632
|
-
attributes:
|
|
6606
|
+
attributes: Nl(t),
|
|
6633
6607
|
slots: t.slots?.map((i) => ({
|
|
6634
6608
|
name: i.name,
|
|
6635
6609
|
description: i.description
|
|
6636
6610
|
})),
|
|
6637
|
-
events:
|
|
6611
|
+
events: Di(t),
|
|
6638
6612
|
js: {
|
|
6639
|
-
properties:
|
|
6640
|
-
events:
|
|
6613
|
+
properties: Bl(t),
|
|
6614
|
+
events: Di(t)
|
|
6641
6615
|
}
|
|
6642
|
-
})),
|
|
6616
|
+
})), Bl = (e) => e.members.filter(hs).map((t) => ({
|
|
6643
6617
|
name: t.name,
|
|
6644
6618
|
description: t.description,
|
|
6645
6619
|
type: t.type?.text
|
|
6646
|
-
})) ?? [],
|
|
6620
|
+
})) ?? [], Di = (e) => e.events?.map((t) => ({
|
|
6647
6621
|
name: t.name,
|
|
6648
6622
|
type: t.type?.text,
|
|
6649
6623
|
description: t.description
|
|
6650
|
-
})) ?? [],
|
|
6624
|
+
})) ?? [], _l = (e) => e.map((t) => ({
|
|
6651
6625
|
name: t.tagName,
|
|
6652
|
-
description:
|
|
6653
|
-
attributes:
|
|
6626
|
+
description: ls(t),
|
|
6627
|
+
attributes: Hl(t),
|
|
6654
6628
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
6655
|
-
})),
|
|
6629
|
+
})), Hl = (e) => e.attributes?.map((t) => ({
|
|
6656
6630
|
name: t.name,
|
|
6657
|
-
description:
|
|
6658
|
-
values:
|
|
6659
|
-
})) ?? [],
|
|
6631
|
+
description: Qe(t.description, t.deprecated) || void 0,
|
|
6632
|
+
values: Ul(t)
|
|
6633
|
+
})) ?? [], Ul = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], zl = (e) => ({
|
|
6660
6634
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
6661
6635
|
version: 1.1,
|
|
6662
|
-
tags:
|
|
6663
|
-
}),
|
|
6636
|
+
tags: _l(e)
|
|
6637
|
+
}), ql = (e) => ({
|
|
6664
6638
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
6665
6639
|
version: 1.1,
|
|
6666
|
-
properties:
|
|
6667
|
-
pseudoElements:
|
|
6668
|
-
}),
|
|
6669
|
-
function
|
|
6640
|
+
properties: as(e),
|
|
6641
|
+
pseudoElements: cs(e)
|
|
6642
|
+
}), Gl = "@arcgis/lumina:generateDocs";
|
|
6643
|
+
function Vl(e) {
|
|
6670
6644
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
6671
6645
|
{
|
|
6672
6646
|
type: "dynamic",
|
|
6673
|
-
source: () => JSON.stringify(
|
|
6647
|
+
source: () => JSON.stringify(xl(e), null, 2),
|
|
6674
6648
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
6675
6649
|
}
|
|
6676
6650
|
]), e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
@@ -6680,34 +6654,34 @@ function ad(e) {
|
|
|
6680
6654
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
6681
6655
|
}
|
|
6682
6656
|
]), {
|
|
6683
|
-
name:
|
|
6657
|
+
name: Gl,
|
|
6684
6658
|
async writeBundle() {
|
|
6685
6659
|
if (e.isInStorybook)
|
|
6686
6660
|
return;
|
|
6687
6661
|
const { jetBrains: t } = e.options.documentation ?? {}, i = e._documentationFileNames, n = i.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, i.vsCodeHtml), s = i.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, i.vsCodeCss), r = i.webTypes === void 0 ? void 0 : u.join(e.dir.dist, i.webTypes), a = [n, s, r].filter(j);
|
|
6688
6662
|
if (a.length === 0)
|
|
6689
6663
|
return;
|
|
6690
|
-
await
|
|
6664
|
+
await ts(a);
|
|
6691
6665
|
const c = [];
|
|
6692
6666
|
if (n !== void 0) {
|
|
6693
|
-
const l = JSON.stringify(
|
|
6667
|
+
const l = JSON.stringify(zl(e.apiJsonComponents), null, 2);
|
|
6694
6668
|
c.push(F(n, l));
|
|
6695
6669
|
}
|
|
6696
6670
|
if (s !== void 0) {
|
|
6697
|
-
const l = JSON.stringify(
|
|
6671
|
+
const l = JSON.stringify(ql(e.apiJsonComponents), null, 2);
|
|
6698
6672
|
c.push(F(s, l));
|
|
6699
6673
|
}
|
|
6700
6674
|
if (r !== void 0) {
|
|
6701
|
-
const l =
|
|
6675
|
+
const l = Kl(e.apiJsonComponents, typeof t == "object" ? t : {});
|
|
6702
6676
|
c.push(F(r, JSON.stringify(l, null, 2)));
|
|
6703
6677
|
}
|
|
6704
6678
|
await Promise.all(c);
|
|
6705
6679
|
}
|
|
6706
6680
|
};
|
|
6707
6681
|
}
|
|
6708
|
-
const
|
|
6682
|
+
const Xl = (e) => `import type { h, EventHandler } from "@arcgis/lumina";
|
|
6709
6683
|
|
|
6710
|
-
${e.map(
|
|
6684
|
+
${e.map(Ql).join(`
|
|
6711
6685
|
|
|
6712
6686
|
`)}
|
|
6713
6687
|
|
|
@@ -6719,8 +6693,8 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6719
6693
|
}
|
|
6720
6694
|
}
|
|
6721
6695
|
}`;
|
|
6722
|
-
function
|
|
6723
|
-
const [s, r] =
|
|
6696
|
+
function Ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6697
|
+
const [s, r] = Xe(e, i);
|
|
6724
6698
|
return [
|
|
6725
6699
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6726
6700
|
`,
|
|
@@ -6732,7 +6706,7 @@ function ld({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6732
6706
|
r
|
|
6733
6707
|
].join("");
|
|
6734
6708
|
}
|
|
6735
|
-
function
|
|
6709
|
+
function Zl(e) {
|
|
6736
6710
|
const t = ` interface IntrinsicElements extends PreactJsx.IntrinsicElements {
|
|
6737
6711
|
${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join(`
|
|
6738
6712
|
`)}
|
|
@@ -6740,7 +6714,7 @@ ${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join
|
|
|
6740
6714
|
return `import { JSX as PreactJsx } from "preact";
|
|
6741
6715
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6742
6716
|
|
|
6743
|
-
${e.map(
|
|
6717
|
+
${e.map(Yl).join(`
|
|
6744
6718
|
|
|
6745
6719
|
`)}
|
|
6746
6720
|
|
|
@@ -6753,8 +6727,8 @@ ${t}
|
|
|
6753
6727
|
}
|
|
6754
6728
|
}`;
|
|
6755
6729
|
}
|
|
6756
|
-
function
|
|
6757
|
-
const [s, r] =
|
|
6730
|
+
function Yl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6731
|
+
const [s, r] = Xe(e, i);
|
|
6758
6732
|
return [
|
|
6759
6733
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6760
6734
|
`,
|
|
@@ -6766,13 +6740,13 @@ function pd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6766
6740
|
r
|
|
6767
6741
|
].join("");
|
|
6768
6742
|
}
|
|
6769
|
-
function
|
|
6743
|
+
function ed(e) {
|
|
6770
6744
|
const t = e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": React${i};`).join(`
|
|
6771
6745
|
`);
|
|
6772
6746
|
return `import type { HTMLProps } from 'react';
|
|
6773
6747
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6774
6748
|
|
|
6775
|
-
${e.map(
|
|
6749
|
+
${e.map(td).join(`
|
|
6776
6750
|
|
|
6777
6751
|
`)}
|
|
6778
6752
|
|
|
@@ -6798,8 +6772,8 @@ ${t}
|
|
|
6798
6772
|
}
|
|
6799
6773
|
}`;
|
|
6800
6774
|
}
|
|
6801
|
-
function
|
|
6802
|
-
const [s, r] =
|
|
6775
|
+
function td({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6776
|
+
const [s, r] = Xe(e, i);
|
|
6803
6777
|
return [
|
|
6804
6778
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6805
6779
|
`,
|
|
@@ -6811,10 +6785,10 @@ function md({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6811
6785
|
r
|
|
6812
6786
|
].join("");
|
|
6813
6787
|
}
|
|
6814
|
-
const
|
|
6788
|
+
const id = (e) => `import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
6815
6789
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6816
6790
|
|
|
6817
|
-
${e.map(
|
|
6791
|
+
${e.map(nd).join(`
|
|
6818
6792
|
|
|
6819
6793
|
`)}
|
|
6820
6794
|
|
|
@@ -6832,8 +6806,8 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6832
6806
|
interface IntrinsicElements extends ExposedElements {}
|
|
6833
6807
|
}
|
|
6834
6808
|
}`;
|
|
6835
|
-
function
|
|
6836
|
-
const [s, r] =
|
|
6809
|
+
function nd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6810
|
+
const [s, r] = Xe(e, i);
|
|
6837
6811
|
return [
|
|
6838
6812
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6839
6813
|
`,
|
|
@@ -6845,16 +6819,16 @@ function yd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6845
6819
|
r
|
|
6846
6820
|
].join("");
|
|
6847
6821
|
}
|
|
6848
|
-
const
|
|
6822
|
+
const sd = (e, t, i) => [i, t, rd(e), od(e)].join(`
|
|
6849
6823
|
|
|
6850
|
-
`),
|
|
6824
|
+
`), rd = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6851
6825
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6852
6826
|
detail: T;
|
|
6853
6827
|
target: HTML${t}Element;
|
|
6854
6828
|
currentTarget: HTML${t}Element;
|
|
6855
6829
|
}`
|
|
6856
6830
|
).join(`
|
|
6857
|
-
`),
|
|
6831
|
+
`), od = (e) => `export { ToEvents, TargetedEvent } from "@arcgis/lumina";
|
|
6858
6832
|
|
|
6859
6833
|
declare global {
|
|
6860
6834
|
interface HTMLElementTagNameMap {
|
|
@@ -6862,12 +6836,12 @@ ${e.map(({ pascalCaseName: t, tagName: i }) => ` "${i}": HTML${t}Element;`).j
|
|
|
6862
6836
|
`)}
|
|
6863
6837
|
}
|
|
6864
6838
|
|
|
6865
|
-
${e.map(
|
|
6839
|
+
${e.map(ad).join(`
|
|
6866
6840
|
`).split(`
|
|
6867
6841
|
`).map((t) => t.length > 0 ? ` ${t}` : t).join(`
|
|
6868
6842
|
`)}
|
|
6869
6843
|
}`;
|
|
6870
|
-
function
|
|
6844
|
+
function ad({ name: e, pascalCaseName: t, events: i = [] }) {
|
|
6871
6845
|
const n = i.length > 0, s = `${t}CustomEvent`, r = `HTML${t}Element`;
|
|
6872
6846
|
return [
|
|
6873
6847
|
n ? `interface ${r}EventMap {
|
|
@@ -6886,7 +6860,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6886
6860
|
}`
|
|
6887
6861
|
].join("");
|
|
6888
6862
|
}
|
|
6889
|
-
function
|
|
6863
|
+
function cd(e) {
|
|
6890
6864
|
let t;
|
|
6891
6865
|
return {
|
|
6892
6866
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6894,11 +6868,11 @@ function bd(e) {
|
|
|
6894
6868
|
generateBundle() {
|
|
6895
6869
|
if (e.isInStorybook)
|
|
6896
6870
|
return;
|
|
6897
|
-
t =
|
|
6871
|
+
t = Ja(e);
|
|
6898
6872
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6899
6873
|
e._declarationTextTransformers.push((n) => {
|
|
6900
6874
|
const { filePath: s, content: r } = n;
|
|
6901
|
-
return s === i ? { filePath: s, content:
|
|
6875
|
+
return s === i ? { filePath: s, content: sd(e.apiJsonComponents, r, t) } : n;
|
|
6902
6876
|
});
|
|
6903
6877
|
},
|
|
6904
6878
|
async writeBundle() {
|
|
@@ -6908,10 +6882,10 @@ function bd(e) {
|
|
|
6908
6882
|
await z(i);
|
|
6909
6883
|
const n = `/// <reference types="../index.d.ts" />
|
|
6910
6884
|
${t.replaceAll("./", "../")}`, s = Object.entries({
|
|
6911
|
-
react:
|
|
6912
|
-
preact:
|
|
6913
|
-
stencil:
|
|
6914
|
-
lumina:
|
|
6885
|
+
react: ed(e.apiJsonComponents),
|
|
6886
|
+
preact: Zl(e.apiJsonComponents),
|
|
6887
|
+
stencil: id(e.apiJsonComponents),
|
|
6888
|
+
lumina: Xl(e.apiJsonComponents)
|
|
6915
6889
|
}).map(
|
|
6916
6890
|
async ([r, a]) => await F(u.join(i, `${r}.d.ts`), `${n}
|
|
6917
6891
|
${a}`)
|
|
@@ -6920,38 +6894,38 @@ ${a}`)
|
|
|
6920
6894
|
}
|
|
6921
6895
|
};
|
|
6922
6896
|
}
|
|
6923
|
-
function
|
|
6897
|
+
function ld(e) {
|
|
6924
6898
|
return {
|
|
6925
6899
|
name: "@arcgis/lumina:buildWrappers",
|
|
6926
6900
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
6927
6901
|
async writeBundle() {
|
|
6928
6902
|
e.isInStorybook || await Promise.all(
|
|
6929
6903
|
e.options.build?.wrappers?.map(async (t) => {
|
|
6930
|
-
t.type === "react18" && await
|
|
6904
|
+
t.type === "react18" && await ud(e, t);
|
|
6931
6905
|
}) ?? []
|
|
6932
6906
|
);
|
|
6933
6907
|
}
|
|
6934
6908
|
};
|
|
6935
6909
|
}
|
|
6936
|
-
const
|
|
6937
|
-
import React from "${
|
|
6938
|
-
import { createComponent } from "${
|
|
6939
|
-
import type { EventName } from "${
|
|
6910
|
+
const dd = "react", ji = "@lit/react", pd = `
|
|
6911
|
+
import React from "${dd}";
|
|
6912
|
+
import { createComponent } from "${ji}";
|
|
6913
|
+
import type { EventName } from "${ji}";
|
|
6940
6914
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
6941
6915
|
|
|
6942
6916
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
6943
6917
|
`;
|
|
6944
|
-
async function
|
|
6918
|
+
async function ud(e, t) {
|
|
6945
6919
|
const { name: i } = R(), n = [];
|
|
6946
6920
|
for (const a of e.apiJson.modules)
|
|
6947
6921
|
for (const c of a.declarations)
|
|
6948
|
-
"customElement" in c && n.push(
|
|
6949
|
-
const s = [`/// <reference types="${i}" preserve="true" />`,
|
|
6922
|
+
"customElement" in c && n.push(md(c));
|
|
6923
|
+
const s = [`/// <reference types="${i}" preserve="true" />`, pd, ...n].join(""), r = u.resolve(t.proxiesFile);
|
|
6950
6924
|
await z(u.dirname(r), { recursive: !0 }), await F(r, s);
|
|
6951
6925
|
}
|
|
6952
|
-
function
|
|
6926
|
+
function md(e) {
|
|
6953
6927
|
const t = e.events?.map(
|
|
6954
|
-
(i) => ` ${Ee(`on${
|
|
6928
|
+
(i) => ` ${Ee(`on${ws(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
6955
6929
|
).join(`
|
|
6956
6930
|
`);
|
|
6957
6931
|
return `
|
|
@@ -6965,48 +6939,48 @@ ${t}
|
|
|
6965
6939
|
);
|
|
6966
6940
|
`;
|
|
6967
6941
|
}
|
|
6968
|
-
function
|
|
6942
|
+
function kd(e = {}) {
|
|
6969
6943
|
const t = new P(e), i = [
|
|
6970
6944
|
t._plugin,
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6945
|
+
nl(t),
|
|
6946
|
+
sl(t),
|
|
6947
|
+
Cl(t),
|
|
6948
|
+
xr(t),
|
|
6949
|
+
Hc(t),
|
|
6950
|
+
cd(t),
|
|
6951
|
+
Vl(t),
|
|
6952
|
+
Sc(t),
|
|
6953
|
+
vo(t),
|
|
6954
|
+
Vc(t),
|
|
6955
|
+
El(t),
|
|
6956
|
+
wl(t),
|
|
6957
|
+
dl(t),
|
|
6958
|
+
Ms(t),
|
|
6959
|
+
Cc(t),
|
|
6986
6960
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
6987
6961
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6962
|
+
Qc(t),
|
|
6963
|
+
ld(t),
|
|
6964
|
+
Zc(t)
|
|
6991
6965
|
].filter(j);
|
|
6992
6966
|
return i.context = t, i;
|
|
6993
6967
|
}
|
|
6994
|
-
const
|
|
6995
|
-
initializeComponentDependencies:
|
|
6996
|
-
updateLuminaTs:
|
|
6997
|
-
propertyToAttributeMappings:
|
|
6998
|
-
findDeclaredComponents:
|
|
6999
|
-
nativeEvents:
|
|
6968
|
+
const Ad = {
|
|
6969
|
+
initializeComponentDependencies: yn,
|
|
6970
|
+
updateLuminaTs: ss,
|
|
6971
|
+
propertyToAttributeMappings: B,
|
|
6972
|
+
findDeclaredComponents: Hi,
|
|
6973
|
+
nativeEvents: Zi,
|
|
7000
6974
|
svgElements: Ct,
|
|
7001
6975
|
mathMlElements: $t,
|
|
7002
|
-
alwaysAttributes:
|
|
7003
|
-
nativeAlwaysAttributes:
|
|
6976
|
+
alwaysAttributes: Vi,
|
|
6977
|
+
nativeAlwaysAttributes: Xi,
|
|
7004
6978
|
htmlAlwaysAttributes: yt,
|
|
7005
|
-
isPropertyEscapeNeeded:
|
|
6979
|
+
isPropertyEscapeNeeded: Ve
|
|
7006
6980
|
};
|
|
7007
6981
|
export {
|
|
7008
6982
|
Je as LuminaApiExtractor,
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
6983
|
+
Ad as exportsForCodemod,
|
|
6984
|
+
qe as inferCdnUrl,
|
|
6985
|
+
kd as useLumina
|
|
7012
6986
|
};
|