@arcgis/lumina-compiler 4.33.0-next.137 → 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 +603 -574
- 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
5
|
import { f as w, l as C } from "./logger-KpGU2b3R.js";
|
|
6
|
-
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as
|
|
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
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
|
|
9
|
-
import { lazyMetaSubItemJoiner as
|
|
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,8 +36,8 @@ function Ks(e) {
|
|
|
36
36
|
};
|
|
37
37
|
return r;
|
|
38
38
|
}
|
|
39
|
-
const Tt = "customElement.js",
|
|
40
|
-
function
|
|
39
|
+
const Tt = "customElement.js", _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) => {
|
|
@@ -64,10 +64,10 @@ function _s(e, t) {
|
|
|
64
64
|
}
|
|
65
65
|
const Hs = ({ filePath: e, content: t }, i) => {
|
|
66
66
|
const n = e.startsWith(i.dir.distComponents) ? ge(
|
|
67
|
-
|
|
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.") ? {
|
|
@@ -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,11 +300,11 @@ function yr(e) {
|
|
|
300
300
|
} else
|
|
301
301
|
return e;
|
|
302
302
|
}
|
|
303
|
-
const
|
|
303
|
+
const Xi = "_setterTypes";
|
|
304
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) => {
|
|
@@ -393,7 +393,7 @@ function br(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 br(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 br(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,8 +473,8 @@ function br(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
|
|
476
|
+
const Vt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
477
|
+
function Xt(e, t, i) {
|
|
478
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);
|
|
@@ -483,7 +483,7 @@ function Qt(e, t, i) {
|
|
|
483
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(w(
|
|
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;
|
|
@@ -1841,19 +1841,19 @@ function he(e, t) {
|
|
|
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
|
-
`),
|
|
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
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
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;
|
|
@@ -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) {
|
|
@@ -2083,32 +2083,32 @@ function So(e, t) {
|
|
|
2083
2083
|
};
|
|
2084
2084
|
}
|
|
2085
2085
|
function bo(e, t) {
|
|
2086
|
-
return he(e, t.srcComponents) ? u.join(t.dist,
|
|
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
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
|
|
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,7 +2137,7 @@ 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) {
|
|
@@ -2150,11 +2150,11 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
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,7 +2162,7 @@ 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) {
|
|
@@ -2200,11 +2200,11 @@ 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(
|
|
@@ -2228,7 +2228,7 @@ 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(
|
|
@@ -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,10 +2341,10 @@ 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
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) : ""];
|
|
@@ -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,
|
|
@@ -2462,14 +2462,14 @@ function re(e, 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 gs {
|
|
|
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 gs {
|
|
|
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);
|
|
@@ -2548,7 +2548,7 @@ class Oe extends gs {
|
|
|
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);
|
|
@@ -2674,36 +2674,40 @@ ${c}.componentOnReady().then(() => {
|
|
|
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
|
-
|
|
2677
|
+
Wt(t, i, this.file);
|
|
2678
2678
|
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((h) => h.name === "required") ?? !1;
|
|
2679
|
-
i.type =
|
|
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
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
2693
|
const b = i.description;
|
|
2690
|
-
ue(t.name, s, i,
|
|
2694
|
+
ue(t.name, s, i, $), $.docsTags.forEach((T) => {
|
|
2691
2695
|
c.add(T.name);
|
|
2692
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 b =
|
|
2701
|
-
l ||= b.modifiers?.some((T) => T.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1,
|
|
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((h) => h.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && (
|
|
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
|
-
),
|
|
2710
|
+
), Je.loggedBooleanWarning = !0) : i.default = "false"), this.pairedSetter !== void 0 && !i.readonly) {
|
|
2707
2711
|
const h = this.pairedSetter.parameters.at(0)?.type?.getText(this.file), v = t.type?.getText(this.file);
|
|
2708
2712
|
h !== v && v !== void 0 && h !== void 0 && (i.getterType = { text: v });
|
|
2709
2713
|
}
|
|
@@ -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
|
},
|
|
@@ -2837,15 +2841,15 @@ async function ta(e, t) {
|
|
|
2837
2841
|
t || (e.componentFilesPromise = xt(e, e.dir.srcComponents));
|
|
2838
2842
|
const i = await e.componentFilesPromise, n = await pa(e, i);
|
|
2839
2843
|
await e.componentStoriesPromise, e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2840
|
-
const s =
|
|
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
|
-
const n = e.getSourceFile(t, i), s =
|
|
2850
|
+
const n = e.getSourceFile(t, i), s = gn([n], e, !0), r = s.modules[0];
|
|
2847
2851
|
{
|
|
2848
|
-
const f =
|
|
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);
|
|
2849
2853
|
h.splice(y, 1, f), e.apiJson = { ...e.apiJson, modules: h }, e.apiJsonComponents = e.apiJsonComponents.filter(
|
|
2850
2854
|
(v) => !g.declarations.includes(v)
|
|
2851
2855
|
);
|
|
@@ -2867,11 +2871,11 @@ function ia(e, t, i) {
|
|
|
2867
2871
|
}
|
|
2868
2872
|
return d ||= m.length !== p.length, d ? void 0 : m;
|
|
2869
2873
|
}
|
|
2870
|
-
function
|
|
2871
|
-
const n = t.options.apiJson?.Extractor ??
|
|
2874
|
+
function gn(e, t, i) {
|
|
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);
|
|
@@ -2977,17 +2981,17 @@ function ra(e, t, i, n) {
|
|
|
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,7 +3004,7 @@ 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() {
|
|
@@ -3013,7 +3017,7 @@ function ua() {
|
|
|
3013
3017
|
);
|
|
3014
3018
|
return gt;
|
|
3015
3019
|
}
|
|
3016
|
-
function
|
|
3020
|
+
function Sn() {
|
|
3017
3021
|
if (ht === void 0)
|
|
3018
3022
|
throw Error(
|
|
3019
3023
|
w(
|
|
@@ -3025,7 +3029,7 @@ function bn() {
|
|
|
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
|
-
[...Object.keys(i), ...Object.keys(n)].filter((a) => !fa.has(a)).flatMap(async (a) => await
|
|
3032
|
+
[...Object.keys(i), ...Object.keys(n)].filter((a) => !fa.has(a)).flatMap(async (a) => await bn(a, e))
|
|
3029
3033
|
)).filter(j);
|
|
3030
3034
|
return gt ??= r, ht = Object.fromEntries(r.flatMap((a) => Object.entries(a.components))), r;
|
|
3031
3035
|
}
|
|
@@ -3066,27 +3070,27 @@ const fa = /* @__PURE__ */ new Set([
|
|
|
3066
3070
|
"vscode-languageserver-types"
|
|
3067
3071
|
]);
|
|
3068
3072
|
let gt, ht, ve;
|
|
3069
|
-
async function
|
|
3070
|
-
const i = await
|
|
3073
|
+
async function bn(e, t) {
|
|
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
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), g = JSON.parse(await J(y, "utf-8")), h = ga(g), v =
|
|
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
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
3095
|
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), h = ha(g, {
|
|
3092
3096
|
packageName: e,
|
|
@@ -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 ga = (e) => e.compiler?.name ===
|
|
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 ga = (e) => e.compiler?.name === At, ha = (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,
|
|
@@ -3169,7 +3173,7 @@ const ga = (e) => e.compiler?.name === At, ha = (e, t) => Object.fromEntries(
|
|
|
3169
3173
|
];
|
|
3170
3174
|
})
|
|
3171
3175
|
), ba = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, wa = (e) => e.startsWith("/") ? e : `/${e}`, It = (e, t) => `${e}@fs${wa(t)}`;
|
|
3172
|
-
function
|
|
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,16 +3282,16 @@ 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
|
-
), g = i === "value" && (n === "input" || n === "textarea" || n ===
|
|
3294
|
+
), g = i === "value" && (n === "input" || n === "textarea" || n === Re) ? Da(f, e) : f;
|
|
3291
3295
|
if (g !== p)
|
|
3292
3296
|
return [m ? `.${i}` : s.name, d, g];
|
|
3293
3297
|
}
|
|
@@ -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,16 +3410,16 @@ 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
|
);
|
|
3414
3418
|
if (o.isStringLiteral(t))
|
|
3415
|
-
return
|
|
3419
|
+
return gi(t, i);
|
|
3416
3420
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3417
3421
|
if (o.isStringLiteral(t.expression))
|
|
3418
|
-
return
|
|
3422
|
+
return gi(t.expression, i);
|
|
3419
3423
|
if (i) {
|
|
3420
3424
|
if (o.isNumericLiteral(t.expression))
|
|
3421
3425
|
return [`=${t.expression.text}`];
|
|
@@ -3425,13 +3429,13 @@ function Fe(e, t, i = !1) {
|
|
|
3425
3429
|
}
|
|
3426
3430
|
return ["=", ...Nt(e, t, void 0)];
|
|
3427
3431
|
}
|
|
3428
|
-
function
|
|
3432
|
+
function gi(e, t) {
|
|
3429
3433
|
if (!t)
|
|
3430
3434
|
return ["=", e];
|
|
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 hi(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,14 +3634,14 @@ 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];
|
|
@@ -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) => {
|
|
@@ -3786,49 +3790,49 @@ function Xe(e, t) {
|
|
|
3786
3790
|
}
|
|
3787
3791
|
m.docsTags?.some((y) => y.name === "required") ? i.push(p.name) : n.push(p.name);
|
|
3788
3792
|
});
|
|
3789
|
-
const r =
|
|
3793
|
+
const r = bi(i), a = bi(n), c = [
|
|
3790
3794
|
r ? `Required<Pick<${e}, ${r}>>` : "",
|
|
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
|
-
const
|
|
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;
|
|
@@ -3840,16 +3844,16 @@ function Dn(e, t) {
|
|
|
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
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]
|
|
@@ -3865,7 +3869,7 @@ Found ${I.getText(e.sourceFile)}`
|
|
|
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 h = typeof c == "string" && Fr.has(c), v =
|
|
3872
|
+
const h = typeof c == "string" && Fr.has(c), v = De(i, e);
|
|
3869
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)}`
|
|
@@ -3875,47 +3879,47 @@ Found ${I.getText(e.sourceFile)}`
|
|
|
3875
3879
|
typeof c == "string" ? c : r,
|
|
3876
3880
|
...g,
|
|
3877
3881
|
S ? `${g.length === 0 ? "" : " "}/>` : ">"
|
|
3878
|
-
],
|
|
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), {}), b
|
|
|
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), {}), b
|
|
|
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
|
-
},
|
|
4029
|
+
}, Rn = jn(
|
|
4026
4030
|
Object.entries(be).flatMap(([e, t]) => t.map((i) => [i, e]))
|
|
4027
|
-
),
|
|
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,7 +4052,7 @@ 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
4057
|
const d = (l.propertyName ?? l.name).text, p = be[d];
|
|
4054
4058
|
if (c) {
|
|
@@ -4067,7 +4071,7 @@ function rc(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,7 +4148,7 @@ 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(
|
|
@@ -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,7 +4241,7 @@ 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
|
-
|
|
4244
|
+
Xe(n) ? o.factory.createStringLiteral(n) : n,
|
|
4241
4245
|
gc(s, i)
|
|
4242
4246
|
)
|
|
4243
4247
|
)
|
|
@@ -4256,7 +4260,7 @@ function gc(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 gc(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,
|
|
@@ -4355,14 +4359,14 @@ function wc(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
|
}
|
|
@@ -4389,7 +4393,7 @@ function Tc(e, t, i, n) {
|
|
|
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
|
}
|
|
@@ -4522,14 +4526,14 @@ function $c(e, t, i, n, s) {
|
|
|
4522
4526
|
}
|
|
4523
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,13 +4572,13 @@ 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,createTrackingTarget,runTracked} from "${
|
|
4580
|
+
Ce ? `
|
|
4581
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${kc}/applications/Components/reactiveUtils.js";
|
|
4578
4582
|
createObservable,
|
|
4579
4583
|
runtime.t = trackAccess;
|
|
4580
4584
|
runtime.o = createObservable;
|
|
@@ -4588,8 +4592,8 @@ const Ic = [
|
|
|
4588
4592
|
uc,
|
|
4589
4593
|
Xs,
|
|
4590
4594
|
Ec
|
|
4591
|
-
],
|
|
4592
|
-
name:
|
|
4595
|
+
], $i = "@arcgis/lumina:transformComponents", Lc = (e) => ({
|
|
4596
|
+
name: $i,
|
|
4593
4597
|
transform: {
|
|
4594
4598
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4595
4599
|
order: "pre",
|
|
@@ -4597,18 +4601,18 @@ const Ic = [
|
|
|
4597
4601
|
if (!i.endsWith(".tsx")) {
|
|
4598
4602
|
if (e.isInTest && i.endsWith(".ts") && Et(i) && t.includes("extends LitElement"))
|
|
4599
4603
|
C.warn(
|
|
4600
|
-
|
|
4604
|
+
$i,
|
|
4601
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",
|
|
4602
4606
|
i
|
|
4603
4607
|
);
|
|
4604
4608
|
else if (i === `${e.dir.src}runtime.ts`)
|
|
4605
|
-
return
|
|
4609
|
+
return Ac(t, e);
|
|
4606
4610
|
return;
|
|
4607
4611
|
}
|
|
4608
4612
|
const n = e.getSourceFile(i, t);
|
|
4609
4613
|
await ve;
|
|
4610
4614
|
const r = o.transform(n, [
|
|
4611
|
-
(f) => () =>
|
|
4615
|
+
(f) => () => Gi(e, f, n, [
|
|
4612
4616
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4613
4617
|
...Ic
|
|
4614
4618
|
])
|
|
@@ -4687,7 +4691,7 @@ function Nc(e) {
|
|
|
4687
4691
|
}, r = o.parseJsonConfigFileContent(s, o.sys, u.dirname(i));
|
|
4688
4692
|
e.typeScriptConfig = r.options, e.typeScriptConfigPath = i;
|
|
4689
4693
|
}
|
|
4690
|
-
function
|
|
4694
|
+
function Wn(e) {
|
|
4691
4695
|
const t = e.target;
|
|
4692
4696
|
if (t === void 0)
|
|
4693
4697
|
throw Error(
|
|
@@ -4721,7 +4725,7 @@ function Dc(e, t) {
|
|
|
4721
4725
|
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Ts();
|
|
4722
4726
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4723
4727
|
}
|
|
4724
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = Fc(e), e._typeScriptPrinter =
|
|
4728
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = Fc(e), e._typeScriptPrinter = rn(e._compilerOptionsForPrinter);
|
|
4725
4729
|
}
|
|
4726
4730
|
async function jc(e, t, i) {
|
|
4727
4731
|
const n = u.resolve(e.dir.root, t);
|
|
@@ -4755,8 +4759,8 @@ async function jc(e, t, i) {
|
|
|
4755
4759
|
let E = h.indexOf("<style>");
|
|
4756
4760
|
if (E === -1 && (E = h.indexOf("</head>")), E === -1)
|
|
4757
4761
|
throw Error(w("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
|
|
4758
|
-
const
|
|
4759
|
-
await F(g,
|
|
4762
|
+
const x = h.slice(0, E) + S + h.slice(E);
|
|
4763
|
+
await F(g, x, "utf-8");
|
|
4760
4764
|
})
|
|
4761
4765
|
);
|
|
4762
4766
|
}
|
|
@@ -4773,7 +4777,7 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
4773
4777
|
"collection",
|
|
4774
4778
|
"extras",
|
|
4775
4779
|
"support"
|
|
4776
|
-
]), _ = "@arcgis/lumina:buildCdn",
|
|
4780
|
+
]), _ = "@arcgis/lumina:buildCdn", Dt = "cdn", Hn = "index", we = "main";
|
|
4777
4781
|
function Rc(e) {
|
|
4778
4782
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4779
4783
|
if (r) {
|
|
@@ -4800,10 +4804,10 @@ function Rc(e) {
|
|
|
4800
4804
|
async writeBundle() {
|
|
4801
4805
|
if (e.isInStorybook)
|
|
4802
4806
|
return;
|
|
4803
|
-
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);
|
|
4804
4808
|
await Oc(
|
|
4805
4809
|
p,
|
|
4806
|
-
e
|
|
4810
|
+
e,
|
|
4807
4811
|
r ? `${a}.esm` : a,
|
|
4808
4812
|
d,
|
|
4809
4813
|
c
|
|
@@ -4855,7 +4859,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4855
4859
|
chunkNames: "[hash]",
|
|
4856
4860
|
resolveExtensions: [".js", ".json"],
|
|
4857
4861
|
banner: { js: e.banner },
|
|
4858
|
-
target:
|
|
4862
|
+
target: Wn(e.typeScriptConfig),
|
|
4859
4863
|
...i,
|
|
4860
4864
|
plugins: [
|
|
4861
4865
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
@@ -4900,7 +4904,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4900
4904
|
* The script's file name will be stripped inside defineCustomElements.
|
|
4901
4905
|
**/
|
|
4902
4906
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
4903
|
-
${
|
|
4907
|
+
${fn(e._globalCssString, e)}`,
|
|
4904
4908
|
sourcefile: `${t}.esm.js`,
|
|
4905
4909
|
resolveDir: e.dir.dist,
|
|
4906
4910
|
loader: "js",
|
|
@@ -4909,30 +4913,30 @@ ${yn(e._globalCssString, e)}`,
|
|
|
4909
4913
|
});
|
|
4910
4914
|
}
|
|
4911
4915
|
async function Oc(e, t, i, n, s) {
|
|
4912
|
-
const r = `${i}.js`,
|
|
4913
|
-
e.outputFiles.map((
|
|
4914
|
-
const
|
|
4915
|
-
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,
|
|
4916
4920
|
isAsync: void 0,
|
|
4917
4921
|
oldSingleExportName: void 0
|
|
4918
|
-
},
|
|
4919
|
-
if (
|
|
4922
|
+
}, p = l.path.slice(r.length);
|
|
4923
|
+
if (p === "stdin.js") {
|
|
4920
4924
|
if (s) {
|
|
4921
|
-
const
|
|
4922
|
-
if (
|
|
4925
|
+
const f = l.text.match(Jc)?.[0];
|
|
4926
|
+
if (f === void 0)
|
|
4923
4927
|
throw Error(
|
|
4924
4928
|
"Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina"
|
|
4925
4929
|
);
|
|
4926
|
-
|
|
4930
|
+
d.code = `${d.code.trimEnd()}${Kc(f, n)}`, d.isAsync = !1;
|
|
4927
4931
|
}
|
|
4928
|
-
return [
|
|
4932
|
+
return [a, d];
|
|
4929
4933
|
}
|
|
4930
|
-
return [
|
|
4934
|
+
return [p, d];
|
|
4931
4935
|
})
|
|
4932
4936
|
);
|
|
4933
|
-
s &&
|
|
4934
|
-
|
|
4935
|
-
}), 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)));
|
|
4936
4940
|
}
|
|
4937
4941
|
const Jc = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
4938
4942
|
function Kc(e, t) {
|
|
@@ -4943,7 +4947,7 @@ function Kc(e, t) {
|
|
|
4943
4947
|
"("
|
|
4944
4948
|
].join("");
|
|
4945
4949
|
const n = t.length > 0;
|
|
4946
|
-
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) {
|
|
4947
4951
|
const s = [];
|
|
4948
4952
|
for (const r of t) {
|
|
4949
4953
|
if (r.in.includes("*")) {
|
|
@@ -4954,7 +4958,7 @@ function Kc(e, t) {
|
|
|
4954
4958
|
throw Error(w(_, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
|
|
4955
4959
|
s.push(r.out);
|
|
4956
4960
|
}
|
|
4957
|
-
i += `
|
|
4961
|
+
i += `"${s.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
|
|
4958
4962
|
}
|
|
4959
4963
|
if (i += [
|
|
4960
4964
|
"a.t=(c,...x)=>",
|
|
@@ -4979,7 +4983,7 @@ function Kc(e, t) {
|
|
|
4979
4983
|
function Un(e, t) {
|
|
4980
4984
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4981
4985
|
let c = 0;
|
|
4982
|
-
const l = e.code.matchAll(
|
|
4986
|
+
const l = e.code.matchAll(Bc);
|
|
4983
4987
|
for (const b of l) {
|
|
4984
4988
|
const [T, L, N, D, M] = b, H = M.startsWith(We);
|
|
4985
4989
|
if (c !== 0 && c !== b.index) {
|
|
@@ -4991,13 +4995,13 @@ function Un(e, t) {
|
|
|
4991
4995
|
else {
|
|
4992
4996
|
const K = zn(M, t), G = K?.isAsync === !0;
|
|
4993
4997
|
if (L !== void 0) {
|
|
4994
|
-
const
|
|
4998
|
+
const xe = [];
|
|
4995
4999
|
for (const Ye of L.slice(1, -1).split(",")) {
|
|
4996
|
-
const [
|
|
4997
|
-
G || r.add(
|
|
5000
|
+
const [Ot, Jt = Ot] = Ye.split(" as ");
|
|
5001
|
+
G || r.add(Jt), xe.push(`${Ot}:${Jt}`);
|
|
4998
5002
|
}
|
|
4999
5003
|
if (G) {
|
|
5000
|
-
const Ye = K.oldSingleExportName === void 0 ? `{${
|
|
5004
|
+
const Ye = K.oldSingleExportName === void 0 ? `{${xe.join(",")}}` : xe[0].split(":")[1];
|
|
5001
5005
|
a.push([b.index + 6, 0, L.length, Ye]);
|
|
5002
5006
|
}
|
|
5003
5007
|
} else if (N === void 0 && D === void 0)
|
|
@@ -5015,7 +5019,7 @@ function Un(e, t) {
|
|
|
5015
5019
|
}
|
|
5016
5020
|
}
|
|
5017
5021
|
if (e.isAsync = a.length > 0, !e.isAsync) {
|
|
5018
|
-
e.code =
|
|
5022
|
+
e.code = Pi(e.code, t);
|
|
5019
5023
|
return;
|
|
5020
5024
|
}
|
|
5021
5025
|
const d = Hc(r);
|
|
@@ -5029,7 +5033,7 @@ function Un(e, t) {
|
|
|
5029
5033
|
}
|
|
5030
5034
|
p = p.slice(0, T) + H + p.slice(T + M);
|
|
5031
5035
|
}
|
|
5032
|
-
const m =
|
|
5036
|
+
const m = Wc.exec(e.code), f = m?.index ?? e.code.length;
|
|
5033
5037
|
let y = "";
|
|
5034
5038
|
if (m !== null) {
|
|
5035
5039
|
const b = m[1].split(",");
|
|
@@ -5043,13 +5047,13 @@ function Un(e, t) {
|
|
|
5043
5047
|
e.oldSingleExportName = L, y = `return ${T}`;
|
|
5044
5048
|
}
|
|
5045
5049
|
}
|
|
5046
|
-
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(","),
|
|
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})`;
|
|
5047
5051
|
let I = e.code.slice(c, f);
|
|
5048
|
-
I = `${s.join("")}${I}`, I =
|
|
5049
|
-
const
|
|
5050
|
-
e.code =
|
|
5052
|
+
I = `${s.join("")}${I}`, I = Pi(I, t);
|
|
5053
|
+
const $ = `${p}${S}${I}${x}`;
|
|
5054
|
+
e.code = $;
|
|
5051
5055
|
}
|
|
5052
|
-
const
|
|
5056
|
+
const Bc = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, Wc = /export\{([^}]+)\};\n$/u, We = "@arcgis/core/";
|
|
5053
5057
|
function zn(e, t) {
|
|
5054
5058
|
if (!e.startsWith("./"))
|
|
5055
5059
|
return;
|
|
@@ -5060,7 +5064,7 @@ function zn(e, t) {
|
|
|
5060
5064
|
throw Error(w(_, `Failed to infer whether the ${e} module has top-level await`));
|
|
5061
5065
|
return n;
|
|
5062
5066
|
}
|
|
5063
|
-
function
|
|
5067
|
+
function Pi(e, t) {
|
|
5064
5068
|
return e.replaceAll(_c, (i, n) => {
|
|
5065
5069
|
if (n.startsWith(We))
|
|
5066
5070
|
return `$arcgis.t(m=>m[0],"${qn(n.slice(We.length))}")`;
|
|
@@ -5083,9 +5087,9 @@ function Hc(e) {
|
|
|
5083
5087
|
}
|
|
5084
5088
|
};
|
|
5085
5089
|
}
|
|
5086
|
-
const Gn = 0,
|
|
5090
|
+
const Gn = 0, jt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Vn = `${jt}0123456789`, Uc = jt.length, zc = Vn.length;
|
|
5087
5091
|
function qc(e) {
|
|
5088
|
-
let t =
|
|
5092
|
+
let t = jt[e[0]];
|
|
5089
5093
|
for (let i = 1; i < e.length; i++)
|
|
5090
5094
|
t += Vn[e[i]];
|
|
5091
5095
|
return t;
|
|
@@ -5102,9 +5106,9 @@ function Gc(e) {
|
|
|
5102
5106
|
e = new Array(e.length + 1).fill(Gn);
|
|
5103
5107
|
}
|
|
5104
5108
|
async function Vc(e, t, i, n) {
|
|
5105
|
-
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")) ?? {};
|
|
5106
5110
|
if (i === "cdn") {
|
|
5107
|
-
const m = await
|
|
5111
|
+
const m = await He(r), f = t.cdnUrl ?? Ge(m, !0);
|
|
5108
5112
|
return [
|
|
5109
5113
|
...a ? [
|
|
5110
5114
|
{
|
|
@@ -5146,14 +5150,14 @@ async function Vc(e, t, i, n) {
|
|
|
5146
5150
|
];
|
|
5147
5151
|
}
|
|
5148
5152
|
async function Xn(e) {
|
|
5149
|
-
const i = (await
|
|
5153
|
+
const i = (await Ue(e)).filter(
|
|
5150
5154
|
(s) => !_n.has(s) && !s.includes(".")
|
|
5151
5155
|
), n = i.find((s) => s.startsWith("arcgis-"));
|
|
5152
5156
|
return n === void 0 ? await Promise.all(
|
|
5153
|
-
i.map(async (s) => await
|
|
5154
|
-
).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);
|
|
5155
5159
|
}
|
|
5156
|
-
async function
|
|
5160
|
+
async function xi(e, t) {
|
|
5157
5161
|
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), [s, r] = await Promise.all([U(i), U(n)]);
|
|
5158
5162
|
return s || r ? {
|
|
5159
5163
|
hasCss: s,
|
|
@@ -5161,18 +5165,18 @@ async function Ai(e, t) {
|
|
|
5161
5165
|
} : void 0;
|
|
5162
5166
|
}
|
|
5163
5167
|
async function Xc(e, t, i, n) {
|
|
5164
|
-
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"));
|
|
5165
5169
|
if (i === "cdn") {
|
|
5166
5170
|
const y = a.exports?.[`./${we}.css`] === void 0, g = y ? c.cdnName : Hn;
|
|
5167
5171
|
return {
|
|
5168
5172
|
tag: "script",
|
|
5169
5173
|
attrs: {
|
|
5170
5174
|
type: "module",
|
|
5171
|
-
src: `${t.cdnUrl ??
|
|
5175
|
+
src: `${t.cdnUrl ?? Ge(a, !0)}${g}${y ? ".esm" : ""}.js`
|
|
5172
5176
|
}
|
|
5173
5177
|
};
|
|
5174
5178
|
}
|
|
5175
|
-
const l = c?.cdnName ??
|
|
5179
|
+
const l = c?.cdnName ?? Dt, d = Qc(a), p = `${s}/${u.normalize(d)}${Q}`, m = [
|
|
5176
5180
|
`import styles$${n} from "${p}";`,
|
|
5177
5181
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5178
5182
|
], f = `${s}/loader`;
|
|
@@ -5225,8 +5229,8 @@ async function Zc(e) {
|
|
|
5225
5229
|
],
|
|
5226
5230
|
javascriptCode: [
|
|
5227
5231
|
`import { defineCustomElements } from "${r}";`,
|
|
5228
|
-
"
|
|
5229
|
-
`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}/"}` : ""});`
|
|
5230
5234
|
]
|
|
5231
5235
|
}
|
|
5232
5236
|
];
|
|
@@ -5235,7 +5239,7 @@ async function Qn(e) {
|
|
|
5235
5239
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
5236
5240
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
5237
5241
|
t.map(async (i) => {
|
|
5238
|
-
const n = typeof i == "string" ? i : i.name, s = await
|
|
5242
|
+
const n = typeof i == "string" ? i : i.name, s = await bn(n);
|
|
5239
5243
|
if (s === void 0)
|
|
5240
5244
|
throw Error(
|
|
5241
5245
|
w(
|
|
@@ -5351,10 +5355,10 @@ function il(e) {
|
|
|
5351
5355
|
let v;
|
|
5352
5356
|
if (e.isInStorybook) {
|
|
5353
5357
|
v = await h();
|
|
5354
|
-
const
|
|
5355
|
-
if (
|
|
5358
|
+
const x = e.typeScriptProgram.getSourceFile(g);
|
|
5359
|
+
if (x === void 0)
|
|
5356
5360
|
return;
|
|
5357
|
-
if (!(
|
|
5361
|
+
if (!(x.text === v)) {
|
|
5358
5362
|
let T;
|
|
5359
5363
|
await Promise.race([
|
|
5360
5364
|
e._typeScriptReload.promise,
|
|
@@ -5375,8 +5379,8 @@ function il(e) {
|
|
|
5375
5379
|
const E = ia(e, g, v);
|
|
5376
5380
|
if (E === void 0)
|
|
5377
5381
|
return !1;
|
|
5378
|
-
for (const
|
|
5379
|
-
const I =
|
|
5382
|
+
for (const x of E) {
|
|
5383
|
+
const I = yn(x);
|
|
5380
5384
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: I });
|
|
5381
5385
|
}
|
|
5382
5386
|
return f(), !0;
|
|
@@ -5395,7 +5399,7 @@ function il(e) {
|
|
|
5395
5399
|
return d;
|
|
5396
5400
|
}
|
|
5397
5401
|
const St = "@arcgis/lumina:provideAssets";
|
|
5398
|
-
function fe(e, t, i =
|
|
5402
|
+
function fe(e, t, i = Rt) {
|
|
5399
5403
|
if (e.viteCommand !== "serve")
|
|
5400
5404
|
throw Error(w(St, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5401
5405
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
@@ -5418,22 +5422,22 @@ function fe(e, t, i = Mt) {
|
|
|
5418
5422
|
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
5419
5423
|
}
|
|
5420
5424
|
}
|
|
5421
|
-
async function Yn(e, t, i =
|
|
5425
|
+
async function Yn(e, t, i = Rt) {
|
|
5422
5426
|
await Promise.all(
|
|
5423
5427
|
t.map(async (n) => {
|
|
5424
5428
|
const s = es(n), r = is(e.dir, ts(s));
|
|
5425
5429
|
if (s.type === "directory") {
|
|
5426
|
-
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) => {
|
|
5427
5431
|
const p = u.resolve(d.parentPath, d.name), m = u.relative(a, p), f = u.join(r, m);
|
|
5428
5432
|
return [p, f];
|
|
5429
5433
|
});
|
|
5430
5434
|
await ss(l.map(([d, p]) => p)), await Promise.all(
|
|
5431
5435
|
l.map(
|
|
5432
|
-
async ([d, p]) => await
|
|
5436
|
+
async ([d, p]) => await Ai(d, p, i, e)
|
|
5433
5437
|
)
|
|
5434
5438
|
);
|
|
5435
5439
|
} else if (s.type === "file")
|
|
5436
|
-
await z(u.dirname(r), { recursive: !0 }), await
|
|
5440
|
+
await z(u.dirname(r), { recursive: !0 }), await Ai(s.source, r, i, e);
|
|
5437
5441
|
else if (s.type === "dynamic") {
|
|
5438
5442
|
await z(u.dirname(r), { recursive: !0 });
|
|
5439
5443
|
const a = await Promise.resolve(s.source());
|
|
@@ -5442,15 +5446,15 @@ async function Yn(e, t, i = Mt) {
|
|
|
5442
5446
|
})
|
|
5443
5447
|
);
|
|
5444
5448
|
}
|
|
5445
|
-
const es =
|
|
5449
|
+
const es = Oi ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5446
5450
|
...e,
|
|
5447
|
-
destination:
|
|
5451
|
+
destination: Le(e.destination)
|
|
5448
5452
|
} : {
|
|
5449
5453
|
...e,
|
|
5450
|
-
source:
|
|
5451
|
-
destination:
|
|
5454
|
+
source: Le(e.source),
|
|
5455
|
+
destination: Le(e.destination)
|
|
5452
5456
|
};
|
|
5453
|
-
async function
|
|
5457
|
+
async function Ai(e, t, i, n) {
|
|
5454
5458
|
const s = i.find((r) => r.match(t, n));
|
|
5455
5459
|
if (s === void 0)
|
|
5456
5460
|
await xs(e, t);
|
|
@@ -5483,10 +5487,10 @@ function is({ dist: e, distCdnAssets: t }, i) {
|
|
|
5483
5487
|
}
|
|
5484
5488
|
function nl(e) {
|
|
5485
5489
|
if (e.startsWith(u.sep)) {
|
|
5486
|
-
const t =
|
|
5490
|
+
const t = Ji(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5487
5491
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5488
5492
|
} else
|
|
5489
|
-
return !!(!
|
|
5493
|
+
return !!(!Oi && u.isAbsolute(e));
|
|
5490
5494
|
}
|
|
5491
5495
|
function sl(e, t, i) {
|
|
5492
5496
|
const n = ns(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
@@ -5500,12 +5504,12 @@ async function ss(e) {
|
|
|
5500
5504
|
const ol = {
|
|
5501
5505
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5502
5506
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5503
|
-
},
|
|
5507
|
+
}, Rt = [ol];
|
|
5504
5508
|
function al(e) {
|
|
5505
5509
|
let t;
|
|
5506
5510
|
const i = () => [
|
|
5507
5511
|
...e.options.assets?.transformers ?? [],
|
|
5508
|
-
...
|
|
5512
|
+
...Rt
|
|
5509
5513
|
];
|
|
5510
5514
|
return {
|
|
5511
5515
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
@@ -5622,27 +5626,27 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5622
5626
|
console.log = m;
|
|
5623
5627
|
}
|
|
5624
5628
|
if (l > 0) {
|
|
5625
|
-
const y = d > 0 ? l : c, g =
|
|
5629
|
+
const y = d > 0 ? l : c, g = Fi(y), h = e.dir.relativeDist;
|
|
5626
5630
|
console.log(
|
|
5627
5631
|
[
|
|
5628
|
-
|
|
5632
|
+
Li,
|
|
5629
5633
|
h,
|
|
5630
5634
|
pl,
|
|
5631
5635
|
"*",
|
|
5632
5636
|
" ".repeat(p - `${h}*`.length - g.length),
|
|
5633
5637
|
g,
|
|
5634
|
-
|
|
5635
|
-
d > 0 ? ` ${
|
|
5638
|
+
Ii,
|
|
5639
|
+
d > 0 ? ` ${Li}│ gzip: ${Fi(d)}${Ii}` : ""
|
|
5636
5640
|
].join("")
|
|
5637
5641
|
);
|
|
5638
5642
|
}
|
|
5639
5643
|
};
|
|
5640
5644
|
}
|
|
5641
|
-
}),
|
|
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", {
|
|
5642
5646
|
maximumFractionDigits: 2,
|
|
5643
5647
|
minimumFractionDigits: 2
|
|
5644
|
-
}),
|
|
5645
|
-
name:
|
|
5648
|
+
}), Fi = (e) => `${fl.format(e)} kB`, Ni = "@arcgis/lumina:configureVite", yl = (e) => ({
|
|
5649
|
+
name: Ni,
|
|
5646
5650
|
async config({
|
|
5647
5651
|
server: t,
|
|
5648
5652
|
publicDir: i,
|
|
@@ -5691,7 +5695,16 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5691
5695
|
* will be consider external and discovered by Vite based on "entries"
|
|
5692
5696
|
* above, so we don't need to include it here.
|
|
5693
5697
|
*/
|
|
5694
|
-
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
|
+
],
|
|
5695
5708
|
/**
|
|
5696
5709
|
* Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
|
|
5697
5710
|
* runtime dependencies that are defined inside the monorepo, but are also
|
|
@@ -5709,13 +5722,29 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5709
5722
|
"@arcgis/embeddable-components",
|
|
5710
5723
|
"@arcgis/imagery-components",
|
|
5711
5724
|
"@arcgis/map-config-components",
|
|
5712
|
-
"@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"
|
|
5713
5742
|
] : void 0
|
|
5714
5743
|
};
|
|
5715
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) {
|
|
5716
5745
|
if (p?.enabled === !0)
|
|
5717
5746
|
throw Error(
|
|
5718
|
-
w(
|
|
5747
|
+
w(Ni, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5719
5748
|
);
|
|
5720
5749
|
return {
|
|
5721
5750
|
test: {
|
|
@@ -5749,7 +5778,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5749
5778
|
publicDir: i ?? !1,
|
|
5750
5779
|
build: {
|
|
5751
5780
|
cssMinify: n ?? (e.environment === "production" ? !0 : void 0),
|
|
5752
|
-
target: s ??
|
|
5781
|
+
target: s ?? Wn(e.typeScriptConfig),
|
|
5753
5782
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
5754
5783
|
lib: {
|
|
5755
5784
|
entry: y,
|
|
@@ -5778,7 +5807,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5778
5807
|
browser: {
|
|
5779
5808
|
enabled: e.isInPuppeteerTestFrontEnd ? !1 : p?.enabled ?? !0,
|
|
5780
5809
|
instances: p?.instances === void 0 ? [{ browser: "chromium" }] : void 0,
|
|
5781
|
-
provider: p?.provider ??
|
|
5810
|
+
provider: p?.provider ?? Bs
|
|
5782
5811
|
}
|
|
5783
5812
|
}
|
|
5784
5813
|
};
|
|
@@ -5787,14 +5816,14 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5787
5816
|
name: "@arcgis/lumina:setAssetPath",
|
|
5788
5817
|
apply: () => e.viteCommand === "build",
|
|
5789
5818
|
config: (t) => ({
|
|
5790
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
5819
|
+
base: t.base ?? e.options.assets?.defaultPath ?? Ge()
|
|
5791
5820
|
})
|
|
5792
5821
|
});
|
|
5793
5822
|
function hl(e = R()) {
|
|
5794
5823
|
const t = e.version ?? "0.0.1";
|
|
5795
5824
|
return Es(t);
|
|
5796
5825
|
}
|
|
5797
|
-
const vl = (e) => `/*! ${e} */`,
|
|
5826
|
+
const vl = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
5798
5827
|
Object.defineProperty(t, i, {
|
|
5799
5828
|
get() {
|
|
5800
5829
|
throw Error(
|
|
@@ -5824,7 +5853,7 @@ function de(e) {
|
|
|
5824
5853
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5825
5854
|
)
|
|
5826
5855
|
);
|
|
5827
|
-
return
|
|
5856
|
+
return Le(e);
|
|
5828
5857
|
}
|
|
5829
5858
|
const pe = {
|
|
5830
5859
|
vsCodeHtml: "docs/vscode.html-custom-data.json",
|
|
@@ -5854,7 +5883,7 @@ Hex current content: ${d(l)}`
|
|
|
5854
5883
|
)
|
|
5855
5884
|
);
|
|
5856
5885
|
}
|
|
5857
|
-
return
|
|
5886
|
+
return Wi(a, r), !0;
|
|
5858
5887
|
}
|
|
5859
5888
|
function Sl(e, t, i, n = R()) {
|
|
5860
5889
|
"@arcgis/components-controllers" in (n.dependencies ?? {}) && C.warn(
|
|
@@ -5898,7 +5927,7 @@ const bl = `/**
|
|
|
5898
5927
|
*
|
|
5899
5928
|
* If you need to provide additional typings, create a separate file.
|
|
5900
5929
|
*/`, wl = `
|
|
5901
|
-
/// <reference types="@arcgis/core/interfaces" />`,
|
|
5930
|
+
/// <reference types="@arcgis/core/interfaces" />`, je = "@arcgis/lumina:dependencySupport", cs = (e, t) => e.viteCommand === "serve" && /**
|
|
5902
5931
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5903
5932
|
* However, it is a bit buggy (see
|
|
5904
5933
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5910,10 +5939,10 @@ const bl = `/**
|
|
|
5910
5939
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5911
5940
|
*/
|
|
5912
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) => ({
|
|
5913
|
-
name:
|
|
5942
|
+
name: je,
|
|
5914
5943
|
configResolved() {
|
|
5915
5944
|
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = El(e).catch(
|
|
5916
|
-
(t) => C.error(
|
|
5945
|
+
(t) => C.error(je, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
5917
5946
|
));
|
|
5918
5947
|
},
|
|
5919
5948
|
transformIndexHtml: {
|
|
@@ -5952,7 +5981,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5952
5981
|
return n.optimizableImports;
|
|
5953
5982
|
if ("cssHref" in n)
|
|
5954
5983
|
return [];
|
|
5955
|
-
throw Error(w(
|
|
5984
|
+
throw Error(w(je, `Unexpected loader type: ${JSON.stringify(n)}`));
|
|
5956
5985
|
});
|
|
5957
5986
|
e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
|
|
5958
5987
|
},
|
|
@@ -5965,13 +5994,13 @@ async function El(e) {
|
|
|
5965
5994
|
if (!await as(
|
|
5966
5995
|
i,
|
|
5967
5996
|
e.dir.src,
|
|
5968
|
-
|
|
5997
|
+
Ce,
|
|
5969
5998
|
e.viteConfig.test?.browser?.provider
|
|
5970
5999
|
))
|
|
5971
6000
|
return;
|
|
5972
6001
|
let s = !1;
|
|
5973
6002
|
function r() {
|
|
5974
|
-
s || C.warn(
|
|
6003
|
+
s || C.warn(je, Cl), s = !0;
|
|
5975
6004
|
}
|
|
5976
6005
|
process.on("exit", () => {
|
|
5977
6006
|
r(), clearTimeout(c);
|
|
@@ -6003,9 +6032,9 @@ async function $l(e, t) {
|
|
|
6003
6032
|
let h = "";
|
|
6004
6033
|
if (g.endsWith("*/")) {
|
|
6005
6034
|
const E = g.lastIndexOf("/**");
|
|
6006
|
-
h = g.slice(E + 3, -2).trim().replaceAll(
|
|
6035
|
+
h = g.slice(E + 3, -2).trim().replaceAll(Al, "");
|
|
6007
6036
|
}
|
|
6008
|
-
const v = r.slice(f, y).match(
|
|
6037
|
+
const v = r.slice(f, y).match(kl)?.[1] || m, S = Il(m);
|
|
6009
6038
|
l.push({
|
|
6010
6039
|
description: `${v}${h ? `
|
|
6011
6040
|
${h}` : ""}`,
|
|
@@ -6030,14 +6059,14 @@ ${h}` : ""}`,
|
|
|
6030
6059
|
}
|
|
6031
6060
|
return n;
|
|
6032
6061
|
}
|
|
6033
|
-
const Pl = /component: ["']([^"']+)["']/u, xl = /export const (\w+)/gu,
|
|
6034
|
-
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) => {
|
|
6035
6064
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
6036
6065
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
6037
6066
|
return s && Fl(t, i, s), s;
|
|
6038
6067
|
};
|
|
6039
6068
|
const ie = "@arcgis/lumina:context";
|
|
6040
|
-
class
|
|
6069
|
+
class P {
|
|
6041
6070
|
constructor(t) {
|
|
6042
6071
|
this.typeScriptProgram = void 0, this.typeScriptTypeChecker = void 0, this.typeScriptWatchProgram = void 0, this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._typeScriptReload = void 0, this._plugin = {
|
|
6043
6072
|
name: ie,
|
|
@@ -6050,7 +6079,7 @@ class x {
|
|
|
6050
6079
|
this.viteConfig = s;
|
|
6051
6080
|
const r = s.build.minify !== !1;
|
|
6052
6081
|
this.shouldMinify = r && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
6053
|
-
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);
|
|
6054
6083
|
if (this.dir = {
|
|
6055
6084
|
root: a,
|
|
6056
6085
|
src: c,
|
|
@@ -6060,7 +6089,7 @@ class x {
|
|
|
6060
6089
|
distComponents: m,
|
|
6061
6090
|
distCdn: f,
|
|
6062
6091
|
distCdnAssets: y
|
|
6063
|
-
}, C.initialize(s.logger, a), s.root !==
|
|
6092
|
+
}, C.initialize(s.logger, a), s.root !== Ji())
|
|
6064
6093
|
throw Error(
|
|
6065
6094
|
w(
|
|
6066
6095
|
ie,
|
|
@@ -6094,12 +6123,12 @@ class x {
|
|
|
6094
6123
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? de(i.jetBrains.webTypesFileName) : pe.webTypes,
|
|
6095
6124
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? de(i.vsCode.htmlFileName) : pe.vsCodeHtml,
|
|
6096
6125
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? de(i.vsCode.cssFileName) : pe.vsCodeCss
|
|
6097
|
-
},
|
|
6126
|
+
}, vn(), this.componentFilesPromise = xt(this, u.resolve("src/components")), Nc(this);
|
|
6098
6127
|
const n = t.build?.preamble ?? hl();
|
|
6099
6128
|
this.banner = vl(n);
|
|
6100
6129
|
}
|
|
6101
6130
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
6102
|
-
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (C.warn(
|
|
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;
|
|
6103
6132
|
const s = n?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
6104
6133
|
this.isInPuppeteerTestBackEnd = r && !s, this.isInPuppeteerTestFrontEnd = r && s, i === "production" ? this._silencedRules = this.options.linting?.silence : [this.normalizedDocumentationUrl, this.alternativeDocumentationUrl] = [
|
|
6105
6134
|
this.alternativeDocumentationUrl,
|
|
@@ -6179,81 +6208,81 @@ class x {
|
|
|
6179
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);
|
|
6180
6209
|
}
|
|
6181
6210
|
}
|
|
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
|
-
],
|
|
6254
|
-
|
|
6255
|
-
|
|
6256
|
-
],
|
|
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");
|
|
6257
6286
|
const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
6258
6287
|
name: pt,
|
|
6259
6288
|
apply: () => e.viteCommand === "build",
|
|
@@ -6262,7 +6291,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6262
6291
|
const r = ge(n, "components/", e);
|
|
6263
6292
|
if (r !== n && (s.fileName = r), s.type === "chunk") {
|
|
6264
6293
|
const a = u.dirname(u.join(e.dir.dist, n)), c = r === n ? a : u.dirname(u.join(e.dir.dist, r));
|
|
6265
|
-
s.code =
|
|
6294
|
+
s.code = Ui(s.code, e, c, a);
|
|
6266
6295
|
}
|
|
6267
6296
|
});
|
|
6268
6297
|
},
|
|
@@ -6295,7 +6324,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6295
6324
|
function m(b) {
|
|
6296
6325
|
const T = pc(dc(e, b, r), p);
|
|
6297
6326
|
if (T !== `./${p}`)
|
|
6298
|
-
return T.startsWith(".") ? `${T}/${
|
|
6327
|
+
return T.startsWith(".") ? `${T}/${Di}` : T;
|
|
6299
6328
|
}
|
|
6300
6329
|
const f = new Set(a), y = new Set(c), g = Array.from(f, m).filter(j), h = (b) => `import "${b}";
|
|
6301
6330
|
`, v = g.map(h).join(""), S = /* @__PURE__ */ new Set(), E = Array.from(y, (b) => {
|
|
@@ -6311,30 +6340,30 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6311
6340
|
return S.add(h(T)), `.set("${b}", () => import("${T}"))
|
|
6312
6341
|
`;
|
|
6313
6342
|
}
|
|
6314
|
-
}).filter(j),
|
|
6315
|
-
${
|
|
6316
|
-
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;
|
|
6317
6346
|
return [
|
|
6318
|
-
F(u.join(e.dir.dist, p,
|
|
6347
|
+
F(u.join(e.dir.dist, p, Di), $),
|
|
6319
6348
|
F(u.join(e.dir.dist, p, Dl), I)
|
|
6320
6349
|
];
|
|
6321
6350
|
});
|
|
6322
6351
|
await Promise.all(s);
|
|
6323
6352
|
}
|
|
6324
|
-
}),
|
|
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) => ({
|
|
6325
6354
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6326
6355
|
configureServer(t) {
|
|
6327
|
-
e.server = t, !e.isInPuppeteerTestBackEnd &&
|
|
6356
|
+
e.server = t, !e.isInPuppeteerTestBackEnd && ji(e).forEach(({ assets: i, transformers: n }) => fe(e, i, n));
|
|
6328
6357
|
},
|
|
6329
6358
|
async writeBundle() {
|
|
6330
6359
|
await Promise.all(
|
|
6331
|
-
|
|
6360
|
+
ji(e).map(
|
|
6332
6361
|
async ({ assets: t, transformers: i }) => await Yn(e, t, i)
|
|
6333
6362
|
)
|
|
6334
6363
|
);
|
|
6335
6364
|
}
|
|
6336
6365
|
});
|
|
6337
|
-
function
|
|
6366
|
+
function ji(e) {
|
|
6338
6367
|
const t = [], i = e.assetsToProvide?.filter((n) => n.apply === void 0 || n.apply === e.viteCommand) ?? [];
|
|
6339
6368
|
return e.options.assets?.extra?.forEach((n) => {
|
|
6340
6369
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
@@ -6351,7 +6380,7 @@ const bt = "@arcgis/lumina:updatePackageJson", Rl = (e) => ({
|
|
|
6351
6380
|
});
|
|
6352
6381
|
async function Ml(e) {
|
|
6353
6382
|
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n = Ol(i, e);
|
|
6354
|
-
n &&
|
|
6383
|
+
n && Wi(t, JSON.stringify(n, null, 2));
|
|
6355
6384
|
}
|
|
6356
6385
|
function Ol(e, t) {
|
|
6357
6386
|
const i = e?.devDependencies ?? {};
|
|
@@ -6402,10 +6431,10 @@ function Kl(e) {
|
|
|
6402
6431
|
const t = [];
|
|
6403
6432
|
for (const i of e.apiJson.modules)
|
|
6404
6433
|
for (const n of i.declarations)
|
|
6405
|
-
"customElement" in n && t.push(
|
|
6434
|
+
"customElement" in n && t.push(Bl(n, i.path));
|
|
6406
6435
|
return t;
|
|
6407
6436
|
}
|
|
6408
|
-
function
|
|
6437
|
+
function Bl(e, t) {
|
|
6409
6438
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6410
6439
|
return {
|
|
6411
6440
|
filePath: t,
|
|
@@ -6420,7 +6449,7 @@ function Wl(e, t) {
|
|
|
6420
6449
|
dependencies: [],
|
|
6421
6450
|
dependencyGraph: {},
|
|
6422
6451
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6423
|
-
props: e.members.map(
|
|
6452
|
+
props: e.members.map(Wl).filter(j),
|
|
6424
6453
|
methods: e.members.map(_l).filter(j),
|
|
6425
6454
|
events: e.events?.map(Hl) ?? [],
|
|
6426
6455
|
styles: e.cssProperties?.map((n) => ({
|
|
@@ -6434,7 +6463,7 @@ function Wl(e, t) {
|
|
|
6434
6463
|
listeners: []
|
|
6435
6464
|
};
|
|
6436
6465
|
}
|
|
6437
|
-
function
|
|
6466
|
+
function Wl(e) {
|
|
6438
6467
|
if (e.kind !== "field")
|
|
6439
6468
|
return;
|
|
6440
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;
|
|
@@ -6444,7 +6473,7 @@ function Bl(e) {
|
|
|
6444
6473
|
complexType: t.type === void 0 ? void 0 : {
|
|
6445
6474
|
original: t.type.text,
|
|
6446
6475
|
resolved: t.type.text,
|
|
6447
|
-
references:
|
|
6476
|
+
references: Mt(t.type.references)
|
|
6448
6477
|
},
|
|
6449
6478
|
mutable: !0,
|
|
6450
6479
|
attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
|
|
@@ -6463,12 +6492,12 @@ function Bl(e) {
|
|
|
6463
6492
|
required: s
|
|
6464
6493
|
};
|
|
6465
6494
|
}
|
|
6466
|
-
const
|
|
6495
|
+
const Mt = (e) => Object.fromEntries(
|
|
6467
6496
|
e?.map(
|
|
6468
6497
|
(t) => [
|
|
6469
6498
|
t.name,
|
|
6470
6499
|
{
|
|
6471
|
-
location: t.package ===
|
|
6500
|
+
location: t.package === Ki ? "global" : t.package === void 0 ? "local" : "import",
|
|
6472
6501
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
6473
6502
|
id: "notImplemented"
|
|
6474
6503
|
}
|
|
@@ -6494,7 +6523,7 @@ function _l(e) {
|
|
|
6494
6523
|
signature: t.signature ?? "()=>unknown",
|
|
6495
6524
|
parameters: n,
|
|
6496
6525
|
return: t.return?.type?.text ?? "void",
|
|
6497
|
-
references:
|
|
6526
|
+
references: Mt([
|
|
6498
6527
|
...t.return?.type?.references ?? [],
|
|
6499
6528
|
...t.parameters?.flatMap((s) => s.type.references ?? []) ?? []
|
|
6500
6529
|
])
|
|
@@ -6515,7 +6544,7 @@ function Hl(e) {
|
|
|
6515
6544
|
complexType: {
|
|
6516
6545
|
original: e.type.text,
|
|
6517
6546
|
resolved: e.type.text,
|
|
6518
|
-
references:
|
|
6547
|
+
references: Mt(e.type.references)
|
|
6519
6548
|
},
|
|
6520
6549
|
cancelable: e.cancelable ?? !0,
|
|
6521
6550
|
composed: e.composed ?? !0,
|
|
@@ -6539,9 +6568,9 @@ const ds = (e) => e.flatMap(
|
|
|
6539
6568
|
description: Ze(t.description, t.deprecated) || void 0,
|
|
6540
6569
|
default: t.default,
|
|
6541
6570
|
value: {
|
|
6542
|
-
type: zl(t.type.values?.map(
|
|
6571
|
+
type: zl(t.type.values?.map(an))
|
|
6543
6572
|
}
|
|
6544
|
-
})) ?? [], 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 = {
|
|
6545
6574
|
slots: "Slots",
|
|
6546
6575
|
events: "Events",
|
|
6547
6576
|
cssProperties: "CSS Properties",
|
|
@@ -6555,24 +6584,24 @@ function us(e) {
|
|
|
6555
6584
|
|
|
6556
6585
|
`);
|
|
6557
6586
|
}
|
|
6558
|
-
const
|
|
6587
|
+
const Pe = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6559
6588
|
${t.join(`
|
|
6560
|
-
`)}`, ql = (e) =>
|
|
6561
|
-
|
|
6589
|
+
`)}`, ql = (e) => Pe(
|
|
6590
|
+
$e.slots,
|
|
6562
6591
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6563
|
-
), Gl = (e) =>
|
|
6564
|
-
|
|
6592
|
+
), Gl = (e) => Pe(
|
|
6593
|
+
$e.events,
|
|
6565
6594
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6566
|
-
), Vl = (e = []) =>
|
|
6567
|
-
|
|
6595
|
+
), Vl = (e = []) => Pe(
|
|
6596
|
+
$e.cssProperties,
|
|
6568
6597
|
e?.map(
|
|
6569
6598
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6570
6599
|
)
|
|
6571
|
-
), Xl = (e) =>
|
|
6572
|
-
|
|
6600
|
+
), Xl = (e) => Pe(
|
|
6601
|
+
$e.cssParts,
|
|
6573
6602
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6574
|
-
), Ql = (e) =>
|
|
6575
|
-
|
|
6603
|
+
), Ql = (e) => Pe(
|
|
6604
|
+
$e.methods,
|
|
6576
6605
|
e.filter(Ss).map(
|
|
6577
6606
|
(t) => [`- \`${t.name}${t.signature}\``, Ze(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6578
6607
|
)
|
|
@@ -6605,16 +6634,16 @@ const Yl = (e) => e.map((t) => ({
|
|
|
6605
6634
|
name: i.name,
|
|
6606
6635
|
description: i.description
|
|
6607
6636
|
})),
|
|
6608
|
-
events:
|
|
6637
|
+
events: Ri(t),
|
|
6609
6638
|
js: {
|
|
6610
6639
|
properties: ed(t),
|
|
6611
|
-
events:
|
|
6640
|
+
events: Ri(t)
|
|
6612
6641
|
}
|
|
6613
6642
|
})), ed = (e) => e.members.filter(bs).map((t) => ({
|
|
6614
6643
|
name: t.name,
|
|
6615
6644
|
description: t.description,
|
|
6616
6645
|
type: t.type?.text
|
|
6617
|
-
})) ?? [],
|
|
6646
|
+
})) ?? [], Ri = (e) => e.events?.map((t) => ({
|
|
6618
6647
|
name: t.name,
|
|
6619
6648
|
type: t.type?.text,
|
|
6620
6649
|
description: t.description
|
|
@@ -6691,7 +6720,7 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6691
6720
|
}
|
|
6692
6721
|
}`;
|
|
6693
6722
|
function ld({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6694
|
-
const [s, r] =
|
|
6723
|
+
const [s, r] = Qe(e, i);
|
|
6695
6724
|
return [
|
|
6696
6725
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6697
6726
|
`,
|
|
@@ -6725,7 +6754,7 @@ ${t}
|
|
|
6725
6754
|
}`;
|
|
6726
6755
|
}
|
|
6727
6756
|
function pd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6728
|
-
const [s, r] =
|
|
6757
|
+
const [s, r] = Qe(e, i);
|
|
6729
6758
|
return [
|
|
6730
6759
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6731
6760
|
`,
|
|
@@ -6770,7 +6799,7 @@ ${t}
|
|
|
6770
6799
|
}`;
|
|
6771
6800
|
}
|
|
6772
6801
|
function md({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6773
|
-
const [s, r] =
|
|
6802
|
+
const [s, r] = Qe(e, i);
|
|
6774
6803
|
return [
|
|
6775
6804
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6776
6805
|
`,
|
|
@@ -6804,7 +6833,7 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6804
6833
|
}
|
|
6805
6834
|
}`;
|
|
6806
6835
|
function yd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6807
|
-
const [s, r] =
|
|
6836
|
+
const [s, r] = Qe(e, i);
|
|
6808
6837
|
return [
|
|
6809
6838
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6810
6839
|
`,
|
|
@@ -6904,10 +6933,10 @@ function wd(e) {
|
|
|
6904
6933
|
}
|
|
6905
6934
|
};
|
|
6906
6935
|
}
|
|
6907
|
-
const Td = "react",
|
|
6936
|
+
const Td = "react", Mi = "@lit/react", Ed = `
|
|
6908
6937
|
import React from "${Td}";
|
|
6909
|
-
import { createComponent } from "${
|
|
6910
|
-
import type { EventName } from "${
|
|
6938
|
+
import { createComponent } from "${Mi}";
|
|
6939
|
+
import type { EventName } from "${Mi}";
|
|
6911
6940
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
6912
6941
|
|
|
6913
6942
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
@@ -6937,7 +6966,7 @@ ${t}
|
|
|
6937
6966
|
`;
|
|
6938
6967
|
}
|
|
6939
6968
|
function Kd(e = {}) {
|
|
6940
|
-
const t = new
|
|
6969
|
+
const t = new P(e), i = [
|
|
6941
6970
|
t._plugin,
|
|
6942
6971
|
yl(t),
|
|
6943
6972
|
gl(t),
|
|
@@ -6962,22 +6991,22 @@ function Kd(e = {}) {
|
|
|
6962
6991
|
].filter(j);
|
|
6963
6992
|
return i.context = t, i;
|
|
6964
6993
|
}
|
|
6965
|
-
const
|
|
6966
|
-
initializeComponentDependencies:
|
|
6994
|
+
const Bd = {
|
|
6995
|
+
initializeComponentDependencies: vn,
|
|
6967
6996
|
updateLuminaTs: as,
|
|
6968
|
-
propertyToAttributeMappings:
|
|
6969
|
-
findDeclaredComponents:
|
|
6970
|
-
nativeEvents:
|
|
6997
|
+
propertyToAttributeMappings: W,
|
|
6998
|
+
findDeclaredComponents: zi,
|
|
6999
|
+
nativeEvents: en,
|
|
6971
7000
|
svgElements: Ct,
|
|
6972
7001
|
mathMlElements: $t,
|
|
6973
|
-
alwaysAttributes:
|
|
6974
|
-
nativeAlwaysAttributes:
|
|
7002
|
+
alwaysAttributes: Qi,
|
|
7003
|
+
nativeAlwaysAttributes: Zi,
|
|
6975
7004
|
htmlAlwaysAttributes: yt,
|
|
6976
|
-
isPropertyEscapeNeeded:
|
|
7005
|
+
isPropertyEscapeNeeded: Xe
|
|
6977
7006
|
};
|
|
6978
7007
|
export {
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
7008
|
+
Je as LuminaApiExtractor,
|
|
7009
|
+
Bd as exportsForCodemod,
|
|
7010
|
+
Ge as inferCdnUrl,
|
|
6982
7011
|
Kd as useLumina
|
|
6983
7012
|
};
|