@arcgis/lumina-compiler 4.33.0-next.94 → 4.33.0-next.96
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 +559 -557
- package/dist/testing/index.js +73 -109
- package/dist/testing/wrapController.d.ts +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { nodeExternals as
|
|
2
|
-
import { stringToStartsWithGlob as Ft, path as u, toSystemPathSeparators as k, retrievePackageJson as R, getCwd as
|
|
3
|
-
import
|
|
1
|
+
import { nodeExternals as Qn } from "rollup-plugin-node-externals";
|
|
2
|
+
import { stringToStartsWithGlob as Ft, path as u, toSystemPathSeparators as k, retrievePackageJson as R, getCwd as Ae, fetchPackageLocation as Me, asyncRetrievePackageJson as Oe, existsAsync as W, findPath as Yn, toPosixPathSeparators as $e, isPosix as $i } from "@arcgis/components-build-utils";
|
|
3
|
+
import Zn from "vite-plugin-dts";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { getMemberName as
|
|
6
|
-
import { isNotUndefined as j, mappedFind as Y, camelToKebab as mt, kebabToPascal as
|
|
7
|
-
import { readdir as
|
|
8
|
-
import { lazyMetaSubItemJoiner as
|
|
9
|
-
import { build as
|
|
10
|
-
import { glob as
|
|
11
|
-
import
|
|
5
|
+
import { getMemberName as z, globalPackageIdentifier as xi, ApiExtractor as es, hasIgnoredModifier as ts, setDefaultFromInitializer as jt, isApiMethod as is, isApiProperty as ns } from "@arcgis/api-extractor";
|
|
6
|
+
import { isNotUndefined as j, mappedFind as Y, camelToKebab as mt, kebabToPascal as ss, uncapitalize as ot, identity as Pi, Deferred as rs, getPreamble as os, capitalize as as } from "@arcgis/components-utils";
|
|
7
|
+
import { readdir as Je, readFile as D, rm as cs, mkdir as _, cp as ls, writeFile as L, copyFile as ds } from "node:fs/promises";
|
|
8
|
+
import { lazyMetaSubItemJoiner as ps, lazyMetaItemJoiner as Ve, lazyMetaGroupJoiner as us, PropertyFlags as K } from "@arcgis/lumina/config";
|
|
9
|
+
import { build as ms } from "esbuild";
|
|
10
|
+
import { glob as fs } from "glob";
|
|
11
|
+
import ys from "mime-types";
|
|
12
12
|
import { writeFileSync as Ii } from "node:fs";
|
|
13
|
-
import
|
|
13
|
+
import Ai from "chalk";
|
|
14
14
|
function hs(e) {
|
|
15
15
|
const { externalize: t = [], bundleIn: i = [], ...n } = e.options?.build?.dependencies ?? {}, r = {
|
|
16
|
-
...
|
|
16
|
+
...Qn({
|
|
17
17
|
...n,
|
|
18
18
|
/*
|
|
19
19
|
* This property name is a bit confusing. "include" means "externalize these"
|
|
@@ -35,7 +35,7 @@ function hs(e) {
|
|
|
35
35
|
};
|
|
36
36
|
return r;
|
|
37
37
|
}
|
|
38
|
-
const ft = "customElement.js",
|
|
38
|
+
const ft = "customElement.js", ki = "customElement.d.ts", gs = "playwright";
|
|
39
39
|
function vs(e, t, i) {
|
|
40
40
|
const s = i.split(u.sep).slice(2);
|
|
41
41
|
let r = t._componentPathMapping;
|
|
@@ -62,7 +62,7 @@ function ws(e, t) {
|
|
|
62
62
|
return e;
|
|
63
63
|
}
|
|
64
64
|
const Ss = ({ filePath: e, content: t }, i) => {
|
|
65
|
-
const n = e.startsWith(i.dir.distComponents) ? de(
|
|
65
|
+
const n = e.startsWith(i.dir.distComponents) ? de(Li(e), i.dir.distComponents, i) : e, s = u.dirname(e), r = n.endsWith(ki), a = Fi(
|
|
66
66
|
t,
|
|
67
67
|
i,
|
|
68
68
|
e === n ? s : u.dirname(n),
|
|
@@ -73,18 +73,18 @@ const Ss = ({ filePath: e, content: t }, i) => {
|
|
|
73
73
|
content: c
|
|
74
74
|
};
|
|
75
75
|
};
|
|
76
|
-
function
|
|
76
|
+
function Li(e, t = ".d.ts") {
|
|
77
77
|
const n = (t === "" ? e : e.slice(0, -t.length)).split(u.sep);
|
|
78
78
|
return n.at(bs) !== n.at(Ts) ? e : u.join(
|
|
79
79
|
n.slice(0, -1).join(u.sep),
|
|
80
|
-
t === "" ? ft :
|
|
80
|
+
t === "" ? ft : ki
|
|
81
81
|
);
|
|
82
82
|
}
|
|
83
|
-
const bs = -1, Ts = -2, Es = /["']\.\.?\/[^'"]+/gu,
|
|
83
|
+
const bs = -1, Ts = -2, Es = /["']\.\.?\/[^'"]+/gu, Fi = (e, t, i, n) => e.replaceAll(Es, (s) => {
|
|
84
84
|
const r = s.slice(1);
|
|
85
85
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
86
86
|
return s;
|
|
87
|
-
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
87
|
+
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Li(a, "") : a, l = de(c, t.dir.distComponents, t);
|
|
88
88
|
if (i === n && a === l)
|
|
89
89
|
return s;
|
|
90
90
|
const d = ee(i, l);
|
|
@@ -101,7 +101,7 @@ const Nt = "customElement", $s = (e, t) => {
|
|
|
101
101
|
const { filePath: i, content: n } = e;
|
|
102
102
|
if (!i.startsWith(t.dir.distComponents))
|
|
103
103
|
return e;
|
|
104
|
-
const s =
|
|
104
|
+
const s = Ni(n);
|
|
105
105
|
if (s === void 0)
|
|
106
106
|
return e;
|
|
107
107
|
{
|
|
@@ -140,12 +140,12 @@ const Nt = "customElement", $s = (e, t) => {
|
|
|
140
140
|
o.factory.createStringLiteral(n)
|
|
141
141
|
), ...e.statements, ...i];
|
|
142
142
|
};
|
|
143
|
-
function
|
|
144
|
-
const t =
|
|
143
|
+
function ji(e) {
|
|
144
|
+
const t = Ni(e);
|
|
145
145
|
return t === void 0 ? void 0 : t.split(`
|
|
146
146
|
`).filter((n) => n.includes(":")).map((n) => n.replace(";", "").replaceAll('"', "").replaceAll("'", "").split(":")).map(([n, s]) => [n.trim(), s.trim()]).filter(([n]) => !n.startsWith("/") && !n.startsWith("*"));
|
|
147
147
|
}
|
|
148
|
-
function
|
|
148
|
+
function Ni(e) {
|
|
149
149
|
const t = e.indexOf("declare global {");
|
|
150
150
|
if (t === -1)
|
|
151
151
|
return;
|
|
@@ -201,14 +201,14 @@ ${e.content}`
|
|
|
201
201
|
};
|
|
202
202
|
};
|
|
203
203
|
function Ns(e, t) {
|
|
204
|
-
const i =
|
|
204
|
+
const i = z(t.name);
|
|
205
205
|
return e.members.find((n) => n.name === i);
|
|
206
206
|
}
|
|
207
207
|
function Ds(e, t, i) {
|
|
208
208
|
const n = u.relative(t, e);
|
|
209
209
|
return i.modules.find((s) => s.path === n);
|
|
210
210
|
}
|
|
211
|
-
function
|
|
211
|
+
function Di(e, t, i, n) {
|
|
212
212
|
const s = {
|
|
213
213
|
compiler: e,
|
|
214
214
|
apiModule: e.isInPuppeteerTestBackEnd ? void 0 : Ds(i.fileName, e.dir.root, e.privateApiJson),
|
|
@@ -238,7 +238,7 @@ const Rs = (e, t) => o.factory.updateSourceFile(
|
|
|
238
238
|
e.typeReferenceDirectives,
|
|
239
239
|
e.hasNoDefaultLib,
|
|
240
240
|
e.libReferenceDirectives
|
|
241
|
-
), Ms = (e) => `${Rt}${" ".repeat(e.length - Rt.length - Mt.length)}${Mt}`, Rt = "/*", Mt = "*/", Os = (e) => e.statements.map(Ws), Js = "@arcgis/lumina", Ks = "LitElement", Bs = "PublicLitElement",
|
|
241
|
+
), Ms = (e) => `${Rt}${" ".repeat(e.length - Rt.length - Mt.length)}${Mt}`, Rt = "/*", Mt = "*/", Os = (e) => e.statements.map(Ws), Js = "@arcgis/lumina", Ks = "LitElement", Bs = "PublicLitElement", Ri = "TargetedEvent";
|
|
242
242
|
function Ws(e) {
|
|
243
243
|
if (o.isImportDeclaration(e) && o.isStringLiteral(e.moduleSpecifier) && e.moduleSpecifier.text === Js && e.importClause?.namedBindings && o.isNamedImports(e.importClause.namedBindings)) {
|
|
244
244
|
const t = e.importClause.namedBindings.elements.findIndex(
|
|
@@ -266,7 +266,7 @@ function Ws(e) {
|
|
|
266
266
|
o.factory.createImportSpecifier(
|
|
267
267
|
!e.importClause.isTypeOnly,
|
|
268
268
|
void 0,
|
|
269
|
-
o.factory.createIdentifier(
|
|
269
|
+
o.factory.createIdentifier(Ri)
|
|
270
270
|
)
|
|
271
271
|
])
|
|
272
272
|
),
|
|
@@ -276,11 +276,11 @@ function Ws(e) {
|
|
|
276
276
|
} else
|
|
277
277
|
return e;
|
|
278
278
|
}
|
|
279
|
-
const
|
|
279
|
+
const Mi = "_setterTypes";
|
|
280
280
|
function _s(e, t, i) {
|
|
281
281
|
return o.factory.createPropertyDeclaration(
|
|
282
282
|
[o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword)],
|
|
283
|
-
o.factory.createIdentifier(
|
|
283
|
+
o.factory.createIdentifier(Mi),
|
|
284
284
|
void 0,
|
|
285
285
|
o.factory.createTypeLiteralNode(
|
|
286
286
|
e.map((n) => {
|
|
@@ -306,7 +306,7 @@ function Hs(e, t, i, n) {
|
|
|
306
306
|
).statements[0].members[0];
|
|
307
307
|
return [d.name, d.type];
|
|
308
308
|
}
|
|
309
|
-
const Us = "Fragment", Xe = "DynamicHtmlTag", Qe = "DynamicSvgTag",
|
|
309
|
+
const Us = "Fragment", Xe = "DynamicHtmlTag", Qe = "DynamicSvgTag", ke = Symbol("dynamic html tag name"), at = Symbol("dynamic svg tag name"), Oi = /* @__PURE__ */ new Set([
|
|
310
310
|
/**
|
|
311
311
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
312
312
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -327,7 +327,7 @@ const Us = "Fragment", Xe = "DynamicHtmlTag", Qe = "DynamicSvgTag", Le = Symbol(
|
|
|
327
327
|
"resource",
|
|
328
328
|
"typeof",
|
|
329
329
|
"vocab"
|
|
330
|
-
]),
|
|
330
|
+
]), Ji = /* @__PURE__ */ new Set([
|
|
331
331
|
/*
|
|
332
332
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
333
333
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -354,7 +354,7 @@ const Us = "Fragment", Xe = "DynamicHtmlTag", Qe = "DynamicSvgTag", Le = Symbol(
|
|
|
354
354
|
meta: /* @__PURE__ */ new Set(["charset"]),
|
|
355
355
|
math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
|
|
356
356
|
menu: /* @__PURE__ */ new Set(["label", "type"])
|
|
357
|
-
},
|
|
357
|
+
}, J = {
|
|
358
358
|
common: {
|
|
359
359
|
reflected: {
|
|
360
360
|
hidden: "hidden",
|
|
@@ -1167,9 +1167,9 @@ const Us = "Fragment", Xe = "DynamicHtmlTag", Qe = "DynamicSvgTag", Le = Symbol(
|
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
1169
|
};
|
|
1170
|
-
|
|
1171
|
-
Object.values(
|
|
1172
|
-
function
|
|
1170
|
+
Ki(J.common);
|
|
1171
|
+
Object.values(J.perElement).forEach(Ki);
|
|
1172
|
+
function Ki(e) {
|
|
1173
1173
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
1174
1174
|
/* @__PURE__ */ Object.create(null),
|
|
1175
1175
|
e.stringifiedReflected
|
|
@@ -1178,7 +1178,7 @@ function Ji(e) {
|
|
|
1178
1178
|
e.stringifiedNonReflected
|
|
1179
1179
|
));
|
|
1180
1180
|
}
|
|
1181
|
-
const Ot = /* @__PURE__ */ new Set(["itemScope"]),
|
|
1181
|
+
const Ot = /* @__PURE__ */ new Set(["itemScope"]), Bi = /* @__PURE__ */ new Set([
|
|
1182
1182
|
"abort",
|
|
1183
1183
|
"animationCancel",
|
|
1184
1184
|
"animationEnd",
|
|
@@ -1416,7 +1416,7 @@ const Ot = /* @__PURE__ */ new Set(["itemScope"]), Ki = /* @__PURE__ */ new Set(
|
|
|
1416
1416
|
// special case for CRLFs in backticks
|
|
1417
1417
|
})
|
|
1418
1418
|
);
|
|
1419
|
-
function
|
|
1419
|
+
function Wi(e) {
|
|
1420
1420
|
return `\\u${`0000${e.toString(Qs).toUpperCase()}`.slice(-4)}`;
|
|
1421
1421
|
}
|
|
1422
1422
|
const Qs = 16;
|
|
@@ -1425,11 +1425,11 @@ function Ys(e, t, i) {
|
|
|
1425
1425
|
const n = i.charCodeAt(t + e.length);
|
|
1426
1426
|
return n >= nr && n <= sr ? "\\x00" : "\\0";
|
|
1427
1427
|
}
|
|
1428
|
-
return Xs.get(e) ||
|
|
1428
|
+
return Xs.get(e) || Wi(e.charCodeAt(0));
|
|
1429
1429
|
}
|
|
1430
1430
|
const Zs = (e) => e.replace(Vs, Ys), Jt = /[^\u0000-\u007F]/g;
|
|
1431
1431
|
function er(e) {
|
|
1432
|
-
return e = Zs(e), Jt.test(e) ? e.replace(Jt, (t) =>
|
|
1432
|
+
return e = Zs(e), Jt.test(e) ? e.replace(Jt, (t) => Wi(t.charCodeAt(0))) : e;
|
|
1433
1433
|
}
|
|
1434
1434
|
const tr = er, ir = 0, nr = 48, sr = 57, rr = /\$\{/gu, or = (e) => e.replace(rr, "\\${");
|
|
1435
1435
|
function ar(e) {
|
|
@@ -1445,11 +1445,11 @@ function ar(e) {
|
|
|
1445
1445
|
}
|
|
1446
1446
|
return e.trim().length === 0 ? t : e;
|
|
1447
1447
|
}
|
|
1448
|
-
const
|
|
1448
|
+
const Ke = (e) => or(tr(e)), cr = (e) => !lr.test(e), lr = /^[^\s"'=<>`]+$/u, dr = /[&<>]/gu, pr = {
|
|
1449
1449
|
"&": "&",
|
|
1450
1450
|
"<": "<",
|
|
1451
1451
|
">": ">"
|
|
1452
|
-
},
|
|
1452
|
+
}, _i = (e) => e.replace(dr, (t) => pr[t]), vt = (e) => typeof e == "string" && e.includes("-") && !Gs.has(e), wt = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
1453
1453
|
function St(e, t) {
|
|
1454
1454
|
const i = bt(e);
|
|
1455
1455
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
@@ -1458,7 +1458,7 @@ function St(e, t) {
|
|
|
1458
1458
|
...n,
|
|
1459
1459
|
pos: -1,
|
|
1460
1460
|
end: -1,
|
|
1461
|
-
text:
|
|
1461
|
+
text: Hi(e.slice(n.pos, n.end))
|
|
1462
1462
|
}))
|
|
1463
1463
|
);
|
|
1464
1464
|
}
|
|
@@ -1469,8 +1469,8 @@ function ur(e) {
|
|
|
1469
1469
|
return [e || " "];
|
|
1470
1470
|
const i = t.reduceRight(
|
|
1471
1471
|
([s, ...r], a) => {
|
|
1472
|
-
const c =
|
|
1473
|
-
|
|
1472
|
+
const c = Ke(
|
|
1473
|
+
Hi(Ye(s).slice(a.pos, a.end))
|
|
1474
1474
|
);
|
|
1475
1475
|
return [
|
|
1476
1476
|
Ye(s).slice(0, a.pos),
|
|
@@ -1489,7 +1489,7 @@ function ur(e) {
|
|
|
1489
1489
|
const n = i.at(-1);
|
|
1490
1490
|
return (typeof n != "string" || n.trim() !== "") && i.push(" "), i;
|
|
1491
1491
|
}
|
|
1492
|
-
const
|
|
1492
|
+
const Hi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
1493
1493
|
function Ye(e) {
|
|
1494
1494
|
if (typeof e == "string")
|
|
1495
1495
|
return e;
|
|
@@ -1509,7 +1509,7 @@ function fr(e, t, i) {
|
|
|
1509
1509
|
f === void 0 ? a.push(m) : Array.isArray(f) ? d.push(...f) : d.push(f);
|
|
1510
1510
|
}
|
|
1511
1511
|
return c.size > 0 && a.forEach((p) => {
|
|
1512
|
-
const m =
|
|
1512
|
+
const m = z(p.name);
|
|
1513
1513
|
m !== void 0 && c.has(m) && d.push(gr(p));
|
|
1514
1514
|
}), l.length > 0 && d.push(_s(l, t, i.compiler)), o.factory.updateClassDeclaration(
|
|
1515
1515
|
n,
|
|
@@ -1527,7 +1527,7 @@ function fr(e, t, i) {
|
|
|
1527
1527
|
return e;
|
|
1528
1528
|
}
|
|
1529
1529
|
function yr(e, t, i, n, s) {
|
|
1530
|
-
const r =
|
|
1530
|
+
const r = z(e.name);
|
|
1531
1531
|
if (r === void 0)
|
|
1532
1532
|
return;
|
|
1533
1533
|
const a = t.members.find((c) => c.name === r);
|
|
@@ -1679,7 +1679,7 @@ function vr(e, t) {
|
|
|
1679
1679
|
if (e === void 0)
|
|
1680
1680
|
return;
|
|
1681
1681
|
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;
|
|
1682
|
-
return typeof i == "object" ? o.factory.createTypeReferenceNode(
|
|
1682
|
+
return typeof i == "object" ? o.factory.createTypeReferenceNode(Ri, [
|
|
1683
1683
|
o.factory.createThisTypeNode(),
|
|
1684
1684
|
...i
|
|
1685
1685
|
]) : (console.warn(
|
|
@@ -1728,7 +1728,7 @@ function Tr(e) {
|
|
|
1728
1728
|
}
|
|
1729
1729
|
};
|
|
1730
1730
|
}
|
|
1731
|
-
const Er = (e) => (t) => (i) =>
|
|
1731
|
+
const Er = (e) => (t) => (i) => Di(e, t, i, [
|
|
1732
1732
|
...br,
|
|
1733
1733
|
...e.options.types?.declarationAstTransformers ?? []
|
|
1734
1734
|
]), Cr = (e) => new Proxy(e, {
|
|
@@ -1750,7 +1750,7 @@ function Pr(e) {
|
|
|
1750
1750
|
...t?.compilerOptions,
|
|
1751
1751
|
// See comment above excludeOutsideFiles in ./textTransformers.ts for details
|
|
1752
1752
|
rootDir: "."
|
|
1753
|
-
}, s =
|
|
1753
|
+
}, s = Zn({
|
|
1754
1754
|
...t,
|
|
1755
1755
|
compilerOptions: n,
|
|
1756
1756
|
tsconfigPath: e.options.types?.tsconfigPath,
|
|
@@ -1819,8 +1819,8 @@ function Pr(e) {
|
|
|
1819
1819
|
};
|
|
1820
1820
|
}
|
|
1821
1821
|
const Ir = async (e) => Object.fromEntries(
|
|
1822
|
-
(await e.componentFilesPromise).map((t) => [
|
|
1823
|
-
),
|
|
1822
|
+
(await e.componentFilesPromise).map((t) => [Ui(t), t])
|
|
1823
|
+
), Ui = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ft.slice(0, -3))), Tt = async (e, t, i = t) => await Je(i, { recursive: !0 }).catch((n) => {
|
|
1824
1824
|
if (String(n).includes("ENOENT"))
|
|
1825
1825
|
return console.error(`@arcgis/lumina: Unable to find the ${i} directory (cwd: ${process.cwd()})`), [];
|
|
1826
1826
|
throw n;
|
|
@@ -1839,11 +1839,11 @@ function pe(e, t) {
|
|
|
1839
1839
|
const [i, n] = e.slice(0, -4).split(u.sep).slice(Ar);
|
|
1840
1840
|
return i === n;
|
|
1841
1841
|
}
|
|
1842
|
-
const Ar = -2, _t = 5, Ht = 1, Ut = 1, zt = 3, qt = 4,
|
|
1843
|
-
kr(
|
|
1844
|
-
Lr(
|
|
1845
|
-
Fr(
|
|
1846
|
-
const ae =
|
|
1842
|
+
const Ar = -2, _t = 5, Ht = 1, Ut = 1, zt = 3, qt = 4, Be = o;
|
|
1843
|
+
kr(Be.createSourceMapGenerator);
|
|
1844
|
+
Lr(Be.createTextWriter);
|
|
1845
|
+
Fr(Be.getNewLineCharacter);
|
|
1846
|
+
const ae = Be;
|
|
1847
1847
|
function kr(e) {
|
|
1848
1848
|
if (typeof e != "function")
|
|
1849
1849
|
throw new Error(
|
|
@@ -1894,7 +1894,7 @@ function Nr(e) {
|
|
|
1894
1894
|
`ts.Printer.writeNode() signature changed. Expected ${qt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
1895
1895
|
);
|
|
1896
1896
|
}
|
|
1897
|
-
function
|
|
1897
|
+
function zi(e) {
|
|
1898
1898
|
const t = ae.createPrinter(e);
|
|
1899
1899
|
return jr(t.writeFile), Nr(t.writeNode), t;
|
|
1900
1900
|
}
|
|
@@ -1911,7 +1911,7 @@ const Dr = 40, Rr = (e) => e?.some(
|
|
|
1911
1911
|
* behavior.
|
|
1912
1912
|
*/
|
|
1913
1913
|
t.type === "any"
|
|
1914
|
-
) ?? !1, Mr = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e,
|
|
1914
|
+
) ?? !1, Mr = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e, qi = (e) => e.map(Gi).join(" | "), Gi = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
|
|
1915
1915
|
function Or(e) {
|
|
1916
1916
|
return e === "boolean" ? { type: "boolean" } : Number.isNaN(Number.parseFloat(e)) ? e.startsWith('"') || e.startsWith("'") ? {
|
|
1917
1917
|
value: e.slice(1, -1),
|
|
@@ -1925,7 +1925,7 @@ function Or(e) {
|
|
|
1925
1925
|
}
|
|
1926
1926
|
const Jr = (e, t, i, n) => {
|
|
1927
1927
|
const s = e.typeScriptTypeChecker, r = o.isSetAccessor(t) ? t.parameters[0] : t, a = s.getTypeAtLocation(r), c = !i;
|
|
1928
|
-
return
|
|
1928
|
+
return Le(s, a, n, e.dir, c);
|
|
1929
1929
|
};
|
|
1930
1930
|
function Kr(e, t) {
|
|
1931
1931
|
if (e.length === 0)
|
|
@@ -1938,10 +1938,10 @@ function Kr(e, t) {
|
|
|
1938
1938
|
return n.length === 0 ? void 0 : n;
|
|
1939
1939
|
}
|
|
1940
1940
|
const Br = /"[^"]+"|'[^"]+'|\w+/gu;
|
|
1941
|
-
function
|
|
1941
|
+
function Le(e, t, i, n, s = !1) {
|
|
1942
1942
|
let { typeNode: r, references: a } = Qt(e, t, i, n), c = Gt(r);
|
|
1943
1943
|
c === void 0 && ({ typeNode: r, references: a } = Qt(e, t, i, n, !1), c = Gt(r) ?? []);
|
|
1944
|
-
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d =
|
|
1944
|
+
const l = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, d = qi(l), p = Mr(l), m = Kr(a, d);
|
|
1945
1945
|
return {
|
|
1946
1946
|
text: d,
|
|
1947
1947
|
references: m,
|
|
@@ -1953,8 +1953,8 @@ function Vt(e) {
|
|
|
1953
1953
|
const t = Ze.getText();
|
|
1954
1954
|
return Ze.clear(), t;
|
|
1955
1955
|
}
|
|
1956
|
-
const Wr =
|
|
1957
|
-
`),
|
|
1956
|
+
const Wr = zi({ removeComments: !0 }), Ze = ae.createTextWriter(`
|
|
1957
|
+
`), Vi = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, _r = Vi & o.TypeFormatFlags.NodeBuilderFlagsMask, Hr = _r | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
1958
1958
|
function Ur(e, t, i, n = !0) {
|
|
1959
1959
|
const s = /* @__PURE__ */ new Map();
|
|
1960
1960
|
X(t, s, i, n);
|
|
@@ -1980,8 +1980,8 @@ function Qt(e, t, i, n, s = !0) {
|
|
|
1980
1980
|
if (v.parameters.forEach((g) => {
|
|
1981
1981
|
if (g.type === void 0)
|
|
1982
1982
|
return;
|
|
1983
|
-
const
|
|
1984
|
-
X(
|
|
1983
|
+
const S = e.getTypeFromTypeNode(g.type);
|
|
1984
|
+
X(S, /* @__PURE__ */ new Map(), c, !1);
|
|
1985
1985
|
}), v.type !== void 0) {
|
|
1986
1986
|
const g = e.getTypeFromTypeNode(v.type);
|
|
1987
1987
|
X(g, /* @__PURE__ */ new Map(), c, !1);
|
|
@@ -2066,7 +2066,7 @@ function Gr(e, t) {
|
|
|
2066
2066
|
const i = e.split("/node_modules/");
|
|
2067
2067
|
if (i.length > 1) {
|
|
2068
2068
|
const a = i.at(-1);
|
|
2069
|
-
return
|
|
2069
|
+
return Xi(a);
|
|
2070
2070
|
}
|
|
2071
2071
|
const s = e.split("/dist/");
|
|
2072
2072
|
if (s.length > 1) {
|
|
@@ -2079,10 +2079,10 @@ function Gr(e, t) {
|
|
|
2079
2079
|
};
|
|
2080
2080
|
}
|
|
2081
2081
|
function Vr(e, t) {
|
|
2082
|
-
return pe(e, t.srcComponents) ? u.join(t.dist,
|
|
2082
|
+
return pe(e, t.srcComponents) ? u.join(t.dist, Ui(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2083
2083
|
}
|
|
2084
2084
|
const Xr = (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`;
|
|
2085
|
-
function
|
|
2085
|
+
function Xi(e) {
|
|
2086
2086
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2087
2087
|
return { packageName: s, moduleName: r };
|
|
2088
2088
|
}
|
|
@@ -2133,7 +2133,7 @@ function Zr(e) {
|
|
|
2133
2133
|
}
|
|
2134
2134
|
return t.length === 0 ? void 0 : t;
|
|
2135
2135
|
}
|
|
2136
|
-
const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\*? ?/gu, io = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"],
|
|
2136
|
+
const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\*? ?/gu, io = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], Fe = new RegExp(`\\.(${io.join("|")})(\\?|$)`, "u"), no = /^import ["'](?<specifier>[^"']+)["'];$/gmu, so = () => "throwError", ei = "@arcgis/lumina:loadLitCss", q = "?layered", xe = "?global", ro = (e) => ({
|
|
2137
2137
|
name: ei,
|
|
2138
2138
|
enforce: "pre",
|
|
2139
2139
|
configResolved(t) {
|
|
@@ -2144,18 +2144,18 @@ const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\
|
|
|
2144
2144
|
if (typeof n != "function")
|
|
2145
2145
|
throw new Error("Expected vite:css-post to declare a transform() function");
|
|
2146
2146
|
i.transform = async function(r, a) {
|
|
2147
|
-
const c = a.endsWith(
|
|
2148
|
-
c && (a = a.slice(0, -
|
|
2149
|
-
const l = a.endsWith(
|
|
2150
|
-
if (l && (a = a.slice(0, -
|
|
2147
|
+
const c = a.endsWith(q);
|
|
2148
|
+
c && (a = a.slice(0, -q.length));
|
|
2149
|
+
const l = a.endsWith(xe);
|
|
2150
|
+
if (l && (a = a.slice(0, -xe.length)), !Fe.test(a) || a.includes("?"))
|
|
2151
2151
|
return await n.call(this, r, a);
|
|
2152
2152
|
const d = `${a}?inline`, p = await n.call(this, r, d), { code: m, ...f } = typeof p == "string" ? { code: p } : p ?? {};
|
|
2153
|
-
if (typeof m != "string" || !m.startsWith(
|
|
2153
|
+
if (typeof m != "string" || !m.startsWith(Qi) || !m.endsWith(Yi))
|
|
2154
2154
|
return console.warn(
|
|
2155
2155
|
`${ei} Expected vite:css-post to return a JS module with a string literal for ${k(a)}.`
|
|
2156
2156
|
), console.log(p), p;
|
|
2157
2157
|
if (l)
|
|
2158
|
-
return e._globalCssString =
|
|
2158
|
+
return e._globalCssString = Zi(m), { code: "", map: { mappings: "" } };
|
|
2159
2159
|
{
|
|
2160
2160
|
const y = e.isFullApiExtraction ? Zr(r) : void 0;
|
|
2161
2161
|
if (y !== void 0) {
|
|
@@ -2167,10 +2167,10 @@ const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\
|
|
|
2167
2167
|
if (v.cssProperties === void 0)
|
|
2168
2168
|
v.cssProperties = Array.from(y);
|
|
2169
2169
|
else {
|
|
2170
|
-
const g = new Set(v.cssProperties.map((
|
|
2170
|
+
const g = new Set(v.cssProperties.map((S) => S.name));
|
|
2171
2171
|
v.cssProperties = [
|
|
2172
2172
|
...v.cssProperties,
|
|
2173
|
-
...y.filter((
|
|
2173
|
+
...y.filter((S) => !g.has(S.name))
|
|
2174
2174
|
];
|
|
2175
2175
|
}
|
|
2176
2176
|
}
|
|
@@ -2194,13 +2194,13 @@ const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\
|
|
|
2194
2194
|
const r = Qr(i);
|
|
2195
2195
|
let a = !1;
|
|
2196
2196
|
const c = t.replaceAll(no, (l, d) => {
|
|
2197
|
-
if (!
|
|
2197
|
+
if (!Fe.test(d) || d.includes("?"))
|
|
2198
2198
|
return l;
|
|
2199
2199
|
if (r) {
|
|
2200
2200
|
if ((e.options.css?.sideEffectImportHandling ?? so)(d, i) === "drop")
|
|
2201
2201
|
return a = !0, Ms(l);
|
|
2202
2202
|
{
|
|
2203
|
-
const f = k(u.relative(
|
|
2203
|
+
const f = k(u.relative(Ae(), i));
|
|
2204
2204
|
throw new Error(
|
|
2205
2205
|
`Found a side-effect CSS import \`${l}\` in "${f}". Such import is not allowed as it won't work with shadow DOM. This file appears to be external so such import may not be under your control. To ignore this import, please set the css.sideEffectImportHandling property in useLumina() plugin to a function that will return "drop" for this import to indicate that you wish to have this style import dropped. Then, you would have to import the dropped manually in your component like so: \`import { styles } from "example.css";\` and then add \`static override styles = styles;\` to your component`
|
|
2206
2206
|
);
|
|
@@ -2220,10 +2220,10 @@ const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\
|
|
|
2220
2220
|
".styleSheet];"
|
|
2221
2221
|
].join("");
|
|
2222
2222
|
} else {
|
|
2223
|
-
if (d.endsWith(
|
|
2223
|
+
if (d.endsWith(xe))
|
|
2224
2224
|
return l;
|
|
2225
2225
|
{
|
|
2226
|
-
const p = k(u.relative(
|
|
2226
|
+
const p = k(u.relative(Ae(), i));
|
|
2227
2227
|
throw new Error(
|
|
2228
2228
|
`Found a side-effect CSS import \`${l}\` in "${p}". Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "example.css";\` instead and then add \`static override styles = styles;\` to your component`
|
|
2229
2229
|
);
|
|
@@ -2235,7 +2235,7 @@ const eo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, to = /\n\s+\
|
|
|
2235
2235
|
map: null
|
|
2236
2236
|
} : void 0;
|
|
2237
2237
|
}
|
|
2238
|
-
}),
|
|
2238
|
+
}), Qi = 'export default "', Yi = '"', oo = "import { css } from '@lit/reactive-element/css-tag.js';\nexport const styles = css`", ao = "`;\nexport default styles;", co = `
|
|
2239
2239
|
|
|
2240
2240
|
if(import.meta.hot) {
|
|
2241
2241
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -2246,9 +2246,9 @@ if(import.meta.hot) {
|
|
|
2246
2246
|
}
|
|
2247
2247
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
2248
2248
|
});
|
|
2249
|
-
}`,
|
|
2249
|
+
}`, Zi = (e) => e.slice(Qi.length, -Yi.length);
|
|
2250
2250
|
function lo(e, t, i, n) {
|
|
2251
|
-
const r =
|
|
2251
|
+
const r = Zi(e).replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("\\r", ""), a = Ke(po(r)), c = n ? `@layer{${i ? "" : `
|
|
2252
2252
|
`}${a}${i ? "" : `
|
|
2253
2253
|
`}}` : a;
|
|
2254
2254
|
return `${oo}${c}${ao}${t ? co : ""}`;
|
|
@@ -2271,23 +2271,23 @@ function ho(e) {
|
|
|
2271
2271
|
return "";
|
|
2272
2272
|
const i = ee(e.dir.src, t);
|
|
2273
2273
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
2274
|
-
`import globalStyles from "${i}${
|
|
2274
|
+
`import globalStyles from "${i}${q}";`,
|
|
2275
2275
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
2276
|
-
|
|
2276
|
+
tn("", e)
|
|
2277
2277
|
].join(`
|
|
2278
|
-
`) : `import "${i}${
|
|
2278
|
+
`) : `import "${i}${xe}";`;
|
|
2279
2279
|
}
|
|
2280
|
-
const
|
|
2280
|
+
const en = "hydrated";
|
|
2281
2281
|
function go(e) {
|
|
2282
2282
|
e._globalHydratedCssString = [
|
|
2283
2283
|
":not([",
|
|
2284
|
-
e.options.css?.hydratedAttribute ??
|
|
2284
|
+
e.options.css?.hydratedAttribute ?? en,
|
|
2285
2285
|
"]):is(",
|
|
2286
2286
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
2287
2287
|
"){visibility:hidden}"
|
|
2288
2288
|
].join("");
|
|
2289
2289
|
}
|
|
2290
|
-
function
|
|
2290
|
+
function tn(e, t) {
|
|
2291
2291
|
return [
|
|
2292
2292
|
"const globalCss = new CSSStyleSheet();",
|
|
2293
2293
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e || ""}`}}");`,
|
|
@@ -2332,10 +2332,10 @@ export declare const defineCustomElements: import("@arcgis/lumina").DefineCustom
|
|
|
2332
2332
|
"]"
|
|
2333
2333
|
].join("");
|
|
2334
2334
|
function To(e) {
|
|
2335
|
-
const { properties: t, asyncMethods: i, syncMethods: n } =
|
|
2336
|
-
return d.length > 0 ? `"${d.join(
|
|
2335
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = nn(e), s = t.map((p) => p.join(ps)).join(Ve), r = i.join(Ve), a = n.join(Ve), c = [s, r, a], l = c.findLastIndex((p) => p.length > 0), d = c.slice(0, l + 1);
|
|
2336
|
+
return d.length > 0 ? `"${d.join(us)}"` : "";
|
|
2337
2337
|
}
|
|
2338
|
-
function
|
|
2338
|
+
function nn(e) {
|
|
2339
2339
|
const t = e.members.filter((r) => r.kind === "field").map((r) => {
|
|
2340
2340
|
const a = typeof r.attribute == "string", c = a && r.attribute !== mt(r.name);
|
|
2341
2341
|
return a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""];
|
|
@@ -2360,7 +2360,7 @@ ${e.map((t) => ` "/${t}",`).join(`
|
|
|
2360
2360
|
function lt(e, t) {
|
|
2361
2361
|
const i = Po(t.getJsDocTags());
|
|
2362
2362
|
let n = o.displayPartsToString(t.getDocumentationComment(e));
|
|
2363
|
-
n = n.replaceAll(
|
|
2363
|
+
n = n.replaceAll(sn, rn);
|
|
2364
2364
|
{
|
|
2365
2365
|
const s = i.at(-1), r = s?.text?.indexOf($o);
|
|
2366
2366
|
r !== void 0 && r !== -1 && (n += s.text.slice(r), s.text = s.text?.slice(0, r));
|
|
@@ -2372,8 +2372,8 @@ function lt(e, t) {
|
|
|
2372
2372
|
}
|
|
2373
2373
|
const $o = `
|
|
2374
2374
|
|
|
2375
|
-
[Read more...]`, xo = "internal",
|
|
2376
|
-
function
|
|
2375
|
+
[Read more...]`, xo = "internal", sn = /\{@link(?:code|plain)? ([^}]+)\}/gu;
|
|
2376
|
+
function rn(e, t) {
|
|
2377
2377
|
let i = t.indexOf(" ");
|
|
2378
2378
|
i === -1 && (i = t.length);
|
|
2379
2379
|
const n = t.slice(0, i);
|
|
@@ -2381,7 +2381,7 @@ function sn(e, t) {
|
|
|
2381
2381
|
}
|
|
2382
2382
|
const Po = (e) => e.map((t) => ({
|
|
2383
2383
|
name: t.name,
|
|
2384
|
-
text: t.text?.map((i) => i.text).join("").replaceAll(
|
|
2384
|
+
text: t.text?.map((i) => i.text).join("").replaceAll(sn, rn)
|
|
2385
2385
|
})), ti = ({ modifiers: e = [] }, t) => Y(
|
|
2386
2386
|
e,
|
|
2387
2387
|
(i) => o.isDecorator(i) && o.isCallExpression(i.expression) && o.isIdentifier(i.expression.expression) && i.expression.expression.text === t ? i.expression : void 0
|
|
@@ -2426,7 +2426,7 @@ function Ao(e, t, i, n, s) {
|
|
|
2426
2426
|
);
|
|
2427
2427
|
return;
|
|
2428
2428
|
}
|
|
2429
|
-
const p = i.getTypeAtLocation(d), m =
|
|
2429
|
+
const p = i.getTypeAtLocation(d), m = Le(i, p, n, s);
|
|
2430
2430
|
t.parameters.push({
|
|
2431
2431
|
name: d.name.text,
|
|
2432
2432
|
default: d.initializer?.getText(n),
|
|
@@ -2436,7 +2436,7 @@ function Ao(e, t, i, n, s) {
|
|
|
2436
2436
|
});
|
|
2437
2437
|
}
|
|
2438
2438
|
t.parameters.length === 0 && (t.parameters = void 0);
|
|
2439
|
-
const a = i.getReturnTypeOfSignature(r), c =
|
|
2439
|
+
const a = i.getReturnTypeOfSignature(r), c = Le(i, a, n, s), l = i.signatureToString(r, e, Vi, o.SignatureKind.Call);
|
|
2440
2440
|
ce(e.name, i, t), t.return = {
|
|
2441
2441
|
type: c
|
|
2442
2442
|
}, t.signature = l.replace(" =>", ":");
|
|
@@ -2454,7 +2454,7 @@ function Lo(e, t, i, n) {
|
|
|
2454
2454
|
const m = s.getTypeArguments(p)?.at(0);
|
|
2455
2455
|
if (m === void 0)
|
|
2456
2456
|
continue;
|
|
2457
|
-
const f =
|
|
2457
|
+
const f = Le(s, m, n, i.dir), y = {
|
|
2458
2458
|
name: t,
|
|
2459
2459
|
summary: void 0,
|
|
2460
2460
|
description: void 0,
|
|
@@ -2499,7 +2499,7 @@ function Q(e, t) {
|
|
|
2499
2499
|
throw new Error(`Expected boolean literal. Instead found ${e?.getText(t)}`);
|
|
2500
2500
|
}
|
|
2501
2501
|
const Et = "@arcgis/lumina-compiler";
|
|
2502
|
-
class jo extends
|
|
2502
|
+
class jo extends es {
|
|
2503
2503
|
constructor(t, i) {
|
|
2504
2504
|
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._resolvedInheritance = /* @__PURE__ */ new Map();
|
|
2505
2505
|
}
|
|
@@ -2516,7 +2516,7 @@ class jo extends Zn {
|
|
|
2516
2516
|
}
|
|
2517
2517
|
extractDeclarations(t) {
|
|
2518
2518
|
return this.localDeclaredComponents = new Map(
|
|
2519
|
-
|
|
2519
|
+
ji(t.text)?.map(([i, n]) => [n, i]) ?? []
|
|
2520
2520
|
), this.localDeclaredComponents.size === 0 ? [] : super.extractDeclarations(t);
|
|
2521
2521
|
}
|
|
2522
2522
|
extractDeclaration(t) {
|
|
@@ -2529,7 +2529,7 @@ class jo extends Zn {
|
|
|
2529
2529
|
}
|
|
2530
2530
|
collectCssImports(t) {
|
|
2531
2531
|
const i = t.moduleSpecifier.text;
|
|
2532
|
-
if (!(i.startsWith(".") &&
|
|
2532
|
+
if (!(i.startsWith(".") && Fe.test(i)))
|
|
2533
2533
|
return;
|
|
2534
2534
|
const s = u.join(this.file.fileName, "..", i);
|
|
2535
2535
|
this.localCssImports ??= /* @__PURE__ */ new Set(), this.localCssImports.add(s);
|
|
@@ -2558,7 +2558,7 @@ class jo extends Zn {
|
|
|
2558
2558
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2559
2559
|
* Stencil's behavior.
|
|
2560
2560
|
*/
|
|
2561
|
-
pascalCaseName:
|
|
2561
|
+
pascalCaseName: ss(n),
|
|
2562
2562
|
privacy: void 0,
|
|
2563
2563
|
importPath: "",
|
|
2564
2564
|
members: [],
|
|
@@ -2638,9 +2638,9 @@ ${c}.componentOnReady().then(() => {
|
|
|
2638
2638
|
}
|
|
2639
2639
|
extractComponentMembers(t) {
|
|
2640
2640
|
const i = [], n = t.members.length;
|
|
2641
|
-
let s, r = t.members[0], a, c =
|
|
2641
|
+
let s, r = t.members[0], a, c = z(r?.name);
|
|
2642
2642
|
for (let l = 0; l < n; l++) {
|
|
2643
|
-
if (s = r, r = t.members[l + 1], a = c, c =
|
|
2643
|
+
if (s = r, r = t.members[l + 1], a = c, c = z(r?.name), this.pairedSetter !== void 0) {
|
|
2644
2644
|
this.pairedSetter = void 0;
|
|
2645
2645
|
continue;
|
|
2646
2646
|
}
|
|
@@ -2651,7 +2651,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2651
2651
|
return i;
|
|
2652
2652
|
}
|
|
2653
2653
|
extractComponentMember(t, i) {
|
|
2654
|
-
if (
|
|
2654
|
+
if (ts(t) || i === void 0) {
|
|
2655
2655
|
o.isPropertyDeclaration(t) && o.isIdentifier(t.name) && t.name.text === "shadowRootOptions" && t.initializer !== void 0 && o.isIdentifier(t.initializer) && t.initializer.text === "noShadowRoot" && (this.apiComponent.encapsulation = "none");
|
|
2656
2656
|
return;
|
|
2657
2657
|
}
|
|
@@ -2709,14 +2709,14 @@ ${c}.componentOnReady().then(() => {
|
|
|
2709
2709
|
i.type = Jr(this.context, d, f, this.file);
|
|
2710
2710
|
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);
|
|
2711
2711
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
|
|
2712
|
-
const v = t.initializer, g = s.getSymbolAtLocation(v),
|
|
2713
|
-
if (
|
|
2714
|
-
const T = lt(s,
|
|
2712
|
+
const v = t.initializer, g = s.getSymbolAtLocation(v), S = g !== void 0 && (g.flags ?? 0) & o.SymbolFlags.Alias ? s.getAliasedSymbol(g) : g, b = S?.getDeclarations() ?? [];
|
|
2713
|
+
if (S !== void 0) {
|
|
2714
|
+
const T = lt(s, S);
|
|
2715
2715
|
if (T.docsTags.length > 0) {
|
|
2716
|
-
T.docsTags = T.docsTags.filter((
|
|
2716
|
+
T.docsTags = T.docsTags.filter((w) => !c.has(w.name));
|
|
2717
2717
|
const I = i.description;
|
|
2718
|
-
ce(t.name, s, i, T), T.docsTags.forEach((
|
|
2719
|
-
c.add(
|
|
2718
|
+
ce(t.name, s, i, T), T.docsTags.forEach((w) => {
|
|
2719
|
+
c.add(w.name);
|
|
2720
2720
|
}), i.description = I ?? i.description;
|
|
2721
2721
|
} else
|
|
2722
2722
|
i.description ||= T.description;
|
|
@@ -2726,7 +2726,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2726
2726
|
if (E ??= o.isGetAccessor(T) ? T : void 0, C ??= o.isSetAccessor(T) ? T : void 0, !("initializer" in T))
|
|
2727
2727
|
return;
|
|
2728
2728
|
const I = T;
|
|
2729
|
-
l ||= I.modifiers?.some((
|
|
2729
|
+
l ||= I.modifiers?.some((w) => w.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, jt(I, i, I.getSourceFile());
|
|
2730
2730
|
}), y && E !== void 0 && C !== void 0 && E.type?.getText() !== C.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${v.getText(this.file)}` });
|
|
2731
2731
|
}
|
|
2732
2732
|
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((v) => v.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && this.context.logLintError(
|
|
@@ -2785,7 +2785,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2785
2785
|
description: n.description,
|
|
2786
2786
|
inheritedFrom: n.inheritedFrom,
|
|
2787
2787
|
type: s === void 0 || s.length === 0 ? n.type : {
|
|
2788
|
-
text:
|
|
2788
|
+
text: qi(s),
|
|
2789
2789
|
references: void 0,
|
|
2790
2790
|
values: s
|
|
2791
2791
|
},
|
|
@@ -2863,15 +2863,15 @@ async function No(e, t) {
|
|
|
2863
2863
|
t || (e.componentFilesPromise = Tt(e, e.dir.srcComponents));
|
|
2864
2864
|
const i = await e.componentFilesPromise, n = await Ko(e, i);
|
|
2865
2865
|
e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2866
|
-
const s =
|
|
2866
|
+
const s = on(n, e, !1);
|
|
2867
2867
|
e.privateApiJson = s;
|
|
2868
|
-
const [r, a] =
|
|
2868
|
+
const [r, a] = an(s);
|
|
2869
2869
|
return e.apiJsonComponents = a, e.apiJson = r, s;
|
|
2870
2870
|
}
|
|
2871
2871
|
function Do(e, t, i) {
|
|
2872
|
-
const n = e.getSourceFile(t, i), s =
|
|
2872
|
+
const n = e.getSourceFile(t, i), s = on([n], e, !0), r = s.modules[0];
|
|
2873
2873
|
{
|
|
2874
|
-
const f =
|
|
2874
|
+
const f = an(s)[0].modules[0], y = e.apiJson.modules.findIndex((g) => g.path === f.path), h = e.apiJson.modules[y], v = Array.from(e.apiJson.modules);
|
|
2875
2875
|
v.splice(y, 1, f), e.apiJson = {
|
|
2876
2876
|
...e.apiJson,
|
|
2877
2877
|
modules: v
|
|
@@ -2899,11 +2899,11 @@ function Do(e, t, i) {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
return d ||= m.length !== p.length, d ? void 0 : m;
|
|
2901
2901
|
}
|
|
2902
|
-
function
|
|
2902
|
+
function on(e, t, i) {
|
|
2903
2903
|
const n = t.options.apiJson?.Extractor ?? jo, r = new n(t, i).extract(e);
|
|
2904
2904
|
return t.options.apiJson?.afterCreate?.(r, i), r;
|
|
2905
2905
|
}
|
|
2906
|
-
function
|
|
2906
|
+
function an(e) {
|
|
2907
2907
|
const t = { ...e, modules: [] }, i = [];
|
|
2908
2908
|
for (const n of e.modules) {
|
|
2909
2909
|
const s = { ...n, declarations: [] };
|
|
@@ -2962,7 +2962,7 @@ async function Ko(e, t) {
|
|
|
2962
2962
|
})
|
|
2963
2963
|
);
|
|
2964
2964
|
}
|
|
2965
|
-
async function
|
|
2965
|
+
async function cn(e) {
|
|
2966
2966
|
return ue ??= Wo(e), await ue;
|
|
2967
2967
|
}
|
|
2968
2968
|
function Bo() {
|
|
@@ -2972,7 +2972,7 @@ function Bo() {
|
|
|
2972
2972
|
);
|
|
2973
2973
|
return dt;
|
|
2974
2974
|
}
|
|
2975
|
-
function
|
|
2975
|
+
function ln() {
|
|
2976
2976
|
if (pt === void 0)
|
|
2977
2977
|
throw new Error(
|
|
2978
2978
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
@@ -2981,13 +2981,12 @@ function cn() {
|
|
|
2981
2981
|
}
|
|
2982
2982
|
async function Wo(e) {
|
|
2983
2983
|
const t = R(e), i = t.dependencies ?? {}, n = t.peerDependencies ?? {}, r = (await Promise.all(
|
|
2984
|
-
[...Object.keys(i), ...Object.keys(n)].filter((a) => !_o.has(a)).flatMap(async (a) => await
|
|
2984
|
+
[...Object.keys(i), ...Object.keys(n)].filter((a) => !_o.has(a)).flatMap(async (a) => await dn(a, e))
|
|
2985
2985
|
)).filter(j);
|
|
2986
2986
|
return dt ??= r, pt = Object.fromEntries(r.flatMap((a) => Object.entries(a.components))), r;
|
|
2987
2987
|
}
|
|
2988
2988
|
const _o = /* @__PURE__ */ new Set([
|
|
2989
2989
|
"@arcgis/arcade-languageservice",
|
|
2990
|
-
"@arcgis/components-controllers",
|
|
2991
2990
|
"@arcgis/components-build-utils",
|
|
2992
2991
|
"@arcgis/components-utils",
|
|
2993
2992
|
"@arcgis/core",
|
|
@@ -3023,12 +3022,12 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
3023
3022
|
"vscode-languageserver-types"
|
|
3024
3023
|
]);
|
|
3025
3024
|
let dt, pt, ue;
|
|
3026
|
-
async function
|
|
3027
|
-
const i = await
|
|
3025
|
+
async function dn(e, t) {
|
|
3026
|
+
const i = await Me(e, t), n = await Oe(i), s = "exports" in n, r = Vo.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3028
3027
|
if (a ? await W(c) : !1) {
|
|
3029
|
-
const y = await D(c, "utf8"), h = Ho(y, "bootstrapLazy("), v = y.indexOf(", options", h), g = y.slice(h, v),
|
|
3028
|
+
const y = await D(c, "utf8"), h = Ho(y, "bootstrapLazy("), v = y.indexOf(", options", h), g = y.slice(h, v), S = g.startsWith('JSON.parse("') ? g.slice(12, -2).replaceAll('\\"', '"') : g;
|
|
3030
3029
|
try {
|
|
3031
|
-
const b = JSON.parse(
|
|
3030
|
+
const b = JSON.parse(S), E = qo(b, { packageName: e, getImportPath: r });
|
|
3032
3031
|
return { packageName: e, type: "stencil", components: E };
|
|
3033
3032
|
} catch (b) {
|
|
3034
3033
|
console.warn(`@arcgis/lumina: Failed to parse dist/esm/loader.js for ${e}.
|
|
@@ -3037,7 +3036,7 @@ Error: ${String(b)}`);
|
|
|
3037
3036
|
}
|
|
3038
3037
|
const d = ii(n.customElements);
|
|
3039
3038
|
if (d != null) {
|
|
3040
|
-
const y = u.join(i, d), h = JSON.parse(await D(y, "utf-8")), v = Uo(h), g =
|
|
3039
|
+
const y = u.join(i, d), h = JSON.parse(await D(y, "utf-8")), v = Uo(h), g = pn(h, {
|
|
3041
3040
|
packageName: e,
|
|
3042
3041
|
getImportPath: r
|
|
3043
3042
|
});
|
|
@@ -3066,7 +3065,7 @@ function Ho(e, t) {
|
|
|
3066
3065
|
const i = e.indexOf(t);
|
|
3067
3066
|
return i === -1 ? -1 : i + t.length;
|
|
3068
3067
|
}
|
|
3069
|
-
function
|
|
3068
|
+
function pn(e, t) {
|
|
3070
3069
|
const i = {};
|
|
3071
3070
|
for (const n of e.modules)
|
|
3072
3071
|
if (n.declarations !== void 0)
|
|
@@ -3114,7 +3113,7 @@ const Uo = (e) => e.compiler?.name === Et, zo = (e, t) => Object.fromEntries(
|
|
|
3114
3113
|
)
|
|
3115
3114
|
)
|
|
3116
3115
|
), Go = async (e, t) => Object.fromEntries(
|
|
3117
|
-
(await
|
|
3116
|
+
(await Je(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3118
3117
|
const n = i.slice(0, -5);
|
|
3119
3118
|
return [
|
|
3120
3119
|
n,
|
|
@@ -3126,7 +3125,7 @@ const Uo = (e) => e.compiler?.name === Et, zo = (e, t) => Object.fromEntries(
|
|
|
3126
3125
|
];
|
|
3127
3126
|
})
|
|
3128
3127
|
), Vo = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Xo = (e) => e.startsWith("/") ? e : `/${e}`, $t = (e, t) => `${e}@fs${Xo(t)}`;
|
|
3129
|
-
function
|
|
3128
|
+
function We(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3130
3129
|
const n = e.version.includes("next");
|
|
3131
3130
|
if (e.name === "@esri/calcite-components" && n)
|
|
3132
3131
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
@@ -3153,7 +3152,7 @@ function Yo(e, t) {
|
|
|
3153
3152
|
return "next";
|
|
3154
3153
|
}
|
|
3155
3154
|
async function Zo(e, t, i, n) {
|
|
3156
|
-
const s = await
|
|
3155
|
+
const s = await Me(t), r = await Oe(s), a = ea(r);
|
|
3157
3156
|
if (a === void 0)
|
|
3158
3157
|
throw new Error(`Failed to infer the CDN namespace name for the ${t}`);
|
|
3159
3158
|
const [c, l] = a, d = l.slice(0, -4);
|
|
@@ -3162,10 +3161,10 @@ async function Zo(e, t, i, n) {
|
|
|
3162
3161
|
tag: "script",
|
|
3163
3162
|
attrs: {
|
|
3164
3163
|
type: "module",
|
|
3165
|
-
src: `${
|
|
3164
|
+
src: `${We(r, !0)}${d}.esm.js`
|
|
3166
3165
|
}
|
|
3167
3166
|
};
|
|
3168
|
-
const p = `${t}/${c}/${l}${
|
|
3167
|
+
const p = `${t}/${c}/${l}${q}`, m = [
|
|
3169
3168
|
`import styles$${n} from "${p}";`,
|
|
3170
3169
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
3171
3170
|
], f = `${t}/loader`;
|
|
@@ -3189,7 +3188,7 @@ function ea(e) {
|
|
|
3189
3188
|
const [n, s, r, a] = i.split("/");
|
|
3190
3189
|
return [r, a];
|
|
3191
3190
|
}
|
|
3192
|
-
const ta = ["keyed", "ref", "repeat", "live"], te = "staticHtml",
|
|
3191
|
+
const ta = ["keyed", "ref", "repeat", "live"], te = "staticHtml", G = "staticSvg", ie = "html", Z = "svg", un = Symbol("maybe HTML namespace or maybe SVG"), mn = "css", fn = "mathml", yn = [mn, ie, fn, te, G, Z], ia = new Set(yn), na = ["safeClassMap", "safeStyleMap", "deferLoad"], sa = "nothing", ra = [...ta, ...yn, ...na, sa], je = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e);
|
|
3193
3192
|
function ni(e, t, i) {
|
|
3194
3193
|
if (V(e))
|
|
3195
3194
|
return e;
|
|
@@ -3280,7 +3279,7 @@ const oa = /* @__PURE__ */ new Set([
|
|
|
3280
3279
|
if (f === !1)
|
|
3281
3280
|
return [];
|
|
3282
3281
|
}
|
|
3283
|
-
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] :
|
|
3282
|
+
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Pe(e, t, a), l = c[0] !== "=";
|
|
3284
3283
|
if (a && l)
|
|
3285
3284
|
return [s.name, ...c];
|
|
3286
3285
|
const [d, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
@@ -3289,7 +3288,7 @@ const oa = /* @__PURE__ */ new Set([
|
|
|
3289
3288
|
p,
|
|
3290
3289
|
e,
|
|
3291
3290
|
m ? "" : void 0
|
|
3292
|
-
), h = i === "value" && (n === "input" || n === "textarea" || n ===
|
|
3291
|
+
), h = i === "value" && (n === "input" || n === "textarea" || n === ke) ? pa(f, e) : f;
|
|
3293
3292
|
if (h !== p)
|
|
3294
3293
|
return [m ? `.${i}` : s.name, d, h];
|
|
3295
3294
|
}
|
|
@@ -3301,12 +3300,12 @@ const oa = /* @__PURE__ */ new Set([
|
|
|
3301
3300
|
return [i];
|
|
3302
3301
|
if (n === !1)
|
|
3303
3302
|
return [];
|
|
3304
|
-
const s =
|
|
3303
|
+
const s = Pe(e, t, !0), a = s[0] !== "=" ? s : [s[0], ni(s[1], e)];
|
|
3305
3304
|
return [i, ...a];
|
|
3306
3305
|
},
|
|
3307
3306
|
booleanAttribute(e, t, i) {
|
|
3308
3307
|
const n = t === void 0 || nt(t);
|
|
3309
|
-
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...
|
|
3308
|
+
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...Pe(e, t, !1)];
|
|
3310
3309
|
},
|
|
3311
3310
|
event(e, t, i) {
|
|
3312
3311
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3314,7 +3313,7 @@ const oa = /* @__PURE__ */ new Set([
|
|
|
3314
3313
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3315
3314
|
);
|
|
3316
3315
|
const n = i.slice(2), s = ot(n);
|
|
3317
|
-
return [`@${
|
|
3316
|
+
return [`@${Bi.has(s) ? n.toLowerCase() : ot(n)}=`, ...Pt(e, t, void 0)];
|
|
3318
3317
|
},
|
|
3319
3318
|
directives(e, t) {
|
|
3320
3319
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3365,15 +3364,15 @@ function la(e, t, i) {
|
|
|
3365
3364
|
if (r !== void 0)
|
|
3366
3365
|
return { name: r, type: "reflected" };
|
|
3367
3366
|
}
|
|
3368
|
-
const n = it(
|
|
3367
|
+
const n = it(J.common, t);
|
|
3369
3368
|
if (n !== void 0)
|
|
3370
3369
|
return n;
|
|
3371
3370
|
if (typeof e == "string") {
|
|
3372
|
-
const s = it(
|
|
3371
|
+
const s = it(J.perElement[e], t);
|
|
3373
3372
|
if (s !== void 0)
|
|
3374
3373
|
return s;
|
|
3375
3374
|
} else {
|
|
3376
|
-
const s = Object.values(
|
|
3375
|
+
const s = Object.values(J.perElement).map(
|
|
3377
3376
|
(a) => it(a, t)
|
|
3378
3377
|
), r = Y(s, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? Y(s, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3379
3378
|
if (r !== void 0)
|
|
@@ -3408,8 +3407,8 @@ function nt(e) {
|
|
|
3408
3407
|
return !1;
|
|
3409
3408
|
}
|
|
3410
3409
|
}
|
|
3411
|
-
function
|
|
3412
|
-
if (
|
|
3410
|
+
function Pe(e, t, i = !1) {
|
|
3411
|
+
if (je(t))
|
|
3413
3412
|
throw new Error(
|
|
3414
3413
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3415
3414
|
);
|
|
@@ -3433,7 +3432,7 @@ function si(e, t) {
|
|
|
3433
3432
|
const i = e.text;
|
|
3434
3433
|
if (i.length === 0)
|
|
3435
3434
|
return [];
|
|
3436
|
-
const n =
|
|
3435
|
+
const n = _i(i);
|
|
3437
3436
|
if (cr(n)) {
|
|
3438
3437
|
const s = n.replaceAll('"', """);
|
|
3439
3438
|
if (s.length > n.length) {
|
|
@@ -3461,7 +3460,7 @@ function ri(e, t, i) {
|
|
|
3461
3460
|
]);
|
|
3462
3461
|
return [`${i}=`, c];
|
|
3463
3462
|
} else
|
|
3464
|
-
return [i, ...
|
|
3463
|
+
return [i, ...Pe(e, t, !0)];
|
|
3465
3464
|
}
|
|
3466
3465
|
const da = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3467
3466
|
function pa(e, t) {
|
|
@@ -3490,13 +3489,13 @@ const oi = {
|
|
|
3490
3489
|
bindEvent: "event"
|
|
3491
3490
|
};
|
|
3492
3491
|
function ma(e, t, i) {
|
|
3493
|
-
return ya.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (
|
|
3492
|
+
return ya.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (Oi.has(e) || e.includes("-")) && (e !== "itemId" || i !== "arcgis-map" && i !== "arcgis-scene") ? "attribute" : !vt(i) && (Ji.has(e) || (i === at ? !1 : i === ke ? (
|
|
3494
3493
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3495
3494
|
Object.values(ct).some((r) => r.has(e))
|
|
3496
|
-
) : ct[i]?.has(e) === !0)) ? Ot.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === at || i !==
|
|
3495
|
+
) : ct[i]?.has(e) === !0)) ? Ot.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === at || i !== ke && (ht.has(i) || gt.has(i)) ? e in J.common.reflected || e in J.common.stringifiedReflected || e in J.common.stringifiedNonReflected ? "property" : Ot.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3497
3496
|
}
|
|
3498
3497
|
const fa = ["class", "style", "ref", "directives", "key", "deferLoad"], ya = new Set(fa), ha = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3499
|
-
function
|
|
3498
|
+
function _e({ key: e, parts: t, litTag: i }, n) {
|
|
3500
3499
|
const s = ga(t);
|
|
3501
3500
|
if (s.length % 2 === 0)
|
|
3502
3501
|
throw new Error("Normalized template parts array length must be odd");
|
|
@@ -3515,7 +3514,7 @@ function He({ key: e, parts: t, litTag: i }, n) {
|
|
|
3515
3514
|
}
|
|
3516
3515
|
const c = typeof i == "string" ? i : ie;
|
|
3517
3516
|
n.neededImports.add(c);
|
|
3518
|
-
const l = n.importRenames[c], d =
|
|
3517
|
+
const l = n.importRenames[c], d = Ke(r), p = o.factory.createTaggedTemplateExpression(
|
|
3519
3518
|
o.factory.createIdentifier(l),
|
|
3520
3519
|
void 0,
|
|
3521
3520
|
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(d, d) : o.factory.createTemplateExpression(
|
|
@@ -3546,7 +3545,7 @@ function va(e) {
|
|
|
3546
3545
|
const c = r + 1, l = e[c];
|
|
3547
3546
|
if (typeof l != "string")
|
|
3548
3547
|
throw new Error("Expected to receive a normalized array of parts");
|
|
3549
|
-
const d = s === i - 1, p =
|
|
3548
|
+
const d = s === i - 1, p = Ke(l);
|
|
3550
3549
|
return o.factory.createTemplateSpan(
|
|
3551
3550
|
a,
|
|
3552
3551
|
/*
|
|
@@ -3591,11 +3590,11 @@ function wa(e, t) {
|
|
|
3591
3590
|
if (!ai(b))
|
|
3592
3591
|
return t;
|
|
3593
3592
|
const E = c.statements.slice(0, -1);
|
|
3594
|
-
if (E.some(
|
|
3593
|
+
if (E.some(hn))
|
|
3595
3594
|
return t;
|
|
3596
3595
|
l = E.length === 0, d = b;
|
|
3597
3596
|
}
|
|
3598
|
-
const p = o.isJsxElement(d) ? d.openingElement : d, m =
|
|
3597
|
+
const p = o.isJsxElement(d) ? d.openingElement : d, m = bn(p);
|
|
3599
3598
|
if (m === -1)
|
|
3600
3599
|
return t;
|
|
3601
3600
|
const f = p.attributes.properties[m];
|
|
@@ -3624,24 +3623,24 @@ function wa(e, t) {
|
|
|
3624
3623
|
]);
|
|
3625
3624
|
}
|
|
3626
3625
|
const ai = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3627
|
-
function
|
|
3626
|
+
function hn(e) {
|
|
3628
3627
|
if (o.isReturnStatement(e))
|
|
3629
3628
|
return !0;
|
|
3630
3629
|
let t = !1;
|
|
3631
3630
|
return o.visitEachChild(
|
|
3632
3631
|
e,
|
|
3633
|
-
(i) => (t ||=
|
|
3632
|
+
(i) => (t ||= hn(i), i),
|
|
3634
3633
|
void 0
|
|
3635
3634
|
), t;
|
|
3636
3635
|
}
|
|
3637
3636
|
function Sa(e, t, i, n, s) {
|
|
3638
|
-
const r =
|
|
3637
|
+
const r = O(i);
|
|
3639
3638
|
if (r === void 0)
|
|
3640
3639
|
return;
|
|
3641
|
-
let a =
|
|
3640
|
+
let a = gn(e.name, r);
|
|
3642
3641
|
const c = t.parameters.at(1);
|
|
3643
3642
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
3644
|
-
r.every(
|
|
3643
|
+
r.every(Ne, c.name)) {
|
|
3645
3644
|
console.warn(
|
|
3646
3645
|
`It looks like you are trying to use .map() index as a key={} prop value in ${k(s.sourceFile.fileName)}. 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.`
|
|
3647
3646
|
);
|
|
@@ -3664,25 +3663,25 @@ function Sa(e, t, i, n, s) {
|
|
|
3664
3663
|
e.initializer
|
|
3665
3664
|
);
|
|
3666
3665
|
}
|
|
3667
|
-
function
|
|
3666
|
+
function O(e) {
|
|
3668
3667
|
if (o.isIdentifier(e))
|
|
3669
3668
|
return [e.text];
|
|
3670
3669
|
if (o.isPropertyAccessExpression(e))
|
|
3671
|
-
return
|
|
3670
|
+
return O(e.expression);
|
|
3672
3671
|
if (o.isElementAccessExpression(e))
|
|
3673
|
-
return
|
|
3672
|
+
return O(e.argumentExpression);
|
|
3674
3673
|
if (o.isConditionalExpression(e)) {
|
|
3675
|
-
const t =
|
|
3674
|
+
const t = O(e.condition), i = O(e.whenTrue), n = O(e.whenFalse);
|
|
3676
3675
|
return t === void 0 || i === void 0 || n === void 0 ? void 0 : [...t, ...i, ...n];
|
|
3677
3676
|
} else if (o.isBinaryExpression(e)) {
|
|
3678
|
-
const t =
|
|
3677
|
+
const t = O(e.left), i = O(e.right);
|
|
3679
3678
|
return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
|
|
3680
3679
|
} else {
|
|
3681
3680
|
if (ba.has(e.kind))
|
|
3682
3681
|
return [];
|
|
3683
3682
|
{
|
|
3684
3683
|
const t = me(e);
|
|
3685
|
-
return t !== e ?
|
|
3684
|
+
return t !== e ? O(t) : void 0;
|
|
3686
3685
|
}
|
|
3687
3686
|
}
|
|
3688
3687
|
}
|
|
@@ -3695,16 +3694,16 @@ const ba = /* @__PURE__ */ new Set([
|
|
|
3695
3694
|
o.SyntaxKind.FalseKeyword,
|
|
3696
3695
|
o.SyntaxKind.NullKeyword,
|
|
3697
3696
|
o.SyntaxKind.TrueKeyword
|
|
3698
|
-
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e,
|
|
3697
|
+
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, gn = (e, t) => o.isObjectBindingPattern(e) ? $a(e, t) : e;
|
|
3699
3698
|
function Ta(e, t, i) {
|
|
3700
|
-
if (e.every(
|
|
3699
|
+
if (e.every(Ne, t))
|
|
3701
3700
|
return t;
|
|
3702
3701
|
if (o.isIdentifier(t)) {
|
|
3703
3702
|
const n = o.isBlock(i.body) ? Y(i.body.statements, (r) => Ea(r, t)) : void 0;
|
|
3704
3703
|
if (n === void 0)
|
|
3705
3704
|
return;
|
|
3706
|
-
const s =
|
|
3707
|
-
if (e.every(
|
|
3705
|
+
const s = gn(n, e);
|
|
3706
|
+
if (e.every(Ne, s))
|
|
3708
3707
|
return s;
|
|
3709
3708
|
}
|
|
3710
3709
|
}
|
|
@@ -3714,22 +3713,22 @@ function Ea(e, t) {
|
|
|
3714
3713
|
const i = e.declarationList.declarations[0];
|
|
3715
3714
|
return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
|
|
3716
3715
|
}
|
|
3717
|
-
function
|
|
3716
|
+
function Ne(e) {
|
|
3718
3717
|
const t = this;
|
|
3719
3718
|
return o.isIdentifier(t) ? t.text === e : t.elements.some(Ca, e);
|
|
3720
3719
|
}
|
|
3721
3720
|
function Ca(e) {
|
|
3722
3721
|
const t = this;
|
|
3723
|
-
return o.isOmittedExpression(e) ? !1 :
|
|
3722
|
+
return o.isOmittedExpression(e) ? !1 : Ne.call(e.name, t);
|
|
3724
3723
|
}
|
|
3725
3724
|
function $a(e, t) {
|
|
3726
3725
|
let i = !1;
|
|
3727
3726
|
const n = e.elements.filter((s) => o.isIdentifier(s.name) ? t.includes(s.name.text) : (i = !0, !0));
|
|
3728
3727
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3729
3728
|
}
|
|
3730
|
-
const
|
|
3731
|
-
`), Pa = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u,
|
|
3732
|
-
function
|
|
3729
|
+
const vn = (e, t) => t.liftedKeys.has(e), xa = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}";`).join(`
|
|
3730
|
+
`), Pa = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, He = (e) => !Pa.test(e), he = (e) => He(e) ? `"${e}"` : e;
|
|
3731
|
+
function Ue(e, t) {
|
|
3733
3732
|
const i = [], n = [];
|
|
3734
3733
|
let s = !1;
|
|
3735
3734
|
t?.forEach((p) => {
|
|
@@ -3747,29 +3746,29 @@ function ze(e, t) {
|
|
|
3747
3746
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3748
3747
|
s ? `${e}SetterTypes` : ""
|
|
3749
3748
|
], l = s ? `
|
|
3750
|
-
type ${e}SetterTypes = ${e}["${
|
|
3749
|
+
type ${e}SetterTypes = ${e}["${Mi}"]` : "", d = c.filter(Boolean).join(", ");
|
|
3751
3750
|
return [d.length === 0 ? "" : `${d}, `, l];
|
|
3752
3751
|
}
|
|
3753
3752
|
const ci = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3754
3753
|
function H(e, t, i) {
|
|
3755
|
-
if (
|
|
3756
|
-
return
|
|
3754
|
+
if (je(i))
|
|
3755
|
+
return wn(e, i);
|
|
3757
3756
|
const n = o.isCallExpression(i) ? wa(e, i) : i, s = o.visitEachChild(
|
|
3758
3757
|
n,
|
|
3759
3758
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
3760
3759
|
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
3761
3760
|
e.transformationContext
|
|
3762
3761
|
);
|
|
3763
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) ||
|
|
3764
|
-
}
|
|
3765
|
-
function vn(e, t) {
|
|
3766
|
-
const i = wn(e, t);
|
|
3767
|
-
return He(i, e);
|
|
3762
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || je(me(i.right))) ? ka(s) : s;
|
|
3768
3763
|
}
|
|
3769
3764
|
function wn(e, t) {
|
|
3765
|
+
const i = Sn(e, t);
|
|
3766
|
+
return _e(i, e);
|
|
3767
|
+
}
|
|
3768
|
+
function Sn(e, t) {
|
|
3770
3769
|
const i = "children" in t ? t.children : [];
|
|
3771
3770
|
if (o.isJsxFragment(t))
|
|
3772
|
-
return { key: void 0, ...
|
|
3771
|
+
return { key: void 0, ...Ie(i, e) };
|
|
3773
3772
|
const s = o.isJsxElement(t) ? t.openingElement : t, r = s.tagName;
|
|
3774
3773
|
if (o.isJsxNamespacedName(r)) {
|
|
3775
3774
|
const C = k(e.sourceFile.fileName);
|
|
@@ -3778,7 +3777,7 @@ function wn(e, t) {
|
|
|
3778
3777
|
);
|
|
3779
3778
|
}
|
|
3780
3779
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Xe && r.text !== Qe) {
|
|
3781
|
-
const T = o.isIdentifier(r) && r.text === Us ?
|
|
3780
|
+
const T = o.isIdentifier(r) && r.text === Us ? Ie(i, e) : {
|
|
3782
3781
|
// No need to wrap the function call in a lit-html tag
|
|
3783
3782
|
litTag: void 0,
|
|
3784
3783
|
parts: [Aa(e, t, r, i)]
|
|
@@ -3788,7 +3787,7 @@ function wn(e, t) {
|
|
|
3788
3787
|
...T
|
|
3789
3788
|
};
|
|
3790
3789
|
}
|
|
3791
|
-
const c = r.text === Xe ?
|
|
3790
|
+
const c = r.text === Xe ? ke : r.text === Qe ? at : r.text, l = r.text === Xe ? te : r.text === Qe ? G : qs.has(c) ? un : ht.has(c) ? Z : ie, d = vt(c);
|
|
3792
3791
|
let p;
|
|
3793
3792
|
d && e.compiler.viteCommand === "build" && (p = La(e, c));
|
|
3794
3793
|
let m;
|
|
@@ -3802,23 +3801,23 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3802
3801
|
);
|
|
3803
3802
|
const { name: T, initializer: I } = C;
|
|
3804
3803
|
if (o.isJsxNamespacedName(T)) {
|
|
3805
|
-
const
|
|
3804
|
+
const M = k(e.sourceFile.fileName);
|
|
3806
3805
|
throw new Error(
|
|
3807
|
-
`JSX namespaced attributes are not supported. Found ${T.getText(e.sourceFile)} in "${
|
|
3806
|
+
`JSX namespaced attributes are not supported. Found ${T.getText(e.sourceFile)} in "${M}"`
|
|
3808
3807
|
);
|
|
3809
3808
|
}
|
|
3810
|
-
const
|
|
3811
|
-
p?.delete(
|
|
3812
|
-
const N = ca[F](e, A?.initializer ?? I,
|
|
3809
|
+
const w = T.text, A = ua(I), F = A?.propType ?? ma(w, I, c);
|
|
3810
|
+
p?.delete(w);
|
|
3811
|
+
const N = ca[F](e, A?.initializer ?? I, w, c);
|
|
3813
3812
|
if (N.length === 0)
|
|
3814
3813
|
return [];
|
|
3815
|
-
const
|
|
3816
|
-
return F === "key" ? (m = typeof N[0] == "object" && !
|
|
3817
|
-
...
|
|
3814
|
+
const U = e.compiler.shouldMinifyJsx ? [" "] : ur(wt(T, e));
|
|
3815
|
+
return F === "key" ? (m = typeof N[0] == "object" && !vn(T, e) ? N[0] : void 0, U.some(ha) ? U : []) : F === "directives" || F === "ref" || w === "deferLoad" ? (y ||= F === "deferLoad", f.push(
|
|
3816
|
+
...U,
|
|
3818
3817
|
...N.flatMap(
|
|
3819
|
-
(
|
|
3818
|
+
(M, we) => typeof M == "string" || we === 0 || typeof N[we - 1] == "string" ? M : [" ", M]
|
|
3820
3819
|
)
|
|
3821
|
-
), []) : [...
|
|
3820
|
+
), []) : [...U, ...N];
|
|
3822
3821
|
});
|
|
3823
3822
|
if (p !== void 0 && p.size > 0 && e.compiler.logLintError(
|
|
3824
3823
|
"mustIncludeAllRequiredProperties",
|
|
@@ -3829,26 +3828,26 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3829
3828
|
`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`
|
|
3830
3829
|
);
|
|
3831
3830
|
d && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3832
|
-
const v = typeof c == "string" && zs.has(c), g =
|
|
3831
|
+
const v = typeof c == "string" && zs.has(c), g = Ie(i, e);
|
|
3833
3832
|
if (v && g.parts.length > 0) {
|
|
3834
3833
|
const C = k(e.sourceFile.fileName);
|
|
3835
3834
|
throw new Error(
|
|
3836
3835
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)} in "${C}"`
|
|
3837
3836
|
);
|
|
3838
3837
|
}
|
|
3839
|
-
const
|
|
3838
|
+
const S = (l === Z || l === G) && g.parts.length === 0, b = [
|
|
3840
3839
|
"<",
|
|
3841
3840
|
typeof c == "string" ? c : r,
|
|
3842
3841
|
...h,
|
|
3843
|
-
|
|
3844
|
-
], E = v ||
|
|
3842
|
+
S ? `${h.length === 0 ? "" : " "}/>` : ">"
|
|
3843
|
+
], E = v || S ? b : [
|
|
3845
3844
|
...b,
|
|
3846
3845
|
/**
|
|
3847
3846
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
3848
3847
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
3849
3848
|
* tagged template literal (e.g. svg``)
|
|
3850
3849
|
*/
|
|
3851
|
-
...g.litTag !== void 0 && g.litTag !== l ? [
|
|
3850
|
+
...g.litTag !== void 0 && g.litTag !== l ? [_e({ key: void 0, ...g }, e)] : g.parts,
|
|
3852
3851
|
"</",
|
|
3853
3852
|
typeof c == "string" ? c : r,
|
|
3854
3853
|
">"
|
|
@@ -3856,10 +3855,10 @@ Found ${C.getText(e.sourceFile)}`
|
|
|
3856
3855
|
return { key: m, parts: E, litTag: l };
|
|
3857
3856
|
}
|
|
3858
3857
|
function Ia(e, t) {
|
|
3859
|
-
const i = e.attributes.properties[
|
|
3860
|
-
return i && o.isJsxAttribute(i) && !
|
|
3858
|
+
const i = e.attributes.properties[bn(e)];
|
|
3859
|
+
return i && o.isJsxAttribute(i) && !vn(i.name, t) ? xt(i.initializer, t.sourceFile) : void 0;
|
|
3861
3860
|
}
|
|
3862
|
-
const
|
|
3861
|
+
const bn = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3863
3862
|
function Aa(e, t, i, n) {
|
|
3864
3863
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((l) => {
|
|
3865
3864
|
if (o.isJsxSpreadAttribute(l))
|
|
@@ -3873,19 +3872,19 @@ function Aa(e, t, i, n) {
|
|
|
3873
3872
|
}
|
|
3874
3873
|
if (d.text === "key")
|
|
3875
3874
|
return;
|
|
3876
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p :
|
|
3875
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : je(p) ? wn(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = He(d.text) ? o.factory.createStringLiteral(d.text) : d;
|
|
3877
3876
|
return o.factory.createPropertyAssignment(f, m);
|
|
3878
|
-
}), { parts: a, litTag: c } =
|
|
3877
|
+
}), { parts: a, litTag: c } = Ie(n, e);
|
|
3879
3878
|
return a.length > 0 && r.push(
|
|
3880
3879
|
o.factory.createPropertyAssignment(
|
|
3881
3880
|
o.factory.createIdentifier("children"),
|
|
3882
|
-
|
|
3881
|
+
_e({ key: void 0, parts: a, litTag: c }, e)
|
|
3883
3882
|
)
|
|
3884
3883
|
), o.factory.createCallExpression(i, void 0, [
|
|
3885
3884
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
3886
3885
|
]);
|
|
3887
3886
|
}
|
|
3888
|
-
function
|
|
3887
|
+
function Ie(e, t) {
|
|
3889
3888
|
let i;
|
|
3890
3889
|
const n = e.flatMap((s) => {
|
|
3891
3890
|
if (o.isJsxText(s))
|
|
@@ -3893,9 +3892,9 @@ function Ae(e, t) {
|
|
|
3893
3892
|
if (o.isJsxExpression(s))
|
|
3894
3893
|
return Pt(t, s, s);
|
|
3895
3894
|
{
|
|
3896
|
-
const r =
|
|
3897
|
-
if (r.key === void 0 && r.litTag !== te && r.litTag !==
|
|
3898
|
-
if (r.litTag ===
|
|
3895
|
+
const r = Sn(t, s);
|
|
3896
|
+
if (r.key === void 0 && r.litTag !== te && r.litTag !== G) {
|
|
3897
|
+
if (r.litTag === un)
|
|
3899
3898
|
return r.parts;
|
|
3900
3899
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
3901
3900
|
throw new Error(
|
|
@@ -3903,7 +3902,7 @@ function Ae(e, t) {
|
|
|
3903
3902
|
);
|
|
3904
3903
|
return i = r.litTag, r.parts;
|
|
3905
3904
|
} else
|
|
3906
|
-
return [
|
|
3905
|
+
return [_e(r, t)];
|
|
3907
3906
|
}
|
|
3908
3907
|
});
|
|
3909
3908
|
return { litTag: i, parts: n };
|
|
@@ -3922,7 +3921,7 @@ function Pt(e, t, i) {
|
|
|
3922
3921
|
const n = t.getText(e.sourceFile).slice(1, -1);
|
|
3923
3922
|
return bt(n).length === 0 ? [] : [St(n, o.factory.createIdentifier("undefined"))];
|
|
3924
3923
|
}
|
|
3925
|
-
return o.isStringLiteral(t.expression) ? [
|
|
3924
|
+
return o.isStringLiteral(t.expression) ? [_i(t.expression.text)] : (
|
|
3926
3925
|
/**
|
|
3927
3926
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
3928
3927
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -3971,7 +3970,7 @@ function La(e, t) {
|
|
|
3971
3970
|
return r;
|
|
3972
3971
|
}
|
|
3973
3972
|
}
|
|
3974
|
-
const
|
|
3973
|
+
const Tn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), fe = {
|
|
3975
3974
|
[ie]: ["lit-html", "lit/html.js", "lit"],
|
|
3976
3975
|
/**
|
|
3977
3976
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -3981,9 +3980,9 @@ const bn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), f
|
|
|
3981
3980
|
*/
|
|
3982
3981
|
[te]: ["lit-html/static.js", "lit/static-html.js"],
|
|
3983
3982
|
[Z]: ["lit-html", "lit/html.js", "lit"],
|
|
3984
|
-
[
|
|
3985
|
-
[
|
|
3986
|
-
[
|
|
3983
|
+
[G]: ["lit-html/static.js", "lit/static-html.js"],
|
|
3984
|
+
[fn]: ["lit-html", "lit/html.js", "lit"],
|
|
3985
|
+
[mn]: ["@lit/reactive-element/css-tag.js", "@lit/reactive-element", "lit"],
|
|
3987
3986
|
safeClassMap: ["@arcgis/lumina"],
|
|
3988
3987
|
safeStyleMap: ["@arcgis/lumina"],
|
|
3989
3988
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -3992,9 +3991,9 @@ const bn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), f
|
|
|
3992
3991
|
repeat: ["lit-html/directives/repeat.js", "lit/directives/repeat.js"],
|
|
3993
3992
|
ref: ["lit-html/directives/ref.js", "lit/directives/ref.js"],
|
|
3994
3993
|
nothing: ["lit-html", "lit/html.js", "lit-element/lit-element.js", "lit", "@arcgis/lumina"]
|
|
3995
|
-
},
|
|
3994
|
+
}, En = Tn(
|
|
3996
3995
|
Object.entries(fe).flatMap(([e, t]) => t.map((i) => [i, e]))
|
|
3997
|
-
), It = new Set(Object.keys(
|
|
3996
|
+
), It = new Set(Object.keys(En));
|
|
3998
3997
|
function Fa(e, t) {
|
|
3999
3998
|
const i = t.importClause, n = t.moduleSpecifier;
|
|
4000
3999
|
if (!o.isStringLiteral(n))
|
|
@@ -4002,13 +4001,13 @@ function Fa(e, t) {
|
|
|
4002
4001
|
const s = ja(e.sourceFile.fileName, n.text, ""), r = !i?.isTypeOnly;
|
|
4003
4002
|
if (r && e.existingImportedModules.add(s), i === void 0)
|
|
4004
4003
|
return t;
|
|
4005
|
-
if (e.isInLightDomComponent && n.text.startsWith(".") &&
|
|
4004
|
+
if (e.isInLightDomComponent && n.text.startsWith(".") && Fe.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4006
4005
|
!n.text.includes("?"))
|
|
4007
4006
|
return o.factory.updateImportDeclaration(
|
|
4008
4007
|
t,
|
|
4009
4008
|
t.modifiers,
|
|
4010
4009
|
i,
|
|
4011
|
-
o.factory.createStringLiteral(n.text +
|
|
4010
|
+
o.factory.createStringLiteral(n.text + q),
|
|
4012
4011
|
t.attributes
|
|
4013
4012
|
);
|
|
4014
4013
|
if (i.name !== void 0) {
|
|
@@ -4023,7 +4022,7 @@ function Fa(e, t) {
|
|
|
4023
4022
|
const d = (l.propertyName ?? l.name).text, p = fe[d];
|
|
4024
4023
|
if (c) {
|
|
4025
4024
|
if (p?.some((y) => y === n.text)) {
|
|
4026
|
-
const y =
|
|
4025
|
+
const y = Cn(d, s);
|
|
4027
4026
|
e.existingLitImports.add(y), e.importRenames[y] = l.name?.text ?? y;
|
|
4028
4027
|
}
|
|
4029
4028
|
} else (l.name.text === "h" || l.name.text === "createElement") && (e.hasNonLuminaJsxImport = !0);
|
|
@@ -4031,7 +4030,7 @@ function Fa(e, t) {
|
|
|
4031
4030
|
r && !l.isTypeOnly && m && f && e.importedFunctionComponentsFromModules.add(s);
|
|
4032
4031
|
}), t;
|
|
4033
4032
|
}
|
|
4034
|
-
const
|
|
4033
|
+
const Cn = (e, t) => e === ie && fe.staticHtml.includes(t) ? te : e === Z && fe.staticSvg.includes(t) ? G : e, ja = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4035
4034
|
function Na(e) {
|
|
4036
4035
|
return o.isImportDeclaration(e) ? Da(this, e) : e;
|
|
4037
4036
|
}
|
|
@@ -4042,11 +4041,11 @@ function Da(e, t) {
|
|
|
4042
4041
|
const r = i.isTypeOnly;
|
|
4043
4042
|
let a = !1;
|
|
4044
4043
|
const c = n.elements.map((l) => {
|
|
4045
|
-
const d = (l.propertyName ?? l.name).text, p =
|
|
4044
|
+
const d = (l.propertyName ?? l.name).text, p = Cn(d, s.text);
|
|
4046
4045
|
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;
|
|
4047
4046
|
});
|
|
4048
|
-
return
|
|
4049
|
-
!e.neededImports.has(l) || e.existingLitImports.has(l) || (e.neededImports.delete(l), a = !0, c.push(
|
|
4047
|
+
return En[s.text]?.forEach((l) => {
|
|
4048
|
+
!e.neededImports.has(l) || e.existingLitImports.has(l) || (e.neededImports.delete(l), a = !0, c.push($n(l, e)));
|
|
4050
4049
|
}), a ? o.factory.updateImportDeclaration(
|
|
4051
4050
|
t,
|
|
4052
4051
|
t.modifiers,
|
|
@@ -4061,7 +4060,7 @@ function Da(e, t) {
|
|
|
4061
4060
|
) : t;
|
|
4062
4061
|
}
|
|
4063
4062
|
function Ra(e) {
|
|
4064
|
-
const t =
|
|
4063
|
+
const t = Tn(Array.from(e.neededImports, (i) => [fe[i][0], i]));
|
|
4065
4064
|
return Object.entries(t).map(
|
|
4066
4065
|
([i, n]) => o.factory.createImportDeclaration(
|
|
4067
4066
|
void 0,
|
|
@@ -4069,15 +4068,15 @@ function Ra(e) {
|
|
|
4069
4068
|
!1,
|
|
4070
4069
|
void 0,
|
|
4071
4070
|
o.factory.createNamedImports(
|
|
4072
|
-
n.map((s) => (e.neededImports.delete(s),
|
|
4071
|
+
n.map((s) => (e.neededImports.delete(s), $n(s, e)))
|
|
4073
4072
|
)
|
|
4074
4073
|
),
|
|
4075
4074
|
o.factory.createStringLiteral(i)
|
|
4076
4075
|
)
|
|
4077
4076
|
);
|
|
4078
4077
|
}
|
|
4079
|
-
function
|
|
4080
|
-
const i = e === te ? ie : e ===
|
|
4078
|
+
function $n(e, t) {
|
|
4079
|
+
const i = e === te ? ie : e === G ? Z : e, n = t.importRenames[e];
|
|
4081
4080
|
return n === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4082
4081
|
!1,
|
|
4083
4082
|
o.factory.createIdentifier(i),
|
|
@@ -4089,7 +4088,7 @@ function Ma(e) {
|
|
|
4089
4088
|
return e.existingImportedModules.forEach((i) => {
|
|
4090
4089
|
if (u.isAbsolute(i))
|
|
4091
4090
|
return;
|
|
4092
|
-
const { packageName: n, moduleName: s } =
|
|
4091
|
+
const { packageName: n, moduleName: s } = Xi(i);
|
|
4093
4092
|
if (t.includes(n ?? "") && (s.startsWith("dist/components") || s.startsWith("components"))) {
|
|
4094
4093
|
const r = k(e.sourceFile.fileName);
|
|
4095
4094
|
throw new Error(
|
|
@@ -4114,7 +4113,7 @@ function Oa(e) {
|
|
|
4114
4113
|
}), [];
|
|
4115
4114
|
}
|
|
4116
4115
|
function Ja(e, t, i) {
|
|
4117
|
-
const n =
|
|
4116
|
+
const n = ln()[t] ?? xn(e)[t];
|
|
4118
4117
|
if (n === void 0) {
|
|
4119
4118
|
const s = k(i);
|
|
4120
4119
|
throw new Error(
|
|
@@ -4126,8 +4125,8 @@ function Ja(e, t, i) {
|
|
|
4126
4125
|
function Ka(e, t) {
|
|
4127
4126
|
return e.packageName === void 0 ? ee(t, e.moduleName) : u.join(e.packageName, e.moduleName);
|
|
4128
4127
|
}
|
|
4129
|
-
function
|
|
4130
|
-
return e._localDefinedComponents ??=
|
|
4128
|
+
function xn(e) {
|
|
4129
|
+
return e._localDefinedComponents ??= pn(e.privateApiJson, {
|
|
4131
4130
|
packageName: void 0,
|
|
4132
4131
|
getImportPath() {
|
|
4133
4132
|
throw new Error("Not supposed to be called for local components");
|
|
@@ -4140,8 +4139,8 @@ const Ba = (e, t) => {
|
|
|
4140
4139
|
return e.statements;
|
|
4141
4140
|
const n = {
|
|
4142
4141
|
compiler: t.compiler,
|
|
4143
|
-
externalComponents:
|
|
4144
|
-
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} :
|
|
4142
|
+
externalComponents: ln(),
|
|
4143
|
+
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : xn(t.compiler),
|
|
4145
4144
|
sourceFile: e,
|
|
4146
4145
|
transformationContext: t.transformation,
|
|
4147
4146
|
importRenames: Wa(e),
|
|
@@ -4204,7 +4203,7 @@ function Ha(e, t, i) {
|
|
|
4204
4203
|
o.factory.createObjectLiteralExpression(
|
|
4205
4204
|
Array.from(t.entries()).map(
|
|
4206
4205
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4207
|
-
|
|
4206
|
+
He(n) ? o.factory.createStringLiteral(n) : n,
|
|
4208
4207
|
Ua(s, i)
|
|
4209
4208
|
)
|
|
4210
4209
|
)
|
|
@@ -4315,7 +4314,7 @@ function Xa(e, t, i, n, s) {
|
|
|
4315
4314
|
let p = !1;
|
|
4316
4315
|
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, di(t, l, r, p);
|
|
4317
4316
|
} else if (a !== -1) {
|
|
4318
|
-
const c = li(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 =
|
|
4317
|
+
const c = li(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 = z(t.name);
|
|
4319
4318
|
if (p === void 0)
|
|
4320
4319
|
throw new Error("Failed to statically determine the state property name");
|
|
4321
4320
|
return s.set(p, d), di(t, c, a, !0);
|
|
@@ -4336,7 +4335,7 @@ function Qa(e, t, i, n) {
|
|
|
4336
4335
|
`Failed to find API property for ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
4337
4336
|
);
|
|
4338
4337
|
if (r.name === "") {
|
|
4339
|
-
const a =
|
|
4338
|
+
const a = z(t.name);
|
|
4340
4339
|
if (a === void 0)
|
|
4341
4340
|
throw Error(
|
|
4342
4341
|
`Failed to statically determine the property name: ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
@@ -4398,10 +4397,10 @@ const Ya = (e, t) => {
|
|
|
4398
4397
|
}
|
|
4399
4398
|
const s = (c) => Ha(c, i, t.compiler.shouldMinify), r = (c, l) => ec(t, c, l, e, i);
|
|
4400
4399
|
return e.statements.map(
|
|
4401
|
-
(c) =>
|
|
4400
|
+
(c) => Pn(r, c, t, n, s)
|
|
4402
4401
|
);
|
|
4403
4402
|
};
|
|
4404
|
-
function
|
|
4403
|
+
function Pn(e, t, i, n, s = Pi) {
|
|
4405
4404
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4406
4405
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4407
4406
|
let r = !1;
|
|
@@ -4424,7 +4423,7 @@ function xn(e, t, i, n, s = Pi) {
|
|
|
4424
4423
|
} else
|
|
4425
4424
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4426
4425
|
t,
|
|
4427
|
-
(a) =>
|
|
4426
|
+
(a) => Pn(e, a, i, n, s),
|
|
4428
4427
|
i.transformation
|
|
4429
4428
|
) : t;
|
|
4430
4429
|
}
|
|
@@ -4487,7 +4486,7 @@ function ic(e, t) {
|
|
|
4487
4486
|
"{",
|
|
4488
4487
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
4489
4488
|
'hydratedAttribute:"',
|
|
4490
|
-
t.options.css?.hydratedAttribute ??
|
|
4489
|
+
t.options.css?.hydratedAttribute ?? en,
|
|
4491
4490
|
'",',
|
|
4492
4491
|
s === void 0 ? "" : "commonStyles",
|
|
4493
4492
|
"}",
|
|
@@ -4518,7 +4517,7 @@ const nc = [
|
|
|
4518
4517
|
const n = e.getSourceFile(i, t);
|
|
4519
4518
|
await ue;
|
|
4520
4519
|
const r = o.transform(n, [
|
|
4521
|
-
(f) => () =>
|
|
4520
|
+
(f) => () => Di(e, f, n, [
|
|
4522
4521
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4523
4522
|
...nc
|
|
4524
4523
|
])
|
|
@@ -4571,7 +4570,7 @@ function rc(e) {
|
|
|
4571
4570
|
};
|
|
4572
4571
|
}
|
|
4573
4572
|
function oc(e) {
|
|
4574
|
-
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t :
|
|
4573
|
+
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : Yn(t ?? "tsconfig.json");
|
|
4575
4574
|
if (i === void 0)
|
|
4576
4575
|
throw new Error(
|
|
4577
4576
|
`Unable to find ${k(String(t))} in ${process.cwd()}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`
|
|
@@ -4593,7 +4592,7 @@ function oc(e) {
|
|
|
4593
4592
|
}, r = o.parseJsonConfigFileContent(s, o.sys, u.dirname(i));
|
|
4594
4593
|
e.typeScriptConfig = r.options, e.typeScriptConfigPath = i;
|
|
4595
4594
|
}
|
|
4596
|
-
function
|
|
4595
|
+
function In(e) {
|
|
4597
4596
|
const t = e.target;
|
|
4598
4597
|
if (t === void 0)
|
|
4599
4598
|
throw new Error(
|
|
@@ -4621,18 +4620,18 @@ function ac(e, t) {
|
|
|
4621
4620
|
l[0] === "timerToUpdateProgram" ? s : c,
|
|
4622
4621
|
...l
|
|
4623
4622
|
), n.afterProgramCreate = (a) => {
|
|
4624
|
-
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new
|
|
4623
|
+
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new rs();
|
|
4625
4624
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4626
4625
|
}
|
|
4627
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = rc(e), e._typeScriptPrinter =
|
|
4626
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = rc(e), e._typeScriptPrinter = zi(e._compilerOptionsForPrinter);
|
|
4628
4627
|
}
|
|
4629
4628
|
const ut = "@arcgis/core", ui = R(), B = ut in (ui.dependencies ?? {}) || ut in (ui.peerDependencies ?? {});
|
|
4630
4629
|
async function cc(e, t) {
|
|
4631
4630
|
if (!B)
|
|
4632
4631
|
return [];
|
|
4633
|
-
const i = await
|
|
4632
|
+
const i = await Me(ut);
|
|
4634
4633
|
if (t === "cdn") {
|
|
4635
|
-
const n = await
|
|
4634
|
+
const n = await Oe(i), s = We({ name: "", version: n.version }, !0);
|
|
4636
4635
|
return [
|
|
4637
4636
|
// Use the ESM CDN
|
|
4638
4637
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -4661,10 +4660,10 @@ const mi = (e) => ({
|
|
|
4661
4660
|
});
|
|
4662
4661
|
async function lc(e, t, i) {
|
|
4663
4662
|
const n = u.resolve(e.dir.root, t);
|
|
4664
|
-
await W(n) && await
|
|
4663
|
+
await W(n) && await cs(n, { recursive: !0, force: !0 }), await _(n, { recursive: !0 }), await ls(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4665
4664
|
const s = [
|
|
4666
4665
|
"index.html",
|
|
4667
|
-
...await
|
|
4666
|
+
...await fs("**/*.html", {
|
|
4668
4667
|
cwd: e.dir.src,
|
|
4669
4668
|
nodir: !0,
|
|
4670
4669
|
posix: !0
|
|
@@ -4686,17 +4685,17 @@ async function lc(e, t, i) {
|
|
|
4686
4685
|
s.map(async (d, p) => {
|
|
4687
4686
|
const f = p === 0 ? d : u.join(r, d), y = u.join(e.dir.root, f), h = u.join(n, f);
|
|
4688
4687
|
await _(u.dirname(h), { recursive: !0 });
|
|
4689
|
-
const v = await D(y, "utf-8"), g = ee(u.dirname(f), `build/${i}`),
|
|
4688
|
+
const v = await D(y, "utf-8"), g = ee(u.dirname(f), `build/${i}`), S = `${l}<script type="module" src="${g}"><\/script>
|
|
4690
4689
|
`;
|
|
4691
4690
|
let b = v.indexOf("<style>");
|
|
4692
4691
|
if (b === -1 && (b = v.indexOf("</head>")), b === -1)
|
|
4693
4692
|
throw Error(`Failed to find <head> or <style> tag in ${y}`);
|
|
4694
|
-
const E = v.slice(0, b) +
|
|
4693
|
+
const E = v.slice(0, b) + S + v.slice(b);
|
|
4695
4694
|
await L(h, E, "utf-8");
|
|
4696
4695
|
})
|
|
4697
4696
|
);
|
|
4698
4697
|
}
|
|
4699
|
-
const
|
|
4698
|
+
const An = /* @__PURE__ */ new Set([
|
|
4700
4699
|
"chunks",
|
|
4701
4700
|
"components",
|
|
4702
4701
|
"docs",
|
|
@@ -4709,22 +4708,18 @@ const In = /* @__PURE__ */ new Set([
|
|
|
4709
4708
|
"collection",
|
|
4710
4709
|
"extras",
|
|
4711
4710
|
"support"
|
|
4712
|
-
]),
|
|
4711
|
+
]), De = "cdn";
|
|
4713
4712
|
function dc(e) {
|
|
4714
|
-
const { skip: t = !1, namespace: i =
|
|
4713
|
+
const { skip: t = !1, namespace: i = De, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination;
|
|
4715
4714
|
if (i.toLowerCase() !== i)
|
|
4716
4715
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
4717
|
-
if (
|
|
4716
|
+
if (An.has(i))
|
|
4718
4717
|
throw new Error(
|
|
4719
4718
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
4720
4719
|
);
|
|
4721
|
-
const r = i ===
|
|
4720
|
+
const r = i === De ? "index" : i;
|
|
4722
4721
|
if (e.provideAssets([
|
|
4723
|
-
{
|
|
4724
|
-
type: "dynamic",
|
|
4725
|
-
source: () => vo(e),
|
|
4726
|
-
destination: `../${r}.css`
|
|
4727
|
-
}
|
|
4722
|
+
{ type: "dynamic", source: () => vo(e), destination: `../${r}.css` }
|
|
4728
4723
|
]), !t)
|
|
4729
4724
|
return {
|
|
4730
4725
|
name: "@arcgis/lumina:buildCdn",
|
|
@@ -4748,7 +4743,7 @@ async function pc(e, t, i) {
|
|
|
4748
4743
|
throw Error(
|
|
4749
4744
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4750
4745
|
);
|
|
4751
|
-
return await
|
|
4746
|
+
return await ms({
|
|
4752
4747
|
bundle: !0,
|
|
4753
4748
|
minify: B ? !0 : n === "production",
|
|
4754
4749
|
treeShaking: !0,
|
|
@@ -4774,7 +4769,7 @@ async function pc(e, t, i) {
|
|
|
4774
4769
|
resolveExtensions: [".js", ".json"],
|
|
4775
4770
|
entryNames: At(t),
|
|
4776
4771
|
banner: { js: e.banner },
|
|
4777
|
-
target:
|
|
4772
|
+
target: In(e.typeScriptConfig),
|
|
4778
4773
|
...i,
|
|
4779
4774
|
plugins: [
|
|
4780
4775
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
@@ -4797,7 +4792,7 @@ async function pc(e, t, i) {
|
|
|
4797
4792
|
],
|
|
4798
4793
|
stdin: {
|
|
4799
4794
|
contents: `import { defineCustomElements } from "./loader";
|
|
4800
|
-
${
|
|
4795
|
+
${tn(e._globalCssString, e)}
|
|
4801
4796
|
/**
|
|
4802
4797
|
* We use import.meta.url to get the path to the current file
|
|
4803
4798
|
* and pass it to defineCustomElements to set the resources url.
|
|
@@ -4819,82 +4814,82 @@ async function uc(e, t, i) {
|
|
|
4819
4814
|
})
|
|
4820
4815
|
);
|
|
4821
4816
|
B && s.entries().forEach(([r, a]) => {
|
|
4822
|
-
a.isAsync === void 0 && (r.endsWith(".js") ?
|
|
4817
|
+
a.isAsync === void 0 && (r.endsWith(".js") ? kn(a, s) : a.isAsync = !1);
|
|
4823
4818
|
}), await Promise.all(s.entries().map(async ([r, { code: a }]) => await L(t + r, a)));
|
|
4824
4819
|
}
|
|
4825
4820
|
const mc = '{window.$arcgis||Object.defineProperty(window,"$arcgis",{configurable:!1,enumerable:!0,writable:!1,value:{},});var a=$arcgis;a.t=(c,...x)=>Promise.all(x.map(x=>x.then?x:(!a?.forceESM&&a?.import||(x=>import(x+".js").then(m=>m.default??m)))("@arcgis/core/"+x))).then(c)}';
|
|
4826
|
-
function
|
|
4827
|
-
const i = [], n = [], s = [], r =
|
|
4828
|
-
|
|
4829
|
-
|
|
4830
|
-
|
|
4831
|
-
|
|
4832
|
-
|
|
4833
|
-
|
|
4834
|
-
s.push([a
|
|
4835
|
-
|
|
4836
|
-
|
|
4821
|
+
function kn(e, t) {
|
|
4822
|
+
const i = [], n = [], s = [], r = [];
|
|
4823
|
+
let a = 0;
|
|
4824
|
+
const c = e.code.matchAll(fc);
|
|
4825
|
+
for (const w of c) {
|
|
4826
|
+
const [A, F, N, U, M] = w, we = M.startsWith(Re);
|
|
4827
|
+
if (a !== 0 && a !== w.index) {
|
|
4828
|
+
const qe = e.code.slice(a, w.index);
|
|
4829
|
+
s.push(qe), r.push([a, qe.length, ""]);
|
|
4830
|
+
}
|
|
4831
|
+
if (a = w.index + A.length, we)
|
|
4832
|
+
r.push([w.index, A.length, ""]), n.push({
|
|
4833
|
+
clause: F?.replaceAll(" as ", ":") ?? N ?? U ?? "",
|
|
4834
|
+
specifier: Fn(M.slice(Re.length))
|
|
4837
4835
|
});
|
|
4838
|
-
else {
|
|
4839
|
-
const
|
|
4840
|
-
if (
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
|
|
4845
|
-
|
|
4846
|
-
|
|
4847
|
-
|
|
4848
|
-
`Expected local import specifiers to use only named or side-effect import syntax. Found ${S}`
|
|
4849
|
-
);
|
|
4850
|
-
}
|
|
4836
|
+
else if (Ln(M, t)) {
|
|
4837
|
+
const Ge = Ee(i.length);
|
|
4838
|
+
if (i.push(Ge), F !== void 0)
|
|
4839
|
+
r.push([w.index + 7, 0, `${oe} as ${Ge},`]);
|
|
4840
|
+
else if (N === void 0 && U === void 0)
|
|
4841
|
+
r.push([w.index + 6, 0, `{${oe} as ${Ge}}from`]);
|
|
4842
|
+
else
|
|
4843
|
+
throw Error(
|
|
4844
|
+
`Expected local import specifiers to use only named or side-effect import syntax. Found ${A}`
|
|
4845
|
+
);
|
|
4851
4846
|
}
|
|
4852
4847
|
}
|
|
4853
|
-
if (e.isAsync =
|
|
4848
|
+
if (e.isAsync = r.length > 0, !e.isAsync)
|
|
4854
4849
|
return;
|
|
4855
|
-
let l = e.code.slice(0,
|
|
4856
|
-
l =
|
|
4857
|
-
(
|
|
4850
|
+
let l = e.code.slice(0, a);
|
|
4851
|
+
l = r.reduceRight(
|
|
4852
|
+
(w, [A, F, N]) => w.slice(0, A) + N + w.slice(A + F),
|
|
4858
4853
|
l
|
|
4859
4854
|
);
|
|
4860
4855
|
let d = [];
|
|
4861
|
-
const p =
|
|
4856
|
+
const p = yc.exec(e.code), m = p?.index ?? e.code.length;
|
|
4862
4857
|
if (p !== null) {
|
|
4863
|
-
const [
|
|
4858
|
+
const [w, A] = p;
|
|
4864
4859
|
d = A.split(",").map((F) => F.split(" as "));
|
|
4865
4860
|
}
|
|
4866
|
-
const f = [...d.map((
|
|
4861
|
+
const f = [...d.map((w, A) => Ee(i.length + A)), oe], y = n.findLastIndex(({ clause: w }) => w.length > 0), h = n.slice(0, y + 1).map(({ clause: w }) => w).join(","), v = h.length === 0 ? "_" : `([${h}])`, g = `var ${f.join(",")}=$arcgis.t(${v}=>{`, S = d.map(([w], A) => `${Ee(i.length + A)}=${w}`).join(";"), b = [...n.map((w) => `"${w.specifier}"`), ...i].join(","), E = [
|
|
4867
4862
|
oe,
|
|
4868
|
-
...d.map(([
|
|
4869
|
-
].join(","), C = `${
|
|
4863
|
+
...d.map(([w, A], F) => `${Ee(i.length + F)} as ${A}`)
|
|
4864
|
+
].join(","), C = `${S}},${b})
|
|
4870
4865
|
export{${E}}`;
|
|
4871
|
-
let T = e.code.slice(
|
|
4872
|
-
T =
|
|
4866
|
+
let T = e.code.slice(a, m);
|
|
4867
|
+
T = `${s.join("")}${T}`, T = hc(T, t);
|
|
4873
4868
|
const I = `${l}${g}${T}${C}`;
|
|
4874
4869
|
e.code = I;
|
|
4875
4870
|
}
|
|
4876
|
-
const
|
|
4877
|
-
function
|
|
4871
|
+
const fc = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, yc = /export\{([^}]+)\};\n$/u, Re = "@arcgis/core/", Ee = (e) => `_${e}`, oe = "$$";
|
|
4872
|
+
function Ln(e, t) {
|
|
4878
4873
|
if (!e.startsWith("./"))
|
|
4879
4874
|
return !1;
|
|
4880
4875
|
const i = e.slice(2), n = t.get(i);
|
|
4881
4876
|
if (n === void 0)
|
|
4882
4877
|
throw Error(`Failed to find the ${e} module`);
|
|
4883
|
-
if (n.isAsync === void 0 &&
|
|
4878
|
+
if (n.isAsync === void 0 && kn(n, t), n.isAsync === void 0)
|
|
4884
4879
|
throw Error(`Failed to infer whether the ${e} module has top-level await`);
|
|
4885
4880
|
return n.isAsync;
|
|
4886
4881
|
}
|
|
4887
|
-
function
|
|
4888
|
-
return e.replaceAll(
|
|
4882
|
+
function hc(e, t) {
|
|
4883
|
+
return e.replaceAll(gc, (i, n) => n.startsWith(Re) ? `$arcgis.t(_=>_[0],"${Fn(n.slice(Re.length))}")` : n.startsWith("./") && Ln(n, t) ? `${i}.then(m=>m.${oe}.then(_=>m))` : i);
|
|
4889
4884
|
}
|
|
4890
|
-
const
|
|
4885
|
+
const gc = /(?<![.\w\d])import\("([^"]+)"\)/gu, Fn = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
4891
4886
|
function At(e) {
|
|
4892
4887
|
return `${e}.esm`;
|
|
4893
4888
|
}
|
|
4894
|
-
async function
|
|
4895
|
-
const s = await
|
|
4889
|
+
async function vc(e, t, i, n) {
|
|
4890
|
+
const s = await Me(t), { hasCss: r, cdnName: a } = await wc(u.join(s, "dist")) ?? {};
|
|
4896
4891
|
if (i === "cdn") {
|
|
4897
|
-
const p = await
|
|
4892
|
+
const p = await Oe(s), m = We(p, !0);
|
|
4898
4893
|
return [
|
|
4899
4894
|
...r ? [
|
|
4900
4895
|
{
|
|
@@ -4914,7 +4909,7 @@ async function gc(e, t, i, n) {
|
|
|
4914
4909
|
}
|
|
4915
4910
|
];
|
|
4916
4911
|
}
|
|
4917
|
-
const c = `${t}/dist/${a}/${a}.css${
|
|
4912
|
+
const c = `${t}/dist/${a}/${a}.css${q}`, l = r ? [
|
|
4918
4913
|
`import styles$${n} from "${c}";`,
|
|
4919
4914
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
4920
4915
|
] : [], d = `${t}/dist/esm/loader.js`;
|
|
@@ -4935,9 +4930,9 @@ async function gc(e, t, i, n) {
|
|
|
4935
4930
|
}
|
|
4936
4931
|
];
|
|
4937
4932
|
}
|
|
4938
|
-
async function
|
|
4939
|
-
const i = (await
|
|
4940
|
-
(s) => !
|
|
4933
|
+
async function wc(e) {
|
|
4934
|
+
const i = (await Je(e)).filter(
|
|
4935
|
+
(s) => !An.has(s) && !s.includes(".")
|
|
4941
4936
|
), n = i.find((s) => s.startsWith("arcgis-"));
|
|
4942
4937
|
return n === void 0 ? await Promise.all(
|
|
4943
4938
|
i.map(async (s) => await fi(e, s))
|
|
@@ -4951,21 +4946,21 @@ async function fi(e, t) {
|
|
|
4951
4946
|
} : void 0;
|
|
4952
4947
|
}
|
|
4953
4948
|
async function ye(e) {
|
|
4954
|
-
return e._loadersCache ??=
|
|
4949
|
+
return e._loadersCache ??= Sc(e), await e._loadersCache;
|
|
4955
4950
|
}
|
|
4956
|
-
async function
|
|
4951
|
+
async function Sc(e) {
|
|
4957
4952
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.viteConfig.base, n = async (c) => (await Promise.all(
|
|
4958
4953
|
c.map(
|
|
4959
|
-
async (l, d) => l.type === "stencil" ? await
|
|
4954
|
+
async (l, d) => l.type === "stencil" ? await vc(i, l.packageName, t, d) : l.type === "@arcgis/lumina" ? await Zo(i, l.packageName, t, d) : void 0
|
|
4960
4955
|
)
|
|
4961
4956
|
)).filter(j).flat(), s = await Promise.all([
|
|
4962
4957
|
// This may contain an import map so must be first
|
|
4963
4958
|
cc(i, t),
|
|
4964
4959
|
ue.then(n),
|
|
4965
|
-
|
|
4960
|
+
Nn(e).then(n)
|
|
4966
4961
|
]), r = u.join(e.dir.src, "loader.ts");
|
|
4967
4962
|
return [
|
|
4968
|
-
...e.viteCommand === "serve" ? [
|
|
4963
|
+
...e.viteCommand === "serve" ? [jn] : [],
|
|
4969
4964
|
...s.flat(),
|
|
4970
4965
|
{
|
|
4971
4966
|
optimizableImports: [
|
|
@@ -4977,12 +4972,12 @@ async function wc(e) {
|
|
|
4977
4972
|
javascriptCode: [
|
|
4978
4973
|
`import { defineCustomElements } from "${r}";`,
|
|
4979
4974
|
"window.devOnly$ownTagNames = new Set();",
|
|
4980
|
-
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ??
|
|
4975
|
+
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? De}/"}` : ""});`
|
|
4981
4976
|
]
|
|
4982
4977
|
}
|
|
4983
4978
|
];
|
|
4984
4979
|
}
|
|
4985
|
-
const
|
|
4980
|
+
const jn = {
|
|
4986
4981
|
optimizableImports: [],
|
|
4987
4982
|
// Disable this warning to reduce noise in the console
|
|
4988
4983
|
// See https://github.com/lit/lit/issues/4877
|
|
@@ -4993,15 +4988,15 @@ const Fn = {
|
|
|
4993
4988
|
");"
|
|
4994
4989
|
]
|
|
4995
4990
|
};
|
|
4996
|
-
async function
|
|
4991
|
+
async function Nn(e) {
|
|
4997
4992
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
4998
4993
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
4999
|
-
t.map(async (i) => await
|
|
4994
|
+
t.map(async (i) => await dn(i))
|
|
5000
4995
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
5001
4996
|
}
|
|
5002
|
-
const
|
|
4997
|
+
const Dn = "/@arcgis/lumina-compiler/testLitSetupFile", Rn = "/@arcgis/lumina-compiler/testSetupFile", rt = [Dn, Rn], bc = jn.javascriptCode.join(`
|
|
5003
4998
|
`);
|
|
5004
|
-
async function
|
|
4999
|
+
async function Tc(e) {
|
|
5005
5000
|
if (!e.viteConfig.test?.browser?.enabled)
|
|
5006
5001
|
return yi(e);
|
|
5007
5002
|
const i = (await ye(e)).map((n, s) => {
|
|
@@ -5014,7 +5009,7 @@ async function bc(e) {
|
|
|
5014
5009
|
* The $index naming is already used by makeLoaders(), so we use the
|
|
5015
5010
|
* $t prefix to avoid collisions.
|
|
5016
5011
|
*/
|
|
5017
|
-
`import styles$t${s} from "${n.cssHref}${
|
|
5012
|
+
`import styles$t${s} from "${n.cssHref}${q}";`,
|
|
5018
5013
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${s}.styleSheet];`
|
|
5019
5014
|
].join(`
|
|
5020
5015
|
`);
|
|
@@ -5024,12 +5019,12 @@ async function bc(e) {
|
|
|
5024
5019
|
`);
|
|
5025
5020
|
return [yi(e), i].join("");
|
|
5026
5021
|
}
|
|
5027
|
-
const yi = (e) => [e.isInPuppeteerTestBackEnd ?
|
|
5022
|
+
const yi = (e) => [e.isInPuppeteerTestBackEnd ? Ec : "", Cc].join(""), Ec = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
5028
5023
|
setupPuppeteerTest();
|
|
5029
|
-
`,
|
|
5024
|
+
`, Cc = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
5030
5025
|
setupLuminaTest();
|
|
5031
5026
|
`;
|
|
5032
|
-
function
|
|
5027
|
+
function $c(e) {
|
|
5033
5028
|
let t = !0, i = !1, n, s, r, a, c;
|
|
5034
5029
|
const l = "@arcgis/lumina:generateVirtualFiles", d = {
|
|
5035
5030
|
name: l,
|
|
@@ -5039,24 +5034,24 @@ function Cc(e) {
|
|
|
5039
5034
|
},
|
|
5040
5035
|
resolveId: (h) => h === a || h === c ? a : void 0,
|
|
5041
5036
|
async load(h) {
|
|
5042
|
-
const v = h.startsWith(
|
|
5037
|
+
const v = h.startsWith(Dn), g = h.startsWith(Rn);
|
|
5043
5038
|
if (!(!h.endsWith(".tsx") && h !== a && !v && !g)) {
|
|
5044
5039
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5045
5040
|
r === void 0 && clearTimeout(n), r ??= No(e, t).catch((b) => {
|
|
5046
5041
|
throw i = !0, b;
|
|
5047
5042
|
}), t = !1;
|
|
5048
|
-
const
|
|
5049
|
-
s ??=
|
|
5043
|
+
const S = await r;
|
|
5044
|
+
s ??= S;
|
|
5050
5045
|
}
|
|
5051
|
-
return h === a ? wo(e) : v ?
|
|
5046
|
+
return h === a ? wo(e) : v ? bc : g ? await Tc(e) : void 0;
|
|
5052
5047
|
}
|
|
5053
5048
|
},
|
|
5054
5049
|
async writeBundle() {
|
|
5055
5050
|
e.isInStorybook || await L(u.join(e.dir.dist, "loader.d.ts"), So);
|
|
5056
5051
|
},
|
|
5057
5052
|
async handleHotUpdate({ file: h, modules: v, read: g }) {
|
|
5058
|
-
const
|
|
5059
|
-
return
|
|
5053
|
+
const S = await p(h, g);
|
|
5054
|
+
return S === void 0 ? void 0 : S ? v : (m(), []);
|
|
5060
5055
|
},
|
|
5061
5056
|
/**
|
|
5062
5057
|
* If a component was added, removed or renamed, regenerate the api.json and
|
|
@@ -5070,7 +5065,7 @@ function Cc(e) {
|
|
|
5070
5065
|
}), h.watcher.on("add", v), h.watcher.on("unlink", v), h.watcher.on(
|
|
5071
5066
|
"addDir",
|
|
5072
5067
|
(g) => g.startsWith(e.dir.srcComponents) ? void Tt(e, e.dir.srcComponents, g).then(
|
|
5073
|
-
(
|
|
5068
|
+
(S) => S.length > 0 ? m() : void 0
|
|
5074
5069
|
) : void 0
|
|
5075
5070
|
), h.watcher.on("unlinkDir", (g) => {
|
|
5076
5071
|
e.componentFiles.some((b) => b.startsWith(g)) && m();
|
|
@@ -5098,15 +5093,15 @@ function Cc(e) {
|
|
|
5098
5093
|
if (E === void 0)
|
|
5099
5094
|
return;
|
|
5100
5095
|
if (!(E.text === g)) {
|
|
5101
|
-
let
|
|
5096
|
+
let w;
|
|
5102
5097
|
await Promise.race([
|
|
5103
5098
|
e._typeScriptReload.promise,
|
|
5104
5099
|
new Promise((A) => {
|
|
5105
|
-
|
|
5100
|
+
w = setTimeout(() => {
|
|
5106
5101
|
console.log("Timed out waiting for TypeScript to finish type-checking. This may be a bug"), A(void 0);
|
|
5107
5102
|
}, 1e4);
|
|
5108
5103
|
})
|
|
5109
|
-
]), clearTimeout(
|
|
5104
|
+
]), clearTimeout(w);
|
|
5110
5105
|
}
|
|
5111
5106
|
}
|
|
5112
5107
|
if (!pe(h, e.dir.srcComponents))
|
|
@@ -5116,7 +5111,7 @@ function Cc(e) {
|
|
|
5116
5111
|
if (b === void 0)
|
|
5117
5112
|
return !1;
|
|
5118
5113
|
for (const E of b) {
|
|
5119
|
-
const C =
|
|
5114
|
+
const C = nn(E);
|
|
5120
5115
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: C });
|
|
5121
5116
|
}
|
|
5122
5117
|
return f(), !0;
|
|
@@ -5134,21 +5129,21 @@ function Cc(e) {
|
|
|
5134
5129
|
});
|
|
5135
5130
|
return d;
|
|
5136
5131
|
}
|
|
5137
|
-
const
|
|
5132
|
+
const xc = "@arcgis/lumina:provideAssets";
|
|
5138
5133
|
function le(e, t, i = kt) {
|
|
5139
5134
|
if (e.viteCommand !== "serve")
|
|
5140
5135
|
throw new Error("serveAssets() is only available when Vite is running in serve mode");
|
|
5141
5136
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5142
5137
|
if (t.forEach((r) => {
|
|
5143
|
-
const a =
|
|
5138
|
+
const a = On(r), c = Kn(e.dir, Jn(a)), l = Ic(e.viteConfig.base, c, e.dir.distCdn);
|
|
5144
5139
|
e.server.middlewares.use(l, (d, p, m) => {
|
|
5145
|
-
const f =
|
|
5140
|
+
const f = Ac(d.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), v = i.find((g) => g.match(h, e));
|
|
5146
5141
|
return (typeof y == "function" ? Promise.resolve(y()) : D(y)).then((g) => {
|
|
5147
|
-
const
|
|
5148
|
-
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type",
|
|
5142
|
+
const S = (typeof y == "function" ? void 0 : v?.transform(g.toString("utf8"), h, e)) ?? g;
|
|
5143
|
+
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", ys.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
5149
5144
|
}).catch((g) => {
|
|
5150
5145
|
(a.type !== "directory" || process.env.DEBUG) && console.error(
|
|
5151
|
-
|
|
5146
|
+
xc,
|
|
5152
5147
|
`Error occurred when trying to serve a file in response to request for "${d.originalUrl ?? f}":`,
|
|
5153
5148
|
g
|
|
5154
5149
|
), m();
|
|
@@ -5159,16 +5154,16 @@ function le(e, t, i = kt) {
|
|
|
5159
5154
|
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
5160
5155
|
}
|
|
5161
5156
|
}
|
|
5162
|
-
async function
|
|
5157
|
+
async function Mn(e, t, i = kt) {
|
|
5163
5158
|
await Promise.all(
|
|
5164
5159
|
t.map(async (n) => {
|
|
5165
|
-
const s =
|
|
5160
|
+
const s = On(n), r = Kn(e.dir, Jn(s));
|
|
5166
5161
|
if (s.type === "directory") {
|
|
5167
|
-
const a = u.resolve(s.source), l = (await
|
|
5162
|
+
const a = u.resolve(s.source), l = (await Je(a, { recursive: !0, withFileTypes: !0 })).filter((d) => d.isFile()).map((d) => {
|
|
5168
5163
|
const p = u.resolve(d.parentPath, d.name), m = u.relative(a, p), f = u.join(r, m);
|
|
5169
5164
|
return [p, f];
|
|
5170
5165
|
});
|
|
5171
|
-
await
|
|
5166
|
+
await Wn(l.map(([d, p]) => p)), await Promise.all(
|
|
5172
5167
|
l.map(
|
|
5173
5168
|
async ([d, p]) => await hi(d, p, i, e)
|
|
5174
5169
|
)
|
|
@@ -5183,24 +5178,24 @@ async function Rn(e, t, i = kt) {
|
|
|
5183
5178
|
})
|
|
5184
5179
|
);
|
|
5185
5180
|
}
|
|
5186
|
-
const
|
|
5181
|
+
const On = $i ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5187
5182
|
...e,
|
|
5188
|
-
destination:
|
|
5183
|
+
destination: $e(e.destination)
|
|
5189
5184
|
} : {
|
|
5190
5185
|
...e,
|
|
5191
|
-
source:
|
|
5192
|
-
destination:
|
|
5186
|
+
source: $e(e.source),
|
|
5187
|
+
destination: $e(e.destination)
|
|
5193
5188
|
};
|
|
5194
5189
|
async function hi(e, t, i, n) {
|
|
5195
5190
|
const s = i.find((r) => r.match(t, n));
|
|
5196
5191
|
if (s === void 0)
|
|
5197
|
-
await
|
|
5192
|
+
await ds(e, t);
|
|
5198
5193
|
else {
|
|
5199
5194
|
const r = await D(e, "utf8"), a = s.transform(r, t, n);
|
|
5200
5195
|
await L(t, a);
|
|
5201
5196
|
}
|
|
5202
5197
|
}
|
|
5203
|
-
function
|
|
5198
|
+
function Jn(e) {
|
|
5204
5199
|
if (e.type === "dynamic")
|
|
5205
5200
|
return e.destination;
|
|
5206
5201
|
if (e.source.endsWith(u.sep)) {
|
|
@@ -5212,34 +5207,34 @@ function On(e) {
|
|
|
5212
5207
|
}
|
|
5213
5208
|
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
5214
5209
|
}
|
|
5215
|
-
function
|
|
5216
|
-
const n =
|
|
5210
|
+
function Kn({ dist: e, distCdnAssets: t }, i) {
|
|
5211
|
+
const n = Pc(i), s = u.join(
|
|
5217
5212
|
t,
|
|
5218
5213
|
n ? u.relative(t, i) : i
|
|
5219
|
-
), r = u.relative(e, s), a =
|
|
5214
|
+
), r = u.relative(e, s), a = Bn(r);
|
|
5220
5215
|
return u.join(e, a);
|
|
5221
5216
|
}
|
|
5222
|
-
function
|
|
5217
|
+
function Pc(e) {
|
|
5223
5218
|
if (e.startsWith(u.sep)) {
|
|
5224
|
-
const t =
|
|
5219
|
+
const t = Ae(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5225
5220
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5226
5221
|
} else
|
|
5227
5222
|
return !!(!$i && u.isAbsolute(e));
|
|
5228
5223
|
}
|
|
5229
|
-
function
|
|
5230
|
-
const n =
|
|
5224
|
+
function Ic(e, t, i) {
|
|
5225
|
+
const n = Bn(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
5231
5226
|
return `${e}${s}`;
|
|
5232
5227
|
}
|
|
5233
|
-
const
|
|
5234
|
-
async function
|
|
5228
|
+
const Bn = (e) => e.replaceAll("../", ""), Ac = (e = "") => e.split("?")[0].split("#")[0];
|
|
5229
|
+
async function Wn(e) {
|
|
5235
5230
|
const t = new Set(e.map(u.dirname));
|
|
5236
5231
|
await Promise.all(Array.from(t, async (i) => await _(i, { recursive: !0 })));
|
|
5237
5232
|
}
|
|
5238
|
-
const
|
|
5233
|
+
const kc = {
|
|
5239
5234
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5240
5235
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5241
|
-
}, kt = [
|
|
5242
|
-
function
|
|
5236
|
+
}, kt = [kc];
|
|
5237
|
+
function Lc(e) {
|
|
5243
5238
|
let t;
|
|
5244
5239
|
const i = () => [
|
|
5245
5240
|
...e.options.assets?.transformers ?? [],
|
|
@@ -5248,36 +5243,36 @@ function kc(e) {
|
|
|
5248
5243
|
return {
|
|
5249
5244
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
5250
5245
|
configResolved() {
|
|
5251
|
-
t =
|
|
5246
|
+
t = Fc(e);
|
|
5252
5247
|
},
|
|
5253
5248
|
async configureServer(n) {
|
|
5254
5249
|
e.server = n, !e.isInPuppeteerTestBackEnd && (le(e, await t, i()), n.watcher.on("addDir", (s) => {
|
|
5255
5250
|
if (s.endsWith("assets")) {
|
|
5256
5251
|
const r = u.dirname(s);
|
|
5257
|
-
u.join(r, "/") === e.dir.root ? le(e, [
|
|
5252
|
+
u.join(r, "/") === e.dir.root ? le(e, [Hn], i()) : s.startsWith(e.dir.srcComponents) && le(e, [_n(s, r)], i());
|
|
5258
5253
|
}
|
|
5259
5254
|
}));
|
|
5260
5255
|
},
|
|
5261
5256
|
async writeBundle() {
|
|
5262
|
-
await
|
|
5257
|
+
await Mn(e, await t, i());
|
|
5263
5258
|
}
|
|
5264
5259
|
};
|
|
5265
5260
|
}
|
|
5266
|
-
async function
|
|
5261
|
+
async function Fc(e) {
|
|
5267
5262
|
const t = W("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5268
5263
|
i.map(async (s) => {
|
|
5269
5264
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
5270
|
-
return await W(a) ?
|
|
5265
|
+
return await W(a) ? _n(a, r) : void 0;
|
|
5271
5266
|
})
|
|
5272
5267
|
);
|
|
5273
|
-
return await t && n.push(
|
|
5268
|
+
return await t && n.push(Hn), n.filter(j);
|
|
5274
5269
|
}
|
|
5275
|
-
const
|
|
5270
|
+
const _n = (e, t) => ({
|
|
5276
5271
|
type: "directory",
|
|
5277
5272
|
source: e,
|
|
5278
5273
|
destination: u.basename(t)
|
|
5279
|
-
}),
|
|
5280
|
-
function
|
|
5274
|
+
}), Hn = { type: "directory", source: "assets/", destination: "" };
|
|
5275
|
+
function jc(e) {
|
|
5281
5276
|
const { stencilCompatibility: t } = e.options.build?.ssr ?? {};
|
|
5282
5277
|
if (t?.enabled === !0)
|
|
5283
5278
|
return {
|
|
@@ -5329,7 +5324,7 @@ export * from "@arcgis/lumina/stencilSsrCompatibility";`;
|
|
|
5329
5324
|
}
|
|
5330
5325
|
};
|
|
5331
5326
|
}
|
|
5332
|
-
const
|
|
5327
|
+
const Nc = (e) => ({
|
|
5333
5328
|
name: "@arcgis/lumina:printTotalBuildSize",
|
|
5334
5329
|
apply: () => e.viteCommand === "build",
|
|
5335
5330
|
configResolved(t) {
|
|
@@ -5346,10 +5341,10 @@ const jc = (e) => ({
|
|
|
5346
5341
|
const m = console.log;
|
|
5347
5342
|
console.log = function(...y) {
|
|
5348
5343
|
if (m.apply(console, y), y.length === 1 && typeof y[0] == "string") {
|
|
5349
|
-
const [h, v] = y[0].match(
|
|
5344
|
+
const [h, v] = y[0].match(Rc) ?? [];
|
|
5350
5345
|
if (!h)
|
|
5351
5346
|
return;
|
|
5352
|
-
p || (p = y[0].slice(0, y[0].indexOf(h) + h.length).replaceAll(
|
|
5347
|
+
p || (p = y[0].slice(0, y[0].indexOf(h) + h.length).replaceAll(Mc, "").length);
|
|
5353
5348
|
const g = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
5354
5349
|
v ? (d += Number.parseFloat(v.replace(" kB", "").replaceAll(",", "")), l += g) : c += g;
|
|
5355
5350
|
}
|
|
@@ -5365,7 +5360,7 @@ const jc = (e) => ({
|
|
|
5365
5360
|
[
|
|
5366
5361
|
vi,
|
|
5367
5362
|
v,
|
|
5368
|
-
|
|
5363
|
+
Dc,
|
|
5369
5364
|
"*",
|
|
5370
5365
|
" ".repeat(p - `${v}*`.length - h.length),
|
|
5371
5366
|
h,
|
|
@@ -5376,10 +5371,10 @@ const jc = (e) => ({
|
|
|
5376
5371
|
}
|
|
5377
5372
|
};
|
|
5378
5373
|
}
|
|
5379
|
-
}), gi = "\x1B[22m\x1B[1m\x1B[22m", vi = "\x1B[2m",
|
|
5374
|
+
}), gi = "\x1B[22m\x1B[1m\x1B[22m", vi = "\x1B[2m", Dc = "\x1B[22m\x1B[36m", Rc = /\d+(?:,\d+)?\.\d{2} kB/gu, Mc = /\x1B\[\d+m/gu, Oc = new Intl.NumberFormat("en", {
|
|
5380
5375
|
maximumFractionDigits: 2,
|
|
5381
5376
|
minimumFractionDigits: 2
|
|
5382
|
-
}), wi = (e) => `${
|
|
5377
|
+
}), wi = (e) => `${Oc.format(e)} kB`, Jc = (e) => ({
|
|
5383
5378
|
name: "@arcgis/lumina:configureVite",
|
|
5384
5379
|
async config({
|
|
5385
5380
|
server: t,
|
|
@@ -5398,7 +5393,7 @@ const jc = (e) => ({
|
|
|
5398
5393
|
loader: "src/loader.ts",
|
|
5399
5394
|
// Entrypoint for bundling used components only:
|
|
5400
5395
|
...await Ir(e)
|
|
5401
|
-
}, { loader: v, ...g } = h,
|
|
5396
|
+
}, { loader: v, ...g } = h, S = e.environment === "development" || e.isInTest ? {
|
|
5402
5397
|
"process.env.ESRI_INTERNAL": "true"
|
|
5403
5398
|
} : void 0, b = !import.meta.url.includes("node_modules"), E = {
|
|
5404
5399
|
/**
|
|
@@ -5481,7 +5476,7 @@ const jc = (e) => ({
|
|
|
5481
5476
|
},
|
|
5482
5477
|
css: C,
|
|
5483
5478
|
optimizeDeps: E,
|
|
5484
|
-
define:
|
|
5479
|
+
define: S
|
|
5485
5480
|
};
|
|
5486
5481
|
}
|
|
5487
5482
|
return {
|
|
@@ -5492,7 +5487,7 @@ const jc = (e) => ({
|
|
|
5492
5487
|
publicDir: i ?? !1,
|
|
5493
5488
|
build: {
|
|
5494
5489
|
cssMinify: n ?? (e.environment === "production" ? !0 : void 0),
|
|
5495
|
-
target: s ??
|
|
5490
|
+
target: s ?? In(e.typeScriptConfig),
|
|
5496
5491
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
5497
5492
|
lib: {
|
|
5498
5493
|
entry: h,
|
|
@@ -5511,7 +5506,7 @@ const jc = (e) => ({
|
|
|
5511
5506
|
}
|
|
5512
5507
|
},
|
|
5513
5508
|
optimizeDeps: E,
|
|
5514
|
-
define:
|
|
5509
|
+
define: S,
|
|
5515
5510
|
test: {
|
|
5516
5511
|
/*
|
|
5517
5512
|
* If in browser, run all test files that include *.e2e.* in the name.
|
|
@@ -5527,18 +5522,18 @@ const jc = (e) => ({
|
|
|
5527
5522
|
css: C
|
|
5528
5523
|
};
|
|
5529
5524
|
}
|
|
5530
|
-
}),
|
|
5525
|
+
}), Kc = (e) => ({
|
|
5531
5526
|
name: "@arcgis/lumina:setAssetPath",
|
|
5532
5527
|
apply: () => e.viteCommand === "build",
|
|
5533
5528
|
config: (t) => ({
|
|
5534
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
5529
|
+
base: t.base ?? e.options.assets?.defaultPath ?? We()
|
|
5535
5530
|
})
|
|
5536
5531
|
});
|
|
5537
|
-
function
|
|
5532
|
+
function Bc(e = R()) {
|
|
5538
5533
|
const t = e.version ?? "0.0.1";
|
|
5539
|
-
return
|
|
5534
|
+
return os(t);
|
|
5540
5535
|
}
|
|
5541
|
-
const
|
|
5536
|
+
const Wc = (e) => `/*! ${e} */`, x = (e) => (t, i) => {
|
|
5542
5537
|
Object.defineProperty(t, i, {
|
|
5543
5538
|
get() {
|
|
5544
5539
|
throw new Error(
|
|
@@ -5562,7 +5557,7 @@ function se(e) {
|
|
|
5562
5557
|
throw new Error(
|
|
5563
5558
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5564
5559
|
);
|
|
5565
|
-
return
|
|
5560
|
+
return $e(e);
|
|
5566
5561
|
}
|
|
5567
5562
|
const re = {
|
|
5568
5563
|
vsCodeHtml: "docs/vscode.html-custom-data.json",
|
|
@@ -5571,8 +5566,8 @@ const re = {
|
|
|
5571
5566
|
apiJson: "docs/api.json",
|
|
5572
5567
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5573
5568
|
};
|
|
5574
|
-
async function
|
|
5575
|
-
const r =
|
|
5569
|
+
async function Un(e, t, i, n, s = R()) {
|
|
5570
|
+
const r = _c(e, i, n, s), a = u.join(t, "lumina.ts");
|
|
5576
5571
|
if ((await W(a) ? await D(a, "utf8") : "") === r)
|
|
5577
5572
|
return !1;
|
|
5578
5573
|
if (process.env.CI)
|
|
@@ -5581,7 +5576,12 @@ async function Hn(e, t, i, n, s = R()) {
|
|
|
5581
5576
|
);
|
|
5582
5577
|
return Ii(a, r), !0;
|
|
5583
5578
|
}
|
|
5584
|
-
function
|
|
5579
|
+
function _c(e, t, i, n = R()) {
|
|
5580
|
+
"@arcgis/components-controllers" in (n.dependencies ?? {}) && console.error(
|
|
5581
|
+
Ai.yellow(
|
|
5582
|
+
"Deprecation warning: the @arcgis/components-controllers package was merged into @arcgis/lumina. Please remove it from your package.json and rewrite code to import from @arcgis/lumina/controllers and @arcgis/lumina/controllers/accessor instead."
|
|
5583
|
+
)
|
|
5584
|
+
);
|
|
5585
5585
|
const s = e.filter((m) => m.type === "@arcgis/lumina").map((m) => `
|
|
5586
5586
|
/// <reference types="${m.packageName}/types/lumina" />`), r = e.filter((m) => m.type === "stencil"), a = r.map(
|
|
5587
5587
|
(m, f) => `
|
|
@@ -5592,8 +5592,11 @@ declare module "@arcgis/lumina" {
|
|
|
5592
5592
|
interface ImportStencilElements extends ${r.map((m, f) => `JSX$${f}.IntrinsicElements`).join(", ")} {}
|
|
5593
5593
|
}`, l = n.devDependencies ?? {}, d = i === "preview" ? "matchers" : i === "webdriverio" ? "webdriverio" : "playwright";
|
|
5594
5594
|
return [
|
|
5595
|
-
|
|
5596
|
-
|
|
5595
|
+
Hc,
|
|
5596
|
+
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5597
|
+
n.name === "@arcgis/lumina" ? "" : `
|
|
5598
|
+
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5599
|
+
t ? Uc : "",
|
|
5597
5600
|
l.vitest ? `
|
|
5598
5601
|
/// <reference types="vitest/config" />` : "",
|
|
5599
5602
|
l["@vitest/browser"] ? `
|
|
@@ -5607,7 +5610,7 @@ declare module "@arcgis/lumina" {
|
|
|
5607
5610
|
`
|
|
5608
5611
|
].join("");
|
|
5609
5612
|
}
|
|
5610
|
-
const
|
|
5613
|
+
const Hc = `/**
|
|
5611
5614
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5612
5615
|
* Manual edits will be overwritten.
|
|
5613
5616
|
*
|
|
@@ -5615,9 +5618,8 @@ const _c = `/**
|
|
|
5615
5618
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5616
5619
|
*
|
|
5617
5620
|
* If you need to provide additional typings, create a separate file.
|
|
5618
|
-
|
|
5619
|
-
/// <reference types="@arcgis/
|
|
5620
|
-
/// <reference types="@arcgis/core/interfaces" />`, Si = "@arcgis/lumina:dependencySupport", Un = (e, t) => e.viteCommand === "serve" && /**
|
|
5621
|
+
*/`, Uc = `
|
|
5622
|
+
/// <reference types="@arcgis/core/interfaces" />`, Si = "@arcgis/lumina:dependencySupport", zn = (e, t) => e.viteCommand === "serve" && /**
|
|
5621
5623
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5622
5624
|
* However, it is a bit buggy (see
|
|
5623
5625
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5628,10 +5630,10 @@ const _c = `/**
|
|
|
5628
5630
|
* is doing:
|
|
5629
5631
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5630
5632
|
*/
|
|
5631
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
5633
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, zc = (e) => ({
|
|
5632
5634
|
name: Si,
|
|
5633
5635
|
configResolved() {
|
|
5634
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
5636
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = qc(e).catch(
|
|
5635
5637
|
(t) => console.error(`${Si}: Failed to update package's src/lumina.ts`, t)
|
|
5636
5638
|
));
|
|
5637
5639
|
},
|
|
@@ -5639,7 +5641,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5639
5641
|
// Add imports to index.html before Vite starts resolving imports
|
|
5640
5642
|
order: "pre",
|
|
5641
5643
|
async handler(t, i) {
|
|
5642
|
-
return
|
|
5644
|
+
return zn(e, i) ? (await ye(e)).map(
|
|
5643
5645
|
(s) => "javascriptCode" in s ? {
|
|
5644
5646
|
tag: "script",
|
|
5645
5647
|
attrs: {
|
|
@@ -5679,9 +5681,9 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5679
5681
|
await e._updateLuminaTsPromise;
|
|
5680
5682
|
}
|
|
5681
5683
|
});
|
|
5682
|
-
async function
|
|
5683
|
-
const i = (await Promise.all([ue,
|
|
5684
|
-
if (!await
|
|
5684
|
+
async function qc(e) {
|
|
5685
|
+
const i = (await Promise.all([ue, Nn(e)])).flat();
|
|
5686
|
+
if (!await Un(
|
|
5685
5687
|
i,
|
|
5686
5688
|
e.dir.src,
|
|
5687
5689
|
B,
|
|
@@ -5690,27 +5692,27 @@ async function zc(e) {
|
|
|
5690
5692
|
return;
|
|
5691
5693
|
let s = !1;
|
|
5692
5694
|
function r() {
|
|
5693
|
-
s || console.warn(
|
|
5695
|
+
s || console.warn(Gc), s = !0;
|
|
5694
5696
|
}
|
|
5695
5697
|
process.on("exit", () => {
|
|
5696
5698
|
r(), clearTimeout(c);
|
|
5697
5699
|
});
|
|
5698
5700
|
const c = setTimeout(r, 2e3);
|
|
5699
5701
|
}
|
|
5700
|
-
const
|
|
5702
|
+
const Gc = Ai.greenBright(
|
|
5701
5703
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
5702
5704
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
5703
5705
|
);
|
|
5704
|
-
var
|
|
5706
|
+
var Vc = Object.defineProperty, P = (e, t, i, n) => {
|
|
5705
5707
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
5706
5708
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
5707
|
-
return s &&
|
|
5709
|
+
return s && Vc(t, i, s), s;
|
|
5708
5710
|
};
|
|
5709
|
-
const
|
|
5711
|
+
const Ce = "@arcgis/lumina:compilerContextPlugin";
|
|
5710
5712
|
class $ {
|
|
5711
5713
|
constructor(t) {
|
|
5712
5714
|
this.typeScriptProgram = void 0, this.typeScriptTypeChecker = void 0, this.typeScriptWatchProgram = void 0, this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._typeScriptReload = void 0, this._plugin = {
|
|
5713
|
-
name:
|
|
5715
|
+
name: Ce,
|
|
5714
5716
|
// Make sure these globals are available to all plugins as soon as possible
|
|
5715
5717
|
enforce: "pre",
|
|
5716
5718
|
apply: (s, r) => (this._inferBuildSetup(r, s.define), !0),
|
|
@@ -5720,7 +5722,7 @@ class $ {
|
|
|
5720
5722
|
this.viteConfig = s;
|
|
5721
5723
|
const r = s.build.minify !== !1;
|
|
5722
5724
|
this.shouldMinify = r && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
5723
|
-
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 ??
|
|
5725
|
+
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 ?? De, u.sep), y = u.join(f, "assets", u.sep);
|
|
5724
5726
|
if (this.dir = {
|
|
5725
5727
|
root: a,
|
|
5726
5728
|
src: c,
|
|
@@ -5730,15 +5732,15 @@ class $ {
|
|
|
5730
5732
|
distComponents: m,
|
|
5731
5733
|
distCdn: f,
|
|
5732
5734
|
distCdnAssets: y
|
|
5733
|
-
}, s.root !==
|
|
5735
|
+
}, s.root !== Ae())
|
|
5734
5736
|
throw new Error(
|
|
5735
|
-
`${
|
|
5737
|
+
`${Ce}: Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2126 or contact Lumina maintainers.`
|
|
5736
5738
|
);
|
|
5737
5739
|
d === a ? console.warn(
|
|
5738
|
-
`${
|
|
5740
|
+
`${Ce}: Vite output directory is set to the root directory. This can produce unexpected behavior. Please set the output directory to a subdirectory of the root directory (i.e dist/)`
|
|
5739
5741
|
) : p.startsWith("..") && console.warn(
|
|
5740
|
-
`${
|
|
5741
|
-
), this.isInStorybook = s.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(s.server?.hmr ?? !0), ac(this, s.build.sourcemap !== !1),
|
|
5742
|
+
`${Ce}: Vite output directory is outside the root directory. This is not officially supported by Lumina and may lead to unexpected behavior. Contact Lumina maintainers if you need this to be supported.`
|
|
5743
|
+
), this.isInStorybook = s.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(s.server?.hmr ?? !0), ac(this, s.build.sourcemap !== !1), zn(this) && ye(this).catch(console.error);
|
|
5742
5744
|
}
|
|
5743
5745
|
},
|
|
5744
5746
|
configureServer: {
|
|
@@ -5755,9 +5757,9 @@ class $ {
|
|
|
5755
5757
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? se(i.jetBrains.webTypesFileName) : re.webTypes,
|
|
5756
5758
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? se(i.vsCode.htmlFileName) : re.vsCodeHtml,
|
|
5757
5759
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? se(i.vsCode.cssFileName) : re.vsCodeCss
|
|
5758
|
-
},
|
|
5759
|
-
const n = t.build?.preamble ??
|
|
5760
|
-
this.banner =
|
|
5760
|
+
}, cn().catch(console.error), this.componentFilesPromise = Tt(this, u.resolve("src/components")), oc(this);
|
|
5761
|
+
const n = t.build?.preamble ?? Bc();
|
|
5762
|
+
this.banner = Wc(n);
|
|
5761
5763
|
}
|
|
5762
5764
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
5763
5765
|
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (console.warn(`${Et}: Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -5898,7 +5900,7 @@ P([
|
|
|
5898
5900
|
P([
|
|
5899
5901
|
x("configResolved()")
|
|
5900
5902
|
], $.prototype, "_typeScriptPrinter");
|
|
5901
|
-
const
|
|
5903
|
+
const Xc = (e) => ({
|
|
5902
5904
|
name: "@arcgis/lumina:addNonLazyImports",
|
|
5903
5905
|
apply: () => e.viteCommand === "build",
|
|
5904
5906
|
generateBundle(t, i) {
|
|
@@ -5906,7 +5908,7 @@ const Vc = (e) => ({
|
|
|
5906
5908
|
const r = de(n, "components/", e);
|
|
5907
5909
|
if (r !== n && (s.fileName = r), s.type === "chunk") {
|
|
5908
5910
|
const a = u.dirname(u.join(e.dir.dist, n)), c = r === n ? a : u.dirname(u.join(e.dir.dist, r));
|
|
5909
|
-
s.code =
|
|
5911
|
+
s.code = Fi(s.code, e, c, a);
|
|
5910
5912
|
}
|
|
5911
5913
|
});
|
|
5912
5914
|
},
|
|
@@ -5919,7 +5921,7 @@ const Vc = (e) => ({
|
|
|
5919
5921
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: l }]) => {
|
|
5920
5922
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
5921
5923
|
return;
|
|
5922
|
-
const d =
|
|
5924
|
+
const d = qn(t, l, n);
|
|
5923
5925
|
if (d.forEach((p) => {
|
|
5924
5926
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
5925
5927
|
}), (a.length > 0 || c.length > 0) && d.length === 0) {
|
|
@@ -5934,34 +5936,34 @@ const Vc = (e) => ({
|
|
|
5934
5936
|
return [];
|
|
5935
5937
|
const l = u.dirname(r), d = de(l, e.dir.srcComponents, e), p = u.relative(e.dir.src, d);
|
|
5936
5938
|
function m(I) {
|
|
5937
|
-
const
|
|
5938
|
-
if (
|
|
5939
|
-
return
|
|
5939
|
+
const w = Ka(Ja(e, I, r), p);
|
|
5940
|
+
if (w !== `./${p}`)
|
|
5941
|
+
return w.startsWith(".") ? `${w}/${bi}` : w;
|
|
5940
5942
|
}
|
|
5941
5943
|
const f = new Set(a), y = new Set(c), h = Array.from(f, m).filter(j), v = (I) => `import "${I}";
|
|
5942
|
-
`, g = h.map(v).join(""),
|
|
5943
|
-
const
|
|
5944
|
-
if (
|
|
5944
|
+
`, g = h.map(v).join(""), S = /* @__PURE__ */ new Set(), b = Array.from(y, (I) => {
|
|
5945
|
+
const w = m(I);
|
|
5946
|
+
if (w !== void 0) {
|
|
5945
5947
|
if (f.has(I)) {
|
|
5946
5948
|
console.warn(
|
|
5947
5949
|
`@arcgis/lumina: "${I}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
|
|
5948
5950
|
);
|
|
5949
5951
|
return;
|
|
5950
5952
|
}
|
|
5951
|
-
return
|
|
5953
|
+
return S.add(v(w)), `.set("${I}", () => import("${w}"))
|
|
5952
5954
|
`;
|
|
5953
5955
|
}
|
|
5954
|
-
}).filter(j), E = `${g}export * from "./${ft}";`, C = Array.from(
|
|
5956
|
+
}).filter(j), E = `${g}export * from "./${ft}";`, C = Array.from(S).join("") + E, T = b.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
5955
5957
|
${E}
|
|
5956
5958
|
deferredLoaders${b.join("")};` : E;
|
|
5957
5959
|
return [
|
|
5958
5960
|
L(u.join(e.dir.dist, p, bi), T),
|
|
5959
|
-
L(u.join(e.dir.dist, p,
|
|
5961
|
+
L(u.join(e.dir.dist, p, Qc), C)
|
|
5960
5962
|
];
|
|
5961
5963
|
});
|
|
5962
5964
|
await Promise.all(s);
|
|
5963
5965
|
}
|
|
5964
|
-
}), bi = "index.js",
|
|
5966
|
+
}), bi = "index.js", Qc = "index.d.ts", qn = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), qn(e, e[s].referencedBy, i, n))), Yc = (e) => ({
|
|
5965
5967
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5966
5968
|
configureServer(t) {
|
|
5967
5969
|
e.server = t, !e.isInPuppeteerTestBackEnd && Ti(e).forEach(({ assets: i, transformers: n }) => le(e, i, n));
|
|
@@ -5969,7 +5971,7 @@ deferredLoaders${b.join("")};` : E;
|
|
|
5969
5971
|
async writeBundle() {
|
|
5970
5972
|
await Promise.all(
|
|
5971
5973
|
Ti(e).map(
|
|
5972
|
-
async ({ assets: t, transformers: i }) => await
|
|
5974
|
+
async ({ assets: t, transformers: i }) => await Mn(e, t, i)
|
|
5973
5975
|
)
|
|
5974
5976
|
);
|
|
5975
5977
|
}
|
|
@@ -5980,20 +5982,20 @@ function Ti(e) {
|
|
|
5980
5982
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
5981
5983
|
}), t.length > 0 && i.push({ assets: t }), e.assetsToProvide = void 0, i;
|
|
5982
5984
|
}
|
|
5983
|
-
const Ei = "@arcgis/lumina:updatePackageJson",
|
|
5985
|
+
const Ei = "@arcgis/lumina:updatePackageJson", Zc = (e) => ({
|
|
5984
5986
|
name: Ei,
|
|
5985
5987
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5986
5988
|
configResolved() {
|
|
5987
|
-
|
|
5989
|
+
el(e).catch(
|
|
5988
5990
|
(t) => console.error(`${Ei}: Failed to update package's package.json`, t)
|
|
5989
5991
|
);
|
|
5990
5992
|
}
|
|
5991
5993
|
});
|
|
5992
|
-
async function
|
|
5993
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await D(t, "utf-8")), n =
|
|
5994
|
+
async function el(e) {
|
|
5995
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await D(t, "utf-8")), n = tl(i, e);
|
|
5994
5996
|
n && Ii(t, JSON.stringify(n, null, 2));
|
|
5995
5997
|
}
|
|
5996
|
-
function
|
|
5998
|
+
function tl(e, t) {
|
|
5997
5999
|
const i = e?.devDependencies ?? {};
|
|
5998
6000
|
Object.keys(e?.peerDependencies ?? {}).forEach((a) => {
|
|
5999
6001
|
a in i || console.error(
|
|
@@ -6021,20 +6023,20 @@ function el(e, t) {
|
|
|
6021
6023
|
if (n)
|
|
6022
6024
|
return e;
|
|
6023
6025
|
}
|
|
6024
|
-
const
|
|
6026
|
+
const il = (e) => ({
|
|
6025
6027
|
timestamp: e.apiJson.timestamp,
|
|
6026
6028
|
compiler: e.apiJson.compiler,
|
|
6027
|
-
components:
|
|
6029
|
+
components: nl(e),
|
|
6028
6030
|
typeLibrary: {}
|
|
6029
6031
|
});
|
|
6030
|
-
function
|
|
6032
|
+
function nl(e) {
|
|
6031
6033
|
const t = [];
|
|
6032
6034
|
for (const i of e.apiJson.modules)
|
|
6033
6035
|
for (const n of i.declarations)
|
|
6034
|
-
"customElement" in n && t.push(
|
|
6036
|
+
"customElement" in n && t.push(sl(n, i.path));
|
|
6035
6037
|
return t;
|
|
6036
6038
|
}
|
|
6037
|
-
function
|
|
6039
|
+
function sl(e, t) {
|
|
6038
6040
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6039
6041
|
return {
|
|
6040
6042
|
filePath: t,
|
|
@@ -6049,9 +6051,9 @@ function nl(e, t) {
|
|
|
6049
6051
|
dependencies: [],
|
|
6050
6052
|
dependencyGraph: {},
|
|
6051
6053
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6052
|
-
props: e.members.map(
|
|
6053
|
-
methods: e.members.map(
|
|
6054
|
-
events: e.events?.map(
|
|
6054
|
+
props: e.members.map(rl).filter(j),
|
|
6055
|
+
methods: e.members.map(ol).filter(j),
|
|
6056
|
+
events: e.events?.map(al) ?? [],
|
|
6055
6057
|
styles: e.cssProperties?.map((n) => ({
|
|
6056
6058
|
name: n.name,
|
|
6057
6059
|
annotation: "prop",
|
|
@@ -6063,7 +6065,7 @@ function nl(e, t) {
|
|
|
6063
6065
|
listeners: []
|
|
6064
6066
|
};
|
|
6065
6067
|
}
|
|
6066
|
-
function
|
|
6068
|
+
function rl(e) {
|
|
6067
6069
|
if (e.kind !== "field")
|
|
6068
6070
|
return;
|
|
6069
6071
|
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;
|
|
@@ -6104,7 +6106,7 @@ const Lt = (e) => Object.fromEntries(
|
|
|
6104
6106
|
]
|
|
6105
6107
|
) ?? []
|
|
6106
6108
|
);
|
|
6107
|
-
function
|
|
6109
|
+
function ol(e) {
|
|
6108
6110
|
if (e.kind !== "method")
|
|
6109
6111
|
return;
|
|
6110
6112
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], n = t.parameters?.map(({ name: s, type: r, description: a }) => ({
|
|
@@ -6135,7 +6137,7 @@ function rl(e) {
|
|
|
6135
6137
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
6136
6138
|
};
|
|
6137
6139
|
}
|
|
6138
|
-
function
|
|
6140
|
+
function al(e) {
|
|
6139
6141
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
6140
6142
|
return {
|
|
6141
6143
|
event: e.name,
|
|
@@ -6153,32 +6155,32 @@ function ol(e) {
|
|
|
6153
6155
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated
|
|
6154
6156
|
};
|
|
6155
6157
|
}
|
|
6156
|
-
const
|
|
6158
|
+
const Gn = (e) => e.flatMap(
|
|
6157
6159
|
(t) => t.cssProperties?.map((i) => ({
|
|
6158
6160
|
name: i.name,
|
|
6159
6161
|
description: i.description || void 0
|
|
6160
6162
|
})) ?? []
|
|
6161
|
-
),
|
|
6163
|
+
), Vn = (e) => e.flatMap(
|
|
6162
6164
|
(t) => t.cssParts?.map((i) => ({
|
|
6163
6165
|
name: `::part(${i.name})`,
|
|
6164
6166
|
description: i.description || void 0
|
|
6165
6167
|
})) ?? []
|
|
6166
|
-
),
|
|
6168
|
+
), cl = (e) => e.attributes?.map((t) => ({
|
|
6167
6169
|
name: t.name ?? "",
|
|
6168
|
-
description:
|
|
6170
|
+
description: ze(t.description, t.deprecated) || void 0,
|
|
6169
6171
|
default: t.default,
|
|
6170
6172
|
value: {
|
|
6171
|
-
type:
|
|
6173
|
+
type: ll(t.type.values?.map(Gi))
|
|
6172
6174
|
}
|
|
6173
|
-
})) ?? [],
|
|
6175
|
+
})) ?? [], ll = (e) => e?.length === 1 ? e[0] : e, ze = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
|
|
6174
6176
|
slots: "Slots",
|
|
6175
6177
|
events: "Events",
|
|
6176
6178
|
cssProperties: "CSS Properties",
|
|
6177
6179
|
cssParts: "CSS Parts",
|
|
6178
6180
|
methods: "Methods"
|
|
6179
6181
|
};
|
|
6180
|
-
function
|
|
6181
|
-
const t =
|
|
6182
|
+
function Xn(e) {
|
|
6183
|
+
const t = dl(e.slots), i = pl(e.events), n = ul(e.cssProperties), s = ml(e.cssParts), r = fl(e.members), a = ze(e.description, e.deprecated).trim();
|
|
6182
6184
|
return [...a ? [`${a}
|
|
6183
6185
|
--`] : [], i, r, t, n, s].filter(Boolean).join(`
|
|
6184
6186
|
|
|
@@ -6186,28 +6188,28 @@ function Vn(e) {
|
|
|
6186
6188
|
}
|
|
6187
6189
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6188
6190
|
${t.join(`
|
|
6189
|
-
`)}`,
|
|
6191
|
+
`)}`, dl = (e) => ve(
|
|
6190
6192
|
ge.slots,
|
|
6191
6193
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6192
|
-
),
|
|
6194
|
+
), pl = (e) => ve(
|
|
6193
6195
|
ge.events,
|
|
6194
6196
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6195
|
-
),
|
|
6197
|
+
), ul = (e = []) => ve(
|
|
6196
6198
|
ge.cssProperties,
|
|
6197
6199
|
e?.map(
|
|
6198
6200
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6199
6201
|
)
|
|
6200
|
-
),
|
|
6202
|
+
), ml = (e) => ve(
|
|
6201
6203
|
ge.cssParts,
|
|
6202
6204
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6203
|
-
),
|
|
6205
|
+
), fl = (e) => ve(
|
|
6204
6206
|
ge.methods,
|
|
6205
|
-
e.filter(
|
|
6206
|
-
(t) => [`- \`${t.name}${t.signature}\``,
|
|
6207
|
+
e.filter(is).map(
|
|
6208
|
+
(t) => [`- \`${t.name}${t.signature}\``, ze(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6207
6209
|
)
|
|
6208
6210
|
);
|
|
6209
|
-
function
|
|
6210
|
-
const i =
|
|
6211
|
+
function yl(e, t) {
|
|
6212
|
+
const i = hl(e), n = Gn(e), s = Vn(e), r = R();
|
|
6211
6213
|
return {
|
|
6212
6214
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
6213
6215
|
name: r.name,
|
|
@@ -6225,21 +6227,21 @@ function fl(e, t) {
|
|
|
6225
6227
|
}
|
|
6226
6228
|
};
|
|
6227
6229
|
}
|
|
6228
|
-
const
|
|
6230
|
+
const hl = (e) => e.map((t) => ({
|
|
6229
6231
|
name: t.tagName,
|
|
6230
|
-
description:
|
|
6232
|
+
description: Xn(t),
|
|
6231
6233
|
"doc-url": t.demos?.[0]?.url,
|
|
6232
|
-
attributes:
|
|
6234
|
+
attributes: cl(t),
|
|
6233
6235
|
slots: t.slots?.map((i) => ({
|
|
6234
6236
|
name: i.name,
|
|
6235
6237
|
description: i.description
|
|
6236
6238
|
})),
|
|
6237
6239
|
events: Ci(t),
|
|
6238
6240
|
js: {
|
|
6239
|
-
properties:
|
|
6241
|
+
properties: gl(t),
|
|
6240
6242
|
events: Ci(t)
|
|
6241
6243
|
}
|
|
6242
|
-
})),
|
|
6244
|
+
})), gl = (e) => e.members.filter(ns).map((t) => ({
|
|
6243
6245
|
name: t.name,
|
|
6244
6246
|
description: t.description,
|
|
6245
6247
|
type: t.type?.text
|
|
@@ -6247,30 +6249,30 @@ const yl = (e) => e.map((t) => ({
|
|
|
6247
6249
|
name: t.name,
|
|
6248
6250
|
type: t.type?.text,
|
|
6249
6251
|
description: t.description
|
|
6250
|
-
})) ?? [],
|
|
6252
|
+
})) ?? [], vl = (e) => e.map((t) => ({
|
|
6251
6253
|
name: t.tagName,
|
|
6252
|
-
description:
|
|
6253
|
-
attributes:
|
|
6254
|
+
description: Xn(t),
|
|
6255
|
+
attributes: wl(t),
|
|
6254
6256
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
6255
|
-
})),
|
|
6257
|
+
})), wl = (e) => e.attributes?.map((t) => ({
|
|
6256
6258
|
name: t.name,
|
|
6257
|
-
description:
|
|
6258
|
-
values:
|
|
6259
|
-
})) ?? [],
|
|
6259
|
+
description: ze(t.description, t.deprecated) || void 0,
|
|
6260
|
+
values: Sl(t)
|
|
6261
|
+
})) ?? [], Sl = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], bl = (e) => ({
|
|
6260
6262
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
6261
6263
|
version: 1.1,
|
|
6262
|
-
tags:
|
|
6263
|
-
}),
|
|
6264
|
+
tags: vl(e)
|
|
6265
|
+
}), Tl = (e) => ({
|
|
6264
6266
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
6265
6267
|
version: 1.1,
|
|
6266
|
-
properties:
|
|
6267
|
-
pseudoElements:
|
|
6268
|
-
}),
|
|
6269
|
-
function
|
|
6268
|
+
properties: Gn(e),
|
|
6269
|
+
pseudoElements: Vn(e)
|
|
6270
|
+
}), El = "@arcgis/lumina:generateDocs";
|
|
6271
|
+
function Cl(e) {
|
|
6270
6272
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
6271
6273
|
{
|
|
6272
6274
|
type: "dynamic",
|
|
6273
|
-
source: () => JSON.stringify(
|
|
6275
|
+
source: () => JSON.stringify(il(e), null, 2),
|
|
6274
6276
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
6275
6277
|
}
|
|
6276
6278
|
]), e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
@@ -6280,34 +6282,34 @@ function El(e) {
|
|
|
6280
6282
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
6281
6283
|
}
|
|
6282
6284
|
]), {
|
|
6283
|
-
name:
|
|
6285
|
+
name: El,
|
|
6284
6286
|
async writeBundle() {
|
|
6285
6287
|
if (e.isInStorybook)
|
|
6286
6288
|
return;
|
|
6287
6289
|
const { jetBrains: t } = e.options.documentation ?? {}, i = e._documentationFileNames, n = i.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, i.vsCodeHtml), s = i.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, i.vsCodeCss), r = i.webTypes === void 0 ? void 0 : u.join(e.dir.dist, i.webTypes), a = [n, s, r].filter(j);
|
|
6288
6290
|
if (a.length === 0)
|
|
6289
6291
|
return;
|
|
6290
|
-
await
|
|
6292
|
+
await Wn(a);
|
|
6291
6293
|
const c = [];
|
|
6292
6294
|
if (n !== void 0) {
|
|
6293
|
-
const l = JSON.stringify(
|
|
6295
|
+
const l = JSON.stringify(bl(e.apiJsonComponents), null, 2);
|
|
6294
6296
|
c.push(L(n, l));
|
|
6295
6297
|
}
|
|
6296
6298
|
if (s !== void 0) {
|
|
6297
|
-
const l = JSON.stringify(
|
|
6299
|
+
const l = JSON.stringify(Tl(e.apiJsonComponents), null, 2);
|
|
6298
6300
|
c.push(L(s, l));
|
|
6299
6301
|
}
|
|
6300
6302
|
if (r !== void 0) {
|
|
6301
|
-
const l =
|
|
6303
|
+
const l = yl(e.apiJsonComponents, typeof t == "object" ? t : {});
|
|
6302
6304
|
c.push(L(r, JSON.stringify(l, null, 2)));
|
|
6303
6305
|
}
|
|
6304
6306
|
await Promise.all(c);
|
|
6305
6307
|
}
|
|
6306
6308
|
};
|
|
6307
6309
|
}
|
|
6308
|
-
const
|
|
6310
|
+
const $l = (e) => `import type { h, EventHandler } from "@arcgis/lumina";
|
|
6309
6311
|
|
|
6310
|
-
${e.map(
|
|
6312
|
+
${e.map(xl).join(`
|
|
6311
6313
|
|
|
6312
6314
|
`)}
|
|
6313
6315
|
|
|
@@ -6319,8 +6321,8 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6319
6321
|
}
|
|
6320
6322
|
}
|
|
6321
6323
|
}`;
|
|
6322
|
-
function
|
|
6323
|
-
const [s, r] =
|
|
6324
|
+
function xl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6325
|
+
const [s, r] = Ue(e, i);
|
|
6324
6326
|
return [
|
|
6325
6327
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6326
6328
|
`,
|
|
@@ -6332,7 +6334,7 @@ function $l({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6332
6334
|
r
|
|
6333
6335
|
].join("");
|
|
6334
6336
|
}
|
|
6335
|
-
function
|
|
6337
|
+
function Pl(e) {
|
|
6336
6338
|
const t = ` interface IntrinsicElements extends PreactJsx.IntrinsicElements {
|
|
6337
6339
|
${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join(`
|
|
6338
6340
|
`)}
|
|
@@ -6340,7 +6342,7 @@ ${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join
|
|
|
6340
6342
|
return `import { JSX as PreactJsx } from "preact";
|
|
6341
6343
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6342
6344
|
|
|
6343
|
-
${e.map(
|
|
6345
|
+
${e.map(Il).join(`
|
|
6344
6346
|
|
|
6345
6347
|
`)}
|
|
6346
6348
|
|
|
@@ -6353,8 +6355,8 @@ ${t}
|
|
|
6353
6355
|
}
|
|
6354
6356
|
}`;
|
|
6355
6357
|
}
|
|
6356
|
-
function
|
|
6357
|
-
const [s, r] =
|
|
6358
|
+
function Il({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6359
|
+
const [s, r] = Ue(e, i);
|
|
6358
6360
|
return [
|
|
6359
6361
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6360
6362
|
`,
|
|
@@ -6366,13 +6368,13 @@ function Pl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6366
6368
|
r
|
|
6367
6369
|
].join("");
|
|
6368
6370
|
}
|
|
6369
|
-
function
|
|
6371
|
+
function Al(e) {
|
|
6370
6372
|
const t = e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": React${i};`).join(`
|
|
6371
6373
|
`);
|
|
6372
6374
|
return `import type { HTMLProps } from 'react';
|
|
6373
6375
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6374
6376
|
|
|
6375
|
-
${e.map(
|
|
6377
|
+
${e.map(kl).join(`
|
|
6376
6378
|
|
|
6377
6379
|
`)}
|
|
6378
6380
|
|
|
@@ -6398,8 +6400,8 @@ ${t}
|
|
|
6398
6400
|
}
|
|
6399
6401
|
}`;
|
|
6400
6402
|
}
|
|
6401
|
-
function
|
|
6402
|
-
const [s, r] =
|
|
6403
|
+
function kl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6404
|
+
const [s, r] = Ue(e, i);
|
|
6403
6405
|
return [
|
|
6404
6406
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6405
6407
|
`,
|
|
@@ -6411,10 +6413,10 @@ function Al({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6411
6413
|
r
|
|
6412
6414
|
].join("");
|
|
6413
6415
|
}
|
|
6414
|
-
const
|
|
6416
|
+
const Ll = (e) => `import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
6415
6417
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6416
6418
|
|
|
6417
|
-
${e.map(
|
|
6419
|
+
${e.map(Fl).join(`
|
|
6418
6420
|
|
|
6419
6421
|
`)}
|
|
6420
6422
|
|
|
@@ -6432,8 +6434,8 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6432
6434
|
interface IntrinsicElements extends ExposedElements {}
|
|
6433
6435
|
}
|
|
6434
6436
|
}`;
|
|
6435
|
-
function
|
|
6436
|
-
const [s, r] =
|
|
6437
|
+
function Fl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6438
|
+
const [s, r] = Ue(e, i);
|
|
6437
6439
|
return [
|
|
6438
6440
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6439
6441
|
`,
|
|
@@ -6445,16 +6447,16 @@ function Ll({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6445
6447
|
r
|
|
6446
6448
|
].join("");
|
|
6447
6449
|
}
|
|
6448
|
-
const
|
|
6450
|
+
const jl = (e, t, i) => [i, t, Nl(e), Dl(e)].join(`
|
|
6449
6451
|
|
|
6450
|
-
`),
|
|
6452
|
+
`), Nl = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6451
6453
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6452
6454
|
detail: T;
|
|
6453
6455
|
target: HTML${t}Element;
|
|
6454
6456
|
currentTarget: HTML${t}Element;
|
|
6455
6457
|
}`
|
|
6456
6458
|
).join(`
|
|
6457
|
-
`),
|
|
6459
|
+
`), Dl = (e) => `export { ToEvents, TargetedEvent } from "@arcgis/lumina";
|
|
6458
6460
|
|
|
6459
6461
|
declare global {
|
|
6460
6462
|
interface HTMLElementTagNameMap {
|
|
@@ -6462,12 +6464,12 @@ ${e.map(({ pascalCaseName: t, tagName: i }) => ` "${i}": HTML${t}Element;`).j
|
|
|
6462
6464
|
`)}
|
|
6463
6465
|
}
|
|
6464
6466
|
|
|
6465
|
-
${e.map(
|
|
6467
|
+
${e.map(Rl).join(`
|
|
6466
6468
|
`).split(`
|
|
6467
6469
|
`).map((t) => t.length > 0 ? ` ${t}` : t).join(`
|
|
6468
6470
|
`)}
|
|
6469
6471
|
}`;
|
|
6470
|
-
function
|
|
6472
|
+
function Rl({ name: e, pascalCaseName: t, events: i = [] }) {
|
|
6471
6473
|
const n = i.length > 0, s = `${t}CustomEvent`, r = `HTML${t}Element`;
|
|
6472
6474
|
return [
|
|
6473
6475
|
n ? `interface ${r}EventMap {
|
|
@@ -6486,7 +6488,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6486
6488
|
}`
|
|
6487
6489
|
].join("");
|
|
6488
6490
|
}
|
|
6489
|
-
function
|
|
6491
|
+
function Ml(e) {
|
|
6490
6492
|
let t;
|
|
6491
6493
|
return {
|
|
6492
6494
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6498,7 +6500,7 @@ function Rl(e) {
|
|
|
6498
6500
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6499
6501
|
e._declarationTextTransformers.push((n) => {
|
|
6500
6502
|
const { filePath: s, content: r } = n;
|
|
6501
|
-
return s === i ? { filePath: s, content:
|
|
6503
|
+
return s === i ? { filePath: s, content: jl(e.apiJsonComponents, r, t) } : n;
|
|
6502
6504
|
});
|
|
6503
6505
|
},
|
|
6504
6506
|
async writeBundle() {
|
|
@@ -6508,10 +6510,10 @@ function Rl(e) {
|
|
|
6508
6510
|
await _(i);
|
|
6509
6511
|
const n = `/// <reference types="../index.d.ts" />
|
|
6510
6512
|
${t.replaceAll("./", "../")}`, s = Object.entries({
|
|
6511
|
-
react:
|
|
6512
|
-
preact:
|
|
6513
|
-
stencil:
|
|
6514
|
-
lumina:
|
|
6513
|
+
react: Al(e.apiJsonComponents),
|
|
6514
|
+
preact: Pl(e.apiJsonComponents),
|
|
6515
|
+
stencil: Ll(e.apiJsonComponents),
|
|
6516
|
+
lumina: $l(e.apiJsonComponents)
|
|
6515
6517
|
}).map(
|
|
6516
6518
|
async ([r, a]) => await L(u.join(i, `${r}.d.ts`), `${n}
|
|
6517
6519
|
${a}`)
|
|
@@ -6520,20 +6522,20 @@ ${a}`)
|
|
|
6520
6522
|
}
|
|
6521
6523
|
};
|
|
6522
6524
|
}
|
|
6523
|
-
function
|
|
6525
|
+
function Ol(e) {
|
|
6524
6526
|
return {
|
|
6525
6527
|
name: "@arcgis/lumina:buildWrappers",
|
|
6526
6528
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
6527
6529
|
async writeBundle() {
|
|
6528
6530
|
e.isInStorybook || await Promise.all(
|
|
6529
6531
|
e.options.build?.wrappers?.map(async (t) => {
|
|
6530
|
-
t.type === "react18" && await
|
|
6532
|
+
t.type === "react18" && await Kl(e, t);
|
|
6531
6533
|
}) ?? []
|
|
6532
6534
|
);
|
|
6533
6535
|
}
|
|
6534
6536
|
};
|
|
6535
6537
|
}
|
|
6536
|
-
const
|
|
6538
|
+
const Jl = `
|
|
6537
6539
|
import React from "react";
|
|
6538
6540
|
import { createComponent } from "@lit/react";
|
|
6539
6541
|
import type { EventName } from "@lit/react";
|
|
@@ -6541,17 +6543,17 @@ import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina"
|
|
|
6541
6543
|
|
|
6542
6544
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
6543
6545
|
`;
|
|
6544
|
-
async function
|
|
6546
|
+
async function Kl(e, t) {
|
|
6545
6547
|
const { name: i } = R(), n = [];
|
|
6546
6548
|
for (const a of e.apiJson.modules)
|
|
6547
6549
|
for (const c of a.declarations)
|
|
6548
|
-
"customElement" in c && n.push(
|
|
6549
|
-
const s = [`/// <reference types="${i}" preserve="true" />`,
|
|
6550
|
+
"customElement" in c && n.push(Bl(c));
|
|
6551
|
+
const s = [`/// <reference types="${i}" preserve="true" />`, Jl, ...n].join(""), r = u.resolve(t.proxiesFile);
|
|
6550
6552
|
await _(u.dirname(r), { recursive: !0 }), await L(r, s);
|
|
6551
6553
|
}
|
|
6552
|
-
function
|
|
6554
|
+
function Bl(e) {
|
|
6553
6555
|
const t = e.events?.map(
|
|
6554
|
-
(i) => ` ${he(`on${
|
|
6556
|
+
(i) => ` ${he(`on${as(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
6555
6557
|
).join(`
|
|
6556
6558
|
`);
|
|
6557
6559
|
return `
|
|
@@ -6565,48 +6567,48 @@ ${t}
|
|
|
6565
6567
|
);
|
|
6566
6568
|
`;
|
|
6567
6569
|
}
|
|
6568
|
-
function
|
|
6570
|
+
function td(e = {}) {
|
|
6569
6571
|
const t = new $(e), i = [
|
|
6570
6572
|
t._plugin,
|
|
6571
|
-
Oc(t),
|
|
6572
6573
|
Jc(t),
|
|
6573
|
-
|
|
6574
|
+
Kc(t),
|
|
6575
|
+
Zc(t),
|
|
6574
6576
|
Pr(t),
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6577
|
+
$c(t),
|
|
6578
|
+
Ml(t),
|
|
6579
|
+
Cl(t),
|
|
6578
6580
|
sc(t),
|
|
6579
6581
|
ro(t),
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6582
|
+
Lc(t),
|
|
6583
|
+
Yc(t),
|
|
6584
|
+
Xc(t),
|
|
6585
|
+
zc(t),
|
|
6584
6586
|
hs(t),
|
|
6585
6587
|
dc(t),
|
|
6586
6588
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
6587
6589
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6590
|
+
jc(t),
|
|
6591
|
+
Ol(t),
|
|
6592
|
+
Nc(t)
|
|
6591
6593
|
].filter(j);
|
|
6592
6594
|
return i.context = t, i;
|
|
6593
6595
|
}
|
|
6594
|
-
const
|
|
6595
|
-
initializeComponentDependencies:
|
|
6596
|
-
updateLuminaTs:
|
|
6597
|
-
propertyToAttributeMappings:
|
|
6598
|
-
findDeclaredComponents:
|
|
6599
|
-
nativeEvents:
|
|
6596
|
+
const id = {
|
|
6597
|
+
initializeComponentDependencies: cn,
|
|
6598
|
+
updateLuminaTs: Un,
|
|
6599
|
+
propertyToAttributeMappings: J,
|
|
6600
|
+
findDeclaredComponents: ji,
|
|
6601
|
+
nativeEvents: Bi,
|
|
6600
6602
|
svgElements: ht,
|
|
6601
6603
|
mathMlElements: gt,
|
|
6602
|
-
alwaysAttributes:
|
|
6603
|
-
nativeAlwaysAttributes:
|
|
6604
|
+
alwaysAttributes: Oi,
|
|
6605
|
+
nativeAlwaysAttributes: Ji,
|
|
6604
6606
|
htmlAlwaysAttributes: ct,
|
|
6605
|
-
isPropertyEscapeNeeded:
|
|
6607
|
+
isPropertyEscapeNeeded: He
|
|
6606
6608
|
};
|
|
6607
6609
|
export {
|
|
6608
6610
|
jo as LuminaApiExtractor,
|
|
6609
|
-
|
|
6610
|
-
|
|
6611
|
-
|
|
6611
|
+
id as exportsForCodemod,
|
|
6612
|
+
We as inferCdnUrl,
|
|
6613
|
+
td as useLumina
|
|
6612
6614
|
};
|