@arcgis/lumina-compiler 4.33.0-next.136 → 4.33.0-next.138
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 +829 -797
- package/dist/jsxToLitHtml/imports.d.ts +0 -1
- package/dist/plugins/buildCdn.d.ts +2 -6
- package/dist/publicTypes.d.ts +12 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { nodeExternals as ms } from "rollup-plugin-node-externals";
|
|
2
|
-
import { stringToStartsWithGlob 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 fs, toPosixPathSeparators as Le, isPosix as Oi, getCwd as Ji } from "@arcgis/components-build-utils";
|
|
3
3
|
import ys from "vite-plugin-dts";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { f as
|
|
6
|
-
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as
|
|
7
|
-
import { isNotUndefined as j, mappedFind as ye, camelToKebab as
|
|
8
|
-
import { readdir as
|
|
9
|
-
import { lazyMetaSubItemJoiner as
|
|
5
|
+
import { f as w, l as C } from "./logger-KpGU2b3R.js";
|
|
6
|
+
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as Ki, setApiDocFromJsDoc as ue, ApiExtractor as gs, hasIgnoredModifier as hs, symbolToDocs as Bt, setDefaultFromInitializer as Wt, multipleJsDocTags as vs, findDecorator as _t, isApiMethod as Ss, isApiProperty as bs } from "@arcgis/api-extractor";
|
|
7
|
+
import { isNotUndefined as j, mappedFind as ye, camelToKebab as wt, kebabToPascal as ws, uncapitalize as ut, identity as Bi, Deferred as Ts, getPreamble as Es, capitalize as Cs } from "@arcgis/components-utils";
|
|
8
|
+
import { readdir as Ue, readFile as J, rm as $s, mkdir as z, cp as Ps, writeFile as F, copyFile as xs } from "node:fs/promises";
|
|
9
|
+
import { lazyMetaSubItemJoiner as ks, lazyMetaItemJoiner as et, lazyMetaGroupJoiner as As, propertyFlagAttribute as Ht, propertyFlagReflect as Is, propertyFlagBoolean as Ls, propertyFlagNumber as Fs, propertyFlagState as Ns, propertyFlagReadOnly as Ds, propertyFlagNoAccessor as js } from "@arcgis/lumina/config";
|
|
10
10
|
import { build as Rs } from "esbuild";
|
|
11
11
|
import { glob as Ms } from "glob";
|
|
12
12
|
import Os from "mime-types";
|
|
13
|
-
import { writeFileSync as
|
|
13
|
+
import { writeFileSync as Wi } from "node:fs";
|
|
14
14
|
import Js from "chalk";
|
|
15
15
|
function Ks(e) {
|
|
16
16
|
const { externalize: t = [], bundleIn: i = [], ...n } = e.options?.build?.dependencies ?? {}, r = {
|
|
@@ -26,9 +26,9 @@ function Ks(e) {
|
|
|
26
26
|
// Externalize all @lit/ and @lit-labs/ packages
|
|
27
27
|
/^@lit[-/]/u,
|
|
28
28
|
/^lit$/u,
|
|
29
|
-
...Array.isArray(t) ? t.map(
|
|
29
|
+
...Array.isArray(t) ? t.map(Kt) : []
|
|
30
30
|
],
|
|
31
|
-
exclude: Array.isArray(i) ? i.map(
|
|
31
|
+
exclude: Array.isArray(i) ? i.map(Kt) : []
|
|
32
32
|
}),
|
|
33
33
|
configResolved() {
|
|
34
34
|
e.isInStorybook && (r.resolveId = void 0);
|
|
@@ -36,15 +36,15 @@ function Ks(e) {
|
|
|
36
36
|
};
|
|
37
37
|
return r;
|
|
38
38
|
}
|
|
39
|
-
const Tt = "customElement.js",
|
|
40
|
-
function
|
|
39
|
+
const Tt = "customElement.js", _i = "customElement.d.ts", Bs = "playwright";
|
|
40
|
+
function Ws(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) => {
|
|
44
44
|
c === s.length - 1 ? r[""] ??= e : (r[a] ??= {}, r = r[a]);
|
|
45
45
|
}), r[""];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ge(e, t, i) {
|
|
48
48
|
if (!e.startsWith(t))
|
|
49
49
|
return e;
|
|
50
50
|
const n = e.slice(t.length), s = _s(n, i);
|
|
@@ -63,11 +63,11 @@ function _s(e, t) {
|
|
|
63
63
|
return e;
|
|
64
64
|
}
|
|
65
65
|
const Hs = ({ filePath: e, content: t }, i) => {
|
|
66
|
-
const n = e.startsWith(i.dir.distComponents) ?
|
|
67
|
-
|
|
66
|
+
const n = e.startsWith(i.dir.distComponents) ? ge(
|
|
67
|
+
Hi(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(_i), a = Ui(
|
|
71
71
|
t,
|
|
72
72
|
i,
|
|
73
73
|
e === n ? s : u.dirname(n),
|
|
@@ -78,20 +78,20 @@ const Hs = ({ filePath: e, content: t }, i) => {
|
|
|
78
78
|
content: c
|
|
79
79
|
};
|
|
80
80
|
};
|
|
81
|
-
function
|
|
81
|
+
function Hi(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
85
|
return s.at(Us) !== s.at(zs) ? t : u.join(
|
|
86
86
|
s.slice(0, -1).join(u.sep),
|
|
87
|
-
i === "" ? Tt :
|
|
87
|
+
i === "" ? Tt : _i
|
|
88
88
|
);
|
|
89
89
|
}
|
|
90
|
-
const Us = -1, zs = -2, qs = /["']\.\.?\/[^'"]+/gu,
|
|
90
|
+
const Us = -1, zs = -2, qs = /["']\.\.?\/[^'"]+/gu, Ui = (e, t, i, n) => e.replaceAll(qs, (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(".") ? Hi(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);
|
|
@@ -104,11 +104,11 @@ function Gs(e) {
|
|
|
104
104
|
return `/// <reference types="../../index.d.ts" />
|
|
105
105
|
${e}`;
|
|
106
106
|
}
|
|
107
|
-
const
|
|
107
|
+
const Ut = "customElement", Vs = (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 = qi(n);
|
|
112
112
|
if (s === void 0)
|
|
113
113
|
return e;
|
|
114
114
|
{
|
|
@@ -123,7 +123,7 @@ const zt = "customElement", Vs = (e, t) => {
|
|
|
123
123
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
124
124
|
"customElement" in r && i.push(
|
|
125
125
|
o.factory.createExpressionStatement(
|
|
126
|
-
o.factory.createCallExpression(o.factory.createIdentifier(
|
|
126
|
+
o.factory.createCallExpression(o.factory.createIdentifier(Ut), void 0, [
|
|
127
127
|
o.factory.createStringLiteral(r.tagName),
|
|
128
128
|
o.factory.createIdentifier(r.name)
|
|
129
129
|
])
|
|
@@ -141,18 +141,18 @@ const zt = "customElement", Vs = (e, t) => {
|
|
|
141
141
|
!1,
|
|
142
142
|
void 0,
|
|
143
143
|
o.factory.createNamedImports([
|
|
144
|
-
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(
|
|
144
|
+
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Ut))
|
|
145
145
|
])
|
|
146
146
|
),
|
|
147
147
|
o.factory.createStringLiteral(n)
|
|
148
148
|
), ...e.statements, ...i];
|
|
149
149
|
};
|
|
150
|
-
function
|
|
151
|
-
const t =
|
|
150
|
+
function zi(e) {
|
|
151
|
+
const t = qi(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 qi(e) {
|
|
156
156
|
const t = e.indexOf("declare global {");
|
|
157
157
|
if (t === -1)
|
|
158
158
|
return;
|
|
@@ -184,8 +184,8 @@ const Qs = (e) => (t, i) => (
|
|
|
184
184
|
)
|
|
185
185
|
), Zs = (e, t) => t.isInStorybook ? !1 : e, Ys = (e, t) => (
|
|
186
186
|
// Short-circuit quickly if file doesn't look like the one we want to exclude
|
|
187
|
-
e.filePath.endsWith(
|
|
188
|
-
),
|
|
187
|
+
e.filePath.endsWith(zt) && e.filePath === u.join(t.dir.dist, zt) ? !1 : e
|
|
188
|
+
), zt = "lumina.d.ts", er = (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
191
|
}, Et = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."), tr = (e) => Et(e.filePath) || e.filePath.includes(".stories.") || e.filePath.includes(".story.") ? !1 : e, ir = (e) => e.content.includes("__esri.") ? {
|
|
@@ -211,7 +211,7 @@ ${e.content}`
|
|
|
211
211
|
const t = e.content.match(rr)?.[1] ?? e.content.match(or)?.[1];
|
|
212
212
|
if (t !== void 0)
|
|
213
213
|
throw Error(
|
|
214
|
-
|
|
214
|
+
w(
|
|
215
215
|
"@arcgis/lumina:failOnJsonImport",
|
|
216
216
|
`Found a .json import (${t}). This can cause TypeScript errors for consumers of your package. See alternative options: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2047
|
|
217
217
|
File content:
|
|
@@ -232,7 +232,7 @@ function cr(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 Gi(e, t, i, n) {
|
|
236
236
|
const s = {
|
|
237
237
|
compiler: e,
|
|
238
238
|
apiModule: e.isInPuppeteerTestBackEnd ? void 0 : cr(i.fileName, e.dir.root, e.privateApiJson),
|
|
@@ -262,7 +262,7 @@ const lr = (e, t) => o.factory.updateSourceFile(
|
|
|
262
262
|
e.typeReferenceDirectives,
|
|
263
263
|
e.hasNoDefaultLib,
|
|
264
264
|
e.libReferenceDirectives
|
|
265
|
-
), dr = (e) => `${
|
|
265
|
+
), dr = (e) => `${qt}${" ".repeat(e.length - qt.length - Gt.length)}${Gt}`, qt = "/*", Gt = "*/", pr = (e) => e.statements.map(yr), ur = "@arcgis/lumina", mr = "LitElement", fr = "PublicLitElement", Vi = "TargetedEvent";
|
|
266
266
|
function yr(e) {
|
|
267
267
|
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text === ur && e.importClause?.namedBindings && o.isNamedImports(e.importClause.namedBindings)) {
|
|
268
268
|
const t = e.importClause.namedBindings.elements.findIndex(
|
|
@@ -290,7 +290,7 @@ function yr(e) {
|
|
|
290
290
|
o.factory.createImportSpecifier(
|
|
291
291
|
!e.importClause.isTypeOnly,
|
|
292
292
|
void 0,
|
|
293
|
-
o.factory.createIdentifier(
|
|
293
|
+
o.factory.createIdentifier(Vi)
|
|
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 Xi = "_setterTypes";
|
|
304
|
+
function gr(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(Xi),
|
|
308
308
|
void 0,
|
|
309
309
|
o.factory.createTypeLiteralNode(
|
|
310
310
|
e.map((n) => {
|
|
311
|
-
const [s, r] =
|
|
311
|
+
const [s, r] = hr(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 hr(e, t, i) {
|
|
|
320
320
|
void 0
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function hr(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,
|
|
@@ -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
|
|
345
|
-
|
|
344
|
+
const g = n.members[y], h = br(g, r, l, c, t);
|
|
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
|
-
const
|
|
349
|
-
|
|
350
|
-
}), l.length > 0 && d.push(
|
|
348
|
+
const g = X(y.name);
|
|
349
|
+
g !== void 0 && c.has(g) && d.push(Tr(y));
|
|
350
|
+
}), l.length > 0 && d.push(gr(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 br(e, t, i, n, s) {
|
|
382
382
|
const r = X(e.name);
|
|
383
383
|
if (r === void 0)
|
|
384
384
|
return;
|
|
@@ -393,7 +393,7 @@ function wr(e, t, i, n, s) {
|
|
|
393
393
|
return;
|
|
394
394
|
const d = o.factory.updatePropertyDeclaration(
|
|
395
395
|
e,
|
|
396
|
-
|
|
396
|
+
Qt(e.modifiers),
|
|
397
397
|
e.name,
|
|
398
398
|
void 0,
|
|
399
399
|
Er(e.type, s),
|
|
@@ -407,19 +407,19 @@ function wr(e, t, i, n, s) {
|
|
|
407
407
|
if (a.readonly === !0) {
|
|
408
408
|
const l = o.factory.updatePropertyDeclaration(
|
|
409
409
|
e,
|
|
410
|
-
|
|
410
|
+
Qt(e.modifiers),
|
|
411
411
|
e.name,
|
|
412
412
|
void 0,
|
|
413
|
-
|
|
413
|
+
Xt(n, e.type, s),
|
|
414
414
|
e.initializer
|
|
415
415
|
);
|
|
416
416
|
return o.setSyntheticLeadingComments(l, V(a)), l;
|
|
417
417
|
} else if (a.getterType !== void 0) {
|
|
418
|
-
const l =
|
|
418
|
+
const l = Vt.exec(a.getterType.text)?.groups;
|
|
419
419
|
if (l === void 0)
|
|
420
420
|
return C.error(
|
|
421
421
|
"@arcgis/lumina:transformComponentMembers",
|
|
422
|
-
`Expected bound accessor getter type to match ${
|
|
422
|
+
`Expected bound accessor getter type to match ${Vt}, but got ${a.getterType.text}`,
|
|
423
423
|
s.fileName
|
|
424
424
|
), e;
|
|
425
425
|
n.add(l.accessor);
|
|
@@ -457,7 +457,7 @@ function wr(e, t, i, n, s) {
|
|
|
457
457
|
)
|
|
458
458
|
];
|
|
459
459
|
} else
|
|
460
|
-
return
|
|
460
|
+
return Xt(n, e.type, s), o.setSyntheticLeadingComments(e, V(a)), e;
|
|
461
461
|
else if (o.isGetAccessor(e) || o.isSetAccessor(e)) {
|
|
462
462
|
if (o.isSetAccessor(e)) {
|
|
463
463
|
if (a.readonly === !0)
|
|
@@ -473,17 +473,17 @@ function wr(e, t, i, n, s) {
|
|
|
473
473
|
} else if (o.isMethodDeclaration(e))
|
|
474
474
|
return o.setSyntheticLeadingComments(e, V(a)), e;
|
|
475
475
|
}
|
|
476
|
-
const
|
|
477
|
-
function
|
|
478
|
-
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(
|
|
476
|
+
const Vt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
477
|
+
function Xt(e, t, i) {
|
|
478
|
+
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(wr) ?? [];
|
|
479
479
|
for (const r of s)
|
|
480
480
|
e.add(r);
|
|
481
481
|
return t;
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const wr = /(?<=this.)[\w$]+/gu;
|
|
484
484
|
function Tr(e) {
|
|
485
485
|
if (o.setEmitFlags(e, o.EmitFlags.NoComments), o.isPropertyDeclaration(e)) {
|
|
486
|
-
const t =
|
|
486
|
+
const t = ke(e.modifiers);
|
|
487
487
|
if (t !== e.modifiers)
|
|
488
488
|
return o.factory.updatePropertyDeclaration(
|
|
489
489
|
e,
|
|
@@ -494,7 +494,7 @@ function Tr(e) {
|
|
|
494
494
|
e.initializer
|
|
495
495
|
);
|
|
496
496
|
} else if (o.isGetAccessor(e)) {
|
|
497
|
-
const t =
|
|
497
|
+
const t = ke(e.modifiers);
|
|
498
498
|
if (t !== e.modifiers)
|
|
499
499
|
return o.factory.updateGetAccessorDeclaration(
|
|
500
500
|
e,
|
|
@@ -505,11 +505,11 @@ function Tr(e) {
|
|
|
505
505
|
e.body
|
|
506
506
|
);
|
|
507
507
|
} else if (o.isSetAccessor(e)) {
|
|
508
|
-
const t =
|
|
508
|
+
const t = ke(e.modifiers);
|
|
509
509
|
if (t !== e.modifiers)
|
|
510
510
|
return o.factory.updateSetAccessorDeclaration(e, t, e.name, e.parameters, e.body);
|
|
511
511
|
} else if (o.isMethodDeclaration(e)) {
|
|
512
|
-
const t =
|
|
512
|
+
const t = ke(e.modifiers);
|
|
513
513
|
if (t !== e.modifiers)
|
|
514
514
|
return o.factory.updateMethodDeclaration(
|
|
515
515
|
e,
|
|
@@ -525,10 +525,10 @@ function Tr(e) {
|
|
|
525
525
|
}
|
|
526
526
|
return e;
|
|
527
527
|
}
|
|
528
|
-
function
|
|
528
|
+
function Qt(e) {
|
|
529
529
|
return e?.some((i) => i.kind === o.SyntaxKind.ReadonlyKeyword) ? e : [o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword), ...e ?? []];
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function ke(e) {
|
|
532
532
|
return e?.some((i) => i.kind === o.SyntaxKind.PrivateKeyword) ? e : [
|
|
533
533
|
o.factory.createModifier(o.SyntaxKind.PrivateKeyword),
|
|
534
534
|
...(e ?? []).filter(
|
|
@@ -540,7 +540,7 @@ function Er(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(Vi, [
|
|
544
544
|
o.factory.createThisTypeNode(),
|
|
545
545
|
...i
|
|
546
546
|
]) : (C.warn(
|
|
@@ -549,12 +549,12 @@ function Er(e, t) {
|
|
|
549
549
|
t.fileName
|
|
550
550
|
), e);
|
|
551
551
|
}
|
|
552
|
-
const Cr = [pr, vr],
|
|
552
|
+
const Cr = [pr, vr], Zt = "@arcgis/lumina:componentDtsTransformer";
|
|
553
553
|
function $r(e) {
|
|
554
554
|
let t;
|
|
555
555
|
const i = Pr(e);
|
|
556
556
|
return {
|
|
557
|
-
name:
|
|
557
|
+
name: Zt,
|
|
558
558
|
supports(n) {
|
|
559
559
|
return t ??= new Set(e.componentFiles), n.endsWith(".tsx") && t.has(n);
|
|
560
560
|
},
|
|
@@ -563,7 +563,7 @@ function $r(e) {
|
|
|
563
563
|
return [];
|
|
564
564
|
const s = e.typeScriptProgram.getSourceFile(n);
|
|
565
565
|
if (s === void 0)
|
|
566
|
-
throw Error(
|
|
566
|
+
throw Error(w(Zt, `Could not find source file: ${Y(n)}`));
|
|
567
567
|
const r = [];
|
|
568
568
|
return e.typeScriptProgram.emit(
|
|
569
569
|
s,
|
|
@@ -580,19 +580,19 @@ function $r(e) {
|
|
|
580
580
|
}
|
|
581
581
|
};
|
|
582
582
|
}
|
|
583
|
-
const Pr = (e) => (t) => (i) =>
|
|
583
|
+
const Pr = (e) => (t) => (i) => Gi(e, t, i, [
|
|
584
584
|
...Cr,
|
|
585
585
|
...e.options.types?.declarationAstTransformers ?? []
|
|
586
586
|
]), xr = (e) => new Proxy(e, {
|
|
587
|
-
get:
|
|
588
|
-
set:
|
|
587
|
+
get: kr,
|
|
588
|
+
set: Ar
|
|
589
589
|
});
|
|
590
|
-
function
|
|
590
|
+
function kr(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 Ar(e, t) {
|
|
596
596
|
throw new Error(`Unexpectedly tried to set the ${String(t)} property.`);
|
|
597
597
|
}
|
|
598
598
|
function Ir(e) {
|
|
@@ -673,7 +673,7 @@ function Ir(e) {
|
|
|
673
673
|
}
|
|
674
674
|
};
|
|
675
675
|
}
|
|
676
|
-
const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag",
|
|
676
|
+
const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Re = Symbol("dynamic html tag name"), ft = Symbol("dynamic svg tag name"), Qi = /* @__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", je = Symbol(
|
|
|
694
694
|
"resource",
|
|
695
695
|
"typeof",
|
|
696
696
|
"vocab"
|
|
697
|
-
]),
|
|
697
|
+
]), Zi = /* @__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", je = 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
|
+
}, W = {
|
|
725
725
|
common: {
|
|
726
726
|
reflected: {
|
|
727
727
|
hidden: "hidden",
|
|
@@ -1534,9 +1534,9 @@ const Lr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", je = Symbol(
|
|
|
1534
1534
|
}
|
|
1535
1535
|
}
|
|
1536
1536
|
};
|
|
1537
|
-
|
|
1538
|
-
Object.values(
|
|
1539
|
-
function
|
|
1537
|
+
Yi(W.common);
|
|
1538
|
+
Object.values(W.perElement).forEach(Yi);
|
|
1539
|
+
function Yi(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 en(e) {
|
|
|
1545
1545
|
e.stringifiedNonReflected
|
|
1546
1546
|
));
|
|
1547
1547
|
}
|
|
1548
|
-
const
|
|
1548
|
+
const Yt = /* @__PURE__ */ new Set(["itemScope"]), en = /* @__PURE__ */ new Set([
|
|
1549
1549
|
"abort",
|
|
1550
1550
|
"animationCancel",
|
|
1551
1551
|
"animationEnd",
|
|
@@ -1785,22 +1785,22 @@ const ei = /* @__PURE__ */ new Set(["itemScope"]), tn = /* @__PURE__ */ new Set(
|
|
|
1785
1785
|
// special case for CRLFs in backticks
|
|
1786
1786
|
})
|
|
1787
1787
|
);
|
|
1788
|
-
function
|
|
1788
|
+
function tn(e) {
|
|
1789
1789
|
return `\\u${`0000${e.toString(Mr).toUpperCase()}`.slice(-4)}`;
|
|
1790
1790
|
}
|
|
1791
1791
|
const Mr = 16;
|
|
1792
1792
|
function Or(e, t, i) {
|
|
1793
|
-
if (e.charCodeAt(0) ===
|
|
1793
|
+
if (e.charCodeAt(0) === Wr) {
|
|
1794
1794
|
const n = i.charCodeAt(t + e.length);
|
|
1795
1795
|
return n >= _r && n <= Hr ? "\\x00" : "\\0";
|
|
1796
1796
|
}
|
|
1797
|
-
return Rr.get(e) ||
|
|
1797
|
+
return Rr.get(e) || tn(e.charCodeAt(0));
|
|
1798
1798
|
}
|
|
1799
|
-
const Jr = (e) => e.replace(jr, Or),
|
|
1799
|
+
const Jr = (e) => e.replace(jr, Or), ei = /[^\u0000-\u007F]/g;
|
|
1800
1800
|
function Kr(e) {
|
|
1801
|
-
return e = Jr(e),
|
|
1801
|
+
return e = Jr(e), ei.test(e) ? e.replace(ei, (t) => tn(t.charCodeAt(0))) : e;
|
|
1802
1802
|
}
|
|
1803
|
-
const
|
|
1803
|
+
const Br = Kr, Wr = 0, _r = 48, Hr = 57, Ur = /\$\{/gu, zr = (e) => e.replace(Ur, "\\${");
|
|
1804
1804
|
function qr(e) {
|
|
1805
1805
|
if (e.length === 0)
|
|
1806
1806
|
return "";
|
|
@@ -1814,13 +1814,13 @@ function qr(e) {
|
|
|
1814
1814
|
}
|
|
1815
1815
|
return e.trim().length === 0 ? t : e;
|
|
1816
1816
|
}
|
|
1817
|
-
const
|
|
1817
|
+
const ze = (e) => zr(Br(e)), Gr = (e) => !Vr.test(e), Vr = /^[^\s"'=<>`]+$/u, Xr = /[&<>]/gu, Qr = {
|
|
1818
1818
|
"&": "&",
|
|
1819
1819
|
"<": "<",
|
|
1820
1820
|
">": ">"
|
|
1821
|
-
},
|
|
1822
|
-
(await e.componentFilesPromise).map((t) => [
|
|
1823
|
-
),
|
|
1821
|
+
}, nn = (e) => e.replace(Xr, (t) => Qr[t]), Pt = (e) => typeof e == "string" && e.includes("-") && !Dr.has(e), Zr = async (e) => Object.fromEntries(
|
|
1822
|
+
(await e.componentFilesPromise).map((t) => [sn(t), t])
|
|
1823
|
+
), sn = (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
1824
|
if (String(n).includes("ENOENT"))
|
|
1825
1825
|
return C.error("@arcgis/lumina", `Unable to find the ${i} directory (cwd: ${process.cwd()})`), [];
|
|
1826
1826
|
throw n;
|
|
@@ -1829,31 +1829,31 @@ const Ue = (e) => zr(Wr(e)), Gr = (e) => !Vr.test(e), Vr = /^[^\s"'=<>`]+$/u, Xr
|
|
|
1829
1829
|
if (!a.endsWith(".tsx"))
|
|
1830
1830
|
return;
|
|
1831
1831
|
const c = u.join(i, a);
|
|
1832
|
-
if (
|
|
1832
|
+
if (he(c, t))
|
|
1833
1833
|
return c;
|
|
1834
1834
|
a.endsWith(".stories.tsx") && c.startsWith(t) && s.push(c);
|
|
1835
1835
|
}).filter(j);
|
|
1836
1836
|
return e.componentFiles = r, e.componentStoryFiles = s, r;
|
|
1837
1837
|
});
|
|
1838
|
-
function
|
|
1838
|
+
function he(e, t) {
|
|
1839
1839
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
1840
1840
|
return !1;
|
|
1841
1841
|
const [i, n] = e.slice(0, -4).split(u.sep).slice(Yr);
|
|
1842
1842
|
return i === n;
|
|
1843
1843
|
}
|
|
1844
|
-
const Yr = -2,
|
|
1845
|
-
eo(
|
|
1846
|
-
to(
|
|
1847
|
-
io(
|
|
1848
|
-
const me =
|
|
1844
|
+
const Yr = -2, ti = 5, ii = 1, ni = 1, si = 3, ri = 4, qe = o;
|
|
1845
|
+
eo(qe.createSourceMapGenerator);
|
|
1846
|
+
to(qe.createTextWriter);
|
|
1847
|
+
io(qe.getNewLineCharacter);
|
|
1848
|
+
const me = qe;
|
|
1849
1849
|
function eo(e) {
|
|
1850
1850
|
if (typeof e != "function")
|
|
1851
1851
|
throw new Error(
|
|
1852
1852
|
"Failed to find ts.createSourceMapGenerator() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1853
1853
|
);
|
|
1854
|
-
if (e.length !==
|
|
1854
|
+
if (e.length !== ti)
|
|
1855
1855
|
throw new Error(
|
|
1856
|
-
`ts.createSourceMapGenerator() signature changed. Expected ${
|
|
1856
|
+
`ts.createSourceMapGenerator() signature changed. Expected ${ti} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1857
1857
|
);
|
|
1858
1858
|
}
|
|
1859
1859
|
function to(e) {
|
|
@@ -1861,9 +1861,9 @@ function to(e) {
|
|
|
1861
1861
|
throw new Error(
|
|
1862
1862
|
"Failed to find ts.createTextWriter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1863
1863
|
);
|
|
1864
|
-
if (e.length !==
|
|
1864
|
+
if (e.length !== ii)
|
|
1865
1865
|
throw new Error(
|
|
1866
|
-
`ts.createTextWriter() signature changed. Expected ${
|
|
1866
|
+
`ts.createTextWriter() signature changed. Expected ${ii} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1867
1867
|
);
|
|
1868
1868
|
}
|
|
1869
1869
|
function io(e) {
|
|
@@ -1871,9 +1871,9 @@ function io(e) {
|
|
|
1871
1871
|
throw new Error(
|
|
1872
1872
|
"Failed to find ts.getNewLineCharacter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1873
1873
|
);
|
|
1874
|
-
if (e.length !==
|
|
1874
|
+
if (e.length !== ni)
|
|
1875
1875
|
throw new Error(
|
|
1876
|
-
`ts.getNewLineCharacter() signature changed. Expected ${
|
|
1876
|
+
`ts.getNewLineCharacter() signature changed. Expected ${ni} argument. Lumina needs to be updated to support the new TypeScript version`
|
|
1877
1877
|
);
|
|
1878
1878
|
}
|
|
1879
1879
|
function no(e) {
|
|
@@ -1881,9 +1881,9 @@ function no(e) {
|
|
|
1881
1881
|
throw new Error(
|
|
1882
1882
|
"Failed to find ts.Printer.writeFile() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1883
1883
|
);
|
|
1884
|
-
if (e.length !==
|
|
1884
|
+
if (e.length !== si)
|
|
1885
1885
|
throw new Error(
|
|
1886
|
-
`ts.Printer.writeFile() signature changed. Expected ${
|
|
1886
|
+
`ts.Printer.writeFile() signature changed. Expected ${si} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1887
1887
|
);
|
|
1888
1888
|
}
|
|
1889
1889
|
function so(e) {
|
|
@@ -1891,17 +1891,17 @@ function so(e) {
|
|
|
1891
1891
|
throw new Error(
|
|
1892
1892
|
"Failed to find ts.Printer.writeNode() function. Lumina needs to be updated to support the new TypeScript version"
|
|
1893
1893
|
);
|
|
1894
|
-
if (e.length !==
|
|
1894
|
+
if (e.length !== ri)
|
|
1895
1895
|
throw new Error(
|
|
1896
|
-
`ts.Printer.writeNode() signature changed. Expected ${
|
|
1896
|
+
`ts.Printer.writeNode() signature changed. Expected ${ri} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1897
1897
|
);
|
|
1898
1898
|
}
|
|
1899
|
-
function
|
|
1899
|
+
function rn(e) {
|
|
1900
1900
|
const t = me.createPrinter(e);
|
|
1901
1901
|
return no(t.writeFile), so(t.writeNode), t;
|
|
1902
1902
|
}
|
|
1903
|
-
function
|
|
1904
|
-
const t = o.isUnionTypeNode(e) ? e.types.map(
|
|
1903
|
+
function oi(e) {
|
|
1904
|
+
const t = o.isUnionTypeNode(e) ? e.types.map(ai) : [ai(e)], i = new Set(t), n = i.delete("true"), s = i.delete("false");
|
|
1905
1905
|
(n || s) && i.add("boolean");
|
|
1906
1906
|
let r = Array.from(i).sort();
|
|
1907
1907
|
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length > ro))
|
|
@@ -1913,7 +1913,7 @@ const ro = 40, oo = (e) => e?.some(
|
|
|
1913
1913
|
* behavior.
|
|
1914
1914
|
*/
|
|
1915
1915
|
t.type === "any"
|
|
1916
|
-
) ?? !1, ao = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e,
|
|
1916
|
+
) ?? !1, ao = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e, on = (e) => e.map(an).join(" | "), an = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
|
|
1917
1917
|
function co(e) {
|
|
1918
1918
|
return e === "boolean" ? { type: "boolean" } : Number.isNaN(Number.parseFloat(e)) ? e.startsWith('"') || e.startsWith("'") ? {
|
|
1919
1919
|
value: e.slice(1, -1),
|
|
@@ -1927,7 +1927,7 @@ function co(e) {
|
|
|
1927
1927
|
}
|
|
1928
1928
|
const lo = (e, t, i, n) => {
|
|
1929
1929
|
const s = e.typeScriptTypeChecker, r = o.isSetAccessor(t) ? t.parameters[0] : t, a = s.getTypeAtLocation(r), c = !i;
|
|
1930
|
-
return
|
|
1930
|
+
return Me(s, a, n, e.dir, c);
|
|
1931
1931
|
};
|
|
1932
1932
|
function po(e, t) {
|
|
1933
1933
|
if (e.length === 0)
|
|
@@ -1940,35 +1940,35 @@ function po(e, t) {
|
|
|
1940
1940
|
return n.length === 0 ? void 0 : n;
|
|
1941
1941
|
}
|
|
1942
1942
|
const uo = /"[^"]+"|'[^"]+'|\w+/gu;
|
|
1943
|
-
function
|
|
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 =
|
|
1943
|
+
function Me(e, t, i, n, s = !1) {
|
|
1944
|
+
let { typeNode: r, references: a } = li(e, t, i, n), c = oi(r);
|
|
1945
|
+
c === void 0 && ({ typeNode: r, references: a } = li(e, t, i, n, !1), c = oi(r) ?? []);
|
|
1946
|
+
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d = on(l), p = ao(l), m = po(a, d);
|
|
1947
1947
|
return {
|
|
1948
1948
|
text: d,
|
|
1949
1949
|
references: m,
|
|
1950
1950
|
values: p
|
|
1951
1951
|
};
|
|
1952
1952
|
}
|
|
1953
|
-
function
|
|
1953
|
+
function ai(e) {
|
|
1954
1954
|
mo.writeNode(o.EmitHint.Unspecified, e, void 0, nt);
|
|
1955
1955
|
const t = nt.getText();
|
|
1956
1956
|
return nt.clear(), t;
|
|
1957
1957
|
}
|
|
1958
|
-
const mo =
|
|
1959
|
-
`),
|
|
1960
|
-
function
|
|
1958
|
+
const mo = rn({ removeComments: !0 }), nt = me.createTextWriter(`
|
|
1959
|
+
`), cn = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, fo = cn & o.TypeFormatFlags.NodeBuilderFlagsMask, yo = fo | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
1960
|
+
function go(e, t, i, n = !0) {
|
|
1961
1961
|
const s = /* @__PURE__ */ new Map();
|
|
1962
1962
|
se(t, s, i, n);
|
|
1963
|
-
const r = t.flags & o.TypeFlags.Union ? t.types.every(
|
|
1963
|
+
const r = t.flags & o.TypeFlags.Union ? t.types.every(ci) : ci(t), a = e.typeToTypeNode(
|
|
1964
1964
|
t,
|
|
1965
1965
|
void 0,
|
|
1966
1966
|
yo & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
1967
1967
|
);
|
|
1968
|
-
return s.forEach(
|
|
1968
|
+
return s.forEach(ho), 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
1969
|
}
|
|
1970
|
-
const
|
|
1971
|
-
function
|
|
1970
|
+
const ci = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
1971
|
+
function li(e, t, i, n, s = !0) {
|
|
1972
1972
|
const r = [], a = /* @__PURE__ */ new Set();
|
|
1973
1973
|
function c(d, p) {
|
|
1974
1974
|
const m = d.aliasSymbol ?? d.symbol;
|
|
@@ -1976,16 +1976,16 @@ function di(e, t, i, n, s = !0) {
|
|
|
1976
1976
|
return;
|
|
1977
1977
|
const f = p ? d.aliasTypeArguments?.[0]?.symbol?.escapedName ?? "" : m.name;
|
|
1978
1978
|
if (f.startsWith("_")) {
|
|
1979
|
-
const
|
|
1980
|
-
if (
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
1979
|
+
const g = m.declarations?.[0];
|
|
1980
|
+
if (g?.kind === o.SyntaxKind.FunctionType) {
|
|
1981
|
+
const h = g;
|
|
1982
|
+
if (h.parameters.forEach((v) => {
|
|
1983
1983
|
if (v.type === void 0)
|
|
1984
1984
|
return;
|
|
1985
1985
|
const S = e.getTypeFromTypeNode(v.type);
|
|
1986
1986
|
se(S, /* @__PURE__ */ new Map(), c, !1);
|
|
1987
|
-
}),
|
|
1988
|
-
const v = e.getTypeFromTypeNode(
|
|
1987
|
+
}), h.type !== void 0) {
|
|
1988
|
+
const v = e.getTypeFromTypeNode(h.type);
|
|
1989
1989
|
se(v, /* @__PURE__ */ new Map(), c, !1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
@@ -2000,7 +2000,7 @@ function di(e, t, i, n, s = !0) {
|
|
|
2000
2000
|
} : vo(m, f, i, n);
|
|
2001
2001
|
r.push(y), a.add(f);
|
|
2002
2002
|
}
|
|
2003
|
-
return { typeNode:
|
|
2003
|
+
return { typeNode: go(e, t, c, s), references: r };
|
|
2004
2004
|
}
|
|
2005
2005
|
function se(e, t, i, n = !0) {
|
|
2006
2006
|
if (typeof e != "object" || e === null || !("checker" in e))
|
|
@@ -2030,7 +2030,7 @@ function se(e, t, i, n = !0) {
|
|
|
2030
2030
|
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
2031
|
});
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function ho(e, t) {
|
|
2034
2034
|
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
2035
|
}
|
|
2036
2036
|
function vo(e, t, i, n) {
|
|
@@ -2051,7 +2051,7 @@ function vo(e, t, i, n) {
|
|
|
2051
2051
|
if (s.length === 0)
|
|
2052
2052
|
return {
|
|
2053
2053
|
name: t,
|
|
2054
|
-
package:
|
|
2054
|
+
package: Ki,
|
|
2055
2055
|
module: void 0
|
|
2056
2056
|
};
|
|
2057
2057
|
const { packageName: r, moduleName: a } = So(s[0].fileName, n);
|
|
@@ -2059,7 +2059,7 @@ function vo(e, t, i, n) {
|
|
|
2059
2059
|
name: t,
|
|
2060
2060
|
package: r,
|
|
2061
2061
|
module: a.length > 0 ? a : void 0,
|
|
2062
|
-
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ?
|
|
2062
|
+
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ? di(e, s[0], "core") : r === "typescript" ? di(e, s[0], "typescript") : void 0
|
|
2063
2063
|
} : {
|
|
2064
2064
|
name: t,
|
|
2065
2065
|
package: void 0,
|
|
@@ -2070,7 +2070,7 @@ function So(e, t) {
|
|
|
2070
2070
|
const i = e.split("/node_modules/");
|
|
2071
2071
|
if (i.length > 1) {
|
|
2072
2072
|
const a = i.at(-1);
|
|
2073
|
-
return
|
|
2073
|
+
return ln(a);
|
|
2074
2074
|
}
|
|
2075
2075
|
const s = e.split("/dist/");
|
|
2076
2076
|
if (s.length > 1) {
|
|
@@ -2079,36 +2079,36 @@ function So(e, t) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
return {
|
|
2081
2081
|
packageName: void 0,
|
|
2082
|
-
moduleName: u.relative(t.root, bo(
|
|
2082
|
+
moduleName: u.relative(t.root, wo(bo(e, t)))
|
|
2083
2083
|
};
|
|
2084
2084
|
}
|
|
2085
|
-
function
|
|
2086
|
-
return
|
|
2085
|
+
function bo(e, t) {
|
|
2086
|
+
return he(e, t.srcComponents) ? u.join(t.dist, sn(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2087
2087
|
}
|
|
2088
|
-
const
|
|
2089
|
-
function
|
|
2088
|
+
const wo = (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`;
|
|
2089
|
+
function ln(e) {
|
|
2090
2090
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2091
2091
|
return { packageName: s, moduleName: r };
|
|
2092
2092
|
}
|
|
2093
2093
|
const To = (e) => e.includes("/node_modules/") || e.includes("/dist/");
|
|
2094
|
-
function
|
|
2094
|
+
function di(e, t, i) {
|
|
2095
2095
|
const n = e.declarations;
|
|
2096
2096
|
if (n !== void 0)
|
|
2097
2097
|
for (const s of n) {
|
|
2098
|
-
const r =
|
|
2098
|
+
const r = pi(s, t, i);
|
|
2099
2099
|
if (r !== void 0)
|
|
2100
2100
|
return r;
|
|
2101
2101
|
if (!("members" in s))
|
|
2102
2102
|
continue;
|
|
2103
2103
|
const a = s.members;
|
|
2104
2104
|
for (const c of a) {
|
|
2105
|
-
const l =
|
|
2105
|
+
const l = pi(c, t, i);
|
|
2106
2106
|
if (l !== void 0)
|
|
2107
2107
|
return Eo(l);
|
|
2108
2108
|
}
|
|
2109
2109
|
}
|
|
2110
2110
|
}
|
|
2111
|
-
function
|
|
2111
|
+
function pi(e, t, i) {
|
|
2112
2112
|
const n = e.jsDoc?.[0];
|
|
2113
2113
|
if (n !== void 0)
|
|
2114
2114
|
return ye([n, ...n.tags ?? []], ({ comment: s }) => {
|
|
@@ -2137,24 +2137,24 @@ function Co(e) {
|
|
|
2137
2137
|
}
|
|
2138
2138
|
return t.length === 0 ? void 0 : t;
|
|
2139
2139
|
}
|
|
2140
|
-
const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\*? ?/gu, xo = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"],
|
|
2140
|
+
const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\*? ?/gu, xo = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], Oe = new RegExp(`\\.(${xo.join("|")})(\\?|$)`, "u"), ko = /^import ["'](?<specifier>[^"']+)["'];$/gmu, Ao = () => "throwError", te = "@arcgis/lumina:loadLitCss", Q = "?layered", Fe = "?global", Io = (e) => ({
|
|
2141
2141
|
name: te,
|
|
2142
2142
|
enforce: "pre",
|
|
2143
2143
|
configResolved(t) {
|
|
2144
2144
|
const i = t.plugins.find(({ name: s }) => s === "vite:css-post");
|
|
2145
2145
|
if (i === void 0)
|
|
2146
|
-
throw Error(
|
|
2146
|
+
throw Error(w(te, "Unable to find the vite's built-in vite:css-post plugin"));
|
|
2147
2147
|
const n = i.transform;
|
|
2148
2148
|
if (typeof n != "function")
|
|
2149
|
-
throw Error(
|
|
2149
|
+
throw Error(w(te, "Expected vite:css-post to declare a transform() function"));
|
|
2150
2150
|
i.transform = async function(r, a) {
|
|
2151
2151
|
const c = a.endsWith(Q);
|
|
2152
2152
|
c && (a = a.slice(0, -Q.length));
|
|
2153
|
-
const l = a.endsWith(
|
|
2154
|
-
if (l && (a = a.slice(0, -
|
|
2153
|
+
const l = a.endsWith(Fe);
|
|
2154
|
+
if (l && (a = a.slice(0, -Fe.length)), !Oe.test(a) || a.includes("?"))
|
|
2155
2155
|
return await n.call(this, r, a);
|
|
2156
2156
|
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(
|
|
2157
|
+
if (typeof m != "string" || !m.startsWith(dn) || !m.endsWith(pn))
|
|
2158
2158
|
return C.warn(
|
|
2159
2159
|
te,
|
|
2160
2160
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
@@ -2162,21 +2162,21 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2162
2162
|
)}`
|
|
2163
2163
|
), p;
|
|
2164
2164
|
if (l)
|
|
2165
|
-
return e._globalCssString =
|
|
2165
|
+
return e._globalCssString = un(m), { code: "", map: { mappings: "" } };
|
|
2166
2166
|
{
|
|
2167
2167
|
const y = e.isFullApiExtraction ? Co(r) : void 0;
|
|
2168
2168
|
if (y !== void 0) {
|
|
2169
2169
|
e._cssDocs ??= /* @__PURE__ */ new Map(), e._cssDocs.set(a, y);
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
for (const
|
|
2173
|
-
if (
|
|
2174
|
-
if (
|
|
2175
|
-
|
|
2170
|
+
const g = e._cssImports.get(a);
|
|
2171
|
+
if (g !== void 0) {
|
|
2172
|
+
for (const h of e.apiJsonComponents)
|
|
2173
|
+
if (g.has(h.tagName))
|
|
2174
|
+
if (h.cssProperties === void 0)
|
|
2175
|
+
h.cssProperties = Array.from(y);
|
|
2176
2176
|
else {
|
|
2177
|
-
const v = new Set(
|
|
2178
|
-
|
|
2179
|
-
...
|
|
2177
|
+
const v = new Set(h.cssProperties.map((S) => S.name));
|
|
2178
|
+
h.cssProperties = [
|
|
2179
|
+
...h.cssProperties,
|
|
2180
2180
|
...y.filter((S) => !v.has(S.name))
|
|
2181
2181
|
];
|
|
2182
2182
|
}
|
|
@@ -2200,14 +2200,14 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2200
2200
|
let s = 0;
|
|
2201
2201
|
const r = To(i);
|
|
2202
2202
|
let a = !1;
|
|
2203
|
-
const c = t.replaceAll(
|
|
2204
|
-
if (!
|
|
2203
|
+
const c = t.replaceAll(ko, (l, d) => {
|
|
2204
|
+
if (!Oe.test(d) || d.includes("?"))
|
|
2205
2205
|
return l;
|
|
2206
2206
|
if (r) {
|
|
2207
|
-
if ((e.options.css?.sideEffectImportHandling ??
|
|
2207
|
+
if ((e.options.css?.sideEffectImportHandling ?? Ao)(d, i) === "drop")
|
|
2208
2208
|
return a = !0, dr(l);
|
|
2209
2209
|
throw Error(
|
|
2210
|
-
|
|
2210
|
+
w(
|
|
2211
2211
|
te,
|
|
2212
2212
|
`Found a side-effect CSS import \`${l}\`. Such import is not allowed as it won't work with shadow DOM. This file appears to be external so such import may not be under your control. To ignore this import, please set the css.sideEffectImportHandling property in useLumina() plugin to a function that will return "drop" for this import to indicate that you wish to have this style import dropped. Then, you would have to import the dropped manually in your component like so: \`import { styles } from "example.css";\` and then add \`static override styles = styles;\` to your component`,
|
|
2213
2213
|
i
|
|
@@ -2228,10 +2228,10 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2228
2228
|
".styleSheet];"
|
|
2229
2229
|
].join("");
|
|
2230
2230
|
} else {
|
|
2231
|
-
if (d.endsWith(
|
|
2231
|
+
if (d.endsWith(Fe))
|
|
2232
2232
|
return l;
|
|
2233
2233
|
throw Error(
|
|
2234
|
-
|
|
2234
|
+
w(
|
|
2235
2235
|
te,
|
|
2236
2236
|
`Found a side-effect CSS import \`${l}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "example.css";\` instead and then add \`static override styles = styles;\` to your component`,
|
|
2237
2237
|
i
|
|
@@ -2244,7 +2244,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2244
2244
|
map: null
|
|
2245
2245
|
} : void 0;
|
|
2246
2246
|
}
|
|
2247
|
-
}),
|
|
2247
|
+
}), dn = 'export default "', pn = '"', Lo = "import { css } from '@lit/reactive-element/css-tag.js';\nexport const styles = css`", Fo = "`;\nexport default styles;", No = `
|
|
2248
2248
|
|
|
2249
2249
|
if(import.meta.hot) {
|
|
2250
2250
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -2255,9 +2255,9 @@ if(import.meta.hot) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
2257
2257
|
});
|
|
2258
|
-
}`,
|
|
2258
|
+
}`, un = (e) => e.slice(dn.length, -pn.length);
|
|
2259
2259
|
function Do(e, t, i, n) {
|
|
2260
|
-
const r =
|
|
2260
|
+
const r = un(e).replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("\\r", ""), a = ze(jo(r)), c = n ? `@layer{${i ? "" : `
|
|
2261
2261
|
`}${a}${i ? "" : `
|
|
2262
2262
|
`}}` : a;
|
|
2263
2263
|
return `${Lo}${c}${Fo}${t ? No : ""}`;
|
|
@@ -2273,8 +2273,8 @@ const Oo = "@storybook/web-components", Jo = (e) => `JSON.parse(\`${Ko(JSON.stri
|
|
|
2273
2273
|
function Ko(e) {
|
|
2274
2274
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2277
|
-
|
|
2276
|
+
function Bo(e) {
|
|
2277
|
+
Wo(e);
|
|
2278
2278
|
const t = e.options.css?.globalStylesPath;
|
|
2279
2279
|
if (t === void 0)
|
|
2280
2280
|
return "";
|
|
@@ -2282,21 +2282,21 @@ function Wo(e) {
|
|
|
2282
2282
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
2283
2283
|
`import globalStyles from "${i}${Q}";`,
|
|
2284
2284
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
2285
|
-
|
|
2285
|
+
fn("", e)
|
|
2286
2286
|
].join(`
|
|
2287
|
-
`) : `import "${i}${
|
|
2287
|
+
`) : `import "${i}${Fe}";`;
|
|
2288
2288
|
}
|
|
2289
|
-
const
|
|
2290
|
-
function
|
|
2289
|
+
const mn = "hydrated";
|
|
2290
|
+
function Wo(e) {
|
|
2291
2291
|
e._globalHydratedCssString = [
|
|
2292
2292
|
":not([",
|
|
2293
|
-
e.options.css?.hydratedAttribute ??
|
|
2293
|
+
e.options.css?.hydratedAttribute ?? mn,
|
|
2294
2294
|
"]):is(",
|
|
2295
2295
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
2296
2296
|
"){visibility:hidden}"
|
|
2297
2297
|
].join("");
|
|
2298
2298
|
}
|
|
2299
|
-
function
|
|
2299
|
+
function fn(e, t) {
|
|
2300
2300
|
return [
|
|
2301
2301
|
"const globalCss = new CSSStyleSheet;",
|
|
2302
2302
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e || ""}`}}");`,
|
|
@@ -2320,7 +2320,7 @@ function Ho(e) {
|
|
|
2320
2320
|
e.viteCommand === "build" && e.options.build?.ssr?.stencilCompatibility?.enabled === !0 ? 'import "@lit-labs/ssr-client/lit-element-hydrate-support.js";' : "",
|
|
2321
2321
|
'import { runtime } from "./runtime";',
|
|
2322
2322
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
2323
|
-
|
|
2323
|
+
Bo(e),
|
|
2324
2324
|
e.hmrEnabled ? Go : "",
|
|
2325
2325
|
"",
|
|
2326
2326
|
e.isInStorybook ? Mo(e.apiJson) : "",
|
|
@@ -2341,12 +2341,12 @@ export declare const defineCustomElements: import("@arcgis/lumina").DefineCustom
|
|
|
2341
2341
|
"]"
|
|
2342
2342
|
].join("");
|
|
2343
2343
|
function qo(e) {
|
|
2344
|
-
const { properties: t, asyncMethods: i, syncMethods: n } =
|
|
2345
|
-
return d.length > 0 ? `"${d.join(
|
|
2344
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = yn(e), s = t.map((p) => p.join(ks)).join(et), r = i.join(et), a = n.join(et), c = [s, r, a], l = c.findLastIndex((p) => p.length > 0), d = c.slice(0, l + 1);
|
|
2345
|
+
return d.length > 0 ? `"${d.join(As)}"` : "";
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2347
|
+
function yn(e) {
|
|
2348
2348
|
const t = e.members.filter((r) => r.kind === "field").map((r) => {
|
|
2349
|
-
const a = typeof r.attribute == "string", c = a && r.attribute !==
|
|
2349
|
+
const a = typeof r.attribute == "string", c = a && r.attribute !== wt(r.name);
|
|
2350
2350
|
return a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""];
|
|
2351
2351
|
}), i = e.members.filter(
|
|
2352
2352
|
(r) => r.kind === "method" && /**
|
|
@@ -2379,7 +2379,7 @@ function Qo(e, t, i, n, s) {
|
|
|
2379
2379
|
);
|
|
2380
2380
|
return;
|
|
2381
2381
|
}
|
|
2382
|
-
const p = i.getTypeAtLocation(d), m =
|
|
2382
|
+
const p = i.getTypeAtLocation(d), m = Me(i, p, n, s);
|
|
2383
2383
|
t.parameters.push({
|
|
2384
2384
|
name: d.name.text,
|
|
2385
2385
|
default: d.initializer?.getText(n),
|
|
@@ -2389,7 +2389,7 @@ function Qo(e, t, i, n, s) {
|
|
|
2389
2389
|
});
|
|
2390
2390
|
}
|
|
2391
2391
|
t.parameters.length === 0 && (t.parameters = void 0);
|
|
2392
|
-
const a = i.getReturnTypeOfSignature(r), c =
|
|
2392
|
+
const a = i.getReturnTypeOfSignature(r), c = Me(i, a, n, s), l = i.signatureToString(r, e, cn, o.SignatureKind.Call);
|
|
2393
2393
|
ue(e.name, i, t), t.return = {
|
|
2394
2394
|
type: c
|
|
2395
2395
|
}, t.signature = l.replace(" =>", ":");
|
|
@@ -2407,7 +2407,7 @@ function Yo(e, t, i, n) {
|
|
|
2407
2407
|
const m = s.getTypeArguments(p)?.at(0);
|
|
2408
2408
|
if (m === void 0)
|
|
2409
2409
|
continue;
|
|
2410
|
-
const f =
|
|
2410
|
+
const f = Me(s, m, n, i.dir), y = {
|
|
2411
2411
|
name: t,
|
|
2412
2412
|
summary: void 0,
|
|
2413
2413
|
description: void 0,
|
|
@@ -2434,14 +2434,14 @@ function ea(e, t, i) {
|
|
|
2434
2434
|
if (s !== void 0) {
|
|
2435
2435
|
if (!o.isObjectLiteralExpression(s))
|
|
2436
2436
|
throw Error(
|
|
2437
|
-
|
|
2437
|
+
w(
|
|
2438
2438
|
"@arcgis/lumina:extractEventMeta",
|
|
2439
2439
|
`Expected object literal expression as first argument of ${Ae}(). Found ${t.name} = createEvent(${s.getText(i)})`
|
|
2440
2440
|
)
|
|
2441
2441
|
);
|
|
2442
2442
|
if (s.properties.some((r) => o.isSpreadAssignment(r)))
|
|
2443
2443
|
throw Error(
|
|
2444
|
-
|
|
2444
|
+
w(
|
|
2445
2445
|
"@arcgis/lumina:extractEventMeta",
|
|
2446
2446
|
`Unexpected spread syntax in ${Ae}() argument. ${Ae}() arguments must be statically parsable at compile time`
|
|
2447
2447
|
)
|
|
@@ -2456,20 +2456,20 @@ function re(e, t) {
|
|
|
2456
2456
|
if (e.kind === o.SyntaxKind.FalseKeyword)
|
|
2457
2457
|
return !1;
|
|
2458
2458
|
throw Error(
|
|
2459
|
-
|
|
2459
|
+
w(
|
|
2460
2460
|
"@arcgis/lumina:extractBooleanInitializer",
|
|
2461
2461
|
`Expected boolean literal. Instead found ${e?.getText(t)}`
|
|
2462
2462
|
)
|
|
2463
2463
|
);
|
|
2464
2464
|
}
|
|
2465
|
-
const
|
|
2466
|
-
class
|
|
2465
|
+
const kt = "@arcgis/lumina-compiler";
|
|
2466
|
+
class Je extends gs {
|
|
2467
2467
|
constructor(t, i) {
|
|
2468
2468
|
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
2469
|
}
|
|
2470
2470
|
extract(t) {
|
|
2471
2471
|
const i = super.extract(t);
|
|
2472
|
-
return i.compiler.name =
|
|
2472
|
+
return i.compiler.name = kt, i;
|
|
2473
2473
|
}
|
|
2474
2474
|
extractModules(t) {
|
|
2475
2475
|
const i = super.extractModules(t);
|
|
@@ -2480,7 +2480,7 @@ class Oe extends hs {
|
|
|
2480
2480
|
}
|
|
2481
2481
|
extractDeclarations(t) {
|
|
2482
2482
|
return this.localDeclaredComponents = new Map(
|
|
2483
|
-
|
|
2483
|
+
zi(t.text)?.map(([i, n]) => [n, i]) ?? []
|
|
2484
2484
|
), this.localDeclaredComponents.size === 0 ? [] : super.extractDeclarations(t);
|
|
2485
2485
|
}
|
|
2486
2486
|
extractDeclaration(t) {
|
|
@@ -2493,7 +2493,7 @@ class Oe extends hs {
|
|
|
2493
2493
|
}
|
|
2494
2494
|
collectCssImports(t) {
|
|
2495
2495
|
const i = t.moduleSpecifier.text;
|
|
2496
|
-
if (!(i.startsWith(".") &&
|
|
2496
|
+
if (!(i.startsWith(".") && Oe.test(i)))
|
|
2497
2497
|
return;
|
|
2498
2498
|
const s = u.join(this.file.fileName, "..", i);
|
|
2499
2499
|
this.localCssImports ??= /* @__PURE__ */ new Set(), this.localCssImports.add(s);
|
|
@@ -2522,7 +2522,7 @@ class Oe extends hs {
|
|
|
2522
2522
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2523
2523
|
* Stencil's behavior.
|
|
2524
2524
|
*/
|
|
2525
|
-
pascalCaseName:
|
|
2525
|
+
pascalCaseName: ws(n),
|
|
2526
2526
|
privacy: void 0,
|
|
2527
2527
|
importPath: "",
|
|
2528
2528
|
members: [],
|
|
@@ -2535,7 +2535,7 @@ class Oe extends hs {
|
|
|
2535
2535
|
}, r = t.heritageClauses?.find((a) => a.token === o.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;
|
|
2536
2536
|
if (r === void 0)
|
|
2537
2537
|
throw Error(
|
|
2538
|
-
|
|
2538
|
+
w(
|
|
2539
2539
|
"@arcgis/lumina:extractComponentDeclaration",
|
|
2540
2540
|
`Lumina component must extend LitElement class. Found ${i} in ${this.apiModule.path} that does not extend any class.`
|
|
2541
2541
|
)
|
|
@@ -2548,13 +2548,13 @@ class Oe extends hs {
|
|
|
2548
2548
|
}
|
|
2549
2549
|
if (this.apiComponent = s, s.members = this.extractComponentMembers(t), this.context.isFullApiExtraction) {
|
|
2550
2550
|
s.attributes = this.inferAttributes(s.members), this.indexedComponents.set(i, s);
|
|
2551
|
-
const a =
|
|
2551
|
+
const a = Ws(n, this.context, this.apiModule.path);
|
|
2552
2552
|
if (s.importPath = `components/${a}`, this.localCssImports !== void 0) {
|
|
2553
2553
|
for (const f of this.localCssImports) {
|
|
2554
2554
|
const y = this.context._cssImports.get(f);
|
|
2555
2555
|
y === void 0 ? this.context._cssImports.set(f, /* @__PURE__ */ new Set([s.tagName])) : y.add(s.tagName);
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2556
|
+
const g = this.context._cssDocs?.get(f);
|
|
2557
|
+
g !== void 0 && (s.cssProperties = g);
|
|
2558
2558
|
}
|
|
2559
2559
|
this.localCssImports = void 0;
|
|
2560
2560
|
}
|
|
@@ -2620,7 +2620,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2620
2620
|
return i;
|
|
2621
2621
|
}
|
|
2622
2622
|
extractComponentMember(t, i) {
|
|
2623
|
-
if (
|
|
2623
|
+
if (hs(t) || i === void 0) {
|
|
2624
2624
|
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
2625
|
return;
|
|
2626
2626
|
}
|
|
@@ -2649,7 +2649,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2649
2649
|
default: void 0,
|
|
2650
2650
|
deprecated: void 0,
|
|
2651
2651
|
readonly: c || (s ? t.modifiers?.some((d) => d.kind === o.SyntaxKind.ReadonlyKeyword) : o.isGetAccessor(t) && this.pairedSetter === void 0) ? !0 : void 0,
|
|
2652
|
-
attribute: r === !1 ? void 0 : typeof r == "string" ? r :
|
|
2652
|
+
attribute: r === !1 ? void 0 : typeof r == "string" ? r : wt(i),
|
|
2653
2653
|
reflects: a || void 0,
|
|
2654
2654
|
docsTags: void 0,
|
|
2655
2655
|
getterType: void 0,
|
|
@@ -2670,42 +2670,46 @@ ${c}.componentOnReady().then(() => {
|
|
|
2670
2670
|
* When doing full API extraction, extract additional details for a field.
|
|
2671
2671
|
*/
|
|
2672
2672
|
extractComponentFieldDetails(t, i) {
|
|
2673
|
-
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 : Bt(s, r), c = new Set(a?.docsTags.map((
|
|
2673
|
+
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 : Bt(s, r), c = new Set(a?.docsTags.map((h) => h.name) ?? []);
|
|
2674
2674
|
ue(t.name, this.context.typeScriptTypeChecker, i, a);
|
|
2675
2675
|
let l = !n && i.readonly === !0;
|
|
2676
2676
|
const d = this.pairedSetter ?? t, p = i.default;
|
|
2677
|
-
|
|
2678
|
-
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((
|
|
2679
|
-
i.type =
|
|
2677
|
+
Wt(t, i, this.file);
|
|
2678
|
+
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((h) => h.name === "required") ?? !1;
|
|
2679
|
+
i.type = // Messages overrides type can be verbose, so we display a simplified type
|
|
2680
|
+
// in the documentation. The full type is still present in the .d.ts files.
|
|
2681
|
+
i.name === "messageOverrides" ? {
|
|
2682
|
+
text: "Record<string, unknown>"
|
|
2683
|
+
} : lo(this.context, d, f, this.file);
|
|
2680
2684
|
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);
|
|
2681
2685
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
|
|
2682
|
-
const
|
|
2686
|
+
const h = t.initializer, v = s.getSymbolAtLocation(h), S = v !== void 0 && ((v.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(v) : v, E = S?.getDeclarations() ?? [];
|
|
2683
2687
|
if (S !== void 0) {
|
|
2684
|
-
const
|
|
2685
|
-
if (
|
|
2686
|
-
|
|
2688
|
+
const $ = Bt(s, S);
|
|
2689
|
+
if ($.docsTags.length > 0) {
|
|
2690
|
+
$.docsTags = $.docsTags.filter(
|
|
2687
2691
|
(T) => !c.has(T.name) || vs.has(T.name)
|
|
2688
2692
|
);
|
|
2689
|
-
const
|
|
2690
|
-
ue(t.name, s, i,
|
|
2693
|
+
const b = i.description;
|
|
2694
|
+
ue(t.name, s, i, $), $.docsTags.forEach((T) => {
|
|
2691
2695
|
c.add(T.name);
|
|
2692
|
-
}), i.description =
|
|
2696
|
+
}), i.description = b ?? i.description;
|
|
2693
2697
|
} else
|
|
2694
|
-
i.description ||=
|
|
2698
|
+
i.description ||= $.description;
|
|
2695
2699
|
}
|
|
2696
|
-
let
|
|
2697
|
-
E.forEach((
|
|
2698
|
-
if (
|
|
2700
|
+
let x, I;
|
|
2701
|
+
E.forEach(($) => {
|
|
2702
|
+
if (x ??= o.isGetAccessor($) ? $ : void 0, I ??= o.isSetAccessor($) ? $ : void 0, !("initializer" in $))
|
|
2699
2703
|
return;
|
|
2700
|
-
const
|
|
2701
|
-
l ||=
|
|
2702
|
-
}), y &&
|
|
2704
|
+
const b = $;
|
|
2705
|
+
l ||= b.modifiers?.some((T) => T.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, Wt(b, i, b.getSourceFile());
|
|
2706
|
+
}), y && x !== void 0 && I !== void 0 && x.type?.getText() !== I.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${h.getText(this.file)}` });
|
|
2703
2707
|
}
|
|
2704
|
-
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((
|
|
2708
|
+
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(
|
|
2705
2709
|
`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`
|
|
2706
|
-
),
|
|
2707
|
-
const
|
|
2708
|
-
|
|
2710
|
+
), Je.loggedBooleanWarning = !0) : i.default = "false"), this.pairedSetter !== void 0 && !i.readonly) {
|
|
2711
|
+
const h = this.pairedSetter.parameters.at(0)?.type?.getText(this.file), v = t.type?.getText(this.file);
|
|
2712
|
+
h !== v && v !== void 0 && h !== void 0 && (i.getterType = { text: v });
|
|
2709
2713
|
}
|
|
2710
2714
|
this.copyDoc(this.copyDocDefinitions?.properties?.[i.name], i, this.apiComponent);
|
|
2711
2715
|
}
|
|
@@ -2716,11 +2720,11 @@ ${c}.componentOnReady().then(() => {
|
|
|
2716
2720
|
* Find the properties given to the `@property()` decorator.
|
|
2717
2721
|
*/
|
|
2718
2722
|
findPropertyOptions(t) {
|
|
2719
|
-
const i =
|
|
2723
|
+
const i = _t(t, "property");
|
|
2720
2724
|
return i === void 0 ? void 0 : i.arguments?.find(o.isObjectLiteralExpression)?.properties ?? [];
|
|
2721
2725
|
}
|
|
2722
2726
|
extractComponentMethod(t, i) {
|
|
2723
|
-
if (
|
|
2727
|
+
if (_t(t, "method") === void 0)
|
|
2724
2728
|
return;
|
|
2725
2729
|
const n = {
|
|
2726
2730
|
kind: "method",
|
|
@@ -2759,7 +2763,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2759
2763
|
description: n.description,
|
|
2760
2764
|
inheritedFrom: n.inheritedFrom,
|
|
2761
2765
|
type: s === void 0 || s.length === 0 ? n.type : {
|
|
2762
|
-
text:
|
|
2766
|
+
text: on(s),
|
|
2763
2767
|
references: void 0,
|
|
2764
2768
|
values: s
|
|
2765
2769
|
},
|
|
@@ -2839,15 +2843,15 @@ async function ta(e, t) {
|
|
|
2839
2843
|
await e.componentStoriesPromise, e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2840
2844
|
const s = gn(n, e, !1);
|
|
2841
2845
|
e.privateApiJson = s;
|
|
2842
|
-
const [r, a] =
|
|
2846
|
+
const [r, a] = hn(s);
|
|
2843
2847
|
return e.apiJsonComponents = a, e.apiJson = r, s;
|
|
2844
2848
|
}
|
|
2845
2849
|
function ia(e, t, i) {
|
|
2846
2850
|
const n = e.getSourceFile(t, i), s = gn([n], e, !0), r = s.modules[0];
|
|
2847
2851
|
{
|
|
2848
|
-
const f =
|
|
2849
|
-
|
|
2850
|
-
(v) => !
|
|
2852
|
+
const f = hn(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
|
+
h.splice(y, 1, f), e.apiJson = { ...e.apiJson, modules: h }, e.apiJsonComponents = e.apiJsonComponents.filter(
|
|
2854
|
+
(v) => !g.declarations.includes(v)
|
|
2851
2855
|
);
|
|
2852
2856
|
for (const v of f.declarations)
|
|
2853
2857
|
"customElement" in v && e.apiJsonComponents.push(v);
|
|
@@ -2862,16 +2866,16 @@ function ia(e, t, i) {
|
|
|
2862
2866
|
), m = [];
|
|
2863
2867
|
for (const f of r.declarations)
|
|
2864
2868
|
if ("customElement" in f) {
|
|
2865
|
-
const
|
|
2866
|
-
d ||=
|
|
2869
|
+
const g = p.find((h) => h.tagName === f.tagName) === void 0;
|
|
2870
|
+
d ||= g, m.push(f);
|
|
2867
2871
|
}
|
|
2868
2872
|
return d ||= m.length !== p.length, d ? void 0 : m;
|
|
2869
2873
|
}
|
|
2870
2874
|
function gn(e, t, i) {
|
|
2871
|
-
const n = t.options.apiJson?.Extractor ??
|
|
2875
|
+
const n = t.options.apiJson?.Extractor ?? Je, r = new n(t, i).extract(e);
|
|
2872
2876
|
return t.options.apiJson?.afterCreate?.(r, i), r;
|
|
2873
2877
|
}
|
|
2874
|
-
function
|
|
2878
|
+
function hn(e) {
|
|
2875
2879
|
const t = { ...e, modules: [] }, i = [];
|
|
2876
2880
|
for (const n of e.modules) {
|
|
2877
2881
|
const s = { ...n, declarations: [] };
|
|
@@ -2892,18 +2896,18 @@ function na(e, t, i) {
|
|
|
2892
2896
|
O(e, n, t);
|
|
2893
2897
|
for (const s of e.members) {
|
|
2894
2898
|
if (s.kind === "field")
|
|
2895
|
-
|
|
2899
|
+
Ie(s.type, i, t);
|
|
2896
2900
|
else {
|
|
2897
|
-
if (
|
|
2901
|
+
if (Ie(s.return?.type, i, t), s.parameters !== void 0)
|
|
2898
2902
|
for (const r of s.parameters)
|
|
2899
|
-
|
|
2903
|
+
Ie(r.type, i, t), O(r, n, t);
|
|
2900
2904
|
s.return !== void 0 && O(s.return, n, t);
|
|
2901
2905
|
}
|
|
2902
2906
|
O(s, n, t);
|
|
2903
2907
|
}
|
|
2904
2908
|
if (e.events !== void 0)
|
|
2905
2909
|
for (const s of e.events)
|
|
2906
|
-
|
|
2910
|
+
Ie(s.type, i, t), O(s, n, t);
|
|
2907
2911
|
if (e.attributes !== void 0)
|
|
2908
2912
|
for (const s of e.attributes)
|
|
2909
2913
|
O(s, n, t);
|
|
@@ -2923,25 +2927,25 @@ function na(e, t, i) {
|
|
|
2923
2927
|
for (const s of e.demos)
|
|
2924
2928
|
O(s, n, t);
|
|
2925
2929
|
}
|
|
2926
|
-
function
|
|
2930
|
+
function Ie(e, t, i) {
|
|
2927
2931
|
e !== void 0 && (e.references?.reduce(
|
|
2928
2932
|
(n, s) => ra(s, t, i, n),
|
|
2929
2933
|
0
|
|
2930
2934
|
), e.text = e.text.replaceAll(
|
|
2931
2935
|
da,
|
|
2932
|
-
(n, s) =>
|
|
2936
|
+
(n, s) => At(t.get(s)) ?? n
|
|
2933
2937
|
), e.values?.forEach(oa, t));
|
|
2934
2938
|
}
|
|
2935
2939
|
function O(e, t, i) {
|
|
2936
|
-
if (e.description && (e.description = e.description.replaceAll(
|
|
2940
|
+
if (e.description && (e.description = e.description.replaceAll(ui, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl)), e.docsTags)
|
|
2937
2941
|
for (const n of e.docsTags)
|
|
2938
|
-
n.text && (n.text = n.text.replaceAll(
|
|
2942
|
+
n.text && (n.text = n.text.replaceAll(ui, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2939
2943
|
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(
|
|
2940
2944
|
i.alternativeDocumentationUrl,
|
|
2941
2945
|
i.normalizedDocumentationUrl
|
|
2942
2946
|
));
|
|
2943
2947
|
}
|
|
2944
|
-
const
|
|
2948
|
+
const ui = /\{@link ([^}]+)\}/gu, sa = (e, t) => (i, n) => {
|
|
2945
2949
|
let s = n.indexOf(" ");
|
|
2946
2950
|
s === -1 && (s = n.length);
|
|
2947
2951
|
const r = n.slice(0, s), a = n.slice(s + 1);
|
|
@@ -2952,14 +2956,14 @@ const mi = /\{@link ([^}]+)\}/gu, sa = (e, t) => (i, n) => {
|
|
|
2952
2956
|
throw Error(
|
|
2953
2957
|
`Failed to find which component is referenced by the following link in ${t.name}: ${i}. Make sure the link follows the pattern {@link ComponentClassName} or {@link ComponentClassName#propertyOrMethodOrEventName}.`
|
|
2954
2958
|
);
|
|
2955
|
-
const p = d.demos?.find((
|
|
2959
|
+
const p = d.demos?.find((g) => g.description === "Docs")?.url;
|
|
2956
2960
|
if (p === void 0)
|
|
2957
2961
|
throw Error(
|
|
2958
2962
|
`Failed to find documentation URL for ${c} in ${t.name}. Make sure the following Lumina configuration option is set: documentation.getComponentDocsUrl`
|
|
2959
2963
|
);
|
|
2960
2964
|
if (l === void 0)
|
|
2961
2965
|
return `[${a || d.name}](${p})`;
|
|
2962
|
-
if ((d.members.find((
|
|
2966
|
+
if ((d.members.find((g) => g.name === l) ?? d.events?.find((g) => g.name === l)) === void 0)
|
|
2963
2967
|
throw Error(
|
|
2964
2968
|
`Failed to find ${l} member in ${c}. Found it referenced by the following link in ${t.name}: ${i}. Make sure the link follows the pattern {@link ComponentClassName#propertyOrMethodOrEventName}.`
|
|
2965
2969
|
);
|
|
@@ -2972,22 +2976,22 @@ function ra(e, t, i, n) {
|
|
|
2972
2976
|
)), n > 0 && (e.start !== void 0 && (e.start += n), e.end !== void 0 && (e.end += n)), e.package !== void 0)
|
|
2973
2977
|
return n;
|
|
2974
2978
|
if (e.module?.startsWith("dist/components/") === !0)
|
|
2975
|
-
e.module =
|
|
2979
|
+
e.module = ge(e.module, "dist/components/", i);
|
|
2976
2980
|
else if (e.module === "index.js" && e.name) {
|
|
2977
2981
|
const s = t.get(e.name);
|
|
2978
2982
|
if (s !== void 0) {
|
|
2979
2983
|
const r = e.name.length;
|
|
2980
|
-
e.name =
|
|
2981
|
-
const a = e.name.length - r -
|
|
2982
|
-
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start -
|
|
2984
|
+
e.name = At(s);
|
|
2985
|
+
const a = e.name.length - r - mi;
|
|
2986
|
+
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start - mi, e.end = e.end + a, n += a - la;
|
|
2983
2987
|
}
|
|
2984
2988
|
}
|
|
2985
2989
|
return n;
|
|
2986
2990
|
}
|
|
2987
2991
|
function oa(e) {
|
|
2988
|
-
e.type.startsWith("ToElement<") && (e.type =
|
|
2992
|
+
e.type.startsWith("ToElement<") && (e.type = At(this.get(e.type.slice(10, -1))) ?? e.type);
|
|
2989
2993
|
}
|
|
2990
|
-
const
|
|
2994
|
+
const At = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0, aa = "ToElement<", mi = aa.length, ca = ">", la = ca.length, da = /ToElement<(\w+)>/gu;
|
|
2991
2995
|
async function pa(e, t) {
|
|
2992
2996
|
if (e.viteCommand === "serve" && (Object.hasOwn(e, "typeScriptHost") || (e.typeScriptHost = o.createCompilerHost(e.typeScriptConfig, !1))), e.typeScriptProgram !== void 0) {
|
|
2993
2997
|
const i = e.typeScriptProgram.getSourceFiles(), n = new Set(t);
|
|
@@ -3000,34 +3004,34 @@ async function pa(e, t) {
|
|
|
3000
3004
|
})
|
|
3001
3005
|
);
|
|
3002
3006
|
}
|
|
3003
|
-
async function
|
|
3007
|
+
async function vn(e) {
|
|
3004
3008
|
return ve ??= ma(e), await ve;
|
|
3005
3009
|
}
|
|
3006
3010
|
function ua() {
|
|
3007
|
-
if (
|
|
3011
|
+
if (gt === void 0)
|
|
3008
3012
|
throw Error(
|
|
3009
|
-
|
|
3013
|
+
w(
|
|
3010
3014
|
"@arcgis/lumina:retrieveComponentDependencies",
|
|
3011
3015
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
3012
3016
|
)
|
|
3013
3017
|
);
|
|
3014
|
-
return
|
|
3018
|
+
return gt;
|
|
3015
3019
|
}
|
|
3016
|
-
function
|
|
3017
|
-
if (
|
|
3020
|
+
function Sn() {
|
|
3021
|
+
if (ht === void 0)
|
|
3018
3022
|
throw Error(
|
|
3019
|
-
|
|
3023
|
+
w(
|
|
3020
3024
|
"@arcgis/lumina:retrieveFlatComponentDependencies",
|
|
3021
3025
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
3022
3026
|
)
|
|
3023
3027
|
);
|
|
3024
|
-
return
|
|
3028
|
+
return ht;
|
|
3025
3029
|
}
|
|
3026
3030
|
async function ma(e) {
|
|
3027
3031
|
const t = R(e), i = t.dependencies ?? {}, n = t.peerDependencies ?? {}, r = (await Promise.all(
|
|
3028
3032
|
[...Object.keys(i), ...Object.keys(n)].filter((a) => !fa.has(a)).flatMap(async (a) => await bn(a, e))
|
|
3029
3033
|
)).filter(j);
|
|
3030
|
-
return
|
|
3034
|
+
return gt ??= r, ht = Object.fromEntries(r.flatMap((a) => Object.entries(a.components))), r;
|
|
3031
3035
|
}
|
|
3032
3036
|
const fa = /* @__PURE__ */ new Set([
|
|
3033
3037
|
"@arcgis/arcade-languageservice",
|
|
@@ -3065,35 +3069,35 @@ const fa = /* @__PURE__ */ new Set([
|
|
|
3065
3069
|
"vscode-languageserver-textdocument",
|
|
3066
3070
|
"vscode-languageserver-types"
|
|
3067
3071
|
]);
|
|
3068
|
-
let
|
|
3072
|
+
let gt, ht, ve;
|
|
3069
3073
|
async function bn(e, t) {
|
|
3070
|
-
const i = await
|
|
3074
|
+
const i = await _e(e, t), n = await He(i), s = "exports" in n, r = ba.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3071
3075
|
if (a ? await U(c) : !1) {
|
|
3072
|
-
const y = await J(c, "utf8"),
|
|
3076
|
+
const y = await J(c, "utf8"), g = ya(y, "bootstrapLazy("), h = y.indexOf(", options", g), v = y.slice(g, h), S = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
3073
3077
|
try {
|
|
3074
|
-
const E = JSON.parse(S),
|
|
3075
|
-
return { packageName: e, type: "stencil", components:
|
|
3078
|
+
const E = JSON.parse(S), x = va(E, { packageName: e, getImportPath: r });
|
|
3079
|
+
return { packageName: e, type: "stencil", components: x };
|
|
3076
3080
|
} catch (E) {
|
|
3077
3081
|
C.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
3078
3082
|
Error: ${String(E)}`);
|
|
3079
3083
|
}
|
|
3080
3084
|
}
|
|
3081
|
-
const d =
|
|
3085
|
+
const d = fi(n.customElements);
|
|
3082
3086
|
if (d != null) {
|
|
3083
|
-
const y = u.join(i, d),
|
|
3087
|
+
const y = u.join(i, d), g = JSON.parse(await J(y, "utf-8")), h = ga(g), v = wn(g, {
|
|
3084
3088
|
packageName: e,
|
|
3085
3089
|
getImportPath: r
|
|
3086
3090
|
});
|
|
3087
|
-
return { type:
|
|
3091
|
+
return { type: h ? "@arcgis/lumina" : "unknown", packageName: e, components: v };
|
|
3088
3092
|
}
|
|
3089
|
-
const p =
|
|
3093
|
+
const p = fi(n["web-types"]);
|
|
3090
3094
|
if (p != null) {
|
|
3091
|
-
const y = u.join(i, p),
|
|
3095
|
+
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), h = ha(g, {
|
|
3092
3096
|
packageName: e,
|
|
3093
3097
|
getImportPath: r,
|
|
3094
3098
|
packageRoot: i
|
|
3095
3099
|
});
|
|
3096
|
-
return { type: "unknown", packageName: e, components:
|
|
3100
|
+
return { type: "unknown", packageName: e, components: h };
|
|
3097
3101
|
}
|
|
3098
3102
|
const m = u.join(i, "dist/components");
|
|
3099
3103
|
if (await U(m)) {
|
|
@@ -3104,12 +3108,12 @@ Error: ${String(E)}`);
|
|
|
3104
3108
|
return { type: "unknown", packageName: e, components: y };
|
|
3105
3109
|
}
|
|
3106
3110
|
}
|
|
3107
|
-
const
|
|
3111
|
+
const fi = (e) => Array.isArray(e) ? e[0] : e;
|
|
3108
3112
|
function ya(e, t) {
|
|
3109
3113
|
const i = e.indexOf(t);
|
|
3110
3114
|
return i === -1 ? -1 : i + t.length;
|
|
3111
3115
|
}
|
|
3112
|
-
function
|
|
3116
|
+
function wn(e, t) {
|
|
3113
3117
|
const i = {};
|
|
3114
3118
|
for (const n of e.modules ?? [])
|
|
3115
3119
|
if (n.declarations !== void 0)
|
|
@@ -3127,7 +3131,7 @@ function Tn(e, t) {
|
|
|
3127
3131
|
}
|
|
3128
3132
|
return i;
|
|
3129
3133
|
}
|
|
3130
|
-
const
|
|
3134
|
+
const ga = (e) => e.compiler?.name === kt, ha = (e, t) => Object.fromEntries(
|
|
3131
3135
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
3132
3136
|
(i) => [
|
|
3133
3137
|
i.name,
|
|
@@ -3157,7 +3161,7 @@ const ha = (e) => e.compiler?.name === At, ga = (e, t) => Object.fromEntries(
|
|
|
3157
3161
|
)
|
|
3158
3162
|
)
|
|
3159
3163
|
), Sa = async (e, t) => Object.fromEntries(
|
|
3160
|
-
(await
|
|
3164
|
+
(await Ue(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3161
3165
|
const n = i.slice(0, -5);
|
|
3162
3166
|
return [
|
|
3163
3167
|
n,
|
|
@@ -3168,8 +3172,8 @@ const ha = (e) => e.compiler?.name === At, ga = (e, t) => Object.fromEntries(
|
|
|
3168
3172
|
}
|
|
3169
3173
|
];
|
|
3170
3174
|
})
|
|
3171
|
-
),
|
|
3172
|
-
function
|
|
3175
|
+
), ba = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, wa = (e) => e.startsWith("/") ? e : `/${e}`, It = (e, t) => `${e}@fs${wa(t)}`;
|
|
3176
|
+
function Ge(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3173
3177
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3174
3178
|
if (s && n)
|
|
3175
3179
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
@@ -3187,8 +3191,8 @@ function Ea(e, t) {
|
|
|
3187
3191
|
}
|
|
3188
3192
|
return "next";
|
|
3189
3193
|
}
|
|
3190
|
-
const Ca = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Z = "staticSvg", ce = "html", oe = "svg",
|
|
3191
|
-
function
|
|
3194
|
+
const Ca = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Z = "staticSvg", ce = "html", oe = "svg", Tn = Symbol("maybe HTML namespace or maybe SVG"), En = "css", Cn = "mathml", $n = [En, ce, Cn, ae, Z, oe], $a = new Set($n), Pa = ["safeClassMap", "safeStyleMap", "deferLoad"], xa = "nothing", ka = [...Ca, ...$n, ...Pa, xa], Ke = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e);
|
|
3195
|
+
function yi(e, t, i) {
|
|
3192
3196
|
if (ne(e))
|
|
3193
3197
|
return e;
|
|
3194
3198
|
{
|
|
@@ -3207,14 +3211,14 @@ function ne(e) {
|
|
|
3207
3211
|
return (
|
|
3208
3212
|
// Inlined string literal
|
|
3209
3213
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3210
|
-
|
|
3214
|
+
Aa.has(e.kind) || // Ternary with both branches never undefined
|
|
3211
3215
|
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
|
|
3212
3216
|
o.isBinaryExpression(e) && (Ia.has(e.operatorToken.kind) || ne(e.left) && ne(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3213
3217
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ne(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3214
3218
|
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && $a.has(e.tag.text)
|
|
3215
3219
|
);
|
|
3216
3220
|
}
|
|
3217
|
-
const
|
|
3221
|
+
const Aa = /* @__PURE__ */ new Set([
|
|
3218
3222
|
o.SyntaxKind.NumericLiteral,
|
|
3219
3223
|
o.SyntaxKind.BigIntLiteral,
|
|
3220
3224
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3278,18 +3282,18 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3278
3282
|
if (f === !1)
|
|
3279
3283
|
return [];
|
|
3280
3284
|
}
|
|
3281
|
-
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] :
|
|
3285
|
+
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Ne(e, t, a), l = c[0] !== "=";
|
|
3282
3286
|
if (a && l)
|
|
3283
3287
|
return [s.name, ...c];
|
|
3284
3288
|
const [d, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
3285
3289
|
if (r || m) {
|
|
3286
|
-
const f =
|
|
3290
|
+
const f = yi(
|
|
3287
3291
|
p,
|
|
3288
3292
|
e,
|
|
3289
3293
|
m ? "" : void 0
|
|
3290
|
-
),
|
|
3291
|
-
if (
|
|
3292
|
-
return [m ? `.${i}` : s.name, d,
|
|
3294
|
+
), g = i === "value" && (n === "input" || n === "textarea" || n === Re) ? Da(f, e) : f;
|
|
3295
|
+
if (g !== p)
|
|
3296
|
+
return [m ? `.${i}` : s.name, d, g];
|
|
3293
3297
|
}
|
|
3294
3298
|
return [`.${i}`, ...c];
|
|
3295
3299
|
},
|
|
@@ -3299,12 +3303,12 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3299
3303
|
return [i];
|
|
3300
3304
|
if (n === !1)
|
|
3301
3305
|
return [];
|
|
3302
|
-
const s =
|
|
3306
|
+
const s = Ne(e, t, !0), a = s[0] !== "=" ? s : [s[0], yi(s[1], e)];
|
|
3303
3307
|
return [i, ...a];
|
|
3304
3308
|
},
|
|
3305
3309
|
booleanAttribute(e, t, i) {
|
|
3306
3310
|
const n = t === void 0 || ot(t);
|
|
3307
|
-
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...
|
|
3311
|
+
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...Ne(e, t, !1)];
|
|
3308
3312
|
},
|
|
3309
3313
|
event(e, t, i) {
|
|
3310
3314
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3312,7 +3316,7 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3312
3316
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3313
3317
|
);
|
|
3314
3318
|
const n = i.slice(2), s = ut(n);
|
|
3315
|
-
return [`@${
|
|
3319
|
+
return [`@${en.has(s) ? n.toLowerCase() : ut(n)}=`, ...Nt(e, t, void 0)];
|
|
3316
3320
|
},
|
|
3317
3321
|
directives(e, t) {
|
|
3318
3322
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3344,8 +3348,8 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3344
3348
|
])
|
|
3345
3349
|
];
|
|
3346
3350
|
},
|
|
3347
|
-
class:
|
|
3348
|
-
style:
|
|
3351
|
+
class: hi,
|
|
3352
|
+
style: hi,
|
|
3349
3353
|
key: (e, t) => [Lt(t, e.sourceFile)],
|
|
3350
3354
|
deferLoad(e, t, i, n) {
|
|
3351
3355
|
if (typeof n != "string")
|
|
@@ -3363,15 +3367,15 @@ function Fa(e, t, i) {
|
|
|
3363
3367
|
if (r !== void 0)
|
|
3364
3368
|
return { name: r, type: "reflected" };
|
|
3365
3369
|
}
|
|
3366
|
-
const n = rt(
|
|
3370
|
+
const n = rt(W.common, t);
|
|
3367
3371
|
if (n !== void 0)
|
|
3368
3372
|
return n;
|
|
3369
3373
|
if (typeof e == "string") {
|
|
3370
|
-
const s = rt(
|
|
3374
|
+
const s = rt(W.perElement[e], t);
|
|
3371
3375
|
if (s !== void 0)
|
|
3372
3376
|
return s;
|
|
3373
3377
|
} else {
|
|
3374
|
-
const s = Object.values(
|
|
3378
|
+
const s = Object.values(W.perElement).map(
|
|
3375
3379
|
(a) => rt(a, t)
|
|
3376
3380
|
), r = ye(s, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ye(s, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3377
3381
|
if (r !== void 0)
|
|
@@ -3406,8 +3410,8 @@ function ot(e) {
|
|
|
3406
3410
|
return !1;
|
|
3407
3411
|
}
|
|
3408
3412
|
}
|
|
3409
|
-
function
|
|
3410
|
-
if (
|
|
3413
|
+
function Ne(e, t, i = !1) {
|
|
3414
|
+
if (Ke(t))
|
|
3411
3415
|
throw new Error(
|
|
3412
3416
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3413
3417
|
);
|
|
@@ -3431,7 +3435,7 @@ function gi(e, t) {
|
|
|
3431
3435
|
const i = e.text;
|
|
3432
3436
|
if (i.length === 0)
|
|
3433
3437
|
return [];
|
|
3434
|
-
const n =
|
|
3438
|
+
const n = nn(i);
|
|
3435
3439
|
if (Gr(n)) {
|
|
3436
3440
|
const s = n.replaceAll('"', """);
|
|
3437
3441
|
if (s.length > n.length) {
|
|
@@ -3443,7 +3447,7 @@ function gi(e, t) {
|
|
|
3443
3447
|
} else
|
|
3444
3448
|
return [`=${n}`];
|
|
3445
3449
|
}
|
|
3446
|
-
function
|
|
3450
|
+
function hi(e, t, i) {
|
|
3447
3451
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3448
3452
|
return [`${i}="${t.text}"`];
|
|
3449
3453
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3459,7 +3463,7 @@ function vi(e, t, i) {
|
|
|
3459
3463
|
]);
|
|
3460
3464
|
return [`${i}=`, c];
|
|
3461
3465
|
} else
|
|
3462
|
-
return [i, ...
|
|
3466
|
+
return [i, ...Ne(e, t, !0)];
|
|
3463
3467
|
}
|
|
3464
3468
|
const Na = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3465
3469
|
function Da(e, t) {
|
|
@@ -3470,9 +3474,9 @@ function Da(e, t) {
|
|
|
3470
3474
|
]);
|
|
3471
3475
|
}
|
|
3472
3476
|
function ja(e) {
|
|
3473
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3477
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in vi && e.expression.arguments.length <= 1)
|
|
3474
3478
|
return {
|
|
3475
|
-
propType:
|
|
3479
|
+
propType: vi[e.expression.expression.text],
|
|
3476
3480
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3477
3481
|
initializer: o.factory.createJsxExpression(
|
|
3478
3482
|
void 0,
|
|
@@ -3481,20 +3485,20 @@ function ja(e) {
|
|
|
3481
3485
|
)
|
|
3482
3486
|
};
|
|
3483
3487
|
}
|
|
3484
|
-
const
|
|
3488
|
+
const vi = {
|
|
3485
3489
|
bindProperty: "property",
|
|
3486
3490
|
bindAttribute: "attribute",
|
|
3487
3491
|
bindBooleanAttribute: "booleanAttribute",
|
|
3488
3492
|
bindEvent: "event"
|
|
3489
3493
|
};
|
|
3490
3494
|
function Ra(e, t, i) {
|
|
3491
|
-
return Oa.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (
|
|
3495
|
+
return Oa.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (Qi.has(e) || e.includes("-")) && (e !== "itemId" || i !== "arcgis-map" && i !== "arcgis-scene") ? "attribute" : !Pt(i) && (Zi.has(e) || (i === ft ? !1 : i === Re ? (
|
|
3492
3496
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3493
3497
|
Object.values(yt).some((r) => r.has(e))
|
|
3494
|
-
) : yt[i]?.has(e) === !0)) ?
|
|
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 W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : Yt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3495
3499
|
}
|
|
3496
3500
|
const Ma = ["class", "style", "ref", "directives", "key", "deferLoad"], Oa = new Set(Ma), Ja = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3497
|
-
function
|
|
3501
|
+
function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
3498
3502
|
const s = Ka(t);
|
|
3499
3503
|
if (s.length % 2 === 0)
|
|
3500
3504
|
throw new Error("Normalized template parts array length must be odd");
|
|
@@ -3513,12 +3517,12 @@ function Ge({ key: e, parts: t, litTag: i }, n) {
|
|
|
3513
3517
|
}
|
|
3514
3518
|
const c = typeof i == "string" ? i : ce;
|
|
3515
3519
|
n.neededImports.add(c);
|
|
3516
|
-
const l = n.importRenames[c], d =
|
|
3520
|
+
const l = n.importRenames[c], d = ze(r), p = o.factory.createTaggedTemplateExpression(
|
|
3517
3521
|
o.factory.createIdentifier(l),
|
|
3518
3522
|
void 0,
|
|
3519
3523
|
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(d, d) : o.factory.createTemplateExpression(
|
|
3520
3524
|
o.factory.createTemplateHead(d, d),
|
|
3521
|
-
|
|
3525
|
+
Ba(a)
|
|
3522
3526
|
)
|
|
3523
3527
|
);
|
|
3524
3528
|
return at(n, e, p);
|
|
@@ -3533,7 +3537,7 @@ const Ka = (e) => e.reduce(
|
|
|
3533
3537
|
},
|
|
3534
3538
|
[""]
|
|
3535
3539
|
);
|
|
3536
|
-
function
|
|
3540
|
+
function Ba(e) {
|
|
3537
3541
|
if (!(e.length % 2 === 0))
|
|
3538
3542
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3539
3543
|
const i = e.length / 2;
|
|
@@ -3544,7 +3548,7 @@ function Wa(e) {
|
|
|
3544
3548
|
const c = r + 1, l = e[c];
|
|
3545
3549
|
if (typeof l != "string")
|
|
3546
3550
|
throw new Error("Expected to receive a normalized array of parts");
|
|
3547
|
-
const d = s === i - 1, p =
|
|
3551
|
+
const d = s === i - 1, p = ze(l);
|
|
3548
3552
|
return o.factory.createTemplateSpan(
|
|
3549
3553
|
a,
|
|
3550
3554
|
/*
|
|
@@ -3565,8 +3569,8 @@ function at(e, t, i) {
|
|
|
3565
3569
|
const n = e.importRenames.keyed;
|
|
3566
3570
|
return o.factory.createCallExpression(o.factory.createIdentifier(n), void 0, [t, i]);
|
|
3567
3571
|
}
|
|
3568
|
-
const
|
|
3569
|
-
function
|
|
3572
|
+
const Pn = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
3573
|
+
function xn(e, t) {
|
|
3570
3574
|
const i = Ft(e);
|
|
3571
3575
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
3572
3576
|
t,
|
|
@@ -3579,13 +3583,13 @@ function An(e, t) {
|
|
|
3579
3583
|
);
|
|
3580
3584
|
}
|
|
3581
3585
|
const Ft = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3582
|
-
function
|
|
3586
|
+
function Wa(e) {
|
|
3583
3587
|
const t = Ft(e);
|
|
3584
3588
|
if (t.length === 0)
|
|
3585
3589
|
return [e || " "];
|
|
3586
3590
|
const i = t.reduceRight(
|
|
3587
3591
|
([s, ...r], a) => {
|
|
3588
|
-
const c = _a(s), l =
|
|
3592
|
+
const c = _a(s), l = ze(kn(c.slice(a.pos, a.end)));
|
|
3589
3593
|
return [
|
|
3590
3594
|
c.slice(0, a.pos),
|
|
3591
3595
|
/**
|
|
@@ -3621,7 +3625,7 @@ function Ha(e, t) {
|
|
|
3621
3625
|
return t;
|
|
3622
3626
|
const c = Se(n.body);
|
|
3623
3627
|
let l = !0, d;
|
|
3624
|
-
if (
|
|
3628
|
+
if (Si(c))
|
|
3625
3629
|
d = c;
|
|
3626
3630
|
else {
|
|
3627
3631
|
if (!o.isBlock(c))
|
|
@@ -3630,29 +3634,29 @@ function Ha(e, t) {
|
|
|
3630
3634
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
3631
3635
|
return t;
|
|
3632
3636
|
const E = Se(v.expression);
|
|
3633
|
-
if (!
|
|
3637
|
+
if (!Si(E))
|
|
3634
3638
|
return t;
|
|
3635
|
-
const
|
|
3636
|
-
if (
|
|
3639
|
+
const x = c.statements.slice(0, -1);
|
|
3640
|
+
if (x.some(An))
|
|
3637
3641
|
return t;
|
|
3638
|
-
l =
|
|
3642
|
+
l = x.length === 0, d = E;
|
|
3639
3643
|
}
|
|
3640
|
-
const p = o.isJsxElement(d) ? d.openingElement : d, m =
|
|
3644
|
+
const p = o.isJsxElement(d) ? d.openingElement : d, m = Dn(p);
|
|
3641
3645
|
if (m === -1)
|
|
3642
3646
|
return t;
|
|
3643
3647
|
const f = p.attributes.properties[m];
|
|
3644
3648
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3645
3649
|
return t;
|
|
3646
|
-
const y = Lt(f.initializer, e.sourceFile),
|
|
3647
|
-
if (
|
|
3650
|
+
const y = Lt(f.initializer, e.sourceFile), g = Ua(r, n, y, l, e);
|
|
3651
|
+
if (g === void 0)
|
|
3648
3652
|
return t;
|
|
3649
3653
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
3650
|
-
const
|
|
3651
|
-
return o.factory.updateCallExpression(t, o.factory.createIdentifier(
|
|
3654
|
+
const h = e.importRenames.repeat;
|
|
3655
|
+
return o.factory.updateCallExpression(t, o.factory.createIdentifier(h), t.typeArguments, [
|
|
3652
3656
|
// From `items.map()` get `items`
|
|
3653
3657
|
t.expression.expression,
|
|
3654
3658
|
// (item)=>item.key
|
|
3655
|
-
o.factory.createArrowFunction(void 0, void 0, [
|
|
3659
|
+
o.factory.createArrowFunction(void 0, void 0, [g], void 0, void 0, y),
|
|
3656
3660
|
// Keep arrow as is, but remove the key prop from the JSX element
|
|
3657
3661
|
o.factory.updateArrowFunction(
|
|
3658
3662
|
n,
|
|
@@ -3665,25 +3669,25 @@ function Ha(e, t) {
|
|
|
3665
3669
|
)
|
|
3666
3670
|
]);
|
|
3667
3671
|
}
|
|
3668
|
-
const
|
|
3669
|
-
function
|
|
3672
|
+
const Si = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3673
|
+
function An(e) {
|
|
3670
3674
|
if (o.isReturnStatement(e))
|
|
3671
3675
|
return !0;
|
|
3672
3676
|
let t = !1;
|
|
3673
3677
|
return o.visitEachChild(
|
|
3674
3678
|
e,
|
|
3675
|
-
(i) => (t ||=
|
|
3679
|
+
(i) => (t ||= An(i), i),
|
|
3676
3680
|
void 0
|
|
3677
3681
|
), t;
|
|
3678
3682
|
}
|
|
3679
3683
|
function Ua(e, t, i, n, s) {
|
|
3680
|
-
const r =
|
|
3684
|
+
const r = B(i);
|
|
3681
3685
|
if (r === void 0)
|
|
3682
3686
|
return;
|
|
3683
|
-
let a =
|
|
3687
|
+
let a = In(e.name, r);
|
|
3684
3688
|
const c = t.parameters.at(1);
|
|
3685
3689
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
3686
|
-
r.every(
|
|
3690
|
+
r.every(Be, c.name)) {
|
|
3687
3691
|
C.warn(
|
|
3688
3692
|
"@arcgis/lumina:jsxToLitHtml",
|
|
3689
3693
|
"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.",
|
|
@@ -3708,25 +3712,25 @@ function Ua(e, t, i, n, s) {
|
|
|
3708
3712
|
e.initializer
|
|
3709
3713
|
);
|
|
3710
3714
|
}
|
|
3711
|
-
function
|
|
3715
|
+
function B(e) {
|
|
3712
3716
|
if (o.isIdentifier(e))
|
|
3713
3717
|
return [e.text];
|
|
3714
3718
|
if (o.isPropertyAccessExpression(e))
|
|
3715
|
-
return
|
|
3719
|
+
return B(e.expression);
|
|
3716
3720
|
if (o.isElementAccessExpression(e))
|
|
3717
|
-
return
|
|
3721
|
+
return B(e.argumentExpression);
|
|
3718
3722
|
if (o.isConditionalExpression(e)) {
|
|
3719
|
-
const t =
|
|
3723
|
+
const t = B(e.condition), i = B(e.whenTrue), n = B(e.whenFalse);
|
|
3720
3724
|
return t === void 0 || i === void 0 || n === void 0 ? void 0 : [...t, ...i, ...n];
|
|
3721
3725
|
} else if (o.isBinaryExpression(e)) {
|
|
3722
|
-
const t =
|
|
3726
|
+
const t = B(e.left), i = B(e.right);
|
|
3723
3727
|
return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
|
|
3724
3728
|
} else {
|
|
3725
3729
|
if (za.has(e.kind))
|
|
3726
3730
|
return [];
|
|
3727
3731
|
{
|
|
3728
3732
|
const t = Se(e);
|
|
3729
|
-
return t !== e ?
|
|
3733
|
+
return t !== e ? B(t) : void 0;
|
|
3730
3734
|
}
|
|
3731
3735
|
}
|
|
3732
3736
|
}
|
|
@@ -3739,16 +3743,16 @@ const za = /* @__PURE__ */ new Set([
|
|
|
3739
3743
|
o.SyntaxKind.FalseKeyword,
|
|
3740
3744
|
o.SyntaxKind.NullKeyword,
|
|
3741
3745
|
o.SyntaxKind.TrueKeyword
|
|
3742
|
-
]), Se = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Se(e.expression) : e,
|
|
3746
|
+
]), Se = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Se(e.expression) : e, In = (e, t) => o.isObjectBindingPattern(e) ? Xa(e, t) : e;
|
|
3743
3747
|
function qa(e, t, i) {
|
|
3744
|
-
if (e.every(
|
|
3748
|
+
if (e.every(Be, t))
|
|
3745
3749
|
return t;
|
|
3746
3750
|
if (o.isIdentifier(t)) {
|
|
3747
3751
|
const n = o.isBlock(i.body) ? ye(i.body.statements, (r) => Ga(r, t)) : void 0;
|
|
3748
3752
|
if (n === void 0)
|
|
3749
3753
|
return;
|
|
3750
|
-
const s =
|
|
3751
|
-
if (e.every(
|
|
3754
|
+
const s = In(n, e);
|
|
3755
|
+
if (e.every(Be, s))
|
|
3752
3756
|
return s;
|
|
3753
3757
|
}
|
|
3754
3758
|
}
|
|
@@ -3758,22 +3762,22 @@ function Ga(e, t) {
|
|
|
3758
3762
|
const i = e.declarationList.declarations[0];
|
|
3759
3763
|
return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
|
|
3760
3764
|
}
|
|
3761
|
-
function
|
|
3765
|
+
function Be(e) {
|
|
3762
3766
|
const t = this;
|
|
3763
3767
|
return o.isIdentifier(t) ? t.text === e : t.elements.some(Va, e);
|
|
3764
3768
|
}
|
|
3765
3769
|
function Va(e) {
|
|
3766
3770
|
const t = this;
|
|
3767
|
-
return o.isOmittedExpression(e) ? !1 :
|
|
3771
|
+
return o.isOmittedExpression(e) ? !1 : Be.call(e.name, t);
|
|
3768
3772
|
}
|
|
3769
3773
|
function Xa(e, t) {
|
|
3770
3774
|
let i = !1;
|
|
3771
3775
|
const n = e.elements.filter((s) => o.isIdentifier(s.name) ? t.includes(s.name.text) : (i = !0, !0));
|
|
3772
3776
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3773
3777
|
}
|
|
3774
|
-
const
|
|
3775
|
-
`), Za = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u,
|
|
3776
|
-
function
|
|
3778
|
+
const Ln = (e, t) => t.liftedKeys.has(e), Qa = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}";`).join(`
|
|
3779
|
+
`), Za = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, Xe = (e) => !Za.test(e), Ee = (e) => Xe(e) ? `"${e}"` : e;
|
|
3780
|
+
function Qe(e, t) {
|
|
3777
3781
|
const i = [], n = [];
|
|
3778
3782
|
let s = !1;
|
|
3779
3783
|
t?.forEach((p) => {
|
|
@@ -3791,65 +3795,65 @@ function Xe(e, t) {
|
|
|
3791
3795
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3792
3796
|
s ? `${e}SetterTypes` : ""
|
|
3793
3797
|
], l = s ? `
|
|
3794
|
-
type ${e}SetterTypes = ${e}["${
|
|
3798
|
+
type ${e}SetterTypes = ${e}["${Xi}"]` : "", d = c.filter(Boolean).join(", ");
|
|
3795
3799
|
return [d.length === 0 ? "" : `${d}, `, l];
|
|
3796
3800
|
}
|
|
3797
3801
|
const bi = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3798
3802
|
function q(e, t, i) {
|
|
3799
|
-
if (
|
|
3800
|
-
return
|
|
3803
|
+
if (Ke(i))
|
|
3804
|
+
return Fn(e, i);
|
|
3801
3805
|
const n = o.isCallExpression(i) ? Ha(e, i) : i, s = o.visitEachChild(
|
|
3802
3806
|
n,
|
|
3803
3807
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
3804
3808
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
3805
3809
|
e.transformationContext
|
|
3806
3810
|
);
|
|
3807
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) ||
|
|
3811
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Ke(Se(i.right))) ? tc(s) : s;
|
|
3808
3812
|
}
|
|
3809
|
-
function
|
|
3810
|
-
const i =
|
|
3811
|
-
return
|
|
3813
|
+
function Fn(e, t) {
|
|
3814
|
+
const i = Nn(e, t);
|
|
3815
|
+
return Ve(i, e);
|
|
3812
3816
|
}
|
|
3813
|
-
function
|
|
3817
|
+
function Nn(e, t) {
|
|
3814
3818
|
const i = "children" in t ? t.children : [];
|
|
3815
3819
|
if (o.isJsxFragment(t))
|
|
3816
|
-
return { key: void 0, ...
|
|
3820
|
+
return { key: void 0, ...De(i, e) };
|
|
3817
3821
|
const s = o.isJsxElement(t) ? t.openingElement : t, r = s.tagName;
|
|
3818
3822
|
if (o.isJsxNamespacedName(r))
|
|
3819
3823
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
3820
3824
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== tt && r.text !== it) {
|
|
3821
|
-
const
|
|
3825
|
+
const $ = o.isIdentifier(r) && r.text === Lr ? De(i, e) : {
|
|
3822
3826
|
// No need to wrap the function call in a lit-html tag
|
|
3823
3827
|
litTag: void 0,
|
|
3824
3828
|
parts: [ec(e, t, r, i)]
|
|
3825
3829
|
};
|
|
3826
3830
|
return {
|
|
3827
3831
|
key: Ya(s, e),
|
|
3828
|
-
|
|
3832
|
+
...$
|
|
3829
3833
|
};
|
|
3830
3834
|
}
|
|
3831
|
-
const c = r.text === tt ?
|
|
3835
|
+
const c = r.text === tt ? Re : r.text === it ? ft : r.text, l = r.text === tt ? ae : r.text === it ? Z : Nr.has(c) ? Tn : Ct.has(c) ? oe : ce, d = Pt(c);
|
|
3832
3836
|
let p;
|
|
3833
3837
|
d && e.compiler.viteCommand === "build" && (p = ic(e, c));
|
|
3834
3838
|
let m;
|
|
3835
3839
|
const f = [];
|
|
3836
3840
|
let y = !1;
|
|
3837
|
-
const
|
|
3841
|
+
const g = s.attributes.properties.flatMap((I) => {
|
|
3838
3842
|
if (o.isJsxSpreadAttribute(I))
|
|
3839
3843
|
throw Error(
|
|
3840
3844
|
`JSX spread attribute syntax is not supported. See alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes
|
|
3841
3845
|
Found ${I.getText(e.sourceFile)}`
|
|
3842
3846
|
);
|
|
3843
|
-
const { name:
|
|
3844
|
-
if (o.isJsxNamespacedName(
|
|
3845
|
-
throw Error(`JSX namespaced attributes are not supported. Found ${
|
|
3846
|
-
const T =
|
|
3847
|
+
const { name: $, initializer: b } = I;
|
|
3848
|
+
if (o.isJsxNamespacedName($))
|
|
3849
|
+
throw Error(`JSX namespaced attributes are not supported. Found ${$.getText(e.sourceFile)}`);
|
|
3850
|
+
const T = $.text, L = ja(b), N = L?.propType ?? Ra(T, b, c);
|
|
3847
3851
|
p?.delete(T);
|
|
3848
|
-
const D = La[N](e, L?.initializer ??
|
|
3852
|
+
const D = La[N](e, L?.initializer ?? b, T, c);
|
|
3849
3853
|
if (D.length === 0)
|
|
3850
3854
|
return [];
|
|
3851
|
-
const M = e.compiler.shouldMinifyJsx ? [" "] :
|
|
3852
|
-
return N === "key" ? (m = typeof D[0] == "object" && !
|
|
3855
|
+
const M = e.compiler.shouldMinifyJsx ? [" "] : Wa(Pn($, e));
|
|
3856
|
+
return N === "key" ? (m = typeof D[0] == "object" && !Ln($, e) ? D[0] : void 0, M.some(Ja) ? M : []) : N === "directives" || N === "ref" || T === "deferLoad" ? (y ||= N === "deferLoad", f.push(
|
|
3853
3857
|
...M,
|
|
3854
3858
|
...D.flatMap(
|
|
3855
3859
|
(H, K) => typeof H == "string" || K === 0 || typeof D[K - 1] == "string" ? H : [" ", H]
|
|
@@ -3860,62 +3864,62 @@ Found ${I.getText(e.sourceFile)}`
|
|
|
3860
3864
|
"mustIncludeAllRequiredProperties",
|
|
3861
3865
|
e.sourceFile.fileName,
|
|
3862
3866
|
`Missing required properties for <${c}> }: ${Array.from(p).join(", ")}`
|
|
3863
|
-
), f.length > 0 &&
|
|
3867
|
+
), f.length > 0 && g.push(...f), typeof c == "string" && $t.has(c))
|
|
3864
3868
|
throw Error(
|
|
3865
3869
|
`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`
|
|
3866
3870
|
);
|
|
3867
3871
|
d && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3868
|
-
const
|
|
3869
|
-
if (
|
|
3872
|
+
const h = typeof c == "string" && Fr.has(c), v = De(i, e);
|
|
3873
|
+
if (h && v.parts.length > 0)
|
|
3870
3874
|
throw Error(
|
|
3871
3875
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
3872
3876
|
);
|
|
3873
3877
|
const S = (l === oe || l === Z) && v.parts.length === 0, E = [
|
|
3874
3878
|
"<",
|
|
3875
3879
|
typeof c == "string" ? c : r,
|
|
3876
|
-
...
|
|
3877
|
-
S ? `${
|
|
3878
|
-
],
|
|
3880
|
+
...g,
|
|
3881
|
+
S ? `${g.length === 0 ? "" : " "}/>` : ">"
|
|
3882
|
+
], x = h || S ? E : [
|
|
3879
3883
|
...E,
|
|
3880
3884
|
/**
|
|
3881
3885
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
3882
3886
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
3883
3887
|
* tagged template literal (e.g. svg``)
|
|
3884
3888
|
*/
|
|
3885
|
-
...v.litTag !== void 0 && v.litTag !== l ? [
|
|
3889
|
+
...v.litTag !== void 0 && v.litTag !== l ? [Ve({ key: void 0, ...v }, e)] : v.parts,
|
|
3886
3890
|
"</",
|
|
3887
3891
|
typeof c == "string" ? c : r,
|
|
3888
3892
|
">"
|
|
3889
3893
|
];
|
|
3890
|
-
return { key: m, parts:
|
|
3894
|
+
return { key: m, parts: x, litTag: l };
|
|
3891
3895
|
}
|
|
3892
3896
|
function Ya(e, t) {
|
|
3893
|
-
const i = e.attributes.properties[
|
|
3894
|
-
return i && o.isJsxAttribute(i) && !
|
|
3897
|
+
const i = e.attributes.properties[Dn(e)];
|
|
3898
|
+
return i && o.isJsxAttribute(i) && !Ln(i.name, t) ? Lt(i.initializer, t.sourceFile) : void 0;
|
|
3895
3899
|
}
|
|
3896
|
-
const
|
|
3900
|
+
const Dn = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3897
3901
|
function ec(e, t, i, n) {
|
|
3898
3902
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((l) => {
|
|
3899
3903
|
if (o.isJsxSpreadAttribute(l))
|
|
3900
|
-
return
|
|
3904
|
+
return xn(Pn(l, e), o.factory.createSpreadAssignment(l.expression));
|
|
3901
3905
|
const { name: d, initializer: p } = l;
|
|
3902
3906
|
if (o.isJsxNamespacedName(d))
|
|
3903
3907
|
throw Error(`JSX namespaced attributes are not supported. Found ${d.getText(e.sourceFile)}`);
|
|
3904
3908
|
if (d.text === "key")
|
|
3905
3909
|
return;
|
|
3906
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p :
|
|
3910
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Ke(p) ? Fn(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Xe(d.text) ? o.factory.createStringLiteral(d.text) : d;
|
|
3907
3911
|
return o.factory.createPropertyAssignment(f, m);
|
|
3908
|
-
}), { parts: a, litTag: c } =
|
|
3912
|
+
}), { parts: a, litTag: c } = De(n, e);
|
|
3909
3913
|
return a.length > 0 && r.push(
|
|
3910
3914
|
o.factory.createPropertyAssignment(
|
|
3911
3915
|
o.factory.createIdentifier("children"),
|
|
3912
|
-
|
|
3916
|
+
Ve({ key: void 0, parts: a, litTag: c }, e)
|
|
3913
3917
|
)
|
|
3914
3918
|
), o.factory.createCallExpression(i, void 0, [
|
|
3915
3919
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
3916
3920
|
]);
|
|
3917
3921
|
}
|
|
3918
|
-
function
|
|
3922
|
+
function De(e, t) {
|
|
3919
3923
|
let i;
|
|
3920
3924
|
const n = e.flatMap((s) => {
|
|
3921
3925
|
if (o.isJsxText(s))
|
|
@@ -3923,9 +3927,9 @@ function Ne(e, t) {
|
|
|
3923
3927
|
if (o.isJsxExpression(s))
|
|
3924
3928
|
return Nt(t, s, s);
|
|
3925
3929
|
{
|
|
3926
|
-
const r =
|
|
3930
|
+
const r = Nn(t, s);
|
|
3927
3931
|
if (r.key === void 0 && r.litTag !== ae && r.litTag !== Z) {
|
|
3928
|
-
if (r.litTag ===
|
|
3932
|
+
if (r.litTag === Tn)
|
|
3929
3933
|
return r.parts;
|
|
3930
3934
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
3931
3935
|
throw new Error(
|
|
@@ -3933,7 +3937,7 @@ function Ne(e, t) {
|
|
|
3933
3937
|
);
|
|
3934
3938
|
return i = r.litTag, r.parts;
|
|
3935
3939
|
} else
|
|
3936
|
-
return [
|
|
3940
|
+
return [Ve(r, t)];
|
|
3937
3941
|
}
|
|
3938
3942
|
});
|
|
3939
3943
|
return { litTag: i, parts: n };
|
|
@@ -3950,9 +3954,9 @@ function Nt(e, t, i) {
|
|
|
3950
3954
|
if (e.compiler.shouldMinifyJsx)
|
|
3951
3955
|
return [];
|
|
3952
3956
|
const n = t.getText(e.sourceFile).slice(1, -1);
|
|
3953
|
-
return Ft(n).length === 0 ? [] : [
|
|
3957
|
+
return Ft(n).length === 0 ? [] : [xn(n, o.factory.createIdentifier("undefined"))];
|
|
3954
3958
|
}
|
|
3955
|
-
return o.isStringLiteral(t.expression) ? [
|
|
3959
|
+
return o.isStringLiteral(t.expression) ? [nn(t.expression.text)] : (
|
|
3956
3960
|
/**
|
|
3957
3961
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
3958
3962
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4001,7 +4005,7 @@ function ic(e, t) {
|
|
|
4001
4005
|
return r;
|
|
4002
4006
|
}
|
|
4003
4007
|
}
|
|
4004
|
-
const
|
|
4008
|
+
const jn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), be = {
|
|
4005
4009
|
[ce]: ["lit-html", "lit/html.js", "lit"],
|
|
4006
4010
|
/**
|
|
4007
4011
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -4012,8 +4016,8 @@ const Rn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), w
|
|
|
4012
4016
|
[ae]: ["lit-html/static.js", "lit/static-html.js"],
|
|
4013
4017
|
[oe]: ["lit-html", "lit/html.js", "lit"],
|
|
4014
4018
|
[Z]: ["lit-html/static.js", "lit/static-html.js"],
|
|
4015
|
-
[
|
|
4016
|
-
[
|
|
4019
|
+
[Cn]: ["lit-html", "lit/html.js", "lit"],
|
|
4020
|
+
[En]: ["@lit/reactive-element/css-tag.js", "@lit/reactive-element", "lit"],
|
|
4017
4021
|
safeClassMap: ["@arcgis/lumina"],
|
|
4018
4022
|
safeStyleMap: ["@arcgis/lumina"],
|
|
4019
4023
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -4022,9 +4026,9 @@ const Rn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), w
|
|
|
4022
4026
|
repeat: ["lit-html/directives/repeat.js", "lit/directives/repeat.js"],
|
|
4023
4027
|
ref: ["lit-html/directives/ref.js", "lit/directives/ref.js"],
|
|
4024
4028
|
nothing: ["lit-html", "lit/html.js", "lit-element/lit-element.js", "lit", "@arcgis/lumina"]
|
|
4025
|
-
},
|
|
4026
|
-
Object.entries(
|
|
4027
|
-
),
|
|
4029
|
+
}, Rn = jn(
|
|
4030
|
+
Object.entries(be).flatMap(([e, t]) => t.map((i) => [i, e]))
|
|
4031
|
+
), Mn = new Set(Object.keys(Rn));
|
|
4028
4032
|
function nc(e, t) {
|
|
4029
4033
|
const i = t.importClause, n = t.moduleSpecifier;
|
|
4030
4034
|
if (!o.isStringLiteral(n))
|
|
@@ -4032,7 +4036,7 @@ function nc(e, t) {
|
|
|
4032
4036
|
const s = sc(e.sourceFile.fileName, n.text, ""), r = !i?.isTypeOnly;
|
|
4033
4037
|
if (r && e.existingImportedModules.add(s), i === void 0)
|
|
4034
4038
|
return t;
|
|
4035
|
-
if (e.isInLightDomComponent && n.text.startsWith(".") &&
|
|
4039
|
+
if (e.isInLightDomComponent && n.text.startsWith(".") && Oe.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4036
4040
|
!n.text.includes("?"))
|
|
4037
4041
|
return o.factory.updateImportDeclaration(
|
|
4038
4042
|
t,
|
|
@@ -4048,9 +4052,9 @@ function nc(e, t) {
|
|
|
4048
4052
|
const a = i.namedBindings;
|
|
4049
4053
|
if (a === void 0 || !o.isNamedImports(a))
|
|
4050
4054
|
return t;
|
|
4051
|
-
const c =
|
|
4055
|
+
const c = Mn.has(n.text);
|
|
4052
4056
|
return a.elements.forEach((l) => {
|
|
4053
|
-
const d = (l.propertyName ?? l.name).text, p =
|
|
4057
|
+
const d = (l.propertyName ?? l.name).text, p = be[d];
|
|
4054
4058
|
if (c) {
|
|
4055
4059
|
if (p?.some((y) => y === n.text)) {
|
|
4056
4060
|
const y = On(d, s);
|
|
@@ -4061,13 +4065,13 @@ function nc(e, t) {
|
|
|
4061
4065
|
r && !l.isTypeOnly && m && f && e.importedFunctionComponentsFromModules.add(s);
|
|
4062
4066
|
}), t;
|
|
4063
4067
|
}
|
|
4064
|
-
const On = (e, t) => e === ce &&
|
|
4068
|
+
const On = (e, t) => e === ce && be.staticHtml.includes(t) ? ae : e === oe && be.staticSvg.includes(t) ? Z : e, sc = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4065
4069
|
function rc(e) {
|
|
4066
4070
|
return o.isImportDeclaration(e) ? oc(this, e) : e;
|
|
4067
4071
|
}
|
|
4068
4072
|
function oc(e, t) {
|
|
4069
4073
|
const i = t.importClause, n = i?.namedBindings, s = t.moduleSpecifier;
|
|
4070
|
-
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !
|
|
4074
|
+
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !Mn.has(s.text))
|
|
4071
4075
|
return t;
|
|
4072
4076
|
const r = i.isTypeOnly;
|
|
4073
4077
|
let a = !1;
|
|
@@ -4075,7 +4079,7 @@ function oc(e, t) {
|
|
|
4075
4079
|
const d = (l.propertyName ?? l.name).text, p = On(d, s.text);
|
|
4076
4080
|
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;
|
|
4077
4081
|
});
|
|
4078
|
-
return
|
|
4082
|
+
return Rn[s.text]?.forEach((l) => {
|
|
4079
4083
|
!e.neededImports.has(l) || e.existingLitImports.has(l) || (e.neededImports.delete(l), a = !0, c.push(Jn(l, e)));
|
|
4080
4084
|
}), a ? o.factory.updateImportDeclaration(
|
|
4081
4085
|
t,
|
|
@@ -4091,7 +4095,7 @@ function oc(e, t) {
|
|
|
4091
4095
|
) : t;
|
|
4092
4096
|
}
|
|
4093
4097
|
function ac(e) {
|
|
4094
|
-
const t =
|
|
4098
|
+
const t = jn(Array.from(e.neededImports, (i) => [be[i][0], i]));
|
|
4095
4099
|
return Object.entries(t).map(
|
|
4096
4100
|
([i, n]) => o.factory.createImportDeclaration(
|
|
4097
4101
|
void 0,
|
|
@@ -4119,7 +4123,7 @@ function cc(e) {
|
|
|
4119
4123
|
return e.existingImportedModules.forEach((i) => {
|
|
4120
4124
|
if (u.isAbsolute(i))
|
|
4121
4125
|
return;
|
|
4122
|
-
const { packageName: n, moduleName: s } =
|
|
4126
|
+
const { packageName: n, moduleName: s } = ln(i);
|
|
4123
4127
|
if (t.includes(n ?? "") && (s.startsWith("dist/components") || s.startsWith("components"))) {
|
|
4124
4128
|
const r = Y(e.sourceFile.fileName);
|
|
4125
4129
|
throw new Error(
|
|
@@ -4144,11 +4148,11 @@ function lc(e) {
|
|
|
4144
4148
|
}), [];
|
|
4145
4149
|
}
|
|
4146
4150
|
function dc(e, t, i) {
|
|
4147
|
-
const n =
|
|
4151
|
+
const n = Sn()[t] ?? Kn(e)[t];
|
|
4148
4152
|
if (n === void 0) {
|
|
4149
4153
|
const s = Y(i);
|
|
4150
4154
|
throw Error(
|
|
4151
|
-
|
|
4155
|
+
w(
|
|
4152
4156
|
"@arcgis/lumina:resolveTagName",
|
|
4153
4157
|
`Unable to resolve the definition of the "${t}" custom element. Used in ${s}. If this is coming from an external package, make sure that package is installed as a peerDependency or a dependency. If in development-only you wish to use a component package that is defined as a devDependency, then provide serve.extraDependencies option to useLumina()`
|
|
4154
4158
|
)
|
|
@@ -4160,7 +4164,7 @@ function pc(e, t) {
|
|
|
4160
4164
|
return e.packageName === void 0 ? ee(t, e.moduleName) : u.join(e.packageName, e.moduleName);
|
|
4161
4165
|
}
|
|
4162
4166
|
function Kn(e) {
|
|
4163
|
-
return e._localDefinedComponents ??=
|
|
4167
|
+
return e._localDefinedComponents ??= wn(e.privateApiJson, {
|
|
4164
4168
|
packageName: void 0,
|
|
4165
4169
|
getImportPath() {
|
|
4166
4170
|
throw new Error("Not supposed to be called for local components");
|
|
@@ -4173,7 +4177,7 @@ const uc = (e, t) => {
|
|
|
4173
4177
|
return e.statements;
|
|
4174
4178
|
const n = {
|
|
4175
4179
|
compiler: t.compiler,
|
|
4176
|
-
externalComponents:
|
|
4180
|
+
externalComponents: Sn(),
|
|
4177
4181
|
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : Kn(t.compiler),
|
|
4178
4182
|
sourceFile: e,
|
|
4179
4183
|
transformationContext: t.transformation,
|
|
@@ -4215,7 +4219,7 @@ const uc = (e, t) => {
|
|
|
4215
4219
|
};
|
|
4216
4220
|
function mc(e) {
|
|
4217
4221
|
return fc(e), Object.fromEntries(
|
|
4218
|
-
|
|
4222
|
+
ka.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4219
4223
|
);
|
|
4220
4224
|
}
|
|
4221
4225
|
function fc(e) {
|
|
@@ -4237,8 +4241,8 @@ function yc(e, t, i) {
|
|
|
4237
4241
|
o.factory.createObjectLiteralExpression(
|
|
4238
4242
|
Array.from(t.entries()).map(
|
|
4239
4243
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4240
|
-
|
|
4241
|
-
|
|
4244
|
+
Xe(n) ? o.factory.createStringLiteral(n) : n,
|
|
4245
|
+
gc(s, i)
|
|
4242
4246
|
)
|
|
4243
4247
|
)
|
|
4244
4248
|
)
|
|
@@ -4246,7 +4250,7 @@ function yc(e, t, i) {
|
|
|
4246
4250
|
...e
|
|
4247
4251
|
];
|
|
4248
4252
|
}
|
|
4249
|
-
function
|
|
4253
|
+
function gc(e, t) {
|
|
4250
4254
|
let i = 0, n = !0;
|
|
4251
4255
|
const s = [], r = [];
|
|
4252
4256
|
for (const l of e.properties)
|
|
@@ -4256,7 +4260,7 @@ function hc(e, t) {
|
|
|
4256
4260
|
return !0;
|
|
4257
4261
|
const d = l.name.text, p = l.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
|
|
4258
4262
|
if (d === "attribute")
|
|
4259
|
-
return n = !1, i |= m ?
|
|
4263
|
+
return n = !1, i |= m ? Ht : 0, !m && !f;
|
|
4260
4264
|
if (d === "reflect")
|
|
4261
4265
|
return i |= m ? Is : 0, !1;
|
|
4262
4266
|
if (d === "type" && o.isIdentifier(p)) {
|
|
@@ -4273,7 +4277,7 @@ function hc(e, t) {
|
|
|
4273
4277
|
}
|
|
4274
4278
|
return !0;
|
|
4275
4279
|
}
|
|
4276
|
-
n && (i |=
|
|
4280
|
+
n && (i |= Ht);
|
|
4277
4281
|
const c = o.factory.createNumericLiteral(i);
|
|
4278
4282
|
return s.length === 0 && (t || r.length === 0) ? c : o.factory.createArrayLiteralExpression([
|
|
4279
4283
|
c,
|
|
@@ -4288,7 +4292,7 @@ function hc(e, t) {
|
|
|
4288
4292
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4289
4293
|
]);
|
|
4290
4294
|
}
|
|
4291
|
-
function
|
|
4295
|
+
function hc(e, t, i, n, s) {
|
|
4292
4296
|
let r = -1, a = -1, c = -1;
|
|
4293
4297
|
t.options?.properties.forEach((f, y) => {
|
|
4294
4298
|
if (o.isSpreadAssignment(f))
|
|
@@ -4296,8 +4300,8 @@ function gc(e, t, i, n, s) {
|
|
|
4296
4300
|
`Spread property assignment is not allowed in @property() as that is not statically analyzable. Found ${f.getText(n)}`
|
|
4297
4301
|
);
|
|
4298
4302
|
if (o.isIdentifier(f.name)) {
|
|
4299
|
-
const
|
|
4300
|
-
|
|
4303
|
+
const g = f.name.text;
|
|
4304
|
+
g === "type" ? r = y : g === "attribute" ? a = y : g === "readOnly" && (c = y);
|
|
4301
4305
|
}
|
|
4302
4306
|
});
|
|
4303
4307
|
const l = s.attribute === void 0 && a === -1, d = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = vc(e, t, i, s, r), m = [
|
|
@@ -4310,7 +4314,7 @@ function gc(e, t, i, n, s) {
|
|
|
4310
4314
|
function vc(e, t, i, n, s) {
|
|
4311
4315
|
if (n.attribute === void 0)
|
|
4312
4316
|
return;
|
|
4313
|
-
const r =
|
|
4317
|
+
const r = bc(e), a = i.compiler.viteCommand === "serve" || r !== "Other" ? r : Sc(n.type.values);
|
|
4314
4318
|
return a === "Other" || n.readonly && (a !== "Boolean" || !n.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4315
4319
|
o.factory.createIdentifier("type"),
|
|
4316
4320
|
o.factory.createIdentifier(a)
|
|
@@ -4328,7 +4332,7 @@ function Sc(e) {
|
|
|
4328
4332
|
}
|
|
4329
4333
|
return "Other";
|
|
4330
4334
|
}
|
|
4331
|
-
function
|
|
4335
|
+
function bc(e) {
|
|
4332
4336
|
const t = e.type ?? (o.isSetAccessor(e) ? e.parameters[0].type : void 0);
|
|
4333
4337
|
if (t === void 0) {
|
|
4334
4338
|
if ("initializer" in e && e.initializer !== void 0) {
|
|
@@ -4345,7 +4349,7 @@ function wc(e) {
|
|
|
4345
4349
|
}
|
|
4346
4350
|
return "Other";
|
|
4347
4351
|
}
|
|
4348
|
-
function
|
|
4352
|
+
function wc(e, t, i, n, s) {
|
|
4349
4353
|
if (t.modifiers === void 0)
|
|
4350
4354
|
return t;
|
|
4351
4355
|
let r = -1, a = -1;
|
|
@@ -4355,14 +4359,14 @@ function bc(e, t, i, n, s) {
|
|
|
4355
4359
|
d === "property" && (r = l), d === "state" && (a = l);
|
|
4356
4360
|
}
|
|
4357
4361
|
}), r !== -1) {
|
|
4358
|
-
const c = Tc(e, t, i, n), l =
|
|
4362
|
+
const c = Tc(e, t, i, n), l = wi(t, r, n), d = hc(t, l, e, n, c);
|
|
4359
4363
|
let p = !1;
|
|
4360
|
-
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d,
|
|
4364
|
+
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, Ti(t, l, r, p);
|
|
4361
4365
|
} else if (a !== -1) {
|
|
4362
|
-
const c =
|
|
4366
|
+
const c = wi(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);
|
|
4363
4367
|
if (p === void 0)
|
|
4364
4368
|
throw new Error("Failed to statically determine the state property name");
|
|
4365
|
-
return s.set(p, d),
|
|
4369
|
+
return s.set(p, d), Ti(t, c, a, !0);
|
|
4366
4370
|
} else
|
|
4367
4371
|
return t;
|
|
4368
4372
|
}
|
|
@@ -4385,11 +4389,11 @@ function Tc(e, t, i, n) {
|
|
|
4385
4389
|
throw Error(
|
|
4386
4390
|
`Failed to statically determine the property name: ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
4387
4391
|
);
|
|
4388
|
-
r.name = a, r.attribute ??=
|
|
4392
|
+
r.name = a, r.attribute ??= wt(a);
|
|
4389
4393
|
}
|
|
4390
4394
|
return r;
|
|
4391
4395
|
}
|
|
4392
|
-
function
|
|
4396
|
+
function wi(e, t, i) {
|
|
4393
4397
|
const n = e.modifiers[t], s = n.expression, r = s.arguments.at(0);
|
|
4394
4398
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4395
4399
|
throw new Error(
|
|
@@ -4397,7 +4401,7 @@ function Ti(e, t, i) {
|
|
|
4397
4401
|
);
|
|
4398
4402
|
return { decorator: n, callExpression: s, options: r };
|
|
4399
4403
|
}
|
|
4400
|
-
function
|
|
4404
|
+
function Ti(e, t, i, n) {
|
|
4401
4405
|
const s = n ? void 0 : o.factory.updateDecorator(
|
|
4402
4406
|
t.decorator,
|
|
4403
4407
|
o.factory.updateCallExpression(
|
|
@@ -4446,10 +4450,10 @@ const Ec = (e, t) => {
|
|
|
4446
4450
|
return t.compiler.viteCommand === "build" && o.setEmitFlags(d, o.EmitFlags.NoComments), d;
|
|
4447
4451
|
}
|
|
4448
4452
|
return e.statements.map(
|
|
4449
|
-
(c) =>
|
|
4453
|
+
(c) => Bn(r, c, t, n, s)
|
|
4450
4454
|
);
|
|
4451
4455
|
};
|
|
4452
|
-
function
|
|
4456
|
+
function Bn(e, t, i, n, s = Bi) {
|
|
4453
4457
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4454
4458
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4455
4459
|
let r = !1;
|
|
@@ -4472,7 +4476,7 @@ function Wn(e, t, i, n, s = Bi) {
|
|
|
4472
4476
|
} else
|
|
4473
4477
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4474
4478
|
t,
|
|
4475
|
-
(a) =>
|
|
4479
|
+
(a) => Bn(e, a, i, n, s),
|
|
4476
4480
|
i.transformation
|
|
4477
4481
|
) : t;
|
|
4478
4482
|
}
|
|
@@ -4520,16 +4524,16 @@ function $c(e, t, i, n, s) {
|
|
|
4520
4524
|
);
|
|
4521
4525
|
}
|
|
4522
4526
|
}
|
|
4523
|
-
return o.isPropertyDeclaration(t) || o.isAccessor(t) ?
|
|
4527
|
+
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? wc(e, t, i, n, s) : t;
|
|
4524
4528
|
}
|
|
4525
|
-
const Pc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", vt = "@arcgis/core", ct = R(),
|
|
4529
|
+
const Pc = (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
|
|
4526
4530
|
ct.name === "@arcgis/lumina";
|
|
4527
4531
|
async function xc(e, t) {
|
|
4528
|
-
if (!
|
|
4532
|
+
if (!Ce)
|
|
4529
4533
|
return [];
|
|
4530
|
-
const i = await
|
|
4534
|
+
const i = await _e(vt);
|
|
4531
4535
|
if (t === "cdn") {
|
|
4532
|
-
const n = await
|
|
4536
|
+
const n = await He(i), s = Ge({ name: "", version: n.version }, !0);
|
|
4533
4537
|
return [
|
|
4534
4538
|
// Use the ESM CDN
|
|
4535
4539
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -4545,22 +4549,22 @@ async function xc(e, t) {
|
|
|
4545
4549
|
})
|
|
4546
4550
|
},
|
|
4547
4551
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
4548
|
-
|
|
4552
|
+
Ei(s)
|
|
4549
4553
|
];
|
|
4550
4554
|
} else
|
|
4551
|
-
return [
|
|
4555
|
+
return [Ei(It(e, `${i}/assets/`))];
|
|
4552
4556
|
}
|
|
4553
|
-
const
|
|
4557
|
+
const Ei = (e) => ({
|
|
4554
4558
|
// Not using join() because it would turn https:// into https:/
|
|
4555
4559
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
4556
4560
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
4557
4561
|
id: "arcgisCoreStylesheet"
|
|
4558
|
-
}),
|
|
4559
|
-
function
|
|
4560
|
-
const i = e.indexOf(
|
|
4562
|
+
}), Ci = "makeRuntime(", kc = "@arcgis/core";
|
|
4563
|
+
function Ac(e, t) {
|
|
4564
|
+
const i = e.indexOf(Ci);
|
|
4561
4565
|
if (i === -1)
|
|
4562
4566
|
throw new Error("Failed to find makeRuntime() function call in src/runtime.ts");
|
|
4563
|
-
const n = i +
|
|
4567
|
+
const n = i + Ci.length, s = t.options.css?.commonStylesPath;
|
|
4564
4568
|
return {
|
|
4565
4569
|
code: [
|
|
4566
4570
|
s === void 0 ? "" : `import commonStyles from "${ee(t.dir.src, s)}";`,
|
|
@@ -4568,15 +4572,18 @@ function kc(e, t) {
|
|
|
4568
4572
|
"{",
|
|
4569
4573
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
4570
4574
|
'hydratedAttribute:"',
|
|
4571
|
-
t.options.css?.hydratedAttribute ??
|
|
4575
|
+
t.options.css?.hydratedAttribute ?? mn,
|
|
4572
4576
|
'",',
|
|
4573
4577
|
s === void 0 ? "" : "commonStyles",
|
|
4574
4578
|
"}",
|
|
4575
4579
|
e.slice(n),
|
|
4576
|
-
|
|
4577
|
-
import {createObservable,trackAccess} from "${
|
|
4580
|
+
Ce ? `
|
|
4581
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${kc}/applications/Components/reactiveUtils.js";
|
|
4582
|
+
createObservable,
|
|
4578
4583
|
runtime.t = trackAccess;
|
|
4579
|
-
runtime.o = createObservable
|
|
4584
|
+
runtime.o = createObservable;
|
|
4585
|
+
runtime.c = createTrackingTarget;
|
|
4586
|
+
runtime.r = runTracked;` : ""
|
|
4580
4587
|
].join(""),
|
|
4581
4588
|
map: null
|
|
4582
4589
|
};
|
|
@@ -4585,8 +4592,8 @@ const Ic = [
|
|
|
4585
4592
|
uc,
|
|
4586
4593
|
Xs,
|
|
4587
4594
|
Ec
|
|
4588
|
-
],
|
|
4589
|
-
name:
|
|
4595
|
+
], $i = "@arcgis/lumina:transformComponents", Lc = (e) => ({
|
|
4596
|
+
name: $i,
|
|
4590
4597
|
transform: {
|
|
4591
4598
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4592
4599
|
order: "pre",
|
|
@@ -4594,18 +4601,18 @@ const Ic = [
|
|
|
4594
4601
|
if (!i.endsWith(".tsx")) {
|
|
4595
4602
|
if (e.isInTest && i.endsWith(".ts") && Et(i) && t.includes("extends LitElement"))
|
|
4596
4603
|
C.warn(
|
|
4597
|
-
|
|
4604
|
+
$i,
|
|
4598
4605
|
"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",
|
|
4599
4606
|
i
|
|
4600
4607
|
);
|
|
4601
4608
|
else if (i === `${e.dir.src}runtime.ts`)
|
|
4602
|
-
return
|
|
4609
|
+
return Ac(t, e);
|
|
4603
4610
|
return;
|
|
4604
4611
|
}
|
|
4605
4612
|
const n = e.getSourceFile(i, t);
|
|
4606
4613
|
await ve;
|
|
4607
4614
|
const r = o.transform(n, [
|
|
4608
|
-
(f) => () =>
|
|
4615
|
+
(f) => () => Gi(e, f, n, [
|
|
4609
4616
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4610
4617
|
...Ic
|
|
4611
4618
|
])
|
|
@@ -4661,7 +4668,7 @@ function Nc(e) {
|
|
|
4661
4668
|
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : fs(t ?? "tsconfig.json");
|
|
4662
4669
|
if (i === void 0)
|
|
4663
4670
|
throw Error(
|
|
4664
|
-
|
|
4671
|
+
w(
|
|
4665
4672
|
"@arcgis/lumina:loadTypeScriptConfig",
|
|
4666
4673
|
`Unable to find ${Y(String(t))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`,
|
|
4667
4674
|
process.cwd()
|
|
@@ -4684,11 +4691,11 @@ function Nc(e) {
|
|
|
4684
4691
|
}, r = o.parseJsonConfigFileContent(s, o.sys, u.dirname(i));
|
|
4685
4692
|
e.typeScriptConfig = r.options, e.typeScriptConfigPath = i;
|
|
4686
4693
|
}
|
|
4687
|
-
function
|
|
4694
|
+
function Wn(e) {
|
|
4688
4695
|
const t = e.target;
|
|
4689
4696
|
if (t === void 0)
|
|
4690
4697
|
throw Error(
|
|
4691
|
-
|
|
4698
|
+
w(
|
|
4692
4699
|
"@arcgis/lumina:resolveTargetVersion",
|
|
4693
4700
|
'TypeScript config must have a "target" property specified (or any parent tsconfig.json file if this config is extending another tsconfig.json)'
|
|
4694
4701
|
)
|
|
@@ -4718,7 +4725,7 @@ function Dc(e, t) {
|
|
|
4718
4725
|
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Ts();
|
|
4719
4726
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4720
4727
|
}
|
|
4721
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = Fc(e), e._typeScriptPrinter =
|
|
4728
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = Fc(e), e._typeScriptPrinter = rn(e._compilerOptionsForPrinter);
|
|
4722
4729
|
}
|
|
4723
4730
|
async function jc(e, t, i) {
|
|
4724
4731
|
const n = u.resolve(e.dir.root, t);
|
|
@@ -4740,20 +4747,20 @@ async function jc(e, t, i) {
|
|
|
4740
4747
|
if (typeof p == "string")
|
|
4741
4748
|
return `<${d.tag} ${Object.entries(d.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${d.tag}>`;
|
|
4742
4749
|
}
|
|
4743
|
-
throw Error(
|
|
4750
|
+
throw Error(w("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(d)}`));
|
|
4744
4751
|
}).join(`
|
|
4745
4752
|
`);
|
|
4746
4753
|
await Promise.all(
|
|
4747
4754
|
s.map(async (d, p) => {
|
|
4748
|
-
const f = p === 0 ? d : u.join(r, d), y = u.join(e.dir.root, f),
|
|
4749
|
-
await z(u.dirname(
|
|
4750
|
-
const
|
|
4755
|
+
const f = p === 0 ? d : u.join(r, d), y = u.join(e.dir.root, f), g = u.join(n, f);
|
|
4756
|
+
await z(u.dirname(g), { recursive: !0 });
|
|
4757
|
+
const h = await J(y, "utf-8"), v = ee(u.dirname(f), `build/${i}`), S = `${l}<script type="module" src="${v}"><\/script>
|
|
4751
4758
|
`;
|
|
4752
|
-
let E =
|
|
4753
|
-
if (E === -1 && (E =
|
|
4754
|
-
throw Error(
|
|
4755
|
-
const
|
|
4756
|
-
await F(
|
|
4759
|
+
let E = h.indexOf("<style>");
|
|
4760
|
+
if (E === -1 && (E = h.indexOf("</head>")), E === -1)
|
|
4761
|
+
throw Error(w("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
|
|
4762
|
+
const x = h.slice(0, E) + S + h.slice(E);
|
|
4763
|
+
await F(g, x, "utf-8");
|
|
4757
4764
|
})
|
|
4758
4765
|
);
|
|
4759
4766
|
}
|
|
@@ -4770,7 +4777,7 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
4770
4777
|
"collection",
|
|
4771
4778
|
"extras",
|
|
4772
4779
|
"support"
|
|
4773
|
-
]), _ = "@arcgis/lumina:buildCdn",
|
|
4780
|
+
]), _ = "@arcgis/lumina:buildCdn", Dt = "cdn", Hn = "index", we = "main";
|
|
4774
4781
|
function Rc(e) {
|
|
4775
4782
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4776
4783
|
if (r) {
|
|
@@ -4789,7 +4796,7 @@ function Rc(e) {
|
|
|
4789
4796
|
{
|
|
4790
4797
|
type: "dynamic",
|
|
4791
4798
|
source: () => _o(e),
|
|
4792
|
-
destination: `../${r ? a :
|
|
4799
|
+
destination: `../${r ? a : we}.css`
|
|
4793
4800
|
}
|
|
4794
4801
|
]), !t)
|
|
4795
4802
|
return {
|
|
@@ -4797,10 +4804,10 @@ function Rc(e) {
|
|
|
4797
4804
|
async writeBundle() {
|
|
4798
4805
|
if (e.isInStorybook)
|
|
4799
4806
|
return;
|
|
4800
|
-
const c =
|
|
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 Mc(e, a, n, d, c);
|
|
4801
4808
|
await Oc(
|
|
4802
4809
|
p,
|
|
4803
|
-
e
|
|
4810
|
+
e,
|
|
4804
4811
|
r ? `${a}.esm` : a,
|
|
4805
4812
|
d,
|
|
4806
4813
|
c
|
|
@@ -4814,14 +4821,14 @@ async function Mc(e, t, i, n, s) {
|
|
|
4814
4821
|
const r = e.environment;
|
|
4815
4822
|
if (i.minify && s)
|
|
4816
4823
|
throw Error(
|
|
4817
|
-
|
|
4824
|
+
w(
|
|
4818
4825
|
_,
|
|
4819
4826
|
"Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4820
4827
|
)
|
|
4821
4828
|
);
|
|
4822
4829
|
if (i.sourcemap && s)
|
|
4823
4830
|
throw Error(
|
|
4824
|
-
|
|
4831
|
+
w(
|
|
4825
4832
|
_,
|
|
4826
4833
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4827
4834
|
)
|
|
@@ -4852,7 +4859,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4852
4859
|
chunkNames: "[hash]",
|
|
4853
4860
|
resolveExtensions: [".js", ".json"],
|
|
4854
4861
|
banner: { js: e.banner },
|
|
4855
|
-
target:
|
|
4862
|
+
target: Wn(e.typeScriptConfig),
|
|
4856
4863
|
...i,
|
|
4857
4864
|
plugins: [
|
|
4858
4865
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
@@ -4881,7 +4888,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4881
4888
|
namespace: "@arcgis/lumina:accessorSupport"
|
|
4882
4889
|
} : void 0
|
|
4883
4890
|
), a.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
|
|
4884
|
-
contents: "export const createObservable=undefined, trackAccess=undefined;",
|
|
4891
|
+
contents: "export const createObservable=undefined, trackAccess=undefined, createTrackingTarget=undefined, runTracked = undefined;",
|
|
4885
4892
|
loader: "js"
|
|
4886
4893
|
}));
|
|
4887
4894
|
}
|
|
@@ -4897,7 +4904,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4897
4904
|
* The script's file name will be stripped inside defineCustomElements.
|
|
4898
4905
|
**/
|
|
4899
4906
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
4900
|
-
${
|
|
4907
|
+
${fn(e._globalCssString, e)}`,
|
|
4901
4908
|
sourcefile: `${t}.esm.js`,
|
|
4902
4909
|
resolveDir: e.dir.dist,
|
|
4903
4910
|
loader: "js",
|
|
@@ -4906,30 +4913,30 @@ ${yn(e._globalCssString, e)}`,
|
|
|
4906
4913
|
});
|
|
4907
4914
|
}
|
|
4908
4915
|
async function Oc(e, t, i, n, s) {
|
|
4909
|
-
const r = `${i}.js`,
|
|
4910
|
-
e.outputFiles.map((
|
|
4911
|
-
const
|
|
4912
|
-
code:
|
|
4916
|
+
const r = t.dir.distCdn, a = `${i}.js`, c = new Map(
|
|
4917
|
+
e.outputFiles.map((l) => {
|
|
4918
|
+
const d = {
|
|
4919
|
+
code: l.text,
|
|
4913
4920
|
isAsync: void 0,
|
|
4914
4921
|
oldSingleExportName: void 0
|
|
4915
|
-
},
|
|
4916
|
-
if (
|
|
4922
|
+
}, p = l.path.slice(r.length);
|
|
4923
|
+
if (p === "stdin.js") {
|
|
4917
4924
|
if (s) {
|
|
4918
|
-
const
|
|
4919
|
-
if (
|
|
4925
|
+
const f = l.text.match(Jc)?.[0];
|
|
4926
|
+
if (f === void 0)
|
|
4920
4927
|
throw Error(
|
|
4921
4928
|
"Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina"
|
|
4922
4929
|
);
|
|
4923
|
-
|
|
4930
|
+
d.code = `${d.code.trimEnd()}${Kc(f, n)}`, d.isAsync = !1;
|
|
4924
4931
|
}
|
|
4925
|
-
return [
|
|
4932
|
+
return [a, d];
|
|
4926
4933
|
}
|
|
4927
|
-
return [
|
|
4934
|
+
return [p, d];
|
|
4928
4935
|
})
|
|
4929
4936
|
);
|
|
4930
|
-
s &&
|
|
4931
|
-
|
|
4932
|
-
}), await Promise.all(Array.from(
|
|
4937
|
+
s && c.forEach((l, d) => {
|
|
4938
|
+
l.isAsync === void 0 && (d.endsWith(".js") ? Un(l, c) : l.isAsync = !1);
|
|
4939
|
+
}), t.options.build?.cdn?.transformer?.(c, t), await Promise.all(Array.from(c.entries(), async ([l, { code: d }]) => await F(r + l, d)));
|
|
4933
4940
|
}
|
|
4934
4941
|
const Jc = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
4935
4942
|
function Kc(e, t) {
|
|
@@ -4940,7 +4947,7 @@ function Kc(e, t) {
|
|
|
4940
4947
|
"("
|
|
4941
4948
|
].join("");
|
|
4942
4949
|
const n = t.length > 0;
|
|
4943
|
-
if (i += "(a,r", n && (i += ",p,j"), i += ")=>{", n) {
|
|
4950
|
+
if (i += "(a,r", n && (i += ",p,j,i=(a.importMap??={}).imports??={}"), i += ")=>{", n) {
|
|
4944
4951
|
const s = [];
|
|
4945
4952
|
for (const r of t) {
|
|
4946
4953
|
if (r.in.includes("*")) {
|
|
@@ -4948,10 +4955,10 @@ function Kc(e, t) {
|
|
|
4948
4955
|
continue;
|
|
4949
4956
|
}
|
|
4950
4957
|
if (r.out.startsWith(".") || r.out.startsWith("/"))
|
|
4951
|
-
throw Error(
|
|
4958
|
+
throw Error(w(_, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
|
|
4952
4959
|
s.push(r.out);
|
|
4953
4960
|
}
|
|
4954
|
-
i += `
|
|
4961
|
+
i += `"${s.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
|
|
4955
4962
|
}
|
|
4956
4963
|
if (i += [
|
|
4957
4964
|
"a.t=(c,...x)=>",
|
|
@@ -4961,7 +4968,7 @@ function Kc(e, t) {
|
|
|
4961
4968
|
// Start loading from reactiveUtils the modules we need to enable integration.
|
|
4962
4969
|
// Store the promise on the runtime object so that the lazy loader awaits
|
|
4963
4970
|
// this before beginning hydration.
|
|
4964
|
-
'r.p=a.t(m=>{r.t=m.trackAccess;r.o=m.createObservable},"applications/Components/reactiveUtils")}',
|
|
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")}',
|
|
4965
4972
|
// We use `a` variable as a shorter alias to `$arcgis` to save bytes.
|
|
4966
4973
|
// We pass runtime as an argument rather than access it directly inside the
|
|
4967
4974
|
// closure to avoid possible collisions (in case runtime variable was
|
|
@@ -4976,33 +4983,33 @@ function Kc(e, t) {
|
|
|
4976
4983
|
function Un(e, t) {
|
|
4977
4984
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4978
4985
|
let c = 0;
|
|
4979
|
-
const l = e.code.matchAll(
|
|
4980
|
-
for (const
|
|
4981
|
-
const [T, L, N, D, M] =
|
|
4982
|
-
if (c !== 0 && c !==
|
|
4983
|
-
const K = e.code.slice(c,
|
|
4986
|
+
const l = e.code.matchAll(Bc);
|
|
4987
|
+
for (const b of l) {
|
|
4988
|
+
const [T, L, N, D, M] = b, H = M.startsWith(We);
|
|
4989
|
+
if (c !== 0 && c !== b.index) {
|
|
4990
|
+
const K = e.code.slice(c, b.index);
|
|
4984
4991
|
s.push(K), a.push([c, K.length, 0, ""]);
|
|
4985
4992
|
}
|
|
4986
|
-
if (c =
|
|
4987
|
-
a.push([
|
|
4993
|
+
if (c = b.index + T.length, H)
|
|
4994
|
+
a.push([b.index, T.length, 0, ""]), n.push(`"${qn(M.slice(We.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? N ?? D ?? "");
|
|
4988
4995
|
else {
|
|
4989
4996
|
const K = zn(M, t), G = K?.isAsync === !0;
|
|
4990
4997
|
if (L !== void 0) {
|
|
4991
|
-
const
|
|
4998
|
+
const xe = [];
|
|
4992
4999
|
for (const Ye of L.slice(1, -1).split(",")) {
|
|
4993
|
-
const [
|
|
4994
|
-
G || r.add(
|
|
5000
|
+
const [Ot, Jt = Ot] = Ye.split(" as ");
|
|
5001
|
+
G || r.add(Jt), xe.push(`${Ot}:${Jt}`);
|
|
4995
5002
|
}
|
|
4996
5003
|
if (G) {
|
|
4997
|
-
const Ye = K.oldSingleExportName === void 0 ? `{${
|
|
4998
|
-
a.push([
|
|
5004
|
+
const Ye = K.oldSingleExportName === void 0 ? `{${xe.join(",")}}` : xe[0].split(":")[1];
|
|
5005
|
+
a.push([b.index + 6, 0, L.length, Ye]);
|
|
4999
5006
|
}
|
|
5000
5007
|
} else if (N === void 0 && D === void 0)
|
|
5001
|
-
G && a.push([
|
|
5008
|
+
G && a.push([b.index + 6, 0, 0, ""]);
|
|
5002
5009
|
else {
|
|
5003
5010
|
if (G)
|
|
5004
5011
|
throw Error(
|
|
5005
|
-
|
|
5012
|
+
w(
|
|
5006
5013
|
_,
|
|
5007
5014
|
`Expected local import specifiers to use only named or side-effect import syntax. Found ${T}`
|
|
5008
5015
|
)
|
|
@@ -5012,13 +5019,13 @@ function Un(e, t) {
|
|
|
5012
5019
|
}
|
|
5013
5020
|
}
|
|
5014
5021
|
if (e.isAsync = a.length > 0, !e.isAsync) {
|
|
5015
|
-
e.code =
|
|
5022
|
+
e.code = Pi(e.code, t);
|
|
5016
5023
|
return;
|
|
5017
5024
|
}
|
|
5018
5025
|
const d = Hc(r);
|
|
5019
5026
|
let p = e.code.slice(0, c);
|
|
5020
|
-
for (let
|
|
5021
|
-
const [T, L, N, D] = a[
|
|
5027
|
+
for (let b = a.length - 1; b >= 0; b--) {
|
|
5028
|
+
const [T, L, N, D] = a[b];
|
|
5022
5029
|
let M = L, H = "";
|
|
5023
5030
|
if (L === 0) {
|
|
5024
5031
|
const G = d();
|
|
@@ -5026,38 +5033,38 @@ function Un(e, t) {
|
|
|
5026
5033
|
}
|
|
5027
5034
|
p = p.slice(0, T) + H + p.slice(T + M);
|
|
5028
5035
|
}
|
|
5029
|
-
const m =
|
|
5036
|
+
const m = Wc.exec(e.code), f = m?.index ?? e.code.length;
|
|
5030
5037
|
let y = "";
|
|
5031
5038
|
if (m !== null) {
|
|
5032
|
-
const
|
|
5033
|
-
if (
|
|
5034
|
-
y = `return{${
|
|
5039
|
+
const b = m[1].split(",");
|
|
5040
|
+
if (b.length > 1)
|
|
5041
|
+
y = `return{${b.map((T) => {
|
|
5035
5042
|
const [L, N = L] = T.split(" as ");
|
|
5036
5043
|
return `${N}:${L}`;
|
|
5037
5044
|
}).join(",")}}`;
|
|
5038
5045
|
else {
|
|
5039
|
-
const [T, L = T] =
|
|
5046
|
+
const [T, L = T] = b[0].split(" as ");
|
|
5040
5047
|
e.oldSingleExportName = L, y = `return ${T}`;
|
|
5041
5048
|
}
|
|
5042
5049
|
}
|
|
5043
|
-
const
|
|
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}])`}=>{`, E = n.join(","), x = `${y}},${E})`;
|
|
5044
5051
|
let I = e.code.slice(c, f);
|
|
5045
|
-
I = `${s.join("")}${I}`, I =
|
|
5046
|
-
const
|
|
5047
|
-
e.code =
|
|
5052
|
+
I = `${s.join("")}${I}`, I = Pi(I, t);
|
|
5053
|
+
const $ = `${p}${S}${I}${x}`;
|
|
5054
|
+
e.code = $;
|
|
5048
5055
|
}
|
|
5049
|
-
const
|
|
5056
|
+
const Bc = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, Wc = /export\{([^}]+)\};\n$/u, We = "@arcgis/core/";
|
|
5050
5057
|
function zn(e, t) {
|
|
5051
5058
|
if (!e.startsWith("./"))
|
|
5052
5059
|
return;
|
|
5053
5060
|
const i = e.slice(2), n = t.get(i);
|
|
5054
5061
|
if (n === void 0)
|
|
5055
|
-
throw Error(
|
|
5062
|
+
throw Error(w(_, `Failed to find the ${e} module`));
|
|
5056
5063
|
if (n.isAsync === void 0 && Un(n, t), n.isAsync === void 0)
|
|
5057
|
-
throw Error(
|
|
5064
|
+
throw Error(w(_, `Failed to infer whether the ${e} module has top-level await`));
|
|
5058
5065
|
return n;
|
|
5059
5066
|
}
|
|
5060
|
-
function
|
|
5067
|
+
function Pi(e, t) {
|
|
5061
5068
|
return e.replaceAll(_c, (i, n) => {
|
|
5062
5069
|
if (n.startsWith(We))
|
|
5063
5070
|
return `$arcgis.t(m=>m[0],"${qn(n.slice(We.length))}")`;
|
|
@@ -5080,9 +5087,9 @@ function Hc(e) {
|
|
|
5080
5087
|
}
|
|
5081
5088
|
};
|
|
5082
5089
|
}
|
|
5083
|
-
const Gn = 0,
|
|
5090
|
+
const Gn = 0, jt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Vn = `${jt}0123456789`, Uc = jt.length, zc = Vn.length;
|
|
5084
5091
|
function qc(e) {
|
|
5085
|
-
let t =
|
|
5092
|
+
let t = jt[e[0]];
|
|
5086
5093
|
for (let i = 1; i < e.length; i++)
|
|
5087
5094
|
t += Vn[e[i]];
|
|
5088
5095
|
return t;
|
|
@@ -5099,9 +5106,9 @@ function Gc(e) {
|
|
|
5099
5106
|
e = new Array(e.length + 1).fill(Gn);
|
|
5100
5107
|
}
|
|
5101
5108
|
async function Vc(e, t, i, n) {
|
|
5102
|
-
const s = t.packageName, r = await
|
|
5109
|
+
const s = t.packageName, r = await _e(s), { hasCss: a, cdnName: c } = await Xn(u.join(r, "dist")) ?? {};
|
|
5103
5110
|
if (i === "cdn") {
|
|
5104
|
-
const m = await
|
|
5111
|
+
const m = await He(r), f = t.cdnUrl ?? Ge(m, !0);
|
|
5105
5112
|
return [
|
|
5106
5113
|
...a ? [
|
|
5107
5114
|
{
|
|
@@ -5143,14 +5150,14 @@ async function Vc(e, t, i, n) {
|
|
|
5143
5150
|
];
|
|
5144
5151
|
}
|
|
5145
5152
|
async function Xn(e) {
|
|
5146
|
-
const i = (await
|
|
5153
|
+
const i = (await Ue(e)).filter(
|
|
5147
5154
|
(s) => !_n.has(s) && !s.includes(".")
|
|
5148
5155
|
), n = i.find((s) => s.startsWith("arcgis-"));
|
|
5149
5156
|
return n === void 0 ? await Promise.all(
|
|
5150
|
-
i.map(async (s) => await
|
|
5151
|
-
).then((s) => s.find(j)) : await
|
|
5157
|
+
i.map(async (s) => await xi(e, s))
|
|
5158
|
+
).then((s) => s.find(j)) : await xi(e, n);
|
|
5152
5159
|
}
|
|
5153
|
-
async function
|
|
5160
|
+
async function xi(e, t) {
|
|
5154
5161
|
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), [s, r] = await Promise.all([U(i), U(n)]);
|
|
5155
5162
|
return s || r ? {
|
|
5156
5163
|
hasCss: s,
|
|
@@ -5158,18 +5165,18 @@ async function Ai(e, t) {
|
|
|
5158
5165
|
} : void 0;
|
|
5159
5166
|
}
|
|
5160
5167
|
async function Xc(e, t, i, n) {
|
|
5161
|
-
const s = t.packageName, r = await
|
|
5168
|
+
const s = t.packageName, r = await _e(s), a = await He(r), c = await Xn(u.join(r, "dist"));
|
|
5162
5169
|
if (i === "cdn") {
|
|
5163
|
-
const y = a.exports?.[`./${
|
|
5170
|
+
const y = a.exports?.[`./${we}.css`] === void 0, g = y ? c.cdnName : Hn;
|
|
5164
5171
|
return {
|
|
5165
5172
|
tag: "script",
|
|
5166
5173
|
attrs: {
|
|
5167
5174
|
type: "module",
|
|
5168
|
-
src: `${t.cdnUrl ??
|
|
5175
|
+
src: `${t.cdnUrl ?? Ge(a, !0)}${g}${y ? ".esm" : ""}.js`
|
|
5169
5176
|
}
|
|
5170
5177
|
};
|
|
5171
5178
|
}
|
|
5172
|
-
const l = c?.cdnName ??
|
|
5179
|
+
const l = c?.cdnName ?? Dt, d = Qc(a), p = `${s}/${u.normalize(d)}${Q}`, m = [
|
|
5173
5180
|
`import styles$${n} from "${p}";`,
|
|
5174
5181
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5175
5182
|
], f = `${s}/loader`;
|
|
@@ -5194,8 +5201,8 @@ function Qc(e) {
|
|
|
5194
5201
|
throw new Error(
|
|
5195
5202
|
`Package "${e.name}" does not have an "exports" field. All Lumina packages must include an "exports" field.`
|
|
5196
5203
|
);
|
|
5197
|
-
const i = Object.entries(t).filter(([s]) => u.extname(s) === ".css"), n = i.find(([, s]) => s === `./${
|
|
5198
|
-
return n ? n[0] : i.length > 0 ? i[0][0] : `./${
|
|
5204
|
+
const i = Object.entries(t).filter(([s]) => u.extname(s) === ".css"), n = i.find(([, s]) => s === `./${we}.css`);
|
|
5205
|
+
return n ? n[0] : i.length > 0 ? i[0][0] : `./${we}.css`;
|
|
5199
5206
|
}
|
|
5200
5207
|
async function Te(e) {
|
|
5201
5208
|
return e._loadersCache ??= Zc(e), await e._loadersCache;
|
|
@@ -5222,8 +5229,8 @@ async function Zc(e) {
|
|
|
5222
5229
|
],
|
|
5223
5230
|
javascriptCode: [
|
|
5224
5231
|
`import { defineCustomElements } from "${r}";`,
|
|
5225
|
-
"
|
|
5226
|
-
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ??
|
|
5232
|
+
"globalThis.devOnly$ownTagNames = new Set();",
|
|
5233
|
+
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? Dt}/"}` : ""});`
|
|
5227
5234
|
]
|
|
5228
5235
|
}
|
|
5229
5236
|
];
|
|
@@ -5235,7 +5242,7 @@ async function Qn(e) {
|
|
|
5235
5242
|
const n = typeof i == "string" ? i : i.name, s = await bn(n);
|
|
5236
5243
|
if (s === void 0)
|
|
5237
5244
|
throw Error(
|
|
5238
|
-
|
|
5245
|
+
w(
|
|
5239
5246
|
"@arcgis/lumina:computeServeOnlyDependencies",
|
|
5240
5247
|
`Unable to resolve extra dependency "${n}". Make sure it is a valid Stencil or Lumina package.`
|
|
5241
5248
|
)
|
|
@@ -5266,7 +5273,7 @@ async function Yc(e) {
|
|
|
5266
5273
|
].join(`
|
|
5267
5274
|
`);
|
|
5268
5275
|
throw Error(
|
|
5269
|
-
|
|
5276
|
+
w(
|
|
5270
5277
|
"@arcgis/lumina:buildTestSetupFile",
|
|
5271
5278
|
`Unexpected loader type for the browser test environment: ${JSON.stringify(n)}`
|
|
5272
5279
|
)
|
|
@@ -5289,10 +5296,10 @@ function il(e) {
|
|
|
5289
5296
|
configResolved() {
|
|
5290
5297
|
a = u.join(e.dir.root, "src", "loader.ts"), c = Y(a);
|
|
5291
5298
|
},
|
|
5292
|
-
resolveId: (
|
|
5293
|
-
async load(
|
|
5294
|
-
const
|
|
5295
|
-
if (!(!
|
|
5299
|
+
resolveId: (g) => g === a || g === c ? a : void 0,
|
|
5300
|
+
async load(g) {
|
|
5301
|
+
const h = g.startsWith(Zn);
|
|
5302
|
+
if (!(!g.endsWith(".tsx") && g !== a && !h)) {
|
|
5296
5303
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5297
5304
|
r === void 0 && clearTimeout(n), r ??= ta(e, t).catch((S) => {
|
|
5298
5305
|
throw i = !0, S;
|
|
@@ -5300,39 +5307,39 @@ function il(e) {
|
|
|
5300
5307
|
const v = await r;
|
|
5301
5308
|
s ??= v;
|
|
5302
5309
|
}
|
|
5303
|
-
return
|
|
5310
|
+
return g === a ? Ho(e) : h ? await Yc(e) : void 0;
|
|
5304
5311
|
}
|
|
5305
5312
|
},
|
|
5306
5313
|
async writeBundle() {
|
|
5307
5314
|
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"), Uo);
|
|
5308
5315
|
},
|
|
5309
|
-
async handleHotUpdate({ file:
|
|
5310
|
-
const S = await p(
|
|
5311
|
-
return S === void 0 ? void 0 : S ?
|
|
5316
|
+
async handleHotUpdate({ file: g, modules: h, read: v }) {
|
|
5317
|
+
const S = await p(g, v);
|
|
5318
|
+
return S === void 0 ? void 0 : S ? h : (m(), []);
|
|
5312
5319
|
},
|
|
5313
5320
|
/**
|
|
5314
5321
|
* If a component was added, removed or renamed, regenerate the api.json and
|
|
5315
5322
|
* invalidate loader.js, forcing a page reload
|
|
5316
5323
|
*/
|
|
5317
|
-
configureServer(
|
|
5324
|
+
configureServer(g) {
|
|
5318
5325
|
if (e.isInPuppeteerTestBackEnd)
|
|
5319
5326
|
return;
|
|
5320
|
-
e.isInTest &&
|
|
5327
|
+
e.isInTest && g.watcher.on("change", (v) => {
|
|
5321
5328
|
p(v, async () => await J(v, "utf8")).catch(
|
|
5322
5329
|
(S) => C.warn(l, v, String(S))
|
|
5323
5330
|
);
|
|
5324
|
-
}),
|
|
5331
|
+
}), g.watcher.on("add", h), g.watcher.on("unlink", h), g.watcher.on(
|
|
5325
5332
|
"addDir",
|
|
5326
5333
|
(v) => v.startsWith(e.dir.srcComponents) ? void xt(e, e.dir.srcComponents, v).then(
|
|
5327
5334
|
(S) => S.length > 0 ? m() : void 0
|
|
5328
5335
|
) : void 0
|
|
5329
|
-
),
|
|
5336
|
+
), g.watcher.on("unlinkDir", (v) => {
|
|
5330
5337
|
e.componentFiles.some((E) => E.startsWith(v)) && m();
|
|
5331
5338
|
});
|
|
5332
|
-
function
|
|
5333
|
-
|
|
5339
|
+
function h(v) {
|
|
5340
|
+
he(v, e.dir.srcComponents) && m();
|
|
5334
5341
|
}
|
|
5335
|
-
|
|
5342
|
+
g.watcher.on("change", () => {
|
|
5336
5343
|
if (!i)
|
|
5337
5344
|
return;
|
|
5338
5345
|
i = !1, n = setTimeout(() => m(!0), 1e3);
|
|
@@ -5342,16 +5349,16 @@ function il(e) {
|
|
|
5342
5349
|
e.typeScriptWatchProgram?.close();
|
|
5343
5350
|
}
|
|
5344
5351
|
};
|
|
5345
|
-
async function p(
|
|
5352
|
+
async function p(g, h) {
|
|
5346
5353
|
if (s === void 0)
|
|
5347
5354
|
return !1;
|
|
5348
5355
|
let v;
|
|
5349
5356
|
if (e.isInStorybook) {
|
|
5350
|
-
v = await
|
|
5351
|
-
const
|
|
5352
|
-
if (
|
|
5357
|
+
v = await h();
|
|
5358
|
+
const x = e.typeScriptProgram.getSourceFile(g);
|
|
5359
|
+
if (x === void 0)
|
|
5353
5360
|
return;
|
|
5354
|
-
if (!(
|
|
5361
|
+
if (!(x.text === v)) {
|
|
5355
5362
|
let T;
|
|
5356
5363
|
await Promise.race([
|
|
5357
5364
|
e._typeScriptReload.promise,
|
|
@@ -5366,24 +5373,24 @@ function il(e) {
|
|
|
5366
5373
|
]), clearTimeout(T);
|
|
5367
5374
|
}
|
|
5368
5375
|
}
|
|
5369
|
-
if (!
|
|
5376
|
+
if (!he(g, e.dir.srcComponents))
|
|
5370
5377
|
return;
|
|
5371
|
-
v ??= await
|
|
5372
|
-
const E = ia(e,
|
|
5378
|
+
v ??= await h();
|
|
5379
|
+
const E = ia(e, g, v);
|
|
5373
5380
|
if (E === void 0)
|
|
5374
5381
|
return !1;
|
|
5375
|
-
for (const
|
|
5376
|
-
const I =
|
|
5382
|
+
for (const x of E) {
|
|
5383
|
+
const I = yn(x);
|
|
5377
5384
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: I });
|
|
5378
5385
|
}
|
|
5379
5386
|
return f(), !0;
|
|
5380
5387
|
}
|
|
5381
|
-
function m(
|
|
5382
|
-
!
|
|
5388
|
+
function m(g = !1) {
|
|
5389
|
+
!g && s === void 0 || (s = void 0, r = void 0, f(), y());
|
|
5383
5390
|
}
|
|
5384
5391
|
function f() {
|
|
5385
|
-
const
|
|
5386
|
-
|
|
5392
|
+
const g = e.server.moduleGraph.getModuleById(a);
|
|
5393
|
+
g === void 0 ? (C.warn(l, "Failed to find HMR module for src/loader.ts"), e.server.moduleGraph.invalidateAll()) : e.server.moduleGraph.invalidateModule(g);
|
|
5387
5394
|
}
|
|
5388
5395
|
const y = () => e.server.ws.send({
|
|
5389
5396
|
type: "full-reload",
|
|
@@ -5392,16 +5399,16 @@ function il(e) {
|
|
|
5392
5399
|
return d;
|
|
5393
5400
|
}
|
|
5394
5401
|
const St = "@arcgis/lumina:provideAssets";
|
|
5395
|
-
function fe(e, t, i =
|
|
5402
|
+
function fe(e, t, i = Rt) {
|
|
5396
5403
|
if (e.viteCommand !== "serve")
|
|
5397
|
-
throw Error(
|
|
5404
|
+
throw Error(w(St, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5398
5405
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5399
5406
|
if (t.forEach((r) => {
|
|
5400
5407
|
const a = es(r), c = is(e.dir, ts(a)), l = sl(e.viteConfig.base, c, e.dir.distCdn);
|
|
5401
5408
|
e.server.middlewares.use(l, (d, p, m) => {
|
|
5402
|
-
const f = rl(d.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source,
|
|
5409
|
+
const f = rl(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));
|
|
5403
5410
|
return (typeof y == "function" ? Promise.resolve(y()) : J(y)).then((v) => {
|
|
5404
|
-
const S = (typeof y == "function" ? void 0 :
|
|
5411
|
+
const S = (typeof y == "function" ? void 0 : h?.transform(v.toString("utf8"), g, e)) ?? v;
|
|
5405
5412
|
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Os.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
5406
5413
|
}).catch((v) => {
|
|
5407
5414
|
(a.type !== "directory" || process.env.DEBUG) && C.warn(
|
|
@@ -5415,22 +5422,22 @@ function fe(e, t, i = Mt) {
|
|
|
5415
5422
|
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
5416
5423
|
}
|
|
5417
5424
|
}
|
|
5418
|
-
async function Yn(e, t, i =
|
|
5425
|
+
async function Yn(e, t, i = Rt) {
|
|
5419
5426
|
await Promise.all(
|
|
5420
5427
|
t.map(async (n) => {
|
|
5421
5428
|
const s = es(n), r = is(e.dir, ts(s));
|
|
5422
5429
|
if (s.type === "directory") {
|
|
5423
|
-
const a = u.resolve(s.source), l = (await
|
|
5430
|
+
const a = u.resolve(s.source), l = (await Ue(a, { recursive: !0, withFileTypes: !0 })).filter((d) => d.isFile()).map((d) => {
|
|
5424
5431
|
const p = u.resolve(d.parentPath, d.name), m = u.relative(a, p), f = u.join(r, m);
|
|
5425
5432
|
return [p, f];
|
|
5426
5433
|
});
|
|
5427
5434
|
await ss(l.map(([d, p]) => p)), await Promise.all(
|
|
5428
5435
|
l.map(
|
|
5429
|
-
async ([d, p]) => await
|
|
5436
|
+
async ([d, p]) => await Ai(d, p, i, e)
|
|
5430
5437
|
)
|
|
5431
5438
|
);
|
|
5432
5439
|
} else if (s.type === "file")
|
|
5433
|
-
await z(u.dirname(r), { recursive: !0 }), await
|
|
5440
|
+
await z(u.dirname(r), { recursive: !0 }), await Ai(s.source, r, i, e);
|
|
5434
5441
|
else if (s.type === "dynamic") {
|
|
5435
5442
|
await z(u.dirname(r), { recursive: !0 });
|
|
5436
5443
|
const a = await Promise.resolve(s.source());
|
|
@@ -5439,15 +5446,15 @@ async function Yn(e, t, i = Mt) {
|
|
|
5439
5446
|
})
|
|
5440
5447
|
);
|
|
5441
5448
|
}
|
|
5442
|
-
const es =
|
|
5449
|
+
const es = Oi ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5443
5450
|
...e,
|
|
5444
|
-
destination:
|
|
5451
|
+
destination: Le(e.destination)
|
|
5445
5452
|
} : {
|
|
5446
5453
|
...e,
|
|
5447
|
-
source:
|
|
5448
|
-
destination:
|
|
5454
|
+
source: Le(e.source),
|
|
5455
|
+
destination: Le(e.destination)
|
|
5449
5456
|
};
|
|
5450
|
-
async function
|
|
5457
|
+
async function Ai(e, t, i, n) {
|
|
5451
5458
|
const s = i.find((r) => r.match(t, n));
|
|
5452
5459
|
if (s === void 0)
|
|
5453
5460
|
await xs(e, t);
|
|
@@ -5462,7 +5469,7 @@ function ts(e) {
|
|
|
5462
5469
|
if (e.source.endsWith(u.sep)) {
|
|
5463
5470
|
if (e.type === "file")
|
|
5464
5471
|
throw Error(
|
|
5465
|
-
|
|
5472
|
+
w(
|
|
5466
5473
|
St,
|
|
5467
5474
|
`Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${Y(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
|
|
5468
5475
|
)
|
|
@@ -5480,10 +5487,10 @@ function is({ dist: e, distCdnAssets: t }, i) {
|
|
|
5480
5487
|
}
|
|
5481
5488
|
function nl(e) {
|
|
5482
5489
|
if (e.startsWith(u.sep)) {
|
|
5483
|
-
const t =
|
|
5490
|
+
const t = Ji(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5484
5491
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5485
5492
|
} else
|
|
5486
|
-
return !!(!
|
|
5493
|
+
return !!(!Oi && u.isAbsolute(e));
|
|
5487
5494
|
}
|
|
5488
5495
|
function sl(e, t, i) {
|
|
5489
5496
|
const n = ns(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
@@ -5497,12 +5504,12 @@ async function ss(e) {
|
|
|
5497
5504
|
const ol = {
|
|
5498
5505
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5499
5506
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5500
|
-
},
|
|
5507
|
+
}, Rt = [ol];
|
|
5501
5508
|
function al(e) {
|
|
5502
5509
|
let t;
|
|
5503
5510
|
const i = () => [
|
|
5504
5511
|
...e.options.assets?.transformers ?? [],
|
|
5505
|
-
...
|
|
5512
|
+
...Rt
|
|
5506
5513
|
];
|
|
5507
5514
|
return {
|
|
5508
5515
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
@@ -5545,7 +5552,7 @@ function ll(e) {
|
|
|
5545
5552
|
if (e.isInStorybook)
|
|
5546
5553
|
return;
|
|
5547
5554
|
const i = R()?.name ?? e.options.build?.cdn?.namespace ?? u.basename(e.dir.root), n = `${i}/hydrate`, s = u.resolve(e.dir.root, t.path ?? "hydrate"), r = "index.d.ts", a = "index.js", c = "index.mjs", l = u.join(s, "index.d.ts"), d = u.join(s, "index.js"), p = u.join(s, "index.mjs"), m = ee(s, e.dir.dist), y = `${Array.from(
|
|
5548
|
-
new Set(e.apiJsonComponents.map((
|
|
5555
|
+
new Set(e.apiJsonComponents.map((g) => `import "${m}/${g.importPath}";`))
|
|
5549
5556
|
).join(`
|
|
5550
5557
|
`)}
|
|
5551
5558
|
export * from "@arcgis/lumina/stencilSsrCompatibility";`;
|
|
@@ -5599,18 +5606,18 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5599
5606
|
}
|
|
5600
5607
|
const n = i.writeBundle;
|
|
5601
5608
|
if (typeof n != "function")
|
|
5602
|
-
throw Error(
|
|
5609
|
+
throw Error(w(dt, "Expected vite:reporter to declare a writeBundle() function"));
|
|
5603
5610
|
i.writeBundle = async function(r, a) {
|
|
5604
5611
|
let c = 0, l = 0, d = 0, p = 0;
|
|
5605
5612
|
const m = console.log;
|
|
5606
5613
|
console.log = function(...y) {
|
|
5607
5614
|
if (m.apply(console, y), y.length === 1 && typeof y[0] == "string") {
|
|
5608
|
-
const [
|
|
5609
|
-
if (!
|
|
5615
|
+
const [g, h] = y[0].match(ul) ?? [];
|
|
5616
|
+
if (!g)
|
|
5610
5617
|
return;
|
|
5611
|
-
p || (p = y[0].slice(0, y[0].indexOf(
|
|
5612
|
-
const v = Number.parseFloat(
|
|
5613
|
-
|
|
5618
|
+
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(ml, "").length);
|
|
5619
|
+
const v = Number.parseFloat(g.replace(" kB", "").replaceAll(",", ""));
|
|
5620
|
+
h ? (d += Number.parseFloat(h.replace(" kB", "").replaceAll(",", "")), l += v) : c += v;
|
|
5614
5621
|
}
|
|
5615
5622
|
};
|
|
5616
5623
|
try {
|
|
@@ -5619,27 +5626,27 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5619
5626
|
console.log = m;
|
|
5620
5627
|
}
|
|
5621
5628
|
if (l > 0) {
|
|
5622
|
-
const y = d > 0 ? l : c,
|
|
5629
|
+
const y = d > 0 ? l : c, g = Fi(y), h = e.dir.relativeDist;
|
|
5623
5630
|
console.log(
|
|
5624
5631
|
[
|
|
5625
|
-
|
|
5626
|
-
|
|
5632
|
+
Li,
|
|
5633
|
+
h,
|
|
5627
5634
|
pl,
|
|
5628
5635
|
"*",
|
|
5629
|
-
" ".repeat(p - `${
|
|
5630
|
-
|
|
5631
|
-
|
|
5632
|
-
d > 0 ? ` ${
|
|
5636
|
+
" ".repeat(p - `${h}*`.length - g.length),
|
|
5637
|
+
g,
|
|
5638
|
+
Ii,
|
|
5639
|
+
d > 0 ? ` ${Li}│ gzip: ${Fi(d)}${Ii}` : ""
|
|
5633
5640
|
].join("")
|
|
5634
5641
|
);
|
|
5635
5642
|
}
|
|
5636
5643
|
};
|
|
5637
5644
|
}
|
|
5638
|
-
}),
|
|
5645
|
+
}), Ii = "\x1B[22m\x1B[1m\x1B[22m", Li = "\x1B[2m", pl = "\x1B[22m\x1B[36m", ul = /\d+(?:,\d+)?\.\d{2} kB/gu, ml = /\x1B\[\d+m/gu, fl = new Intl.NumberFormat("en", {
|
|
5639
5646
|
maximumFractionDigits: 2,
|
|
5640
5647
|
minimumFractionDigits: 2
|
|
5641
|
-
}),
|
|
5642
|
-
name:
|
|
5648
|
+
}), Fi = (e) => `${fl.format(e)} kB`, Ni = "@arcgis/lumina:configureVite", yl = (e) => ({
|
|
5649
|
+
name: Ni,
|
|
5643
5650
|
async config({
|
|
5644
5651
|
server: t,
|
|
5645
5652
|
publicDir: i,
|
|
@@ -5656,7 +5663,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5656
5663
|
loader: "src/loader.ts",
|
|
5657
5664
|
// Entrypoint for bundling used components only:
|
|
5658
5665
|
...await Zr(e)
|
|
5659
|
-
}, { loader:
|
|
5666
|
+
}, { loader: g, ...h } = y, v = e.environment === "development" || e.isInTest ? {
|
|
5660
5667
|
"process.env.ESRI_INTERNAL": "true"
|
|
5661
5668
|
} : void 0, S = !import.meta.url.includes("node_modules"), E = {
|
|
5662
5669
|
/**
|
|
@@ -5670,7 +5677,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5670
5677
|
* Exclude src/loader.ts since it's a dynamically created file that
|
|
5671
5678
|
* is not visible to dep-optimizer's ESBuild instance.
|
|
5672
5679
|
*/
|
|
5673
|
-
entries: Object.values(
|
|
5680
|
+
entries: Object.values(h),
|
|
5674
5681
|
/**
|
|
5675
5682
|
* We dynamically insert imports during the JSX to lit-html transformation.
|
|
5676
5683
|
* In order to have dependency pre-bundling work correctly, we need to tell
|
|
@@ -5688,7 +5695,16 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5688
5695
|
* will be consider external and discovered by Vite based on "entries"
|
|
5689
5696
|
* above, so we don't need to include it here.
|
|
5690
5697
|
*/
|
|
5691
|
-
include:
|
|
5698
|
+
include: [
|
|
5699
|
+
// Used by Lumina's test setup file. Vitest scans setup files for
|
|
5700
|
+
// optimizedDeps but only if setup file is added by user, rather than by
|
|
5701
|
+
// a plugin (like our configureVite), and is statically present on disk,
|
|
5702
|
+
// rather than virtual like ours.
|
|
5703
|
+
...e.isInTest ? ["vitest-fail-on-console", "js-beautify"] : [],
|
|
5704
|
+
// Used by controllers. Need to add manually because @arcgis/lumina is
|
|
5705
|
+
// excluded per comment below, so Vite will discover these usages too late.
|
|
5706
|
+
...Ce ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
|
|
5707
|
+
],
|
|
5692
5708
|
/**
|
|
5693
5709
|
* Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
|
|
5694
5710
|
* runtime dependencies that are defined inside the monorepo, but are also
|
|
@@ -5706,13 +5722,29 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5706
5722
|
"@arcgis/embeddable-components",
|
|
5707
5723
|
"@arcgis/imagery-components",
|
|
5708
5724
|
"@arcgis/map-config-components",
|
|
5709
|
-
"@arcgis/portal-components"
|
|
5725
|
+
"@arcgis/portal-components",
|
|
5726
|
+
// By excluding Lumina, we also disable discovery of packages
|
|
5727
|
+
// used by it (Lit), which are then discovered at runtime and cause
|
|
5728
|
+
// dev-server reload. We could manually include all Lit packages,
|
|
5729
|
+
// but because Lit has so many entry points and barrel files,
|
|
5730
|
+
// pre-bundling Lit marginally increases the number of requests
|
|
5731
|
+
// rather than decrease them (620 vs 621)), defeating the point of
|
|
5732
|
+
// dependency optimization. Add to it that debugging is easier for
|
|
5733
|
+
// non-optimized dependencies, so we exclude it.
|
|
5734
|
+
// Even though lit/ is a barrel package, we still need to explicitly
|
|
5735
|
+
// exclude the sub-packages to prevent them from being optimized at
|
|
5736
|
+
// runtime.
|
|
5737
|
+
"lit",
|
|
5738
|
+
"lit-html",
|
|
5739
|
+
"lit-element",
|
|
5740
|
+
"@lit/reactive-element",
|
|
5741
|
+
"@lit/context"
|
|
5710
5742
|
] : void 0
|
|
5711
5743
|
};
|
|
5712
5744
|
if (typeof l.setupFiles == "string" ? l.setupFiles = [...lt, l.setupFiles] : Array.isArray(l.setupFiles) ? l.setupFiles = [...lt, ...l.setupFiles] : l.setupFiles = [...lt], e.isInPuppeteerTestBackEnd) {
|
|
5713
5745
|
if (p?.enabled === !0)
|
|
5714
5746
|
throw Error(
|
|
5715
|
-
|
|
5747
|
+
w(Ni, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5716
5748
|
);
|
|
5717
5749
|
return {
|
|
5718
5750
|
test: {
|
|
@@ -5746,7 +5778,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5746
5778
|
publicDir: i ?? !1,
|
|
5747
5779
|
build: {
|
|
5748
5780
|
cssMinify: n ?? (e.environment === "production" ? !0 : void 0),
|
|
5749
|
-
target: s ??
|
|
5781
|
+
target: s ?? Wn(e.typeScriptConfig),
|
|
5750
5782
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
5751
5783
|
lib: {
|
|
5752
5784
|
entry: y,
|
|
@@ -5775,27 +5807,27 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5775
5807
|
browser: {
|
|
5776
5808
|
enabled: e.isInPuppeteerTestFrontEnd ? !1 : p?.enabled ?? !0,
|
|
5777
5809
|
instances: p?.instances === void 0 ? [{ browser: "chromium" }] : void 0,
|
|
5778
|
-
provider: p?.provider ??
|
|
5810
|
+
provider: p?.provider ?? Bs
|
|
5779
5811
|
}
|
|
5780
5812
|
}
|
|
5781
5813
|
};
|
|
5782
5814
|
}
|
|
5783
|
-
}),
|
|
5815
|
+
}), gl = (e) => ({
|
|
5784
5816
|
name: "@arcgis/lumina:setAssetPath",
|
|
5785
5817
|
apply: () => e.viteCommand === "build",
|
|
5786
5818
|
config: (t) => ({
|
|
5787
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
5819
|
+
base: t.base ?? e.options.assets?.defaultPath ?? Ge()
|
|
5788
5820
|
})
|
|
5789
5821
|
});
|
|
5790
|
-
function
|
|
5822
|
+
function hl(e = R()) {
|
|
5791
5823
|
const t = e.version ?? "0.0.1";
|
|
5792
5824
|
return Es(t);
|
|
5793
5825
|
}
|
|
5794
|
-
const vl = (e) => `/*! ${e} */`,
|
|
5826
|
+
const vl = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
5795
5827
|
Object.defineProperty(t, i, {
|
|
5796
5828
|
get() {
|
|
5797
5829
|
throw Error(
|
|
5798
|
-
|
|
5830
|
+
w(
|
|
5799
5831
|
"@arcgis/lumina:context",
|
|
5800
5832
|
`Tried to access '${String(i)}' before it was set. You can't access this property in global scope. However, it will be accessible by the time the following Vite plugin hook is called: ${e}`
|
|
5801
5833
|
)
|
|
@@ -5816,12 +5848,12 @@ const vl = (e) => `/*! ${e} */`, A = (e) => (t, i) => {
|
|
|
5816
5848
|
function de(e) {
|
|
5817
5849
|
if (u.isAbsolute(e))
|
|
5818
5850
|
throw Error(
|
|
5819
|
-
|
|
5851
|
+
w(
|
|
5820
5852
|
"@arcgis/lumina:context",
|
|
5821
5853
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5822
5854
|
)
|
|
5823
5855
|
);
|
|
5824
|
-
return
|
|
5856
|
+
return Le(e);
|
|
5825
5857
|
}
|
|
5826
5858
|
const pe = {
|
|
5827
5859
|
vsCodeHtml: "docs/vscode.html-custom-data.json",
|
|
@@ -5837,7 +5869,7 @@ async function as(e, t, i, n, s = R()) {
|
|
|
5837
5869
|
if (process.env.CI) {
|
|
5838
5870
|
const d = (p) => Array.from(p, (m) => m.codePointAt(0).toString(16).padStart(4, "0")).join(",");
|
|
5839
5871
|
throw Error(
|
|
5840
|
-
|
|
5872
|
+
w(
|
|
5841
5873
|
"@arcgis/lumina:updateLuminaTs",
|
|
5842
5874
|
`lumina.ts is out of date. Start the vite dev server or build locally at least once to update lumina.ts and commit the updated file. Tried to write the following content:
|
|
5843
5875
|
|
|
@@ -5851,7 +5883,7 @@ Hex current content: ${d(l)}`
|
|
|
5851
5883
|
)
|
|
5852
5884
|
);
|
|
5853
5885
|
}
|
|
5854
|
-
return
|
|
5886
|
+
return Wi(a, r), !0;
|
|
5855
5887
|
}
|
|
5856
5888
|
function Sl(e, t, i, n = R()) {
|
|
5857
5889
|
"@arcgis/components-controllers" in (n.dependencies ?? {}) && C.warn(
|
|
@@ -5868,11 +5900,11 @@ declare module "@arcgis/lumina" {
|
|
|
5868
5900
|
interface ImportStencilElements extends ${r.map((m, f) => `JSX$${f}.IntrinsicElements`).join(", ")} {}
|
|
5869
5901
|
}`, l = n.devDependencies ?? {}, d = i === "preview" ? "matchers" : i === "webdriverio" ? "webdriverio" : "playwright";
|
|
5870
5902
|
return [
|
|
5871
|
-
|
|
5903
|
+
bl,
|
|
5872
5904
|
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5873
5905
|
n.name === "@arcgis/lumina" ? "" : `
|
|
5874
5906
|
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5875
|
-
t ?
|
|
5907
|
+
t ? wl : "",
|
|
5876
5908
|
l.vitest ? `
|
|
5877
5909
|
/// <reference types="vitest/config" />` : "",
|
|
5878
5910
|
l["@vitest/browser"] ? `
|
|
@@ -5886,7 +5918,7 @@ declare module "@arcgis/lumina" {
|
|
|
5886
5918
|
`
|
|
5887
5919
|
].join("");
|
|
5888
5920
|
}
|
|
5889
|
-
const
|
|
5921
|
+
const bl = `/**
|
|
5890
5922
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5891
5923
|
* Manual edits will be overwritten.
|
|
5892
5924
|
*
|
|
@@ -5894,8 +5926,8 @@ const wl = `/**
|
|
|
5894
5926
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5895
5927
|
*
|
|
5896
5928
|
* If you need to provide additional typings, create a separate file.
|
|
5897
|
-
*/`,
|
|
5898
|
-
/// <reference types="@arcgis/core/interfaces" />`,
|
|
5929
|
+
*/`, wl = `
|
|
5930
|
+
/// <reference types="@arcgis/core/interfaces" />`, je = "@arcgis/lumina:dependencySupport", cs = (e, t) => e.viteCommand === "serve" && /**
|
|
5899
5931
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5900
5932
|
* However, it is a bit buggy (see
|
|
5901
5933
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5907,10 +5939,10 @@ const wl = `/**
|
|
|
5907
5939
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5908
5940
|
*/
|
|
5909
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, Tl = (e) => ({
|
|
5910
|
-
name:
|
|
5942
|
+
name: je,
|
|
5911
5943
|
configResolved() {
|
|
5912
5944
|
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = El(e).catch(
|
|
5913
|
-
(t) => C.error(
|
|
5945
|
+
(t) => C.error(je, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
5914
5946
|
));
|
|
5915
5947
|
},
|
|
5916
5948
|
transformIndexHtml: {
|
|
@@ -5949,7 +5981,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5949
5981
|
return n.optimizableImports;
|
|
5950
5982
|
if ("cssHref" in n)
|
|
5951
5983
|
return [];
|
|
5952
|
-
throw Error(
|
|
5984
|
+
throw Error(w(je, `Unexpected loader type: ${JSON.stringify(n)}`));
|
|
5953
5985
|
});
|
|
5954
5986
|
e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
|
|
5955
5987
|
},
|
|
@@ -5962,13 +5994,13 @@ async function El(e) {
|
|
|
5962
5994
|
if (!await as(
|
|
5963
5995
|
i,
|
|
5964
5996
|
e.dir.src,
|
|
5965
|
-
|
|
5997
|
+
Ce,
|
|
5966
5998
|
e.viteConfig.test?.browser?.provider
|
|
5967
5999
|
))
|
|
5968
6000
|
return;
|
|
5969
6001
|
let s = !1;
|
|
5970
6002
|
function r() {
|
|
5971
|
-
s || C.warn(
|
|
6003
|
+
s || C.warn(je, Cl), s = !0;
|
|
5972
6004
|
}
|
|
5973
6005
|
process.on("exit", () => {
|
|
5974
6006
|
r(), clearTimeout(c);
|
|
@@ -5996,16 +6028,16 @@ async function $l(e, t) {
|
|
|
5996
6028
|
c === void 0 && (c = [], i.set(a, c));
|
|
5997
6029
|
const l = [];
|
|
5998
6030
|
for (const d of r.matchAll(xl)) {
|
|
5999
|
-
const p = d[1], m = Ll(p), f = r.indexOf("{", d.index), y = r.indexOf("}", f),
|
|
6000
|
-
let
|
|
6001
|
-
if (
|
|
6002
|
-
const E =
|
|
6003
|
-
|
|
6031
|
+
const p = d[1], m = Ll(p), f = r.indexOf("{", d.index), y = r.indexOf("}", f), g = r.slice(0, d.index).trimEnd();
|
|
6032
|
+
let h = "";
|
|
6033
|
+
if (g.endsWith("*/")) {
|
|
6034
|
+
const E = g.lastIndexOf("/**");
|
|
6035
|
+
h = g.slice(E + 3, -2).trim().replaceAll(Al, "");
|
|
6004
6036
|
}
|
|
6005
|
-
const v = r.slice(f, y).match(
|
|
6037
|
+
const v = r.slice(f, y).match(kl)?.[1] || m, S = Il(m);
|
|
6006
6038
|
l.push({
|
|
6007
|
-
description: `${v}${
|
|
6008
|
-
${
|
|
6039
|
+
description: `${v}${h ? `
|
|
6040
|
+
${h}` : ""}`,
|
|
6009
6041
|
url: `${t}?path=/story/${a}--${S}&singleStory=true`
|
|
6010
6042
|
});
|
|
6011
6043
|
}
|
|
@@ -6027,14 +6059,14 @@ ${g}` : ""}`,
|
|
|
6027
6059
|
}
|
|
6028
6060
|
return n;
|
|
6029
6061
|
}
|
|
6030
|
-
const Pl = /component: ["']([^"']+)["']/u, xl = /export const (\w+)/gu,
|
|
6031
|
-
var Fl = Object.defineProperty,
|
|
6062
|
+
const Pl = /component: ["']([^"']+)["']/u, xl = /export const (\w+)/gu, kl = /name: ["']([^"']+)["']/u, Al = /^\s*\*\s?/gmu, Il = (e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/giu, "-").replace(/-+/gu, "-").replace(/^-+/u, "").replace(/-+$/u, ""), Ll = (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();
|
|
6063
|
+
var Fl = Object.defineProperty, A = (e, t, i, n) => {
|
|
6032
6064
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
6033
6065
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
6034
6066
|
return s && Fl(t, i, s), s;
|
|
6035
6067
|
};
|
|
6036
6068
|
const ie = "@arcgis/lumina:context";
|
|
6037
|
-
class
|
|
6069
|
+
class P {
|
|
6038
6070
|
constructor(t) {
|
|
6039
6071
|
this.typeScriptProgram = void 0, this.typeScriptTypeChecker = void 0, this.typeScriptWatchProgram = void 0, this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._typeScriptReload = void 0, this._plugin = {
|
|
6040
6072
|
name: ie,
|
|
@@ -6047,7 +6079,7 @@ class x {
|
|
|
6047
6079
|
this.viteConfig = s;
|
|
6048
6080
|
const r = s.build.minify !== !1;
|
|
6049
6081
|
this.shouldMinify = r && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
6050
|
-
const a = u.join(s.root, u.sep), c = u.join(a, "src", u.sep), l = u.join(c, "components", u.sep), d = u.join(u.resolve(a, s.build.outDir), u.sep), p = u.join(u.relative(a, d), u.sep), m = u.join(d, "components", u.sep), f = u.join(d, this.options.build?.cdn?.namespace ??
|
|
6082
|
+
const a = u.join(s.root, u.sep), c = u.join(a, "src", u.sep), l = u.join(c, "components", u.sep), d = u.join(u.resolve(a, s.build.outDir), u.sep), p = u.join(u.relative(a, d), u.sep), m = u.join(d, "components", u.sep), f = u.join(d, this.options.build?.cdn?.namespace ?? Dt, u.sep), y = u.join(f, "assets", u.sep);
|
|
6051
6083
|
if (this.dir = {
|
|
6052
6084
|
root: a,
|
|
6053
6085
|
src: c,
|
|
@@ -6057,9 +6089,9 @@ class x {
|
|
|
6057
6089
|
distComponents: m,
|
|
6058
6090
|
distCdn: f,
|
|
6059
6091
|
distCdnAssets: y
|
|
6060
|
-
}, C.initialize(s.logger, a), s.root !==
|
|
6092
|
+
}, C.initialize(s.logger, a), s.root !== Ji())
|
|
6061
6093
|
throw Error(
|
|
6062
|
-
|
|
6094
|
+
w(
|
|
6063
6095
|
ie,
|
|
6064
6096
|
"Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2126 or contact Lumina maintainers."
|
|
6065
6097
|
)
|
|
@@ -6071,9 +6103,9 @@ class x {
|
|
|
6071
6103
|
ie,
|
|
6072
6104
|
"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."
|
|
6073
6105
|
), 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);
|
|
6074
|
-
const
|
|
6075
|
-
this.isFullApiExtraction && typeof
|
|
6076
|
-
this.componentStories =
|
|
6106
|
+
const g = this.options.documentation?.publicStoryUrlPrefix;
|
|
6107
|
+
this.isFullApiExtraction && typeof g == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await $l(this.componentStoryFiles, g)).then((h) => {
|
|
6108
|
+
this.componentStories = h;
|
|
6077
6109
|
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0), Dc(this, s.build.sourcemap !== !1), cs(this) && Te(this);
|
|
6078
6110
|
}
|
|
6079
6111
|
},
|
|
@@ -6091,12 +6123,12 @@ class x {
|
|
|
6091
6123
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? de(i.jetBrains.webTypesFileName) : pe.webTypes,
|
|
6092
6124
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? de(i.vsCode.htmlFileName) : pe.vsCodeHtml,
|
|
6093
6125
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? de(i.vsCode.cssFileName) : pe.vsCodeCss
|
|
6094
|
-
},
|
|
6095
|
-
const n = t.build?.preamble ??
|
|
6126
|
+
}, vn(), this.componentFilesPromise = xt(this, u.resolve("src/components")), Nc(this);
|
|
6127
|
+
const n = t.build?.preamble ?? hl();
|
|
6096
6128
|
this.banner = vl(n);
|
|
6097
6129
|
}
|
|
6098
6130
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
6099
|
-
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(
|
|
6131
|
+
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;
|
|
6100
6132
|
const s = n?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
6101
6133
|
this.isInPuppeteerTestBackEnd = r && !s, this.isInPuppeteerTestFrontEnd = r && s, i === "production" ? this._silencedRules = this.options.linting?.silence : [this.normalizedDocumentationUrl, this.alternativeDocumentationUrl] = [
|
|
6102
6134
|
this.alternativeDocumentationUrl,
|
|
@@ -6115,7 +6147,7 @@ class x {
|
|
|
6115
6147
|
return n;
|
|
6116
6148
|
} else {
|
|
6117
6149
|
if (this.viteCommand === "build" || this.isInStorybook)
|
|
6118
|
-
throw Error(
|
|
6150
|
+
throw Error(w(ie, t, "Unable to find the TypeScript source file"));
|
|
6119
6151
|
{
|
|
6120
6152
|
const r = this._typeScriptSourceFiles.get(t);
|
|
6121
6153
|
r !== void 0 && r.text === i && (n = r);
|
|
@@ -6163,7 +6195,7 @@ class x {
|
|
|
6163
6195
|
n === "serve" && fe(this, t, i);
|
|
6164
6196
|
else
|
|
6165
6197
|
throw Error(
|
|
6166
|
-
|
|
6198
|
+
w(
|
|
6167
6199
|
ie,
|
|
6168
6200
|
"It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
|
|
6169
6201
|
)
|
|
@@ -6176,90 +6208,90 @@ class x {
|
|
|
6176
6208
|
this._silencedRules?.[t]?.includes(i.slice(this.dir.root.length)) !== !0 ? C.error("@arcgis/lumina:linting", n, i) : C.warn("@arcgis/lumina:linting", n, i);
|
|
6177
6209
|
}
|
|
6178
6210
|
}
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
],
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
],
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
],
|
|
6188
|
-
|
|
6189
|
-
|
|
6190
|
-
],
|
|
6191
|
-
|
|
6192
|
-
|
|
6193
|
-
],
|
|
6194
|
-
|
|
6195
|
-
|
|
6196
|
-
],
|
|
6197
|
-
|
|
6198
|
-
|
|
6199
|
-
],
|
|
6200
|
-
|
|
6201
|
-
|
|
6202
|
-
],
|
|
6203
|
-
|
|
6204
|
-
|
|
6205
|
-
],
|
|
6206
|
-
|
|
6207
|
-
|
|
6208
|
-
],
|
|
6209
|
-
|
|
6210
|
-
|
|
6211
|
-
],
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
],
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
],
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
],
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
],
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
],
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
],
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
],
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
],
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
],
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
],
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
],
|
|
6245
|
-
|
|
6246
|
-
|
|
6247
|
-
],
|
|
6248
|
-
|
|
6249
|
-
|
|
6250
|
-
],
|
|
6251
|
-
|
|
6252
|
-
|
|
6253
|
-
],
|
|
6211
|
+
A([
|
|
6212
|
+
k("buildStart() in build mode or load() serve mode")
|
|
6213
|
+
], P.prototype, "typeScriptHost");
|
|
6214
|
+
A([
|
|
6215
|
+
k("configResolved()")
|
|
6216
|
+
], P.prototype, "shouldMinify");
|
|
6217
|
+
A([
|
|
6218
|
+
k("configResolved()")
|
|
6219
|
+
], P.prototype, "shouldMinifyJsx");
|
|
6220
|
+
A([
|
|
6221
|
+
k("configResolved()")
|
|
6222
|
+
], P.prototype, "dir");
|
|
6223
|
+
A([
|
|
6224
|
+
k("load()")
|
|
6225
|
+
], P.prototype, "apiJson");
|
|
6226
|
+
A([
|
|
6227
|
+
k("load()")
|
|
6228
|
+
], P.prototype, "apiJsonComponents");
|
|
6229
|
+
A([
|
|
6230
|
+
k("load()")
|
|
6231
|
+
], P.prototype, "privateApiJson");
|
|
6232
|
+
A([
|
|
6233
|
+
k("load() when in build mode")
|
|
6234
|
+
], P.prototype, "_componentPathMapping");
|
|
6235
|
+
A([
|
|
6236
|
+
k("apply()")
|
|
6237
|
+
], P.prototype, "environment");
|
|
6238
|
+
A([
|
|
6239
|
+
k("apply()")
|
|
6240
|
+
], P.prototype, "isInTest");
|
|
6241
|
+
A([
|
|
6242
|
+
k("apply()")
|
|
6243
|
+
], P.prototype, "isInPuppeteerTestBackEnd");
|
|
6244
|
+
A([
|
|
6245
|
+
k("apply()")
|
|
6246
|
+
], P.prototype, "isInPuppeteerTestFrontEnd");
|
|
6247
|
+
A([
|
|
6248
|
+
k("configResolved()")
|
|
6249
|
+
], P.prototype, "isInStorybook");
|
|
6250
|
+
A([
|
|
6251
|
+
k("configResolved()")
|
|
6252
|
+
], P.prototype, "hmrEnabled");
|
|
6253
|
+
A([
|
|
6254
|
+
k("apply()")
|
|
6255
|
+
], P.prototype, "viteCommand");
|
|
6256
|
+
A([
|
|
6257
|
+
k("configResolved()")
|
|
6258
|
+
], P.prototype, "isFullApiExtraction");
|
|
6259
|
+
A([
|
|
6260
|
+
k("configResolved()")
|
|
6261
|
+
], P.prototype, "viteConfig");
|
|
6262
|
+
A([
|
|
6263
|
+
k("configResolved()")
|
|
6264
|
+
], P.prototype, "server");
|
|
6265
|
+
A([
|
|
6266
|
+
k("load()")
|
|
6267
|
+
], P.prototype, "componentFiles");
|
|
6268
|
+
A([
|
|
6269
|
+
k("load()")
|
|
6270
|
+
], P.prototype, "componentStoryFiles");
|
|
6271
|
+
A([
|
|
6272
|
+
k("configResolved()")
|
|
6273
|
+
], P.prototype, "componentStoriesPromise");
|
|
6274
|
+
A([
|
|
6275
|
+
k("load()")
|
|
6276
|
+
], P.prototype, "componentStories");
|
|
6277
|
+
A([
|
|
6278
|
+
k("transform()")
|
|
6279
|
+
], P.prototype, "_globalHydratedCssString");
|
|
6280
|
+
A([
|
|
6281
|
+
k("configResolved()")
|
|
6282
|
+
], P.prototype, "_compilerOptionsForPrinter");
|
|
6283
|
+
A([
|
|
6284
|
+
k("configResolved()")
|
|
6285
|
+
], P.prototype, "_typeScriptPrinter");
|
|
6254
6286
|
const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
6255
6287
|
name: pt,
|
|
6256
6288
|
apply: () => e.viteCommand === "build",
|
|
6257
6289
|
generateBundle(t, i) {
|
|
6258
6290
|
Object.entries(i).forEach(([n, s]) => {
|
|
6259
|
-
const r =
|
|
6291
|
+
const r = ge(n, "components/", e);
|
|
6260
6292
|
if (r !== n && (s.fileName = r), s.type === "chunk") {
|
|
6261
6293
|
const a = u.dirname(u.join(e.dir.dist, n)), c = r === n ? a : u.dirname(u.join(e.dir.dist, r));
|
|
6262
|
-
s.code =
|
|
6294
|
+
s.code = Ui(s.code, e, c, a);
|
|
6263
6295
|
}
|
|
6264
6296
|
});
|
|
6265
6297
|
},
|
|
@@ -6267,7 +6299,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6267
6299
|
if (e.isInStorybook)
|
|
6268
6300
|
return;
|
|
6269
6301
|
const t = e._customElementDependencies, i = Object.entries(t), n = new Set(
|
|
6270
|
-
i.map(([r]) => r).filter((r) =>
|
|
6302
|
+
i.map(([r]) => r).filter((r) => he(r, e.dir.srcComponents))
|
|
6271
6303
|
);
|
|
6272
6304
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: l }]) => {
|
|
6273
6305
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
@@ -6278,7 +6310,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6278
6310
|
}), (a.length > 0 || c.length > 0) && d.length === 0) {
|
|
6279
6311
|
const p = Y(r);
|
|
6280
6312
|
throw Error(
|
|
6281
|
-
|
|
6313
|
+
w(
|
|
6282
6314
|
pt,
|
|
6283
6315
|
`Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...c].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.`
|
|
6284
6316
|
)
|
|
@@ -6288,73 +6320,73 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6288
6320
|
const s = i.flatMap(([r, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
|
|
6289
6321
|
if (!n.has(r))
|
|
6290
6322
|
return [];
|
|
6291
|
-
const l = u.dirname(r), d =
|
|
6292
|
-
function m(
|
|
6293
|
-
const T = pc(dc(e,
|
|
6323
|
+
const l = u.dirname(r), d = ge(l, e.dir.srcComponents, e), p = u.relative(e.dir.src, d);
|
|
6324
|
+
function m(b) {
|
|
6325
|
+
const T = pc(dc(e, b, r), p);
|
|
6294
6326
|
if (T !== `./${p}`)
|
|
6295
|
-
return T.startsWith(".") ? `${T}/${
|
|
6327
|
+
return T.startsWith(".") ? `${T}/${Di}` : T;
|
|
6296
6328
|
}
|
|
6297
|
-
const f = new Set(a), y = new Set(c),
|
|
6298
|
-
`, v =
|
|
6299
|
-
const T = m(
|
|
6329
|
+
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(), E = Array.from(y, (b) => {
|
|
6331
|
+
const T = m(b);
|
|
6300
6332
|
if (T !== void 0) {
|
|
6301
|
-
if (f.has(
|
|
6333
|
+
if (f.has(b)) {
|
|
6302
6334
|
C.warn(
|
|
6303
6335
|
pt,
|
|
6304
|
-
`"${
|
|
6336
|
+
`"${b}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
|
|
6305
6337
|
);
|
|
6306
6338
|
return;
|
|
6307
6339
|
}
|
|
6308
|
-
return S.add(
|
|
6340
|
+
return S.add(h(T)), `.set("${b}", () => import("${T}"))
|
|
6309
6341
|
`;
|
|
6310
6342
|
}
|
|
6311
|
-
}).filter(j),
|
|
6312
|
-
${
|
|
6313
|
-
deferredLoaders${E.join("")};` :
|
|
6343
|
+
}).filter(j), x = `${v}export * from "./${Tt}";`, I = Array.from(S).join("") + x, $ = E.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
6344
|
+
${x}
|
|
6345
|
+
deferredLoaders${E.join("")};` : x;
|
|
6314
6346
|
return [
|
|
6315
|
-
F(u.join(e.dir.dist, p,
|
|
6347
|
+
F(u.join(e.dir.dist, p, Di), $),
|
|
6316
6348
|
F(u.join(e.dir.dist, p, Dl), I)
|
|
6317
6349
|
];
|
|
6318
6350
|
});
|
|
6319
6351
|
await Promise.all(s);
|
|
6320
6352
|
}
|
|
6321
|
-
}),
|
|
6353
|
+
}), Di = "index.js", Dl = "index.d.ts", ls = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), ls(e, e[s].referencedBy, i, n))), jl = (e) => ({
|
|
6322
6354
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6323
6355
|
configureServer(t) {
|
|
6324
|
-
e.server = t, !e.isInPuppeteerTestBackEnd &&
|
|
6356
|
+
e.server = t, !e.isInPuppeteerTestBackEnd && ji(e).forEach(({ assets: i, transformers: n }) => fe(e, i, n));
|
|
6325
6357
|
},
|
|
6326
6358
|
async writeBundle() {
|
|
6327
6359
|
await Promise.all(
|
|
6328
|
-
|
|
6360
|
+
ji(e).map(
|
|
6329
6361
|
async ({ assets: t, transformers: i }) => await Yn(e, t, i)
|
|
6330
6362
|
)
|
|
6331
6363
|
);
|
|
6332
6364
|
}
|
|
6333
6365
|
});
|
|
6334
|
-
function
|
|
6366
|
+
function ji(e) {
|
|
6335
6367
|
const t = [], i = e.assetsToProvide?.filter((n) => n.apply === void 0 || n.apply === e.viteCommand) ?? [];
|
|
6336
6368
|
return e.options.assets?.extra?.forEach((n) => {
|
|
6337
6369
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
6338
6370
|
}), t.length > 0 && i.push({ assets: t }), e.assetsToProvide = void 0, i;
|
|
6339
6371
|
}
|
|
6340
|
-
const
|
|
6341
|
-
name:
|
|
6372
|
+
const bt = "@arcgis/lumina:updatePackageJson", Rl = (e) => ({
|
|
6373
|
+
name: bt,
|
|
6342
6374
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
6343
6375
|
configResolved() {
|
|
6344
6376
|
Ml(e).catch(
|
|
6345
|
-
(t) => C.error(
|
|
6377
|
+
(t) => C.error(bt, `Failed to update package's package.json:${String(t)}`)
|
|
6346
6378
|
);
|
|
6347
6379
|
}
|
|
6348
6380
|
});
|
|
6349
6381
|
async function Ml(e) {
|
|
6350
6382
|
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n = Ol(i, e);
|
|
6351
|
-
n &&
|
|
6383
|
+
n && Wi(t, JSON.stringify(n, null, 2));
|
|
6352
6384
|
}
|
|
6353
6385
|
function Ol(e, t) {
|
|
6354
6386
|
const i = e?.devDependencies ?? {};
|
|
6355
6387
|
Object.keys(e?.peerDependencies ?? {}).forEach((d) => {
|
|
6356
6388
|
d in i || C.warn(
|
|
6357
|
-
|
|
6389
|
+
bt,
|
|
6358
6390
|
`Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${d}" that is not a devDependency. Please edit your package.json`
|
|
6359
6391
|
);
|
|
6360
6392
|
});
|
|
@@ -6376,7 +6408,7 @@ function Ol(e, t) {
|
|
|
6376
6408
|
const d = s(r.webTypes);
|
|
6377
6409
|
e["web-types"] !== d && (n = !0, e["web-types"] = d);
|
|
6378
6410
|
}
|
|
6379
|
-
const a = `./${
|
|
6411
|
+
const a = `./${we}.css`, c = t.options.build?.cdn?.namespace !== void 0, l = ee(
|
|
6380
6412
|
t.dir.root,
|
|
6381
6413
|
u.join(t.dir.distCdn, a)
|
|
6382
6414
|
);
|
|
@@ -6399,10 +6431,10 @@ function Kl(e) {
|
|
|
6399
6431
|
const t = [];
|
|
6400
6432
|
for (const i of e.apiJson.modules)
|
|
6401
6433
|
for (const n of i.declarations)
|
|
6402
|
-
"customElement" in n && t.push(
|
|
6434
|
+
"customElement" in n && t.push(Bl(n, i.path));
|
|
6403
6435
|
return t;
|
|
6404
6436
|
}
|
|
6405
|
-
function
|
|
6437
|
+
function Bl(e, t) {
|
|
6406
6438
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6407
6439
|
return {
|
|
6408
6440
|
filePath: t,
|
|
@@ -6417,7 +6449,7 @@ function Wl(e, t) {
|
|
|
6417
6449
|
dependencies: [],
|
|
6418
6450
|
dependencyGraph: {},
|
|
6419
6451
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6420
|
-
props: e.members.map(
|
|
6452
|
+
props: e.members.map(Wl).filter(j),
|
|
6421
6453
|
methods: e.members.map(_l).filter(j),
|
|
6422
6454
|
events: e.events?.map(Hl) ?? [],
|
|
6423
6455
|
styles: e.cssProperties?.map((n) => ({
|
|
@@ -6431,7 +6463,7 @@ function Wl(e, t) {
|
|
|
6431
6463
|
listeners: []
|
|
6432
6464
|
};
|
|
6433
6465
|
}
|
|
6434
|
-
function
|
|
6466
|
+
function Wl(e) {
|
|
6435
6467
|
if (e.kind !== "field")
|
|
6436
6468
|
return;
|
|
6437
6469
|
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;
|
|
@@ -6441,7 +6473,7 @@ function Bl(e) {
|
|
|
6441
6473
|
complexType: t.type === void 0 ? void 0 : {
|
|
6442
6474
|
original: t.type.text,
|
|
6443
6475
|
resolved: t.type.text,
|
|
6444
|
-
references:
|
|
6476
|
+
references: Mt(t.type.references)
|
|
6445
6477
|
},
|
|
6446
6478
|
mutable: !0,
|
|
6447
6479
|
attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
|
|
@@ -6460,12 +6492,12 @@ function Bl(e) {
|
|
|
6460
6492
|
required: s
|
|
6461
6493
|
};
|
|
6462
6494
|
}
|
|
6463
|
-
const
|
|
6495
|
+
const Mt = (e) => Object.fromEntries(
|
|
6464
6496
|
e?.map(
|
|
6465
6497
|
(t) => [
|
|
6466
6498
|
t.name,
|
|
6467
6499
|
{
|
|
6468
|
-
location: t.package ===
|
|
6500
|
+
location: t.package === Ki ? "global" : t.package === void 0 ? "local" : "import",
|
|
6469
6501
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
6470
6502
|
id: "notImplemented"
|
|
6471
6503
|
}
|
|
@@ -6491,7 +6523,7 @@ function _l(e) {
|
|
|
6491
6523
|
signature: t.signature ?? "()=>unknown",
|
|
6492
6524
|
parameters: n,
|
|
6493
6525
|
return: t.return?.type?.text ?? "void",
|
|
6494
|
-
references:
|
|
6526
|
+
references: Mt([
|
|
6495
6527
|
...t.return?.type?.references ?? [],
|
|
6496
6528
|
...t.parameters?.flatMap((s) => s.type.references ?? []) ?? []
|
|
6497
6529
|
])
|
|
@@ -6512,7 +6544,7 @@ function Hl(e) {
|
|
|
6512
6544
|
complexType: {
|
|
6513
6545
|
original: e.type.text,
|
|
6514
6546
|
resolved: e.type.text,
|
|
6515
|
-
references:
|
|
6547
|
+
references: Mt(e.type.references)
|
|
6516
6548
|
},
|
|
6517
6549
|
cancelable: e.cancelable ?? !0,
|
|
6518
6550
|
composed: e.composed ?? !0,
|
|
@@ -6536,9 +6568,9 @@ const ds = (e) => e.flatMap(
|
|
|
6536
6568
|
description: Ze(t.description, t.deprecated) || void 0,
|
|
6537
6569
|
default: t.default,
|
|
6538
6570
|
value: {
|
|
6539
|
-
type: zl(t.type.values?.map(
|
|
6571
|
+
type: zl(t.type.values?.map(an))
|
|
6540
6572
|
}
|
|
6541
|
-
})) ?? [], zl = (e) => e?.length === 1 ? e[0] : e, Ze = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`,
|
|
6573
|
+
})) ?? [], zl = (e) => e?.length === 1 ? e[0] : e, Ze = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, $e = {
|
|
6542
6574
|
slots: "Slots",
|
|
6543
6575
|
events: "Events",
|
|
6544
6576
|
cssProperties: "CSS Properties",
|
|
@@ -6552,24 +6584,24 @@ function us(e) {
|
|
|
6552
6584
|
|
|
6553
6585
|
`);
|
|
6554
6586
|
}
|
|
6555
|
-
const
|
|
6587
|
+
const Pe = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6556
6588
|
${t.join(`
|
|
6557
|
-
`)}`, ql = (e) =>
|
|
6558
|
-
|
|
6589
|
+
`)}`, ql = (e) => Pe(
|
|
6590
|
+
$e.slots,
|
|
6559
6591
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6560
|
-
), Gl = (e) =>
|
|
6561
|
-
|
|
6592
|
+
), Gl = (e) => Pe(
|
|
6593
|
+
$e.events,
|
|
6562
6594
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6563
|
-
), Vl = (e = []) =>
|
|
6564
|
-
|
|
6595
|
+
), Vl = (e = []) => Pe(
|
|
6596
|
+
$e.cssProperties,
|
|
6565
6597
|
e?.map(
|
|
6566
6598
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6567
6599
|
)
|
|
6568
|
-
), Xl = (e) =>
|
|
6569
|
-
|
|
6600
|
+
), Xl = (e) => Pe(
|
|
6601
|
+
$e.cssParts,
|
|
6570
6602
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6571
|
-
), Ql = (e) =>
|
|
6572
|
-
|
|
6603
|
+
), Ql = (e) => Pe(
|
|
6604
|
+
$e.methods,
|
|
6573
6605
|
e.filter(Ss).map(
|
|
6574
6606
|
(t) => [`- \`${t.name}${t.signature}\``, Ze(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6575
6607
|
)
|
|
@@ -6602,16 +6634,16 @@ const Yl = (e) => e.map((t) => ({
|
|
|
6602
6634
|
name: i.name,
|
|
6603
6635
|
description: i.description
|
|
6604
6636
|
})),
|
|
6605
|
-
events:
|
|
6637
|
+
events: Ri(t),
|
|
6606
6638
|
js: {
|
|
6607
6639
|
properties: ed(t),
|
|
6608
|
-
events:
|
|
6640
|
+
events: Ri(t)
|
|
6609
6641
|
}
|
|
6610
|
-
})), ed = (e) => e.members.filter(
|
|
6642
|
+
})), ed = (e) => e.members.filter(bs).map((t) => ({
|
|
6611
6643
|
name: t.name,
|
|
6612
6644
|
description: t.description,
|
|
6613
6645
|
type: t.type?.text
|
|
6614
|
-
})) ?? [],
|
|
6646
|
+
})) ?? [], Ri = (e) => e.events?.map((t) => ({
|
|
6615
6647
|
name: t.name,
|
|
6616
6648
|
type: t.type?.text,
|
|
6617
6649
|
description: t.description
|
|
@@ -6688,7 +6720,7 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6688
6720
|
}
|
|
6689
6721
|
}`;
|
|
6690
6722
|
function ld({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6691
|
-
const [s, r] =
|
|
6723
|
+
const [s, r] = Qe(e, i);
|
|
6692
6724
|
return [
|
|
6693
6725
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6694
6726
|
`,
|
|
@@ -6722,7 +6754,7 @@ ${t}
|
|
|
6722
6754
|
}`;
|
|
6723
6755
|
}
|
|
6724
6756
|
function pd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6725
|
-
const [s, r] =
|
|
6757
|
+
const [s, r] = Qe(e, i);
|
|
6726
6758
|
return [
|
|
6727
6759
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6728
6760
|
`,
|
|
@@ -6767,7 +6799,7 @@ ${t}
|
|
|
6767
6799
|
}`;
|
|
6768
6800
|
}
|
|
6769
6801
|
function md({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6770
|
-
const [s, r] =
|
|
6802
|
+
const [s, r] = Qe(e, i);
|
|
6771
6803
|
return [
|
|
6772
6804
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6773
6805
|
`,
|
|
@@ -6801,7 +6833,7 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6801
6833
|
}
|
|
6802
6834
|
}`;
|
|
6803
6835
|
function yd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6804
|
-
const [s, r] =
|
|
6836
|
+
const [s, r] = Qe(e, i);
|
|
6805
6837
|
return [
|
|
6806
6838
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6807
6839
|
`,
|
|
@@ -6813,9 +6845,9 @@ function yd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6813
6845
|
r
|
|
6814
6846
|
].join("");
|
|
6815
6847
|
}
|
|
6816
|
-
const
|
|
6848
|
+
const gd = (e, t, i) => [i, t, hd(e), vd(e)].join(`
|
|
6817
6849
|
|
|
6818
|
-
`),
|
|
6850
|
+
`), hd = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6819
6851
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6820
6852
|
detail: T;
|
|
6821
6853
|
target: HTML${t}Element;
|
|
@@ -6854,7 +6886,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6854
6886
|
}`
|
|
6855
6887
|
].join("");
|
|
6856
6888
|
}
|
|
6857
|
-
function
|
|
6889
|
+
function bd(e) {
|
|
6858
6890
|
let t;
|
|
6859
6891
|
return {
|
|
6860
6892
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6866,7 +6898,7 @@ function wd(e) {
|
|
|
6866
6898
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6867
6899
|
e._declarationTextTransformers.push((n) => {
|
|
6868
6900
|
const { filePath: s, content: r } = n;
|
|
6869
|
-
return s === i ? { filePath: s, content:
|
|
6901
|
+
return s === i ? { filePath: s, content: gd(e.apiJsonComponents, r, t) } : n;
|
|
6870
6902
|
});
|
|
6871
6903
|
},
|
|
6872
6904
|
async writeBundle() {
|
|
@@ -6888,7 +6920,7 @@ ${a}`)
|
|
|
6888
6920
|
}
|
|
6889
6921
|
};
|
|
6890
6922
|
}
|
|
6891
|
-
function
|
|
6923
|
+
function wd(e) {
|
|
6892
6924
|
return {
|
|
6893
6925
|
name: "@arcgis/lumina:buildWrappers",
|
|
6894
6926
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
@@ -6901,10 +6933,10 @@ function bd(e) {
|
|
|
6901
6933
|
}
|
|
6902
6934
|
};
|
|
6903
6935
|
}
|
|
6904
|
-
const Td = "react",
|
|
6936
|
+
const Td = "react", Mi = "@lit/react", Ed = `
|
|
6905
6937
|
import React from "${Td}";
|
|
6906
|
-
import { createComponent } from "${
|
|
6907
|
-
import type { EventName } from "${
|
|
6938
|
+
import { createComponent } from "${Mi}";
|
|
6939
|
+
import type { EventName } from "${Mi}";
|
|
6908
6940
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
6909
6941
|
|
|
6910
6942
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
@@ -6934,14 +6966,14 @@ ${t}
|
|
|
6934
6966
|
`;
|
|
6935
6967
|
}
|
|
6936
6968
|
function Kd(e = {}) {
|
|
6937
|
-
const t = new
|
|
6969
|
+
const t = new P(e), i = [
|
|
6938
6970
|
t._plugin,
|
|
6939
6971
|
yl(t),
|
|
6940
|
-
|
|
6972
|
+
gl(t),
|
|
6941
6973
|
Rl(t),
|
|
6942
6974
|
Ir(t),
|
|
6943
6975
|
il(t),
|
|
6944
|
-
|
|
6976
|
+
bd(t),
|
|
6945
6977
|
ad(t),
|
|
6946
6978
|
Lc(t),
|
|
6947
6979
|
Io(t),
|
|
@@ -6954,27 +6986,27 @@ function Kd(e = {}) {
|
|
|
6954
6986
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
6955
6987
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6956
6988
|
ll(t),
|
|
6957
|
-
|
|
6989
|
+
wd(t),
|
|
6958
6990
|
dl(t)
|
|
6959
6991
|
].filter(j);
|
|
6960
6992
|
return i.context = t, i;
|
|
6961
6993
|
}
|
|
6962
|
-
const
|
|
6963
|
-
initializeComponentDependencies:
|
|
6994
|
+
const Bd = {
|
|
6995
|
+
initializeComponentDependencies: vn,
|
|
6964
6996
|
updateLuminaTs: as,
|
|
6965
|
-
propertyToAttributeMappings:
|
|
6966
|
-
findDeclaredComponents:
|
|
6967
|
-
nativeEvents:
|
|
6997
|
+
propertyToAttributeMappings: W,
|
|
6998
|
+
findDeclaredComponents: zi,
|
|
6999
|
+
nativeEvents: en,
|
|
6968
7000
|
svgElements: Ct,
|
|
6969
7001
|
mathMlElements: $t,
|
|
6970
|
-
alwaysAttributes:
|
|
6971
|
-
nativeAlwaysAttributes:
|
|
7002
|
+
alwaysAttributes: Qi,
|
|
7003
|
+
nativeAlwaysAttributes: Zi,
|
|
6972
7004
|
htmlAlwaysAttributes: yt,
|
|
6973
|
-
isPropertyEscapeNeeded:
|
|
7005
|
+
isPropertyEscapeNeeded: Xe
|
|
6974
7006
|
};
|
|
6975
7007
|
export {
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
7008
|
+
Je as LuminaApiExtractor,
|
|
7009
|
+
Bd as exportsForCodemod,
|
|
7010
|
+
Ge as inferCdnUrl,
|
|
6979
7011
|
Kd as useLumina
|
|
6980
7012
|
};
|