@arcgis/lumina-compiler 4.33.0-next.67 → 4.33.0-next.68
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { nodeExternals as Vi } from "rollup-plugin-node-externals";
|
|
2
|
-
import { stringToStartsWithGlob as
|
|
2
|
+
import { stringToStartsWithGlob as It, path as u, toSystemPathSeparators as I, retrievePackageJson as D, getCwd as Pe, fetchPackageLocation as Re, asyncRetrievePackageJson as Me, existsAsync as W, findPath as Xi, toPosixPathSeparators as Ee, isPosix as Tn } from "@arcgis/components-build-utils";
|
|
3
3
|
import Qi from "vite-plugin-dts";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { getMemberName as _, globalPackageIdentifier as
|
|
6
|
-
import { isNotUndefined as N, mappedFind as X, camelToKebab as
|
|
5
|
+
import { getMemberName as _, globalPackageIdentifier as En, ApiExtractor as Yi, hasIgnoredModifier as Zi, setDefaultFromInitializer as kt, isApiMethod as es, isApiProperty as ts } from "@arcgis/api-extractor";
|
|
6
|
+
import { isNotUndefined as N, mappedFind as X, camelToKebab as pt, kebabToPascal as ns, uncapitalize as st, identity as Cn, Deferred as is, getPreamble as ss, capitalize as rs } from "@arcgis/components-utils";
|
|
7
7
|
import { readdir as Oe, readFile as M, writeFile as A, mkdir as Q, copyFile as os } from "node:fs/promises";
|
|
8
8
|
import { lazyMetaSubItemJoiner as as, lazyMetaItemJoiner as qe, lazyMetaGroupJoiner as cs, PropertyFlags as J } from "@arcgis/lumina/config";
|
|
9
9
|
import { build as ls } from "esbuild";
|
|
@@ -24,9 +24,9 @@ function us(e) {
|
|
|
24
24
|
// Externalize all @lit/ and @lit-labs/ packages
|
|
25
25
|
/^@lit[-/]/u,
|
|
26
26
|
/^lit$/u,
|
|
27
|
-
...Array.isArray(t) ? t.map(
|
|
27
|
+
...Array.isArray(t) ? t.map(It) : []
|
|
28
28
|
],
|
|
29
|
-
exclude: Array.isArray(n) ? n.map(
|
|
29
|
+
exclude: Array.isArray(n) ? n.map(It) : []
|
|
30
30
|
}),
|
|
31
31
|
configResolved() {
|
|
32
32
|
e.isInStorybook && (r.resolveId = void 0);
|
|
@@ -34,7 +34,7 @@ function us(e) {
|
|
|
34
34
|
};
|
|
35
35
|
return r;
|
|
36
36
|
}
|
|
37
|
-
const
|
|
37
|
+
const ut = "customElement.js", $n = "customElement.d.ts", ms = "playwright";
|
|
38
38
|
function fs(e, t, n) {
|
|
39
39
|
const s = n.split(u.sep).slice(2);
|
|
40
40
|
let r = t._componentPathMapping;
|
|
@@ -76,7 +76,7 @@ function Pn(e, t = ".d.ts") {
|
|
|
76
76
|
const i = (t === "" ? e : e.slice(0, -t.length)).split(u.sep);
|
|
77
77
|
return i.at(gs) !== i.at(vs) ? e : u.join(
|
|
78
78
|
i.slice(0, -1).join(u.sep),
|
|
79
|
-
t === "" ?
|
|
79
|
+
t === "" ? ut : $n
|
|
80
80
|
);
|
|
81
81
|
}
|
|
82
82
|
const gs = -1, vs = -2, Ss = /["']\.\.?\/[^'"]+/gu, In = (e, t, n, i) => e.replaceAll(Ss, (s) => {
|
|
@@ -96,7 +96,7 @@ function ws(e) {
|
|
|
96
96
|
return `/// <reference types="../../index.d.ts" />
|
|
97
97
|
${e}`;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const At = "customElement", bs = (e, t) => {
|
|
100
100
|
const { filePath: n, content: i } = e;
|
|
101
101
|
if (!n.startsWith(t.dir.distComponents))
|
|
102
102
|
return e;
|
|
@@ -115,7 +115,7 @@ const kt = "customElement", bs = (e, t) => {
|
|
|
115
115
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
116
116
|
"customElement" in r && n.push(
|
|
117
117
|
o.factory.createExpressionStatement(
|
|
118
|
-
o.factory.createCallExpression(o.factory.createIdentifier(
|
|
118
|
+
o.factory.createCallExpression(o.factory.createIdentifier(At), void 0, [
|
|
119
119
|
o.factory.createStringLiteral(r.tagName),
|
|
120
120
|
o.factory.createIdentifier(r.name)
|
|
121
121
|
])
|
|
@@ -133,7 +133,7 @@ const kt = "customElement", bs = (e, t) => {
|
|
|
133
133
|
!1,
|
|
134
134
|
void 0,
|
|
135
135
|
o.factory.createNamedImports([
|
|
136
|
-
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(
|
|
136
|
+
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(At))
|
|
137
137
|
])
|
|
138
138
|
),
|
|
139
139
|
o.factory.createStringLiteral(i)
|
|
@@ -175,11 +175,11 @@ const Es = (e) => (t, n) => (
|
|
|
175
175
|
)
|
|
176
176
|
), Cs = (e, t) => t.isInStorybook ? !1 : e, xs = (e, t) => (
|
|
177
177
|
// Short-circuit quickly if file doesn't look like the one we want to exclude
|
|
178
|
-
e.filePath.endsWith(
|
|
179
|
-
),
|
|
178
|
+
e.filePath.endsWith(Ft) && e.filePath === u.join(t.dir.dist, Ft) ? !1 : e
|
|
179
|
+
), Ft = "lumina.d.ts", $s = (e, t) => {
|
|
180
180
|
const n = t.dir.dist, i = `${n}src/`;
|
|
181
181
|
return e.filePath.startsWith(i) ? { ...e, filePath: `${n}${e.filePath.slice(i.length)}` } : !1;
|
|
182
|
-
},
|
|
182
|
+
}, mt = (e) => e.includes("__test") || e.includes(".e2e.") || e.includes(".spec.") || e.includes(".test."), Ps = (e) => mt(e.filePath) ? !1 : e, Is = (e) => e.content.includes("__esri.") ? {
|
|
183
183
|
filePath: e.filePath,
|
|
184
184
|
content: `/// <reference types="@arcgis/core/interfaces.d.ts" />
|
|
185
185
|
${e.content}`
|
|
@@ -237,7 +237,7 @@ const Ls = (e, t) => o.factory.updateSourceFile(
|
|
|
237
237
|
e.typeReferenceDirectives,
|
|
238
238
|
e.hasNoDefaultLib,
|
|
239
239
|
e.libReferenceDirectives
|
|
240
|
-
), Ns = (e) => `${
|
|
240
|
+
), Ns = (e) => `${Lt}${" ".repeat(e.length - Lt.length - Nt.length)}${Nt}`, Lt = "/*", Nt = "*/", js = (e) => e.statements.map(Os), Ds = "@arcgis/lumina", Rs = "LitElement", Ms = "PublicLitElement", Ln = "TargetedEvent";
|
|
241
241
|
function Os(e) {
|
|
242
242
|
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text === Ds && e.importClause?.namedBindings && o.isNamedImports(e.importClause.namedBindings)) {
|
|
243
243
|
const t = e.importClause.namedBindings.elements.findIndex(
|
|
@@ -340,9 +340,9 @@ function Hs(e, t, n) {
|
|
|
340
340
|
}
|
|
341
341
|
return Ws.get(e) || jn(e.charCodeAt(0));
|
|
342
342
|
}
|
|
343
|
-
const Us = (e) => e.replace(Bs, Hs),
|
|
343
|
+
const Us = (e) => e.replace(Bs, Hs), jt = /[^\u0000-\u007F]/g;
|
|
344
344
|
function zs(e) {
|
|
345
|
-
return e = Us(e),
|
|
345
|
+
return e = Us(e), jt.test(e) ? e.replace(jt, (t) => jn(t.charCodeAt(0))) : e;
|
|
346
346
|
}
|
|
347
347
|
const qs = zs, Gs = 0, Vs = 48, Xs = 57, Qs = /\$\{/gu, Ys = (e) => e.replace(Qs, "\\${");
|
|
348
348
|
function Zs(e) {
|
|
@@ -362,9 +362,9 @@ const Je = (e) => Ys(qs(e)), er = (e) => !tr.test(e), tr = /^[^\s"'=<>`]+$/u, nr
|
|
|
362
362
|
"&": "&",
|
|
363
363
|
"<": "<",
|
|
364
364
|
">": ">"
|
|
365
|
-
}, Dn = (e) => e.replace(nr, (t) => ir[t]),
|
|
366
|
-
function
|
|
367
|
-
const n =
|
|
365
|
+
}, Dn = (e) => e.replace(nr, (t) => ir[t]), ft = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
366
|
+
function yt(e, t) {
|
|
367
|
+
const n = ht(e);
|
|
368
368
|
return n.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
369
369
|
t,
|
|
370
370
|
n.map((i) => ({
|
|
@@ -375,9 +375,9 @@ function ft(e, t) {
|
|
|
375
375
|
}))
|
|
376
376
|
);
|
|
377
377
|
}
|
|
378
|
-
const
|
|
378
|
+
const ht = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
379
379
|
function sr(e) {
|
|
380
|
-
const t =
|
|
380
|
+
const t = ht(e);
|
|
381
381
|
if (t.length === 0)
|
|
382
382
|
return [e || " "];
|
|
383
383
|
const n = t.reduceRight(
|
|
@@ -449,7 +449,7 @@ function ar(e, t, n, i, s) {
|
|
|
449
449
|
if (a === void 0)
|
|
450
450
|
return t.events?.find((l) => l.name === r) === void 0 ? void 0 : o.factory.updatePropertyDeclaration(
|
|
451
451
|
e,
|
|
452
|
-
|
|
452
|
+
Mt(e.modifiers),
|
|
453
453
|
e.name,
|
|
454
454
|
void 0,
|
|
455
455
|
dr(e.type, s),
|
|
@@ -458,20 +458,20 @@ function ar(e, t, n, i, s) {
|
|
|
458
458
|
if (a.readonly === !0)
|
|
459
459
|
return o.factory.updatePropertyDeclaration(
|
|
460
460
|
e,
|
|
461
|
-
|
|
461
|
+
Mt(e.modifiers),
|
|
462
462
|
e.name,
|
|
463
463
|
void 0,
|
|
464
|
-
|
|
464
|
+
Rt(i, e.type, s),
|
|
465
465
|
e.initializer
|
|
466
466
|
);
|
|
467
467
|
if (a.getterType !== void 0) {
|
|
468
|
-
const c =
|
|
468
|
+
const c = Dt.exec(a.getterType.text)?.groups;
|
|
469
469
|
if (c === void 0)
|
|
470
470
|
return console.error(
|
|
471
|
-
`Expected bound accessor getter type to match ${
|
|
471
|
+
`Expected bound accessor getter type to match ${Dt}, but got ${a.getterType.text} in ${s.fileName}`
|
|
472
472
|
), e;
|
|
473
473
|
i.add(c.accessor);
|
|
474
|
-
const l =
|
|
474
|
+
const l = ft(e, { sourceFile: s }), d = e.modifiers?.filter(
|
|
475
475
|
(m) => m.kind !== o.SyntaxKind.AbstractKeyword && m.kind !== o.SyntaxKind.AccessorKeyword && m.kind !== o.SyntaxKind.DeclareKeyword
|
|
476
476
|
), p = e.type;
|
|
477
477
|
return p !== void 0 && n.push({
|
|
@@ -479,7 +479,7 @@ function ar(e, t, n, i, s) {
|
|
|
479
479
|
type: p,
|
|
480
480
|
isRequired: a.docsTags?.some((m) => m.name === "required") ?? !1
|
|
481
481
|
}), [
|
|
482
|
-
|
|
482
|
+
yt(
|
|
483
483
|
l,
|
|
484
484
|
o.factory.createGetAccessorDeclaration(
|
|
485
485
|
d,
|
|
@@ -506,7 +506,7 @@ function ar(e, t, n, i, s) {
|
|
|
506
506
|
)
|
|
507
507
|
];
|
|
508
508
|
} else
|
|
509
|
-
return
|
|
509
|
+
return Rt(i, e.type, s), e;
|
|
510
510
|
} else if (o.isGetAccessor(e) || o.isSetAccessor(e)) {
|
|
511
511
|
if (a === void 0)
|
|
512
512
|
return;
|
|
@@ -525,8 +525,8 @@ function ar(e, t, n, i, s) {
|
|
|
525
525
|
return a === void 0 ? void 0 : e;
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
const
|
|
529
|
-
function
|
|
528
|
+
const Dt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
529
|
+
function Rt(e, t, n) {
|
|
530
530
|
const s = (t?.pos !== -1 ? t?.getText(n) : void 0)?.match(cr) ?? [];
|
|
531
531
|
for (const r of s)
|
|
532
532
|
e.add(r);
|
|
@@ -577,7 +577,7 @@ function lr(e) {
|
|
|
577
577
|
}
|
|
578
578
|
return e;
|
|
579
579
|
}
|
|
580
|
-
function
|
|
580
|
+
function Mt(e) {
|
|
581
581
|
return e?.some((n) => n.kind === o.SyntaxKind.ReadonlyKeyword) ? e : [o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword), ...e ?? []];
|
|
582
582
|
}
|
|
583
583
|
function ge(e) {
|
|
@@ -733,7 +733,7 @@ function Sr(e) {
|
|
|
733
733
|
}
|
|
734
734
|
const wr = async (e) => Object.fromEntries(
|
|
735
735
|
(await e.componentFilesPromise).map((t) => [Mn(t), t])
|
|
736
|
-
), Mn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..",
|
|
736
|
+
), Mn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ut.slice(0, -3))), gt = async (e, t, n = t) => await Oe(n, { recursive: !0 }).catch((i) => {
|
|
737
737
|
if (String(i).includes("ENOENT"))
|
|
738
738
|
return console.error(`@arcgis/lumina: Unable to find the ${n} directory (cwd: ${process.cwd()})`), [];
|
|
739
739
|
throw i;
|
|
@@ -752,7 +752,7 @@ function le(e, t) {
|
|
|
752
752
|
const [n, i] = e.slice(0, -4).split(u.sep).slice(br);
|
|
753
753
|
return n === i;
|
|
754
754
|
}
|
|
755
|
-
const br = -2,
|
|
755
|
+
const br = -2, Ot = 5, Jt = 1, Kt = 1, Bt = 3, Wt = 4, Ke = o;
|
|
756
756
|
Tr(Ke.createSourceMapGenerator);
|
|
757
757
|
Er(Ke.createTextWriter);
|
|
758
758
|
Cr(Ke.getNewLineCharacter);
|
|
@@ -762,9 +762,9 @@ function Tr(e) {
|
|
|
762
762
|
throw new Error(
|
|
763
763
|
"Failed to find ts.createSourceMapGenerator() function. Lumina needs to be updated to support the new TypeScript version"
|
|
764
764
|
);
|
|
765
|
-
if (e.length !==
|
|
765
|
+
if (e.length !== Ot)
|
|
766
766
|
throw new Error(
|
|
767
|
-
`ts.createSourceMapGenerator() signature changed. Expected ${
|
|
767
|
+
`ts.createSourceMapGenerator() signature changed. Expected ${Ot} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
768
768
|
);
|
|
769
769
|
}
|
|
770
770
|
function Er(e) {
|
|
@@ -772,9 +772,9 @@ function Er(e) {
|
|
|
772
772
|
throw new Error(
|
|
773
773
|
"Failed to find ts.createTextWriter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
774
774
|
);
|
|
775
|
-
if (e.length !==
|
|
775
|
+
if (e.length !== Jt)
|
|
776
776
|
throw new Error(
|
|
777
|
-
`ts.createTextWriter() signature changed. Expected ${
|
|
777
|
+
`ts.createTextWriter() signature changed. Expected ${Jt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
778
778
|
);
|
|
779
779
|
}
|
|
780
780
|
function Cr(e) {
|
|
@@ -782,9 +782,9 @@ function Cr(e) {
|
|
|
782
782
|
throw new Error(
|
|
783
783
|
"Failed to find ts.getNewLineCharacter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
784
784
|
);
|
|
785
|
-
if (e.length !==
|
|
785
|
+
if (e.length !== Kt)
|
|
786
786
|
throw new Error(
|
|
787
|
-
`ts.getNewLineCharacter() signature changed. Expected ${
|
|
787
|
+
`ts.getNewLineCharacter() signature changed. Expected ${Kt} argument. Lumina needs to be updated to support the new TypeScript version`
|
|
788
788
|
);
|
|
789
789
|
}
|
|
790
790
|
function xr(e) {
|
|
@@ -792,9 +792,9 @@ function xr(e) {
|
|
|
792
792
|
throw new Error(
|
|
793
793
|
"Failed to find ts.Printer.writeFile() function. Lumina needs to be updated to support the new TypeScript version"
|
|
794
794
|
);
|
|
795
|
-
if (e.length !==
|
|
795
|
+
if (e.length !== Bt)
|
|
796
796
|
throw new Error(
|
|
797
|
-
`ts.Printer.writeFile() signature changed. Expected ${
|
|
797
|
+
`ts.Printer.writeFile() signature changed. Expected ${Bt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
798
798
|
);
|
|
799
799
|
}
|
|
800
800
|
function $r(e) {
|
|
@@ -802,17 +802,17 @@ function $r(e) {
|
|
|
802
802
|
throw new Error(
|
|
803
803
|
"Failed to find ts.Printer.writeNode() function. Lumina needs to be updated to support the new TypeScript version"
|
|
804
804
|
);
|
|
805
|
-
if (e.length !==
|
|
805
|
+
if (e.length !== Wt)
|
|
806
806
|
throw new Error(
|
|
807
|
-
`ts.Printer.writeNode() signature changed. Expected ${
|
|
807
|
+
`ts.Printer.writeNode() signature changed. Expected ${Wt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
808
808
|
);
|
|
809
809
|
}
|
|
810
810
|
function On(e) {
|
|
811
811
|
const t = re.createPrinter(e);
|
|
812
812
|
return xr(t.writeFile), $r(t.writeNode), t;
|
|
813
813
|
}
|
|
814
|
-
function
|
|
815
|
-
const t = o.isUnionTypeNode(e) ? e.types.map(
|
|
814
|
+
function _t(e) {
|
|
815
|
+
const t = o.isUnionTypeNode(e) ? e.types.map(Ht) : [Ht(e)], n = new Set(t), i = n.delete("true"), s = n.delete("false");
|
|
816
816
|
(i || s) && n.add("boolean");
|
|
817
817
|
let r = Array.from(n).sort();
|
|
818
818
|
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length > Pr))
|
|
@@ -852,8 +852,8 @@ function Lr(e, t) {
|
|
|
852
852
|
}
|
|
853
853
|
const Nr = /"[^"]+"|'[^"]+'|\w+/gu;
|
|
854
854
|
function Ie(e, t, n, i, s = !1) {
|
|
855
|
-
let { typeNode: r, references: a } =
|
|
856
|
-
c === void 0 && ({ typeNode: r, references: a } =
|
|
855
|
+
let { typeNode: r, references: a } = zt(e, t, n, i), c = _t(r);
|
|
856
|
+
c === void 0 && ({ typeNode: r, references: a } = zt(e, t, n, i, !1), c = _t(r) ?? []);
|
|
857
857
|
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d = Jn(l), p = kr(l), m = Lr(a, d);
|
|
858
858
|
return {
|
|
859
859
|
text: d,
|
|
@@ -861,7 +861,7 @@ function Ie(e, t, n, i, s = !1) {
|
|
|
861
861
|
values: p
|
|
862
862
|
};
|
|
863
863
|
}
|
|
864
|
-
function
|
|
864
|
+
function Ht(e) {
|
|
865
865
|
jr.writeNode(o.EmitHint.Unspecified, e, void 0, Ve);
|
|
866
866
|
const t = Ve.getText();
|
|
867
867
|
return Ve.clear(), t;
|
|
@@ -871,15 +871,15 @@ const jr = On({ removeComments: !0 }), Ve = re.createTextWriter(`
|
|
|
871
871
|
function Mr(e, t, n, i = !0) {
|
|
872
872
|
const s = /* @__PURE__ */ new Map();
|
|
873
873
|
G(t, s, n, i);
|
|
874
|
-
const r = t.flags & o.TypeFlags.Union ? t.types.every(
|
|
874
|
+
const r = t.flags & o.TypeFlags.Union ? t.types.every(Ut) : Ut(t), a = e.typeToTypeNode(
|
|
875
875
|
t,
|
|
876
876
|
void 0,
|
|
877
877
|
Rr & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
878
878
|
);
|
|
879
879
|
return s.forEach(Or), a === void 0 ? (console.error("Failed to convert type to type node."), o.factory.createTypeReferenceNode(o.factory.createIdentifier("unknown"), void 0)) : a;
|
|
880
880
|
}
|
|
881
|
-
const
|
|
882
|
-
function
|
|
881
|
+
const Ut = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
882
|
+
function zt(e, t, n, i, s = !0) {
|
|
883
883
|
const r = [], a = /* @__PURE__ */ new Set();
|
|
884
884
|
function c(d, p) {
|
|
885
885
|
const m = d.aliasSymbol ?? d.symbol;
|
|
@@ -960,7 +960,7 @@ function Jr(e, t, n, i) {
|
|
|
960
960
|
if (s.length === 0)
|
|
961
961
|
return {
|
|
962
962
|
name: t,
|
|
963
|
-
package:
|
|
963
|
+
package: En,
|
|
964
964
|
module: void 0
|
|
965
965
|
};
|
|
966
966
|
const { packageName: r, moduleName: a } = Kr(s[0].fileName, i);
|
|
@@ -968,7 +968,7 @@ function Jr(e, t, n, i) {
|
|
|
968
968
|
name: t,
|
|
969
969
|
package: r,
|
|
970
970
|
module: a.length > 0 ? a : void 0,
|
|
971
|
-
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ?
|
|
971
|
+
viewUrl: r === "@arcgis/core" && a === "interfaces.d.ts" ? qt(e, s[0], "core") : r === "typescript" ? qt(e, s[0], "typescript") : void 0
|
|
972
972
|
} : {
|
|
973
973
|
name: t,
|
|
974
974
|
package: void 0,
|
|
@@ -1000,24 +1000,24 @@ function Wn(e) {
|
|
|
1000
1000
|
return { packageName: s, moduleName: r };
|
|
1001
1001
|
}
|
|
1002
1002
|
const _r = (e) => e.includes("/node_modules/") || e.includes("/dist/");
|
|
1003
|
-
function
|
|
1003
|
+
function qt(e, t, n) {
|
|
1004
1004
|
const i = e.declarations;
|
|
1005
1005
|
if (i !== void 0)
|
|
1006
1006
|
for (const s of i) {
|
|
1007
|
-
const r =
|
|
1007
|
+
const r = Gt(s, t, n);
|
|
1008
1008
|
if (r !== void 0)
|
|
1009
1009
|
return r;
|
|
1010
1010
|
if (!("members" in s))
|
|
1011
1011
|
continue;
|
|
1012
1012
|
const a = s.members;
|
|
1013
1013
|
for (const c of a) {
|
|
1014
|
-
const l =
|
|
1014
|
+
const l = Gt(c, t, n);
|
|
1015
1015
|
if (l !== void 0)
|
|
1016
1016
|
return Hr(l);
|
|
1017
1017
|
}
|
|
1018
1018
|
}
|
|
1019
1019
|
}
|
|
1020
|
-
function
|
|
1020
|
+
function Gt(e, t, n) {
|
|
1021
1021
|
const i = e.jsDoc?.[0];
|
|
1022
1022
|
if (i !== void 0)
|
|
1023
1023
|
return X([i, ...i.tags ?? []], ({ comment: s }) => {
|
|
@@ -1046,8 +1046,8 @@ function Ur(e) {
|
|
|
1046
1046
|
}
|
|
1047
1047
|
return t.length === 0 ? void 0 : t;
|
|
1048
1048
|
}
|
|
1049
|
-
const zr = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, qr = /\n\s+\*? ?/gu, Gr = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], ke = new RegExp(`\\.(${Gr.join("|")})(\\?|$)`, "u"), Vr = /^import ["'](?<specifier>[^"']+)["'];$/gmu, Xr = () => "throwError",
|
|
1050
|
-
name:
|
|
1049
|
+
const zr = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, qr = /\n\s+\*? ?/gu, Gr = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], ke = new RegExp(`\\.(${Gr.join("|")})(\\?|$)`, "u"), Vr = /^import ["'](?<specifier>[^"']+)["'];$/gmu, Xr = () => "throwError", Vt = "@arcgis/lumina:loadLitCss", H = "?layered", Ce = "?global", Qr = (e) => ({
|
|
1050
|
+
name: Vt,
|
|
1051
1051
|
enforce: "pre",
|
|
1052
1052
|
configResolved(t) {
|
|
1053
1053
|
const n = t.plugins.find(({ name: s }) => s === "vite:css-post");
|
|
@@ -1065,7 +1065,7 @@ const zr = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, qr = /\n\s+\
|
|
|
1065
1065
|
const d = `${a}?inline`, p = await i.call(this, r, d), { code: m, ...f } = typeof p == "string" ? { code: p } : p ?? {};
|
|
1066
1066
|
if (typeof m != "string" || !m.startsWith(_n) || !m.endsWith(Hn))
|
|
1067
1067
|
return console.warn(
|
|
1068
|
-
`${
|
|
1068
|
+
`${Vt} Expected vite:css-post to return a JS module with a string literal for ${I(a)}.`
|
|
1069
1069
|
), console.log(p), p;
|
|
1070
1070
|
if (l)
|
|
1071
1071
|
return e._globalCssString = Un(m), { code: "", map: { mappings: "" } };
|
|
@@ -1250,7 +1250,7 @@ function fo(e) {
|
|
|
1250
1250
|
}
|
|
1251
1251
|
function Gn(e) {
|
|
1252
1252
|
const t = e.members.filter((r) => r.kind === "field").map((r) => {
|
|
1253
|
-
const a = typeof r.attribute == "string", c = a && r.attribute !==
|
|
1253
|
+
const a = typeof r.attribute == "string", c = a && r.attribute !== pt(r.name);
|
|
1254
1254
|
return a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""];
|
|
1255
1255
|
}), n = e.members.filter(
|
|
1256
1256
|
(r) => r.kind === "method" && /**
|
|
@@ -1295,7 +1295,7 @@ function Xn(e, t) {
|
|
|
1295
1295
|
const So = (e) => e.map((t) => ({
|
|
1296
1296
|
name: t.name,
|
|
1297
1297
|
text: t.text?.map((n) => n.text).join("").replaceAll(Vn, Xn)
|
|
1298
|
-
})),
|
|
1298
|
+
})), Xt = ({ modifiers: e = [] }, t) => X(
|
|
1299
1299
|
e,
|
|
1300
1300
|
(n) => o.isDecorator(n) && o.isCallExpression(n.expression) && o.isIdentifier(n.expression.expression) && n.expression.expression.text === t ? n.expression : void 0
|
|
1301
1301
|
);
|
|
@@ -1411,14 +1411,14 @@ function V(e, t) {
|
|
|
1411
1411
|
return !1;
|
|
1412
1412
|
throw new Error(`Expected boolean literal. Instead found ${e?.getText(t)}`);
|
|
1413
1413
|
}
|
|
1414
|
-
const
|
|
1414
|
+
const vt = "@arcgis/lumina-compiler";
|
|
1415
1415
|
class xo extends Yi {
|
|
1416
1416
|
constructor(t, n) {
|
|
1417
1417
|
super({ isFullApiExtraction: t.isFullApiExtraction, cwd: t.dir.root }), this.context = t, this.isPathOnly = n, this.localCssImports = void 0, this.localDeclaredComponents = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.apiComponent = void 0, this.pairedSetter = void 0, this._resolvedInheritance = /* @__PURE__ */ new Map();
|
|
1418
1418
|
}
|
|
1419
1419
|
extract(t) {
|
|
1420
1420
|
const n = super.extract(t);
|
|
1421
|
-
return n.compiler.name =
|
|
1421
|
+
return n.compiler.name = vt, n;
|
|
1422
1422
|
}
|
|
1423
1423
|
extractModules(t) {
|
|
1424
1424
|
const n = super.extractModules(t);
|
|
@@ -1593,7 +1593,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
1593
1593
|
default: void 0,
|
|
1594
1594
|
deprecated: void 0,
|
|
1595
1595
|
readonly: c || (s ? t.modifiers?.some((d) => d.kind === o.SyntaxKind.ReadonlyKeyword) : o.isGetAccessor(t) && this.pairedSetter === void 0) ? !0 : void 0,
|
|
1596
|
-
attribute: r === !1 ? void 0 : typeof r == "string" ? r :
|
|
1596
|
+
attribute: r === !1 ? void 0 : typeof r == "string" ? r : pt(n),
|
|
1597
1597
|
reflects: a || void 0,
|
|
1598
1598
|
docsTags: void 0,
|
|
1599
1599
|
getterType: void 0,
|
|
@@ -1617,7 +1617,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
1617
1617
|
oe(t.name, this.context.typeScriptTypeChecker, n, a);
|
|
1618
1618
|
let l = !i && n.readonly === !0;
|
|
1619
1619
|
const d = this.pairedSetter ?? t, p = n.default;
|
|
1620
|
-
|
|
1620
|
+
kt(t, n, this.file);
|
|
1621
1621
|
const m = p === void 0 && n.default === "true", f = n.docsTags?.some((v) => v.name === "required") ?? !1;
|
|
1622
1622
|
n.type = Fr(this.context, d, f, this.file);
|
|
1623
1623
|
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);
|
|
@@ -1639,7 +1639,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
1639
1639
|
if (T ??= o.isGetAccessor(E) ? E : void 0, k ??= o.isSetAccessor(E) ? E : void 0, !("initializer" in E))
|
|
1640
1640
|
return;
|
|
1641
1641
|
const L = E;
|
|
1642
|
-
l ||= L.modifiers?.some((b) => b.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1,
|
|
1642
|
+
l ||= L.modifiers?.some((b) => b.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, kt(L, n, L.getSourceFile());
|
|
1643
1643
|
}), y && T !== void 0 && k !== void 0 && T.type?.getText() !== k.parameters[0]?.type?.getText() && (n.getterType = { text: `typeof ${v.getText(this.file)}` });
|
|
1644
1644
|
}
|
|
1645
1645
|
if (l && (n.readonly = !0, i || (n.docsOnlyReadonly = !0)), n.type.values && n.type.values.length > 0 && n.type.values?.every((v) => v.type === "boolean") && (n.default ? m && this.context.viteCommand === "build" && n.deprecated === void 0 && this.context.logLintError(
|
|
@@ -1655,11 +1655,11 @@ ${c}.componentOnReady().then(() => {
|
|
|
1655
1655
|
* Find the properties given to the `@property()` decorator.
|
|
1656
1656
|
*/
|
|
1657
1657
|
findPropertyOptions(t) {
|
|
1658
|
-
const n =
|
|
1658
|
+
const n = Xt(t, "property");
|
|
1659
1659
|
return n === void 0 ? void 0 : n.arguments?.find(o.isObjectLiteralExpression)?.properties ?? [];
|
|
1660
1660
|
}
|
|
1661
1661
|
extractComponentMethod(t, n) {
|
|
1662
|
-
if (
|
|
1662
|
+
if (Xt(t, "method") === void 0)
|
|
1663
1663
|
return;
|
|
1664
1664
|
const i = {
|
|
1665
1665
|
kind: "method",
|
|
@@ -1773,7 +1773,7 @@ const te = {
|
|
|
1773
1773
|
package: "@arcgis/lumina"
|
|
1774
1774
|
}, Qe = (e, t) => e.name.localeCompare(t.name);
|
|
1775
1775
|
async function $o(e, t) {
|
|
1776
|
-
t || (e.componentFilesPromise =
|
|
1776
|
+
t || (e.componentFilesPromise = gt(e, e.dir.srcComponents));
|
|
1777
1777
|
const n = await e.componentFilesPromise, i = await Lo(e, n);
|
|
1778
1778
|
e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
1779
1779
|
const s = Qn(i, e, !1);
|
|
@@ -1846,7 +1846,7 @@ function Io(e, t, n) {
|
|
|
1846
1846
|
function Se(e, t, n) {
|
|
1847
1847
|
e !== void 0 && (e.references?.forEach((i) => ko(i, t, n)), e.text = e.text.replaceAll(
|
|
1848
1848
|
Fo,
|
|
1849
|
-
(i, s) =>
|
|
1849
|
+
(i, s) => St(t.get(s)) ?? i
|
|
1850
1850
|
), e.values?.forEach(Ao, t));
|
|
1851
1851
|
}
|
|
1852
1852
|
function ko(e, t, n) {
|
|
@@ -1855,14 +1855,14 @@ function ko(e, t, n) {
|
|
|
1855
1855
|
e.module = ce(e.module, "dist/components/", n);
|
|
1856
1856
|
else if (e.module === "index.js" && e.name) {
|
|
1857
1857
|
const i = t.get(e.name);
|
|
1858
|
-
i !== void 0 && (e.name =
|
|
1858
|
+
i !== void 0 && (e.name = St(i), e.viewUrl = i.demos?.at(0)?.url);
|
|
1859
1859
|
}
|
|
1860
1860
|
}
|
|
1861
1861
|
}
|
|
1862
1862
|
function Ao(e) {
|
|
1863
|
-
e.type.startsWith("ToElement<") && (e.type =
|
|
1863
|
+
e.type.startsWith("ToElement<") && (e.type = St(this.get(e.type.slice(10, -1))) ?? e.type);
|
|
1864
1864
|
}
|
|
1865
|
-
const
|
|
1865
|
+
const St = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0, Fo = /ToElement<(\w+)>/gu;
|
|
1866
1866
|
async function Lo(e, t) {
|
|
1867
1867
|
if (e.viteCommand === "serve" && (Object.hasOwn(e, "typeScriptHost") || (e.typeScriptHost = o.createCompilerHost(e.typeScriptConfig, !1))), e.typeScriptProgram !== void 0) {
|
|
1868
1868
|
const n = e.typeScriptProgram.getSourceFiles(), i = new Set(t);
|
|
@@ -1948,7 +1948,7 @@ async function ti(e, t) {
|
|
|
1948
1948
|
Error: ${String(w)}`);
|
|
1949
1949
|
}
|
|
1950
1950
|
}
|
|
1951
|
-
const d =
|
|
1951
|
+
const d = Qt(i.customElements);
|
|
1952
1952
|
if (d != null) {
|
|
1953
1953
|
const y = u.join(n, d), h = JSON.parse(await M(y, "utf-8")), v = Mo(h), g = ni(h, {
|
|
1954
1954
|
packageName: e,
|
|
@@ -1956,7 +1956,7 @@ Error: ${String(w)}`);
|
|
|
1956
1956
|
});
|
|
1957
1957
|
return { type: v ? "@arcgis/lumina" : "unknown", packageName: e, components: g };
|
|
1958
1958
|
}
|
|
1959
|
-
const p =
|
|
1959
|
+
const p = Qt(i["web-types"]);
|
|
1960
1960
|
if (p != null) {
|
|
1961
1961
|
const y = u.join(n, p), h = JSON.parse(await M(y, "utf-8")), v = Oo(h, {
|
|
1962
1962
|
packageName: e,
|
|
@@ -1974,7 +1974,7 @@ Error: ${String(w)}`);
|
|
|
1974
1974
|
return { type: "unknown", packageName: e, components: y };
|
|
1975
1975
|
}
|
|
1976
1976
|
}
|
|
1977
|
-
const
|
|
1977
|
+
const Qt = (e) => Array.isArray(e) ? e[0] : e;
|
|
1978
1978
|
function Ro(e, t) {
|
|
1979
1979
|
const n = e.indexOf(t);
|
|
1980
1980
|
return n === -1 ? -1 : n + t.length;
|
|
@@ -1997,7 +1997,7 @@ function ni(e, t) {
|
|
|
1997
1997
|
}
|
|
1998
1998
|
return n;
|
|
1999
1999
|
}
|
|
2000
|
-
const Mo = (e) => e.compiler?.name ===
|
|
2000
|
+
const Mo = (e) => e.compiler?.name === vt, Oo = (e, t) => Object.fromEntries(
|
|
2001
2001
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
2002
2002
|
(n) => [
|
|
2003
2003
|
n.name,
|
|
@@ -2038,7 +2038,7 @@ const Mo = (e) => e.compiler?.name === gt, Oo = (e, t) => Object.fromEntries(
|
|
|
2038
2038
|
}
|
|
2039
2039
|
];
|
|
2040
2040
|
})
|
|
2041
|
-
), Bo = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Wo = (e) => e.startsWith("/") ? e : `/${e}`,
|
|
2041
|
+
), Bo = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Wo = (e) => e.startsWith("/") ? e : `/${e}`, wt = (e, t) => `${e}@fs${Wo(t)}`;
|
|
2042
2042
|
function Be(e = D(), t = !1, n = e.name === "@esri/calcite-components") {
|
|
2043
2043
|
const i = e.version.includes("next");
|
|
2044
2044
|
if (e.name === "@esri/calcite-components" && i)
|
|
@@ -2088,7 +2088,7 @@ async function Uo(e, t, n, i) {
|
|
|
2088
2088
|
...m,
|
|
2089
2089
|
`import { defineCustomElements as defineCustomElements$${i} } from "${f}";`,
|
|
2090
2090
|
`defineCustomElements$${i}({`,
|
|
2091
|
-
` resourcesUrl: "${
|
|
2091
|
+
` resourcesUrl: "${wt(e, s)}/dist/${c}/",`,
|
|
2092
2092
|
"});"
|
|
2093
2093
|
]
|
|
2094
2094
|
};
|
|
@@ -2974,7 +2974,7 @@ function li(e) {
|
|
|
2974
2974
|
e.stringifiedNonReflected
|
|
2975
2975
|
));
|
|
2976
2976
|
}
|
|
2977
|
-
const
|
|
2977
|
+
const Yt = /* @__PURE__ */ new Set(["itemScope"]), di = /* @__PURE__ */ new Set([
|
|
2978
2978
|
"abort",
|
|
2979
2979
|
"animationCancel",
|
|
2980
2980
|
"animationEnd",
|
|
@@ -3088,7 +3088,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), di = /* @__PURE__ */ new Set(
|
|
|
3088
3088
|
"source",
|
|
3089
3089
|
"track",
|
|
3090
3090
|
"wbr"
|
|
3091
|
-
]),
|
|
3091
|
+
]), bt = /* @__PURE__ */ new Set([
|
|
3092
3092
|
"animate",
|
|
3093
3093
|
"animateMotion",
|
|
3094
3094
|
"animateTransform",
|
|
@@ -3147,7 +3147,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), di = /* @__PURE__ */ new Set(
|
|
|
3147
3147
|
"tspan",
|
|
3148
3148
|
"use",
|
|
3149
3149
|
"view"
|
|
3150
|
-
]), ea = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]),
|
|
3150
|
+
]), ea = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), Tt = /* @__PURE__ */ new Set([
|
|
3151
3151
|
"annotation-xml",
|
|
3152
3152
|
"annotation",
|
|
3153
3153
|
"maction",
|
|
@@ -3189,7 +3189,7 @@ const Qt = /* @__PURE__ */ new Set(["itemScope"]), di = /* @__PURE__ */ new Set(
|
|
|
3189
3189
|
"font-face-name",
|
|
3190
3190
|
"missing-glyph"
|
|
3191
3191
|
]);
|
|
3192
|
-
function
|
|
3192
|
+
function Zt(e, t, n) {
|
|
3193
3193
|
if (q(e))
|
|
3194
3194
|
return e;
|
|
3195
3195
|
{
|
|
@@ -3284,7 +3284,7 @@ const ta = /* @__PURE__ */ new Set([
|
|
|
3284
3284
|
return [s.name, ...c];
|
|
3285
3285
|
const [d, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
3286
3286
|
if (r || m) {
|
|
3287
|
-
const f =
|
|
3287
|
+
const f = Zt(
|
|
3288
3288
|
p,
|
|
3289
3289
|
e,
|
|
3290
3290
|
m ? "" : void 0
|
|
@@ -3300,7 +3300,7 @@ const ta = /* @__PURE__ */ new Set([
|
|
|
3300
3300
|
return [n];
|
|
3301
3301
|
if (i === !1)
|
|
3302
3302
|
return [];
|
|
3303
|
-
const s = xe(e, t, !0), a = s[0] !== "=" ? s : [s[0],
|
|
3303
|
+
const s = xe(e, t, !0), a = s[0] !== "=" ? s : [s[0], Zt(s[1], e)];
|
|
3304
3304
|
return [n, ...a];
|
|
3305
3305
|
},
|
|
3306
3306
|
booleanAttribute(e, t, n) {
|
|
@@ -3313,7 +3313,7 @@ const ta = /* @__PURE__ */ new Set([
|
|
|
3313
3313
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3314
3314
|
);
|
|
3315
3315
|
const i = n.slice(2), s = st(i);
|
|
3316
|
-
return [`@${di.has(s) ? i.toLowerCase() : st(i)}=`, ...
|
|
3316
|
+
return [`@${di.has(s) ? i.toLowerCase() : st(i)}=`, ...Ct(e, t, void 0)];
|
|
3317
3317
|
},
|
|
3318
3318
|
directives(e, t) {
|
|
3319
3319
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3345,9 +3345,9 @@ const ta = /* @__PURE__ */ new Set([
|
|
|
3345
3345
|
])
|
|
3346
3346
|
];
|
|
3347
3347
|
},
|
|
3348
|
-
class:
|
|
3349
|
-
style:
|
|
3350
|
-
key: (e, t) => [
|
|
3348
|
+
class: tn,
|
|
3349
|
+
style: tn,
|
|
3350
|
+
key: (e, t) => [Et(t, e.sourceFile)]
|
|
3351
3351
|
};
|
|
3352
3352
|
function sa(e, t, n) {
|
|
3353
3353
|
if (typeof e == "string") {
|
|
@@ -3381,7 +3381,7 @@ function et(e, t) {
|
|
|
3381
3381
|
if (s !== void 0)
|
|
3382
3382
|
return { name: s, type: "stringifiedNonReflected" };
|
|
3383
3383
|
}
|
|
3384
|
-
function
|
|
3384
|
+
function Et(e, t) {
|
|
3385
3385
|
if (e !== void 0 && o.isJsxExpression(e) && e.expression !== void 0)
|
|
3386
3386
|
return e.expression;
|
|
3387
3387
|
if (e !== void 0 && o.isStringLiteral(e))
|
|
@@ -3404,10 +3404,10 @@ function xe(e, t, n = !1) {
|
|
|
3404
3404
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3405
3405
|
);
|
|
3406
3406
|
if (o.isStringLiteral(t))
|
|
3407
|
-
return
|
|
3407
|
+
return en(t, n);
|
|
3408
3408
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3409
3409
|
if (o.isStringLiteral(t.expression))
|
|
3410
|
-
return
|
|
3410
|
+
return en(t.expression, n);
|
|
3411
3411
|
if (n) {
|
|
3412
3412
|
if (o.isNumericLiteral(t.expression))
|
|
3413
3413
|
return [`=${t.expression.text}`];
|
|
@@ -3415,9 +3415,9 @@ function xe(e, t, n = !1) {
|
|
|
3415
3415
|
return [`=${t.expression.getText(e.sourceFile)}`];
|
|
3416
3416
|
}
|
|
3417
3417
|
}
|
|
3418
|
-
return ["=", ...
|
|
3418
|
+
return ["=", ...Ct(e, t, void 0)];
|
|
3419
3419
|
}
|
|
3420
|
-
function
|
|
3420
|
+
function en(e, t) {
|
|
3421
3421
|
if (!t)
|
|
3422
3422
|
return ["=", e];
|
|
3423
3423
|
const n = e.text;
|
|
@@ -3435,7 +3435,7 @@ function Zt(e, t) {
|
|
|
3435
3435
|
} else
|
|
3436
3436
|
return [`=${i}`];
|
|
3437
3437
|
}
|
|
3438
|
-
function
|
|
3438
|
+
function tn(e, t, n) {
|
|
3439
3439
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3440
3440
|
return [`${n}="${t.text}"`];
|
|
3441
3441
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3462,9 +3462,9 @@ function oa(e, t) {
|
|
|
3462
3462
|
]);
|
|
3463
3463
|
}
|
|
3464
3464
|
function aa(e) {
|
|
3465
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3465
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in nn && e.expression.arguments.length <= 1)
|
|
3466
3466
|
return {
|
|
3467
|
-
propType:
|
|
3467
|
+
propType: nn[e.expression.expression.text],
|
|
3468
3468
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3469
3469
|
initializer: o.factory.createJsxExpression(
|
|
3470
3470
|
void 0,
|
|
@@ -3473,7 +3473,7 @@ function aa(e) {
|
|
|
3473
3473
|
)
|
|
3474
3474
|
};
|
|
3475
3475
|
}
|
|
3476
|
-
const
|
|
3476
|
+
const nn = {
|
|
3477
3477
|
bindProperty: "property",
|
|
3478
3478
|
bindAttribute: "attribute",
|
|
3479
3479
|
bindBooleanAttribute: "booleanAttribute",
|
|
@@ -3483,7 +3483,7 @@ function ca(e, t, n) {
|
|
|
3483
3483
|
return da.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (ai.has(e) || e.includes("-")) && (e !== "itemId" || n !== "arcgis-map" && n !== "arcgis-scene") ? "attribute" : !(typeof n == "string" && n.includes("-") && !pi.has(n)) && (ci.has(e) || (n === ct ? !1 : n === Fe ? (
|
|
3484
3484
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3485
3485
|
Object.values(lt).some((a) => a.has(e))
|
|
3486
|
-
) : lt[n]?.has(e) === !0)) ?
|
|
3486
|
+
) : lt[n]?.has(e) === !0)) ? Yt.has(e) ? "booleanAttribute" : "attribute" : n === "svg" || n === "math" || n === ct || n !== Fe && (bt.has(n) || Tt.has(n)) ? e in O.common.reflected || e in O.common.stringifiedReflected || e in O.common.stringifiedNonReflected ? "property" : Yt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3487
3487
|
}
|
|
3488
3488
|
const la = ["class", "style", "ref", "directives", "key"], da = new Set(la), pa = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3489
3489
|
function We({ key: e, parts: t, litTag: n }, i) {
|
|
@@ -3569,7 +3569,7 @@ function fa(e, t) {
|
|
|
3569
3569
|
return t;
|
|
3570
3570
|
const c = pe(i.body);
|
|
3571
3571
|
let l = !0, d;
|
|
3572
|
-
if (
|
|
3572
|
+
if (sn(c))
|
|
3573
3573
|
d = c;
|
|
3574
3574
|
else {
|
|
3575
3575
|
if (!o.isBlock(c))
|
|
@@ -3578,7 +3578,7 @@ function fa(e, t) {
|
|
|
3578
3578
|
if (!(g && o.isReturnStatement(g) && g.expression))
|
|
3579
3579
|
return t;
|
|
3580
3580
|
const w = pe(g.expression);
|
|
3581
|
-
if (!
|
|
3581
|
+
if (!sn(w))
|
|
3582
3582
|
return t;
|
|
3583
3583
|
const T = c.statements.slice(0, -1);
|
|
3584
3584
|
if (T.some(ui))
|
|
@@ -3591,7 +3591,7 @@ function fa(e, t) {
|
|
|
3591
3591
|
const f = p.attributes.properties[m];
|
|
3592
3592
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3593
3593
|
return t;
|
|
3594
|
-
const y =
|
|
3594
|
+
const y = Et(f.initializer, e.sourceFile), h = ya(r, i, y, l, e);
|
|
3595
3595
|
if (h === void 0)
|
|
3596
3596
|
return t;
|
|
3597
3597
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3613,7 +3613,7 @@ function fa(e, t) {
|
|
|
3613
3613
|
)
|
|
3614
3614
|
]);
|
|
3615
3615
|
}
|
|
3616
|
-
const
|
|
3616
|
+
const sn = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3617
3617
|
function ui(e) {
|
|
3618
3618
|
if (o.isReturnStatement(e))
|
|
3619
3619
|
return !0;
|
|
@@ -3732,7 +3732,7 @@ function He(e, t) {
|
|
|
3732
3732
|
}
|
|
3733
3733
|
m.docsTags?.some((y) => y.name === "required") ? n.push(p.name) : i.push(p.name);
|
|
3734
3734
|
});
|
|
3735
|
-
const r =
|
|
3735
|
+
const r = rn(n), a = rn(i), c = [
|
|
3736
3736
|
r ? `Required<Pick<${e}, ${r}>>` : "",
|
|
3737
3737
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3738
3738
|
s ? `${e}SetterTypes` : ""
|
|
@@ -3740,7 +3740,7 @@ function He(e, t) {
|
|
|
3740
3740
|
type ${e}SetterTypes = ${e}["${Nn}"]` : "", d = c.filter(Boolean).join(", ");
|
|
3741
3741
|
return [d.length === 0 ? "" : `${d}, `, l];
|
|
3742
3742
|
}
|
|
3743
|
-
const
|
|
3743
|
+
const rn = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3744
3744
|
function B(e, t, n) {
|
|
3745
3745
|
if (Ae(n))
|
|
3746
3746
|
return yi(e, n);
|
|
@@ -3778,7 +3778,7 @@ function hi(e, t) {
|
|
|
3778
3778
|
...T
|
|
3779
3779
|
};
|
|
3780
3780
|
}
|
|
3781
|
-
const c = r.text === Ye ? Fe : r.text === Ze ? ct : r.text, l = r.text === Ye ? Z : r.text === Ze ? U : ea.has(c) ? ii :
|
|
3781
|
+
const c = r.text === Ye ? Fe : r.text === Ze ? ct : r.text, l = r.text === Ye ? Z : r.text === Ze ? U : ea.has(c) ? ii : bt.has(c) ? Y : ee;
|
|
3782
3782
|
let d;
|
|
3783
3783
|
typeof c == "string" && c.includes("-") && !pi.has(c) && (e.customElementsToImport.add(c), e.compiler.viteCommand === "build" && (d = $a(e, c)));
|
|
3784
3784
|
let p;
|
|
@@ -3800,7 +3800,7 @@ Found ${w.getText(e.sourceFile)}`
|
|
|
3800
3800
|
const x = ia[b](e, L?.initializer ?? k, E, c);
|
|
3801
3801
|
if (x.length === 0)
|
|
3802
3802
|
return [];
|
|
3803
|
-
const F = e.compiler.shouldMinifyJsx ? " " : sr(
|
|
3803
|
+
const F = e.compiler.shouldMinifyJsx ? " " : sr(ft(T, e));
|
|
3804
3804
|
return b === "key" ? (p = typeof x[0] == "object" && !fi(T, e) ? x[0] : void 0, Array.isArray(F) && F.some(pa) ? F : []) : b === "directives" || b === "ref" ? (m.push(
|
|
3805
3805
|
...F,
|
|
3806
3806
|
...x.flatMap(
|
|
@@ -3812,7 +3812,7 @@ Found ${w.getText(e.sourceFile)}`
|
|
|
3812
3812
|
"mustIncludeAllRequiredProperties",
|
|
3813
3813
|
e.sourceFile.fileName,
|
|
3814
3814
|
`Missing required properties for <${c}> in ${e.sourceFile.fileName.slice(e.compiler.dir.root.length)}: ${Array.from(d).join(", ")}`
|
|
3815
|
-
), m.length > 0 && f.push(...m), typeof c == "string" &&
|
|
3815
|
+
), m.length > 0 && f.push(...m), typeof c == "string" && Tt.has(c))
|
|
3816
3816
|
throw new Error(
|
|
3817
3817
|
`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`
|
|
3818
3818
|
);
|
|
@@ -3844,13 +3844,13 @@ Found ${w.getText(e.sourceFile)}`
|
|
|
3844
3844
|
}
|
|
3845
3845
|
function Ea(e, t) {
|
|
3846
3846
|
const n = e.attributes.properties[gi(e)];
|
|
3847
|
-
return n && o.isJsxAttribute(n) && !fi(n.name, t) ?
|
|
3847
|
+
return n && o.isJsxAttribute(n) && !fi(n.name, t) ? Et(n.initializer, t.sourceFile) : void 0;
|
|
3848
3848
|
}
|
|
3849
3849
|
const gi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3850
3850
|
function Ca(e, t, n, i) {
|
|
3851
3851
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((l) => {
|
|
3852
3852
|
if (o.isJsxSpreadAttribute(l))
|
|
3853
|
-
return ft(
|
|
3853
|
+
return yt(ft(l, e), o.factory.createSpreadAssignment(l.expression));
|
|
3854
3854
|
const { name: d, initializer: p } = l;
|
|
3855
3855
|
if (o.isJsxNamespacedName(d)) {
|
|
3856
3856
|
const y = I(e.sourceFile.fileName);
|
|
@@ -3878,7 +3878,7 @@ function $e(e, t) {
|
|
|
3878
3878
|
if (o.isJsxText(s))
|
|
3879
3879
|
return [t.compiler.shouldMinifyJsx ? Zs(s.text) : s.text];
|
|
3880
3880
|
if (o.isJsxExpression(s))
|
|
3881
|
-
return
|
|
3881
|
+
return Ct(t, s, s);
|
|
3882
3882
|
{
|
|
3883
3883
|
const r = hi(t, s);
|
|
3884
3884
|
if (r.key === void 0 && r.litTag !== Z && r.litTag !== U) {
|
|
@@ -3902,12 +3902,12 @@ function xa(e) {
|
|
|
3902
3902
|
o.factory.createStringLiteral("")
|
|
3903
3903
|
) : e;
|
|
3904
3904
|
}
|
|
3905
|
-
function
|
|
3905
|
+
function Ct(e, t, n) {
|
|
3906
3906
|
if (t.expression === void 0) {
|
|
3907
3907
|
if (e.compiler.shouldMinifyJsx)
|
|
3908
3908
|
return [];
|
|
3909
3909
|
const i = t.getText(e.sourceFile).slice(1, -1);
|
|
3910
|
-
return
|
|
3910
|
+
return ht(i).length === 0 ? [] : [yt(i, o.factory.createIdentifier("undefined"))];
|
|
3911
3911
|
}
|
|
3912
3912
|
return o.isStringLiteral(t.expression) ? [Dn(t.expression.text)] : (
|
|
3913
3913
|
/**
|
|
@@ -3980,7 +3980,7 @@ const vi = (e) => e.reduce((t, [n, i]) => (t[n] ??= [], t[n].push(i), t), {}), u
|
|
|
3980
3980
|
nothing: ["lit-html", "lit/html.js", "lit-element/lit-element.js", "lit", "@arcgis/lumina"]
|
|
3981
3981
|
}, Si = vi(
|
|
3982
3982
|
Object.entries(ue).flatMap(([e, t]) => t.map((n) => [n, e]))
|
|
3983
|
-
),
|
|
3983
|
+
), xt = new Set(Object.keys(Si));
|
|
3984
3984
|
function Pa(e, t) {
|
|
3985
3985
|
const n = t.importClause, i = t.moduleSpecifier;
|
|
3986
3986
|
if (!o.isStringLiteral(i))
|
|
@@ -4004,7 +4004,7 @@ function Pa(e, t) {
|
|
|
4004
4004
|
const a = n.namedBindings;
|
|
4005
4005
|
if (a === void 0 || !o.isNamedImports(a))
|
|
4006
4006
|
return t;
|
|
4007
|
-
const c =
|
|
4007
|
+
const c = xt.has(i.text);
|
|
4008
4008
|
return a.elements.forEach((l) => {
|
|
4009
4009
|
const d = (l.propertyName ?? l.name).text, p = ue[d];
|
|
4010
4010
|
if (c) {
|
|
@@ -4023,7 +4023,7 @@ function ka(e) {
|
|
|
4023
4023
|
}
|
|
4024
4024
|
function Aa(e, t) {
|
|
4025
4025
|
const n = t.importClause, i = n?.namedBindings, s = t.moduleSpecifier;
|
|
4026
|
-
if (!o.isStringLiteral(s) || !i || !o.isNamedImports(i) || !
|
|
4026
|
+
if (!o.isStringLiteral(s) || !i || !o.isNamedImports(i) || !xt.has(s.text))
|
|
4027
4027
|
return t;
|
|
4028
4028
|
const r = n.isTypeOnly;
|
|
4029
4029
|
let a = !1;
|
|
@@ -4235,7 +4235,7 @@ function Ba(e, t, n, i, s) {
|
|
|
4235
4235
|
h === "type" ? r = y : h === "attribute" ? a = y : h === "readOnly" && (c = y);
|
|
4236
4236
|
}
|
|
4237
4237
|
});
|
|
4238
|
-
const l = s
|
|
4238
|
+
const l = s.attribute === void 0 && a === -1, d = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = Wa(e, t, n, s, r), m = [
|
|
4239
4239
|
...l ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4240
4240
|
...d ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4241
4241
|
...p !== void 0 ? [p] : []
|
|
@@ -4243,7 +4243,7 @@ function Ba(e, t, n, i, s) {
|
|
|
4243
4243
|
return m.length > 0 ? t.options === void 0 ? o.factory.createObjectLiteralExpression(m, !1) : o.factory.updateObjectLiteralExpression(t.options, [...t.options.properties, ...m]) : t.options;
|
|
4244
4244
|
}
|
|
4245
4245
|
function Wa(e, t, n, i, s) {
|
|
4246
|
-
if (i
|
|
4246
|
+
if (i.attribute === void 0)
|
|
4247
4247
|
return;
|
|
4248
4248
|
const r = Ha(e), a = n.compiler.viteCommand === "serve" || r !== "Other" ? r : _a(i.type.values);
|
|
4249
4249
|
return a === "Other" || i.readonly && (a !== "Boolean" || !i.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
@@ -4290,14 +4290,14 @@ function Ua(e, t, n, i, s) {
|
|
|
4290
4290
|
d === "property" && (r = l), d === "state" && (a = l);
|
|
4291
4291
|
}
|
|
4292
4292
|
}), r !== -1) {
|
|
4293
|
-
const c = za(e, t, n, i), l =
|
|
4293
|
+
const c = za(e, t, n, i), l = on(t, r, i), d = Ba(t, l, e, i, c);
|
|
4294
4294
|
let p = !1;
|
|
4295
|
-
return s
|
|
4296
|
-
} else if (a !== -1
|
|
4297
|
-
const c =
|
|
4295
|
+
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, an(t, l, r, p);
|
|
4296
|
+
} else if (a !== -1) {
|
|
4297
|
+
const c = on(t, a, i), 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 = _(t.name);
|
|
4298
4298
|
if (p === void 0)
|
|
4299
4299
|
throw new Error("Failed to statically determine the state property name");
|
|
4300
|
-
return s.set(p, d),
|
|
4300
|
+
return s.set(p, d), an(t, c, a, !0);
|
|
4301
4301
|
} else
|
|
4302
4302
|
return t;
|
|
4303
4303
|
}
|
|
@@ -4308,19 +4308,23 @@ function za(e, t, n, i) {
|
|
|
4308
4308
|
members: []
|
|
4309
4309
|
} : void 0);
|
|
4310
4310
|
if (s === void 0)
|
|
4311
|
-
|
|
4311
|
+
throw Error(`Failed to find API component for ${n} in ${i.fileName}`);
|
|
4312
4312
|
const r = As(s, t) ?? (e.compiler.isInTest ? { kind: "field", attribute: "", readonly: !1, name: "", type: { text: "" } } : void 0);
|
|
4313
|
-
if (
|
|
4314
|
-
|
|
4315
|
-
|
|
4316
|
-
|
|
4317
|
-
|
|
4318
|
-
|
|
4319
|
-
|
|
4320
|
-
|
|
4313
|
+
if (r === void 0 || r.kind !== "field")
|
|
4314
|
+
throw Error(
|
|
4315
|
+
`Failed to find API property for ${t.getText(i)} in ${n} in ${i.fileName}`
|
|
4316
|
+
);
|
|
4317
|
+
if (r.name === "") {
|
|
4318
|
+
const a = _(t.name);
|
|
4319
|
+
if (a === void 0)
|
|
4320
|
+
throw Error(
|
|
4321
|
+
`Failed to statically determine the property name: ${t.getText(i)} in ${n} in ${i.fileName}`
|
|
4322
|
+
);
|
|
4323
|
+
r.name = a, r.attribute ??= pt(a);
|
|
4321
4324
|
}
|
|
4325
|
+
return r;
|
|
4322
4326
|
}
|
|
4323
|
-
function
|
|
4327
|
+
function on(e, t, n) {
|
|
4324
4328
|
const i = e.modifiers[t], s = i.expression, r = s.arguments.at(0);
|
|
4325
4329
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4326
4330
|
throw new Error(
|
|
@@ -4328,7 +4332,7 @@ function rn(e, t, n) {
|
|
|
4328
4332
|
);
|
|
4329
4333
|
return { decorator: i, callExpression: s, options: r };
|
|
4330
4334
|
}
|
|
4331
|
-
function
|
|
4335
|
+
function an(e, t, n, i) {
|
|
4332
4336
|
const s = i ? void 0 : o.factory.updateDecorator(
|
|
4333
4337
|
t.decorator,
|
|
4334
4338
|
o.factory.updateCallExpression(
|
|
@@ -4378,30 +4382,30 @@ const qa = (e, t) => {
|
|
|
4378
4382
|
};
|
|
4379
4383
|
function Ei(e, t, n, i, s = Cn) {
|
|
4380
4384
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4381
|
-
t.heritageClauses?.some((
|
|
4382
|
-
let
|
|
4383
|
-
const
|
|
4385
|
+
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4386
|
+
let r = !1;
|
|
4387
|
+
const a = t.name?.text;
|
|
4384
4388
|
i?.();
|
|
4385
|
-
const
|
|
4386
|
-
t.members.map((
|
|
4387
|
-
const
|
|
4388
|
-
return
|
|
4389
|
+
const c = s(
|
|
4390
|
+
t.members.map((d) => {
|
|
4391
|
+
const p = e(d, a);
|
|
4392
|
+
return r ||= p !== d, p;
|
|
4389
4393
|
})
|
|
4390
4394
|
);
|
|
4391
|
-
return
|
|
4395
|
+
return r ? o.factory.updateClassDeclaration(
|
|
4392
4396
|
t,
|
|
4393
4397
|
t.modifiers,
|
|
4394
4398
|
t.name,
|
|
4395
4399
|
t.typeParameters,
|
|
4396
4400
|
t.heritageClauses,
|
|
4397
|
-
|
|
4401
|
+
c
|
|
4402
|
+
) : t;
|
|
4403
|
+
} else
|
|
4404
|
+
return n.compiler.isInTest ? o.visitEachChild(
|
|
4405
|
+
t,
|
|
4406
|
+
(a) => Ei(e, a, n, i, s),
|
|
4407
|
+
n.transformation
|
|
4398
4408
|
) : t;
|
|
4399
|
-
}
|
|
4400
|
-
return n.compiler.isInTest ? o.visitEachChild(
|
|
4401
|
-
t,
|
|
4402
|
-
(a) => Ei(e, a, n, i, s),
|
|
4403
|
-
n.transformation
|
|
4404
|
-
) : t;
|
|
4405
4409
|
}
|
|
4406
4410
|
const Ga = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4407
4411
|
function Va(e, t, n, i, s) {
|
|
@@ -4449,12 +4453,12 @@ function Va(e, t, n, i, s) {
|
|
|
4449
4453
|
}
|
|
4450
4454
|
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? Ua(e, t, n, i, s) : t;
|
|
4451
4455
|
}
|
|
4452
|
-
const Xa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method",
|
|
4456
|
+
const Xa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", cn = "makeRuntime(";
|
|
4453
4457
|
function Qa(e, t) {
|
|
4454
|
-
const n = e.indexOf(
|
|
4458
|
+
const n = e.indexOf(cn);
|
|
4455
4459
|
if (n === -1)
|
|
4456
4460
|
throw new Error("Failed to find makeRuntime() function call in src/runtime.ts");
|
|
4457
|
-
const i = n +
|
|
4461
|
+
const i = n + cn.length, s = t.options.css?.commonStylesPath;
|
|
4458
4462
|
return {
|
|
4459
4463
|
code: [
|
|
4460
4464
|
s === void 0 ? "" : `import commonStyles from "${me(t.dir.src, s)}";`,
|
|
@@ -4482,7 +4486,7 @@ const Ya = [
|
|
|
4482
4486
|
order: "pre",
|
|
4483
4487
|
async handler(t, n) {
|
|
4484
4488
|
if (!n.endsWith(".tsx")) {
|
|
4485
|
-
if (e.isInTest && n.endsWith(".ts") &&
|
|
4489
|
+
if (e.isInTest && n.endsWith(".ts") && mt(n) && t.includes("extends LitElement"))
|
|
4486
4490
|
console.warn(
|
|
4487
4491
|
"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"
|
|
4488
4492
|
);
|
|
@@ -4581,7 +4585,7 @@ function nc(e, t) {
|
|
|
4581
4585
|
if (e.isInStorybook && e.viteCommand === "serve") {
|
|
4582
4586
|
const n = (a, c, l, ...d) => {
|
|
4583
4587
|
const p = a.filter(
|
|
4584
|
-
(m) => (!m.includes(".stories.") || m.endsWith(".tsx")) && !
|
|
4588
|
+
(m) => (!m.includes(".stories.") || m.endsWith(".tsx")) && !mt(m)
|
|
4585
4589
|
);
|
|
4586
4590
|
return e.typeScriptHost = l, o.createAbstractBuilder(p, c, l, ...d);
|
|
4587
4591
|
}, i = o.createWatchCompilerHost(
|
|
@@ -4601,7 +4605,7 @@ function nc(e, t) {
|
|
|
4601
4605
|
}
|
|
4602
4606
|
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = ec(e), e._typeScriptPrinter = On(e._compilerOptionsForPrinter);
|
|
4603
4607
|
}
|
|
4604
|
-
const dt = "@arcgis/core",
|
|
4608
|
+
const dt = "@arcgis/core", ln = D(), K = dt in (ln.dependencies ?? {}) || dt in (ln.peerDependencies ?? {});
|
|
4605
4609
|
async function ic(e, t) {
|
|
4606
4610
|
if (!K)
|
|
4607
4611
|
return [];
|
|
@@ -4623,12 +4627,12 @@ async function ic(e, t) {
|
|
|
4623
4627
|
})
|
|
4624
4628
|
},
|
|
4625
4629
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
4626
|
-
|
|
4630
|
+
dn(s)
|
|
4627
4631
|
];
|
|
4628
4632
|
} else
|
|
4629
|
-
return [
|
|
4633
|
+
return [dn(wt(e, `${n}/assets/`))];
|
|
4630
4634
|
}
|
|
4631
|
-
const
|
|
4635
|
+
const dn = (e) => ({
|
|
4632
4636
|
// Not using join() because it would turn https:// into https:/
|
|
4633
4637
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
4634
4638
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
@@ -4866,7 +4870,7 @@ async function pc(e, t, n, i) {
|
|
|
4866
4870
|
...l,
|
|
4867
4871
|
`import { defineCustomElements as defineCustomElements$${i} } from "${d}";`,
|
|
4868
4872
|
`defineCustomElements$${i}(globalThis.window, {`,
|
|
4869
|
-
` resourcesUrl: "${
|
|
4873
|
+
` resourcesUrl: "${wt(e, s)}/dist/${a}/",`,
|
|
4870
4874
|
"});"
|
|
4871
4875
|
]
|
|
4872
4876
|
}
|
|
@@ -4877,10 +4881,10 @@ async function uc(e) {
|
|
|
4877
4881
|
(s) => !xi.has(s) && !s.includes(".")
|
|
4878
4882
|
), i = n.find((s) => s.startsWith("arcgis-"));
|
|
4879
4883
|
return i === void 0 ? await Promise.all(
|
|
4880
|
-
n.map(async (s) => await
|
|
4881
|
-
).then((s) => s.find(N)) : await
|
|
4884
|
+
n.map(async (s) => await pn(e, s))
|
|
4885
|
+
).then((s) => s.find(N)) : await pn(e, i);
|
|
4882
4886
|
}
|
|
4883
|
-
async function
|
|
4887
|
+
async function pn(e, t) {
|
|
4884
4888
|
const n = u.join(e, t, `${t}.css`), i = u.join(e, t, "assets"), [s, r] = await Promise.all([W(n), W(i)]);
|
|
4885
4889
|
return s || r ? {
|
|
4886
4890
|
hasCss: s,
|
|
@@ -4940,7 +4944,7 @@ const Li = "/@arcgis/lumina-compiler/testLitSetupFile", Ni = "/@arcgis/lumina-co
|
|
|
4940
4944
|
`);
|
|
4941
4945
|
async function yc(e) {
|
|
4942
4946
|
if (!e.viteConfig.test?.browser?.enabled)
|
|
4943
|
-
return
|
|
4947
|
+
return un(e);
|
|
4944
4948
|
const n = (await De(e)).map((i, s) => {
|
|
4945
4949
|
if ("javascriptCode" in i)
|
|
4946
4950
|
return i.javascriptCode.join(`
|
|
@@ -4959,9 +4963,9 @@ async function yc(e) {
|
|
|
4959
4963
|
}).join(`
|
|
4960
4964
|
|
|
4961
4965
|
`);
|
|
4962
|
-
return [
|
|
4966
|
+
return [un(e), n].join("");
|
|
4963
4967
|
}
|
|
4964
|
-
const
|
|
4968
|
+
const un = (e) => [e.isInPuppeteerTestBackEnd ? hc : "", gc].join(""), hc = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
4965
4969
|
setupPuppeteerTest();
|
|
4966
4970
|
`, gc = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
4967
4971
|
setupLuminaTest();
|
|
@@ -5006,7 +5010,7 @@ function vc(e) {
|
|
|
5006
5010
|
p(g, async () => await M(g, "utf8")).catch(console.error);
|
|
5007
5011
|
}), h.watcher.on("add", v), h.watcher.on("unlink", v), h.watcher.on(
|
|
5008
5012
|
"addDir",
|
|
5009
|
-
(g) => g.startsWith(e.dir.srcComponents) ? void
|
|
5013
|
+
(g) => g.startsWith(e.dir.srcComponents) ? void gt(e, e.dir.srcComponents, g).then(
|
|
5010
5014
|
(S) => S.length > 0 ? m() : void 0
|
|
5011
5015
|
) : void 0
|
|
5012
5016
|
), h.watcher.on("unlinkDir", (g) => {
|
|
@@ -5072,7 +5076,7 @@ function vc(e) {
|
|
|
5072
5076
|
return d;
|
|
5073
5077
|
}
|
|
5074
5078
|
const Sc = "@arcgis/lumina:provideAssets";
|
|
5075
|
-
function ae(e, t, n =
|
|
5079
|
+
function ae(e, t, n = $t) {
|
|
5076
5080
|
if (e.viteCommand !== "serve")
|
|
5077
5081
|
throw new Error("serveAssets() is only available when Vite is running in serve mode");
|
|
5078
5082
|
const i = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
@@ -5096,7 +5100,7 @@ function ae(e, t, n = xt) {
|
|
|
5096
5100
|
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
5097
5101
|
}
|
|
5098
5102
|
}
|
|
5099
|
-
async function ji(e, t, n =
|
|
5103
|
+
async function ji(e, t, n = $t) {
|
|
5100
5104
|
await Promise.all(
|
|
5101
5105
|
t.map(async (i) => {
|
|
5102
5106
|
const s = Di(i), r = Mi(e.dir, Ri(s));
|
|
@@ -5107,11 +5111,11 @@ async function ji(e, t, n = xt) {
|
|
|
5107
5111
|
});
|
|
5108
5112
|
await Ji(l.map(([d, p]) => p)), await Promise.all(
|
|
5109
5113
|
l.map(
|
|
5110
|
-
async ([d, p]) => await
|
|
5114
|
+
async ([d, p]) => await mn(d, p, n, e)
|
|
5111
5115
|
)
|
|
5112
5116
|
);
|
|
5113
5117
|
} else if (s.type === "file")
|
|
5114
|
-
await Q(u.dirname(r), { recursive: !0 }), await
|
|
5118
|
+
await Q(u.dirname(r), { recursive: !0 }), await mn(s.source, r, n, e);
|
|
5115
5119
|
else if (s.type === "dynamic") {
|
|
5116
5120
|
await Q(u.dirname(r), { recursive: !0 });
|
|
5117
5121
|
const a = await Promise.resolve(s.source());
|
|
@@ -5120,7 +5124,7 @@ async function ji(e, t, n = xt) {
|
|
|
5120
5124
|
})
|
|
5121
5125
|
);
|
|
5122
5126
|
}
|
|
5123
|
-
const Di =
|
|
5127
|
+
const Di = Tn ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5124
5128
|
...e,
|
|
5125
5129
|
destination: Ee(e.destination)
|
|
5126
5130
|
} : {
|
|
@@ -5128,7 +5132,7 @@ const Di = bn ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
5128
5132
|
source: Ee(e.source),
|
|
5129
5133
|
destination: Ee(e.destination)
|
|
5130
5134
|
};
|
|
5131
|
-
async function
|
|
5135
|
+
async function mn(e, t, n, i) {
|
|
5132
5136
|
const s = n.find((r) => r.match(t, i));
|
|
5133
5137
|
if (s === void 0)
|
|
5134
5138
|
await os(e, t);
|
|
@@ -5161,7 +5165,7 @@ function wc(e) {
|
|
|
5161
5165
|
const t = Pe(), n = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5162
5166
|
return e.startsWith(`/${n}/`) || e.startsWith("/Users/");
|
|
5163
5167
|
} else
|
|
5164
|
-
return !!(!
|
|
5168
|
+
return !!(!Tn && u.isAbsolute(e));
|
|
5165
5169
|
}
|
|
5166
5170
|
function bc(e, t, n) {
|
|
5167
5171
|
const i = Oi(u.relative(n, t)), s = i.startsWith("/") ? i.slice(1) : i;
|
|
@@ -5175,12 +5179,12 @@ async function Ji(e) {
|
|
|
5175
5179
|
const Ec = {
|
|
5176
5180
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5177
5181
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5178
|
-
},
|
|
5182
|
+
}, $t = [Ec];
|
|
5179
5183
|
function Cc(e) {
|
|
5180
5184
|
let t;
|
|
5181
5185
|
const n = () => [
|
|
5182
5186
|
...e.options.assets?.transformers ?? [],
|
|
5183
|
-
|
|
5187
|
+
...$t
|
|
5184
5188
|
];
|
|
5185
5189
|
return {
|
|
5186
5190
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
@@ -5297,26 +5301,26 @@ const Pc = (e) => ({
|
|
|
5297
5301
|
console.log = m;
|
|
5298
5302
|
}
|
|
5299
5303
|
if (l > 0) {
|
|
5300
|
-
const y = d > 0 ? l : c, h =
|
|
5304
|
+
const y = d > 0 ? l : c, h = hn(y), v = e.dir.relativeDist;
|
|
5301
5305
|
console.log(
|
|
5302
5306
|
[
|
|
5303
|
-
|
|
5307
|
+
yn,
|
|
5304
5308
|
v,
|
|
5305
5309
|
Ic,
|
|
5306
5310
|
"*",
|
|
5307
5311
|
" ".repeat(p - `${v}*`.length - h.length),
|
|
5308
5312
|
h,
|
|
5309
|
-
|
|
5310
|
-
d > 0 ? ` ${
|
|
5313
|
+
fn,
|
|
5314
|
+
d > 0 ? ` ${yn}│ gzip: ${hn(d)}${fn}` : ""
|
|
5311
5315
|
].join("")
|
|
5312
5316
|
);
|
|
5313
5317
|
}
|
|
5314
5318
|
};
|
|
5315
5319
|
}
|
|
5316
|
-
}),
|
|
5320
|
+
}), fn = "\x1B[22m\x1B[1m\x1B[22m", yn = "\x1B[2m", Ic = "\x1B[22m\x1B[36m", kc = /\d+(?:,\d+)?\.\d{2} kB/gu, Ac = /\x1B\[\d+m/gu, Fc = new Intl.NumberFormat("en", {
|
|
5317
5321
|
maximumFractionDigits: 2,
|
|
5318
5322
|
minimumFractionDigits: 2
|
|
5319
|
-
}),
|
|
5323
|
+
}), hn = (e) => `${Fc.format(e)} kB`, Lc = (e) => ({
|
|
5320
5324
|
name: "@arcgis/lumina:configureVite",
|
|
5321
5325
|
async config({
|
|
5322
5326
|
server: t,
|
|
@@ -5367,7 +5371,7 @@ const Pc = (e) => ({
|
|
|
5367
5371
|
* will be consider external and discovered by Vite based on "entries"
|
|
5368
5372
|
* above, so we don't need to include it here.
|
|
5369
5373
|
*/
|
|
5370
|
-
include: Array.from(
|
|
5374
|
+
include: Array.from(xt).filter((E) => !E.startsWith("@arcgis")),
|
|
5371
5375
|
/**
|
|
5372
5376
|
* Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
|
|
5373
5377
|
* runtime dependencies that are defined inside the monorepo, but are also
|
|
@@ -5554,7 +5558,7 @@ const Mc = `/**
|
|
|
5554
5558
|
* If you need to provide additional typings, create a separate file.
|
|
5555
5559
|
*/
|
|
5556
5560
|
/// <reference types="@arcgis/lumina/typings" />`, Oc = `
|
|
5557
|
-
/// <reference types="@arcgis/core/interfaces" />`,
|
|
5561
|
+
/// <reference types="@arcgis/core/interfaces" />`, gn = "@arcgis/lumina:dependencySupport", _i = (e, t) => e.viteCommand === "serve" && /**
|
|
5558
5562
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5559
5563
|
* However, it is a bit buggy (see
|
|
5560
5564
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5566,10 +5570,10 @@ const Mc = `/**
|
|
|
5566
5570
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5567
5571
|
*/
|
|
5568
5572
|
e.isInStorybook && (t === void 0 || t.path === "/iframe.html"), Jc = (e) => ({
|
|
5569
|
-
name:
|
|
5573
|
+
name: gn,
|
|
5570
5574
|
configResolved() {
|
|
5571
5575
|
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Kc(e).catch(
|
|
5572
|
-
(t) => console.error(`${
|
|
5576
|
+
(t) => console.error(`${gn}: Failed to update package's src/lumina.ts`, t)
|
|
5573
5577
|
));
|
|
5574
5578
|
},
|
|
5575
5579
|
transformIndexHtml: {
|
|
@@ -5692,12 +5696,12 @@ class C {
|
|
|
5692
5696
|
webTypes: n.jetBrains === !1 ? void 0 : n.jetBrains?.webTypesFileName ? ne(n.jetBrains.webTypesFileName) : ie.webTypes,
|
|
5693
5697
|
vsCodeHtml: n.vsCode === !1 ? void 0 : n.vsCode?.htmlFileName ? ne(n.vsCode.htmlFileName) : ie.vsCodeHtml,
|
|
5694
5698
|
vsCodeCss: n.vsCode === !1 ? void 0 : n.vsCode?.cssFileName ? ne(n.vsCode.cssFileName) : ie.vsCodeCss
|
|
5695
|
-
}, Zn().catch(console.error), this.componentFilesPromise =
|
|
5699
|
+
}, Zn().catch(console.error), this.componentFilesPromise = gt(this, u.resolve("src/components")), tc(this);
|
|
5696
5700
|
const i = t.build?.preamble ?? jc();
|
|
5697
5701
|
this.banner = Dc(i);
|
|
5698
5702
|
}
|
|
5699
5703
|
_inferBuildSetup({ command: t, mode: n }, i) {
|
|
5700
|
-
this.isInTest = process.env.NODE_ENV === "test", n === "production" || n === "development" ? this.environment = n : n === "test" || n === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (console.warn(`${
|
|
5704
|
+
this.isInTest = process.env.NODE_ENV === "test", n === "production" || n === "development" ? this.environment = n : n === "test" || n === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (console.warn(`${vt}: Vite is running in unknown mode "${n}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
5701
5705
|
const s = i?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
5702
5706
|
this.isInPuppeteerTestBackEnd = r && !s, this.isInPuppeteerTestFrontEnd = r && s, n === "production" && (this._silencedRules = this.options.linting?.silence);
|
|
5703
5707
|
}
|
|
@@ -5870,45 +5874,45 @@ const _c = (e) => ({
|
|
|
5870
5874
|
if (!i.has(r))
|
|
5871
5875
|
return [];
|
|
5872
5876
|
const c = u.dirname(r), l = ce(c, e.dir.srcComponents, e), d = u.relative(e.dir.src, l), p = a.map((y) => Da(ja(e, y, r), d)).filter((y) => y !== `./${d}`).map(
|
|
5873
|
-
(y) => y.startsWith(".") ? `${y}/${
|
|
5877
|
+
(y) => y.startsWith(".") ? `${y}/${vn}` : y
|
|
5874
5878
|
), f = `${Array.from(
|
|
5875
5879
|
// Make list unique
|
|
5876
5880
|
new Set(p),
|
|
5877
5881
|
(y) => `import "${y}";
|
|
5878
5882
|
`
|
|
5879
|
-
).join("").trimStart()}export * from "./${
|
|
5883
|
+
).join("").trimStart()}export * from "./${ut}";`;
|
|
5880
5884
|
return [
|
|
5881
|
-
A(u.join(e.dir.dist, d,
|
|
5885
|
+
A(u.join(e.dir.dist, d, vn), f),
|
|
5882
5886
|
A(u.join(e.dir.dist, d, Hc), f)
|
|
5883
5887
|
];
|
|
5884
5888
|
});
|
|
5885
5889
|
await Promise.all(s);
|
|
5886
5890
|
}
|
|
5887
|
-
}),
|
|
5891
|
+
}), vn = "index.js", Hc = "index.d.ts", Hi = (e, t, n, i = /* @__PURE__ */ new Set()) => t.flatMap((s) => n.has(s) ? [s] : i.has(s) ? [] : (i.add(s), Hi(e, e[s].referencedBy, n, i))), Uc = (e) => ({
|
|
5888
5892
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5889
5893
|
configureServer(t) {
|
|
5890
|
-
e.server = t, !e.isInPuppeteerTestBackEnd &&
|
|
5894
|
+
e.server = t, !e.isInPuppeteerTestBackEnd && Sn(e).forEach(({ assets: n, transformers: i }) => ae(e, n, i));
|
|
5891
5895
|
},
|
|
5892
5896
|
async writeBundle() {
|
|
5893
5897
|
await Promise.all(
|
|
5894
|
-
|
|
5898
|
+
Sn(e).map(
|
|
5895
5899
|
async ({ assets: t, transformers: n }) => await ji(e, t, n)
|
|
5896
5900
|
)
|
|
5897
5901
|
);
|
|
5898
5902
|
}
|
|
5899
5903
|
});
|
|
5900
|
-
function
|
|
5904
|
+
function Sn(e) {
|
|
5901
5905
|
const t = [], n = e.assetsToProvide?.filter((i) => i.apply === void 0 || i.apply === e.viteCommand) ?? [];
|
|
5902
5906
|
return e.options.assets?.extra?.forEach((i) => {
|
|
5903
5907
|
"type" in i ? t.push(i) : "assets" in i && t.push(...i.assets);
|
|
5904
5908
|
}), t.length > 1 && n.push({ assets: t }), e.assetsToProvide = void 0, n;
|
|
5905
5909
|
}
|
|
5906
|
-
const
|
|
5907
|
-
name:
|
|
5910
|
+
const wn = "@arcgis/lumina:updatePackageJson", zc = (e) => ({
|
|
5911
|
+
name: wn,
|
|
5908
5912
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5909
5913
|
configResolved() {
|
|
5910
5914
|
qc(e).catch(
|
|
5911
|
-
(t) => console.error(`${
|
|
5915
|
+
(t) => console.error(`${wn}: Failed to update package's package.json`, t)
|
|
5912
5916
|
);
|
|
5913
5917
|
}
|
|
5914
5918
|
});
|
|
@@ -5996,7 +6000,7 @@ function Yc(e) {
|
|
|
5996
6000
|
complexType: t.type === void 0 ? void 0 : {
|
|
5997
6001
|
original: t.type.text,
|
|
5998
6002
|
resolved: t.type.text,
|
|
5999
|
-
references:
|
|
6003
|
+
references: Pt(t.type.references)
|
|
6000
6004
|
},
|
|
6001
6005
|
mutable: !0,
|
|
6002
6006
|
attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
|
|
@@ -6015,12 +6019,12 @@ function Yc(e) {
|
|
|
6015
6019
|
required: s
|
|
6016
6020
|
};
|
|
6017
6021
|
}
|
|
6018
|
-
const
|
|
6022
|
+
const Pt = (e) => Object.fromEntries(
|
|
6019
6023
|
e?.map(
|
|
6020
6024
|
(t) => [
|
|
6021
6025
|
t.name,
|
|
6022
6026
|
{
|
|
6023
|
-
location: t.package ===
|
|
6027
|
+
location: t.package === En ? "global" : t.package === void 0 ? "local" : "import",
|
|
6024
6028
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
6025
6029
|
id: "notImplemented"
|
|
6026
6030
|
}
|
|
@@ -6046,7 +6050,7 @@ function Zc(e) {
|
|
|
6046
6050
|
signature: t.signature ?? "()=>unknown",
|
|
6047
6051
|
parameters: i,
|
|
6048
6052
|
return: t.return?.type?.text ?? "void",
|
|
6049
|
-
references:
|
|
6053
|
+
references: Pt([
|
|
6050
6054
|
...t.return?.type?.references ?? [],
|
|
6051
6055
|
...t.parameters?.flatMap((s) => s.type.references ?? []) ?? []
|
|
6052
6056
|
])
|
|
@@ -6067,7 +6071,7 @@ function el(e) {
|
|
|
6067
6071
|
complexType: {
|
|
6068
6072
|
original: e.type.text,
|
|
6069
6073
|
resolved: e.type.text,
|
|
6070
|
-
references:
|
|
6074
|
+
references: Pt(e.type.references)
|
|
6071
6075
|
},
|
|
6072
6076
|
cancelable: e.cancelable ?? !0,
|
|
6073
6077
|
composed: e.composed ?? !0,
|
|
@@ -6157,16 +6161,16 @@ const ll = (e) => e.map((t) => ({
|
|
|
6157
6161
|
name: n.name,
|
|
6158
6162
|
description: n.description
|
|
6159
6163
|
})),
|
|
6160
|
-
events:
|
|
6164
|
+
events: bn(t),
|
|
6161
6165
|
js: {
|
|
6162
6166
|
properties: dl(t),
|
|
6163
|
-
events:
|
|
6167
|
+
events: bn(t)
|
|
6164
6168
|
}
|
|
6165
6169
|
})), dl = (e) => e.members.filter(ts).map((t) => ({
|
|
6166
6170
|
name: t.name,
|
|
6167
6171
|
description: t.description,
|
|
6168
6172
|
type: t.type?.text
|
|
6169
|
-
})) ?? [],
|
|
6173
|
+
})) ?? [], bn = (e) => e.events?.map((t) => ({
|
|
6170
6174
|
name: t.name,
|
|
6171
6175
|
type: t.type?.text,
|
|
6172
6176
|
description: t.description
|
|
@@ -6520,8 +6524,8 @@ const Vl = {
|
|
|
6520
6524
|
propertyToAttributeMappings: O,
|
|
6521
6525
|
findDeclaredComponents: kn,
|
|
6522
6526
|
nativeEvents: di,
|
|
6523
|
-
svgElements:
|
|
6524
|
-
mathMlElements:
|
|
6527
|
+
svgElements: bt,
|
|
6528
|
+
mathMlElements: Tt,
|
|
6525
6529
|
alwaysAttributes: ai,
|
|
6526
6530
|
nativeAlwaysAttributes: ci,
|
|
6527
6531
|
htmlAlwaysAttributes: lt,
|