@arcgis/lumina-compiler 5.2.0-next.60 → 5.2.0-next.62
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 +422 -405
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -2,29 +2,29 @@ import { externalizeDependencies as ls } from "@arcgis/node-toolkit/vite/externa
|
|
|
2
2
|
import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
|
|
3
3
|
import { f as b, l as $ } from "./logger-edpIalAo.js";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { camelToKebab as
|
|
5
|
+
import { camelToKebab as qt, getPreamble as cs, uncapitalize as ft, capitalize as ds } from "@arcgis/toolkit/string";
|
|
6
6
|
import { lazyMetaSubItemJoiner as ps, lazyMetaItemJoiner as Fe, lazyMetaGroupJoiner as ms, propertyFlagAttribute as gt, propertyFlagReflect as us, propertyFlagBoolean as fs, propertyFlagNumber as gs, propertyFlagState as hs, propertyFlagReadOnly as ys, propertyFlagNoAccessor as vs, propertyFlagUseDefault as bs } from "@arcgis/lumina/config";
|
|
7
|
-
import { path as u, toPosixPathSeparators as le, isPosix as
|
|
7
|
+
import { path as u, toPosixPathSeparators as le, isPosix as Vt, toSystemPathSeparators as ke, getCwd as Gt } from "@arcgis/node-toolkit/path";
|
|
8
8
|
import { isApiMethodAsync as ws, globalPackageIdentifier as Ss, isApiMethod as Es, isApiProperty as Cs } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
9
|
import { existsAsync as K } from "@arcgis/node-toolkit/file";
|
|
10
10
|
import { readFile as z, readdir as et, rm as Ts, mkdir as V, cp as $s, writeFile as _, copyFile as Ps } from "node:fs/promises";
|
|
11
|
-
import { retrievePackageJson as R, fetchPackageLocation as
|
|
11
|
+
import { retrievePackageJson as R, fetchPackageLocation as Xt, asyncRetrievePackageJson as Yt } from "@arcgis/node-toolkit/packageJson";
|
|
12
12
|
import { build as Is } from "esbuild";
|
|
13
13
|
import { glob as ks } from "tinyglobby";
|
|
14
14
|
import { renameComponentFolder as Ue } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
15
15
|
import { useApiExtractor as xs } from "@arcgis/api-extractor/vite/plugin";
|
|
16
16
|
import As from "mime-types";
|
|
17
17
|
import { forEachWithConcurrency as Ls } from "@arcgis/toolkit/promise";
|
|
18
|
-
import { writeFileSync as
|
|
18
|
+
import { writeFileSync as Qt } from "node:fs";
|
|
19
19
|
import { styleText as Ns } from "node:util";
|
|
20
20
|
import { unsafeGetUndocumentedPrinter as js, unsafeUndocumentedTs as ht } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
21
21
|
import { pathIsComponentEntrypoint as Se } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
22
22
|
import { loadApiExtractorConfig as Fs, mergeApiExtractorConfigs as yt } from "@arcgis/api-extractor/extractor/config";
|
|
23
23
|
import { loadTypeScriptConfig as Ds } from "@arcgis/api-extractor/vite/typeScript";
|
|
24
24
|
import { mappedFind as We } from "@arcgis/toolkit/array";
|
|
25
|
-
import { isPropertyEscapeNeeded as
|
|
26
|
-
import { getPackageNameFromExternalSpecifier as Os, getMemberName as
|
|
27
|
-
import { identity as
|
|
25
|
+
import { isPropertyEscapeNeeded as Zt, maybeEscapePropertyName as Rs } from "@arcgis/api-extractor/utils/partPrinter";
|
|
26
|
+
import { getPackageNameFromExternalSpecifier as Os, getMemberName as ei } from "@arcgis/api-extractor/utils/astHelpers";
|
|
27
|
+
import { identity as ti } from "@arcgis/toolkit/function";
|
|
28
28
|
function Ms(e) {
|
|
29
29
|
const t = e.options?.build?.dependencies ?? {}, i = ls({
|
|
30
30
|
bundleIn: t.bundleIn,
|
|
@@ -42,7 +42,7 @@ function Ms(e) {
|
|
|
42
42
|
e.isInStorybook && (i.resolveId = void 0);
|
|
43
43
|
}, i;
|
|
44
44
|
}
|
|
45
|
-
const Js = "Fragment", De = "DynamicHtmlTag", Re = "DynamicSvgTag", Ee = /* @__PURE__ */ Symbol("dynamic html tag name"), ze = /* @__PURE__ */ Symbol("dynamic svg tag name"),
|
|
45
|
+
const Js = "Fragment", De = "DynamicHtmlTag", Re = "DynamicSvgTag", Ee = /* @__PURE__ */ Symbol("dynamic html tag name"), ze = /* @__PURE__ */ Symbol("dynamic svg tag name"), ii = /* @__PURE__ */ new Set([
|
|
46
46
|
/**
|
|
47
47
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
48
48
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -74,7 +74,7 @@ const Js = "Fragment", De = "DynamicHtmlTag", Re = "DynamicSvgTag", Ee = /* @__P
|
|
|
74
74
|
"vocab",
|
|
75
75
|
// These don't exist as a property, only as an attribute
|
|
76
76
|
"exportParts"
|
|
77
|
-
]),
|
|
77
|
+
]), si = /* @__PURE__ */ new Set([
|
|
78
78
|
/*
|
|
79
79
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
80
80
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -913,9 +913,9 @@ const Js = "Fragment", De = "DynamicHtmlTag", Re = "DynamicSvgTag", Ee = /* @__P
|
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
|
-
|
|
917
|
-
Object.values(U.perElement).forEach(
|
|
918
|
-
function
|
|
916
|
+
ri(U.common);
|
|
917
|
+
Object.values(U.perElement).forEach(ri);
|
|
918
|
+
function ri(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),
|
|
921
921
|
e.stringifiedReflected
|
|
@@ -924,7 +924,7 @@ function ni(e) {
|
|
|
924
924
|
e.stringifiedNonReflected
|
|
925
925
|
));
|
|
926
926
|
}
|
|
927
|
-
const vt = /* @__PURE__ */ new Set(["itemScope"]),
|
|
927
|
+
const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set([
|
|
928
928
|
"abort",
|
|
929
929
|
"animationCancel",
|
|
930
930
|
"animationEnd",
|
|
@@ -1158,7 +1158,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1158
1158
|
"&": "&",
|
|
1159
1159
|
"<": "<",
|
|
1160
1160
|
">": ">"
|
|
1161
|
-
},
|
|
1161
|
+
}, oi = (e) => e.replace(Vs, (t) => Gs[t]), st = (e) => typeof e == "string" && e.includes("-") && !_s.has(e), Xs = ["keyed", "ref", "repeat", "live"], ie = "staticHtml", G = "staticSvg", se = "html", Z = "svg", ai = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), li = "css", ci = "mathml", di = [li, se, ci, ie, G, Z], Ys = new Set(di), Qs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], Zs = "nothing", er = [...Xs, ...di, ...Qs, Zs], tr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), ee = {
|
|
1162
1162
|
[se]: ["lit", "lit/html.js", "lit-html"],
|
|
1163
1163
|
/**
|
|
1164
1164
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1169,8 +1169,8 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1169
1169
|
[ie]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1170
1170
|
[Z]: ["lit", "lit-html", "lit/html.js"],
|
|
1171
1171
|
[G]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1172
|
-
[
|
|
1173
|
-
[
|
|
1172
|
+
[ci]: ["lit", "lit-html", "lit/html.js"],
|
|
1173
|
+
[li]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
1174
1174
|
safeClassMap: ["@arcgis/lumina"],
|
|
1175
1175
|
safeStyleMap: ["@arcgis/lumina"],
|
|
1176
1176
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -1230,12 +1230,12 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1230
1230
|
if (l && (a = a.slice(0, -qe.length)), !c && !d && !l)
|
|
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(
|
|
1233
|
+
return typeof f != "string" || !f.startsWith(pi) || !f.endsWith(nr) ? ($.warn(
|
|
1234
1234
|
ne,
|
|
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) : l ? (e._globalCssString =
|
|
1238
|
+
), m) : l ? (e._globalCssString = mi(f), { code: "", map: { mappings: "" } }) : {
|
|
1239
1239
|
...g,
|
|
1240
1240
|
code: cr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1241
1241
|
/**
|
|
@@ -1247,7 +1247,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
}),
|
|
1250
|
+
}), pi = 'export default "', nr = '"', or = `import { css } from '${ee.css[0]}';
|
|
1251
1251
|
export const styles = css\``, ar = "`;\nexport default styles;", lr = `
|
|
1252
1252
|
|
|
1253
1253
|
if(import.meta.hot) {
|
|
@@ -1259,9 +1259,9 @@ if(import.meta.hot) {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1261
1261
|
});
|
|
1262
|
-
}`,
|
|
1262
|
+
}`, mi = (e) => e.slice(pi.length - 1);
|
|
1263
1263
|
function cr(e, t, i, s) {
|
|
1264
|
-
const n =
|
|
1264
|
+
const n = mi(e), r = JSON.parse(n), a = Ws(r), c = s ? `@layer{${i ? "" : `
|
|
1265
1265
|
`}${a}${i ? "" : `
|
|
1266
1266
|
`}}` : a;
|
|
1267
1267
|
return `${or}${c}${ar}${t ? lr : ""}`;
|
|
@@ -1284,21 +1284,21 @@ function fr(e) {
|
|
|
1284
1284
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
1285
1285
|
`import globalStyles from "${i}${X}";`,
|
|
1286
1286
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1287
|
-
|
|
1287
|
+
fi("", e)
|
|
1288
1288
|
].join(`
|
|
1289
1289
|
`) : `import "${i}${qe}";`;
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1291
|
+
const ui = "hydrated";
|
|
1292
1292
|
function gr(e) {
|
|
1293
1293
|
e._globalHydratedCssString = [
|
|
1294
1294
|
":not([",
|
|
1295
|
-
e.options.css?.hydratedAttribute ??
|
|
1295
|
+
e.options.css?.hydratedAttribute ?? ui,
|
|
1296
1296
|
"]):is(",
|
|
1297
1297
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
1298
1298
|
"){visibility:hidden}"
|
|
1299
1299
|
].join("");
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function fi(e, t) {
|
|
1302
1302
|
return [
|
|
1303
1303
|
"const globalCss = new CSSStyleSheet;",
|
|
1304
1304
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
|
|
@@ -1339,15 +1339,15 @@ const vr = (e, t, i) => [
|
|
|
1339
1339
|
"]"
|
|
1340
1340
|
].join("");
|
|
1341
1341
|
function br(e) {
|
|
1342
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } =
|
|
1342
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = gi(e), r = t.map((g) => g.join(ps)).join(Fe), a = i.join(Fe), c = s.join(Fe), d = [r, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
|
|
1343
1343
|
return `${p.length > 0 || n ? `"${p.join(ms)}"` : ""}${n ? ",1" : ""}`;
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function gi(e) {
|
|
1346
1346
|
const t = [], i = [], s = [];
|
|
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 c = typeof a.attribute == "string", d = c && a.attribute !==
|
|
1350
|
+
const c = typeof a.attribute == "string", d = c && a.attribute !== qt(a.name);
|
|
1351
1351
|
t.push(
|
|
1352
1352
|
c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
|
|
1353
1353
|
);
|
|
@@ -1364,10 +1364,10 @@ if(import.meta.hot) {
|
|
|
1364
1364
|
${e.map((t) => ` "/${t}",`).join(`
|
|
1365
1365
|
`)}
|
|
1366
1366
|
], handleHmrUpdate);
|
|
1367
|
-
}`, Er = "@arcgis/lumina-compiler",
|
|
1367
|
+
}`, Er = "@arcgis/lumina-compiler", hi = {
|
|
1368
1368
|
name: Er
|
|
1369
1369
|
};
|
|
1370
|
-
async function
|
|
1370
|
+
async function yi(e, t) {
|
|
1371
1371
|
return te ??= Tr(e, t), await te;
|
|
1372
1372
|
}
|
|
1373
1373
|
function Cr() {
|
|
@@ -1380,7 +1380,7 @@ function Cr() {
|
|
|
1380
1380
|
);
|
|
1381
1381
|
return Te;
|
|
1382
1382
|
}
|
|
1383
|
-
function
|
|
1383
|
+
function vi() {
|
|
1384
1384
|
if (Ve === void 0)
|
|
1385
1385
|
throw Error(
|
|
1386
1386
|
b(
|
|
@@ -1392,7 +1392,7 @@ function bi() {
|
|
|
1392
1392
|
}
|
|
1393
1393
|
async function Tr(e, t) {
|
|
1394
1394
|
const i = R(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1395
|
-
[...Object.keys(s), ...Object.keys(n)].filter((l) => !$r.has(l)).flatMap(async (l) => await
|
|
1395
|
+
[...Object.keys(s), ...Object.keys(n)].filter((l) => !$r.has(l)).flatMap(async (l) => await bi(l, e))
|
|
1396
1396
|
)).filter(j);
|
|
1397
1397
|
Te ??= a, Ve = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1398
1398
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -1437,8 +1437,8 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1437
1437
|
"vscode-languageserver-types"
|
|
1438
1438
|
]);
|
|
1439
1439
|
let Te, Ve, te;
|
|
1440
|
-
async function
|
|
1441
|
-
const i = await
|
|
1440
|
+
async function bi(e, t) {
|
|
1441
|
+
const i = await Xt(e, t), s = await Yt(i), n = "exports" in s, r = Rr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
1442
1442
|
if (a ? await K(c) : !1) {
|
|
1443
1443
|
const g = await z(c, "utf8"), h = Pr(g, "bootstrapLazy("), v = g.indexOf(", options", h), y = g.slice(h, v), S = y.startsWith('JSON.parse("') ? y.slice(12, -2).replaceAll('\\"', '"') : y;
|
|
1444
1444
|
try {
|
|
@@ -1451,7 +1451,7 @@ Error: ${String(E)}`);
|
|
|
1451
1451
|
}
|
|
1452
1452
|
const l = bt(s.customElements);
|
|
1453
1453
|
if (l != null) {
|
|
1454
|
-
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), v = Ir(h), y =
|
|
1454
|
+
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), v = Ir(h), y = wi(h, {
|
|
1455
1455
|
packageName: e,
|
|
1456
1456
|
getImportPath: r
|
|
1457
1457
|
});
|
|
@@ -1479,7 +1479,7 @@ function Pr(e, t) {
|
|
|
1479
1479
|
const i = e.indexOf(t);
|
|
1480
1480
|
return i === -1 ? -1 : i + t.length;
|
|
1481
1481
|
}
|
|
1482
|
-
function
|
|
1482
|
+
function wi(e, t, i = !1) {
|
|
1483
1483
|
const s = /* @__PURE__ */ Object.create(null);
|
|
1484
1484
|
if (e.modules === void 0)
|
|
1485
1485
|
return s;
|
|
@@ -1519,7 +1519,7 @@ function Si(e, t, i = !1) {
|
|
|
1519
1519
|
const Ir = (e) => (
|
|
1520
1520
|
// Since 5.0
|
|
1521
1521
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1522
|
-
e.compiler?.name ===
|
|
1522
|
+
e.compiler?.name === hi.name
|
|
1523
1523
|
), kr = (e, t) => Object.fromEntries(
|
|
1524
1524
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1525
1525
|
(i) => [
|
|
@@ -1559,7 +1559,7 @@ const Ir = (e) => (
|
|
|
1559
1559
|
];
|
|
1560
1560
|
})
|
|
1561
1561
|
), Rr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Or = (e) => e.startsWith("/") ? e : `/${e}`, rt = (e, t) => `${e}@fs${Or(t)}`;
|
|
1562
|
-
function
|
|
1562
|
+
function Si(e) {
|
|
1563
1563
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1564
1564
|
return i === "latest" ? "esnext" : i;
|
|
1565
1565
|
}
|
|
@@ -1568,9 +1568,9 @@ Oe.name === "@arcgis/lumina";
|
|
|
1568
1568
|
async function Mr(e, t, i) {
|
|
1569
1569
|
if (!xe)
|
|
1570
1570
|
return [];
|
|
1571
|
-
const s = await
|
|
1571
|
+
const s = await Xt(Ge);
|
|
1572
1572
|
if (t === "cdn") {
|
|
1573
|
-
const n = await
|
|
1573
|
+
const n = await Yt(s), r = Ae({ name: "", version: n.version }, i);
|
|
1574
1574
|
return [
|
|
1575
1575
|
// Use the ESM CDN
|
|
1576
1576
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -1586,28 +1586,45 @@ async function Mr(e, t, i) {
|
|
|
1586
1586
|
})
|
|
1587
1587
|
},
|
|
1588
1588
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1589
|
-
|
|
1589
|
+
Ei(r)
|
|
1590
1590
|
];
|
|
1591
1591
|
} else
|
|
1592
|
-
return
|
|
1592
|
+
return Jr(e, s);
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1594
|
+
function Jr(e, t) {
|
|
1595
|
+
const i = rt(e, `${t}/assets/`);
|
|
1596
|
+
return [
|
|
1597
|
+
Ei(i),
|
|
1598
|
+
{
|
|
1599
|
+
/**
|
|
1600
|
+
* This import is injected dynamically, so external consumers must tell Vite to optimize it. Within the monorepo,
|
|
1601
|
+
* configureVite excludes this exact import to keep the app and this assignment on the same core config instance.
|
|
1602
|
+
*/
|
|
1603
|
+
optimizableImports: ["@arcgis/core/config.js"],
|
|
1604
|
+
javascriptCode: [
|
|
1605
|
+
'import esriConfig from "@arcgis/core/config.js";',
|
|
1606
|
+
`esriConfig.assetsPath = ${JSON.stringify(i)};`
|
|
1607
|
+
]
|
|
1608
|
+
}
|
|
1609
|
+
];
|
|
1610
|
+
}
|
|
1611
|
+
const Ei = (e) => ({
|
|
1595
1612
|
// Not using join() because it would turn https:// into https:/
|
|
1596
1613
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
1597
1614
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1598
1615
|
id: "arcgisCoreStylesheet"
|
|
1599
1616
|
}), nt = "customElement.js";
|
|
1600
|
-
function
|
|
1617
|
+
function Br(e, t) {
|
|
1601
1618
|
if (!t.startsWith(e))
|
|
1602
1619
|
return t;
|
|
1603
1620
|
const s = t.split(u.sep);
|
|
1604
|
-
return s.at(
|
|
1621
|
+
return s.at(Kr) !== s.at(_r) ? t : u.join(s.slice(0, -1).join(u.sep), nt);
|
|
1605
1622
|
}
|
|
1606
|
-
const
|
|
1623
|
+
const Kr = -1, _r = -2, Ur = /["']\.\.?\/[^'"]+/gu, Wr = (e, t, i, s) => e.replaceAll(Ur, (n) => {
|
|
1607
1624
|
const r = n.slice(1);
|
|
1608
1625
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1609
1626
|
return n;
|
|
1610
|
-
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
1627
|
+
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Br(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + Ue(c.slice(t.dir.dist.length), t.apiExtractor) : c;
|
|
1611
1628
|
if (i === s && a === d)
|
|
1612
1629
|
return n;
|
|
1613
1630
|
const l = ue(i, d), p = n.endsWith("/") ? `${l}/` : l;
|
|
@@ -1616,7 +1633,7 @@ const Br = -1, Kr = -2, _r = /["']\.\.?\/[^'"]+/gu, Ur = (e, t, i, s) => e.repla
|
|
|
1616
1633
|
const i = u.relative(e, t);
|
|
1617
1634
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
1618
1635
|
};
|
|
1619
|
-
async function
|
|
1636
|
+
async function zr(e, t, i) {
|
|
1620
1637
|
const s = u.resolve(e.dir.root, t);
|
|
1621
1638
|
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Ts(s, { recursive: !0, force: !0 }), await V(s, { recursive: !0 }), await $s(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1622
1639
|
const n = [
|
|
@@ -1673,7 +1690,7 @@ const Ci = /* @__PURE__ */ new Set([
|
|
|
1673
1690
|
"extras",
|
|
1674
1691
|
"support"
|
|
1675
1692
|
]), D = "@arcgis/lumina:buildCdn", re = "cdn", Ti = "index", Y = "main";
|
|
1676
|
-
function
|
|
1693
|
+
function Hr(e) {
|
|
1677
1694
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1678
1695
|
if (a) {
|
|
1679
1696
|
if (i.toLowerCase() !== i)
|
|
@@ -1706,7 +1723,7 @@ function zr(e) {
|
|
|
1706
1723
|
);
|
|
1707
1724
|
return;
|
|
1708
1725
|
}
|
|
1709
|
-
const d = xe && R().name !== "@arcgis/embeddable-components", l = 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
|
|
1726
|
+
const d = xe && R().name !== "@arcgis/embeddable-components", l = 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 qr(
|
|
1710
1727
|
e,
|
|
1711
1728
|
c,
|
|
1712
1729
|
s,
|
|
@@ -1714,7 +1731,7 @@ function zr(e) {
|
|
|
1714
1731
|
n,
|
|
1715
1732
|
d
|
|
1716
1733
|
);
|
|
1717
|
-
await
|
|
1734
|
+
await Vr(
|
|
1718
1735
|
m,
|
|
1719
1736
|
e,
|
|
1720
1737
|
a ? `${c}.esm` : c,
|
|
@@ -1722,11 +1739,11 @@ function zr(e) {
|
|
|
1722
1739
|
d
|
|
1723
1740
|
);
|
|
1724
1741
|
const f = Date.now();
|
|
1725
|
-
$.info(D, `CDN was built in ${f - l}ms`), r && await
|
|
1742
|
+
$.info(D, `CDN was built in ${f - l}ms`), r && await zr(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
1726
1743
|
}
|
|
1727
1744
|
};
|
|
1728
1745
|
}
|
|
1729
|
-
async function
|
|
1746
|
+
async function qr(e, t, i, s, n, r) {
|
|
1730
1747
|
const a = e.environment;
|
|
1731
1748
|
if (i.minify && r)
|
|
1732
1749
|
throw Error(
|
|
@@ -1749,7 +1766,7 @@ async function Hr(e, t, i, s, n, r) {
|
|
|
1749
1766
|
* The script's file name will be stripped inside defineCustomElements.
|
|
1750
1767
|
**/
|
|
1751
1768
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1752
|
-
${
|
|
1769
|
+
${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
1753
1770
|
return await Is({
|
|
1754
1771
|
bundle: !0,
|
|
1755
1772
|
minify: r ? !0 : a === "production",
|
|
@@ -1775,7 +1792,7 @@ ${gi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1775
1792
|
chunkNames: "[hash]",
|
|
1776
1793
|
resolveExtensions: [".js", ".json"],
|
|
1777
1794
|
banner: { js: e.banner },
|
|
1778
|
-
target:
|
|
1795
|
+
target: Si(e),
|
|
1779
1796
|
...i,
|
|
1780
1797
|
write: !1,
|
|
1781
1798
|
plugins: [
|
|
@@ -1834,8 +1851,8 @@ ${gi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1834
1851
|
}
|
|
1835
1852
|
});
|
|
1836
1853
|
}
|
|
1837
|
-
const
|
|
1838
|
-
async function
|
|
1854
|
+
const wt = "stdin.js";
|
|
1855
|
+
async function Vr(e, t, i, s, n) {
|
|
1839
1856
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
1840
1857
|
let c;
|
|
1841
1858
|
n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -1847,15 +1864,15 @@ async function qr(e, t, i, s, n) {
|
|
|
1847
1864
|
isAsync: void 0,
|
|
1848
1865
|
oldSingleExportName: void 0
|
|
1849
1866
|
}, f = le(p.path.slice(r.length));
|
|
1850
|
-
if (f ===
|
|
1867
|
+
if (f === wt) {
|
|
1851
1868
|
if (n) {
|
|
1852
|
-
const h = p.text.match(
|
|
1869
|
+
const h = p.text.match(Gr)?.[0];
|
|
1853
1870
|
if (h === void 0)
|
|
1854
1871
|
throw Error(
|
|
1855
|
-
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${
|
|
1872
|
+
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${wt} contents:
|
|
1856
1873
|
${p.text}`
|
|
1857
1874
|
);
|
|
1858
|
-
m.code = `${m.code.trimEnd()}${
|
|
1875
|
+
m.code = `${m.code.trimEnd()}${Xr(h, s)}`, m.isAsync = !1;
|
|
1859
1876
|
}
|
|
1860
1877
|
return [a, m];
|
|
1861
1878
|
}
|
|
@@ -1885,8 +1902,8 @@ ${p.text}`
|
|
|
1885
1902
|
}
|
|
1886
1903
|
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await _(r + p, m)));
|
|
1887
1904
|
}
|
|
1888
|
-
const
|
|
1889
|
-
function
|
|
1905
|
+
const Gr = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
1906
|
+
function Xr(e, t) {
|
|
1890
1907
|
let i = [
|
|
1891
1908
|
"window.$arcgis",
|
|
1892
1909
|
"||",
|
|
@@ -1929,13 +1946,13 @@ function Gr(e, t) {
|
|
|
1929
1946
|
}
|
|
1930
1947
|
function $i(e, t) {
|
|
1931
1948
|
if (e.isProcessing) {
|
|
1932
|
-
e.isAsync = !0,
|
|
1949
|
+
e.isAsync = !0, St(e);
|
|
1933
1950
|
return;
|
|
1934
1951
|
}
|
|
1935
1952
|
e.isProcessing = !0;
|
|
1936
1953
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
1937
1954
|
let c = 0;
|
|
1938
|
-
const d = e.code.matchAll(
|
|
1955
|
+
const d = e.code.matchAll(Yr);
|
|
1939
1956
|
for (const w of d) {
|
|
1940
1957
|
const [O, L, W, N, A] = w, B = A.startsWith($e);
|
|
1941
1958
|
if (c !== 0 && c !== w.index) {
|
|
@@ -1974,10 +1991,10 @@ ${F.code}`
|
|
|
1974
1991
|
e.isProcessing = !1;
|
|
1975
1992
|
const l = e.isAsync === !0;
|
|
1976
1993
|
if (e.isAsync = l || a.length > 0, !e.isAsync) {
|
|
1977
|
-
e.code =
|
|
1994
|
+
e.code = Et(e.code, t);
|
|
1978
1995
|
return;
|
|
1979
1996
|
}
|
|
1980
|
-
const p =
|
|
1997
|
+
const p = en(r);
|
|
1981
1998
|
let m = e.code.slice(0, c);
|
|
1982
1999
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
1983
2000
|
const [O, L, W, N] = a[w];
|
|
@@ -1988,15 +2005,15 @@ ${F.code}`
|
|
|
1988
2005
|
}
|
|
1989
2006
|
m = m.slice(0, O) + B + m.slice(O + A);
|
|
1990
2007
|
}
|
|
1991
|
-
const [f, g] =
|
|
2008
|
+
const [f, g] = St(e), h = i.findLastIndex((w) => w.length > 0), v = i.slice(0, h + 1).join(","), y = i.length === 0 ? "_" : `([${v}])`, S = `${Pi}${y}=>{`, E = s.join(","), C = `${g}},${E})`;
|
|
1992
2009
|
let T = e.code.slice(c, f);
|
|
1993
|
-
T = `${n.join("")}${T}`, T =
|
|
2010
|
+
T = `${n.join("")}${T}`, T = Et(T, t);
|
|
1994
2011
|
const x = `${m}${S}${T}${C}`;
|
|
1995
2012
|
e.code = x;
|
|
1996
2013
|
}
|
|
1997
2014
|
const Pi = "export default $arcgis.t(";
|
|
1998
|
-
function
|
|
1999
|
-
const t =
|
|
2015
|
+
function St(e) {
|
|
2016
|
+
const t = Qr.exec(e.code), i = t?.index ?? e.code.length;
|
|
2000
2017
|
let s = "";
|
|
2001
2018
|
if (t !== null) {
|
|
2002
2019
|
const n = t[1].split(",");
|
|
@@ -2012,7 +2029,7 @@ function Et(e) {
|
|
|
2012
2029
|
}
|
|
2013
2030
|
return [i, s];
|
|
2014
2031
|
}
|
|
2015
|
-
const
|
|
2032
|
+
const Yr = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Qr = /export\{([^}]+)\};\n$/u, $e = "@arcgis/core/";
|
|
2016
2033
|
function Ii(e, t) {
|
|
2017
2034
|
if (!e.startsWith("./"))
|
|
2018
2035
|
return;
|
|
@@ -2023,8 +2040,8 @@ function Ii(e, t) {
|
|
|
2023
2040
|
throw Error(b(D, `Failed to infer whether the ${e} module has top-level await`));
|
|
2024
2041
|
return s;
|
|
2025
2042
|
}
|
|
2026
|
-
function
|
|
2027
|
-
return e.replaceAll(
|
|
2043
|
+
function Et(e, t) {
|
|
2044
|
+
return e.replaceAll(Zr, (i, s) => {
|
|
2028
2045
|
if (s.startsWith($e))
|
|
2029
2046
|
return `$arcgis.t(m=>m[0],"${ki(s.slice($e.length))}")`;
|
|
2030
2047
|
if (s.startsWith("./")) {
|
|
@@ -2035,28 +2052,28 @@ function Ct(e, t) {
|
|
|
2035
2052
|
return i;
|
|
2036
2053
|
});
|
|
2037
2054
|
}
|
|
2038
|
-
const
|
|
2039
|
-
function
|
|
2055
|
+
const Zr = /(?<![.\w\d])import\("([^"]+)"\)/gu, ki = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2056
|
+
function en(e) {
|
|
2040
2057
|
const t = [Xe];
|
|
2041
2058
|
return () => {
|
|
2042
2059
|
for (; ; ) {
|
|
2043
|
-
const i =
|
|
2044
|
-
if (
|
|
2060
|
+
const i = rn(t);
|
|
2061
|
+
if (nn(t), !e.has(i))
|
|
2045
2062
|
return e.add(i), i;
|
|
2046
2063
|
}
|
|
2047
2064
|
};
|
|
2048
2065
|
}
|
|
2049
|
-
const Xe = 0, ot = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", xi = `${ot}0123456789`,
|
|
2050
|
-
function
|
|
2066
|
+
const Xe = 0, ot = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", xi = `${ot}0123456789`, tn = ot.length, sn = xi.length;
|
|
2067
|
+
function rn(e) {
|
|
2051
2068
|
let t = ot[e[0]];
|
|
2052
2069
|
for (let i = 1; i < e.length; ++i)
|
|
2053
2070
|
t += xi[e[i]];
|
|
2054
2071
|
return t;
|
|
2055
2072
|
}
|
|
2056
|
-
function
|
|
2073
|
+
function nn(e) {
|
|
2057
2074
|
let t = e.length - 1;
|
|
2058
2075
|
for (; t >= 0; ) {
|
|
2059
|
-
const i = t === 0 ?
|
|
2076
|
+
const i = t === 0 ? tn : sn;
|
|
2060
2077
|
if (e[t] += 1, e[t] >= i)
|
|
2061
2078
|
e[t] = Xe, t--;
|
|
2062
2079
|
else
|
|
@@ -2068,7 +2085,7 @@ function Ae(e = R(), t = !1) {
|
|
|
2068
2085
|
const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
2069
2086
|
if (s && i)
|
|
2070
2087
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${re}/`;
|
|
2071
|
-
const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r =
|
|
2088
|
+
const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r = on(e.name), a = an(e.version);
|
|
2072
2089
|
if (a === void 0)
|
|
2073
2090
|
throw Error(
|
|
2074
2091
|
b(
|
|
@@ -2078,15 +2095,15 @@ function Ae(e = R(), t = !1) {
|
|
|
2078
2095
|
);
|
|
2079
2096
|
return r.length === 0 ? `https://${n}/${a}/` : s ? `https://${n}/${r}/${a}/` : `https://${n}/${a}/${r}/`;
|
|
2080
2097
|
}
|
|
2081
|
-
const
|
|
2082
|
-
function
|
|
2098
|
+
const on = (e) => e.split("/").pop() ?? e;
|
|
2099
|
+
function an(e) {
|
|
2083
2100
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2084
2101
|
if (i?.groups === void 0)
|
|
2085
2102
|
return;
|
|
2086
2103
|
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
|
|
2087
2104
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2088
2105
|
}
|
|
2089
|
-
async function
|
|
2106
|
+
async function ln(e, t, i, s, n) {
|
|
2090
2107
|
const r = t.packageName, { hasCss: a, cdnName: c } = await Ai(t.packageLocation) ?? {};
|
|
2091
2108
|
if (i === "cdn") {
|
|
2092
2109
|
const m = t.cdnUrl ?? Ae(t.packageJson, n);
|
|
@@ -2138,10 +2155,10 @@ async function Ai(e) {
|
|
|
2138
2155
|
a === i
|
|
2139
2156
|
);
|
|
2140
2157
|
return r === void 0 ? await Promise.all(
|
|
2141
|
-
n.map(async (a) => await
|
|
2142
|
-
).then((a) => a.find(j)) : await
|
|
2158
|
+
n.map(async (a) => await Ct(t, a))
|
|
2159
|
+
).then((a) => a.find(j)) : await Ct(t, r);
|
|
2143
2160
|
}
|
|
2144
|
-
async function
|
|
2161
|
+
async function Ct(e, t) {
|
|
2145
2162
|
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
|
|
2146
2163
|
K(i),
|
|
2147
2164
|
K(s),
|
|
@@ -2152,7 +2169,7 @@ async function Tt(e, t) {
|
|
|
2152
2169
|
cdnName: t
|
|
2153
2170
|
} : void 0;
|
|
2154
2171
|
}
|
|
2155
|
-
async function
|
|
2172
|
+
async function cn(e, t, i, s, n) {
|
|
2156
2173
|
const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await Ai(t.packageLocation) : void 0, c = a?.cdnName ?? re, d = a === void 0 ? `${Ti}.js` : `${a.cdnName}.esm.js`;
|
|
2157
2174
|
if (i === "cdn")
|
|
2158
2175
|
return {
|
|
@@ -2162,7 +2179,7 @@ async function ln(e, t, i, s, n) {
|
|
|
2162
2179
|
src: `${t.cdnUrl ?? Ae(t.packageJson, n)}${d}`
|
|
2163
2180
|
}
|
|
2164
2181
|
};
|
|
2165
|
-
const l =
|
|
2182
|
+
const l = dn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${X}`, m = [
|
|
2166
2183
|
`import styles$${s} from "${p}";`,
|
|
2167
2184
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2168
2185
|
], f = `${t.packageName}/loader`;
|
|
@@ -2181,7 +2198,7 @@ async function ln(e, t, i, s, n) {
|
|
|
2181
2198
|
]
|
|
2182
2199
|
};
|
|
2183
2200
|
}
|
|
2184
|
-
function
|
|
2201
|
+
function dn(e) {
|
|
2185
2202
|
const { exports: t } = e;
|
|
2186
2203
|
if (t === void 0)
|
|
2187
2204
|
throw new Error(
|
|
@@ -2191,15 +2208,15 @@ function cn(e) {
|
|
|
2191
2208
|
return s ? s[0] : i.length > 0 ? i[0][0] : `./${Y}.css`;
|
|
2192
2209
|
}
|
|
2193
2210
|
async function pe(e) {
|
|
2194
|
-
return e._loadersCache ??=
|
|
2211
|
+
return e._loadersCache ??= pn(e), await e._loadersCache;
|
|
2195
2212
|
}
|
|
2196
|
-
async function
|
|
2213
|
+
async function pn(e) {
|
|
2197
2214
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", s = e.viteConfig.base;
|
|
2198
2215
|
let n = 0;
|
|
2199
2216
|
const r = async (l) => (await Promise.all(
|
|
2200
2217
|
l.map(async (p) => {
|
|
2201
2218
|
const m = n++;
|
|
2202
|
-
return p.type === "stencil" ? await
|
|
2219
|
+
return p.type === "stencil" ? await ln(s, p, t, m, i) : p.type === "@arcgis/lumina" ? await cn(s, p, t, m, i) : void 0;
|
|
2203
2220
|
})
|
|
2204
2221
|
)).filter(j).flat(), a = await Promise.all([
|
|
2205
2222
|
// This may contain an import map so must be first
|
|
@@ -2228,7 +2245,7 @@ async function Li(e) {
|
|
|
2228
2245
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
2229
2246
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
2230
2247
|
t.map(async (i) => {
|
|
2231
|
-
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await
|
|
2248
|
+
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await bi(n);
|
|
2232
2249
|
if (r === void 0)
|
|
2233
2250
|
throw Error(
|
|
2234
2251
|
b(
|
|
@@ -2243,8 +2260,8 @@ async function Li(e) {
|
|
|
2243
2260
|
})
|
|
2244
2261
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
2245
2262
|
}
|
|
2246
|
-
const
|
|
2247
|
-
async function
|
|
2263
|
+
const mn = "/C:@arcgis/lumina-compiler/testSetupFile", un = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, Me = [mn];
|
|
2264
|
+
async function fn(e) {
|
|
2248
2265
|
if (
|
|
2249
2266
|
/**
|
|
2250
2267
|
* Only import custom element dependencies if we are running in Vitest browser mode.
|
|
@@ -2256,7 +2273,7 @@ async function un(e) {
|
|
|
2256
2273
|
*/
|
|
2257
2274
|
!e.apiJsonEnabled
|
|
2258
2275
|
)
|
|
2259
|
-
return
|
|
2276
|
+
return Tt(e);
|
|
2260
2277
|
const i = (await pe(e)).map((s, n) => {
|
|
2261
2278
|
if ("javascriptCode" in s)
|
|
2262
2279
|
return s.javascriptCode.join(`
|
|
@@ -2280,18 +2297,18 @@ async function un(e) {
|
|
|
2280
2297
|
}).join(`
|
|
2281
2298
|
|
|
2282
2299
|
`);
|
|
2283
|
-
return [
|
|
2300
|
+
return [Tt(e), i].join("");
|
|
2284
2301
|
}
|
|
2285
|
-
const
|
|
2302
|
+
const Tt = (e) => [e.isInPuppeteerTestBackEnd ? gn : "", hn].join(""), gn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2286
2303
|
setupPuppeteerTest();
|
|
2287
|
-
`,
|
|
2304
|
+
`, hn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2288
2305
|
setupLuminaTest();
|
|
2289
|
-
`,
|
|
2306
|
+
`, yn = "@arcgis/lumina:generateLoaderTs";
|
|
2290
2307
|
let Pe;
|
|
2291
|
-
function
|
|
2308
|
+
function vn(e) {
|
|
2292
2309
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2293
2310
|
return [xs(e.apiExtractorPluginConfig), {
|
|
2294
|
-
name:
|
|
2311
|
+
name: yn,
|
|
2295
2312
|
configResolved() {
|
|
2296
2313
|
Pe = `${e.dir.root}src/loader.ts`;
|
|
2297
2314
|
},
|
|
@@ -2316,17 +2333,17 @@ function yn(e) {
|
|
|
2316
2333
|
name: "@arcgis/lumina:generateTestSetupVirtualFile",
|
|
2317
2334
|
load: {
|
|
2318
2335
|
filter: {
|
|
2319
|
-
id:
|
|
2336
|
+
id: un
|
|
2320
2337
|
},
|
|
2321
|
-
handler: async () => await
|
|
2338
|
+
handler: async () => await fn(e)
|
|
2322
2339
|
}
|
|
2323
2340
|
}];
|
|
2324
2341
|
}
|
|
2325
|
-
function
|
|
2342
|
+
function $t(e) {
|
|
2326
2343
|
const t = e.server.moduleGraph.getModuleById(Pe);
|
|
2327
2344
|
t !== void 0 && e.server.moduleGraph.invalidateModule(t);
|
|
2328
2345
|
}
|
|
2329
|
-
const
|
|
2346
|
+
const Pt = (e) => {
|
|
2330
2347
|
e.server.ws.send({
|
|
2331
2348
|
type: "full-reload",
|
|
2332
2349
|
path: u.join("/", u.relative(e.dir.root, Pe))
|
|
@@ -2337,9 +2354,9 @@ function ce(e, t, i = at) {
|
|
|
2337
2354
|
throw Error(b(Ye, "serveAssets() is only available when Vite is running in serve mode"));
|
|
2338
2355
|
const s = e._serverConfigured, n = e.server.middlewares.stack.length;
|
|
2339
2356
|
if (t.forEach((r) => {
|
|
2340
|
-
const a = ji(r), c = Di(e.dir, Fi(a)), d =
|
|
2357
|
+
const a = ji(r), c = Di(e.dir, Fi(a)), d = wn(e.viteConfig.base, c, e.dir.distCdn);
|
|
2341
2358
|
e.server.middlewares.use(d, (l, p, m) => {
|
|
2342
|
-
const f =
|
|
2359
|
+
const f = Sn(l.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), v = i.find((y) => y.match(h, e));
|
|
2343
2360
|
return (typeof g == "function" ? Promise.resolve(g()) : z(g)).then((y) => {
|
|
2344
2361
|
const S = (typeof g == "function" ? void 0 : v?.transform(y.toString("utf8"), h, e)) ?? y;
|
|
2345
2362
|
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", As.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
@@ -2367,10 +2384,10 @@ async function Ni(e, t, i = at) {
|
|
|
2367
2384
|
await Oi(d.map(([l, p]) => p)), await Ls(
|
|
2368
2385
|
d,
|
|
2369
2386
|
16,
|
|
2370
|
-
async ([l, p]) => await
|
|
2387
|
+
async ([l, p]) => await It(l, p, i, e)
|
|
2371
2388
|
);
|
|
2372
2389
|
} else if (n.type === "file")
|
|
2373
|
-
await V(u.dirname(r), { recursive: !0 }), await
|
|
2390
|
+
await V(u.dirname(r), { recursive: !0 }), await It(n.source, r, i, e);
|
|
2374
2391
|
else if (n.type === "dynamic") {
|
|
2375
2392
|
await V(u.dirname(r), { recursive: !0 });
|
|
2376
2393
|
const a = await Promise.resolve(n.source());
|
|
@@ -2379,7 +2396,7 @@ async function Ni(e, t, i = at) {
|
|
|
2379
2396
|
})
|
|
2380
2397
|
);
|
|
2381
2398
|
}
|
|
2382
|
-
const ji =
|
|
2399
|
+
const ji = Vt ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
2383
2400
|
...e,
|
|
2384
2401
|
destination: le(e.destination)
|
|
2385
2402
|
} : {
|
|
@@ -2387,7 +2404,7 @@ const ji = Gt ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
2387
2404
|
source: le(e.source),
|
|
2388
2405
|
destination: le(e.destination)
|
|
2389
2406
|
};
|
|
2390
|
-
async function
|
|
2407
|
+
async function It(e, t, i, s) {
|
|
2391
2408
|
const n = i.find((r) => r.match(t, s));
|
|
2392
2409
|
if (n === void 0)
|
|
2393
2410
|
await Ps(e, t);
|
|
@@ -2412,33 +2429,33 @@ function Fi(e) {
|
|
|
2412
2429
|
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
2413
2430
|
}
|
|
2414
2431
|
function Di({ dist: e, distCdnAssets: t }, i) {
|
|
2415
|
-
const s =
|
|
2432
|
+
const s = bn(i), n = u.join(
|
|
2416
2433
|
t,
|
|
2417
2434
|
s ? u.relative(t, i) : i
|
|
2418
2435
|
), r = u.relative(e, n), a = Ri(r);
|
|
2419
2436
|
return u.join(e, a);
|
|
2420
2437
|
}
|
|
2421
|
-
function
|
|
2438
|
+
function bn(e) {
|
|
2422
2439
|
if (e.startsWith(u.sep)) {
|
|
2423
|
-
const t =
|
|
2440
|
+
const t = Gt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
2424
2441
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
2425
2442
|
} else
|
|
2426
|
-
return !!(!
|
|
2443
|
+
return !!(!Vt && u.isAbsolute(e));
|
|
2427
2444
|
}
|
|
2428
|
-
function
|
|
2445
|
+
function wn(e, t, i) {
|
|
2429
2446
|
const s = Ri(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
2430
2447
|
return `${e}${n}`;
|
|
2431
2448
|
}
|
|
2432
|
-
const Ri = (e) => e.replaceAll("../", ""),
|
|
2449
|
+
const Ri = (e) => e.replaceAll("../", ""), Sn = (e = "") => e.split("?")[0].split("#")[0];
|
|
2433
2450
|
async function Oi(e) {
|
|
2434
2451
|
const t = new Set(e.map(u.dirname));
|
|
2435
2452
|
await Promise.all(Array.from(t, async (i) => await V(i, { recursive: !0 })));
|
|
2436
2453
|
}
|
|
2437
|
-
const
|
|
2454
|
+
const En = {
|
|
2438
2455
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
2439
2456
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
2440
|
-
}, at = [
|
|
2441
|
-
function
|
|
2457
|
+
}, at = [En];
|
|
2458
|
+
function Cn(e) {
|
|
2442
2459
|
let t;
|
|
2443
2460
|
const i = () => [
|
|
2444
2461
|
...e.options.assets?.transformers ?? [],
|
|
@@ -2461,10 +2478,10 @@ function En(e) {
|
|
|
2461
2478
|
* `configureServer`.
|
|
2462
2479
|
*/
|
|
2463
2480
|
configResolved() {
|
|
2464
|
-
e.viteCommand === "serve" && (t =
|
|
2481
|
+
e.viteCommand === "serve" && (t = kt(e));
|
|
2465
2482
|
},
|
|
2466
2483
|
options() {
|
|
2467
|
-
e.viteCommand === "build" && (t =
|
|
2484
|
+
e.viteCommand === "build" && (t = kt(e));
|
|
2468
2485
|
},
|
|
2469
2486
|
async configureServer(s) {
|
|
2470
2487
|
e.server = s, ce(e, await t, i()), s.watcher.on("addDir", (n) => {
|
|
@@ -2479,7 +2496,7 @@ function En(e) {
|
|
|
2479
2496
|
}
|
|
2480
2497
|
};
|
|
2481
2498
|
}
|
|
2482
|
-
async function
|
|
2499
|
+
async function kt(e) {
|
|
2483
2500
|
const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2484
2501
|
i.map(async (n) => {
|
|
2485
2502
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
@@ -2492,7 +2509,7 @@ const Mi = (e, t) => ({
|
|
|
2492
2509
|
type: "directory",
|
|
2493
2510
|
source: e,
|
|
2494
2511
|
destination: u.basename(t)
|
|
2495
|
-
}), Ji = { type: "directory", source: "assets/", destination: "" }, Je = "@arcgis/lumina:printTotalBuildSize",
|
|
2512
|
+
}), Ji = { type: "directory", source: "assets/", destination: "" }, Je = "@arcgis/lumina:printTotalBuildSize", Tn = (e) => ({
|
|
2496
2513
|
name: Je,
|
|
2497
2514
|
apply: () => e.viteCommand === "build",
|
|
2498
2515
|
configResolved(t) {
|
|
@@ -2511,10 +2528,10 @@ const Mi = (e, t) => ({
|
|
|
2511
2528
|
const m = console.log;
|
|
2512
2529
|
console.log = function(...g) {
|
|
2513
2530
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2514
|
-
const [h, v] = g[0].match(
|
|
2531
|
+
const [h, v] = g[0].match(Pn) ?? [];
|
|
2515
2532
|
if (!h)
|
|
2516
2533
|
return;
|
|
2517
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2534
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(In, "").length);
|
|
2518
2535
|
const y = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2519
2536
|
v ? (l += Number.parseFloat(v.replace(" kB", "").replaceAll(",", "")), d += y) : c += y;
|
|
2520
2537
|
}
|
|
@@ -2525,27 +2542,27 @@ const Mi = (e, t) => ({
|
|
|
2525
2542
|
console.log = m;
|
|
2526
2543
|
}
|
|
2527
2544
|
if (d > 0) {
|
|
2528
|
-
const g = l > 0 ? d : c, h =
|
|
2545
|
+
const g = l > 0 ? d : c, h = Lt(g), v = e.dir.relativeDist;
|
|
2529
2546
|
console.log(
|
|
2530
2547
|
[
|
|
2531
|
-
|
|
2548
|
+
At,
|
|
2532
2549
|
v,
|
|
2533
|
-
|
|
2550
|
+
$n,
|
|
2534
2551
|
"*",
|
|
2535
2552
|
" ".repeat(p - `${v}*`.length - h.length),
|
|
2536
2553
|
h,
|
|
2537
|
-
|
|
2538
|
-
l > 0 ? ` ${
|
|
2554
|
+
xt,
|
|
2555
|
+
l > 0 ? ` ${At}│ gzip: ${Lt(l)}${xt}` : ""
|
|
2539
2556
|
].join("")
|
|
2540
2557
|
);
|
|
2541
2558
|
}
|
|
2542
2559
|
};
|
|
2543
2560
|
}
|
|
2544
|
-
}),
|
|
2561
|
+
}), xt = "\x1B[22m\x1B[1m\x1B[22m", At = "\x1B[2m", $n = "\x1B[22m\x1B[36m", Pn = /\d+(?:,\d+)?\.\d{2} kB/gu, In = /\x1B\[\d+m/gu, kn = new Intl.NumberFormat("en", {
|
|
2545
2562
|
maximumFractionDigits: 2,
|
|
2546
2563
|
minimumFractionDigits: 2
|
|
2547
|
-
}),
|
|
2548
|
-
name:
|
|
2564
|
+
}), Lt = (e) => `${kn.format(e)} kB`, xn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", nt.slice(0, -3))), Nt = "@arcgis/lumina:configureVite", An = (e) => ({
|
|
2565
|
+
name: Nt,
|
|
2549
2566
|
async config({
|
|
2550
2567
|
server: t,
|
|
2551
2568
|
publicDir: i,
|
|
@@ -2656,7 +2673,7 @@ const Mi = (e, t) => ({
|
|
|
2656
2673
|
if (typeof p.setupFiles == "string" ? p.setupFiles = [...Me, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...Me, ...p.setupFiles] : p.setupFiles = [...Me], e.isInPuppeteerTestBackEnd) {
|
|
2657
2674
|
if (g?.enabled === !0)
|
|
2658
2675
|
throw Error(
|
|
2659
|
-
b(
|
|
2676
|
+
b(Nt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2660
2677
|
);
|
|
2661
2678
|
return {
|
|
2662
2679
|
test: {
|
|
@@ -2690,7 +2707,7 @@ const Mi = (e, t) => ({
|
|
|
2690
2707
|
publicDir: i ?? !1,
|
|
2691
2708
|
build: {
|
|
2692
2709
|
cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
|
|
2693
|
-
target: n ??
|
|
2710
|
+
target: n ?? Si(e),
|
|
2694
2711
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2695
2712
|
lib: {
|
|
2696
2713
|
entry: y,
|
|
@@ -2755,22 +2772,22 @@ const Mi = (e, t) => ({
|
|
|
2755
2772
|
e._originalRollupInputOptions ??= t.input;
|
|
2756
2773
|
const s = { ...e._originalRollupInputOptions };
|
|
2757
2774
|
i.forEach((n) => {
|
|
2758
|
-
const r =
|
|
2775
|
+
const r = xn(n);
|
|
2759
2776
|
s[r] = n;
|
|
2760
2777
|
}), t.input = s;
|
|
2761
2778
|
}
|
|
2762
|
-
}),
|
|
2779
|
+
}), Ln = (e) => ({
|
|
2763
2780
|
name: "@arcgis/lumina:setAssetPath",
|
|
2764
2781
|
apply: () => e.viteCommand === "build",
|
|
2765
2782
|
config: (t) => ({
|
|
2766
2783
|
base: t.base ?? e.options.assets?.defaultPath ?? Ae()
|
|
2767
2784
|
})
|
|
2768
2785
|
});
|
|
2769
|
-
function
|
|
2786
|
+
function Nn(e = R()) {
|
|
2770
2787
|
const t = e.version ?? "0.0.1";
|
|
2771
2788
|
return cs(t);
|
|
2772
2789
|
}
|
|
2773
|
-
const
|
|
2790
|
+
const jn = (e) => `/* ${e} */`, I = (e) => (t, i) => {
|
|
2774
2791
|
Object.defineProperty(t, i, {
|
|
2775
2792
|
get() {
|
|
2776
2793
|
throw Error(
|
|
@@ -2810,7 +2827,7 @@ const ae = {
|
|
|
2810
2827
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2811
2828
|
}, Qe = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2812
2829
|
async function Bi(e, t, i = R()) {
|
|
2813
|
-
const s =
|
|
2830
|
+
const s = Fn(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await z(n, "utf8") : "";
|
|
2814
2831
|
if (a.trim().replaceAll(`\r
|
|
2815
2832
|
`, `
|
|
2816
2833
|
`) === s.trim())
|
|
@@ -2828,9 +2845,9 @@ Current content:
|
|
|
2828
2845
|
${a}`
|
|
2829
2846
|
)
|
|
2830
2847
|
);
|
|
2831
|
-
return
|
|
2848
|
+
return Qt(n, s), !0;
|
|
2832
2849
|
}
|
|
2833
|
-
function
|
|
2850
|
+
function Fn(e, t = R()) {
|
|
2834
2851
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
2835
2852
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
2836
2853
|
(d, l) => `
|
|
@@ -2841,7 +2858,7 @@ declare module "@arcgis/lumina" {
|
|
|
2841
2858
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
2842
2859
|
}`, a = t.devDependencies ?? {};
|
|
2843
2860
|
return [
|
|
2844
|
-
|
|
2861
|
+
Dn,
|
|
2845
2862
|
a.vitest ? `
|
|
2846
2863
|
/// <reference types="vitest/config" />
|
|
2847
2864
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -2852,7 +2869,7 @@ declare module "@arcgis/lumina" {
|
|
|
2852
2869
|
`
|
|
2853
2870
|
].join("");
|
|
2854
2871
|
}
|
|
2855
|
-
const
|
|
2872
|
+
const Dn = `/**
|
|
2856
2873
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
2857
2874
|
* Manual edits will be overwritten.
|
|
2858
2875
|
*
|
|
@@ -2871,10 +2888,10 @@ const Fn = `/**
|
|
|
2871
2888
|
* is doing:
|
|
2872
2889
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
2873
2890
|
*/
|
|
2874
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
2891
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Rn = (e) => ({
|
|
2875
2892
|
name: ve,
|
|
2876
2893
|
configResolved() {
|
|
2877
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
2894
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = On(e).catch(
|
|
2878
2895
|
(t) => $.error(ve, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
2879
2896
|
));
|
|
2880
2897
|
},
|
|
@@ -2924,25 +2941,25 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
2924
2941
|
await e._updateLuminaTsPromise;
|
|
2925
2942
|
}
|
|
2926
2943
|
});
|
|
2927
|
-
async function
|
|
2944
|
+
async function On(e) {
|
|
2928
2945
|
const i = (await Promise.all([te, Li(e)])).flat();
|
|
2929
2946
|
if (!await Bi(i, e.dir.src))
|
|
2930
2947
|
return;
|
|
2931
2948
|
let n = !1;
|
|
2932
2949
|
function r() {
|
|
2933
|
-
n || $.warn(ve,
|
|
2950
|
+
n || $.warn(ve, Mn), n = !0;
|
|
2934
2951
|
}
|
|
2935
2952
|
process.on("exit", () => {
|
|
2936
2953
|
r(), clearTimeout(c);
|
|
2937
2954
|
});
|
|
2938
2955
|
const c = setTimeout(r, 2e3);
|
|
2939
2956
|
}
|
|
2940
|
-
const
|
|
2957
|
+
const Mn = Ns(
|
|
2941
2958
|
"greenBright",
|
|
2942
2959
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
2943
2960
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
2944
2961
|
);
|
|
2945
|
-
async function
|
|
2962
|
+
async function Jn(e) {
|
|
2946
2963
|
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Fs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : yt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
2947
2964
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? oe(e.options.documentation.apiJsonFileName) : ae.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
2948
2965
|
{
|
|
@@ -2997,7 +3014,7 @@ async function Mn(e) {
|
|
|
2997
3014
|
if ([...p.addedModules, ...p.removedModules].some(
|
|
2998
3015
|
(f) => Se(f.sourcePath, "src/components/")
|
|
2999
3016
|
))
|
|
3000
|
-
|
|
3017
|
+
$t(e), Pt(e);
|
|
3001
3018
|
else {
|
|
3002
3019
|
for (const f of p.changedModules) {
|
|
3003
3020
|
if (!Se(f.new.sourcePath, "src/components/"))
|
|
@@ -3010,20 +3027,20 @@ async function Mn(e) {
|
|
|
3010
3027
|
if (g === void 0 && h === void 0)
|
|
3011
3028
|
continue;
|
|
3012
3029
|
if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName || g.formAssociated !== h.formAssociated) {
|
|
3013
|
-
|
|
3030
|
+
Pt(e);
|
|
3014
3031
|
break;
|
|
3015
3032
|
}
|
|
3016
|
-
const v =
|
|
3033
|
+
const v = gi(h);
|
|
3017
3034
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: v });
|
|
3018
3035
|
}
|
|
3019
|
-
|
|
3036
|
+
$t(e);
|
|
3020
3037
|
}
|
|
3021
|
-
|
|
3038
|
+
jt(e, p.apiJson);
|
|
3022
3039
|
}
|
|
3023
3040
|
}
|
|
3024
3041
|
},
|
|
3025
3042
|
afterApiJsonCreate: (l) => {
|
|
3026
|
-
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(),
|
|
3043
|
+
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), jt(e, l.apiJson));
|
|
3027
3044
|
}
|
|
3028
3045
|
}, c = i === void 0 ? a : yt(i, a);
|
|
3029
3046
|
e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
|
|
@@ -3032,7 +3049,7 @@ async function Mn(e) {
|
|
|
3032
3049
|
e.apiExtractor = l, d?.(l);
|
|
3033
3050
|
};
|
|
3034
3051
|
}
|
|
3035
|
-
function
|
|
3052
|
+
function jt(e, t) {
|
|
3036
3053
|
const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
|
|
3037
3054
|
for (const r of t.modules) {
|
|
3038
3055
|
const a = { ...r, declarations: [] };
|
|
@@ -3057,10 +3074,10 @@ function Ft(e, t) {
|
|
|
3057
3074
|
}
|
|
3058
3075
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3059
3076
|
}
|
|
3060
|
-
var
|
|
3077
|
+
var Bn = Object.defineProperty, k = (e, t, i, s) => {
|
|
3061
3078
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3062
3079
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3063
|
-
return n &&
|
|
3080
|
+
return n && Bn(t, i, n), n;
|
|
3064
3081
|
};
|
|
3065
3082
|
const q = "@arcgis/lumina:context";
|
|
3066
3083
|
class P {
|
|
@@ -3086,7 +3103,7 @@ class P {
|
|
|
3086
3103
|
distComponents: f,
|
|
3087
3104
|
distCdn: g,
|
|
3088
3105
|
distCdnAssets: h
|
|
3089
|
-
}, $.initialize(r.logger, c), r.root !==
|
|
3106
|
+
}, $.initialize(r.logger, c), r.root !== Gt())
|
|
3090
3107
|
throw Error(
|
|
3091
3108
|
b(
|
|
3092
3109
|
q,
|
|
@@ -3137,7 +3154,7 @@ class P {
|
|
|
3137
3154
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? oe(i.jetBrains.webTypesFileName) : ae.webTypes,
|
|
3138
3155
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? oe(i.vsCode.htmlFileName) : ae.vsCodeHtml,
|
|
3139
3156
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? oe(i.vsCode.cssFileName) : ae.vsCodeCss
|
|
3140
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3157
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Jn(this);
|
|
3141
3158
|
const s = process.cwd().length + 1;
|
|
3142
3159
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3143
3160
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3146,12 +3163,12 @@ class P {
|
|
|
3146
3163
|
Se(l, "src/components") && a.push(l);
|
|
3147
3164
|
}
|
|
3148
3165
|
return a;
|
|
3149
|
-
}),
|
|
3150
|
-
const n = t.build?.preamble ??
|
|
3151
|
-
this.banner =
|
|
3166
|
+
}), yi(void 0, t);
|
|
3167
|
+
const n = t.build?.preamble ?? Nn();
|
|
3168
|
+
this.banner = jn(n);
|
|
3152
3169
|
}
|
|
3153
3170
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3154
|
-
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(
|
|
3171
|
+
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(hi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
3155
3172
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3156
3173
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3157
3174
|
}
|
|
@@ -3299,8 +3316,8 @@ k([
|
|
|
3299
3316
|
k([
|
|
3300
3317
|
I("configResolved()")
|
|
3301
3318
|
], P.prototype, "_typeScriptPrinter");
|
|
3302
|
-
function
|
|
3303
|
-
const s =
|
|
3319
|
+
function Kn(e, t, i) {
|
|
3320
|
+
const s = vi()[t] ?? _i(e)[t];
|
|
3304
3321
|
if (s === void 0) {
|
|
3305
3322
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3306
3323
|
return;
|
|
@@ -3314,11 +3331,11 @@ function Bn(e, t, i) {
|
|
|
3314
3331
|
}
|
|
3315
3332
|
return s;
|
|
3316
3333
|
}
|
|
3317
|
-
function
|
|
3334
|
+
function _n(e, t) {
|
|
3318
3335
|
return e.packageName === void 0 ? ue(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3319
3336
|
}
|
|
3320
3337
|
function _i(e) {
|
|
3321
|
-
return e._localDefinedComponents ??=
|
|
3338
|
+
return e._localDefinedComponents ??= wi(
|
|
3322
3339
|
e.privateApiJson,
|
|
3323
3340
|
{
|
|
3324
3341
|
packageName: void 0,
|
|
@@ -3329,19 +3346,19 @@ function _i(e) {
|
|
|
3329
3346
|
e.viteCommand === "build"
|
|
3330
3347
|
), e._localDefinedComponents;
|
|
3331
3348
|
}
|
|
3332
|
-
const
|
|
3333
|
-
name:
|
|
3349
|
+
const Ft = "makeRuntime(", Un = "@arcgis/core", Wn = "@arcgis/lumina:injectRuntimeOptions", zn = (e) => ({
|
|
3350
|
+
name: Wn,
|
|
3334
3351
|
transform: {
|
|
3335
3352
|
filter: {
|
|
3336
3353
|
id: /\/src\/runtime\.ts$/u
|
|
3337
3354
|
},
|
|
3338
3355
|
handler(t, i) {
|
|
3339
|
-
const s = t.indexOf(
|
|
3356
|
+
const s = t.indexOf(Ft);
|
|
3340
3357
|
if (s === -1)
|
|
3341
3358
|
throw new Error(
|
|
3342
3359
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3343
3360
|
);
|
|
3344
|
-
const n = s +
|
|
3361
|
+
const n = s + Ft.length, r = e.options.css?.commonStylesPath;
|
|
3345
3362
|
return {
|
|
3346
3363
|
code: [
|
|
3347
3364
|
r === void 0 ? "" : `import commonStyles from "${ue(e.dir.src, r)}${Ce}";`,
|
|
@@ -3349,7 +3366,7 @@ const Dt = "makeRuntime(", _n = "@arcgis/core", Un = "@arcgis/lumina:injectRunti
|
|
|
3349
3366
|
"{",
|
|
3350
3367
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
3351
3368
|
'hydratedAttribute:"',
|
|
3352
|
-
e.options.css?.hydratedAttribute ??
|
|
3369
|
+
e.options.css?.hydratedAttribute ?? ui,
|
|
3353
3370
|
'",',
|
|
3354
3371
|
r === void 0 ? "" : "commonStyles",
|
|
3355
3372
|
"}",
|
|
@@ -3357,7 +3374,7 @@ const Dt = "makeRuntime(", _n = "@arcgis/core", Un = "@arcgis/lumina:injectRunti
|
|
|
3357
3374
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3358
3375
|
// a cyclical dependency.
|
|
3359
3376
|
xe ? `
|
|
3360
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3377
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Un}/applications/Components/reactiveUtils.js";
|
|
3361
3378
|
createObservable,
|
|
3362
3379
|
runtime.t = trackAccess;
|
|
3363
3380
|
runtime.o = createObservable;
|
|
@@ -3369,11 +3386,11 @@ runtime.r = runTracked;` : ""
|
|
|
3369
3386
|
}
|
|
3370
3387
|
}
|
|
3371
3388
|
});
|
|
3372
|
-
function
|
|
3389
|
+
function Hn(e) {
|
|
3373
3390
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${re}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3374
3391
|
`;
|
|
3375
3392
|
}
|
|
3376
|
-
const ye = "@arcgis/lumina:addNonLazyImports",
|
|
3393
|
+
const ye = "@arcgis/lumina:addNonLazyImports", qn = (e) => ({
|
|
3377
3394
|
name: ye,
|
|
3378
3395
|
apply: () => e.viteCommand === "build",
|
|
3379
3396
|
generateBundle(t, i) {
|
|
@@ -3385,7 +3402,7 @@ const ye = "@arcgis/lumina:addNonLazyImports", Hn = (e) => ({
|
|
|
3385
3402
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3386
3403
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3387
3404
|
let m = c.code;
|
|
3388
|
-
m =
|
|
3405
|
+
m = Wr(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = Hn(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
|
|
3389
3406
|
}
|
|
3390
3407
|
}), !r && !e.isInStorybook)
|
|
3391
3408
|
throw Error(b(ye, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3422,12 +3439,12 @@ Possible causes:
|
|
|
3422
3439
|
return [];
|
|
3423
3440
|
const d = u.dirname(r), l = e.dir.src + Ue(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
|
|
3424
3441
|
function m(T) {
|
|
3425
|
-
const x =
|
|
3442
|
+
const x = Kn(e, T, r);
|
|
3426
3443
|
if (x === void 0)
|
|
3427
3444
|
return;
|
|
3428
|
-
const w =
|
|
3445
|
+
const w = _n(x, p);
|
|
3429
3446
|
if (w !== `./${p}`)
|
|
3430
|
-
return w.startsWith(".") ? `${w}/${
|
|
3447
|
+
return w.startsWith(".") ? `${w}/${Dt}` : w;
|
|
3431
3448
|
}
|
|
3432
3449
|
const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(j), v = (T) => `import "${T}";
|
|
3433
3450
|
`, y = h.map(v).join(""), S = Array.from(g, (T) => {
|
|
@@ -3446,12 +3463,12 @@ Possible causes:
|
|
|
3446
3463
|
}).filter(j), E = `${y}export * from "./${nt}";`, C = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3447
3464
|
${E}
|
|
3448
3465
|
deferredLoaders${S.join("")};` : E;
|
|
3449
|
-
return await _(u.join(e.dir.dist, p,
|
|
3466
|
+
return await _(u.join(e.dir.dist, p, Dt), C);
|
|
3450
3467
|
});
|
|
3451
3468
|
await Promise.all(n);
|
|
3452
3469
|
}
|
|
3453
|
-
}),
|
|
3454
|
-
function
|
|
3470
|
+
}), Dt = "index.js", Ui = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), Ui(e, e[n].referencedBy, i, s)));
|
|
3471
|
+
function Rt(e, t, i) {
|
|
3455
3472
|
if (Q(e))
|
|
3456
3473
|
return e;
|
|
3457
3474
|
{
|
|
@@ -3470,14 +3487,14 @@ function Q(e) {
|
|
|
3470
3487
|
return (
|
|
3471
3488
|
// Inlined string literal
|
|
3472
3489
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3473
|
-
|
|
3490
|
+
Vn.has(e.kind) || // Ternary with both branches never undefined
|
|
3474
3491
|
o.isConditionalExpression(e) && Q(e.whenTrue) && Q(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3475
|
-
o.isBinaryExpression(e) && (
|
|
3492
|
+
o.isBinaryExpression(e) && (Gn.has(e.operatorToken.kind) || Q(e.left) && Q(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3476
3493
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Q(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3477
3494
|
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Ys.has(e.tag.text)
|
|
3478
3495
|
);
|
|
3479
3496
|
}
|
|
3480
|
-
const
|
|
3497
|
+
const Vn = /* @__PURE__ */ new Set([
|
|
3481
3498
|
o.SyntaxKind.NumericLiteral,
|
|
3482
3499
|
o.SyntaxKind.BigIntLiteral,
|
|
3483
3500
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3496,7 +3513,7 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3496
3513
|
o.SyntaxKind.ClassExpression,
|
|
3497
3514
|
// Trust? Trust.
|
|
3498
3515
|
o.SyntaxKind.NonNullExpression
|
|
3499
|
-
]),
|
|
3516
|
+
]), Gn = /* @__PURE__ */ new Set([
|
|
3500
3517
|
o.SyntaxKind.PlusEqualsToken,
|
|
3501
3518
|
o.SyntaxKind.MinusEqualsToken,
|
|
3502
3519
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3531,9 +3548,9 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3531
3548
|
o.SyntaxKind.SlashToken,
|
|
3532
3549
|
o.SyntaxKind.PercentToken,
|
|
3533
3550
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3534
|
-
]),
|
|
3551
|
+
]), Xn = {
|
|
3535
3552
|
property(e, t, i, s) {
|
|
3536
|
-
const n =
|
|
3553
|
+
const n = Yn(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3537
3554
|
if (a) {
|
|
3538
3555
|
const f = Ke(t);
|
|
3539
3556
|
if (f === !0)
|
|
@@ -3546,11 +3563,11 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3546
3563
|
return [n.name, ...c];
|
|
3547
3564
|
const [l, p] = c, m = n?.type === "stringifiedNonReflected";
|
|
3548
3565
|
if (r || m) {
|
|
3549
|
-
const f =
|
|
3566
|
+
const f = Rt(
|
|
3550
3567
|
p,
|
|
3551
3568
|
e,
|
|
3552
3569
|
m ? "" : void 0
|
|
3553
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === Ee) ?
|
|
3570
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === Ee) ? Zn(f, e) : f;
|
|
3554
3571
|
if (h !== p)
|
|
3555
3572
|
return [m ? `.${i}` : n.name, l, h];
|
|
3556
3573
|
}
|
|
@@ -3562,7 +3579,7 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3562
3579
|
return [i];
|
|
3563
3580
|
if (s === !1)
|
|
3564
3581
|
return [];
|
|
3565
|
-
const n = be(e, t, !0), a = n[0] !== "=" ? n : [n[0],
|
|
3582
|
+
const n = be(e, t, !0), a = n[0] !== "=" ? n : [n[0], Rt(n[1], e)];
|
|
3566
3583
|
return [i, ...a];
|
|
3567
3584
|
},
|
|
3568
3585
|
booleanAttribute(e, t, i) {
|
|
@@ -3575,7 +3592,7 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3575
3592
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3576
3593
|
);
|
|
3577
3594
|
const s = i.slice(2), n = ft(s);
|
|
3578
|
-
return [`@${
|
|
3595
|
+
return [`@${ni.has(n) ? s.toLowerCase() : ft(s)}=`, ...dt(e, t, void 0)];
|
|
3579
3596
|
},
|
|
3580
3597
|
directives(e, t) {
|
|
3581
3598
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3610,8 +3627,8 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3610
3627
|
])
|
|
3611
3628
|
];
|
|
3612
3629
|
},
|
|
3613
|
-
class:
|
|
3614
|
-
style:
|
|
3630
|
+
class: Mt,
|
|
3631
|
+
style: Mt,
|
|
3615
3632
|
key: (e, t) => [lt(t, e.sourceFile)],
|
|
3616
3633
|
deferLoad(e, t, i, s) {
|
|
3617
3634
|
if (typeof s != "string")
|
|
@@ -3623,7 +3640,7 @@ const qn = /* @__PURE__ */ new Set([
|
|
|
3623
3640
|
return [o.factory.createIdentifier(n)];
|
|
3624
3641
|
}
|
|
3625
3642
|
};
|
|
3626
|
-
function
|
|
3643
|
+
function Yn(e, t, i) {
|
|
3627
3644
|
if (typeof e == "string") {
|
|
3628
3645
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3629
3646
|
if (r !== void 0)
|
|
@@ -3678,10 +3695,10 @@ function be(e, t, i = !1) {
|
|
|
3678
3695
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3679
3696
|
);
|
|
3680
3697
|
if (o.isStringLiteral(t))
|
|
3681
|
-
return
|
|
3698
|
+
return Ot(t, i);
|
|
3682
3699
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3683
3700
|
if (o.isStringLiteral(t.expression))
|
|
3684
|
-
return
|
|
3701
|
+
return Ot(t.expression, i);
|
|
3685
3702
|
if (i) {
|
|
3686
3703
|
if (o.isNumericLiteral(t.expression))
|
|
3687
3704
|
return [`=${t.expression.text}`];
|
|
@@ -3691,13 +3708,13 @@ function be(e, t, i = !1) {
|
|
|
3691
3708
|
}
|
|
3692
3709
|
return ["=", ...dt(e, t, void 0)];
|
|
3693
3710
|
}
|
|
3694
|
-
function
|
|
3711
|
+
function Ot(e, t) {
|
|
3695
3712
|
if (!t)
|
|
3696
3713
|
return ["=", e];
|
|
3697
3714
|
const i = e.text;
|
|
3698
3715
|
if (i.length === 0)
|
|
3699
3716
|
return [];
|
|
3700
|
-
const s =
|
|
3717
|
+
const s = oi(i);
|
|
3701
3718
|
if (Hs(s)) {
|
|
3702
3719
|
const n = s.replaceAll('"', """);
|
|
3703
3720
|
if (n.length > s.length) {
|
|
@@ -3709,7 +3726,7 @@ function Mt(e, t) {
|
|
|
3709
3726
|
} else
|
|
3710
3727
|
return [`=${s}`];
|
|
3711
3728
|
}
|
|
3712
|
-
function
|
|
3729
|
+
function Mt(e, t, i) {
|
|
3713
3730
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3714
3731
|
return [`${i}="${t.text}"`];
|
|
3715
3732
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3717,7 +3734,7 @@ function Jt(e, t, i) {
|
|
|
3717
3734
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3718
3735
|
);
|
|
3719
3736
|
const s = t.expression;
|
|
3720
|
-
if (
|
|
3737
|
+
if (Qn(s)) {
|
|
3721
3738
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3722
3739
|
e.neededImports.add(r);
|
|
3723
3740
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3727,18 +3744,18 @@ function Jt(e, t, i) {
|
|
|
3727
3744
|
} else
|
|
3728
3745
|
return [i, ...be(e, t, !0)];
|
|
3729
3746
|
}
|
|
3730
|
-
const
|
|
3731
|
-
function
|
|
3747
|
+
const Qn = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3748
|
+
function Zn(e, t) {
|
|
3732
3749
|
t.neededImports.add("live");
|
|
3733
3750
|
const i = t.importRenames.live;
|
|
3734
3751
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3735
3752
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3736
3753
|
]);
|
|
3737
3754
|
}
|
|
3738
|
-
function
|
|
3739
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3755
|
+
function eo(e) {
|
|
3756
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Jt && e.expression.arguments.length <= 1)
|
|
3740
3757
|
return {
|
|
3741
|
-
propType:
|
|
3758
|
+
propType: Jt[e.expression.expression.text],
|
|
3742
3759
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3743
3760
|
initializer: o.factory.createJsxExpression(
|
|
3744
3761
|
void 0,
|
|
@@ -3747,21 +3764,21 @@ function Zn(e) {
|
|
|
3747
3764
|
)
|
|
3748
3765
|
};
|
|
3749
3766
|
}
|
|
3750
|
-
const
|
|
3767
|
+
const Jt = {
|
|
3751
3768
|
bindProperty: "property",
|
|
3752
3769
|
bindAttribute: "attribute",
|
|
3753
3770
|
bindBooleanAttribute: "booleanAttribute",
|
|
3754
3771
|
bindEvent: "event"
|
|
3755
3772
|
};
|
|
3756
|
-
function
|
|
3757
|
-
return
|
|
3773
|
+
function to(e, t, i) {
|
|
3774
|
+
return so.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ii.has(e) || e.includes("-") ? "attribute" : !st(i) && (si.has(e) || (i === ze ? !1 : i === Ee ? (
|
|
3758
3775
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3759
3776
|
Object.values(He).some((r) => r.has(e))
|
|
3760
3777
|
) : He[i]?.has(e) === !0)) ? vt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === ze || i !== Ee && (tt.has(i) || it.has(i)) ? e in U.common.reflected || e in U.common.stringifiedReflected || e in U.common.stringifiedNonReflected ? "property" : vt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3761
3778
|
}
|
|
3762
|
-
const
|
|
3779
|
+
const io = ["class", "style", "ref", "directives", "key", "deferLoad"], so = new Set(io), ro = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3763
3780
|
function Le({ key: e, parts: t, litTag: i }, s) {
|
|
3764
|
-
const n =
|
|
3781
|
+
const n = no(t);
|
|
3765
3782
|
if (n.length % 2 === 0)
|
|
3766
3783
|
throw new Error("Normalized template parts array length must be odd");
|
|
3767
3784
|
const [r, ...a] = n;
|
|
@@ -3782,11 +3799,11 @@ function Le({ key: e, parts: t, litTag: i }, s) {
|
|
|
3782
3799
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3783
3800
|
o.factory.createIdentifier(d),
|
|
3784
3801
|
void 0,
|
|
3785
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3802
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), oo(a))
|
|
3786
3803
|
);
|
|
3787
3804
|
return _e(s, e, l);
|
|
3788
3805
|
}
|
|
3789
|
-
const
|
|
3806
|
+
const no = (e) => e.reduce(
|
|
3790
3807
|
(t, i, s) => {
|
|
3791
3808
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3792
3809
|
if (r && a)
|
|
@@ -3796,7 +3813,7 @@ const ro = (e) => e.reduce(
|
|
|
3796
3813
|
},
|
|
3797
3814
|
[""]
|
|
3798
3815
|
);
|
|
3799
|
-
function
|
|
3816
|
+
function oo(e) {
|
|
3800
3817
|
if (!(e.length % 2 === 0))
|
|
3801
3818
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3802
3819
|
const i = e.length / 2;
|
|
@@ -3835,13 +3852,13 @@ function zi(e, t) {
|
|
|
3835
3852
|
);
|
|
3836
3853
|
}
|
|
3837
3854
|
const ct = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3838
|
-
function
|
|
3855
|
+
function ao(e) {
|
|
3839
3856
|
const t = ct(e);
|
|
3840
3857
|
if (t.length === 0)
|
|
3841
3858
|
return [e || " "];
|
|
3842
3859
|
const i = t.reduceRight(
|
|
3843
3860
|
([n, ...r], a) => {
|
|
3844
|
-
const c =
|
|
3861
|
+
const c = lo(n), d = Hi(c.slice(a.pos, a.end));
|
|
3845
3862
|
return [
|
|
3846
3863
|
c.slice(0, a.pos),
|
|
3847
3864
|
/**
|
|
@@ -3860,12 +3877,12 @@ function oo(e) {
|
|
|
3860
3877
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
3861
3878
|
}
|
|
3862
3879
|
const Hi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3863
|
-
function
|
|
3880
|
+
function lo(e) {
|
|
3864
3881
|
if (typeof e == "string")
|
|
3865
3882
|
return e;
|
|
3866
3883
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3867
3884
|
}
|
|
3868
|
-
function
|
|
3885
|
+
function co(e, t) {
|
|
3869
3886
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3870
3887
|
return t;
|
|
3871
3888
|
const s = t.arguments[0];
|
|
@@ -3877,7 +3894,7 @@ function lo(e, t) {
|
|
|
3877
3894
|
return t;
|
|
3878
3895
|
const c = me(s.body);
|
|
3879
3896
|
let d = !0, l;
|
|
3880
|
-
if (
|
|
3897
|
+
if (Bt(c))
|
|
3881
3898
|
l = c;
|
|
3882
3899
|
else {
|
|
3883
3900
|
if (!o.isBlock(c))
|
|
@@ -3886,7 +3903,7 @@ function lo(e, t) {
|
|
|
3886
3903
|
if (!(y && o.isReturnStatement(y) && y.expression))
|
|
3887
3904
|
return t;
|
|
3888
3905
|
const E = me(y.expression);
|
|
3889
|
-
if (!
|
|
3906
|
+
if (!Bt(E))
|
|
3890
3907
|
return t;
|
|
3891
3908
|
const C = c.statements.slice(0, -1);
|
|
3892
3909
|
if (C.some(qi))
|
|
@@ -3899,7 +3916,7 @@ function lo(e, t) {
|
|
|
3899
3916
|
const f = p.attributes.properties[m];
|
|
3900
3917
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3901
3918
|
return t;
|
|
3902
|
-
const g = lt(f.initializer, e.sourceFile), h =
|
|
3919
|
+
const g = lt(f.initializer, e.sourceFile), h = po(r, s, g, d, e);
|
|
3903
3920
|
if (h === void 0)
|
|
3904
3921
|
return t;
|
|
3905
3922
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3921,7 +3938,7 @@ function lo(e, t) {
|
|
|
3921
3938
|
)
|
|
3922
3939
|
]);
|
|
3923
3940
|
}
|
|
3924
|
-
const
|
|
3941
|
+
const Bt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3925
3942
|
function qi(e) {
|
|
3926
3943
|
if (o.isReturnStatement(e))
|
|
3927
3944
|
return !0;
|
|
@@ -3932,7 +3949,7 @@ function qi(e) {
|
|
|
3932
3949
|
void 0
|
|
3933
3950
|
), t;
|
|
3934
3951
|
}
|
|
3935
|
-
function
|
|
3952
|
+
function po(e, t, i, s, n) {
|
|
3936
3953
|
const r = J(i);
|
|
3937
3954
|
if (r === void 0)
|
|
3938
3955
|
return;
|
|
@@ -3948,7 +3965,7 @@ function co(e, t, i, s, n) {
|
|
|
3948
3965
|
return;
|
|
3949
3966
|
}
|
|
3950
3967
|
if (!s) {
|
|
3951
|
-
const d =
|
|
3968
|
+
const d = uo(r, a, t);
|
|
3952
3969
|
if (d === void 0)
|
|
3953
3970
|
return;
|
|
3954
3971
|
a = d;
|
|
@@ -3987,7 +4004,7 @@ function J(e) {
|
|
|
3987
4004
|
}
|
|
3988
4005
|
return t;
|
|
3989
4006
|
} else {
|
|
3990
|
-
if (
|
|
4007
|
+
if (mo.has(e.kind))
|
|
3991
4008
|
return [];
|
|
3992
4009
|
{
|
|
3993
4010
|
const t = me(e);
|
|
@@ -3995,7 +4012,7 @@ function J(e) {
|
|
|
3995
4012
|
}
|
|
3996
4013
|
}
|
|
3997
4014
|
}
|
|
3998
|
-
const
|
|
4015
|
+
const mo = /* @__PURE__ */ new Set([
|
|
3999
4016
|
o.SyntaxKind.NumericLiteral,
|
|
4000
4017
|
o.SyntaxKind.BigIntLiteral,
|
|
4001
4018
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4004,12 +4021,12 @@ const po = /* @__PURE__ */ new Set([
|
|
|
4004
4021
|
o.SyntaxKind.FalseKeyword,
|
|
4005
4022
|
o.SyntaxKind.NullKeyword,
|
|
4006
4023
|
o.SyntaxKind.TrueKeyword
|
|
4007
|
-
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Vi = (e, t) => o.isObjectBindingPattern(e) ?
|
|
4008
|
-
function
|
|
4024
|
+
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Vi = (e, t) => o.isObjectBindingPattern(e) ? ho(e, t) : e;
|
|
4025
|
+
function uo(e, t, i) {
|
|
4009
4026
|
if (e.every(Ie, t))
|
|
4010
4027
|
return t;
|
|
4011
4028
|
if (o.isIdentifier(t)) {
|
|
4012
|
-
const s = o.isBlock(i.body) ? We(i.body.statements, (r) =>
|
|
4029
|
+
const s = o.isBlock(i.body) ? We(i.body.statements, (r) => fo(r, t)) : void 0;
|
|
4013
4030
|
if (s === void 0)
|
|
4014
4031
|
return;
|
|
4015
4032
|
const n = Vi(s, e);
|
|
@@ -4017,7 +4034,7 @@ function mo(e, t, i) {
|
|
|
4017
4034
|
return n;
|
|
4018
4035
|
}
|
|
4019
4036
|
}
|
|
4020
|
-
function
|
|
4037
|
+
function fo(e, t) {
|
|
4021
4038
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4022
4039
|
return;
|
|
4023
4040
|
const i = e.declarationList.declarations[0];
|
|
@@ -4025,13 +4042,13 @@ function uo(e, t) {
|
|
|
4025
4042
|
}
|
|
4026
4043
|
function Ie(e) {
|
|
4027
4044
|
const t = this;
|
|
4028
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4045
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(go, e);
|
|
4029
4046
|
}
|
|
4030
|
-
function
|
|
4047
|
+
function go(e) {
|
|
4031
4048
|
const t = this;
|
|
4032
4049
|
return o.isOmittedExpression(e) ? !1 : Ie.call(e.name, t);
|
|
4033
4050
|
}
|
|
4034
|
-
function
|
|
4051
|
+
function ho(e, t) {
|
|
4035
4052
|
let i = !1;
|
|
4036
4053
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4037
4054
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
@@ -4040,13 +4057,13 @@ const Gi = (e, t) => t.liftedKeys.has(e);
|
|
|
4040
4057
|
function H(e, t, i) {
|
|
4041
4058
|
if (de(i))
|
|
4042
4059
|
return Xi(e, i);
|
|
4043
|
-
const s = o.isCallExpression(i) ?
|
|
4060
|
+
const s = o.isCallExpression(i) ? co(e, i) : i, n = o.visitEachChild(
|
|
4044
4061
|
s,
|
|
4045
4062
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4046
4063
|
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4047
4064
|
e.transformationContext
|
|
4048
4065
|
);
|
|
4049
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || tr(i.right)) ?
|
|
4066
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || tr(i.right)) ? bo(n) : n;
|
|
4050
4067
|
}
|
|
4051
4068
|
function Xi(e, t) {
|
|
4052
4069
|
const i = Yi(e, t);
|
|
@@ -4063,14 +4080,14 @@ function Yi(e, t) {
|
|
|
4063
4080
|
const w = o.isIdentifier(r) && r.text === Js ? we(i, e) : {
|
|
4064
4081
|
// No need to wrap the function call in a lit-html tag
|
|
4065
4082
|
litTag: void 0,
|
|
4066
|
-
parts: [
|
|
4083
|
+
parts: [vo(e, t, r, i)]
|
|
4067
4084
|
};
|
|
4068
4085
|
return {
|
|
4069
|
-
key:
|
|
4086
|
+
key: yo(n, e),
|
|
4070
4087
|
...w
|
|
4071
4088
|
};
|
|
4072
4089
|
}
|
|
4073
|
-
const c = r.text === De ? Ee : r.text === Re ? ze : r.text, d = r.text === De ? ie : r.text === Re ? G : Ks.has(c) ?
|
|
4090
|
+
const c = r.text === De ? Ee : r.text === Re ? ze : r.text, d = r.text === De ? ie : r.text === Re ? G : Ks.has(c) ? ai : tt.has(c) ? Z : se, l = st(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4074
4091
|
let f;
|
|
4075
4092
|
const g = [];
|
|
4076
4093
|
let h = !1;
|
|
@@ -4083,13 +4100,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4083
4100
|
const { name: w, initializer: O } = x;
|
|
4084
4101
|
if (o.isJsxNamespacedName(w))
|
|
4085
4102
|
throw Error(`JSX namespaced attributes are not supported. Found ${w.getText(e.sourceFile)}`);
|
|
4086
|
-
const L = w.text, W =
|
|
4103
|
+
const L = w.text, W = eo(O), N = W?.propType ?? to(L, O, c);
|
|
4087
4104
|
m?.delete(L);
|
|
4088
|
-
const A =
|
|
4105
|
+
const A = Xn[N](e, W?.initializer ?? O, L, c);
|
|
4089
4106
|
if (A.length === 0)
|
|
4090
4107
|
return [];
|
|
4091
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4092
|
-
return N === "key" ? (f = typeof A[0] == "object" && !Gi(w, e) ? A[0] : void 0, B.some(
|
|
4108
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : ao(Wi(w, e));
|
|
4109
|
+
return N === "key" ? (f = typeof A[0] == "object" && !Gi(w, e) ? A[0] : void 0, B.some(ro) ? B : []) : N === "directives" || N === "ref" || L === "deferLoad" ? (h ||= N === "deferLoad", g.push(
|
|
4093
4110
|
...B,
|
|
4094
4111
|
...A.flatMap(
|
|
4095
4112
|
(F, M) => typeof F == "string" || M === 0 || typeof A[M - 1] == "string" ? F : [" ", F]
|
|
@@ -4129,12 +4146,12 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4129
4146
|
];
|
|
4130
4147
|
return { key: f, parts: T, litTag: d };
|
|
4131
4148
|
}
|
|
4132
|
-
function
|
|
4149
|
+
function yo(e, t) {
|
|
4133
4150
|
const i = e.attributes.properties[Qi(e)];
|
|
4134
4151
|
return i && o.isJsxAttribute(i) && !Gi(i.name, t) ? lt(i.initializer, t.sourceFile) : void 0;
|
|
4135
4152
|
}
|
|
4136
4153
|
const Qi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4137
|
-
function
|
|
4154
|
+
function vo(e, t, i, s) {
|
|
4138
4155
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4139
4156
|
if (o.isJsxSpreadAttribute(d))
|
|
4140
4157
|
return zi(Wi(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
@@ -4143,7 +4160,7 @@ function yo(e, t, i, s) {
|
|
|
4143
4160
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4144
4161
|
if (l.text === "key")
|
|
4145
4162
|
return;
|
|
4146
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ? Xi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f =
|
|
4163
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ? Xi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Zt(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
4147
4164
|
return o.factory.createPropertyAssignment(f, m);
|
|
4148
4165
|
}), { parts: a, litTag: c } = we(s, e);
|
|
4149
4166
|
return a.length > 0 && r.push(
|
|
@@ -4165,7 +4182,7 @@ function we(e, t) {
|
|
|
4165
4182
|
{
|
|
4166
4183
|
const r = Yi(t, n);
|
|
4167
4184
|
if (r.key === void 0 && r.litTag !== ie && r.litTag !== G) {
|
|
4168
|
-
if (r.litTag ===
|
|
4185
|
+
if (r.litTag === ai)
|
|
4169
4186
|
return r.parts;
|
|
4170
4187
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
4171
4188
|
throw new Error(
|
|
@@ -4178,7 +4195,7 @@ function we(e, t) {
|
|
|
4178
4195
|
});
|
|
4179
4196
|
return { litTag: i, parts: s };
|
|
4180
4197
|
}
|
|
4181
|
-
function
|
|
4198
|
+
function bo(e) {
|
|
4182
4199
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4183
4200
|
e,
|
|
4184
4201
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4192,7 +4209,7 @@ function dt(e, t, i) {
|
|
|
4192
4209
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4193
4210
|
return ct(s).length === 0 ? [] : [zi(s, o.factory.createIdentifier("undefined"))];
|
|
4194
4211
|
}
|
|
4195
|
-
return o.isStringLiteral(t.expression) ? [
|
|
4212
|
+
return o.isStringLiteral(t.expression) ? [oi(t.expression.text)] : (
|
|
4196
4213
|
/**
|
|
4197
4214
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
4198
4215
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4234,11 +4251,11 @@ const Zi = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), e
|
|
|
4234
4251
|
([e, t]) => t.map((i) => [i, e])
|
|
4235
4252
|
)
|
|
4236
4253
|
), ts = new Set(Object.keys(es));
|
|
4237
|
-
function
|
|
4254
|
+
function wo(e, t) {
|
|
4238
4255
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4239
4256
|
if (!o.isStringLiteral(n))
|
|
4240
4257
|
return t;
|
|
4241
|
-
const r =
|
|
4258
|
+
const r = So(e.sourceFile.fileName, n.text, ""), a = !i?.isTypeOnly;
|
|
4242
4259
|
if (a && e.existingImportedModules.add(r), sr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4243
4260
|
!n.text.includes("?")) {
|
|
4244
4261
|
if (s) {
|
|
@@ -4316,11 +4333,11 @@ function bo(e, t) {
|
|
|
4316
4333
|
}
|
|
4317
4334
|
return t;
|
|
4318
4335
|
}
|
|
4319
|
-
const is = (e, t) => e === se && ee.staticHtml.includes(t) ? ie : e === Z && ee.staticSvg.includes(t) ? G : e,
|
|
4320
|
-
function
|
|
4321
|
-
return o.isImportDeclaration(e) ?
|
|
4336
|
+
const is = (e, t) => e === se && ee.staticHtml.includes(t) ? ie : e === Z && ee.staticSvg.includes(t) ? G : e, So = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4337
|
+
function Eo(e) {
|
|
4338
|
+
return o.isImportDeclaration(e) ? Co(this, e) : e;
|
|
4322
4339
|
}
|
|
4323
|
-
function
|
|
4340
|
+
function Co(e, t) {
|
|
4324
4341
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4325
4342
|
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !ts.has(n.text))
|
|
4326
4343
|
return t;
|
|
@@ -4345,7 +4362,7 @@ function Eo(e, t) {
|
|
|
4345
4362
|
t.attributes
|
|
4346
4363
|
) : t;
|
|
4347
4364
|
}
|
|
4348
|
-
function
|
|
4365
|
+
function To(e) {
|
|
4349
4366
|
const t = Zi(
|
|
4350
4367
|
Array.from(e.neededImports, (i) => [ee[i][0], i])
|
|
4351
4368
|
);
|
|
@@ -4371,7 +4388,7 @@ function ss(e, t) {
|
|
|
4371
4388
|
o.factory.createIdentifier(s)
|
|
4372
4389
|
);
|
|
4373
4390
|
}
|
|
4374
|
-
function
|
|
4391
|
+
function $o(e) {
|
|
4375
4392
|
const t = Cr().map(({ packageName: i }) => i);
|
|
4376
4393
|
return e.existingImportedModules.forEach((i) => {
|
|
4377
4394
|
if (u.isAbsolute(i))
|
|
@@ -4385,7 +4402,7 @@ function To(e) {
|
|
|
4385
4402
|
}
|
|
4386
4403
|
}), [];
|
|
4387
4404
|
}
|
|
4388
|
-
function
|
|
4405
|
+
function Po(e) {
|
|
4389
4406
|
if (e.compiler.viteCommand === "serve")
|
|
4390
4407
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4391
4408
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4400,7 +4417,7 @@ function $o(e) {
|
|
|
4400
4417
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4401
4418
|
}), [];
|
|
4402
4419
|
}
|
|
4403
|
-
const
|
|
4420
|
+
const Io = (e, t) => {
|
|
4404
4421
|
const i = e.pragmas;
|
|
4405
4422
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4406
4423
|
return e.statements;
|
|
@@ -4420,11 +4437,11 @@ const Po = (e, t) => {
|
|
|
4420
4437
|
}
|
|
4421
4438
|
const r = {
|
|
4422
4439
|
compiler: t.compiler,
|
|
4423
|
-
externalComponents:
|
|
4440
|
+
externalComponents: vi(),
|
|
4424
4441
|
localComponents: _i(t.compiler),
|
|
4425
4442
|
sourceFile: e,
|
|
4426
4443
|
transformationContext: t.transformation,
|
|
4427
|
-
importRenames:
|
|
4444
|
+
importRenames: ko(e),
|
|
4428
4445
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4429
4446
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4430
4447
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4438,7 +4455,7 @@ const Po = (e, t) => {
|
|
|
4438
4455
|
let a = [];
|
|
4439
4456
|
if (e.statements.every((d) => {
|
|
4440
4457
|
if (o.isImportDeclaration(d)) {
|
|
4441
|
-
const l =
|
|
4458
|
+
const l = wo(r, d);
|
|
4442
4459
|
if (l === void 0)
|
|
4443
4460
|
return !0;
|
|
4444
4461
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
@@ -4448,11 +4465,11 @@ const Po = (e, t) => {
|
|
|
4448
4465
|
return !0;
|
|
4449
4466
|
}), r.hasNonLuminaJsxImport)
|
|
4450
4467
|
return e.statements;
|
|
4451
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4468
|
+
if (r.neededImports.size > 0 && (a = a.map(Eo, r), r.existingLitImports.size > 0))
|
|
4452
4469
|
throw new Error(
|
|
4453
4470
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4454
4471
|
);
|
|
4455
|
-
const c = [
|
|
4472
|
+
const c = [To, $o, Po].flatMap(
|
|
4456
4473
|
(d) => d(r)
|
|
4457
4474
|
);
|
|
4458
4475
|
if (r.neededImports.size > 0)
|
|
@@ -4461,24 +4478,24 @@ const Po = (e, t) => {
|
|
|
4461
4478
|
);
|
|
4462
4479
|
return [...c, ...a];
|
|
4463
4480
|
};
|
|
4464
|
-
function
|
|
4465
|
-
return
|
|
4481
|
+
function ko(e) {
|
|
4482
|
+
return xo(e), Object.fromEntries(
|
|
4466
4483
|
er.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4467
4484
|
);
|
|
4468
4485
|
}
|
|
4469
|
-
function
|
|
4486
|
+
function xo(e) {
|
|
4470
4487
|
if (!("identifiers" in e))
|
|
4471
4488
|
throw new Error(
|
|
4472
4489
|
"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."
|
|
4473
4490
|
);
|
|
4474
4491
|
}
|
|
4475
|
-
const
|
|
4492
|
+
const Kt = "customElement", Ao = (e, t) => {
|
|
4476
4493
|
const i = [];
|
|
4477
4494
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4478
4495
|
const a = r;
|
|
4479
4496
|
a.customElement !== void 0 && i.push(
|
|
4480
4497
|
o.factory.createExpressionStatement(
|
|
4481
|
-
o.factory.createCallExpression(o.factory.createIdentifier(
|
|
4498
|
+
o.factory.createCallExpression(o.factory.createIdentifier(Kt), void 0, [
|
|
4482
4499
|
o.factory.createStringLiteral(a.tagName ?? ""),
|
|
4483
4500
|
o.factory.createIdentifier(a.name)
|
|
4484
4501
|
])
|
|
@@ -4496,13 +4513,13 @@ const _t = "customElement", xo = (e, t) => {
|
|
|
4496
4513
|
!1,
|
|
4497
4514
|
void 0,
|
|
4498
4515
|
o.factory.createNamedImports([
|
|
4499
|
-
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(
|
|
4516
|
+
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Kt))
|
|
4500
4517
|
])
|
|
4501
4518
|
),
|
|
4502
4519
|
o.factory.createStringLiteral(s)
|
|
4503
4520
|
), ...e.statements, ...i];
|
|
4504
4521
|
};
|
|
4505
|
-
function
|
|
4522
|
+
function Lo(e, t, i) {
|
|
4506
4523
|
return t.size === 0 ? e : [
|
|
4507
4524
|
o.factory.createPropertyDeclaration(
|
|
4508
4525
|
[
|
|
@@ -4516,8 +4533,8 @@ function Ao(e, t, i) {
|
|
|
4516
4533
|
Array.from(
|
|
4517
4534
|
t.entries(),
|
|
4518
4535
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4519
|
-
|
|
4520
|
-
|
|
4536
|
+
Zt(s) ? o.factory.createStringLiteral(s) : s,
|
|
4537
|
+
No(n, i)
|
|
4521
4538
|
)
|
|
4522
4539
|
)
|
|
4523
4540
|
)
|
|
@@ -4525,7 +4542,7 @@ function Ao(e, t, i) {
|
|
|
4525
4542
|
...e
|
|
4526
4543
|
];
|
|
4527
4544
|
}
|
|
4528
|
-
function
|
|
4545
|
+
function No(e, t) {
|
|
4529
4546
|
let i = 0, s = !0;
|
|
4530
4547
|
const n = [], r = [];
|
|
4531
4548
|
for (const d of e.properties)
|
|
@@ -4570,7 +4587,7 @@ function Lo(e, t) {
|
|
|
4570
4587
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4571
4588
|
]);
|
|
4572
4589
|
}
|
|
4573
|
-
function
|
|
4590
|
+
function jo(e, t, i) {
|
|
4574
4591
|
let s = -1, n = -1, r = -1;
|
|
4575
4592
|
e.options?.properties.forEach((p, m) => {
|
|
4576
4593
|
if (o.isSpreadAssignment(p))
|
|
@@ -4582,23 +4599,23 @@ function No(e, t, i) {
|
|
|
4582
4599
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4583
4600
|
}
|
|
4584
4601
|
});
|
|
4585
|
-
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d =
|
|
4602
|
+
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = Fo(e, i, s), l = [
|
|
4586
4603
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4587
4604
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4588
4605
|
...d !== void 0 ? [d] : []
|
|
4589
4606
|
];
|
|
4590
4607
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4591
4608
|
}
|
|
4592
|
-
function
|
|
4609
|
+
function Fo(e, t, i) {
|
|
4593
4610
|
if (t.attribute === void 0)
|
|
4594
4611
|
return;
|
|
4595
|
-
const s =
|
|
4612
|
+
const s = Do(t.type.values);
|
|
4596
4613
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4597
4614
|
o.factory.createIdentifier("type"),
|
|
4598
4615
|
o.factory.createIdentifier(s)
|
|
4599
4616
|
);
|
|
4600
4617
|
}
|
|
4601
|
-
function
|
|
4618
|
+
function Do(e) {
|
|
4602
4619
|
let t = !1, i = !1, s = !1;
|
|
4603
4620
|
if (e?.forEach((n) => {
|
|
4604
4621
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4610,7 +4627,7 @@ function Fo(e) {
|
|
|
4610
4627
|
}
|
|
4611
4628
|
return "Other";
|
|
4612
4629
|
}
|
|
4613
|
-
function
|
|
4630
|
+
function Ro(e, t, i, s, n, r) {
|
|
4614
4631
|
if (i.modifiers === void 0)
|
|
4615
4632
|
return i;
|
|
4616
4633
|
let a = -1, c = -1;
|
|
@@ -4620,23 +4637,23 @@ function Do(e, t, i, s, n, r) {
|
|
|
4620
4637
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4621
4638
|
}
|
|
4622
4639
|
}), a !== -1) {
|
|
4623
|
-
const d =
|
|
4624
|
-
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p,
|
|
4640
|
+
const d = Oo(e, t, i, s, n), l = _t(i, a, n), p = jo(l, n, d);
|
|
4641
|
+
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Ut(i, a);
|
|
4625
4642
|
} else if (c !== -1) {
|
|
4626
|
-
const d =
|
|
4643
|
+
const d = _t(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m = ei(i.name);
|
|
4627
4644
|
if (m === void 0)
|
|
4628
4645
|
throw new Error("Failed to statically determine the state property name");
|
|
4629
|
-
return r.set(m, p),
|
|
4646
|
+
return r.set(m, p), Ut(i, c);
|
|
4630
4647
|
} else
|
|
4631
4648
|
return i;
|
|
4632
4649
|
}
|
|
4633
|
-
function
|
|
4650
|
+
function Oo(e, t, i, s, n) {
|
|
4634
4651
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4635
4652
|
members: []
|
|
4636
4653
|
} : void 0);
|
|
4637
4654
|
if (r === void 0)
|
|
4638
4655
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4639
|
-
const a =
|
|
4656
|
+
const a = ei(i.name);
|
|
4640
4657
|
let c;
|
|
4641
4658
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4642
4659
|
const l = r.members[d];
|
|
@@ -4651,11 +4668,11 @@ function Ro(e, t, i, s, n) {
|
|
|
4651
4668
|
throw Error(
|
|
4652
4669
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4653
4670
|
);
|
|
4654
|
-
c.name = a, c.attribute ??=
|
|
4671
|
+
c.name = a, c.attribute ??= qt(a);
|
|
4655
4672
|
}
|
|
4656
4673
|
return c;
|
|
4657
4674
|
}
|
|
4658
|
-
function
|
|
4675
|
+
function _t(e, t, i) {
|
|
4659
4676
|
const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
|
|
4660
4677
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4661
4678
|
throw new Error(
|
|
@@ -4663,7 +4680,7 @@ function Ut(e, t, i) {
|
|
|
4663
4680
|
);
|
|
4664
4681
|
return { decorator: s, callExpression: n, options: r };
|
|
4665
4682
|
}
|
|
4666
|
-
function
|
|
4683
|
+
function Ut(e, t) {
|
|
4667
4684
|
const i = [
|
|
4668
4685
|
...e.modifiers.slice(0, t),
|
|
4669
4686
|
...e.modifiers.slice(t + 1)
|
|
@@ -4690,7 +4707,7 @@ function Wt(e, t) {
|
|
|
4690
4707
|
e.initializer
|
|
4691
4708
|
);
|
|
4692
4709
|
}
|
|
4693
|
-
function
|
|
4710
|
+
function Mo(e, t, i, s) {
|
|
4694
4711
|
let n;
|
|
4695
4712
|
if (e.apiJsonEnabled)
|
|
4696
4713
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4713,9 +4730,9 @@ function Oo(e, t, i, s) {
|
|
|
4713
4730
|
} finally {
|
|
4714
4731
|
c = i.statements, i.statements = a;
|
|
4715
4732
|
}
|
|
4716
|
-
return
|
|
4733
|
+
return Jo(i, c);
|
|
4717
4734
|
}
|
|
4718
|
-
const
|
|
4735
|
+
const Jo = (e, t) => o.factory.updateSourceFile(
|
|
4719
4736
|
e,
|
|
4720
4737
|
t,
|
|
4721
4738
|
/*
|
|
@@ -4730,10 +4747,10 @@ const Mo = (e, t) => o.factory.updateSourceFile(
|
|
|
4730
4747
|
e.hasNoDefaultLib,
|
|
4731
4748
|
e.libReferenceDirectives
|
|
4732
4749
|
);
|
|
4733
|
-
function
|
|
4750
|
+
function Bo(e, t) {
|
|
4734
4751
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4735
4752
|
}
|
|
4736
|
-
const
|
|
4753
|
+
const Ko = (e, t) => {
|
|
4737
4754
|
let i;
|
|
4738
4755
|
if (t.apiModule !== void 0)
|
|
4739
4756
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4749,16 +4766,16 @@ const Bo = (e, t) => {
|
|
|
4749
4766
|
function n() {
|
|
4750
4767
|
s = /* @__PURE__ */ new Map();
|
|
4751
4768
|
}
|
|
4752
|
-
const r = (d) =>
|
|
4769
|
+
const r = (d) => Lo(d, s, t.compiler.shouldMinify);
|
|
4753
4770
|
function a(d, l) {
|
|
4754
|
-
const p =
|
|
4755
|
-
return
|
|
4771
|
+
const p = Uo(t, i, d, l, e, s);
|
|
4772
|
+
return Bo(p, t), p;
|
|
4756
4773
|
}
|
|
4757
4774
|
return e.statements.map(
|
|
4758
4775
|
(d) => rs(a, d, t, n, r)
|
|
4759
4776
|
);
|
|
4760
4777
|
};
|
|
4761
|
-
function rs(e, t, i, s, n =
|
|
4778
|
+
function rs(e, t, i, s, n = ti) {
|
|
4762
4779
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4763
4780
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4764
4781
|
let r = !1;
|
|
@@ -4785,11 +4802,11 @@ function rs(e, t, i, s, n = ii) {
|
|
|
4785
4802
|
i.transformation
|
|
4786
4803
|
) : t;
|
|
4787
4804
|
}
|
|
4788
|
-
const
|
|
4789
|
-
function
|
|
4805
|
+
const _o = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4806
|
+
function Uo(e, t, i, s, n, r) {
|
|
4790
4807
|
if (o.isMethodDeclaration(i)) {
|
|
4791
4808
|
const a = i.modifiers?.filter(
|
|
4792
|
-
(c) => !o.isDecorator(c) || !
|
|
4809
|
+
(c) => !o.isDecorator(c) || !Wo(c)
|
|
4793
4810
|
);
|
|
4794
4811
|
if (a?.length !== i.modifiers?.length)
|
|
4795
4812
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4803,7 +4820,7 @@ function _o(e, t, i, s, n, r) {
|
|
|
4803
4820
|
i.type,
|
|
4804
4821
|
i.body
|
|
4805
4822
|
);
|
|
4806
|
-
if ("text" in i.name &&
|
|
4823
|
+
if ("text" in i.name && _o.has(i.name.text) && i.body) {
|
|
4807
4824
|
const c = i.name.text;
|
|
4808
4825
|
return i.body.statements.some(
|
|
4809
4826
|
(l) => o.isExpressionStatement(l) && o.isCallExpression(l.expression) && o.isPropertyAccessExpression(l.expression.expression) && l.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && l.expression.expression.name.text === c
|
|
@@ -4829,14 +4846,14 @@ function _o(e, t, i, s, n, r) {
|
|
|
4829
4846
|
);
|
|
4830
4847
|
}
|
|
4831
4848
|
}
|
|
4832
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
4833
|
-
}
|
|
4834
|
-
const
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
],
|
|
4839
|
-
name:
|
|
4849
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Ro(e, t, i, s, n, r) : i;
|
|
4850
|
+
}
|
|
4851
|
+
const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", zo = [
|
|
4852
|
+
Io,
|
|
4853
|
+
Ao,
|
|
4854
|
+
Ko
|
|
4855
|
+
], Ho = "@arcgis/lumina:transformComponents", qo = (e) => ({
|
|
4856
|
+
name: Ho,
|
|
4840
4857
|
transform: {
|
|
4841
4858
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4842
4859
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -4853,11 +4870,11 @@ const Uo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4853
4870
|
e.apiJsonDeferred === void 0 ? [te] : [te, e.apiJsonDeferred.promise]
|
|
4854
4871
|
);
|
|
4855
4872
|
const s = e.getSourceFile(i, t), r = o.transform(s, [
|
|
4856
|
-
(m) => () =>
|
|
4873
|
+
(m) => () => Mo(e, m, s, [
|
|
4857
4874
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4858
|
-
...
|
|
4875
|
+
...zo
|
|
4859
4876
|
])
|
|
4860
|
-
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : ht.createSourceMapGenerator(
|
|
4877
|
+
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : ht.createSourceMapGenerator(Vo, u.basename(i), "", u.dirname(i), {}), d = ht.createTextWriter(`
|
|
4861
4878
|
`);
|
|
4862
4879
|
a.writeFile(r, d, c);
|
|
4863
4880
|
const l = d.getText(), p = c?.toJSON();
|
|
@@ -4867,42 +4884,42 @@ const Uo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4867
4884
|
};
|
|
4868
4885
|
}
|
|
4869
4886
|
}
|
|
4870
|
-
}),
|
|
4887
|
+
}), Vo = {
|
|
4871
4888
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
4872
|
-
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ?
|
|
4873
|
-
},
|
|
4889
|
+
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ti : (e) => e.toLowerCase()
|
|
4890
|
+
}, Go = (e) => ({
|
|
4874
4891
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
4875
4892
|
configureServer(t) {
|
|
4876
|
-
e.server = t,
|
|
4893
|
+
e.server = t, Wt(e).forEach(({ assets: i, transformers: s }) => ce(e, i, s));
|
|
4877
4894
|
},
|
|
4878
4895
|
async writeBundle() {
|
|
4879
4896
|
await Promise.all(
|
|
4880
|
-
|
|
4897
|
+
Wt(e).map(
|
|
4881
4898
|
async ({ assets: t, transformers: i }) => await Ni(e, t, i)
|
|
4882
4899
|
)
|
|
4883
4900
|
);
|
|
4884
4901
|
}
|
|
4885
4902
|
});
|
|
4886
|
-
function
|
|
4903
|
+
function Wt(e) {
|
|
4887
4904
|
const t = [], i = e.assetsToProvide?.filter((s) => s.apply === void 0 || s.apply === e.viteCommand) ?? [];
|
|
4888
4905
|
return e.options.assets?.extra?.forEach((s) => {
|
|
4889
4906
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
4890
4907
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
4891
4908
|
}
|
|
4892
|
-
const Ze = "@arcgis/lumina:updatePackageJson",
|
|
4909
|
+
const Ze = "@arcgis/lumina:updatePackageJson", Xo = (e) => ({
|
|
4893
4910
|
name: Ze,
|
|
4894
4911
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
4895
4912
|
configResolved() {
|
|
4896
|
-
|
|
4913
|
+
Yo(e).catch(
|
|
4897
4914
|
(t) => $.error(Ze, `Failed to update package's package.json:${String(t)}`)
|
|
4898
4915
|
);
|
|
4899
4916
|
}
|
|
4900
4917
|
});
|
|
4901
|
-
async function
|
|
4902
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s =
|
|
4903
|
-
s &&
|
|
4918
|
+
async function Yo(e) {
|
|
4919
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = Qo(i, e);
|
|
4920
|
+
s && Qt(t, JSON.stringify(s, null, 2));
|
|
4904
4921
|
}
|
|
4905
|
-
function
|
|
4922
|
+
function Qo(e, t) {
|
|
4906
4923
|
const i = e?.devDependencies ?? {};
|
|
4907
4924
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
4908
4925
|
l in i || $.warn(
|
|
@@ -4941,21 +4958,21 @@ function Yo(e, t) {
|
|
|
4941
4958
|
if (s)
|
|
4942
4959
|
return e;
|
|
4943
4960
|
}
|
|
4944
|
-
const
|
|
4961
|
+
const Zo = (e) => ({
|
|
4945
4962
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
4946
4963
|
timestamp: e.apiJson.timestamp,
|
|
4947
4964
|
compiler: e.apiJson.compiler,
|
|
4948
|
-
components:
|
|
4965
|
+
components: ea(e),
|
|
4949
4966
|
typeLibrary: {}
|
|
4950
4967
|
});
|
|
4951
|
-
function
|
|
4968
|
+
function ea(e) {
|
|
4952
4969
|
const t = [];
|
|
4953
4970
|
for (const i of e.apiJson.modules)
|
|
4954
4971
|
for (const s of i.declarations)
|
|
4955
|
-
s.customElement === !0 && t.push(
|
|
4972
|
+
s.customElement === !0 && t.push(ta(s, i.sourcePath));
|
|
4956
4973
|
return t;
|
|
4957
4974
|
}
|
|
4958
|
-
function
|
|
4975
|
+
function ta(e, t) {
|
|
4959
4976
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
4960
4977
|
return {
|
|
4961
4978
|
filePath: t,
|
|
@@ -4970,9 +4987,9 @@ function ea(e, t) {
|
|
|
4970
4987
|
dependencies: [],
|
|
4971
4988
|
dependencyGraph: {},
|
|
4972
4989
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
4973
|
-
props: e.members.map(
|
|
4974
|
-
methods: e.members.map(
|
|
4975
|
-
events: e.events?.map(
|
|
4990
|
+
props: e.members.map(ia).filter(j),
|
|
4991
|
+
methods: e.members.map(sa).filter(j),
|
|
4992
|
+
events: e.events?.map(ra) ?? [],
|
|
4976
4993
|
styles: e.cssProperties?.map((s) => ({
|
|
4977
4994
|
name: s.name,
|
|
4978
4995
|
annotation: "prop",
|
|
@@ -4984,7 +5001,7 @@ function ea(e, t) {
|
|
|
4984
5001
|
listeners: []
|
|
4985
5002
|
};
|
|
4986
5003
|
}
|
|
4987
|
-
function
|
|
5004
|
+
function ia(e) {
|
|
4988
5005
|
if (e.kind !== "field")
|
|
4989
5006
|
return;
|
|
4990
5007
|
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;
|
|
@@ -5025,7 +5042,7 @@ const pt = (e) => Object.fromEntries(
|
|
|
5025
5042
|
]
|
|
5026
5043
|
) ?? []
|
|
5027
5044
|
);
|
|
5028
|
-
function
|
|
5045
|
+
function sa(e) {
|
|
5029
5046
|
if (e.kind !== "method")
|
|
5030
5047
|
return;
|
|
5031
5048
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5056,7 +5073,7 @@ function ia(e) {
|
|
|
5056
5073
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5057
5074
|
};
|
|
5058
5075
|
}
|
|
5059
|
-
function
|
|
5076
|
+
function ra(e) {
|
|
5060
5077
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5061
5078
|
return {
|
|
5062
5079
|
event: e.name,
|
|
@@ -5085,7 +5102,7 @@ const ns = (e) => e.flatMap(
|
|
|
5085
5102
|
description: i.description || void 0
|
|
5086
5103
|
})) ?? []
|
|
5087
5104
|
);
|
|
5088
|
-
function
|
|
5105
|
+
function na(e) {
|
|
5089
5106
|
if (e.attributes === void 0)
|
|
5090
5107
|
return [];
|
|
5091
5108
|
const t = [];
|
|
@@ -5096,7 +5113,7 @@ function ra(e) {
|
|
|
5096
5113
|
description: Ne(s.description, s.deprecated) || void 0,
|
|
5097
5114
|
default: s.default,
|
|
5098
5115
|
value: {
|
|
5099
|
-
type:
|
|
5116
|
+
type: oa(
|
|
5100
5117
|
s.type.values?.map(
|
|
5101
5118
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5102
5119
|
)
|
|
@@ -5106,7 +5123,7 @@ function ra(e) {
|
|
|
5106
5123
|
}
|
|
5107
5124
|
return t;
|
|
5108
5125
|
}
|
|
5109
|
-
const
|
|
5126
|
+
const oa = (e) => e?.length === 1 ? e[0] : e, Ne = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, fe = {
|
|
5110
5127
|
slots: "Slots",
|
|
5111
5128
|
events: "Events",
|
|
5112
5129
|
cssProperties: "CSS Properties",
|
|
@@ -5114,7 +5131,7 @@ const na = (e) => e?.length === 1 ? e[0] : e, Ne = (e = "", t = !1) => t === !1
|
|
|
5114
5131
|
methods: "Methods"
|
|
5115
5132
|
};
|
|
5116
5133
|
function as(e) {
|
|
5117
|
-
const t =
|
|
5134
|
+
const t = aa(e.slots), i = la(e.events), s = ca(e.cssProperties), n = da(e.cssParts), r = pa(e.members), a = Ne(e.description, e.deprecated).trim();
|
|
5118
5135
|
return [...a ? [`${a}
|
|
5119
5136
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5120
5137
|
|
|
@@ -5122,28 +5139,28 @@ function as(e) {
|
|
|
5122
5139
|
}
|
|
5123
5140
|
const ge = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5124
5141
|
${t.join(`
|
|
5125
|
-
`)}`,
|
|
5142
|
+
`)}`, aa = (e) => ge(
|
|
5126
5143
|
fe.slots,
|
|
5127
5144
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
5128
|
-
),
|
|
5145
|
+
), la = (e) => ge(
|
|
5129
5146
|
fe.events,
|
|
5130
5147
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
5131
|
-
),
|
|
5148
|
+
), ca = (e = []) => ge(
|
|
5132
5149
|
fe.cssProperties,
|
|
5133
5150
|
e?.map(
|
|
5134
5151
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5135
5152
|
)
|
|
5136
|
-
),
|
|
5153
|
+
), da = (e) => ge(
|
|
5137
5154
|
fe.cssParts,
|
|
5138
5155
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
5139
|
-
),
|
|
5156
|
+
), pa = (e) => ge(
|
|
5140
5157
|
fe.methods,
|
|
5141
5158
|
e.filter(Es).map(
|
|
5142
5159
|
(t) => [`- \`${t.name}${t.signature}\``, Ne(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
5143
5160
|
)
|
|
5144
5161
|
);
|
|
5145
|
-
function
|
|
5146
|
-
const i =
|
|
5162
|
+
function ma(e, t) {
|
|
5163
|
+
const i = ua(e), s = ns(e), n = os(e), r = R();
|
|
5147
5164
|
return {
|
|
5148
5165
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5149
5166
|
name: r.name,
|
|
@@ -5161,57 +5178,57 @@ function pa(e, t) {
|
|
|
5161
5178
|
}
|
|
5162
5179
|
};
|
|
5163
5180
|
}
|
|
5164
|
-
const
|
|
5181
|
+
const ua = (e) => e.map((t) => ({
|
|
5165
5182
|
name: t.tagName,
|
|
5166
5183
|
description: as(t),
|
|
5167
5184
|
"doc-url": t.demos?.[0]?.url,
|
|
5168
|
-
attributes:
|
|
5185
|
+
attributes: na(t),
|
|
5169
5186
|
slots: t.slots?.map((i) => ({
|
|
5170
5187
|
name: i.name,
|
|
5171
5188
|
description: i.description
|
|
5172
5189
|
})),
|
|
5173
5190
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5174
|
-
events:
|
|
5191
|
+
events: zt(t),
|
|
5175
5192
|
js: {
|
|
5176
|
-
properties:
|
|
5177
|
-
events:
|
|
5193
|
+
properties: fa(t),
|
|
5194
|
+
events: zt(t)
|
|
5178
5195
|
}
|
|
5179
|
-
})),
|
|
5196
|
+
})), fa = (e) => e.members.filter(Cs).map((t) => ({
|
|
5180
5197
|
name: t.name,
|
|
5181
5198
|
description: t.description,
|
|
5182
5199
|
type: t.type?.text
|
|
5183
|
-
})) ?? [],
|
|
5200
|
+
})) ?? [], zt = (e) => e.events?.map((t) => ({
|
|
5184
5201
|
name: t.name,
|
|
5185
5202
|
type: t.type?.text,
|
|
5186
5203
|
description: t.description
|
|
5187
|
-
})) ?? [],
|
|
5204
|
+
})) ?? [], ga = (e) => e.map((t) => ({
|
|
5188
5205
|
name: t.tagName,
|
|
5189
5206
|
description: as(t),
|
|
5190
|
-
attributes:
|
|
5207
|
+
attributes: ha(t),
|
|
5191
5208
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5192
|
-
})),
|
|
5209
|
+
})), ha = (e) => e.attributes?.map((t) => ({
|
|
5193
5210
|
name: t.name,
|
|
5194
5211
|
description: Ne(t.description, t.deprecated) || void 0,
|
|
5195
|
-
values:
|
|
5196
|
-
})) ?? [],
|
|
5212
|
+
values: ya(t)
|
|
5213
|
+
})) ?? [], ya = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], va = (e) => ({
|
|
5197
5214
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5198
5215
|
version: 1.1,
|
|
5199
|
-
tags:
|
|
5200
|
-
}),
|
|
5216
|
+
tags: ga(e)
|
|
5217
|
+
}), ba = (e) => ({
|
|
5201
5218
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5202
5219
|
version: 1.1,
|
|
5203
5220
|
properties: ns(e),
|
|
5204
5221
|
pseudoElements: os(e)
|
|
5205
|
-
}),
|
|
5206
|
-
function
|
|
5222
|
+
}), wa = "@arcgis/lumina:generateDocs";
|
|
5223
|
+
function Sa(e) {
|
|
5207
5224
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5208
5225
|
{
|
|
5209
5226
|
type: "dynamic",
|
|
5210
|
-
source: () => JSON.stringify(
|
|
5227
|
+
source: () => JSON.stringify(Zo(e), null, Qe(e)),
|
|
5211
5228
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5212
5229
|
}
|
|
5213
5230
|
]), {
|
|
5214
|
-
name:
|
|
5231
|
+
name: wa,
|
|
5215
5232
|
async writeBundle() {
|
|
5216
5233
|
if (e.isInStorybook)
|
|
5217
5234
|
return;
|
|
@@ -5221,51 +5238,51 @@ function wa(e) {
|
|
|
5221
5238
|
await Oi(c);
|
|
5222
5239
|
const d = [];
|
|
5223
5240
|
if (n !== void 0) {
|
|
5224
|
-
const l = JSON.stringify(
|
|
5241
|
+
const l = JSON.stringify(va(e.apiJsonComponents), null, t);
|
|
5225
5242
|
d.push(_(n, l));
|
|
5226
5243
|
}
|
|
5227
5244
|
if (r !== void 0) {
|
|
5228
|
-
const l = JSON.stringify(
|
|
5245
|
+
const l = JSON.stringify(ba(e.apiJsonComponents), null, t);
|
|
5229
5246
|
d.push(_(r, l));
|
|
5230
5247
|
}
|
|
5231
5248
|
if (a !== void 0) {
|
|
5232
|
-
const l =
|
|
5249
|
+
const l = ma(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5233
5250
|
d.push(_(a, JSON.stringify(l, null, t)));
|
|
5234
5251
|
}
|
|
5235
5252
|
await Promise.all(d);
|
|
5236
5253
|
}
|
|
5237
5254
|
};
|
|
5238
5255
|
}
|
|
5239
|
-
function
|
|
5256
|
+
function Ea(e) {
|
|
5240
5257
|
return {
|
|
5241
5258
|
name: "@arcgis/lumina:buildWrappers",
|
|
5242
5259
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5243
5260
|
async writeBundle() {
|
|
5244
5261
|
e.isInStorybook || await Promise.all(
|
|
5245
5262
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5246
|
-
t.type === "react18" && await
|
|
5263
|
+
t.type === "react18" && await $a(e, t);
|
|
5247
5264
|
}) ?? []
|
|
5248
5265
|
);
|
|
5249
5266
|
}
|
|
5250
5267
|
};
|
|
5251
5268
|
}
|
|
5252
|
-
const
|
|
5253
|
-
import React from "${
|
|
5254
|
-
import { createComponent } from "${
|
|
5255
|
-
import type { EventName } from "${
|
|
5269
|
+
const Ca = "react", Ht = "@lit/react", Ta = `
|
|
5270
|
+
import React from "${Ca}";
|
|
5271
|
+
import { createComponent } from "${Ht}";
|
|
5272
|
+
import type { EventName } from "${Ht}";
|
|
5256
5273
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5257
5274
|
|
|
5258
5275
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5259
5276
|
`;
|
|
5260
|
-
async function
|
|
5277
|
+
async function $a(e, t) {
|
|
5261
5278
|
const { name: i } = R(), s = [];
|
|
5262
5279
|
for (const a of e.apiJson.modules)
|
|
5263
5280
|
for (const c of a.declarations)
|
|
5264
|
-
c.customElement === !0 && s.push(
|
|
5265
|
-
const n = [`/// <reference types="${i}" preserve="true" />`,
|
|
5281
|
+
c.customElement === !0 && s.push(Pa(c));
|
|
5282
|
+
const n = [`/// <reference types="${i}" preserve="true" />`, Ta, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5266
5283
|
await V(u.dirname(r), { recursive: !0 }), await _(r, n);
|
|
5267
5284
|
}
|
|
5268
|
-
function
|
|
5285
|
+
function Pa(e) {
|
|
5269
5286
|
const t = e.events?.map(
|
|
5270
5287
|
(i) => ` ${Rs(`on${ds(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5271
5288
|
).join(`
|
|
@@ -5282,41 +5299,41 @@ ${t}
|
|
|
5282
5299
|
);
|
|
5283
5300
|
`;
|
|
5284
5301
|
}
|
|
5285
|
-
function
|
|
5302
|
+
function el(e = {}) {
|
|
5286
5303
|
const t = new P(e), s = [
|
|
5287
5304
|
t._plugin,
|
|
5288
|
-
xn(t),
|
|
5289
5305
|
An(t),
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5306
|
+
Ln(t),
|
|
5307
|
+
Xo(t),
|
|
5308
|
+
vn(t),
|
|
5309
|
+
Sa(t),
|
|
5310
|
+
qo(t),
|
|
5311
|
+
zn(t),
|
|
5295
5312
|
rr(t),
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5313
|
+
Cn(t),
|
|
5314
|
+
Go(t),
|
|
5315
|
+
qn(t),
|
|
5316
|
+
Rn(t),
|
|
5300
5317
|
Ms(t),
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5318
|
+
Hr(t),
|
|
5319
|
+
Ea(t),
|
|
5320
|
+
Tn(t)
|
|
5304
5321
|
].filter(j);
|
|
5305
5322
|
return s.context = t, s;
|
|
5306
5323
|
}
|
|
5307
|
-
const
|
|
5308
|
-
initializeComponentDependencies:
|
|
5324
|
+
const tl = {
|
|
5325
|
+
initializeComponentDependencies: yi,
|
|
5309
5326
|
updateLuminaTs: Bi,
|
|
5310
5327
|
propertyToAttributeMappings: U,
|
|
5311
|
-
nativeEvents:
|
|
5328
|
+
nativeEvents: ni,
|
|
5312
5329
|
svgElements: tt,
|
|
5313
5330
|
mathMlElements: it,
|
|
5314
|
-
alwaysAttributes:
|
|
5315
|
-
nativeAlwaysAttributes:
|
|
5331
|
+
alwaysAttributes: ii,
|
|
5332
|
+
nativeAlwaysAttributes: si,
|
|
5316
5333
|
htmlAlwaysAttributes: He
|
|
5317
5334
|
};
|
|
5318
5335
|
export {
|
|
5319
|
-
|
|
5336
|
+
tl as exportsForCodemod,
|
|
5320
5337
|
Ae as inferCdnUrl,
|
|
5321
|
-
|
|
5338
|
+
el as useLumina
|
|
5322
5339
|
};
|