@arcgis/lumina-compiler 6.0.0-next.14 → 6.0.0-next.16
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 +686 -675
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { externalizeDependencies as Cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
|
|
2
2
|
import { isNotUndefined as F } from "@arcgis/toolkit/predicate";
|
|
3
|
-
import { f as b, l as
|
|
3
|
+
import { f as b, l as $ } from "./chunks/logger.js";
|
|
4
4
|
import o from "typescript";
|
|
5
5
|
import { camelToKebab as ri, getPreamble as Es, uncapitalize as Et } from "@arcgis/toolkit/string";
|
|
6
6
|
import { lazyMetaSubItemJoiner as Ts, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as $s, propertyFlagAttribute as Tt, propertyFlagReflect as Ps, propertyFlagBoolean as ks, propertyFlagNumber as Is, propertyFlagState as xs, propertyFlagReadOnly as As, propertyFlagNoAccessor as Ls, propertyFlagUseDefault as Ns } from "@arcgis/lumina/config";
|
|
7
7
|
import { path as u, isPosix as ni, toPosixPathSeparators as G, toSystemPathSeparators as De, getCwd as oi } from "@arcgis/node-toolkit/path";
|
|
8
8
|
import { isApiMethodAsync as js, globalPackageIdentifier as Fs, isApiMethod as Ds, isApiProperty as Rs } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
|
-
import { existsAsync as
|
|
9
|
+
import { existsAsync as _, findPath as at } from "@arcgis/node-toolkit/file";
|
|
10
10
|
import { readFile as W, readdir as ct, mkdir as ie, writeFile as z, copyFile as Os, rm as Ms, cp as Js } from "node:fs/promises";
|
|
11
11
|
import { retrievePackageJson as D, fetchPackageLocation as $e, asyncRetrievePackageJson as ai } from "@arcgis/node-toolkit/packageJson";
|
|
12
12
|
import { build as Bs } from "esbuild";
|
|
@@ -100,7 +100,7 @@ const Qs = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
100
100
|
meta: /* @__PURE__ */ new Set(["charset"]),
|
|
101
101
|
math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
|
|
102
102
|
menu: /* @__PURE__ */ new Set(["label", "type"])
|
|
103
|
-
},
|
|
103
|
+
}, U = {
|
|
104
104
|
common: {
|
|
105
105
|
reflected: {
|
|
106
106
|
hidden: "hidden",
|
|
@@ -913,8 +913,8 @@ const Qs = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
|
-
fi(
|
|
917
|
-
Object.values(
|
|
916
|
+
fi(U.common);
|
|
917
|
+
Object.values(U.perElement).forEach(fi);
|
|
918
918
|
function fi(e) {
|
|
919
919
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
920
920
|
/* @__PURE__ */ Object.create(null),
|
|
@@ -1149,8 +1149,8 @@ function ir(e) {
|
|
|
1149
1149
|
`)) {
|
|
1150
1150
|
const n = t === `
|
|
1151
1151
|
`, r = e.lastIndexOf(`
|
|
1152
|
-
`),
|
|
1153
|
-
return
|
|
1152
|
+
`), l = e.slice(r + 1).trim().length === 0, d = n ? e.trimStart() : e;
|
|
1153
|
+
return l ? d.trimEnd() : d;
|
|
1154
1154
|
}
|
|
1155
1155
|
return e.trim().length === 0 ? t : e;
|
|
1156
1156
|
}
|
|
@@ -1222,20 +1222,20 @@ const sr = (e) => e.replaceAll("\\", "\\\\").replace(rr, "\\${").replaceAll("`",
|
|
|
1222
1222
|
...s,
|
|
1223
1223
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
1224
1224
|
async handler(r, a) {
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1225
|
+
const l = a.endsWith(Ie);
|
|
1226
|
+
l && (a = a.slice(0, -Ie.length));
|
|
1227
1227
|
const d = a.endsWith(Y);
|
|
1228
1228
|
d && (a = a.slice(0, -Y.length));
|
|
1229
|
-
const
|
|
1230
|
-
if (
|
|
1229
|
+
const c = a.endsWith(Ze);
|
|
1230
|
+
if (c && (a = a.slice(0, -Ze.length)), !l && !d && !c)
|
|
1231
1231
|
return await s.handler.call(this, r, a);
|
|
1232
1232
|
const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1233
|
-
return typeof f != "string" || !f.startsWith(Si) || !f.endsWith(vr) ? (
|
|
1233
|
+
return typeof f != "string" || !f.startsWith(Si) || !f.endsWith(vr) ? ($.warn(
|
|
1234
1234
|
de,
|
|
1235
1235
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1236
1236
|
f
|
|
1237
1237
|
)}`
|
|
1238
|
-
), m) :
|
|
1238
|
+
), m) : c ? (e._globalCssString = Ci(f), { code: "", map: { mappings: "" } }) : {
|
|
1239
1239
|
...g,
|
|
1240
1240
|
code: Cr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1241
1241
|
/**
|
|
@@ -1261,10 +1261,10 @@ if(import.meta.hot) {
|
|
|
1261
1261
|
});
|
|
1262
1262
|
}`, Ci = (e) => e.slice(Si.length - 1);
|
|
1263
1263
|
function Cr(e, t, i, s) {
|
|
1264
|
-
const n = Ci(e), r = JSON.parse(n), a = sr(r),
|
|
1264
|
+
const n = Ci(e), r = JSON.parse(n), a = sr(r), l = s ? `@layer{${i ? "" : `
|
|
1265
1265
|
`}${a}${i ? "" : `
|
|
1266
1266
|
`}}` : a;
|
|
1267
|
-
return `${br}${
|
|
1267
|
+
return `${br}${l}${wr}${t ? Sr : ""}`;
|
|
1268
1268
|
}
|
|
1269
1269
|
function Er(e) {
|
|
1270
1270
|
return `import("${Tr}").then(({ setCustomElementsManifest }) => {
|
|
@@ -1339,7 +1339,7 @@ const Lr = (e, t, i) => [
|
|
|
1339
1339
|
"]"
|
|
1340
1340
|
].join("");
|
|
1341
1341
|
function Nr(e) {
|
|
1342
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = $i(e), r = t.map((g) => g.join(Ts)).join(Je), a = i.join(Je),
|
|
1342
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = $i(e), r = t.map((g) => g.join(Ts)).join(Je), a = i.join(Je), l = s.join(Je), d = [r, a, l], c = d.findLastIndex((g) => g.length > 0), p = d.slice(0, c + 1);
|
|
1343
1343
|
return `${p.length > 0 || n ? `"${p.join($s)}"` : ""}${n ? ",1" : ""}`;
|
|
1344
1344
|
}
|
|
1345
1345
|
function $i(e) {
|
|
@@ -1347,9 +1347,9 @@ function $i(e) {
|
|
|
1347
1347
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1348
1348
|
const a = e.members[r];
|
|
1349
1349
|
if (a.kind === "field") {
|
|
1350
|
-
const
|
|
1350
|
+
const l = typeof a.attribute == "string", d = l && a.attribute !== ri(a.name);
|
|
1351
1351
|
t.push(
|
|
1352
|
-
|
|
1352
|
+
l && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
|
|
1353
1353
|
);
|
|
1354
1354
|
} else a.kind === "method" && a.name !== "componentOnReady" && (js(a) ? i.push(a.name) : s.push(a.name));
|
|
1355
1355
|
}
|
|
@@ -1393,12 +1393,12 @@ function Ii() {
|
|
|
1393
1393
|
}
|
|
1394
1394
|
async function Mr(e, t) {
|
|
1395
1395
|
const i = D(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1396
|
-
[...Object.keys(s), ...Object.keys(n)].filter((
|
|
1396
|
+
[...Object.keys(s), ...Object.keys(n)].filter((c) => !Jr.has(c)).flatMap(async (c) => await xi(c, e))
|
|
1397
1397
|
)).filter(F);
|
|
1398
|
-
xe ??= a, et = Object.fromEntries(a.flatMap((
|
|
1399
|
-
const
|
|
1400
|
-
(
|
|
1401
|
-
), d =
|
|
1398
|
+
xe ??= a, et = Object.fromEntries(a.flatMap((c) => Object.entries(c.components)));
|
|
1399
|
+
const l = t?.serve?.extraDependencies?.map(
|
|
1400
|
+
(c) => typeof c == "string" ? c : c.name
|
|
1401
|
+
), d = l === void 0 ? a : a.filter((c) => !l.includes(c.packageName));
|
|
1402
1402
|
return xe ??= d, d;
|
|
1403
1403
|
}
|
|
1404
1404
|
const Jr = /* @__PURE__ */ new Set([
|
|
@@ -1436,20 +1436,20 @@ const Jr = /* @__PURE__ */ new Set([
|
|
|
1436
1436
|
]);
|
|
1437
1437
|
let xe, et, ne;
|
|
1438
1438
|
async function xi(e, t) {
|
|
1439
|
-
const i = await $e(e, t), s = await ai(i), n = "exports" in s, r = Xr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}),
|
|
1440
|
-
if (a ? await
|
|
1441
|
-
const g = await W(
|
|
1439
|
+
const i = await $e(e, t), s = await ai(i), n = "exports" in s, r = Xr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), l = u.join(i, "dist/esm/loader.js");
|
|
1440
|
+
if (a ? await _(l) : !1) {
|
|
1441
|
+
const g = await W(l, "utf8"), h = Br(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1442
1442
|
try {
|
|
1443
|
-
const
|
|
1444
|
-
return { packageName: e, type: "stencil", components:
|
|
1445
|
-
} catch (
|
|
1446
|
-
|
|
1447
|
-
Error: ${String(
|
|
1443
|
+
const S = JSON.parse(w), T = Vr(S, { packageName: e, getImportPath: r });
|
|
1444
|
+
return { packageName: e, type: "stencil", components: T, packageLocation: i, packageJson: s };
|
|
1445
|
+
} catch (S) {
|
|
1446
|
+
$.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
1447
|
+
Error: ${String(S)}`);
|
|
1448
1448
|
}
|
|
1449
1449
|
}
|
|
1450
|
-
const
|
|
1451
|
-
if (
|
|
1452
|
-
const g = u.join(i,
|
|
1450
|
+
const c = It(s.customElements);
|
|
1451
|
+
if (c != null) {
|
|
1452
|
+
const g = u.join(i, c), h = JSON.parse(await W(g, "utf-8")), y = Kr(h), v = Ai(h, {
|
|
1453
1453
|
packageName: e,
|
|
1454
1454
|
getImportPath: r
|
|
1455
1455
|
});
|
|
@@ -1464,7 +1464,7 @@ Error: ${String(C)}`);
|
|
|
1464
1464
|
return { type: "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
|
|
1465
1465
|
}
|
|
1466
1466
|
const m = u.join(i, "dist/components");
|
|
1467
|
-
if (await
|
|
1467
|
+
if (await _(m)) {
|
|
1468
1468
|
const g = await Gr(m, {
|
|
1469
1469
|
packageName: e,
|
|
1470
1470
|
getImportPath: r
|
|
@@ -1488,7 +1488,7 @@ function Ai(e, t, i = !1) {
|
|
|
1488
1488
|
const d = r.declarations[a];
|
|
1489
1489
|
if (d.customElement !== !0)
|
|
1490
1490
|
continue;
|
|
1491
|
-
const
|
|
1491
|
+
const c = (
|
|
1492
1492
|
// New api.json
|
|
1493
1493
|
"sourcePath" in r ? r.path : (
|
|
1494
1494
|
// Older api.json
|
|
@@ -1496,7 +1496,7 @@ function Ai(e, t, i = !1) {
|
|
|
1496
1496
|
)
|
|
1497
1497
|
), p = d.tagName, m = {
|
|
1498
1498
|
packageName: t.packageName,
|
|
1499
|
-
modulePath:
|
|
1499
|
+
modulePath: c ?? t.getImportPath(p),
|
|
1500
1500
|
propToAttribute: Object.fromEntries(
|
|
1501
1501
|
(d.attributes ?? []).map((f) => [f.fieldName ?? f.name, f.name])
|
|
1502
1502
|
),
|
|
@@ -1538,7 +1538,7 @@ const Kr = (e) => (
|
|
|
1538
1538
|
packageName: t.packageName,
|
|
1539
1539
|
modulePath: t.getImportPath(r),
|
|
1540
1540
|
propToAttribute: Object.fromEntries(
|
|
1541
|
-
Object.entries(a ?? {}).filter(([
|
|
1541
|
+
Object.entries(a ?? {}).filter(([l, [d]]) => d & Hr).map(([l, [d, c = l]]) => [l, c])
|
|
1542
1542
|
)
|
|
1543
1543
|
}
|
|
1544
1544
|
]
|
|
@@ -1563,7 +1563,7 @@ function Qr(e, t) {
|
|
|
1563
1563
|
}
|
|
1564
1564
|
const Li = "packages/core-packages/core/src", Zr = "packages/core-packages/core/output/npm/esm", ee = !import.meta.url.includes("node_modules");
|
|
1565
1565
|
function mt(e) {
|
|
1566
|
-
return ee && e.name !== "@esri/calcite-components" ? "6.0.0-next.
|
|
1566
|
+
return ee && e.name !== "@esri/calcite-components" ? "6.0.0-next.16" : e.version;
|
|
1567
1567
|
}
|
|
1568
1568
|
function Ni({ command: e }) {
|
|
1569
1569
|
return e === "serve" && process.argv.includes("--local-core");
|
|
@@ -1578,14 +1578,14 @@ function te(e, t, i = ft, s = "max-age=31536000, immutable") {
|
|
|
1578
1578
|
throw Error(b(tt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
1579
1579
|
const n = e._serverConfigured, r = e.server.middlewares.stack.length;
|
|
1580
1580
|
if (t.forEach((a) => {
|
|
1581
|
-
const
|
|
1582
|
-
e.server.middlewares.use(
|
|
1583
|
-
const g = sn(p.url), h =
|
|
1581
|
+
const l = Di(a), d = Oi(e.dir, Ri(l)), c = tn(e.viteConfig.base, d, e.dir.distCdn);
|
|
1582
|
+
e.server.middlewares.use(c, (p, m, f) => {
|
|
1583
|
+
const g = sn(p.url), h = l.type === "directory" ? Qr(l.source, g) : l.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
|
|
1584
1584
|
return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) : W(h)).then((w) => {
|
|
1585
|
-
const
|
|
1586
|
-
m.setHeader("Cache-Control", s), m.setHeader("Content-Type", Ks.lookup(g) || "application/octet-stream"), m.write(
|
|
1585
|
+
const S = (typeof h == "function" ? void 0 : v?.transform(w.toString("utf8"), y, e)) ?? w;
|
|
1586
|
+
m.setHeader("Cache-Control", s), m.setHeader("Content-Type", Ks.lookup(g) || "application/octet-stream"), m.write(S), m.end();
|
|
1587
1587
|
}).catch((w) => {
|
|
1588
|
-
(
|
|
1588
|
+
(l.type !== "directory" || process.env.DEBUG) && $.warn(
|
|
1589
1589
|
tt,
|
|
1590
1590
|
`Error occurred when trying to serve a file in response to request for "${p.originalUrl ?? g}":${String(w)}`
|
|
1591
1591
|
), f();
|
|
@@ -1601,14 +1601,14 @@ async function Fi(e, t, i = ft) {
|
|
|
1601
1601
|
t.map(async (s) => {
|
|
1602
1602
|
const n = Di(s), r = Oi(e.dir, Ri(n));
|
|
1603
1603
|
if (n.type === "directory") {
|
|
1604
|
-
const a = u.resolve(n.source), d = (await ct(a, { recursive: !0, withFileTypes: !0 })).filter((
|
|
1605
|
-
const p = u.resolve(
|
|
1604
|
+
const a = u.resolve(n.source), d = (await ct(a, { recursive: !0, withFileTypes: !0 })).filter((c) => c.isFile()).map((c) => {
|
|
1605
|
+
const p = u.resolve(c.parentPath, c.name), m = u.relative(a, p), f = u.join(r, m);
|
|
1606
1606
|
return [p, f];
|
|
1607
1607
|
});
|
|
1608
|
-
await Ji(d.map(([
|
|
1608
|
+
await Ji(d.map(([c, p]) => p)), await _s(
|
|
1609
1609
|
d,
|
|
1610
1610
|
16,
|
|
1611
|
-
async ([
|
|
1611
|
+
async ([c, p]) => await xt(c, p, i, e)
|
|
1612
1612
|
);
|
|
1613
1613
|
} else if (n.type === "file")
|
|
1614
1614
|
await ie(u.dirname(r), { recursive: !0 }), await xt(n.source, r, i, e);
|
|
@@ -1685,7 +1685,7 @@ async function nn(e, t, i, s) {
|
|
|
1685
1685
|
return [];
|
|
1686
1686
|
const n = e._localCdnCore, r = n?.packageLocation ?? await $e(Ae);
|
|
1687
1687
|
if (i === "cdn") {
|
|
1688
|
-
const a = await ai(r),
|
|
1688
|
+
const a = await ai(r), l = Re(a, s);
|
|
1689
1689
|
return [
|
|
1690
1690
|
// Use the ESM CDN
|
|
1691
1691
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -1696,12 +1696,12 @@ async function nn(e, t, i, s) {
|
|
|
1696
1696
|
},
|
|
1697
1697
|
children: JSON.stringify({
|
|
1698
1698
|
imports: {
|
|
1699
|
-
"@arcgis/core/": `${
|
|
1699
|
+
"@arcgis/core/": `${l}@arcgis/core/`
|
|
1700
1700
|
}
|
|
1701
1701
|
})
|
|
1702
1702
|
},
|
|
1703
1703
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1704
|
-
Bi(
|
|
1704
|
+
Bi(l)
|
|
1705
1705
|
];
|
|
1706
1706
|
} else
|
|
1707
1707
|
return on(t, r, n?.sourceLocation !== void 0);
|
|
@@ -1767,7 +1767,7 @@ async function an(e) {
|
|
|
1767
1767
|
];
|
|
1768
1768
|
e.server.middlewares.use("/builddate.txt", (n, r) => {
|
|
1769
1769
|
r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain");
|
|
1770
|
-
const a = t?.sourceLocation ? "6.0.0-next.
|
|
1770
|
+
const a = t?.sourceLocation ? "6.0.0-next.16" : D(i).version;
|
|
1771
1771
|
r.end(JSON.stringify({ version: a }));
|
|
1772
1772
|
}), te(e, s, [], "no-cache");
|
|
1773
1773
|
}
|
|
@@ -1787,10 +1787,10 @@ const ln = -1, dn = -2, pn = /["']\.\.?\/[^'"]+/gu, un = (e, t, i, s) => e.repla
|
|
|
1787
1787
|
const r = n.slice(1);
|
|
1788
1788
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1789
1789
|
return n;
|
|
1790
|
-
const a = u.join(s, r),
|
|
1790
|
+
const a = u.join(s, r), l = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? cn(t.dir.distComponents, a) : a, d = l.startsWith(t.dir.distComponents) ? t.dir.dist + Ge(l.slice(t.dir.dist.length), t.apiExtractor) : l;
|
|
1791
1791
|
if (i === s && a === d)
|
|
1792
1792
|
return n;
|
|
1793
|
-
const
|
|
1793
|
+
const c = he(i, d), p = n.endsWith("/") ? `${c}/` : c;
|
|
1794
1794
|
return `${n[0]}${p}`;
|
|
1795
1795
|
}), he = (e, t) => {
|
|
1796
1796
|
const i = u.relative(e, t);
|
|
@@ -1798,7 +1798,7 @@ const ln = -1, dn = -2, pn = /["']\.\.?\/[^'"]+/gu, un = (e, t, i, s) => e.repla
|
|
|
1798
1798
|
};
|
|
1799
1799
|
async function mn(e, t, i) {
|
|
1800
1800
|
const s = u.resolve(e.dir.root, t);
|
|
1801
|
-
e.viteConfig.build.emptyOutDir !== !1 && await
|
|
1801
|
+
e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Ms(s, { recursive: !0, force: !0 }), await ie(s, { recursive: !0 }), await Js(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1802
1802
|
const n = [
|
|
1803
1803
|
"index.html",
|
|
1804
1804
|
...await Us("**/*.html", {
|
|
@@ -1809,33 +1809,33 @@ async function mn(e, t, i) {
|
|
|
1809
1809
|
// Not applicable for our glob pattern
|
|
1810
1810
|
expandDirectories: !1
|
|
1811
1811
|
})
|
|
1812
|
-
], r = u.relative(e.dir.root, e.dir.src), a = await oe(e),
|
|
1813
|
-
if ("cssHref" in
|
|
1814
|
-
return `<link rel="stylesheet" href="${
|
|
1815
|
-
if ("javascriptCode" in
|
|
1812
|
+
], r = u.relative(e.dir.root, e.dir.src), a = await oe(e), l = u.join(e.dir.src, "loader.ts"), d = a.map((c) => {
|
|
1813
|
+
if ("cssHref" in c)
|
|
1814
|
+
return `<link rel="stylesheet" href="${c.cssHref}">`;
|
|
1815
|
+
if ("javascriptCode" in c && c.javascriptCode.at(0)?.includes(l) === !0)
|
|
1816
1816
|
return "";
|
|
1817
|
-
if ("tag" in
|
|
1818
|
-
const p =
|
|
1817
|
+
if ("tag" in c) {
|
|
1818
|
+
const p = c.children ?? "";
|
|
1819
1819
|
if (typeof p == "string")
|
|
1820
|
-
return `<${
|
|
1820
|
+
return `<${c.tag} ${Object.entries(c.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${c.tag}>`;
|
|
1821
1821
|
}
|
|
1822
|
-
throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(
|
|
1822
|
+
throw Error(b("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(c)}`));
|
|
1823
1823
|
}).join(`
|
|
1824
1824
|
`);
|
|
1825
1825
|
await Promise.all(
|
|
1826
|
-
n.map(async (
|
|
1827
|
-
const f = p === 0 ?
|
|
1826
|
+
n.map(async (c, p) => {
|
|
1827
|
+
const f = p === 0 ? c : u.join(r, c), g = u.join(e.dir.root, f), h = u.join(s, f);
|
|
1828
1828
|
await ie(u.dirname(h), { recursive: !0 });
|
|
1829
1829
|
const y = await W(g, "utf-8"), v = he(u.dirname(f), `build/${i}`), w = `${d}<script type="module" src="${v}"><\/script>
|
|
1830
|
-
`,
|
|
1830
|
+
`, S = Math.min(
|
|
1831
1831
|
...[y.indexOf("<style>"), y.indexOf("<script"), y.indexOf("</head>")].filter(
|
|
1832
1832
|
(x) => x !== -1
|
|
1833
1833
|
)
|
|
1834
1834
|
);
|
|
1835
|
-
if (
|
|
1835
|
+
if (S === Number.POSITIVE_INFINITY)
|
|
1836
1836
|
throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
|
|
1837
|
-
const
|
|
1838
|
-
await z(h,
|
|
1837
|
+
const T = y.slice(0, S) + w + y.slice(S), E = e.options?.build?.webApp?.transformFile?.(T, h, e) ?? T;
|
|
1838
|
+
await z(h, E, "utf-8");
|
|
1839
1839
|
})
|
|
1840
1840
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1841
1841
|
}
|
|
@@ -1880,12 +1880,12 @@ function hn(e) {
|
|
|
1880
1880
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
1881
1881
|
);
|
|
1882
1882
|
}
|
|
1883
|
-
const
|
|
1883
|
+
const l = i ?? _i;
|
|
1884
1884
|
if (e.provideAssets([
|
|
1885
1885
|
{
|
|
1886
1886
|
type: "dynamic",
|
|
1887
1887
|
source: () => xr(e),
|
|
1888
|
-
destination: `../${a ?
|
|
1888
|
+
destination: `../${a ? l : Q}.css`
|
|
1889
1889
|
}
|
|
1890
1890
|
]), !t)
|
|
1891
1891
|
return {
|
|
@@ -1894,15 +1894,15 @@ function hn(e) {
|
|
|
1894
1894
|
if (e.isInStorybook)
|
|
1895
1895
|
return;
|
|
1896
1896
|
if ((e.apiJsonComponents ?? []).length === 0) {
|
|
1897
|
-
|
|
1897
|
+
$.warn(
|
|
1898
1898
|
O,
|
|
1899
1899
|
"Skipping CDN build as no public custom elements were found in this package. Double check that your component files follow the required naming convention: https://webgis.esri.com/references/lumina/component."
|
|
1900
1900
|
);
|
|
1901
1901
|
return;
|
|
1902
1902
|
}
|
|
1903
|
-
const d = q && D().name !== "@arcgis/embeddable-components",
|
|
1903
|
+
const d = q && D().name !== "@arcgis/embeddable-components", c = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await yn(
|
|
1904
1904
|
e,
|
|
1905
|
-
|
|
1905
|
+
l,
|
|
1906
1906
|
s,
|
|
1907
1907
|
p,
|
|
1908
1908
|
n,
|
|
@@ -1911,12 +1911,12 @@ function hn(e) {
|
|
|
1911
1911
|
await vn(
|
|
1912
1912
|
m,
|
|
1913
1913
|
e,
|
|
1914
|
-
a ? `${
|
|
1914
|
+
a ? `${l}.esm` : l,
|
|
1915
1915
|
p,
|
|
1916
1916
|
d
|
|
1917
1917
|
);
|
|
1918
1918
|
const f = Date.now();
|
|
1919
|
-
|
|
1919
|
+
$.info(O, `CDN was built in ${f - c}ms`), r && await mn(e, r, `${a ? `${l}.esm` : l}.js`);
|
|
1920
1920
|
}
|
|
1921
1921
|
};
|
|
1922
1922
|
}
|
|
@@ -1936,14 +1936,14 @@ async function yn(e, t, i, s, n, r) {
|
|
|
1936
1936
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
1937
1937
|
)
|
|
1938
1938
|
);
|
|
1939
|
-
const
|
|
1939
|
+
const l = `import { defineCustomElements } from "./loader";
|
|
1940
1940
|
/**
|
|
1941
1941
|
* We use import.meta.url to get the path to the current file
|
|
1942
1942
|
* and pass it to defineCustomElements to set the resources url.
|
|
1943
1943
|
* The script's file name will be stripped inside defineCustomElements.
|
|
1944
1944
|
**/
|
|
1945
1945
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1946
|
-
${Ti(e._globalCssString, e)}`, d = n?.(
|
|
1946
|
+
${Ti(e._globalCssString, e)}`, d = n?.(l, e) ?? l;
|
|
1947
1947
|
return await Bs({
|
|
1948
1948
|
bundle: !0,
|
|
1949
1949
|
minify: r ? !0 : a === "production",
|
|
@@ -1975,14 +1975,14 @@ ${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1975
1975
|
plugins: [
|
|
1976
1976
|
{
|
|
1977
1977
|
name: "@arcgis/lumina:accessorSupport",
|
|
1978
|
-
setup(
|
|
1979
|
-
|
|
1978
|
+
setup(c) {
|
|
1979
|
+
c.onResolve(
|
|
1980
1980
|
{ filter: /^@arcgis\/core\/applications\/Components\/reactiveUtils.js$/ },
|
|
1981
1981
|
(p) => p.importer.endsWith("runtime.js") ? {
|
|
1982
1982
|
path: p.path,
|
|
1983
1983
|
namespace: "@arcgis/lumina:accessorSupport"
|
|
1984
1984
|
} : void 0
|
|
1985
|
-
),
|
|
1985
|
+
), c.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
|
|
1986
1986
|
contents: "export const createObservable=undefined, trackAccess=undefined, createTrackingTarget=undefined, runTracked = undefined;",
|
|
1987
1987
|
loader: "js"
|
|
1988
1988
|
}));
|
|
@@ -1993,7 +1993,7 @@ ${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1993
1993
|
// manual injection further below. Thus drop the CSS import from the
|
|
1994
1994
|
// chunks/runtime.js file.
|
|
1995
1995
|
name: "@arcgis/lumina:customGlobalCssInjection",
|
|
1996
|
-
setup(
|
|
1996
|
+
setup(c) {
|
|
1997
1997
|
const p = e.options.build?.cdn?.namespace === void 0 ? (
|
|
1998
1998
|
// eslint-disable-next-line require-unicode-regexp
|
|
1999
1999
|
new RegExp(`\\/${le}\\/${Q}\\.css$`)
|
|
@@ -2001,10 +2001,10 @@ ${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
2001
2001
|
// eslint-disable-next-line require-unicode-regexp
|
|
2002
2002
|
new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
|
|
2003
2003
|
);
|
|
2004
|
-
|
|
2004
|
+
c.onResolve({ filter: p }, ({ path: m }) => ({
|
|
2005
2005
|
path: m,
|
|
2006
2006
|
namespace: "build-cdn:global-css"
|
|
2007
|
-
})),
|
|
2007
|
+
})), c.onLoad({ filter: /.*/, namespace: "build-cdn:global-css" }, () => ({
|
|
2008
2008
|
contents: "",
|
|
2009
2009
|
loader: "js"
|
|
2010
2010
|
}));
|
|
@@ -2031,8 +2031,8 @@ ${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
2031
2031
|
const Lt = "stdin.js";
|
|
2032
2032
|
async function vn(e, t, i, s, n) {
|
|
2033
2033
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
2034
|
-
let
|
|
2035
|
-
n && (
|
|
2034
|
+
let l;
|
|
2035
|
+
n && (l = new Set(s.map((p) => `${p.out}.js`)), l.add(a));
|
|
2036
2036
|
const d = new Map(
|
|
2037
2037
|
e.outputFiles.map((p) => {
|
|
2038
2038
|
const m = {
|
|
@@ -2059,7 +2059,7 @@ ${p.text}`
|
|
|
2059
2059
|
n && d.forEach((p, m) => {
|
|
2060
2060
|
if (p.isAsync === void 0)
|
|
2061
2061
|
if (m.endsWith(".js")) {
|
|
2062
|
-
if (Ui(p, d),
|
|
2062
|
+
if (Ui(p, d), l?.has(m) === !0 && p.code.includes(Wi))
|
|
2063
2063
|
throw Error(
|
|
2064
2064
|
b(
|
|
2065
2065
|
O,
|
|
@@ -2069,15 +2069,15 @@ ${p.text}`
|
|
|
2069
2069
|
} else
|
|
2070
2070
|
p.isAsync = !1;
|
|
2071
2071
|
}), t.options.build?.cdn?.transformer?.(d, t);
|
|
2072
|
-
const
|
|
2072
|
+
const c = /* @__PURE__ */ new Map();
|
|
2073
2073
|
for (const p of d.keys()) {
|
|
2074
2074
|
const m = p.lastIndexOf("/");
|
|
2075
2075
|
if (m !== -1) {
|
|
2076
2076
|
const f = p.slice(0, m);
|
|
2077
|
-
|
|
2077
|
+
c.set(f, ie(r + f, { recursive: !0 }));
|
|
2078
2078
|
}
|
|
2079
2079
|
}
|
|
2080
|
-
await Promise.all(
|
|
2080
|
+
await Promise.all(c.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await z(r + p, m)));
|
|
2081
2081
|
}
|
|
2082
2082
|
const bn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2083
2083
|
function wn(e, t) {
|
|
@@ -2092,7 +2092,7 @@ function wn(e, t) {
|
|
|
2092
2092
|
const n = [];
|
|
2093
2093
|
for (const r of t) {
|
|
2094
2094
|
if (r.in.includes("*")) {
|
|
2095
|
-
|
|
2095
|
+
$.warn(O, `$arcgis.import does not support wildcard imports, so ${r.in} will be ignored.`);
|
|
2096
2096
|
continue;
|
|
2097
2097
|
}
|
|
2098
2098
|
if (r.out.startsWith(".") || r.out.startsWith("/"))
|
|
@@ -2131,64 +2131,64 @@ function Ui(e, t) {
|
|
|
2131
2131
|
}
|
|
2132
2132
|
e.isProcessing = !0;
|
|
2133
2133
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
2134
|
-
let
|
|
2134
|
+
let l = 0;
|
|
2135
2135
|
const d = e.code.matchAll(Sn);
|
|
2136
|
-
for (const
|
|
2137
|
-
const [
|
|
2138
|
-
if (
|
|
2139
|
-
const R = e.code.slice(
|
|
2140
|
-
n.push(R), a.push([
|
|
2136
|
+
for (const C of d) {
|
|
2137
|
+
const [L, A, M, j, N] = C, K = N.startsWith(Le);
|
|
2138
|
+
if (l !== 0 && l !== C.index) {
|
|
2139
|
+
const R = e.code.slice(l, C.index);
|
|
2140
|
+
n.push(R), a.push([l, R.length, 0, ""]);
|
|
2141
2141
|
}
|
|
2142
|
-
if (
|
|
2143
|
-
a.push([
|
|
2142
|
+
if (l = C.index + L.length, K)
|
|
2143
|
+
a.push([C.index, L.length, 0, ""]), s.push(`"${qi(N.slice(Le.length))}"`), i.push(A?.replaceAll(" as ", ":") ?? M ?? j ?? "");
|
|
2144
2144
|
else {
|
|
2145
|
-
const R = zi(N, t),
|
|
2146
|
-
if (
|
|
2145
|
+
const R = zi(N, t), J = R?.isAsync === !0;
|
|
2146
|
+
if (A !== void 0) {
|
|
2147
2147
|
const be = [];
|
|
2148
|
-
for (const Me of
|
|
2148
|
+
for (const Me of A.slice(1, -1).split(",")) {
|
|
2149
2149
|
const [St, Ct = St] = Me.split(" as ");
|
|
2150
|
-
|
|
2150
|
+
J || r.add(Ct), be.push(`${St}:${Ct}`);
|
|
2151
2151
|
}
|
|
2152
|
-
if (
|
|
2152
|
+
if (J) {
|
|
2153
2153
|
const Me = R.oldSingleExportName === void 0 ? `{${be.join(",")}}` : be[0].split(":")[1];
|
|
2154
|
-
a.push([
|
|
2154
|
+
a.push([C.index + 6, 0, A.length, Me]);
|
|
2155
2155
|
}
|
|
2156
|
-
} else if (
|
|
2157
|
-
|
|
2156
|
+
} else if (M === void 0 && j === void 0)
|
|
2157
|
+
J && a.push([C.index + 6, 0, 0, ""]);
|
|
2158
2158
|
else {
|
|
2159
|
-
if (
|
|
2159
|
+
if (J)
|
|
2160
2160
|
throw Error(
|
|
2161
2161
|
b(
|
|
2162
2162
|
O,
|
|
2163
|
-
`Expected local import specifiers to use only named or side-effect import syntax. Found ${
|
|
2163
|
+
`Expected local import specifiers to use only named or side-effect import syntax. Found ${L} in a chunk:
|
|
2164
2164
|
${R.code}`
|
|
2165
2165
|
)
|
|
2166
2166
|
);
|
|
2167
|
-
r.add(j ??
|
|
2167
|
+
r.add(j ?? M);
|
|
2168
2168
|
}
|
|
2169
2169
|
}
|
|
2170
2170
|
}
|
|
2171
2171
|
e.isProcessing = !1;
|
|
2172
|
-
const
|
|
2173
|
-
if (e.isAsync =
|
|
2172
|
+
const c = e.isAsync === !0;
|
|
2173
|
+
if (e.isAsync = c || a.length > 0, !e.isAsync) {
|
|
2174
2174
|
e.code = jt(e.code, t);
|
|
2175
2175
|
return;
|
|
2176
2176
|
}
|
|
2177
2177
|
const p = Tn(r);
|
|
2178
|
-
let m = e.code.slice(0,
|
|
2179
|
-
for (let
|
|
2180
|
-
const [
|
|
2181
|
-
let N =
|
|
2182
|
-
if (
|
|
2183
|
-
const
|
|
2184
|
-
s.push(
|
|
2178
|
+
let m = e.code.slice(0, l);
|
|
2179
|
+
for (let C = a.length - 1; C >= 0; C--) {
|
|
2180
|
+
const [L, A, M, j] = a[C];
|
|
2181
|
+
let N = A, K = "";
|
|
2182
|
+
if (A === 0) {
|
|
2183
|
+
const J = p();
|
|
2184
|
+
s.push(J), K = ` ${J} from`, j !== "" ? (N = M + 4, i.push(j)) : i.push("");
|
|
2185
2185
|
}
|
|
2186
|
-
m = m.slice(0,
|
|
2186
|
+
m = m.slice(0, L) + K + m.slice(L + N);
|
|
2187
2187
|
}
|
|
2188
|
-
const [f, g] = Nt(e), h = i.findLastIndex((
|
|
2189
|
-
let
|
|
2190
|
-
|
|
2191
|
-
const x = `${m}${w}${
|
|
2188
|
+
const [f, g] = Nt(e), h = i.findLastIndex((C) => C.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${Wi}${v}=>{`, S = s.join(","), T = `${g}},${S})`;
|
|
2189
|
+
let E = e.code.slice(l, f);
|
|
2190
|
+
E = `${n.join("")}${E}`, E = jt(E, t);
|
|
2191
|
+
const x = `${m}${w}${E}${T}`;
|
|
2192
2192
|
e.code = x;
|
|
2193
2193
|
}
|
|
2194
2194
|
const Wi = "export default $arcgis.t(";
|
|
@@ -2199,8 +2199,8 @@ function Nt(e) {
|
|
|
2199
2199
|
const n = t[1].split(",");
|
|
2200
2200
|
if (n.length > 1)
|
|
2201
2201
|
s = `return{${n.map((r) => {
|
|
2202
|
-
const [a,
|
|
2203
|
-
return `${
|
|
2202
|
+
const [a, l = a] = r.split(" as ");
|
|
2203
|
+
return `${l}:${a}`;
|
|
2204
2204
|
}).join(",")}}`;
|
|
2205
2205
|
else {
|
|
2206
2206
|
const [r, a = r] = n[0].split(" as ");
|
|
@@ -2266,26 +2266,26 @@ function Re(e = D(), t = !1) {
|
|
|
2266
2266
|
const i = e.name === "@esri/calcite-components", s = mt(e) ?? e.version, n = s.includes("next");
|
|
2267
2267
|
if (i && n)
|
|
2268
2268
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${s}/dist/${le}/`;
|
|
2269
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = xn(e.name),
|
|
2270
|
-
if (
|
|
2269
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = xn(e.name), l = An(s);
|
|
2270
|
+
if (l === void 0)
|
|
2271
2271
|
throw Error(
|
|
2272
2272
|
b(
|
|
2273
2273
|
"@arcgis/lumina:dependencies",
|
|
2274
2274
|
`Failed to parse a semver version: ${e.name}. Ensure the version follows D.D.D format. Package version: ${e.version}`
|
|
2275
2275
|
)
|
|
2276
2276
|
);
|
|
2277
|
-
return a === "core" ? `https://${r}/${
|
|
2277
|
+
return a === "core" ? `https://${r}/${l}/` : i ? `https://${r}/${a}/${l}/` : `https://${r}/${l}/${a}/`;
|
|
2278
2278
|
}
|
|
2279
2279
|
const xn = (e) => e.split("/").pop() ?? e;
|
|
2280
2280
|
function An(e) {
|
|
2281
2281
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2282
2282
|
if (i?.groups === void 0)
|
|
2283
2283
|
return;
|
|
2284
|
-
const { major: s, minor: n, patch: r, prerelease: a } = i.groups,
|
|
2285
|
-
return a?.startsWith("-next") ? `${
|
|
2284
|
+
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, l = `${s}.${n}.${r}`;
|
|
2285
|
+
return a?.startsWith("-next") ? `${l}-next` : l;
|
|
2286
2286
|
}
|
|
2287
2287
|
async function Ln(e, t, i, s, n) {
|
|
2288
|
-
const r = t.packageName, { hasCss: a, cdnName:
|
|
2288
|
+
const r = t.packageName, { hasCss: a, cdnName: l } = await Vi(t.packageLocation) ?? {};
|
|
2289
2289
|
if (i === "cdn") {
|
|
2290
2290
|
const m = t.cdnUrl ?? Re(t.packageJson, n);
|
|
2291
2291
|
return [
|
|
@@ -2294,7 +2294,7 @@ async function Ln(e, t, i, s, n) {
|
|
|
2294
2294
|
tag: "link",
|
|
2295
2295
|
attrs: {
|
|
2296
2296
|
rel: "stylesheet",
|
|
2297
|
-
src: `${m}${
|
|
2297
|
+
src: `${m}${l}.css`
|
|
2298
2298
|
}
|
|
2299
2299
|
}
|
|
2300
2300
|
] : [],
|
|
@@ -2302,12 +2302,12 @@ async function Ln(e, t, i, s, n) {
|
|
|
2302
2302
|
tag: "script",
|
|
2303
2303
|
attrs: {
|
|
2304
2304
|
type: "module",
|
|
2305
|
-
src: `${m}${
|
|
2305
|
+
src: `${m}${l}.esm.js`
|
|
2306
2306
|
}
|
|
2307
2307
|
}
|
|
2308
2308
|
];
|
|
2309
2309
|
}
|
|
2310
|
-
const d = `${r}/dist/${
|
|
2310
|
+
const d = `${r}/dist/${l}/${l}.css${Y}`, c = a ? [
|
|
2311
2311
|
`import styles$${s} from "${d}";`,
|
|
2312
2312
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2313
2313
|
] : [], p = `${r}/dist/esm/loader.js`;
|
|
@@ -2319,10 +2319,10 @@ async function Ln(e, t, i, s, n) {
|
|
|
2319
2319
|
*/
|
|
2320
2320
|
optimizableImports: [p],
|
|
2321
2321
|
javascriptCode: [
|
|
2322
|
-
...
|
|
2322
|
+
...c,
|
|
2323
2323
|
`import { defineCustomElements as defineCustomElements$${s} } from "${p}";`,
|
|
2324
2324
|
`defineCustomElements$${s}(globalThis.window, {`,
|
|
2325
|
-
` resourcesUrl: "${ut(e, t.packageLocation)}/dist/${
|
|
2325
|
+
` resourcesUrl: "${ut(e, t.packageLocation)}/dist/${l}/",`,
|
|
2326
2326
|
"});"
|
|
2327
2327
|
]
|
|
2328
2328
|
}
|
|
@@ -2340,18 +2340,18 @@ async function Vi(e) {
|
|
|
2340
2340
|
).then((a) => a.find(F)) : await Ft(t, r);
|
|
2341
2341
|
}
|
|
2342
2342
|
async function Ft(e, t) {
|
|
2343
|
-
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a,
|
|
2344
|
-
|
|
2345
|
-
|
|
2346
|
-
|
|
2343
|
+
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, l] = await Promise.all([
|
|
2344
|
+
_(i),
|
|
2345
|
+
_(s),
|
|
2346
|
+
_(n)
|
|
2347
2347
|
]);
|
|
2348
|
-
return r || a ||
|
|
2348
|
+
return r || a || l ? {
|
|
2349
2349
|
hasCss: r,
|
|
2350
2350
|
cdnName: t
|
|
2351
2351
|
} : void 0;
|
|
2352
2352
|
}
|
|
2353
2353
|
async function Nn(e, t, i, s, n) {
|
|
2354
|
-
const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Vi(t.packageLocation) : void 0,
|
|
2354
|
+
const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Vi(t.packageLocation) : void 0, l = a?.cdnName ?? le, d = a === void 0 ? `${_i}.js` : `${a.cdnName}.esm.js`;
|
|
2355
2355
|
if (i === "cdn")
|
|
2356
2356
|
return {
|
|
2357
2357
|
tag: "script",
|
|
@@ -2360,7 +2360,7 @@ async function Nn(e, t, i, s, n) {
|
|
|
2360
2360
|
src: `${t.cdnUrl ?? Re(t.packageJson, n)}${d}`
|
|
2361
2361
|
}
|
|
2362
2362
|
};
|
|
2363
|
-
const
|
|
2363
|
+
const c = jn(t.packageJson), p = `${t.packageName}/${u.normalize(c)}${Y}`, m = [
|
|
2364
2364
|
`import styles$${s} from "${p}";`,
|
|
2365
2365
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2366
2366
|
], f = `${t.packageName}/loader`;
|
|
@@ -2374,7 +2374,7 @@ async function Nn(e, t, i, s, n) {
|
|
|
2374
2374
|
...m,
|
|
2375
2375
|
`import { defineCustomElements as defineCustomElements$${s} } from "${f}";`,
|
|
2376
2376
|
`defineCustomElements$${s}({`,
|
|
2377
|
-
` resourcesUrl: "${ut(e, t.packageLocation)}/dist/${
|
|
2377
|
+
` resourcesUrl: "${ut(e, t.packageLocation)}/dist/${l}/",`,
|
|
2378
2378
|
"});"
|
|
2379
2379
|
]
|
|
2380
2380
|
};
|
|
@@ -2399,14 +2399,14 @@ async function Dt(e, t) {
|
|
|
2399
2399
|
const g = r++;
|
|
2400
2400
|
return f.type === "stencil" ? await Ln(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await Nn(n, f, i, g, s) : void 0;
|
|
2401
2401
|
})
|
|
2402
|
-
)).filter(F).flat(),
|
|
2402
|
+
)).filter(F).flat(), l = await Promise.all([
|
|
2403
2403
|
// This may contain an import map so must be first
|
|
2404
2404
|
nn(e, n, i, s),
|
|
2405
2405
|
ne.then(a),
|
|
2406
2406
|
Gi(e).then(a)
|
|
2407
|
-
]), d = u.join(e.dir.src, "loader.ts"),
|
|
2407
|
+
]), d = u.join(e.dir.src, "loader.ts"), c = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? le}/` : void 0);
|
|
2408
2408
|
return [
|
|
2409
|
-
...
|
|
2409
|
+
...l.flat(),
|
|
2410
2410
|
{
|
|
2411
2411
|
optimizableImports: [
|
|
2412
2412
|
/**
|
|
@@ -2417,7 +2417,7 @@ async function Dt(e, t) {
|
|
|
2417
2417
|
javascriptCode: [
|
|
2418
2418
|
`import { defineCustomElements } from "${d}";`,
|
|
2419
2419
|
"globalThis.devOnly$ownTagNames = new Set();",
|
|
2420
|
-
`defineCustomElements(${
|
|
2420
|
+
`defineCustomElements(${c === void 0 ? "" : `{resourcesUrl:${JSON.stringify(c)}}`});`
|
|
2421
2421
|
]
|
|
2422
2422
|
}
|
|
2423
2423
|
];
|
|
@@ -2573,10 +2573,10 @@ function Bn(e) {
|
|
|
2573
2573
|
};
|
|
2574
2574
|
}
|
|
2575
2575
|
async function Bt(e) {
|
|
2576
|
-
const t =
|
|
2576
|
+
const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2577
2577
|
i.map(async (n) => {
|
|
2578
2578
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
2579
|
-
return await
|
|
2579
|
+
return await _(a) ? Yi(a, r) : void 0;
|
|
2580
2580
|
})
|
|
2581
2581
|
);
|
|
2582
2582
|
return await t && s.push(Qi), s.filter(F);
|
|
@@ -2593,14 +2593,14 @@ const Yi = (e, t) => ({
|
|
|
2593
2593
|
if (i === void 0) {
|
|
2594
2594
|
if ("rolldownVersion" in this.meta)
|
|
2595
2595
|
return;
|
|
2596
|
-
|
|
2596
|
+
$.warn(We, "Unable to find the vite's built-in vite:reporter plugin");
|
|
2597
2597
|
return;
|
|
2598
2598
|
}
|
|
2599
2599
|
const s = i.writeBundle;
|
|
2600
2600
|
if (typeof s != "function")
|
|
2601
2601
|
throw Error(b(We, "Expected vite:reporter to declare a writeBundle() function"));
|
|
2602
2602
|
i.writeBundle = async function(r, a) {
|
|
2603
|
-
let
|
|
2603
|
+
let l = 0, d = 0, c = 0, p = 0;
|
|
2604
2604
|
const m = console.log;
|
|
2605
2605
|
console.log = function(...g) {
|
|
2606
2606
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
@@ -2609,7 +2609,7 @@ const Yi = (e, t) => ({
|
|
|
2609
2609
|
return;
|
|
2610
2610
|
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Wn, "").length);
|
|
2611
2611
|
const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2612
|
-
y ? (
|
|
2612
|
+
y ? (c += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : l += v;
|
|
2613
2613
|
}
|
|
2614
2614
|
};
|
|
2615
2615
|
try {
|
|
@@ -2618,7 +2618,7 @@ const Yi = (e, t) => ({
|
|
|
2618
2618
|
console.log = m;
|
|
2619
2619
|
}
|
|
2620
2620
|
if (d > 0) {
|
|
2621
|
-
const g =
|
|
2621
|
+
const g = c > 0 ? d : l, h = Ut(g), y = e.dir.relativeDist;
|
|
2622
2622
|
console.log(
|
|
2623
2623
|
[
|
|
2624
2624
|
_t,
|
|
@@ -2628,7 +2628,7 @@ const Yi = (e, t) => ({
|
|
|
2628
2628
|
" ".repeat(p - `${y}*`.length - h.length),
|
|
2629
2629
|
h,
|
|
2630
2630
|
Kt,
|
|
2631
|
-
|
|
2631
|
+
c > 0 ? ` ${_t}│ gzip: ${Ut(c)}${Kt}` : ""
|
|
2632
2632
|
].join("")
|
|
2633
2633
|
);
|
|
2634
2634
|
}
|
|
@@ -2639,17 +2639,18 @@ const Yi = (e, t) => ({
|
|
|
2639
2639
|
minimumFractionDigits: 2
|
|
2640
2640
|
}), Ut = (e) => `${zn.format(e)} kB`, qn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", gt.slice(0, -3)));
|
|
2641
2641
|
var Hn = ["@arcgis-test/lit-components/loader", "@arcgis/ai-components/loader", "@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/coding-components/loader", "@arcgis/common-components/loader", "@arcgis/core", "@arcgis/embeddable-components/loader", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-toolkit", "@arcgis/map-components/loader", "@arcgis/node-toolkit", "@arcgis/portal-components/loader", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
|
|
2642
|
-
const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
2642
|
+
const Wt = "@arcgis/lumina:configureVite", Vn = /\.[cm]?[jt]sx?$/u, Gn = (e) => ({
|
|
2643
2643
|
name: Wt,
|
|
2644
2644
|
async config({
|
|
2645
|
-
|
|
2646
|
-
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
2650
|
-
|
|
2651
|
-
|
|
2652
|
-
|
|
2645
|
+
appType: t,
|
|
2646
|
+
server: i,
|
|
2647
|
+
publicDir: s,
|
|
2648
|
+
build: { cssMinify: n, target: r, sourcemap: a, lib: l, rollupOptions: { output: d = [] } = {}, watch: c, emptyOutDir: p } = {},
|
|
2649
|
+
test: m = {}
|
|
2650
|
+
}, f) {
|
|
2651
|
+
const g = c != null, { include: h, browser: y, environment: v, forceRerunTriggers: w } = m, S = q && ee && Ni(f) ? at(Li, import.meta.dirname) : void 0, T = S === void 0 ? [] : [
|
|
2652
|
+
G(u.join(S, "**/*.{ts,tsx,mjs}")),
|
|
2653
|
+
`!${G(u.join(S, "**/*.d.ts"))}`
|
|
2653
2654
|
], E = {
|
|
2654
2655
|
// Public utilities exposed by the package
|
|
2655
2656
|
index: "src/index.ts",
|
|
@@ -2658,7 +2659,7 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2658
2659
|
* the CDN build
|
|
2659
2660
|
*/
|
|
2660
2661
|
loader: "src/loader.ts"
|
|
2661
|
-
}, { loader:
|
|
2662
|
+
}, { loader: x, ...C } = E, L = e.environment === "development" || e.isInTest ? {
|
|
2662
2663
|
"process.env.ESRI_INTERNAL": "true"
|
|
2663
2664
|
} : void 0, A = {
|
|
2664
2665
|
/**
|
|
@@ -2673,9 +2674,9 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2673
2674
|
* is not visible to dep-optimizer's ESBuild instance.
|
|
2674
2675
|
*/
|
|
2675
2676
|
entries: [
|
|
2676
|
-
...Object.values(
|
|
2677
|
+
...Object.values(C),
|
|
2677
2678
|
...await e.componentFilesPromise,
|
|
2678
|
-
...
|
|
2679
|
+
...T,
|
|
2679
2680
|
// Vitest scans setup files, but misses Lumina's because we add it
|
|
2680
2681
|
// dynamically. Include it because it imports js-beautify. Can't
|
|
2681
2682
|
// explicitly declare js-beautify in the "include" because dependencies
|
|
@@ -2763,52 +2764,56 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2763
2764
|
"@lit/task"
|
|
2764
2765
|
]
|
|
2765
2766
|
};
|
|
2766
|
-
if (typeof
|
|
2767
|
-
if (
|
|
2767
|
+
if (typeof m.setupFiles == "string" ? m.setupFiles = [...Ue, m.setupFiles] : Array.isArray(m.setupFiles) ? m.setupFiles = [...Ue, ...m.setupFiles] : m.setupFiles = [...Ue], e.isInPuppeteerTestBackEnd) {
|
|
2768
|
+
if (y?.enabled === !0)
|
|
2768
2769
|
throw Error(
|
|
2769
2770
|
b(Wt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2770
2771
|
);
|
|
2772
|
+
const M = {
|
|
2773
|
+
puppeteerLaunchOptions: e.options.puppeteerTesting?.launchOptions,
|
|
2774
|
+
puppeteerWaitForChangesDelay: e.options.puppeteerTesting?.waitForChangesDelay,
|
|
2775
|
+
globalSetup: ["@arcgis/lumina-compiler/puppeteerTesting/globalSetup"],
|
|
2776
|
+
runner: "@arcgis/lumina-compiler/puppeteerTesting/runner",
|
|
2777
|
+
// Run all test files that include *.e2e.* or *.spec.* in the name.
|
|
2778
|
+
include: h ? void 0 : ["**/*.{e2e,spec}.?(c|m)[jt]s?(x)"],
|
|
2779
|
+
/**
|
|
2780
|
+
* Using happy-dom because:
|
|
2781
|
+
* - faster than js-dom
|
|
2782
|
+
* - supports shadow dom
|
|
2783
|
+
* - is preferred by the Vitest team
|
|
2784
|
+
*/
|
|
2785
|
+
environment: v ?? "happy-dom",
|
|
2786
|
+
/**
|
|
2787
|
+
* Re-run all tests on any file change.
|
|
2788
|
+
*/
|
|
2789
|
+
forceRerunTriggers: w === void 0 ? ["**/*.{ts,tsx}"] : void 0
|
|
2790
|
+
};
|
|
2771
2791
|
return {
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
puppeteerWaitForChangesDelay: e.options.puppeteerTesting?.waitForChangesDelay,
|
|
2775
|
-
globalSetup: ["@arcgis/lumina-compiler/puppeteerTesting/globalSetup"],
|
|
2776
|
-
runner: "@arcgis/lumina-compiler/puppeteerTesting/runner",
|
|
2777
|
-
// Run all test files that include *.e2e.* or *.spec.* in the name.
|
|
2778
|
-
include: g ? void 0 : ["**/*.{e2e,spec}.?(c|m)[jt]s?(x)"],
|
|
2779
|
-
/**
|
|
2780
|
-
* Using happy-dom because:
|
|
2781
|
-
* - faster than js-dom
|
|
2782
|
-
* - supports shadow dom
|
|
2783
|
-
* - is preferred by the Vitest team
|
|
2784
|
-
*/
|
|
2785
|
-
environment: y ?? "happy-dom",
|
|
2786
|
-
/**
|
|
2787
|
-
* Re-run all tests on any file change.
|
|
2788
|
-
*/
|
|
2789
|
-
forceRerunTriggers: v === void 0 ? ["**/*.{ts,tsx}"] : void 0
|
|
2790
|
-
},
|
|
2792
|
+
appType: t ?? "mpa",
|
|
2793
|
+
test: M,
|
|
2791
2794
|
optimizeDeps: A,
|
|
2792
|
-
define:
|
|
2795
|
+
define: L
|
|
2793
2796
|
};
|
|
2794
2797
|
}
|
|
2795
2798
|
return {
|
|
2799
|
+
// Missing assets should return 404 instead of falling back to the test app.
|
|
2800
|
+
appType: t ?? "mpa",
|
|
2796
2801
|
server: {
|
|
2797
|
-
open:
|
|
2802
|
+
open: i?.open ?? !0
|
|
2798
2803
|
},
|
|
2799
2804
|
// We have handleStaticAssets() instead (which uses /assets/ folders)
|
|
2800
|
-
publicDir:
|
|
2805
|
+
publicDir: s ?? !1,
|
|
2801
2806
|
build: {
|
|
2802
|
-
cssMinify:
|
|
2803
|
-
target:
|
|
2804
|
-
sourcemap:
|
|
2807
|
+
cssMinify: n ?? (e.environment === "production" ? !0 : void 0),
|
|
2808
|
+
target: r ?? ji(e),
|
|
2809
|
+
sourcemap: a ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2805
2810
|
lib: {
|
|
2806
2811
|
entry: E,
|
|
2807
|
-
formats: (
|
|
2812
|
+
formats: (l ? l.formats : void 0) ?? ["es"]
|
|
2808
2813
|
},
|
|
2809
2814
|
rollupOptions: {
|
|
2810
2815
|
output: {
|
|
2811
|
-
chunkFileNames: (Array.isArray(
|
|
2816
|
+
chunkFileNames: (Array.isArray(d) ? void 0 : d.chunkFileNames) || "chunks/[name].js",
|
|
2812
2817
|
...// Does not exist in Rolldown, and probably not needed
|
|
2813
2818
|
// https://github.com/rolldown/rolldown/issues/206
|
|
2814
2819
|
"rolldownVersion" in this.meta ? void 0 : {
|
|
@@ -2816,7 +2821,7 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2816
2821
|
* 2015 is the newest option. Rollup's generated code does not use
|
|
2817
2822
|
* newer features at the moment.
|
|
2818
2823
|
*/
|
|
2819
|
-
generatedCode: (Array.isArray(
|
|
2824
|
+
generatedCode: (Array.isArray(d) ? void 0 : d.generatedCode) ?? "es2015"
|
|
2820
2825
|
}
|
|
2821
2826
|
}
|
|
2822
2827
|
},
|
|
@@ -2830,23 +2835,29 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2830
2835
|
* - in API Extractor we can avoid writing unchanged files to disk if
|
|
2831
2836
|
* the out dir is not emptied between watch rebuilds.
|
|
2832
2837
|
*/
|
|
2833
|
-
emptyOutDir:
|
|
2838
|
+
emptyOutDir: p ?? !g
|
|
2834
2839
|
},
|
|
2835
2840
|
optimizeDeps: A,
|
|
2836
|
-
define:
|
|
2841
|
+
define: L,
|
|
2837
2842
|
test: {
|
|
2838
2843
|
/*
|
|
2839
2844
|
* If in browser, run all test files that include *.e2e.* in the name.
|
|
2840
2845
|
* Otherwise, run all files including *.test.* or *.spec.* in the name.
|
|
2841
2846
|
*/
|
|
2842
|
-
include:
|
|
2847
|
+
include: h ? void 0 : [y?.enabled ?? !0 ? "**/*.e2e.?(c|m)[jt]s?(x)" : "**/*.{test,spec}.?(c|m)[jt]s?(x)"],
|
|
2843
2848
|
browser: {
|
|
2844
|
-
enabled: e.isInPuppeteerTestFrontEnd ? !1 :
|
|
2845
|
-
instances:
|
|
2849
|
+
enabled: e.isInPuppeteerTestFrontEnd ? !1 : y?.enabled ?? !0,
|
|
2850
|
+
instances: y?.instances === void 0 ? [{ browser: "chromium" }] : void 0
|
|
2846
2851
|
}
|
|
2847
2852
|
}
|
|
2848
2853
|
};
|
|
2849
2854
|
},
|
|
2855
|
+
configureServer(t) {
|
|
2856
|
+
t.middlewares.use((i, s, n) => {
|
|
2857
|
+
const r = i.url?.split("?", 1)[0];
|
|
2858
|
+
r !== void 0 && Vn.test(r) && delete i.headers["sec-fetch-dest"], n();
|
|
2859
|
+
});
|
|
2860
|
+
},
|
|
2850
2861
|
/**
|
|
2851
2862
|
* Instead of using build.lib.entry for defining component entrypoints, we do
|
|
2852
2863
|
* so in options() hook because it is called on each build --watch re-build,
|
|
@@ -2869,61 +2880,61 @@ const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2869
2880
|
s[r] = n;
|
|
2870
2881
|
}), t.input = s;
|
|
2871
2882
|
}
|
|
2872
|
-
}), Se = "@arcgis/lumina:serveLocalCdn",
|
|
2883
|
+
}), Se = "@arcgis/lumina:serveLocalCdn", Xn = /^\/?@arcgis\/core(?=\/|$)/u, Zi = "/index.js", Yn = je(Zi), rt = `\0${Se}:index`, Qn = je(rt), Zn = 3e3, eo = [
|
|
2873
2884
|
/^https?:\/\/localhost(?::[0-9]+)?$/u,
|
|
2874
2885
|
/^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
|
|
2875
2886
|
];
|
|
2876
|
-
function
|
|
2887
|
+
function to(e) {
|
|
2877
2888
|
if (!q)
|
|
2878
2889
|
return;
|
|
2879
2890
|
const t = D().name, i = t.split("/").pop() ?? t, s = `/${i}/index.js`, n = je(s), r = `\0${Se}:${i}`, a = je(r);
|
|
2880
2891
|
return {
|
|
2881
2892
|
name: Se,
|
|
2882
2893
|
enforce: "pre",
|
|
2883
|
-
apply(
|
|
2884
|
-
const d =
|
|
2894
|
+
apply(l) {
|
|
2895
|
+
const d = ro(e, l);
|
|
2885
2896
|
return d || (e._localCdnCore = void 0), d;
|
|
2886
2897
|
},
|
|
2887
2898
|
config: {
|
|
2888
2899
|
order: "post",
|
|
2889
|
-
handler(
|
|
2890
|
-
const
|
|
2900
|
+
handler(l, d) {
|
|
2901
|
+
const c = l.server, p = Ni(d), m = p ? Li : Zr, f = at(m, import.meta.dirname);
|
|
2891
2902
|
if (f === void 0)
|
|
2892
2903
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2893
2904
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
2894
2905
|
server: {
|
|
2895
|
-
port:
|
|
2896
|
-
cors:
|
|
2906
|
+
port: c?.port ?? Zn,
|
|
2907
|
+
cors: c?.cors ?? { origin: eo }
|
|
2897
2908
|
},
|
|
2898
2909
|
resolve: {
|
|
2899
2910
|
// The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
|
|
2900
2911
|
// to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
|
|
2901
|
-
alias: [{ find:
|
|
2912
|
+
alias: [{ find: Xn, replacement: f }]
|
|
2902
2913
|
}
|
|
2903
2914
|
};
|
|
2904
2915
|
}
|
|
2905
2916
|
},
|
|
2906
2917
|
resolveId: {
|
|
2907
|
-
filter: { id: [
|
|
2908
|
-
handler(
|
|
2909
|
-
if (
|
|
2918
|
+
filter: { id: [Yn, n] },
|
|
2919
|
+
handler(l) {
|
|
2920
|
+
if (l === Zi)
|
|
2910
2921
|
return rt;
|
|
2911
|
-
if (
|
|
2922
|
+
if (l === s)
|
|
2912
2923
|
return r;
|
|
2913
2924
|
}
|
|
2914
2925
|
},
|
|
2915
2926
|
load: {
|
|
2916
|
-
filter: { id: [
|
|
2917
|
-
async handler(
|
|
2918
|
-
if (
|
|
2927
|
+
filter: { id: [Qn, a] },
|
|
2928
|
+
async handler(l) {
|
|
2929
|
+
if (l === rt)
|
|
2919
2930
|
return `import ${JSON.stringify(s)};
|
|
2920
2931
|
`;
|
|
2921
|
-
if (
|
|
2922
|
-
return await
|
|
2932
|
+
if (l === r)
|
|
2933
|
+
return await so(e);
|
|
2923
2934
|
}
|
|
2924
2935
|
},
|
|
2925
|
-
handleHotUpdate({ file:
|
|
2926
|
-
if (
|
|
2936
|
+
handleHotUpdate({ file: l, server: d }) {
|
|
2937
|
+
if (io(l, e._localCdnCore?.sourceLocation))
|
|
2927
2938
|
return d.ws.send({ type: "full-reload" }), [];
|
|
2928
2939
|
}
|
|
2929
2940
|
};
|
|
@@ -2931,30 +2942,30 @@ function eo(e) {
|
|
|
2931
2942
|
function je(e) {
|
|
2932
2943
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2933
2944
|
}
|
|
2934
|
-
function
|
|
2945
|
+
function io(e, t) {
|
|
2935
2946
|
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2936
2947
|
}
|
|
2937
|
-
async function
|
|
2948
|
+
async function so(e) {
|
|
2938
2949
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2939
2950
|
return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
|
|
2940
2951
|
`)}
|
|
2941
2952
|
`;
|
|
2942
2953
|
}
|
|
2943
|
-
function
|
|
2954
|
+
function ro(e, t) {
|
|
2944
2955
|
return ee && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2945
2956
|
}
|
|
2946
|
-
const
|
|
2957
|
+
const no = (e) => ({
|
|
2947
2958
|
name: "@arcgis/lumina:setAssetPath",
|
|
2948
2959
|
apply: () => e.viteCommand === "build",
|
|
2949
2960
|
config: (t) => ({
|
|
2950
2961
|
base: t.base ?? e.options.assets?.defaultPath ?? Re()
|
|
2951
2962
|
})
|
|
2952
2963
|
});
|
|
2953
|
-
function
|
|
2964
|
+
function oo(e = D()) {
|
|
2954
2965
|
const t = mt(e) ?? "0.0.1";
|
|
2955
2966
|
return Es(t);
|
|
2956
2967
|
}
|
|
2957
|
-
const
|
|
2968
|
+
const ao = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2958
2969
|
Object.defineProperty(t, i, {
|
|
2959
2970
|
get() {
|
|
2960
2971
|
throw Error(
|
|
@@ -2994,7 +3005,7 @@ const ue = {
|
|
|
2994
3005
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2995
3006
|
}, nt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2996
3007
|
async function es(e, t, i = D()) {
|
|
2997
|
-
const s =
|
|
3008
|
+
const s = co(e, i), n = u.join(t, "lumina.ts"), a = await _(n) ? await W(n, "utf8") : "";
|
|
2998
3009
|
if (a.trim().replaceAll(`\r
|
|
2999
3010
|
`, `
|
|
3000
3011
|
`) === s.trim())
|
|
@@ -3014,18 +3025,18 @@ ${a}`
|
|
|
3014
3025
|
);
|
|
3015
3026
|
return ci(n, s), !0;
|
|
3016
3027
|
}
|
|
3017
|
-
function
|
|
3028
|
+
function co(e, t = D()) {
|
|
3018
3029
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3019
3030
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
3020
|
-
(d,
|
|
3021
|
-
import type { JSX as JSX$${
|
|
3031
|
+
(d, c) => `
|
|
3032
|
+
import type { JSX as JSX$${c} } from "${d.packageName}/dist/types/components";`
|
|
3022
3033
|
), r = s.length === 0 ? "" : `
|
|
3023
3034
|
|
|
3024
3035
|
declare module "@arcgis/lumina" {
|
|
3025
|
-
interface ImportStencilElements extends ${s.map((d,
|
|
3036
|
+
interface ImportStencilElements extends ${s.map((d, c) => `JSX$${c}.IntrinsicElements`).join(", ")} {}
|
|
3026
3037
|
}`, a = t.devDependencies ?? {};
|
|
3027
3038
|
return [
|
|
3028
|
-
|
|
3039
|
+
lo,
|
|
3029
3040
|
a.vitest ? `
|
|
3030
3041
|
/// <reference types="vitest/config" />
|
|
3031
3042
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3036,7 +3047,7 @@ declare module "@arcgis/lumina" {
|
|
|
3036
3047
|
`
|
|
3037
3048
|
].join("");
|
|
3038
3049
|
}
|
|
3039
|
-
const
|
|
3050
|
+
const lo = `/**
|
|
3040
3051
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3041
3052
|
* Manual edits will be overwritten.
|
|
3042
3053
|
*
|
|
@@ -3055,14 +3066,14 @@ const co = `/**
|
|
|
3055
3066
|
* is doing:
|
|
3056
3067
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3057
3068
|
*/
|
|
3058
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
3069
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, po = (e) => ({
|
|
3059
3070
|
name: Ce,
|
|
3060
3071
|
async configureServer(t) {
|
|
3061
3072
|
q && (e.server = t, await an(e));
|
|
3062
3073
|
},
|
|
3063
3074
|
configResolved() {
|
|
3064
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3065
|
-
(t) =>
|
|
3075
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = uo(e).catch(
|
|
3076
|
+
(t) => $.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3066
3077
|
));
|
|
3067
3078
|
},
|
|
3068
3079
|
transformIndexHtml: {
|
|
@@ -3111,25 +3122,25 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3111
3122
|
await e._updateLuminaTsPromise;
|
|
3112
3123
|
}
|
|
3113
3124
|
});
|
|
3114
|
-
async function
|
|
3125
|
+
async function uo(e) {
|
|
3115
3126
|
const i = (await Promise.all([ne, Gi(e)])).flat();
|
|
3116
3127
|
if (!await es(i, e.dir.src))
|
|
3117
3128
|
return;
|
|
3118
3129
|
let n = !1;
|
|
3119
3130
|
function r() {
|
|
3120
|
-
n ||
|
|
3131
|
+
n || $.warn(Ce, mo), n = !0;
|
|
3121
3132
|
}
|
|
3122
3133
|
process.on("exit", () => {
|
|
3123
|
-
r(), clearTimeout(
|
|
3134
|
+
r(), clearTimeout(l);
|
|
3124
3135
|
});
|
|
3125
|
-
const
|
|
3136
|
+
const l = setTimeout(r, 2e3);
|
|
3126
3137
|
}
|
|
3127
|
-
const
|
|
3138
|
+
const mo = qs(
|
|
3128
3139
|
"greenBright",
|
|
3129
3140
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3130
3141
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3131
3142
|
);
|
|
3132
|
-
async function
|
|
3143
|
+
async function fo(e) {
|
|
3133
3144
|
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Vs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : Pt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
3134
3145
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? pe(e.options.documentation.apiJsonFileName) : ue.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
3135
3146
|
{
|
|
@@ -3163,7 +3174,7 @@ async function mo(e) {
|
|
|
3163
3174
|
afterDiagnostic: e.options.types?.afterDiagnostic,
|
|
3164
3175
|
typeScriptInstanceCreated: e.options.types?.typeScriptInstanceCreated,
|
|
3165
3176
|
declarationTextTransformers: e.options.types?.declarationTextTransformers?.map(
|
|
3166
|
-
(
|
|
3177
|
+
(c) => (p) => c(p, e)
|
|
3167
3178
|
),
|
|
3168
3179
|
typeScriptConfig: n,
|
|
3169
3180
|
// Already merged, so pass empty object to avoid merging again
|
|
@@ -3176,9 +3187,9 @@ async function mo(e) {
|
|
|
3176
3187
|
getComponentDemoUrl: e.options.documentation?.getComponentDemoUrl
|
|
3177
3188
|
},
|
|
3178
3189
|
watch: {
|
|
3179
|
-
onUpdate: async (
|
|
3190
|
+
onUpdate: async (c) => {
|
|
3180
3191
|
e.apiJsonDeferred = Promise.withResolvers();
|
|
3181
|
-
const p = await
|
|
3192
|
+
const p = await c;
|
|
3182
3193
|
if (e.apiJsonDeferred.resolve(), e.apiJsonDeferred = void 0, p !== void 0) {
|
|
3183
3194
|
if (e.viteCommand === "serve")
|
|
3184
3195
|
if ([...p.addedModules, ...p.removedModules].some(
|
|
@@ -3209,48 +3220,48 @@ async function mo(e) {
|
|
|
3209
3220
|
}
|
|
3210
3221
|
}
|
|
3211
3222
|
},
|
|
3212
|
-
afterApiJsonCreate: (
|
|
3213
|
-
e.options.apiJson?.afterCreate?.(
|
|
3223
|
+
afterApiJsonCreate: (c) => {
|
|
3224
|
+
e.options.apiJson?.afterCreate?.(c.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), zt(e, c.apiJson));
|
|
3214
3225
|
}
|
|
3215
|
-
},
|
|
3216
|
-
e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride =
|
|
3226
|
+
}, l = i === void 0 ? a : Pt(i, a);
|
|
3227
|
+
e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = l;
|
|
3217
3228
|
const d = e.apiExtractorPluginConfig.afterExtractorCreated;
|
|
3218
|
-
e.apiExtractorPluginConfig.afterExtractorCreated = (
|
|
3219
|
-
e.apiExtractor =
|
|
3229
|
+
e.apiExtractorPluginConfig.afterExtractorCreated = (c) => {
|
|
3230
|
+
e.apiExtractor = c, d?.(c);
|
|
3220
3231
|
};
|
|
3221
3232
|
}
|
|
3222
3233
|
function zt(e, t) {
|
|
3223
3234
|
const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
|
|
3224
3235
|
for (const r of t.modules) {
|
|
3225
3236
|
const a = { ...r, declarations: [] };
|
|
3226
|
-
let
|
|
3237
|
+
let l = !1;
|
|
3227
3238
|
for (const d of r.declarations) {
|
|
3228
3239
|
if (d.customElement !== !0) {
|
|
3229
3240
|
a.declarations.push(d);
|
|
3230
3241
|
continue;
|
|
3231
3242
|
}
|
|
3232
|
-
const
|
|
3233
|
-
if (n?.push(r.sourcePath),
|
|
3234
|
-
|
|
3243
|
+
const c = d;
|
|
3244
|
+
if (n?.push(r.sourcePath), c.privacy !== void 0) {
|
|
3245
|
+
l = !0;
|
|
3235
3246
|
continue;
|
|
3236
3247
|
}
|
|
3237
3248
|
const p = {
|
|
3238
|
-
...
|
|
3239
|
-
members:
|
|
3249
|
+
...c,
|
|
3250
|
+
members: c.members.filter((m) => m.privacy === void 0)
|
|
3240
3251
|
};
|
|
3241
3252
|
a.declarations.push(p), s.push(p);
|
|
3242
3253
|
}
|
|
3243
|
-
|
|
3254
|
+
l || i.modules.push(a);
|
|
3244
3255
|
}
|
|
3245
3256
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3246
3257
|
}
|
|
3247
|
-
var
|
|
3258
|
+
var go = Object.defineProperty, I = (e, t, i, s) => {
|
|
3248
3259
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3249
3260
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3250
|
-
return n &&
|
|
3261
|
+
return n && go(t, i, n), n;
|
|
3251
3262
|
};
|
|
3252
3263
|
const V = "@arcgis/lumina:context";
|
|
3253
|
-
class
|
|
3264
|
+
class P {
|
|
3254
3265
|
constructor(t) {
|
|
3255
3266
|
this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._plugin = {
|
|
3256
3267
|
name: V,
|
|
@@ -3263,27 +3274,27 @@ class $ {
|
|
|
3263
3274
|
this.viteConfig = r;
|
|
3264
3275
|
const a = r.build.minify !== !1;
|
|
3265
3276
|
this.shouldMinify = a && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
3266
|
-
const
|
|
3277
|
+
const l = u.join(r.root, u.sep), d = u.join(l, "src", u.sep), c = u.join(d, "components", u.sep), p = u.join(u.resolve(l, r.build.outDir), u.sep), m = u.join(u.relative(l, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? le, u.sep), h = u.join(g, "assets", u.sep);
|
|
3267
3278
|
if (this.dir = {
|
|
3268
|
-
root:
|
|
3279
|
+
root: l,
|
|
3269
3280
|
src: d,
|
|
3270
|
-
srcComponents:
|
|
3281
|
+
srcComponents: c,
|
|
3271
3282
|
relativeDist: m,
|
|
3272
3283
|
dist: p,
|
|
3273
3284
|
distComponents: f,
|
|
3274
3285
|
distCdn: g,
|
|
3275
3286
|
distCdnAssets: h
|
|
3276
|
-
},
|
|
3287
|
+
}, $.initialize(r.logger, l), r.root !== oi())
|
|
3277
3288
|
throw Error(
|
|
3278
3289
|
b(
|
|
3279
3290
|
V,
|
|
3280
3291
|
"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/webgis-sdk/issues/2126 or contact Lumina maintainers."
|
|
3281
3292
|
)
|
|
3282
3293
|
);
|
|
3283
|
-
p ===
|
|
3294
|
+
p === l ? $.warn(
|
|
3284
3295
|
V,
|
|
3285
3296
|
"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/)"
|
|
3286
|
-
) : m.startsWith("..") &&
|
|
3297
|
+
) : m.startsWith("..") && $.warn(
|
|
3287
3298
|
V,
|
|
3288
3299
|
"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."
|
|
3289
3300
|
), this.isInStorybook = r.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(r.server?.hmr ?? !0), this.isInBuildWatch = r.command === "build" && r.build.watch != null;
|
|
@@ -3291,8 +3302,8 @@ class $ {
|
|
|
3291
3302
|
this.apiJsonEnabled = !y && !this.isInPuppeteerTestBackEnd && !v && !w, this.apiJsonEnabled ? (this.apiExtractorPluginConfig.serve = {
|
|
3292
3303
|
extract: !0
|
|
3293
3304
|
}, (this.viteCommand === "build" ? r.build.watch : r.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
|
|
3294
|
-
const
|
|
3295
|
-
|
|
3305
|
+
const S = this.viteCommand === "serve" && !this.isInStorybook, T = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3306
|
+
S && (T.context.isLuminaMinimalExtraction = !0, T.types.typeCheckedExtraction = !1, T.types.fullTypeCheck = !1), this.isInStorybook && (T.context.dtsEmitPath = ""), this._typeScriptPrinter = Hs({
|
|
3296
3307
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3297
3308
|
target: o.ScriptTarget.ESNext,
|
|
3298
3309
|
sourceMap: r.build.sourcemap !== !1
|
|
@@ -3324,21 +3335,21 @@ class $ {
|
|
|
3324
3335
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3325
3336
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3326
3337
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3327
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3338
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = fo(this);
|
|
3328
3339
|
const s = process.cwd().length + 1;
|
|
3329
3340
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3330
3341
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
3331
|
-
for (let
|
|
3332
|
-
const
|
|
3333
|
-
Pe(
|
|
3342
|
+
for (let l = 0; l < r.length; ++l) {
|
|
3343
|
+
const c = r[l].slice(s);
|
|
3344
|
+
Pe(c, "src/components") && a.push(c);
|
|
3334
3345
|
}
|
|
3335
3346
|
return a;
|
|
3336
3347
|
}), ki(void 0, t);
|
|
3337
|
-
const n = t.build?.preamble ??
|
|
3338
|
-
this.banner =
|
|
3348
|
+
const n = t.build?.preamble ?? oo();
|
|
3349
|
+
this.banner = ao(n);
|
|
3339
3350
|
}
|
|
3340
3351
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3341
|
-
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (
|
|
3352
|
+
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : ($.warn(Pi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
3342
3353
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3343
3354
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3344
3355
|
}
|
|
@@ -3359,11 +3370,11 @@ class $ {
|
|
|
3359
3370
|
)
|
|
3360
3371
|
);
|
|
3361
3372
|
if (r === void 0 && !n) {
|
|
3362
|
-
const
|
|
3363
|
-
if (
|
|
3364
|
-
return
|
|
3373
|
+
const l = this._typeScriptSourceFiles.get(t);
|
|
3374
|
+
if (l?.text === i)
|
|
3375
|
+
return l;
|
|
3365
3376
|
}
|
|
3366
|
-
return i !== r?.text && ((this.viteCommand !== "serve" || this.isInStorybook) &&
|
|
3377
|
+
return i !== r?.text && ((this.viteCommand !== "serve" || this.isInStorybook) && $.warn(
|
|
3367
3378
|
V,
|
|
3368
3379
|
"The Vite's transform() content didn't match TypeScript's content. This may happen if some plugin transformed a file before Lumina or Vite got out of sync with TypeScript. This may lead to false errors. Debug your build configuration or report it as a bug",
|
|
3369
3380
|
t
|
|
@@ -3420,73 +3431,73 @@ class $ {
|
|
|
3420
3431
|
);
|
|
3421
3432
|
}
|
|
3422
3433
|
logLintWarning(t) {
|
|
3423
|
-
|
|
3434
|
+
$.warn("@arcgis/lumina:linting", t);
|
|
3424
3435
|
}
|
|
3425
3436
|
logLintError(t, i, s) {
|
|
3426
|
-
this._silencedRules?.[t]?.includes(i.slice(this.dir.root.length)) !== !0 ?
|
|
3437
|
+
this._silencedRules?.[t]?.includes(i.slice(this.dir.root.length)) !== !0 ? $.error("@arcgis/lumina:linting", s, i) : $.warn("@arcgis/lumina:linting", s, i);
|
|
3427
3438
|
}
|
|
3428
3439
|
}
|
|
3429
3440
|
I([
|
|
3430
3441
|
k("configResolved()")
|
|
3431
|
-
],
|
|
3442
|
+
], P.prototype, "shouldMinify");
|
|
3432
3443
|
I([
|
|
3433
3444
|
k("configResolved()")
|
|
3434
|
-
],
|
|
3445
|
+
], P.prototype, "shouldMinifyJsx");
|
|
3435
3446
|
I([
|
|
3436
3447
|
k("configResolved()")
|
|
3437
|
-
],
|
|
3448
|
+
], P.prototype, "dir");
|
|
3438
3449
|
I([
|
|
3439
3450
|
k("load()")
|
|
3440
|
-
],
|
|
3451
|
+
], P.prototype, "apiJson");
|
|
3441
3452
|
I([
|
|
3442
3453
|
k("load()")
|
|
3443
|
-
],
|
|
3454
|
+
], P.prototype, "apiJsonComponents");
|
|
3444
3455
|
I([
|
|
3445
3456
|
k("load()")
|
|
3446
|
-
],
|
|
3457
|
+
], P.prototype, "privateApiJson");
|
|
3447
3458
|
I([
|
|
3448
3459
|
k("configResolved()")
|
|
3449
|
-
],
|
|
3460
|
+
], P.prototype, "apiJsonEnabled");
|
|
3450
3461
|
I([
|
|
3451
3462
|
k("apply()")
|
|
3452
|
-
],
|
|
3463
|
+
], P.prototype, "environment");
|
|
3453
3464
|
I([
|
|
3454
3465
|
k("apply()")
|
|
3455
|
-
],
|
|
3466
|
+
], P.prototype, "isInTest");
|
|
3456
3467
|
I([
|
|
3457
3468
|
k("apply()")
|
|
3458
|
-
],
|
|
3469
|
+
], P.prototype, "isInPuppeteerTestBackEnd");
|
|
3459
3470
|
I([
|
|
3460
3471
|
k("apply()")
|
|
3461
|
-
],
|
|
3472
|
+
], P.prototype, "isInPuppeteerTestFrontEnd");
|
|
3462
3473
|
I([
|
|
3463
3474
|
k("configResolved()")
|
|
3464
|
-
],
|
|
3475
|
+
], P.prototype, "isInBuildWatch");
|
|
3465
3476
|
I([
|
|
3466
3477
|
k("configResolved()")
|
|
3467
|
-
],
|
|
3478
|
+
], P.prototype, "isInStorybook");
|
|
3468
3479
|
I([
|
|
3469
3480
|
k("configResolved()")
|
|
3470
|
-
],
|
|
3481
|
+
], P.prototype, "hmrEnabled");
|
|
3471
3482
|
I([
|
|
3472
3483
|
k("apply()")
|
|
3473
|
-
],
|
|
3484
|
+
], P.prototype, "viteCommand");
|
|
3474
3485
|
I([
|
|
3475
3486
|
k("configResolved()")
|
|
3476
|
-
],
|
|
3487
|
+
], P.prototype, "isFullApiExtraction");
|
|
3477
3488
|
I([
|
|
3478
3489
|
k("configResolved()")
|
|
3479
|
-
],
|
|
3490
|
+
], P.prototype, "viteConfig");
|
|
3480
3491
|
I([
|
|
3481
3492
|
k("configureServer()")
|
|
3482
|
-
],
|
|
3493
|
+
], P.prototype, "server");
|
|
3483
3494
|
I([
|
|
3484
3495
|
k("transform()")
|
|
3485
|
-
],
|
|
3496
|
+
], P.prototype, "_globalHydratedCssString");
|
|
3486
3497
|
I([
|
|
3487
3498
|
k("configResolved()")
|
|
3488
|
-
],
|
|
3489
|
-
function
|
|
3499
|
+
], P.prototype, "_typeScriptPrinter");
|
|
3500
|
+
function ho(e, t, i) {
|
|
3490
3501
|
const s = Ii()[t] ?? is(e)[t];
|
|
3491
3502
|
if (s === void 0) {
|
|
3492
3503
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
@@ -3501,7 +3512,7 @@ function go(e, t, i) {
|
|
|
3501
3512
|
}
|
|
3502
3513
|
return s;
|
|
3503
3514
|
}
|
|
3504
|
-
function
|
|
3515
|
+
function yo(e, t) {
|
|
3505
3516
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3506
3517
|
}
|
|
3507
3518
|
function is(e) {
|
|
@@ -3516,8 +3527,8 @@ function is(e) {
|
|
|
3516
3527
|
e.viteCommand === "build"
|
|
3517
3528
|
), e._localDefinedComponents;
|
|
3518
3529
|
}
|
|
3519
|
-
const qt = "makeRuntime(",
|
|
3520
|
-
name:
|
|
3530
|
+
const qt = "makeRuntime(", vo = "@arcgis/core", bo = "@arcgis/lumina:injectRuntimeOptions", wo = (e) => ({
|
|
3531
|
+
name: bo,
|
|
3521
3532
|
transform: {
|
|
3522
3533
|
filter: {
|
|
3523
3534
|
id: /\/src\/runtime\.ts$/u
|
|
@@ -3544,7 +3555,7 @@ const qt = "makeRuntime(", yo = "@arcgis/core", vo = "@arcgis/lumina:injectRunti
|
|
|
3544
3555
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3545
3556
|
// a cyclical dependency.
|
|
3546
3557
|
q ? `
|
|
3547
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3558
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${vo}/applications/Components/reactiveUtils.js";
|
|
3548
3559
|
createObservable,
|
|
3549
3560
|
runtime.t = trackAccess;
|
|
3550
3561
|
runtime.o = createObservable;
|
|
@@ -3556,23 +3567,23 @@ runtime.r = runTracked;` : ""
|
|
|
3556
3567
|
}
|
|
3557
3568
|
}
|
|
3558
3569
|
});
|
|
3559
|
-
function
|
|
3570
|
+
function So(e) {
|
|
3560
3571
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${Q}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3561
3572
|
`;
|
|
3562
3573
|
}
|
|
3563
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3574
|
+
const we = "@arcgis/lumina:addNonLazyImports", Co = (e) => ({
|
|
3564
3575
|
name: we,
|
|
3565
3576
|
apply: () => e.viteCommand === "build",
|
|
3566
3577
|
generateBundle(t, i) {
|
|
3567
3578
|
const n = e.viteConfig.build.sourcemap !== !1 ? " " : `
|
|
3568
3579
|
`;
|
|
3569
3580
|
let r = !1;
|
|
3570
|
-
if (Object.entries(i).forEach(([a,
|
|
3581
|
+
if (Object.entries(i).forEach(([a, l]) => {
|
|
3571
3582
|
const d = Ge(a, e.apiExtractor);
|
|
3572
|
-
if (d !== a && (
|
|
3573
|
-
const
|
|
3574
|
-
let m =
|
|
3575
|
-
m = un(m, e, p,
|
|
3583
|
+
if (d !== a && (l.fileName = d), l.type === "chunk") {
|
|
3584
|
+
const c = u.dirname(u.join(e.dir.dist, a)), p = d === a ? c : u.dirname(u.join(e.dir.dist, d));
|
|
3585
|
+
let m = l.code;
|
|
3586
|
+
m = un(m, e, p, c), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = So(e) + m), m = `${e.banner}${n}${m}`, l.code = m;
|
|
3576
3587
|
}
|
|
3577
3588
|
}), !r && !e.isInStorybook)
|
|
3578
3589
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3583,18 +3594,18 @@ const we = "@arcgis/lumina:addNonLazyImports", So = (e) => ({
|
|
|
3583
3594
|
const t = e._customElementDependencies, i = Object.entries(t), s = new Set(
|
|
3584
3595
|
i.map(([r]) => r).filter((r) => Pe(r, e.dir.srcComponents))
|
|
3585
3596
|
);
|
|
3586
|
-
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames:
|
|
3587
|
-
if (s.has(r) || a.length === 0 &&
|
|
3597
|
+
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: l, referencedBy: d }]) => {
|
|
3598
|
+
if (s.has(r) || a.length === 0 && l.length === 0)
|
|
3588
3599
|
return;
|
|
3589
|
-
const
|
|
3590
|
-
if (
|
|
3591
|
-
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...
|
|
3592
|
-
}), (a.length > 0 ||
|
|
3600
|
+
const c = ss(t, d, s);
|
|
3601
|
+
if (c.forEach((p) => {
|
|
3602
|
+
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...l);
|
|
3603
|
+
}), (a.length > 0 || l.length > 0) && c.length === 0) {
|
|
3593
3604
|
const p = De(r);
|
|
3594
3605
|
throw Error(
|
|
3595
3606
|
b(
|
|
3596
3607
|
we,
|
|
3597
|
-
`Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...
|
|
3608
|
+
`Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...l].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.
|
|
3598
3609
|
|
|
3599
3610
|
Possible causes:
|
|
3600
3611
|
- You are re-exporting a functional component from a barrel file. Refactor such cases to import the functional component directly from the file that declares it.
|
|
@@ -3604,36 +3615,36 @@ Possible causes:
|
|
|
3604
3615
|
);
|
|
3605
3616
|
}
|
|
3606
3617
|
});
|
|
3607
|
-
const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames:
|
|
3618
|
+
const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames: l }]) => {
|
|
3608
3619
|
if (!s.has(r))
|
|
3609
3620
|
return [];
|
|
3610
|
-
const d = u.dirname(r),
|
|
3611
|
-
function m(
|
|
3612
|
-
const x =
|
|
3621
|
+
const d = u.dirname(r), c = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, c);
|
|
3622
|
+
function m(E) {
|
|
3623
|
+
const x = ho(e, E, r);
|
|
3613
3624
|
if (x === void 0)
|
|
3614
3625
|
return;
|
|
3615
|
-
const
|
|
3616
|
-
if (
|
|
3617
|
-
return
|
|
3626
|
+
const C = yo(x, p);
|
|
3627
|
+
if (C !== `./${p}`)
|
|
3628
|
+
return C.startsWith(".") ? `${C}/${Ht}` : C;
|
|
3618
3629
|
}
|
|
3619
|
-
const f = new Set(a), g = new Set(
|
|
3620
|
-
`, v = h.map(y).join(""), w = Array.from(g, (
|
|
3621
|
-
const x = m(
|
|
3630
|
+
const f = new Set(a), g = new Set(l), h = Array.from(f, m).filter(F), y = (E) => `import "${E}";
|
|
3631
|
+
`, v = h.map(y).join(""), w = Array.from(g, (E) => {
|
|
3632
|
+
const x = m(E);
|
|
3622
3633
|
if (x !== void 0) {
|
|
3623
|
-
if (f.has(
|
|
3624
|
-
|
|
3634
|
+
if (f.has(E)) {
|
|
3635
|
+
$.warn(
|
|
3625
3636
|
we,
|
|
3626
|
-
`"${
|
|
3637
|
+
`"${E}" 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.`
|
|
3627
3638
|
);
|
|
3628
3639
|
return;
|
|
3629
3640
|
}
|
|
3630
|
-
return `.set("${
|
|
3641
|
+
return `.set("${E}", () => import("${x}"))
|
|
3631
3642
|
`;
|
|
3632
3643
|
}
|
|
3633
|
-
}).filter(F),
|
|
3634
|
-
${
|
|
3635
|
-
deferredLoaders${w.join("")};` :
|
|
3636
|
-
return await z(u.join(e.dir.dist, p, Ht),
|
|
3644
|
+
}).filter(F), S = `${v}export * from "./${gt}";`, T = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3645
|
+
${S}
|
|
3646
|
+
deferredLoaders${w.join("")};` : S;
|
|
3647
|
+
return await z(u.join(e.dir.dist, p, Ht), T);
|
|
3637
3648
|
});
|
|
3638
3649
|
await Promise.all(n);
|
|
3639
3650
|
}
|
|
@@ -3657,14 +3668,14 @@ function Z(e) {
|
|
|
3657
3668
|
return (
|
|
3658
3669
|
// Inlined string literal
|
|
3659
3670
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3660
|
-
|
|
3671
|
+
Eo.has(e.kind) || // Ternary with both branches never undefined
|
|
3661
3672
|
o.isConditionalExpression(e) && Z(e.whenTrue) && Z(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3662
|
-
o.isBinaryExpression(e) && (
|
|
3673
|
+
o.isBinaryExpression(e) && (To.has(e.operatorToken.kind) || Z(e.left) && Z(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3663
3674
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Z(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3664
3675
|
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && dr.has(e.tag.text)
|
|
3665
3676
|
);
|
|
3666
3677
|
}
|
|
3667
|
-
const
|
|
3678
|
+
const Eo = /* @__PURE__ */ new Set([
|
|
3668
3679
|
o.SyntaxKind.NumericLiteral,
|
|
3669
3680
|
o.SyntaxKind.BigIntLiteral,
|
|
3670
3681
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3683,7 +3694,7 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3683
3694
|
o.SyntaxKind.ClassExpression,
|
|
3684
3695
|
// Trust? Trust.
|
|
3685
3696
|
o.SyntaxKind.NonNullExpression
|
|
3686
|
-
]),
|
|
3697
|
+
]), To = /* @__PURE__ */ new Set([
|
|
3687
3698
|
o.SyntaxKind.PlusEqualsToken,
|
|
3688
3699
|
o.SyntaxKind.MinusEqualsToken,
|
|
3689
3700
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3718,9 +3729,9 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3718
3729
|
o.SyntaxKind.SlashToken,
|
|
3719
3730
|
o.SyntaxKind.PercentToken,
|
|
3720
3731
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3721
|
-
]),
|
|
3732
|
+
]), $o = {
|
|
3722
3733
|
property(e, t, i, s) {
|
|
3723
|
-
const n =
|
|
3734
|
+
const n = Po(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3724
3735
|
if (a) {
|
|
3725
3736
|
const f = qe(t);
|
|
3726
3737
|
if (f === !0)
|
|
@@ -3728,20 +3739,20 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3728
3739
|
if (f === !1)
|
|
3729
3740
|
return [];
|
|
3730
3741
|
}
|
|
3731
|
-
const
|
|
3742
|
+
const l = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Ee(e, t, a), d = l[0] !== "=";
|
|
3732
3743
|
if (a && d)
|
|
3733
|
-
return [n.name, ...
|
|
3734
|
-
const [
|
|
3744
|
+
return [n.name, ...l];
|
|
3745
|
+
const [c, p] = l, m = n?.type === "stringifiedNonReflected";
|
|
3735
3746
|
if (r || m) {
|
|
3736
3747
|
const f = Vt(
|
|
3737
3748
|
p,
|
|
3738
3749
|
e,
|
|
3739
3750
|
m ? "" : void 0
|
|
3740
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3751
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? Io(f, e) : f;
|
|
3741
3752
|
if (h !== p)
|
|
3742
|
-
return [m ? `.${i}` : n.name,
|
|
3753
|
+
return [m ? `.${i}` : n.name, c, h];
|
|
3743
3754
|
}
|
|
3744
|
-
return [`.${i}`, ...
|
|
3755
|
+
return [`.${i}`, ...l];
|
|
3745
3756
|
},
|
|
3746
3757
|
attribute(e, t, i) {
|
|
3747
3758
|
const s = t === void 0 || qe(t);
|
|
@@ -3810,21 +3821,21 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3810
3821
|
return [o.factory.createIdentifier(n)];
|
|
3811
3822
|
}
|
|
3812
3823
|
};
|
|
3813
|
-
function
|
|
3824
|
+
function Po(e, t, i) {
|
|
3814
3825
|
if (typeof e == "string") {
|
|
3815
3826
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3816
3827
|
if (r !== void 0)
|
|
3817
3828
|
return { name: r, type: "reflected" };
|
|
3818
3829
|
}
|
|
3819
|
-
const s = ze(
|
|
3830
|
+
const s = ze(U.common, t);
|
|
3820
3831
|
if (s !== void 0)
|
|
3821
3832
|
return s;
|
|
3822
3833
|
if (typeof e == "string") {
|
|
3823
|
-
const n = ze(
|
|
3834
|
+
const n = ze(U.perElement[e], t);
|
|
3824
3835
|
if (n !== void 0)
|
|
3825
3836
|
return n;
|
|
3826
3837
|
} else {
|
|
3827
|
-
const n = Object.values(
|
|
3838
|
+
const n = Object.values(U.perElement).map(
|
|
3828
3839
|
(a) => ze(a, t)
|
|
3829
3840
|
), r = Xe(n, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? Xe(n, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3830
3841
|
if (r !== void 0)
|
|
@@ -3904,25 +3915,25 @@ function Xt(e, t, i) {
|
|
|
3904
3915
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3905
3916
|
);
|
|
3906
3917
|
const s = t.expression;
|
|
3907
|
-
if (
|
|
3918
|
+
if (ko(s)) {
|
|
3908
3919
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3909
3920
|
e.neededImports.add(r);
|
|
3910
|
-
const a = e.importRenames[r],
|
|
3921
|
+
const a = e.importRenames[r], l = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
3911
3922
|
H(e, void 0, s)
|
|
3912
3923
|
]);
|
|
3913
|
-
return [`${i}=`,
|
|
3924
|
+
return [`${i}=`, l];
|
|
3914
3925
|
} else
|
|
3915
3926
|
return [i, ...Ee(e, t, !0)];
|
|
3916
3927
|
}
|
|
3917
|
-
const
|
|
3918
|
-
function
|
|
3928
|
+
const ko = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3929
|
+
function Io(e, t) {
|
|
3919
3930
|
t.neededImports.add("live");
|
|
3920
3931
|
const i = t.importRenames.live;
|
|
3921
3932
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3922
3933
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3923
3934
|
]);
|
|
3924
3935
|
}
|
|
3925
|
-
function
|
|
3936
|
+
function xo(e) {
|
|
3926
3937
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Yt && e.expression.arguments.length <= 1)
|
|
3927
3938
|
return {
|
|
3928
3939
|
propType: Yt[e.expression.expression.text],
|
|
@@ -3940,15 +3951,15 @@ const Yt = {
|
|
|
3940
3951
|
bindBooleanAttribute: "booleanAttribute",
|
|
3941
3952
|
bindEvent: "event"
|
|
3942
3953
|
};
|
|
3943
|
-
function
|
|
3944
|
-
return
|
|
3954
|
+
function Ao(e, t, i) {
|
|
3955
|
+
return No.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ui.has(e) || e.includes("-") ? "attribute" : !pt(i) && (mi.has(e) || (i === Ye ? !1 : i === ke ? (
|
|
3945
3956
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3946
3957
|
Object.values(Qe).some((r) => r.has(e))
|
|
3947
|
-
) : Qe[i]?.has(e) === !0)) ? kt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (lt.has(i) || dt.has(i)) ? e in
|
|
3958
|
+
) : Qe[i]?.has(e) === !0)) ? kt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (lt.has(i) || dt.has(i)) ? e in U.common.reflected || e in U.common.stringifiedReflected || e in U.common.stringifiedNonReflected ? "property" : kt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3948
3959
|
}
|
|
3949
|
-
const
|
|
3960
|
+
const Lo = ["class", "style", "ref", "directives", "key", "deferLoad"], No = new Set(Lo), jo = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3950
3961
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3951
|
-
const n =
|
|
3962
|
+
const n = Fo(t);
|
|
3952
3963
|
if (n.length % 2 === 0)
|
|
3953
3964
|
throw new Error("Normalized template parts array length must be odd");
|
|
3954
3965
|
const [r, ...a] = n;
|
|
@@ -3964,16 +3975,16 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3964
3975
|
typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
|
|
3965
3976
|
);
|
|
3966
3977
|
}
|
|
3967
|
-
const
|
|
3968
|
-
s.neededImports.add(
|
|
3969
|
-
const d = s.importRenames[
|
|
3978
|
+
const l = typeof i == "string" ? i : ce;
|
|
3979
|
+
s.neededImports.add(l);
|
|
3980
|
+
const d = s.importRenames[l], c = o.factory.createTaggedTemplateExpression(
|
|
3970
3981
|
o.factory.createIdentifier(d),
|
|
3971
3982
|
void 0,
|
|
3972
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3983
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Do(a))
|
|
3973
3984
|
);
|
|
3974
|
-
return He(s, e,
|
|
3985
|
+
return He(s, e, c);
|
|
3975
3986
|
}
|
|
3976
|
-
const
|
|
3987
|
+
const Fo = (e) => e.reduce(
|
|
3977
3988
|
(t, i, s) => {
|
|
3978
3989
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3979
3990
|
if (r && a)
|
|
@@ -3983,7 +3994,7 @@ const jo = (e) => e.reduce(
|
|
|
3983
3994
|
},
|
|
3984
3995
|
[""]
|
|
3985
3996
|
);
|
|
3986
|
-
function
|
|
3997
|
+
function Do(e) {
|
|
3987
3998
|
if (!(e.length % 2 === 0))
|
|
3988
3999
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3989
4000
|
const i = e.length / 2;
|
|
@@ -3991,13 +4002,13 @@ function Fo(e) {
|
|
|
3991
4002
|
const r = n * 2, a = e[r];
|
|
3992
4003
|
if (typeof a == "string")
|
|
3993
4004
|
throw new Error("Expected to receive a normalized array of parts");
|
|
3994
|
-
const
|
|
4005
|
+
const l = r + 1, d = e[l];
|
|
3995
4006
|
if (typeof d != "string")
|
|
3996
4007
|
throw new Error("Expected to receive a normalized array of parts");
|
|
3997
|
-
const
|
|
4008
|
+
const c = n === i - 1;
|
|
3998
4009
|
return o.factory.createTemplateSpan(
|
|
3999
4010
|
a,
|
|
4000
|
-
|
|
4011
|
+
c ? o.factory.createTemplateTail(d) : o.factory.createTemplateMiddle(d)
|
|
4001
4012
|
);
|
|
4002
4013
|
});
|
|
4003
4014
|
}
|
|
@@ -4022,21 +4033,21 @@ function ns(e, t) {
|
|
|
4022
4033
|
);
|
|
4023
4034
|
}
|
|
4024
4035
|
const vt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4025
|
-
function
|
|
4036
|
+
function Ro(e) {
|
|
4026
4037
|
const t = vt(e);
|
|
4027
4038
|
if (t.length === 0)
|
|
4028
4039
|
return [e || " "];
|
|
4029
4040
|
const i = t.reduceRight(
|
|
4030
4041
|
([n, ...r], a) => {
|
|
4031
|
-
const
|
|
4042
|
+
const l = Oo(n), d = os(l.slice(a.pos, a.end));
|
|
4032
4043
|
return [
|
|
4033
|
-
|
|
4044
|
+
l.slice(0, a.pos),
|
|
4034
4045
|
/**
|
|
4035
4046
|
* Literal values (like this) in place of directives are ignored by Lit:
|
|
4036
4047
|
* https://github.com/lit/lit/blob/56cb2ca4a86f2c7f6af757c612f05e50d1966615/packages/lit-html/src/lit-html.ts#L1111
|
|
4037
4048
|
*/
|
|
4038
4049
|
o.factory.createNoSubstitutionTemplateLiteral(d),
|
|
4039
|
-
|
|
4050
|
+
l.slice(a.end),
|
|
4040
4051
|
...r
|
|
4041
4052
|
];
|
|
4042
4053
|
},
|
|
@@ -4047,12 +4058,12 @@ function Do(e) {
|
|
|
4047
4058
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4048
4059
|
}
|
|
4049
4060
|
const os = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4050
|
-
function
|
|
4061
|
+
function Oo(e) {
|
|
4051
4062
|
if (typeof e == "string")
|
|
4052
4063
|
return e;
|
|
4053
4064
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4054
4065
|
}
|
|
4055
|
-
function
|
|
4066
|
+
function Mo(e, t) {
|
|
4056
4067
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4057
4068
|
return t;
|
|
4058
4069
|
const s = t.arguments[0];
|
|
@@ -4062,31 +4073,31 @@ function Oo(e, t) {
|
|
|
4062
4073
|
if (!(typeof r == "object" && // If .map() callback has 3rd argument, it's not supported
|
|
4063
4074
|
s.parameters.length <= 2))
|
|
4064
4075
|
return t;
|
|
4065
|
-
const
|
|
4066
|
-
let d = !0,
|
|
4067
|
-
if (Qt(
|
|
4068
|
-
|
|
4076
|
+
const l = ge(s.body);
|
|
4077
|
+
let d = !0, c;
|
|
4078
|
+
if (Qt(l))
|
|
4079
|
+
c = l;
|
|
4069
4080
|
else {
|
|
4070
|
-
if (!o.isBlock(
|
|
4081
|
+
if (!o.isBlock(l))
|
|
4071
4082
|
return t;
|
|
4072
|
-
const v =
|
|
4083
|
+
const v = l.statements.at(-1);
|
|
4073
4084
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
4074
4085
|
return t;
|
|
4075
|
-
const
|
|
4076
|
-
if (!Qt(
|
|
4086
|
+
const S = ge(v.expression);
|
|
4087
|
+
if (!Qt(S))
|
|
4077
4088
|
return t;
|
|
4078
|
-
const
|
|
4079
|
-
if (
|
|
4089
|
+
const T = l.statements.slice(0, -1);
|
|
4090
|
+
if (T.some(as))
|
|
4080
4091
|
return t;
|
|
4081
|
-
d =
|
|
4092
|
+
d = T.length === 0, c = S;
|
|
4082
4093
|
}
|
|
4083
|
-
const p = o.isJsxElement(
|
|
4094
|
+
const p = o.isJsxElement(c) ? c.openingElement : c, m = us(p);
|
|
4084
4095
|
if (m === -1)
|
|
4085
4096
|
return t;
|
|
4086
4097
|
const f = p.attributes.properties[m];
|
|
4087
4098
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4088
4099
|
return t;
|
|
4089
|
-
const g = yt(f.initializer, e.sourceFile), h =
|
|
4100
|
+
const g = yt(f.initializer, e.sourceFile), h = Jo(r, s, g, d, e);
|
|
4090
4101
|
if (h === void 0)
|
|
4091
4102
|
return t;
|
|
4092
4103
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4104,7 +4115,7 @@ function Oo(e, t) {
|
|
|
4104
4115
|
s.parameters,
|
|
4105
4116
|
s.type,
|
|
4106
4117
|
s.equalsGreaterThanToken,
|
|
4107
|
-
|
|
4118
|
+
l
|
|
4108
4119
|
)
|
|
4109
4120
|
]);
|
|
4110
4121
|
}
|
|
@@ -4119,15 +4130,15 @@ function as(e) {
|
|
|
4119
4130
|
void 0
|
|
4120
4131
|
), t;
|
|
4121
4132
|
}
|
|
4122
|
-
function
|
|
4123
|
-
const r =
|
|
4133
|
+
function Jo(e, t, i, s, n) {
|
|
4134
|
+
const r = B(i);
|
|
4124
4135
|
if (r === void 0)
|
|
4125
4136
|
return;
|
|
4126
4137
|
let a = cs(e.name, r);
|
|
4127
|
-
const
|
|
4128
|
-
if (
|
|
4129
|
-
r.every(Fe,
|
|
4130
|
-
|
|
4138
|
+
const l = t.parameters.at(1);
|
|
4139
|
+
if (l !== void 0 && o.isIdentifier(l.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
4140
|
+
r.every(Fe, l.name)) {
|
|
4141
|
+
$.warn(
|
|
4131
4142
|
"@arcgis/lumina:jsxToLitHtml",
|
|
4132
4143
|
"It looks like you are trying to use .map() index as a key={} prop value. Doing so is potentially pointless and may cause performance degradation. In Lit it is safe to omit the key={} prop. If you really mean to use index as the key, then use the keyed() Lit directive directly, rather than the JSX key={} prop.",
|
|
4133
4144
|
n.sourceFile.fileName
|
|
@@ -4135,7 +4146,7 @@ function Mo(e, t, i, s, n) {
|
|
|
4135
4146
|
return;
|
|
4136
4147
|
}
|
|
4137
4148
|
if (!s) {
|
|
4138
|
-
const d =
|
|
4149
|
+
const d = Ko(r, a, t);
|
|
4139
4150
|
if (d === void 0)
|
|
4140
4151
|
return;
|
|
4141
4152
|
a = d;
|
|
@@ -4151,38 +4162,38 @@ function Mo(e, t, i, s, n) {
|
|
|
4151
4162
|
e.initializer
|
|
4152
4163
|
);
|
|
4153
4164
|
}
|
|
4154
|
-
function
|
|
4165
|
+
function B(e) {
|
|
4155
4166
|
if (o.isIdentifier(e))
|
|
4156
4167
|
return [e.text];
|
|
4157
4168
|
if (o.isPropertyAccessExpression(e))
|
|
4158
|
-
return
|
|
4169
|
+
return B(e.expression);
|
|
4159
4170
|
if (o.isElementAccessExpression(e))
|
|
4160
|
-
return
|
|
4171
|
+
return B(e.argumentExpression);
|
|
4161
4172
|
if (o.isConditionalExpression(e)) {
|
|
4162
|
-
const t =
|
|
4173
|
+
const t = B(e.condition), i = B(e.whenTrue), s = B(e.whenFalse);
|
|
4163
4174
|
return t === void 0 || i === void 0 || s === void 0 ? void 0 : [...t, ...i, ...s];
|
|
4164
4175
|
} else if (o.isBinaryExpression(e)) {
|
|
4165
|
-
const t =
|
|
4176
|
+
const t = B(e.left), i = B(e.right);
|
|
4166
4177
|
return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
|
|
4167
4178
|
} else if (o.isTemplateExpression(e)) {
|
|
4168
4179
|
const t = [];
|
|
4169
4180
|
for (const i of e.templateSpans) {
|
|
4170
|
-
const s =
|
|
4181
|
+
const s = B(i.expression);
|
|
4171
4182
|
if (s === void 0)
|
|
4172
4183
|
return;
|
|
4173
4184
|
t.push(...s);
|
|
4174
4185
|
}
|
|
4175
4186
|
return t;
|
|
4176
4187
|
} else {
|
|
4177
|
-
if (
|
|
4188
|
+
if (Bo.has(e.kind))
|
|
4178
4189
|
return [];
|
|
4179
4190
|
{
|
|
4180
4191
|
const t = ge(e);
|
|
4181
|
-
return t !== e ?
|
|
4192
|
+
return t !== e ? B(t) : void 0;
|
|
4182
4193
|
}
|
|
4183
4194
|
}
|
|
4184
4195
|
}
|
|
4185
|
-
const
|
|
4196
|
+
const Bo = /* @__PURE__ */ new Set([
|
|
4186
4197
|
o.SyntaxKind.NumericLiteral,
|
|
4187
4198
|
o.SyntaxKind.BigIntLiteral,
|
|
4188
4199
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4191,12 +4202,12 @@ const Jo = /* @__PURE__ */ new Set([
|
|
|
4191
4202
|
o.SyntaxKind.FalseKeyword,
|
|
4192
4203
|
o.SyntaxKind.NullKeyword,
|
|
4193
4204
|
o.SyntaxKind.TrueKeyword
|
|
4194
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, cs = (e, t) => o.isObjectBindingPattern(e) ?
|
|
4195
|
-
function
|
|
4205
|
+
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, cs = (e, t) => o.isObjectBindingPattern(e) ? Wo(e, t) : e;
|
|
4206
|
+
function Ko(e, t, i) {
|
|
4196
4207
|
if (e.every(Fe, t))
|
|
4197
4208
|
return t;
|
|
4198
4209
|
if (o.isIdentifier(t)) {
|
|
4199
|
-
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) =>
|
|
4210
|
+
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => _o(r, t)) : void 0;
|
|
4200
4211
|
if (s === void 0)
|
|
4201
4212
|
return;
|
|
4202
4213
|
const n = cs(s, e);
|
|
@@ -4204,7 +4215,7 @@ function Bo(e, t, i) {
|
|
|
4204
4215
|
return n;
|
|
4205
4216
|
}
|
|
4206
4217
|
}
|
|
4207
|
-
function
|
|
4218
|
+
function _o(e, t) {
|
|
4208
4219
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4209
4220
|
return;
|
|
4210
4221
|
const i = e.declarationList.declarations[0];
|
|
@@ -4212,13 +4223,13 @@ function Ko(e, t) {
|
|
|
4212
4223
|
}
|
|
4213
4224
|
function Fe(e) {
|
|
4214
4225
|
const t = this;
|
|
4215
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4226
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Uo, e);
|
|
4216
4227
|
}
|
|
4217
|
-
function
|
|
4228
|
+
function Uo(e) {
|
|
4218
4229
|
const t = this;
|
|
4219
4230
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4220
4231
|
}
|
|
4221
|
-
function
|
|
4232
|
+
function Wo(e, t) {
|
|
4222
4233
|
let i = !1;
|
|
4223
4234
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4224
4235
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
@@ -4227,13 +4238,13 @@ const ls = (e, t) => t.liftedKeys.has(e);
|
|
|
4227
4238
|
function H(e, t, i) {
|
|
4228
4239
|
if (fe(i))
|
|
4229
4240
|
return ds(e, i);
|
|
4230
|
-
const s = o.isCallExpression(i) ?
|
|
4241
|
+
const s = o.isCallExpression(i) ? Mo(e, i) : i, n = o.visitEachChild(
|
|
4231
4242
|
s,
|
|
4232
4243
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4233
4244
|
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4234
4245
|
e.transformationContext
|
|
4235
4246
|
);
|
|
4236
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || fr(i.right)) ?
|
|
4247
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || fr(i.right)) ? Ho(n) : n;
|
|
4237
4248
|
}
|
|
4238
4249
|
function ds(e, t) {
|
|
4239
4250
|
const i = ps(e, t);
|
|
@@ -4247,17 +4258,17 @@ function ps(e, t) {
|
|
|
4247
4258
|
if (o.isJsxNamespacedName(r))
|
|
4248
4259
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4249
4260
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== Ke) {
|
|
4250
|
-
const
|
|
4261
|
+
const C = o.isIdentifier(r) && r.text === Qs ? Te(i, e) : {
|
|
4251
4262
|
// No need to wrap the function call in a lit-html tag
|
|
4252
4263
|
litTag: void 0,
|
|
4253
|
-
parts: [
|
|
4264
|
+
parts: [qo(e, t, r, i)]
|
|
4254
4265
|
};
|
|
4255
4266
|
return {
|
|
4256
|
-
key:
|
|
4257
|
-
...
|
|
4267
|
+
key: zo(n, e),
|
|
4268
|
+
...C
|
|
4258
4269
|
};
|
|
4259
4270
|
}
|
|
4260
|
-
const
|
|
4271
|
+
const l = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ? X : er.has(l) ? yi : lt.has(l) ? se : ce, c = pt(l), p = c ? e.localComponents[l]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4261
4272
|
let f;
|
|
4262
4273
|
const g = [];
|
|
4263
4274
|
let h = !1;
|
|
@@ -4267,43 +4278,43 @@ function ps(e, t) {
|
|
|
4267
4278
|
`JSX spread attribute syntax is not supported. See alternatives: https://webgis.esri.com/references/lumina/jsx#spread-attributes
|
|
4268
4279
|
Found ${x.getText(e.sourceFile)}`
|
|
4269
4280
|
);
|
|
4270
|
-
const { name:
|
|
4271
|
-
if (o.isJsxNamespacedName(
|
|
4272
|
-
throw Error(`JSX namespaced attributes are not supported. Found ${
|
|
4273
|
-
const
|
|
4274
|
-
m?.delete(
|
|
4275
|
-
const N =
|
|
4281
|
+
const { name: C, initializer: L } = x;
|
|
4282
|
+
if (o.isJsxNamespacedName(C))
|
|
4283
|
+
throw Error(`JSX namespaced attributes are not supported. Found ${C.getText(e.sourceFile)}`);
|
|
4284
|
+
const A = C.text, M = xo(L), j = M?.propType ?? Ao(A, L, l);
|
|
4285
|
+
m?.delete(A);
|
|
4286
|
+
const N = $o[j](e, M?.initializer ?? L, A, l);
|
|
4276
4287
|
if (N.length === 0)
|
|
4277
4288
|
return [];
|
|
4278
|
-
const
|
|
4279
|
-
return j === "key" ? (f = typeof N[0] == "object" && !ls(
|
|
4280
|
-
...
|
|
4289
|
+
const K = e.compiler.shouldMinifyJsx ? [" "] : Ro(rs(C, e));
|
|
4290
|
+
return j === "key" ? (f = typeof N[0] == "object" && !ls(C, e) ? N[0] : void 0, K.some(jo) ? K : []) : j === "directives" || j === "ref" || A === "deferLoad" ? (h ||= j === "deferLoad", g.push(
|
|
4291
|
+
...K,
|
|
4281
4292
|
...N.flatMap(
|
|
4282
|
-
(R,
|
|
4293
|
+
(R, J) => typeof R == "string" || J === 0 || typeof N[J - 1] == "string" ? R : [" ", R]
|
|
4283
4294
|
)
|
|
4284
|
-
), []) : [...
|
|
4295
|
+
), []) : [...K, ...N];
|
|
4285
4296
|
});
|
|
4286
4297
|
if (m !== void 0 && m.size > 0 && e.compiler.logLintError(
|
|
4287
4298
|
"mustIncludeAllRequiredProperties",
|
|
4288
4299
|
e.sourceFile.fileName,
|
|
4289
|
-
`Missing required properties for <${
|
|
4290
|
-
), g.length > 0 && y.push(...g), typeof
|
|
4300
|
+
`Missing required properties for <${l}> }: ${Array.from(m).join(", ")}`
|
|
4301
|
+
), g.length > 0 && y.push(...g), typeof l == "string" && dt.has(l))
|
|
4291
4302
|
throw Error(
|
|
4292
|
-
`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 "${
|
|
4303
|
+
`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 "${l}" element`
|
|
4293
4304
|
);
|
|
4294
|
-
|
|
4295
|
-
const v = typeof
|
|
4305
|
+
c && (h ? e.customElementsToImportDeferred.add(l) : e.customElementsToImport.add(l));
|
|
4306
|
+
const v = typeof l == "string" && Zs.has(l), w = Te(i, e);
|
|
4296
4307
|
if (v && w.parts.length > 0)
|
|
4297
4308
|
throw Error(
|
|
4298
|
-
`Void HTML elements like <${
|
|
4309
|
+
`Void HTML elements like <${l}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
4299
4310
|
);
|
|
4300
|
-
const
|
|
4311
|
+
const S = (d === se || d === X) && w.parts.length === 0, T = [
|
|
4301
4312
|
"<",
|
|
4302
|
-
typeof
|
|
4313
|
+
typeof l == "string" ? l : r,
|
|
4303
4314
|
...y,
|
|
4304
|
-
|
|
4305
|
-
],
|
|
4306
|
-
...
|
|
4315
|
+
S ? `${y.length === 0 ? "" : " "}/>` : ">"
|
|
4316
|
+
], E = v || S ? T : [
|
|
4317
|
+
...T,
|
|
4307
4318
|
/**
|
|
4308
4319
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
4309
4320
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
@@ -4311,32 +4322,32 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4311
4322
|
*/
|
|
4312
4323
|
...w.litTag !== void 0 && w.litTag !== d ? [Oe({ key: void 0, ...w }, e)] : w.parts,
|
|
4313
4324
|
"</",
|
|
4314
|
-
typeof
|
|
4325
|
+
typeof l == "string" ? l : r,
|
|
4315
4326
|
">"
|
|
4316
4327
|
];
|
|
4317
|
-
return { key: f, parts:
|
|
4328
|
+
return { key: f, parts: E, litTag: d };
|
|
4318
4329
|
}
|
|
4319
|
-
function
|
|
4330
|
+
function zo(e, t) {
|
|
4320
4331
|
const i = e.attributes.properties[us(e)];
|
|
4321
4332
|
return i && o.isJsxAttribute(i) && !ls(i.name, t) ? yt(i.initializer, t.sourceFile) : void 0;
|
|
4322
4333
|
}
|
|
4323
4334
|
const us = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4324
|
-
function
|
|
4335
|
+
function qo(e, t, i, s) {
|
|
4325
4336
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4326
4337
|
if (o.isJsxSpreadAttribute(d))
|
|
4327
4338
|
return ns(rs(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4328
|
-
const { name:
|
|
4329
|
-
if (o.isJsxNamespacedName(
|
|
4330
|
-
throw Error(`JSX namespaced attributes are not supported. Found ${
|
|
4331
|
-
if (
|
|
4339
|
+
const { name: c, initializer: p } = d;
|
|
4340
|
+
if (o.isJsxNamespacedName(c))
|
|
4341
|
+
throw Error(`JSX namespaced attributes are not supported. Found ${c.getText(e.sourceFile)}`);
|
|
4342
|
+
if (c.text === "key")
|
|
4332
4343
|
return;
|
|
4333
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? ds(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = li(
|
|
4344
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? ds(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = li(c.text) ? o.factory.createStringLiteral(c.text) : c;
|
|
4334
4345
|
return o.factory.createPropertyAssignment(f, m);
|
|
4335
|
-
}), { parts: a, litTag:
|
|
4346
|
+
}), { parts: a, litTag: l } = Te(s, e);
|
|
4336
4347
|
return a.length > 0 && r.push(
|
|
4337
4348
|
o.factory.createPropertyAssignment(
|
|
4338
4349
|
o.factory.createIdentifier("children"),
|
|
4339
|
-
Oe({ key: void 0, parts: a, litTag:
|
|
4350
|
+
Oe({ key: void 0, parts: a, litTag: l }, e)
|
|
4340
4351
|
)
|
|
4341
4352
|
), o.factory.createCallExpression(i, void 0, [
|
|
4342
4353
|
o.factory.createObjectLiteralExpression(r.filter(F))
|
|
@@ -4365,7 +4376,7 @@ function Te(e, t) {
|
|
|
4365
4376
|
});
|
|
4366
4377
|
return { litTag: i, parts: s };
|
|
4367
4378
|
}
|
|
4368
|
-
function
|
|
4379
|
+
function Ho(e) {
|
|
4369
4380
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4370
4381
|
e,
|
|
4371
4382
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4421,21 +4432,21 @@ const ms = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), f
|
|
|
4421
4432
|
([e, t]) => t.map((i) => [i, e])
|
|
4422
4433
|
)
|
|
4423
4434
|
), gs = new Set(Object.keys(fs));
|
|
4424
|
-
function
|
|
4435
|
+
function Vo(e, t) {
|
|
4425
4436
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4426
4437
|
if (!o.isStringLiteral(n))
|
|
4427
4438
|
return t;
|
|
4428
|
-
const r =
|
|
4439
|
+
const r = Go(e.sourceFile.fileName, n.text, ""), a = i?.phaseModifier !== o.SyntaxKind.TypeKeyword;
|
|
4429
4440
|
if (a && e.existingImportedModules.add(r), hr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4430
4441
|
!n.text.includes("?")) {
|
|
4431
4442
|
if (s) {
|
|
4432
4443
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
4433
4444
|
return t;
|
|
4434
|
-
const
|
|
4445
|
+
const c = e.sourceFile.fileName, p = c.includes("/node_modules/") || c.includes("/dist/"), m = `import "${n.text}"`;
|
|
4435
4446
|
throw Error(
|
|
4436
|
-
p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${
|
|
4437
|
-
1. (suggested) Externalize ${
|
|
4438
|
-
2. Write a transform() plugin to drop the CSS import from ${
|
|
4447
|
+
p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${c} is not externalized, and it contains a side-effect CSS import \`${m}\`. How should such CSS import be handled? Options:
|
|
4448
|
+
1. (suggested) Externalize ${c}, which will make end-user's bundler treat this CSS import as global CSS.
|
|
4449
|
+
2. Write a transform() plugin to drop the CSS import from ${c}, and then manually import the CSS as needed inside your shadow root or your library's global CSS file.` : `${c}: Found a side-effect CSS import \`${m}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "${n.text}";\` instead and then add \`static override styles = styles;\` to your component. If this needs to be global CSS, @import it inside your global CSS file`
|
|
4439
4450
|
);
|
|
4440
4451
|
}
|
|
4441
4452
|
return o.factory.updateImportDeclaration(
|
|
@@ -4453,33 +4464,33 @@ function Ho(e, t) {
|
|
|
4453
4464
|
if (s)
|
|
4454
4465
|
return t;
|
|
4455
4466
|
if (i.name !== void 0) {
|
|
4456
|
-
const
|
|
4467
|
+
const c = i.name.text, p = i.name.text.startsWith(c[0].toUpperCase()), m = u.isAbsolute(r);
|
|
4457
4468
|
a && p && m && e.importedFunctionComponentsFromModules.add(r);
|
|
4458
4469
|
}
|
|
4459
|
-
const
|
|
4460
|
-
if (
|
|
4470
|
+
const l = i.namedBindings;
|
|
4471
|
+
if (l === void 0 || !o.isNamedImports(l))
|
|
4461
4472
|
return t;
|
|
4462
4473
|
const d = gs.has(n.text);
|
|
4463
|
-
if (
|
|
4464
|
-
const p = (
|
|
4474
|
+
if (l.elements.forEach((c) => {
|
|
4475
|
+
const p = (c.propertyName ?? c.name).text, m = re[p];
|
|
4465
4476
|
if (d) {
|
|
4466
4477
|
if (m?.some((h) => h === n.text)) {
|
|
4467
4478
|
const h = hs(p, r);
|
|
4468
|
-
e.existingLitImports.add(h), e.importRenames[h] =
|
|
4479
|
+
e.existingLitImports.add(h), e.importRenames[h] = c.name?.text ?? h;
|
|
4469
4480
|
}
|
|
4470
|
-
} else (
|
|
4481
|
+
} else (c.name.text === "h" || c.name.text === "createElement") && D().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
|
|
4471
4482
|
const f = p.startsWith(p[0].toUpperCase()), g = u.isAbsolute(r);
|
|
4472
|
-
a && !
|
|
4483
|
+
a && !c.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
|
|
4473
4484
|
}), n.text === "@arcgis/lumina") {
|
|
4474
|
-
let
|
|
4475
|
-
const p =
|
|
4485
|
+
let c = !1;
|
|
4486
|
+
const p = l.elements.filter((f) => {
|
|
4476
4487
|
const g = (f.propertyName ?? f.name).text;
|
|
4477
|
-
return gr.has(g) ? !1 : (
|
|
4488
|
+
return gr.has(g) ? !1 : (c ||= !f.isTypeOnly, !0);
|
|
4478
4489
|
});
|
|
4479
4490
|
if (p.length === 0)
|
|
4480
4491
|
return;
|
|
4481
|
-
if (p.length !==
|
|
4482
|
-
const f = i.phaseModifier === o.SyntaxKind.TypeKeyword || !
|
|
4492
|
+
if (p.length !== l.elements.length) {
|
|
4493
|
+
const f = i.phaseModifier === o.SyntaxKind.TypeKeyword || !c, g = c ? p : p.map(
|
|
4483
4494
|
(h) => o.factory.updateImportSpecifier(
|
|
4484
4495
|
h,
|
|
4485
4496
|
!1,
|
|
@@ -4494,7 +4505,7 @@ function Ho(e, t) {
|
|
|
4494
4505
|
i,
|
|
4495
4506
|
f ? o.SyntaxKind.TypeKeyword : void 0,
|
|
4496
4507
|
i.name,
|
|
4497
|
-
o.factory.updateNamedImports(
|
|
4508
|
+
o.factory.updateNamedImports(l, g)
|
|
4498
4509
|
),
|
|
4499
4510
|
t.moduleSpecifier,
|
|
4500
4511
|
t.attributes
|
|
@@ -4503,22 +4514,22 @@ function Ho(e, t) {
|
|
|
4503
4514
|
}
|
|
4504
4515
|
return t;
|
|
4505
4516
|
}
|
|
4506
|
-
const hs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? X : e,
|
|
4507
|
-
function
|
|
4508
|
-
return o.isImportDeclaration(e) ?
|
|
4517
|
+
const hs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? X : e, Go = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4518
|
+
function Xo(e) {
|
|
4519
|
+
return o.isImportDeclaration(e) ? Yo(this, e) : e;
|
|
4509
4520
|
}
|
|
4510
|
-
function
|
|
4521
|
+
function Yo(e, t) {
|
|
4511
4522
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4512
4523
|
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !gs.has(n.text))
|
|
4513
4524
|
return t;
|
|
4514
4525
|
const r = i.phaseModifier === o.SyntaxKind.TypeKeyword;
|
|
4515
4526
|
let a = !1;
|
|
4516
|
-
const
|
|
4517
|
-
const
|
|
4527
|
+
const l = s.elements.map((d) => {
|
|
4528
|
+
const c = (d.propertyName ?? d.name).text, p = hs(c, n.text);
|
|
4518
4529
|
return e.existingLitImports.delete(p), e.neededImports.has(p) ? (e.neededImports.delete(p), a = !0, o.factory.updateImportSpecifier(d, !1, d.propertyName, d.name)) : r ? o.factory.updateImportSpecifier(d, !0, d.propertyName, d.name) : d;
|
|
4519
4530
|
});
|
|
4520
4531
|
return fs[n.text]?.forEach((d) => {
|
|
4521
|
-
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0,
|
|
4532
|
+
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, l.push(ys(d, e)));
|
|
4522
4533
|
}), a ? o.factory.updateImportDeclaration(
|
|
4523
4534
|
t,
|
|
4524
4535
|
t.modifiers,
|
|
@@ -4526,13 +4537,13 @@ function Xo(e, t) {
|
|
|
4526
4537
|
i,
|
|
4527
4538
|
void 0,
|
|
4528
4539
|
i.name,
|
|
4529
|
-
o.factory.updateNamedImports(s,
|
|
4540
|
+
o.factory.updateNamedImports(s, l)
|
|
4530
4541
|
),
|
|
4531
4542
|
t.moduleSpecifier,
|
|
4532
4543
|
t.attributes
|
|
4533
4544
|
) : t;
|
|
4534
4545
|
}
|
|
4535
|
-
function
|
|
4546
|
+
function Qo(e) {
|
|
4536
4547
|
const t = ms(
|
|
4537
4548
|
Array.from(e.neededImports, (i) => [re[i][0], i])
|
|
4538
4549
|
);
|
|
@@ -4558,7 +4569,7 @@ function ys(e, t) {
|
|
|
4558
4569
|
o.factory.createIdentifier(s)
|
|
4559
4570
|
);
|
|
4560
4571
|
}
|
|
4561
|
-
function
|
|
4572
|
+
function Zo(e) {
|
|
4562
4573
|
const t = Or().map(({ packageName: i }) => i);
|
|
4563
4574
|
return e.existingImportedModules.forEach((i) => {
|
|
4564
4575
|
if (u.isAbsolute(i))
|
|
@@ -4572,7 +4583,7 @@ function Qo(e) {
|
|
|
4572
4583
|
}
|
|
4573
4584
|
}), [];
|
|
4574
4585
|
}
|
|
4575
|
-
function
|
|
4586
|
+
function ea(e) {
|
|
4576
4587
|
if (e.compiler.viteCommand === "serve")
|
|
4577
4588
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4578
4589
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4587,15 +4598,15 @@ function Zo(e) {
|
|
|
4587
4598
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4588
4599
|
}), [];
|
|
4589
4600
|
}
|
|
4590
|
-
const
|
|
4601
|
+
const ta = (e, t) => {
|
|
4591
4602
|
const i = e.pragmas;
|
|
4592
4603
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4593
4604
|
return e.statements;
|
|
4594
4605
|
let s = !1, n;
|
|
4595
4606
|
if (t.apiModule !== void 0) {
|
|
4596
4607
|
const d = t.apiModule.declarations;
|
|
4597
|
-
for (let
|
|
4598
|
-
const p = d[
|
|
4608
|
+
for (let c = 0; c < d.length; ++c) {
|
|
4609
|
+
const p = d[c];
|
|
4599
4610
|
if (p.customElement === !0) {
|
|
4600
4611
|
const m = p;
|
|
4601
4612
|
s = m.encapsulation !== void 0;
|
|
@@ -4611,7 +4622,7 @@ const ea = (e, t) => {
|
|
|
4611
4622
|
localComponents: is(t.compiler),
|
|
4612
4623
|
sourceFile: e,
|
|
4613
4624
|
transformationContext: t.transformation,
|
|
4614
|
-
importRenames:
|
|
4625
|
+
importRenames: ia(e),
|
|
4615
4626
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4616
4627
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4617
4628
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4625,41 +4636,41 @@ const ea = (e, t) => {
|
|
|
4625
4636
|
let a = [];
|
|
4626
4637
|
if (e.statements.every((d) => {
|
|
4627
4638
|
if (o.isImportDeclaration(d)) {
|
|
4628
|
-
const
|
|
4629
|
-
if (
|
|
4639
|
+
const c = Vo(r, d);
|
|
4640
|
+
if (c === void 0)
|
|
4630
4641
|
return !0;
|
|
4631
|
-
if (a.push(
|
|
4642
|
+
if (a.push(c), r.hasNonLuminaJsxImport)
|
|
4632
4643
|
return !1;
|
|
4633
4644
|
} else
|
|
4634
4645
|
a.push(H(r, void 0, d));
|
|
4635
4646
|
return !0;
|
|
4636
4647
|
}), r.hasNonLuminaJsxImport)
|
|
4637
4648
|
return e.statements;
|
|
4638
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4649
|
+
if (r.neededImports.size > 0 && (a = a.map(Xo, r), r.existingLitImports.size > 0))
|
|
4639
4650
|
throw new Error(
|
|
4640
4651
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4641
4652
|
);
|
|
4642
|
-
const
|
|
4653
|
+
const l = [Qo, Zo, ea].flatMap(
|
|
4643
4654
|
(d) => d(r)
|
|
4644
4655
|
);
|
|
4645
4656
|
if (r.neededImports.size > 0)
|
|
4646
4657
|
throw new Error(
|
|
4647
4658
|
`Expected context.neededLitImports to be empty by now. Found: ${Array.from(r.neededImports).join(", ")}`
|
|
4648
4659
|
);
|
|
4649
|
-
return [...
|
|
4660
|
+
return [...l, ...a];
|
|
4650
4661
|
};
|
|
4651
|
-
function
|
|
4652
|
-
return
|
|
4662
|
+
function ia(e) {
|
|
4663
|
+
return sa(e), Object.fromEntries(
|
|
4653
4664
|
mr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4654
4665
|
);
|
|
4655
4666
|
}
|
|
4656
|
-
function
|
|
4667
|
+
function sa(e) {
|
|
4657
4668
|
if (!("identifiers" in e))
|
|
4658
4669
|
throw new Error(
|
|
4659
4670
|
"Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
|
|
4660
4671
|
);
|
|
4661
4672
|
}
|
|
4662
|
-
const Zt = "customElement",
|
|
4673
|
+
const Zt = "customElement", ra = (e, t) => {
|
|
4663
4674
|
const i = [];
|
|
4664
4675
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4665
4676
|
const a = r;
|
|
@@ -4689,7 +4700,7 @@ const Zt = "customElement", sa = (e, t) => {
|
|
|
4689
4700
|
o.factory.createStringLiteral(s)
|
|
4690
4701
|
), ...e.statements, ...i];
|
|
4691
4702
|
};
|
|
4692
|
-
function
|
|
4703
|
+
function na(e, t, i) {
|
|
4693
4704
|
return t.size === 0 ? e : [
|
|
4694
4705
|
o.factory.createPropertyDeclaration(
|
|
4695
4706
|
[
|
|
@@ -4704,7 +4715,7 @@ function ra(e, t, i) {
|
|
|
4704
4715
|
t.entries(),
|
|
4705
4716
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4706
4717
|
li(s) ? o.factory.createStringLiteral(s) : s,
|
|
4707
|
-
|
|
4718
|
+
oa(n, i)
|
|
4708
4719
|
)
|
|
4709
4720
|
)
|
|
4710
4721
|
)
|
|
@@ -4712,7 +4723,7 @@ function ra(e, t, i) {
|
|
|
4712
4723
|
...e
|
|
4713
4724
|
];
|
|
4714
4725
|
}
|
|
4715
|
-
function
|
|
4726
|
+
function oa(e, t) {
|
|
4716
4727
|
let i = 0, s = !0;
|
|
4717
4728
|
const n = [], r = [];
|
|
4718
4729
|
for (const d of e.properties)
|
|
@@ -4720,32 +4731,32 @@ function na(e, t) {
|
|
|
4720
4731
|
function a(d) {
|
|
4721
4732
|
if (!o.isPropertyAssignment(d) || !o.isIdentifier(d.name))
|
|
4722
4733
|
return !0;
|
|
4723
|
-
const
|
|
4724
|
-
if (
|
|
4734
|
+
const c = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
|
|
4735
|
+
if (c === "attribute")
|
|
4725
4736
|
return s = !1, i |= m ? Tt : 0, !m && !f;
|
|
4726
|
-
if (
|
|
4737
|
+
if (c === "reflect")
|
|
4727
4738
|
return i |= m ? Ps : 0, !1;
|
|
4728
|
-
if (
|
|
4739
|
+
if (c === "type" && o.isIdentifier(p)) {
|
|
4729
4740
|
if (p.text === "Boolean")
|
|
4730
4741
|
return i |= ks, !1;
|
|
4731
4742
|
if (p.text === "Number")
|
|
4732
4743
|
return i |= Is, !1;
|
|
4733
4744
|
} else {
|
|
4734
|
-
if (
|
|
4745
|
+
if (c === "state")
|
|
4735
4746
|
return s = !1, i |= m ? xs : 0, !1;
|
|
4736
|
-
if (
|
|
4747
|
+
if (c === "readOnly")
|
|
4737
4748
|
return i |= m ? As : 0, !1;
|
|
4738
|
-
if (
|
|
4749
|
+
if (c === "noAccessor")
|
|
4739
4750
|
return i |= m ? Ls : 0, !1;
|
|
4740
|
-
if (
|
|
4751
|
+
if (c === "useDefault")
|
|
4741
4752
|
return i |= m ? Ns : 0, !1;
|
|
4742
4753
|
}
|
|
4743
4754
|
return !0;
|
|
4744
4755
|
}
|
|
4745
4756
|
s && (i |= Tt);
|
|
4746
|
-
const
|
|
4747
|
-
return n.length === 0 && (t || r.length === 0) ?
|
|
4748
|
-
|
|
4757
|
+
const l = o.factory.createNumericLiteral(i);
|
|
4758
|
+
return n.length === 0 && (t || r.length === 0) ? l : o.factory.createArrayLiteralExpression([
|
|
4759
|
+
l,
|
|
4749
4760
|
o.factory.createObjectLiteralExpression(n),
|
|
4750
4761
|
/**
|
|
4751
4762
|
* In dev mode, to improve readability for non-source-map developers,
|
|
@@ -4757,7 +4768,7 @@ function na(e, t) {
|
|
|
4757
4768
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4758
4769
|
]);
|
|
4759
4770
|
}
|
|
4760
|
-
function
|
|
4771
|
+
function aa(e, t, i) {
|
|
4761
4772
|
let s = -1, n = -1, r = -1;
|
|
4762
4773
|
e.options?.properties.forEach((p, m) => {
|
|
4763
4774
|
if (o.isSpreadAssignment(p))
|
|
@@ -4769,23 +4780,23 @@ function oa(e, t, i) {
|
|
|
4769
4780
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4770
4781
|
}
|
|
4771
4782
|
});
|
|
4772
|
-
const a = i.attribute === void 0 && n === -1,
|
|
4783
|
+
const a = i.attribute === void 0 && n === -1, l = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = ca(e, i, s), c = [
|
|
4773
4784
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4774
|
-
...
|
|
4785
|
+
...l ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4775
4786
|
...d !== void 0 ? [d] : []
|
|
4776
4787
|
];
|
|
4777
|
-
return
|
|
4788
|
+
return c.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(c, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...c]) : e.options;
|
|
4778
4789
|
}
|
|
4779
|
-
function
|
|
4790
|
+
function ca(e, t, i) {
|
|
4780
4791
|
if (t.attribute === void 0)
|
|
4781
4792
|
return;
|
|
4782
|
-
const s =
|
|
4793
|
+
const s = la(t.type.values);
|
|
4783
4794
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4784
4795
|
o.factory.createIdentifier("type"),
|
|
4785
4796
|
o.factory.createIdentifier(s)
|
|
4786
4797
|
);
|
|
4787
4798
|
}
|
|
4788
|
-
function
|
|
4799
|
+
function la(e) {
|
|
4789
4800
|
let t = !1, i = !1, s = !1;
|
|
4790
4801
|
if (e?.forEach((n) => {
|
|
4791
4802
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4797,50 +4808,50 @@ function ca(e) {
|
|
|
4797
4808
|
}
|
|
4798
4809
|
return "Other";
|
|
4799
4810
|
}
|
|
4800
|
-
function
|
|
4811
|
+
function da(e, t, i, s, n, r) {
|
|
4801
4812
|
if (i.modifiers === void 0)
|
|
4802
4813
|
return i;
|
|
4803
|
-
let a = -1,
|
|
4804
|
-
if (i.modifiers.forEach((d,
|
|
4814
|
+
let a = -1, l = -1;
|
|
4815
|
+
if (i.modifiers.forEach((d, c) => {
|
|
4805
4816
|
if (o.isDecorator(d) && o.isCallExpression(d.expression) && o.isIdentifier(d.expression.expression)) {
|
|
4806
4817
|
const p = d.expression.expression.text;
|
|
4807
|
-
p === "property" && (a =
|
|
4818
|
+
p === "property" && (a = c), p === "state" && (l = c);
|
|
4808
4819
|
}
|
|
4809
4820
|
}), a !== -1) {
|
|
4810
|
-
const d =
|
|
4811
|
-
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()),
|
|
4812
|
-
} else if (
|
|
4813
|
-
const d = ei(i,
|
|
4821
|
+
const d = pa(e, t, i, s, n), c = ei(i, a, n), p = aa(c, n, d);
|
|
4822
|
+
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), c.options = p, ti(i, a);
|
|
4823
|
+
} else if (l !== -1) {
|
|
4824
|
+
const d = ei(i, l, n), c = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([c]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, c]), m = di(i.name);
|
|
4814
4825
|
if (m === void 0)
|
|
4815
4826
|
throw new Error("Failed to statically determine the state property name");
|
|
4816
|
-
return r.set(m, p), ti(i,
|
|
4827
|
+
return r.set(m, p), ti(i, l);
|
|
4817
4828
|
} else
|
|
4818
4829
|
return i;
|
|
4819
4830
|
}
|
|
4820
|
-
function
|
|
4831
|
+
function pa(e, t, i, s, n) {
|
|
4821
4832
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4822
4833
|
members: []
|
|
4823
4834
|
} : void 0);
|
|
4824
4835
|
if (r === void 0)
|
|
4825
4836
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4826
4837
|
const a = di(i.name);
|
|
4827
|
-
let
|
|
4838
|
+
let l;
|
|
4828
4839
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4829
|
-
const
|
|
4830
|
-
|
|
4840
|
+
const c = r.members[d];
|
|
4841
|
+
c.name === a && c.kind === "field" && (l = c);
|
|
4831
4842
|
}
|
|
4832
|
-
if (
|
|
4843
|
+
if (l ??= e.compiler.isInTest ? { kind: "field", attribute: "", name: "", type: { text: "" } } : void 0, l === void 0)
|
|
4833
4844
|
throw Error(
|
|
4834
4845
|
`Failed to find API property for ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4835
4846
|
);
|
|
4836
|
-
if (
|
|
4847
|
+
if (l.name === "") {
|
|
4837
4848
|
if (a === void 0)
|
|
4838
4849
|
throw Error(
|
|
4839
4850
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4840
4851
|
);
|
|
4841
|
-
|
|
4852
|
+
l.name = a, l.attribute ??= ri(a);
|
|
4842
4853
|
}
|
|
4843
|
-
return
|
|
4854
|
+
return l;
|
|
4844
4855
|
}
|
|
4845
4856
|
function ei(e, t, i) {
|
|
4846
4857
|
const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
|
|
@@ -4877,13 +4888,13 @@ function ti(e, t) {
|
|
|
4877
4888
|
e.initializer
|
|
4878
4889
|
);
|
|
4879
4890
|
}
|
|
4880
|
-
function
|
|
4891
|
+
function ua(e, t, i, s) {
|
|
4881
4892
|
let n;
|
|
4882
4893
|
if (e.apiJsonEnabled)
|
|
4883
4894
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
4884
|
-
const
|
|
4885
|
-
if (
|
|
4886
|
-
n =
|
|
4895
|
+
const c = e.privateApiJson.modules[d];
|
|
4896
|
+
if (c.sourcePath === i.fileName.slice(e.dir.root.length)) {
|
|
4897
|
+
n = c;
|
|
4887
4898
|
break;
|
|
4888
4899
|
}
|
|
4889
4900
|
}
|
|
@@ -4892,17 +4903,17 @@ function pa(e, t, i, s) {
|
|
|
4892
4903
|
apiModule: n,
|
|
4893
4904
|
transformation: t
|
|
4894
4905
|
}, a = i.statements;
|
|
4895
|
-
let
|
|
4906
|
+
let l = a;
|
|
4896
4907
|
try {
|
|
4897
4908
|
s.forEach((d) => {
|
|
4898
4909
|
i.statements = d(i, r);
|
|
4899
4910
|
});
|
|
4900
4911
|
} finally {
|
|
4901
|
-
|
|
4912
|
+
l = i.statements, i.statements = a;
|
|
4902
4913
|
}
|
|
4903
|
-
return
|
|
4914
|
+
return ma(i, l);
|
|
4904
4915
|
}
|
|
4905
|
-
const
|
|
4916
|
+
const ma = (e, t) => o.factory.updateSourceFile(
|
|
4906
4917
|
e,
|
|
4907
4918
|
t,
|
|
4908
4919
|
/*
|
|
@@ -4917,16 +4928,16 @@ const ua = (e, t) => o.factory.updateSourceFile(
|
|
|
4917
4928
|
!1,
|
|
4918
4929
|
e.libReferenceDirectives
|
|
4919
4930
|
);
|
|
4920
|
-
function
|
|
4931
|
+
function fa(e, t) {
|
|
4921
4932
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4922
4933
|
}
|
|
4923
|
-
const
|
|
4934
|
+
const ga = (e, t) => {
|
|
4924
4935
|
let i;
|
|
4925
4936
|
if (t.apiModule !== void 0)
|
|
4926
4937
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
4927
|
-
const
|
|
4928
|
-
if (
|
|
4929
|
-
i =
|
|
4938
|
+
const c = t.apiModule.declarations[d];
|
|
4939
|
+
if (c.customElement === !0) {
|
|
4940
|
+
i = c;
|
|
4930
4941
|
break;
|
|
4931
4942
|
}
|
|
4932
4943
|
}
|
|
@@ -4936,10 +4947,10 @@ const fa = (e, t) => {
|
|
|
4936
4947
|
function n() {
|
|
4937
4948
|
s = /* @__PURE__ */ new Map();
|
|
4938
4949
|
}
|
|
4939
|
-
const r = (d) =>
|
|
4940
|
-
function a(d,
|
|
4941
|
-
const p =
|
|
4942
|
-
return
|
|
4950
|
+
const r = (d) => na(d, s, t.compiler.shouldMinify);
|
|
4951
|
+
function a(d, c) {
|
|
4952
|
+
const p = ya(t, i, d, c, e, s);
|
|
4953
|
+
return fa(p, t), p;
|
|
4943
4954
|
}
|
|
4944
4955
|
return e.statements.map(
|
|
4945
4956
|
(d) => vs(a, d, t, n, r)
|
|
@@ -4951,10 +4962,10 @@ function vs(e, t, i, s, n = pi) {
|
|
|
4951
4962
|
let r = !1;
|
|
4952
4963
|
const a = t.name?.text;
|
|
4953
4964
|
s?.();
|
|
4954
|
-
const
|
|
4955
|
-
t.members.map((
|
|
4956
|
-
const p = e(
|
|
4957
|
-
return r ||= p !==
|
|
4965
|
+
const l = n(
|
|
4966
|
+
t.members.map((c) => {
|
|
4967
|
+
const p = e(c, a);
|
|
4968
|
+
return r ||= p !== c, p;
|
|
4958
4969
|
})
|
|
4959
4970
|
);
|
|
4960
4971
|
return r ? o.factory.updateClassDeclaration(
|
|
@@ -4963,7 +4974,7 @@ function vs(e, t, i, s, n = pi) {
|
|
|
4963
4974
|
t.name,
|
|
4964
4975
|
t.typeParameters,
|
|
4965
4976
|
t.heritageClauses,
|
|
4966
|
-
|
|
4977
|
+
l
|
|
4967
4978
|
) : t;
|
|
4968
4979
|
} else
|
|
4969
4980
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
@@ -4972,11 +4983,11 @@ function vs(e, t, i, s, n = pi) {
|
|
|
4972
4983
|
i.transformation
|
|
4973
4984
|
) : t;
|
|
4974
4985
|
}
|
|
4975
|
-
const
|
|
4976
|
-
function
|
|
4986
|
+
const ha = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4987
|
+
function ya(e, t, i, s, n, r) {
|
|
4977
4988
|
if (o.isMethodDeclaration(i)) {
|
|
4978
4989
|
const a = i.modifiers?.filter(
|
|
4979
|
-
(
|
|
4990
|
+
(l) => !o.isDecorator(l) || !va(l)
|
|
4980
4991
|
);
|
|
4981
4992
|
if (a?.length !== i.modifiers?.length)
|
|
4982
4993
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4990,10 +5001,10 @@ function ha(e, t, i, s, n, r) {
|
|
|
4990
5001
|
i.type,
|
|
4991
5002
|
i.body
|
|
4992
5003
|
);
|
|
4993
|
-
if ("text" in i.name &&
|
|
4994
|
-
const
|
|
5004
|
+
if ("text" in i.name && ha.has(i.name.text) && i.body) {
|
|
5005
|
+
const l = i.name.text;
|
|
4995
5006
|
return i.body.statements.some(
|
|
4996
|
-
(
|
|
5007
|
+
(c) => o.isExpressionStatement(c) && o.isCallExpression(c.expression) && o.isPropertyAccessExpression(c.expression.expression) && c.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && c.expression.expression.name.text === l
|
|
4997
5008
|
) ? i : o.factory.updateMethodDeclaration(
|
|
4998
5009
|
i,
|
|
4999
5010
|
i.modifiers,
|
|
@@ -5006,7 +5017,7 @@ function ha(e, t, i, s, n, r) {
|
|
|
5006
5017
|
o.factory.updateBlock(i.body, [
|
|
5007
5018
|
o.factory.createExpressionStatement(
|
|
5008
5019
|
o.factory.createCallExpression(
|
|
5009
|
-
o.factory.createPropertyAccessExpression(o.factory.createSuper(),
|
|
5020
|
+
o.factory.createPropertyAccessExpression(o.factory.createSuper(), l),
|
|
5010
5021
|
void 0,
|
|
5011
5022
|
[]
|
|
5012
5023
|
)
|
|
@@ -5016,14 +5027,14 @@ function ha(e, t, i, s, n, r) {
|
|
|
5016
5027
|
);
|
|
5017
5028
|
}
|
|
5018
5029
|
}
|
|
5019
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5020
|
-
}
|
|
5021
|
-
const
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
],
|
|
5026
|
-
name:
|
|
5030
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? da(e, t, i, s, n, r) : i;
|
|
5031
|
+
}
|
|
5032
|
+
const va = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", ba = [
|
|
5033
|
+
ta,
|
|
5034
|
+
ra,
|
|
5035
|
+
ga
|
|
5036
|
+
], wa = "@arcgis/lumina:transformComponents", Sa = (e) => ({
|
|
5037
|
+
name: wa,
|
|
5027
5038
|
transform: {
|
|
5028
5039
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5029
5040
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5043,24 +5054,24 @@ const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5043
5054
|
e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
|
|
5044
5055
|
);
|
|
5045
5056
|
const n = e.getSourceFile(i, t), a = o.transform(n, [
|
|
5046
|
-
(f) => () =>
|
|
5057
|
+
(f) => () => ua(e, f, n, [
|
|
5047
5058
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5048
|
-
...
|
|
5059
|
+
...ba
|
|
5049
5060
|
])
|
|
5050
|
-
]).transformed[0],
|
|
5061
|
+
]).transformed[0], l = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : $t.createSourceMapGenerator(Ca, u.basename(i), "", u.dirname(i), {}), c = $t.createTextWriter(`
|
|
5051
5062
|
`);
|
|
5052
|
-
|
|
5053
|
-
const p =
|
|
5063
|
+
l.writeFile(a, c, d);
|
|
5064
|
+
const p = c.getText(), m = d?.toJSON();
|
|
5054
5065
|
return {
|
|
5055
5066
|
code: p,
|
|
5056
5067
|
map: m ?? null
|
|
5057
5068
|
};
|
|
5058
5069
|
}
|
|
5059
5070
|
}
|
|
5060
|
-
}),
|
|
5071
|
+
}), Ca = {
|
|
5061
5072
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5062
5073
|
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? pi : (e) => e.toLowerCase()
|
|
5063
|
-
},
|
|
5074
|
+
}, Ea = (e) => ({
|
|
5064
5075
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5065
5076
|
configureServer(t) {
|
|
5066
5077
|
e.server = t, ii(e).forEach(({ assets: i, transformers: s }) => te(e, i, s));
|
|
@@ -5079,73 +5090,73 @@ function ii(e) {
|
|
|
5079
5090
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5080
5091
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5081
5092
|
}
|
|
5082
|
-
const ot = "@arcgis/lumina:updatePackageJson",
|
|
5093
|
+
const ot = "@arcgis/lumina:updatePackageJson", Ta = (e) => ({
|
|
5083
5094
|
name: ot,
|
|
5084
5095
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5085
5096
|
configResolved() {
|
|
5086
|
-
|
|
5087
|
-
(t) =>
|
|
5097
|
+
$a(e).catch(
|
|
5098
|
+
(t) => $.error(ot, `Failed to update package's package.json:${String(t)}`)
|
|
5088
5099
|
);
|
|
5089
5100
|
}
|
|
5090
5101
|
});
|
|
5091
|
-
async function
|
|
5092
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await W(t, "utf-8")), s =
|
|
5102
|
+
async function $a(e) {
|
|
5103
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await W(t, "utf-8")), s = Pa(i, e);
|
|
5093
5104
|
s && ci(t, JSON.stringify(s, null, 2));
|
|
5094
5105
|
}
|
|
5095
|
-
function
|
|
5106
|
+
function Pa(e, t) {
|
|
5096
5107
|
const i = e?.devDependencies ?? {};
|
|
5097
|
-
Object.keys(e?.peerDependencies ?? {}).forEach((
|
|
5098
|
-
|
|
5108
|
+
Object.keys(e?.peerDependencies ?? {}).forEach((c) => {
|
|
5109
|
+
c in i || $.warn(
|
|
5099
5110
|
ot,
|
|
5100
|
-
`Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${
|
|
5111
|
+
`Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${c}" that is not a devDependency. Please edit your package.json`
|
|
5101
5112
|
);
|
|
5102
5113
|
});
|
|
5103
5114
|
let s = !1;
|
|
5104
|
-
const n = (
|
|
5115
|
+
const n = (c) => u.relative(t.dir.root, u.join(t.dir.dist, c)), r = t._documentationFileNames;
|
|
5105
5116
|
if (r.vsCodeCss !== void 0) {
|
|
5106
|
-
const
|
|
5107
|
-
|
|
5117
|
+
const c = e["css.customData"] ?? [], p = n(r.vsCodeCss);
|
|
5118
|
+
c.includes(p) || (e["css.customData"] = [...c, p], s = !0);
|
|
5108
5119
|
}
|
|
5109
5120
|
if (r.apiJson !== void 0) {
|
|
5110
|
-
const
|
|
5111
|
-
e.customElements !==
|
|
5121
|
+
const c = n(r.apiJson);
|
|
5122
|
+
e.customElements !== c && (e.customElements = c, s = !0);
|
|
5112
5123
|
}
|
|
5113
5124
|
if (r.vsCodeHtml !== void 0) {
|
|
5114
|
-
const
|
|
5115
|
-
|
|
5125
|
+
const c = e["html.customData"] ?? [], p = n(r.vsCodeHtml);
|
|
5126
|
+
c.includes(p) || (e["html.customData"] = [...c, p], s = !0);
|
|
5116
5127
|
}
|
|
5117
5128
|
if (r.webTypes !== void 0) {
|
|
5118
|
-
const
|
|
5119
|
-
e["web-types"] !==
|
|
5129
|
+
const c = n(r.webTypes);
|
|
5130
|
+
e["web-types"] !== c && (s = !0, e["web-types"] = c);
|
|
5120
5131
|
}
|
|
5121
|
-
const a = `./${Q}.css`,
|
|
5132
|
+
const a = `./${Q}.css`, l = t.options.build?.cdn?.namespace !== void 0, d = he(
|
|
5122
5133
|
t.dir.root,
|
|
5123
5134
|
u.join(t.dir.distCdn, a)
|
|
5124
5135
|
);
|
|
5125
|
-
if (!
|
|
5136
|
+
if (!l) {
|
|
5126
5137
|
e.exports?.[a] !== d && (e.exports ??= {}, e.exports[a] = d, s = !0);
|
|
5127
|
-
const
|
|
5138
|
+
const c = e.name.split("/").length > 1 ? e.name.split("/")[1] : e.name;
|
|
5128
5139
|
for (const p of Object.keys(e.exports))
|
|
5129
|
-
p.endsWith(`${
|
|
5140
|
+
p.endsWith(`${c}.css`) && e.exports[p] !== d && (e.exports[p] = d, s = !0);
|
|
5130
5141
|
}
|
|
5131
5142
|
if (s)
|
|
5132
5143
|
return e;
|
|
5133
5144
|
}
|
|
5134
|
-
const
|
|
5145
|
+
const ka = (e) => ({
|
|
5135
5146
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5136
5147
|
timestamp: e.apiJson.timestamp,
|
|
5137
5148
|
compiler: e.apiJson.compiler,
|
|
5138
|
-
components:
|
|
5149
|
+
components: Ia(e),
|
|
5139
5150
|
typeLibrary: {}
|
|
5140
5151
|
});
|
|
5141
|
-
function
|
|
5152
|
+
function Ia(e) {
|
|
5142
5153
|
const t = [];
|
|
5143
5154
|
for (const i of e.apiJson.modules)
|
|
5144
5155
|
for (const s of i.declarations)
|
|
5145
|
-
s.customElement === !0 && t.push(
|
|
5156
|
+
s.customElement === !0 && t.push(xa(s, i.sourcePath));
|
|
5146
5157
|
return t;
|
|
5147
5158
|
}
|
|
5148
|
-
function
|
|
5159
|
+
function xa(e, t) {
|
|
5149
5160
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5150
5161
|
return {
|
|
5151
5162
|
filePath: t,
|
|
@@ -5160,9 +5171,9 @@ function Ia(e, t) {
|
|
|
5160
5171
|
dependencies: [],
|
|
5161
5172
|
dependencyGraph: {},
|
|
5162
5173
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5163
|
-
props: e.members.map(
|
|
5164
|
-
methods: e.members.map(
|
|
5165
|
-
events: e.events?.map(
|
|
5174
|
+
props: e.members.map(Aa).filter(F),
|
|
5175
|
+
methods: e.members.map(La).filter(F),
|
|
5176
|
+
events: e.events?.map(Na) ?? [],
|
|
5166
5177
|
styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
|
|
5167
5178
|
name: s,
|
|
5168
5179
|
annotation: "prop",
|
|
@@ -5187,7 +5198,7 @@ function Ve(e, t = "") {
|
|
|
5187
5198
|
}
|
|
5188
5199
|
return t;
|
|
5189
5200
|
}
|
|
5190
|
-
function
|
|
5201
|
+
function Aa(e) {
|
|
5191
5202
|
if (e.kind !== "field")
|
|
5192
5203
|
return;
|
|
5193
5204
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], n = t.docsTags?.some((r) => r.name === "required") ?? !1;
|
|
@@ -5228,7 +5239,7 @@ const wt = (e) => Object.fromEntries(
|
|
|
5228
5239
|
]
|
|
5229
5240
|
) ?? []
|
|
5230
5241
|
);
|
|
5231
|
-
function
|
|
5242
|
+
function La(e) {
|
|
5232
5243
|
if (e.kind !== "method")
|
|
5233
5244
|
return;
|
|
5234
5245
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5259,7 +5270,7 @@ function Aa(e) {
|
|
|
5259
5270
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5260
5271
|
};
|
|
5261
5272
|
}
|
|
5262
|
-
function
|
|
5273
|
+
function Na(e) {
|
|
5263
5274
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5264
5275
|
return {
|
|
5265
5276
|
event: e.name,
|
|
@@ -5285,7 +5296,7 @@ const ye = {
|
|
|
5285
5296
|
methods: "Methods"
|
|
5286
5297
|
};
|
|
5287
5298
|
function bs(e) {
|
|
5288
|
-
const t =
|
|
5299
|
+
const t = ja(e.slots), i = Fa(e.events), s = Da(e.cssProperties), n = Ra(e.cssParts), r = Oa(e.members), a = e.description?.trim();
|
|
5289
5300
|
return [...a ? [`${a}
|
|
5290
5301
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5291
5302
|
|
|
@@ -5293,23 +5304,23 @@ function bs(e) {
|
|
|
5293
5304
|
}
|
|
5294
5305
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5295
5306
|
${t.join(`
|
|
5296
|
-
`)}`,
|
|
5307
|
+
`)}`, ja = (e) => ve(
|
|
5297
5308
|
ye.slots,
|
|
5298
5309
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5299
5310
|
(t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
|
|
5300
5311
|
)
|
|
5301
|
-
),
|
|
5312
|
+
), Fa = (e) => ve(
|
|
5302
5313
|
ye.events,
|
|
5303
5314
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5304
|
-
),
|
|
5315
|
+
), Da = (e = []) => ve(
|
|
5305
5316
|
ye.cssProperties,
|
|
5306
5317
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5307
5318
|
(t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5308
5319
|
)
|
|
5309
|
-
),
|
|
5320
|
+
), Ra = (e) => ve(
|
|
5310
5321
|
ye.cssParts,
|
|
5311
5322
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5312
|
-
),
|
|
5323
|
+
), Oa = (e) => ve(
|
|
5313
5324
|
ye.methods,
|
|
5314
5325
|
e.filter(Ds).filter((t) => t.deprecated === void 0).map(
|
|
5315
5326
|
(t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
|
|
@@ -5334,7 +5345,7 @@ ${t.join(`
|
|
|
5334
5345
|
description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
|
|
5335
5346
|
})) ?? []
|
|
5336
5347
|
);
|
|
5337
|
-
function
|
|
5348
|
+
function Ma(e) {
|
|
5338
5349
|
if (e.attributes === void 0)
|
|
5339
5350
|
return [];
|
|
5340
5351
|
const t = [];
|
|
@@ -5345,7 +5356,7 @@ function Oa(e) {
|
|
|
5345
5356
|
description: s.description || void 0,
|
|
5346
5357
|
default: s.default,
|
|
5347
5358
|
value: {
|
|
5348
|
-
type:
|
|
5359
|
+
type: Ja(
|
|
5349
5360
|
s.type.values?.map(
|
|
5350
5361
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5351
5362
|
)
|
|
@@ -5355,9 +5366,9 @@ function Oa(e) {
|
|
|
5355
5366
|
}
|
|
5356
5367
|
return t;
|
|
5357
5368
|
}
|
|
5358
|
-
const
|
|
5359
|
-
function
|
|
5360
|
-
const i =
|
|
5369
|
+
const Ja = (e) => e?.length === 1 ? e[0] : e;
|
|
5370
|
+
function Ba(e, t) {
|
|
5371
|
+
const i = Ka(e), s = ws(e), n = Ss(e), r = D();
|
|
5361
5372
|
return {
|
|
5362
5373
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5363
5374
|
name: r.name,
|
|
@@ -5375,11 +5386,11 @@ function Ja(e, t) {
|
|
|
5375
5386
|
}
|
|
5376
5387
|
};
|
|
5377
5388
|
}
|
|
5378
|
-
const
|
|
5389
|
+
const Ka = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5379
5390
|
name: t.tagName,
|
|
5380
5391
|
description: bs(t),
|
|
5381
5392
|
"doc-url": t.demos?.[0]?.url,
|
|
5382
|
-
attributes:
|
|
5393
|
+
attributes: Ma(t),
|
|
5383
5394
|
slots: t.slots?.map((i) => ({
|
|
5384
5395
|
name: i.name,
|
|
5385
5396
|
description: i.description
|
|
@@ -5387,10 +5398,10 @@ const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5387
5398
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5388
5399
|
events: si(t),
|
|
5389
5400
|
js: {
|
|
5390
|
-
properties:
|
|
5401
|
+
properties: _a(t),
|
|
5391
5402
|
events: si(t)
|
|
5392
5403
|
}
|
|
5393
|
-
})),
|
|
5404
|
+
})), _a = (e) => e.members.filter(Rs).filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5394
5405
|
name: t.name,
|
|
5395
5406
|
description: t.description,
|
|
5396
5407
|
type: t.type?.text
|
|
@@ -5398,84 +5409,84 @@ const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5398
5409
|
name: t.name,
|
|
5399
5410
|
type: t.type?.text,
|
|
5400
5411
|
description: t.description
|
|
5401
|
-
})) ?? [],
|
|
5412
|
+
})) ?? [], Ua = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5402
5413
|
name: t.tagName,
|
|
5403
5414
|
description: bs(t),
|
|
5404
|
-
attributes:
|
|
5415
|
+
attributes: Wa(t),
|
|
5405
5416
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5406
|
-
})),
|
|
5417
|
+
})), Wa = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5407
5418
|
name: t.name,
|
|
5408
5419
|
description: t.description || void 0,
|
|
5409
|
-
values:
|
|
5410
|
-
})) ?? [],
|
|
5420
|
+
values: za(t)
|
|
5421
|
+
})) ?? [], za = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], qa = (e) => ({
|
|
5411
5422
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5412
5423
|
version: 1.1,
|
|
5413
|
-
tags:
|
|
5414
|
-
}),
|
|
5424
|
+
tags: Ua(e)
|
|
5425
|
+
}), Ha = (e) => ({
|
|
5415
5426
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5416
5427
|
version: 1.1,
|
|
5417
5428
|
properties: ws(e),
|
|
5418
5429
|
pseudoElements: Ss(e)
|
|
5419
|
-
}),
|
|
5420
|
-
function
|
|
5430
|
+
}), Va = "@arcgis/lumina:generateDocs";
|
|
5431
|
+
function Ga(e) {
|
|
5421
5432
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5422
5433
|
{
|
|
5423
5434
|
type: "dynamic",
|
|
5424
|
-
source: () => JSON.stringify(
|
|
5435
|
+
source: () => JSON.stringify(ka(e), null, nt(e)),
|
|
5425
5436
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5426
5437
|
}
|
|
5427
5438
|
]), {
|
|
5428
|
-
name:
|
|
5439
|
+
name: Va,
|
|
5429
5440
|
async writeBundle() {
|
|
5430
5441
|
if (e.isInStorybook)
|
|
5431
5442
|
return;
|
|
5432
|
-
const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes),
|
|
5433
|
-
if (
|
|
5443
|
+
const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), l = [n, r, a].filter(F);
|
|
5444
|
+
if (l.length === 0)
|
|
5434
5445
|
return;
|
|
5435
|
-
await Ji(
|
|
5446
|
+
await Ji(l);
|
|
5436
5447
|
const d = [];
|
|
5437
5448
|
if (n !== void 0) {
|
|
5438
|
-
const
|
|
5439
|
-
d.push(z(n,
|
|
5449
|
+
const c = JSON.stringify(qa(e.apiJsonComponents), null, t);
|
|
5450
|
+
d.push(z(n, c));
|
|
5440
5451
|
}
|
|
5441
5452
|
if (r !== void 0) {
|
|
5442
|
-
const
|
|
5443
|
-
d.push(z(r,
|
|
5453
|
+
const c = JSON.stringify(Ha(e.apiJsonComponents), null, t);
|
|
5454
|
+
d.push(z(r, c));
|
|
5444
5455
|
}
|
|
5445
5456
|
if (a !== void 0) {
|
|
5446
|
-
const
|
|
5447
|
-
d.push(z(a, JSON.stringify(
|
|
5457
|
+
const c = Ba(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5458
|
+
d.push(z(a, JSON.stringify(c, null, t)));
|
|
5448
5459
|
}
|
|
5449
5460
|
await Promise.all(d);
|
|
5450
5461
|
}
|
|
5451
5462
|
};
|
|
5452
5463
|
}
|
|
5453
|
-
function
|
|
5454
|
-
const t = new
|
|
5464
|
+
function Ec(e = {}) {
|
|
5465
|
+
const t = new P(e), s = [
|
|
5455
5466
|
t._plugin,
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5467
|
+
Gn(t),
|
|
5468
|
+
to(t),
|
|
5469
|
+
no(t),
|
|
5470
|
+
Ta(t),
|
|
5460
5471
|
Jn(t),
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5472
|
+
Ga(t),
|
|
5473
|
+
Sa(t),
|
|
5474
|
+
wo(t),
|
|
5464
5475
|
yr(t),
|
|
5465
5476
|
Bn(t),
|
|
5466
|
-
|
|
5467
|
-
|
|
5468
|
-
|
|
5477
|
+
Ea(t),
|
|
5478
|
+
Co(t),
|
|
5479
|
+
po(t),
|
|
5469
5480
|
Ys(t),
|
|
5470
5481
|
hn(t),
|
|
5471
5482
|
Kn(t)
|
|
5472
5483
|
].filter(F);
|
|
5473
5484
|
return s.context = t, s;
|
|
5474
5485
|
}
|
|
5475
|
-
const
|
|
5486
|
+
const Tc = {
|
|
5476
5487
|
initializeComponentDependencies: ki,
|
|
5477
5488
|
updateLuminaTs: es,
|
|
5478
|
-
propertyToAttributeMappings:
|
|
5489
|
+
propertyToAttributeMappings: U,
|
|
5479
5490
|
nativeEvents: gi,
|
|
5480
5491
|
svgElements: lt,
|
|
5481
5492
|
mathMlElements: dt,
|
|
@@ -5484,7 +5495,7 @@ const Ec = {
|
|
|
5484
5495
|
htmlAlwaysAttributes: Qe
|
|
5485
5496
|
};
|
|
5486
5497
|
export {
|
|
5487
|
-
|
|
5498
|
+
Tc as exportsForCodemod,
|
|
5488
5499
|
Re as inferCdnUrl,
|
|
5489
|
-
|
|
5500
|
+
Ec as useLumina
|
|
5490
5501
|
};
|