@arcgis/lumina-compiler 5.1.0-next.77 → 5.1.0-next.78
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 +351 -350
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -11,17 +11,18 @@ import { glob as xs } from "tinyglobby";
|
|
|
11
11
|
import { renameComponentFolder as We } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
12
12
|
import { useApiExtractor as As } from "@arcgis/api-extractor/vite/plugin";
|
|
13
13
|
import Ns from "mime-types";
|
|
14
|
+
import { forEachWithConcurrency as Ls } from "@arcgis/toolkit/promise";
|
|
14
15
|
import { writeFileSync as ei } from "node:fs";
|
|
15
|
-
import
|
|
16
|
-
import { unsafeGetUndocumentedPrinter as
|
|
16
|
+
import js from "chalk";
|
|
17
|
+
import { unsafeGetUndocumentedPrinter as Fs, unsafeUndocumentedTs as yt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
17
18
|
import { pathIsComponentEntrypoint as Ee } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
18
|
-
import { loadApiExtractorConfig as
|
|
19
|
-
import { loadTypeScriptConfig as
|
|
19
|
+
import { loadApiExtractorConfig as Ds, mergeApiExtractorConfigs as vt } from "@arcgis/api-extractor/extractor/config";
|
|
20
|
+
import { loadTypeScriptConfig as Rs } from "@arcgis/api-extractor/vite/typeScript";
|
|
20
21
|
import { mappedFind as ze } from "@arcgis/toolkit/array";
|
|
21
|
-
import { isPropertyEscapeNeeded as ti, maybeEscapePropertyName as
|
|
22
|
-
import { getPackageNameFromExternalSpecifier as
|
|
22
|
+
import { isPropertyEscapeNeeded as ti, maybeEscapePropertyName as Os } from "@arcgis/api-extractor/utils/partPrinter";
|
|
23
|
+
import { getPackageNameFromExternalSpecifier as Ms, getMemberName as ii } from "@arcgis/api-extractor/utils/astHelpers";
|
|
23
24
|
import { identity as si } from "@arcgis/toolkit/function";
|
|
24
|
-
function
|
|
25
|
+
function Js(e) {
|
|
25
26
|
const t = e.options?.build?.dependencies ?? {}, i = cs({
|
|
26
27
|
bundleIn: t.bundleIn,
|
|
27
28
|
externalize: [
|
|
@@ -38,7 +39,7 @@ function Ms(e) {
|
|
|
38
39
|
e.isInStorybook && (i.resolveId = void 0);
|
|
39
40
|
}, i;
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
+
const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ce = /* @__PURE__ */ Symbol("dynamic html tag name"), He = /* @__PURE__ */ Symbol("dynamic svg tag name"), ri = /* @__PURE__ */ new Set([
|
|
42
43
|
/**
|
|
43
44
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
44
45
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -1019,7 +1020,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set(
|
|
|
1019
1020
|
"volumeChange",
|
|
1020
1021
|
"waiting",
|
|
1021
1022
|
"wheel"
|
|
1022
|
-
]),
|
|
1023
|
+
]), Ks = /* @__PURE__ */ new Set([
|
|
1023
1024
|
"area",
|
|
1024
1025
|
"base",
|
|
1025
1026
|
"br",
|
|
@@ -1095,7 +1096,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set(
|
|
|
1095
1096
|
"tspan",
|
|
1096
1097
|
"use",
|
|
1097
1098
|
"view"
|
|
1098
|
-
]),
|
|
1099
|
+
]), _s = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), st = /* @__PURE__ */ new Set([
|
|
1099
1100
|
"annotation-xml",
|
|
1100
1101
|
"annotation",
|
|
1101
1102
|
"maction",
|
|
@@ -1127,7 +1128,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set(
|
|
|
1127
1128
|
"munder",
|
|
1128
1129
|
"munderover",
|
|
1129
1130
|
"semantics"
|
|
1130
|
-
]),
|
|
1131
|
+
]), Us = /* @__PURE__ */ new Set([
|
|
1131
1132
|
"annotation-xml",
|
|
1132
1133
|
"color-profile",
|
|
1133
1134
|
"font-face",
|
|
@@ -1137,7 +1138,7 @@ const bt = /* @__PURE__ */ new Set(["itemScope"]), ai = /* @__PURE__ */ new Set(
|
|
|
1137
1138
|
"font-face-name",
|
|
1138
1139
|
"missing-glyph"
|
|
1139
1140
|
]);
|
|
1140
|
-
function
|
|
1141
|
+
function Ws(e) {
|
|
1141
1142
|
if (e.length === 0)
|
|
1142
1143
|
return "";
|
|
1143
1144
|
const t = e[0];
|
|
@@ -1150,11 +1151,11 @@ function Us(e) {
|
|
|
1150
1151
|
}
|
|
1151
1152
|
return e.trim().length === 0 ? t : e;
|
|
1152
1153
|
}
|
|
1153
|
-
const
|
|
1154
|
+
const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`", "\\`"), Hs = /\$\{/gu, qs = (e) => !Vs.test(e), Vs = /^[^\s"'=<>`]+$/u, Gs = /[&<>]/gu, Xs = {
|
|
1154
1155
|
"&": "&",
|
|
1155
1156
|
"<": "<",
|
|
1156
1157
|
">": ">"
|
|
1157
|
-
}, li = (e) => e.replace(
|
|
1158
|
+
}, li = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], se = "staticHtml", X = "staticSvg", re = "html", ee = "svg", ci = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), di = "css", pi = "mathml", ui = [di, re, pi, se, X, ee], Qs = new Set(ui), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...ui, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => pe(t)), pe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
|
|
1158
1159
|
[re]: ["lit", "lit/html.js", "lit-html"],
|
|
1159
1160
|
/**
|
|
1160
1161
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1176,7 +1177,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1176
1177
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1177
1178
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1178
1179
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1179
|
-
},
|
|
1180
|
+
}, sr = /* @__PURE__ */ new Set([
|
|
1180
1181
|
"h",
|
|
1181
1182
|
"Fragment",
|
|
1182
1183
|
"state",
|
|
@@ -1186,7 +1187,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1186
1187
|
"bindProperty",
|
|
1187
1188
|
"bindEvent",
|
|
1188
1189
|
"bindAttribute"
|
|
1189
|
-
]),
|
|
1190
|
+
]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", Te = "?litCss", Y = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
|
|
1190
1191
|
name: oe,
|
|
1191
1192
|
enforce: "pre",
|
|
1192
1193
|
configResolved(t) {
|
|
@@ -1226,14 +1227,14 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1226
1227
|
if (l && (a = a.slice(0, -Ve.length)), !c && !d && !l)
|
|
1227
1228
|
return await s.handler.call(this, n, a);
|
|
1228
1229
|
const p = `${a}?inline`, u = await s.handler.call(this, n, p), { code: f, ...g } = typeof u == "string" ? { code: u } : u ?? {};
|
|
1229
|
-
return typeof f != "string" || !f.startsWith(mi) || !f.endsWith(
|
|
1230
|
+
return typeof f != "string" || !f.startsWith(mi) || !f.endsWith(or) ? (E.warn(
|
|
1230
1231
|
oe,
|
|
1231
1232
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1232
1233
|
f
|
|
1233
1234
|
)}`
|
|
1234
1235
|
), u) : l ? (e._globalCssString = fi(f), { code: "", map: { mappings: "" } }) : {
|
|
1235
1236
|
...g,
|
|
1236
|
-
code:
|
|
1237
|
+
code: dr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1237
1238
|
/**
|
|
1238
1239
|
* Vite's original transform does not generate source maps for inlined
|
|
1239
1240
|
* css, thus we can't either
|
|
@@ -1243,8 +1244,8 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1243
1244
|
}
|
|
1244
1245
|
};
|
|
1245
1246
|
}
|
|
1246
|
-
}), mi = 'export default "',
|
|
1247
|
-
export const styles = css\``,
|
|
1247
|
+
}), mi = 'export default "', or = '"', ar = `import { css } from '${te.css[0]}';
|
|
1248
|
+
export const styles = css\``, lr = "`;\nexport default styles;", cr = `
|
|
1248
1249
|
|
|
1249
1250
|
if(import.meta.hot) {
|
|
1250
1251
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1256,23 +1257,23 @@ if(import.meta.hot) {
|
|
|
1256
1257
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1257
1258
|
});
|
|
1258
1259
|
}`, fi = (e) => e.slice(mi.length - 1);
|
|
1259
|
-
function
|
|
1260
|
-
const r = fi(e), n = JSON.parse(r), a =
|
|
1260
|
+
function dr(e, t, i, s) {
|
|
1261
|
+
const r = fi(e), n = JSON.parse(r), a = zs(n), c = s ? `@layer{${i ? "" : `
|
|
1261
1262
|
`}${a}${i ? "" : `
|
|
1262
1263
|
`}}` : a;
|
|
1263
|
-
return `${
|
|
1264
|
+
return `${ar}${c}${lr}${t ? cr : ""}`;
|
|
1264
1265
|
}
|
|
1265
|
-
function
|
|
1266
|
-
return `import("${
|
|
1267
|
-
setCustomElementsManifest(${
|
|
1266
|
+
function pr(e) {
|
|
1267
|
+
return `import("${ur}").then(({ setCustomElementsManifest }) => {
|
|
1268
|
+
setCustomElementsManifest(${mr(e)});
|
|
1268
1269
|
});`;
|
|
1269
1270
|
}
|
|
1270
|
-
const
|
|
1271
|
-
function
|
|
1271
|
+
const ur = "@storybook/web-components", mr = (e) => `JSON.parse(\`${fr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1272
|
+
function fr(e) {
|
|
1272
1273
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1273
1274
|
}
|
|
1274
|
-
function
|
|
1275
|
-
|
|
1275
|
+
function gr(e) {
|
|
1276
|
+
hr(e);
|
|
1276
1277
|
const t = e.options.css?.globalStylesPath;
|
|
1277
1278
|
if (t === void 0)
|
|
1278
1279
|
return "";
|
|
@@ -1285,7 +1286,7 @@ function fr(e) {
|
|
|
1285
1286
|
`) : `import "${i}${Ve}";`;
|
|
1286
1287
|
}
|
|
1287
1288
|
const gi = "hydrated";
|
|
1288
|
-
function
|
|
1289
|
+
function hr(e) {
|
|
1289
1290
|
e._globalHydratedCssString = [
|
|
1290
1291
|
":not([",
|
|
1291
1292
|
e.options.css?.hydratedAttribute ?? gi,
|
|
@@ -1302,39 +1303,39 @@ function hi(e, t) {
|
|
|
1302
1303
|
].join(`
|
|
1303
1304
|
`);
|
|
1304
1305
|
}
|
|
1305
|
-
const
|
|
1306
|
+
const yr = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1306
1307
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1307
1308
|
|
|
1308
1309
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1309
1310
|
`}}`;
|
|
1310
|
-
function
|
|
1311
|
+
function vr(e) {
|
|
1311
1312
|
const t = [], i = [];
|
|
1312
1313
|
for (const s of e.privateApiJson.modules)
|
|
1313
1314
|
for (const r of s.declarations)
|
|
1314
|
-
r.customElement === !0 && (i.push(
|
|
1315
|
+
r.customElement === !0 && (i.push(br(r, e, s.sourcePath)), t.push(s.sourcePath));
|
|
1315
1316
|
return [
|
|
1316
1317
|
'import { runtime } from "./runtime.ts";',
|
|
1317
1318
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
1318
|
-
|
|
1319
|
-
e.hmrEnabled ?
|
|
1319
|
+
gr(e),
|
|
1320
|
+
e.hmrEnabled ? Sr : "",
|
|
1320
1321
|
"",
|
|
1321
|
-
e.isInStorybook ?
|
|
1322
|
+
e.isInStorybook ? pr(e.apiJson) : "",
|
|
1322
1323
|
"",
|
|
1323
1324
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
1324
1325
|
i.join(`,
|
|
1325
1326
|
`),
|
|
1326
1327
|
"});",
|
|
1327
|
-
e.hmrEnabled ?
|
|
1328
|
+
e.hmrEnabled ? Er(t) : ""
|
|
1328
1329
|
].join(`
|
|
1329
1330
|
`);
|
|
1330
1331
|
}
|
|
1331
|
-
const
|
|
1332
|
+
const br = (e, t, i) => [
|
|
1332
1333
|
` "${e.tagName}": [`,
|
|
1333
1334
|
`()=>import("${m.join(t.dir.root, i)}"),`,
|
|
1334
|
-
|
|
1335
|
+
wr(e),
|
|
1335
1336
|
"]"
|
|
1336
1337
|
].join("");
|
|
1337
|
-
function
|
|
1338
|
+
function wr(e) {
|
|
1338
1339
|
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: r } = yi(e), n = t.map((g) => g.join(us)).join(De), a = i.join(De), c = s.join(De), d = [n, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
|
|
1339
1340
|
return `${p.length > 0 || r ? `"${p.join(ms)}"` : ""}${r ? ",1" : ""}`;
|
|
1340
1341
|
}
|
|
@@ -1352,21 +1353,21 @@ function yi(e) {
|
|
|
1352
1353
|
const r = e.formAssociated === !0;
|
|
1353
1354
|
return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: r };
|
|
1354
1355
|
}
|
|
1355
|
-
const
|
|
1356
|
-
`,
|
|
1356
|
+
const Sr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
1357
|
+
`, Er = (e) => `
|
|
1357
1358
|
if(import.meta.hot) {
|
|
1358
1359
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
1359
1360
|
import.meta.hot.accept([
|
|
1360
1361
|
${e.map((t) => ` "/${t}",`).join(`
|
|
1361
1362
|
`)}
|
|
1362
1363
|
], handleHmrUpdate);
|
|
1363
|
-
}`,
|
|
1364
|
-
name:
|
|
1364
|
+
}`, Cr = "@arcgis/lumina-compiler", vi = {
|
|
1365
|
+
name: Cr
|
|
1365
1366
|
};
|
|
1366
1367
|
async function bi(e, t) {
|
|
1367
|
-
return ie ??=
|
|
1368
|
+
return ie ??= $r(e, t), await ie;
|
|
1368
1369
|
}
|
|
1369
|
-
function
|
|
1370
|
+
function Tr() {
|
|
1370
1371
|
if ($e === void 0)
|
|
1371
1372
|
throw Error(
|
|
1372
1373
|
b(
|
|
@@ -1386,9 +1387,9 @@ function wi() {
|
|
|
1386
1387
|
);
|
|
1387
1388
|
return Ge;
|
|
1388
1389
|
}
|
|
1389
|
-
async function
|
|
1390
|
+
async function $r(e, t) {
|
|
1390
1391
|
const i = O(e), s = i.dependencies ?? {}, r = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1391
|
-
[...Object.keys(s), ...Object.keys(r)].filter((l) =>
|
|
1392
|
+
[...Object.keys(s), ...Object.keys(r)].filter((l) => !Pr.has(l)).flatMap(async (l) => await Si(l, e))
|
|
1392
1393
|
)).filter(F);
|
|
1393
1394
|
$e ??= a, Ge = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1394
1395
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -1396,7 +1397,7 @@ async function Tr(e, t) {
|
|
|
1396
1397
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
1397
1398
|
return $e ??= d, d;
|
|
1398
1399
|
}
|
|
1399
|
-
const
|
|
1400
|
+
const Pr = /* @__PURE__ */ new Set([
|
|
1400
1401
|
"@arcgis/arcade-languageservice",
|
|
1401
1402
|
"@arcgis/components-build-utils",
|
|
1402
1403
|
"@arcgis/toolkit",
|
|
@@ -1434,11 +1435,11 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1434
1435
|
]);
|
|
1435
1436
|
let $e, Ge, ie;
|
|
1436
1437
|
async function Si(e, t) {
|
|
1437
|
-
const i = await Gt(e, t), s = await Xt(i), r = "exports" in s, n =
|
|
1438
|
+
const i = await Gt(e, t), s = await Xt(i), r = "exports" in s, n = Or.bind(void 0, r), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = m.join(i, "dist/esm/loader.js");
|
|
1438
1439
|
if (a ? await _(c) : !1) {
|
|
1439
|
-
const g = await H(c, "utf8"), h =
|
|
1440
|
+
const g = await H(c, "utf8"), h = Ir(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), C = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1440
1441
|
try {
|
|
1441
|
-
const S = JSON.parse(C), k =
|
|
1442
|
+
const S = JSON.parse(C), k = Dr(S, { packageName: e, getImportPath: n });
|
|
1442
1443
|
return { packageName: e, type: "stencil", components: k, packageLocation: i, packageJson: s };
|
|
1443
1444
|
} catch (S) {
|
|
1444
1445
|
E.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
@@ -1447,7 +1448,7 @@ Error: ${String(S)}`);
|
|
|
1447
1448
|
}
|
|
1448
1449
|
const l = wt(s.customElements);
|
|
1449
1450
|
if (l != null) {
|
|
1450
|
-
const g = m.join(i, l), h = JSON.parse(await H(g, "utf-8")), y =
|
|
1451
|
+
const g = m.join(i, l), h = JSON.parse(await H(g, "utf-8")), y = kr(h), v = Ei(h, {
|
|
1451
1452
|
packageName: e,
|
|
1452
1453
|
getImportPath: n
|
|
1453
1454
|
});
|
|
@@ -1455,7 +1456,7 @@ Error: ${String(S)}`);
|
|
|
1455
1456
|
}
|
|
1456
1457
|
const p = wt(s["web-types"]);
|
|
1457
1458
|
if (p != null) {
|
|
1458
|
-
const g = m.join(i, p), h = JSON.parse(await H(g, "utf-8")), y =
|
|
1459
|
+
const g = m.join(i, p), h = JSON.parse(await H(g, "utf-8")), y = xr(h, {
|
|
1459
1460
|
packageName: e,
|
|
1460
1461
|
getImportPath: n
|
|
1461
1462
|
});
|
|
@@ -1463,7 +1464,7 @@ Error: ${String(S)}`);
|
|
|
1463
1464
|
}
|
|
1464
1465
|
const u = m.join(i, "dist/components");
|
|
1465
1466
|
if (await _(u)) {
|
|
1466
|
-
const g = await
|
|
1467
|
+
const g = await Rr(u, {
|
|
1467
1468
|
packageName: e,
|
|
1468
1469
|
getImportPath: n
|
|
1469
1470
|
});
|
|
@@ -1471,7 +1472,7 @@ Error: ${String(S)}`);
|
|
|
1471
1472
|
}
|
|
1472
1473
|
}
|
|
1473
1474
|
const wt = (e) => Array.isArray(e) ? e[0] : e;
|
|
1474
|
-
function
|
|
1475
|
+
function Ir(e, t) {
|
|
1475
1476
|
const i = e.indexOf(t);
|
|
1476
1477
|
return i === -1 ? -1 : i + t.length;
|
|
1477
1478
|
}
|
|
@@ -1512,11 +1513,11 @@ function Ei(e, t, i = !1) {
|
|
|
1512
1513
|
}
|
|
1513
1514
|
return s;
|
|
1514
1515
|
}
|
|
1515
|
-
const
|
|
1516
|
+
const kr = (e) => (
|
|
1516
1517
|
// Since 5.0
|
|
1517
1518
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1518
1519
|
e.compiler?.name === vi.name
|
|
1519
|
-
),
|
|
1520
|
+
), xr = (e, t) => Object.fromEntries(
|
|
1520
1521
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1521
1522
|
(i) => [
|
|
1522
1523
|
i.name,
|
|
@@ -1527,7 +1528,7 @@ const Ir = (e) => (
|
|
|
1527
1528
|
}
|
|
1528
1529
|
]
|
|
1529
1530
|
) ?? []
|
|
1530
|
-
),
|
|
1531
|
+
), Ar = 1, Nr = 2, Lr = 4, jr = 8, Fr = Ar | Nr | Lr | jr, Dr = (e, t) => Object.fromEntries(
|
|
1531
1532
|
e.flatMap(
|
|
1532
1533
|
([i, s]) => s.map(
|
|
1533
1534
|
([r, n, a]) => [
|
|
@@ -1536,13 +1537,13 @@ const Ir = (e) => (
|
|
|
1536
1537
|
packageName: t.packageName,
|
|
1537
1538
|
modulePath: t.getImportPath(n),
|
|
1538
1539
|
propToAttribute: Object.fromEntries(
|
|
1539
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
1540
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & Fr).map(([c, [d, l = c]]) => [c, l])
|
|
1540
1541
|
)
|
|
1541
1542
|
}
|
|
1542
1543
|
]
|
|
1543
1544
|
)
|
|
1544
1545
|
)
|
|
1545
|
-
),
|
|
1546
|
+
), Rr = async (e, t) => Object.fromEntries(
|
|
1546
1547
|
(await tt(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
1547
1548
|
const s = i.slice(0, -5);
|
|
1548
1549
|
return [
|
|
@@ -1554,14 +1555,14 @@ const Ir = (e) => (
|
|
|
1554
1555
|
}
|
|
1555
1556
|
];
|
|
1556
1557
|
})
|
|
1557
|
-
),
|
|
1558
|
+
), Or = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Mr = (e) => e.startsWith("/") ? e : `/${e}`, nt = (e, t) => `${e}@fs${Mr(t)}`;
|
|
1558
1559
|
function Ci(e) {
|
|
1559
1560
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1560
1561
|
return i === "latest" ? "esnext" : i;
|
|
1561
1562
|
}
|
|
1562
1563
|
const Xe = "@arcgis/core", Me = O(), Ae = Xe in (Me.dependencies ?? {}) || Xe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
1563
1564
|
Me.name === "@arcgis/lumina";
|
|
1564
|
-
async function
|
|
1565
|
+
async function Jr(e, t, i) {
|
|
1565
1566
|
if (!Ae)
|
|
1566
1567
|
return [];
|
|
1567
1568
|
const s = await Gt(Xe);
|
|
@@ -1593,17 +1594,17 @@ const St = (e) => ({
|
|
|
1593
1594
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1594
1595
|
id: "arcgisCoreStylesheet"
|
|
1595
1596
|
}), ot = "customElement.js";
|
|
1596
|
-
function
|
|
1597
|
+
function Br(e, t) {
|
|
1597
1598
|
if (!t.startsWith(e))
|
|
1598
1599
|
return t;
|
|
1599
1600
|
const s = t.split(m.sep);
|
|
1600
|
-
return s.at(
|
|
1601
|
+
return s.at(Kr) !== s.at(_r) ? t : m.join(s.slice(0, -1).join(m.sep), ot);
|
|
1601
1602
|
}
|
|
1602
|
-
const
|
|
1603
|
+
const Kr = -1, _r = -2, Ur = /["']\.\.?\/[^'"]+/gu, Wr = (e, t, i, s) => e.replaceAll(Ur, (r) => {
|
|
1603
1604
|
const n = r.slice(1);
|
|
1604
1605
|
if (!n.startsWith("./") && !n.startsWith("../"))
|
|
1605
1606
|
return r;
|
|
1606
|
-
const a = m.join(s, n), c = !n.endsWith(".js") && !n.split("/").at(-1).includes(".") ?
|
|
1607
|
+
const a = m.join(s, n), c = !n.endsWith(".js") && !n.split("/").at(-1).includes(".") ? Br(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
|
|
1607
1608
|
if (i === s && a === d)
|
|
1608
1609
|
return r;
|
|
1609
1610
|
const l = fe(i, d), p = r.endsWith("/") ? `${l}/` : l;
|
|
@@ -1612,7 +1613,7 @@ const Br = -1, Kr = -2, _r = /["']\.\.?\/[^'"]+/gu, Ur = (e, t, i, s) => e.repla
|
|
|
1612
1613
|
const i = m.relative(e, t);
|
|
1613
1614
|
return i.startsWith(".") ? i : `.${m.sep}${i}`;
|
|
1614
1615
|
};
|
|
1615
|
-
async function
|
|
1616
|
+
async function zr(e, t, i) {
|
|
1616
1617
|
const s = m.resolve(e.dir.root, t);
|
|
1617
1618
|
e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await $s(s, { recursive: !0, force: !0 }), await G(s, { recursive: !0 }), await Ps(e.dir.distCdn, m.join(s, "build"), { recursive: !0 });
|
|
1618
1619
|
const r = [
|
|
@@ -1669,7 +1670,7 @@ const Ti = /* @__PURE__ */ new Set([
|
|
|
1669
1670
|
"extras",
|
|
1670
1671
|
"support"
|
|
1671
1672
|
]), R = "@arcgis/lumina:buildCdn", ne = "cdn", $i = "index", Q = "main";
|
|
1672
|
-
function
|
|
1673
|
+
function Hr(e) {
|
|
1673
1674
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: r } = e.options.build?.cdn ?? {}, n = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1674
1675
|
if (a) {
|
|
1675
1676
|
if (i.toLowerCase() !== i)
|
|
@@ -1686,7 +1687,7 @@ function zr(e) {
|
|
|
1686
1687
|
if (e.provideAssets([
|
|
1687
1688
|
{
|
|
1688
1689
|
type: "dynamic",
|
|
1689
|
-
source: () =>
|
|
1690
|
+
source: () => yr(e),
|
|
1690
1691
|
destination: `../${a ? c : Q}.css`
|
|
1691
1692
|
}
|
|
1692
1693
|
]), !t)
|
|
@@ -1702,7 +1703,7 @@ function zr(e) {
|
|
|
1702
1703
|
);
|
|
1703
1704
|
return;
|
|
1704
1705
|
}
|
|
1705
|
-
const d = Ae && O().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 })) : [], u = await
|
|
1706
|
+
const d = Ae && O().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 })) : [], u = await qr(
|
|
1706
1707
|
e,
|
|
1707
1708
|
c,
|
|
1708
1709
|
s,
|
|
@@ -1710,7 +1711,7 @@ function zr(e) {
|
|
|
1710
1711
|
r,
|
|
1711
1712
|
d
|
|
1712
1713
|
);
|
|
1713
|
-
await
|
|
1714
|
+
await Vr(
|
|
1714
1715
|
u,
|
|
1715
1716
|
e,
|
|
1716
1717
|
a ? `${c}.esm` : c,
|
|
@@ -1718,11 +1719,11 @@ function zr(e) {
|
|
|
1718
1719
|
d
|
|
1719
1720
|
);
|
|
1720
1721
|
const f = Date.now();
|
|
1721
|
-
E.info(R, `CDN was built in ${f - l}ms`), n && await
|
|
1722
|
+
E.info(R, `CDN was built in ${f - l}ms`), n && await zr(e, n, `${a ? `${c}.esm` : c}.js`);
|
|
1722
1723
|
}
|
|
1723
1724
|
};
|
|
1724
1725
|
}
|
|
1725
|
-
async function
|
|
1726
|
+
async function qr(e, t, i, s, r, n) {
|
|
1726
1727
|
const a = e.environment;
|
|
1727
1728
|
if (i.minify && n)
|
|
1728
1729
|
throw Error(
|
|
@@ -1831,7 +1832,7 @@ ${hi(e._globalCssString, e)}`, d = r?.(c, e) ?? c;
|
|
|
1831
1832
|
});
|
|
1832
1833
|
}
|
|
1833
1834
|
const Et = "stdin.js";
|
|
1834
|
-
async function
|
|
1835
|
+
async function Vr(e, t, i, s, r) {
|
|
1835
1836
|
const n = t.dir.distCdn, a = `${i}.js`;
|
|
1836
1837
|
let c;
|
|
1837
1838
|
r && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -1845,13 +1846,13 @@ async function qr(e, t, i, s, r) {
|
|
|
1845
1846
|
}, f = ce(p.path.slice(n.length));
|
|
1846
1847
|
if (f === Et) {
|
|
1847
1848
|
if (r) {
|
|
1848
|
-
const h = p.text.match(
|
|
1849
|
+
const h = p.text.match(Gr)?.[0];
|
|
1849
1850
|
if (h === void 0)
|
|
1850
1851
|
throw Error(
|
|
1851
1852
|
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Et} contents:
|
|
1852
1853
|
${p.text}`
|
|
1853
1854
|
);
|
|
1854
|
-
u.code = `${u.code.trimEnd()}${
|
|
1855
|
+
u.code = `${u.code.trimEnd()}${Xr(h, s)}`, u.isAsync = !1;
|
|
1855
1856
|
}
|
|
1856
1857
|
return [a, u];
|
|
1857
1858
|
}
|
|
@@ -1881,8 +1882,8 @@ ${p.text}`
|
|
|
1881
1882
|
}
|
|
1882
1883
|
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: u }]) => await U(n + p, u)));
|
|
1883
1884
|
}
|
|
1884
|
-
const
|
|
1885
|
-
function
|
|
1885
|
+
const Gr = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
1886
|
+
function Xr(e, t) {
|
|
1886
1887
|
let i = [
|
|
1887
1888
|
"window.$arcgis",
|
|
1888
1889
|
"||",
|
|
@@ -1931,7 +1932,7 @@ function Pi(e, t) {
|
|
|
1931
1932
|
e.isProcessing = !0;
|
|
1932
1933
|
const i = [], s = [], r = [], n = /* @__PURE__ */ new Set(), a = [];
|
|
1933
1934
|
let c = 0;
|
|
1934
|
-
const d = e.code.matchAll(
|
|
1935
|
+
const d = e.code.matchAll(Yr);
|
|
1935
1936
|
for (const w of d) {
|
|
1936
1937
|
const [L, A, z, j, N] = w, K = N.startsWith(Pe);
|
|
1937
1938
|
if (c !== 0 && c !== w.index) {
|
|
@@ -1973,7 +1974,7 @@ ${D.code}`
|
|
|
1973
1974
|
e.code = Tt(e.code, t);
|
|
1974
1975
|
return;
|
|
1975
1976
|
}
|
|
1976
|
-
const p =
|
|
1977
|
+
const p = en(n);
|
|
1977
1978
|
let u = e.code.slice(0, c);
|
|
1978
1979
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
1979
1980
|
const [L, A, z, j] = a[w];
|
|
@@ -1992,7 +1993,7 @@ ${D.code}`
|
|
|
1992
1993
|
}
|
|
1993
1994
|
const Ii = "export default $arcgis.t(";
|
|
1994
1995
|
function Ct(e) {
|
|
1995
|
-
const t =
|
|
1996
|
+
const t = Qr.exec(e.code), i = t?.index ?? e.code.length;
|
|
1996
1997
|
let s = "";
|
|
1997
1998
|
if (t !== null) {
|
|
1998
1999
|
const r = t[1].split(",");
|
|
@@ -2008,7 +2009,7 @@ function Ct(e) {
|
|
|
2008
2009
|
}
|
|
2009
2010
|
return [i, s];
|
|
2010
2011
|
}
|
|
2011
|
-
const
|
|
2012
|
+
const Yr = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Qr = /export\{([^}]+)\};\n$/u, Pe = "@arcgis/core/";
|
|
2012
2013
|
function ki(e, t) {
|
|
2013
2014
|
if (!e.startsWith("./"))
|
|
2014
2015
|
return;
|
|
@@ -2020,7 +2021,7 @@ function ki(e, t) {
|
|
|
2020
2021
|
return s;
|
|
2021
2022
|
}
|
|
2022
2023
|
function Tt(e, t) {
|
|
2023
|
-
return e.replaceAll(
|
|
2024
|
+
return e.replaceAll(Zr, (i, s) => {
|
|
2024
2025
|
if (s.startsWith(Pe))
|
|
2025
2026
|
return `$arcgis.t(m=>m[0],"${xi(s.slice(Pe.length))}")`;
|
|
2026
2027
|
if (s.startsWith("./")) {
|
|
@@ -2031,28 +2032,28 @@ function Tt(e, t) {
|
|
|
2031
2032
|
return i;
|
|
2032
2033
|
});
|
|
2033
2034
|
}
|
|
2034
|
-
const
|
|
2035
|
-
function
|
|
2035
|
+
const Zr = /(?<![.\w\d])import\("([^"]+)"\)/gu, xi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2036
|
+
function en(e) {
|
|
2036
2037
|
const t = [Ye];
|
|
2037
2038
|
return () => {
|
|
2038
2039
|
for (; ; ) {
|
|
2039
|
-
const i =
|
|
2040
|
-
if (
|
|
2040
|
+
const i = rn(t);
|
|
2041
|
+
if (nn(t), !e.has(i))
|
|
2041
2042
|
return e.add(i), i;
|
|
2042
2043
|
}
|
|
2043
2044
|
};
|
|
2044
2045
|
}
|
|
2045
|
-
const Ye = 0, at = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ai = `${at}0123456789`,
|
|
2046
|
-
function
|
|
2046
|
+
const Ye = 0, at = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ai = `${at}0123456789`, tn = at.length, sn = Ai.length;
|
|
2047
|
+
function rn(e) {
|
|
2047
2048
|
let t = at[e[0]];
|
|
2048
2049
|
for (let i = 1; i < e.length; ++i)
|
|
2049
2050
|
t += Ai[e[i]];
|
|
2050
2051
|
return t;
|
|
2051
2052
|
}
|
|
2052
|
-
function
|
|
2053
|
+
function nn(e) {
|
|
2053
2054
|
let t = e.length - 1;
|
|
2054
2055
|
for (; t >= 0; ) {
|
|
2055
|
-
const i = t === 0 ?
|
|
2056
|
+
const i = t === 0 ? tn : sn;
|
|
2056
2057
|
if (e[t] += 1, e[t] >= i)
|
|
2057
2058
|
e[t] = Ye, t--;
|
|
2058
2059
|
else
|
|
@@ -2064,7 +2065,7 @@ function Ne(e = O(), t = !1) {
|
|
|
2064
2065
|
const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
2065
2066
|
if (s && i)
|
|
2066
2067
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ne}/`;
|
|
2067
|
-
const r = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", n =
|
|
2068
|
+
const r = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", n = on(e.name), a = an(e.version);
|
|
2068
2069
|
if (a === void 0)
|
|
2069
2070
|
throw Error(
|
|
2070
2071
|
b(
|
|
@@ -2074,15 +2075,15 @@ function Ne(e = O(), t = !1) {
|
|
|
2074
2075
|
);
|
|
2075
2076
|
return n.length === 0 ? `https://${r}/${a}/` : s ? `https://${r}/${n}/${a}/` : `https://${r}/${a}/${n}/`;
|
|
2076
2077
|
}
|
|
2077
|
-
const
|
|
2078
|
-
function
|
|
2078
|
+
const on = (e) => e.split("/").pop() ?? e;
|
|
2079
|
+
function an(e) {
|
|
2079
2080
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2080
2081
|
if (i?.groups === void 0)
|
|
2081
2082
|
return;
|
|
2082
2083
|
const { major: s, minor: r, patch: n, prerelease: a } = i.groups, c = `${s}.${r}.${n}`;
|
|
2083
2084
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2084
2085
|
}
|
|
2085
|
-
async function
|
|
2086
|
+
async function ln(e, t, i, s, r) {
|
|
2086
2087
|
const n = t.packageName, { hasCss: a, cdnName: c } = await Ni(t.packageLocation) ?? {};
|
|
2087
2088
|
if (i === "cdn") {
|
|
2088
2089
|
const u = t.cdnUrl ?? Ne(t.packageJson, r);
|
|
@@ -2148,7 +2149,7 @@ async function $t(e, t) {
|
|
|
2148
2149
|
cdnName: t
|
|
2149
2150
|
} : void 0;
|
|
2150
2151
|
}
|
|
2151
|
-
async function
|
|
2152
|
+
async function cn(e, t, i, s, r) {
|
|
2152
2153
|
const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Ni(t.packageLocation) : void 0, c = a?.cdnName ?? ne, d = a === void 0 ? `${$i}.js` : `${a.cdnName}.esm.js`;
|
|
2153
2154
|
if (i === "cdn")
|
|
2154
2155
|
return {
|
|
@@ -2158,7 +2159,7 @@ async function ln(e, t, i, s, r) {
|
|
|
2158
2159
|
src: `${t.cdnUrl ?? Ne(t.packageJson, r)}${d}`
|
|
2159
2160
|
}
|
|
2160
2161
|
};
|
|
2161
|
-
const l =
|
|
2162
|
+
const l = dn(t.packageJson), p = `${t.packageName}/${m.normalize(l)}${Y}`, u = [
|
|
2162
2163
|
`import styles$${s} from "${p}";`,
|
|
2163
2164
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2164
2165
|
], f = `${t.packageName}/loader`;
|
|
@@ -2177,7 +2178,7 @@ async function ln(e, t, i, s, r) {
|
|
|
2177
2178
|
]
|
|
2178
2179
|
};
|
|
2179
2180
|
}
|
|
2180
|
-
function
|
|
2181
|
+
function dn(e) {
|
|
2181
2182
|
const { exports: t } = e;
|
|
2182
2183
|
if (t === void 0)
|
|
2183
2184
|
throw new Error(
|
|
@@ -2187,19 +2188,19 @@ function cn(e) {
|
|
|
2187
2188
|
return s ? s[0] : i.length > 0 ? i[0][0] : `./${Q}.css`;
|
|
2188
2189
|
}
|
|
2189
2190
|
async function ue(e) {
|
|
2190
|
-
return e._loadersCache ??=
|
|
2191
|
+
return e._loadersCache ??= pn(e), await e._loadersCache;
|
|
2191
2192
|
}
|
|
2192
|
-
async function
|
|
2193
|
+
async function pn(e) {
|
|
2193
2194
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", s = e.viteConfig.base;
|
|
2194
2195
|
let r = 0;
|
|
2195
2196
|
const n = async (l) => (await Promise.all(
|
|
2196
2197
|
l.map(async (p) => {
|
|
2197
2198
|
const u = r++;
|
|
2198
|
-
return p.type === "stencil" ? await
|
|
2199
|
+
return p.type === "stencil" ? await ln(s, p, t, u, i) : p.type === "@arcgis/lumina" ? await cn(s, p, t, u, i) : void 0;
|
|
2199
2200
|
})
|
|
2200
2201
|
)).filter(F).flat(), a = await Promise.all([
|
|
2201
2202
|
// This may contain an import map so must be first
|
|
2202
|
-
|
|
2203
|
+
Jr(s, t, i),
|
|
2203
2204
|
ie.then(n),
|
|
2204
2205
|
Li(e).then(n)
|
|
2205
2206
|
]), c = m.join(e.dir.src, "loader.ts");
|
|
@@ -2239,8 +2240,8 @@ async function Li(e) {
|
|
|
2239
2240
|
})
|
|
2240
2241
|
).then((i) => i.filter(F)), await e._serveOnlyDependencies);
|
|
2241
2242
|
}
|
|
2242
|
-
const
|
|
2243
|
-
async function
|
|
2243
|
+
const un = "/@arcgis/lumina-compiler/testSetupFile", mn = /^\/@arcgis\/lumina-compiler\/testSetupFile/u, Je = [un];
|
|
2244
|
+
async function fn(e) {
|
|
2244
2245
|
if (
|
|
2245
2246
|
/**
|
|
2246
2247
|
* Only import custom element dependencies if we are running in Vitest browser mode.
|
|
@@ -2278,16 +2279,16 @@ async function mn(e) {
|
|
|
2278
2279
|
`);
|
|
2279
2280
|
return [Pt(e), i].join("");
|
|
2280
2281
|
}
|
|
2281
|
-
const Pt = (e) => [e.isInPuppeteerTestBackEnd ?
|
|
2282
|
+
const Pt = (e) => [e.isInPuppeteerTestBackEnd ? gn : "", hn].join(""), gn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2282
2283
|
setupPuppeteerTest();
|
|
2283
|
-
`,
|
|
2284
|
+
`, hn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2284
2285
|
setupLuminaTest();
|
|
2285
|
-
`,
|
|
2286
|
+
`, yn = "@arcgis/lumina:generateLoaderTs";
|
|
2286
2287
|
let Ie;
|
|
2287
|
-
function
|
|
2288
|
+
function vn(e) {
|
|
2288
2289
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2289
2290
|
return [As(e.apiExtractorPluginConfig), {
|
|
2290
|
-
name:
|
|
2291
|
+
name: yn,
|
|
2291
2292
|
configResolved() {
|
|
2292
2293
|
Ie = `${e.dir.root}src/loader.ts`;
|
|
2293
2294
|
},
|
|
@@ -2302,7 +2303,7 @@ function yn(e) {
|
|
|
2302
2303
|
id: t
|
|
2303
2304
|
},
|
|
2304
2305
|
async handler() {
|
|
2305
|
-
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise,
|
|
2306
|
+
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, vr(e);
|
|
2306
2307
|
}
|
|
2307
2308
|
},
|
|
2308
2309
|
async handleHotUpdate() {
|
|
@@ -2312,9 +2313,9 @@ function yn(e) {
|
|
|
2312
2313
|
name: "@arcgis/lumina:generateTestSetupVirtualFile",
|
|
2313
2314
|
load: {
|
|
2314
2315
|
filter: {
|
|
2315
|
-
id:
|
|
2316
|
+
id: mn
|
|
2316
2317
|
},
|
|
2317
|
-
handler: async () => await
|
|
2318
|
+
handler: async () => await fn(e)
|
|
2318
2319
|
}
|
|
2319
2320
|
}];
|
|
2320
2321
|
}
|
|
@@ -2333,9 +2334,9 @@ function de(e, t, i = lt) {
|
|
|
2333
2334
|
throw Error(b(Qe, "serveAssets() is only available when Vite is running in serve mode"));
|
|
2334
2335
|
const s = e._serverConfigured, r = e.server.middlewares.stack.length;
|
|
2335
2336
|
if (t.forEach((n) => {
|
|
2336
|
-
const a = Fi(n), c = Ri(e.dir, Di(a)), d =
|
|
2337
|
+
const a = Fi(n), c = Ri(e.dir, Di(a)), d = wn(e.viteConfig.base, c, e.dir.distCdn);
|
|
2337
2338
|
e.server.middlewares.use(d, (l, p, u) => {
|
|
2338
|
-
const f =
|
|
2339
|
+
const f = Sn(l.url), g = a.type === "directory" ? m.resolve(a.source, f.slice(1)) : a.source, h = m.join(c, f), y = i.find((v) => v.match(h, e));
|
|
2339
2340
|
return (typeof g == "function" ? Promise.resolve(g()) : H(g)).then((v) => {
|
|
2340
2341
|
const C = (typeof g == "function" ? void 0 : y?.transform(v.toString("utf8"), h, e)) ?? v;
|
|
2341
2342
|
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Ns.lookup(f) || "application/octet-stream"), p.write(C), p.end();
|
|
@@ -2360,10 +2361,10 @@ async function ji(e, t, i = lt) {
|
|
|
2360
2361
|
const p = m.resolve(l.parentPath, l.name), u = m.relative(a, p), f = m.join(n, u);
|
|
2361
2362
|
return [p, f];
|
|
2362
2363
|
});
|
|
2363
|
-
await Mi(d.map(([l, p]) => p)), await
|
|
2364
|
-
d
|
|
2365
|
-
|
|
2366
|
-
)
|
|
2364
|
+
await Mi(d.map(([l, p]) => p)), await Ls(
|
|
2365
|
+
d,
|
|
2366
|
+
16,
|
|
2367
|
+
async ([l, p]) => await xt(l, p, i, e)
|
|
2367
2368
|
);
|
|
2368
2369
|
} else if (r.type === "file")
|
|
2369
2370
|
await G(m.dirname(n), { recursive: !0 }), await xt(r.source, n, i, e);
|
|
@@ -2408,33 +2409,33 @@ function Di(e) {
|
|
|
2408
2409
|
return e.destination === "" ? m.basename(e.source) : e.destination.endsWith(m.sep) ? e.type === "directory" && e.destination === m.sep ? e.destination : m.join(e.destination, m.basename(e.source)) : e.destination;
|
|
2409
2410
|
}
|
|
2410
2411
|
function Ri({ dist: e, distCdnAssets: t }, i) {
|
|
2411
|
-
const s =
|
|
2412
|
+
const s = bn(i), r = m.join(
|
|
2412
2413
|
t,
|
|
2413
2414
|
s ? m.relative(t, i) : i
|
|
2414
2415
|
), n = m.relative(e, r), a = Oi(n);
|
|
2415
2416
|
return m.join(e, a);
|
|
2416
2417
|
}
|
|
2417
|
-
function
|
|
2418
|
+
function bn(e) {
|
|
2418
2419
|
if (e.startsWith(m.sep)) {
|
|
2419
2420
|
const t = Qt(), i = t.startsWith(m.sep) ? t.split(m.sep)[1] ?? "" : "";
|
|
2420
2421
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
2421
2422
|
} else
|
|
2422
2423
|
return !!(!Yt && m.isAbsolute(e));
|
|
2423
2424
|
}
|
|
2424
|
-
function
|
|
2425
|
+
function wn(e, t, i) {
|
|
2425
2426
|
const s = Oi(m.relative(i, t)), r = s.startsWith("/") ? s.slice(1) : s;
|
|
2426
2427
|
return `${e}${r}`;
|
|
2427
2428
|
}
|
|
2428
|
-
const Oi = (e) => e.replaceAll("../", ""),
|
|
2429
|
+
const Oi = (e) => e.replaceAll("../", ""), Sn = (e = "") => e.split("?")[0].split("#")[0];
|
|
2429
2430
|
async function Mi(e) {
|
|
2430
2431
|
const t = new Set(e.map(m.dirname));
|
|
2431
2432
|
await Promise.all(Array.from(t, async (i) => await G(i, { recursive: !0 })));
|
|
2432
2433
|
}
|
|
2433
|
-
const
|
|
2434
|
+
const En = {
|
|
2434
2435
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
2435
2436
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
2436
|
-
}, lt = [
|
|
2437
|
-
function
|
|
2437
|
+
}, lt = [En];
|
|
2438
|
+
function Cn(e) {
|
|
2438
2439
|
let t;
|
|
2439
2440
|
const i = () => [
|
|
2440
2441
|
...e.options.assets?.transformers ?? [],
|
|
@@ -2488,7 +2489,7 @@ const Ji = (e, t) => ({
|
|
|
2488
2489
|
type: "directory",
|
|
2489
2490
|
source: e,
|
|
2490
2491
|
destination: m.basename(t)
|
|
2491
|
-
}), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize",
|
|
2492
|
+
}), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", Tn = (e) => ({
|
|
2492
2493
|
name: Be,
|
|
2493
2494
|
apply: () => e.viteCommand === "build",
|
|
2494
2495
|
configResolved(t) {
|
|
@@ -2507,10 +2508,10 @@ const Ji = (e, t) => ({
|
|
|
2507
2508
|
const u = console.log;
|
|
2508
2509
|
console.log = function(...g) {
|
|
2509
2510
|
if (u.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2510
|
-
const [h, y] = g[0].match(
|
|
2511
|
+
const [h, y] = g[0].match(Pn) ?? [];
|
|
2511
2512
|
if (!h)
|
|
2512
2513
|
return;
|
|
2513
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2514
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(In, "").length);
|
|
2514
2515
|
const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2515
2516
|
y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
|
|
2516
2517
|
}
|
|
@@ -2526,7 +2527,7 @@ const Ji = (e, t) => ({
|
|
|
2526
2527
|
[
|
|
2527
2528
|
Lt,
|
|
2528
2529
|
y,
|
|
2529
|
-
|
|
2530
|
+
$n,
|
|
2530
2531
|
"*",
|
|
2531
2532
|
" ".repeat(p - `${y}*`.length - h.length),
|
|
2532
2533
|
h,
|
|
@@ -2537,10 +2538,10 @@ const Ji = (e, t) => ({
|
|
|
2537
2538
|
}
|
|
2538
2539
|
};
|
|
2539
2540
|
}
|
|
2540
|
-
}), Nt = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m",
|
|
2541
|
+
}), Nt = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m", $n = "\x1B[22m\x1B[36m", Pn = /\d+(?:,\d+)?\.\d{2} kB/gu, In = /\x1B\[\d+m/gu, kn = new Intl.NumberFormat("en", {
|
|
2541
2542
|
maximumFractionDigits: 2,
|
|
2542
2543
|
minimumFractionDigits: 2
|
|
2543
|
-
}), jt = (e) => `${
|
|
2544
|
+
}), jt = (e) => `${kn.format(e)} kB`, xn = (e, t = m.resolve("src")) => m.relative(t, m.join(e, "..", ot.slice(0, -3))), Ft = "@arcgis/lumina:configureVite", An = (e) => ({
|
|
2544
2545
|
name: Ft,
|
|
2545
2546
|
async config({
|
|
2546
2547
|
server: t,
|
|
@@ -2751,22 +2752,22 @@ const Ji = (e, t) => ({
|
|
|
2751
2752
|
e._originalRollupInputOptions ??= t.input;
|
|
2752
2753
|
const s = { ...e._originalRollupInputOptions };
|
|
2753
2754
|
i.forEach((r) => {
|
|
2754
|
-
const n =
|
|
2755
|
+
const n = xn(r);
|
|
2755
2756
|
s[n] = r;
|
|
2756
2757
|
}), t.input = s;
|
|
2757
2758
|
}
|
|
2758
|
-
}),
|
|
2759
|
+
}), Nn = (e) => ({
|
|
2759
2760
|
name: "@arcgis/lumina:setAssetPath",
|
|
2760
2761
|
apply: () => e.viteCommand === "build",
|
|
2761
2762
|
config: (t) => ({
|
|
2762
2763
|
base: t.base ?? e.options.assets?.defaultPath ?? Ne()
|
|
2763
2764
|
})
|
|
2764
2765
|
});
|
|
2765
|
-
function
|
|
2766
|
+
function Ln(e = O()) {
|
|
2766
2767
|
const t = e.version ?? "0.0.1";
|
|
2767
2768
|
return ds(t);
|
|
2768
2769
|
}
|
|
2769
|
-
const
|
|
2770
|
+
const jn = (e) => `/* ${e} */`, P = (e) => (t, i) => {
|
|
2770
2771
|
Object.defineProperty(t, i, {
|
|
2771
2772
|
get() {
|
|
2772
2773
|
throw Error(
|
|
@@ -2806,7 +2807,7 @@ const le = {
|
|
|
2806
2807
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2807
2808
|
}, Ze = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2808
2809
|
async function Ki(e, t, i, s, r = O()) {
|
|
2809
|
-
const n =
|
|
2810
|
+
const n = Fn(e, r), a = m.join(t, "lumina.ts"), d = await _(a) ? await H(a, "utf8") : "";
|
|
2810
2811
|
if (d.trim().replaceAll(`\r
|
|
2811
2812
|
`, `
|
|
2812
2813
|
`) === n.trim())
|
|
@@ -2826,7 +2827,7 @@ ${d}`
|
|
|
2826
2827
|
);
|
|
2827
2828
|
return ei(a, n), !0;
|
|
2828
2829
|
}
|
|
2829
|
-
function
|
|
2830
|
+
function Fn(e, t = O()) {
|
|
2830
2831
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
2831
2832
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), r = s.map(
|
|
2832
2833
|
(d, l) => `
|
|
@@ -2837,7 +2838,7 @@ declare module "@arcgis/lumina" {
|
|
|
2837
2838
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
2838
2839
|
}`, a = t.devDependencies ?? {};
|
|
2839
2840
|
return [
|
|
2840
|
-
|
|
2841
|
+
Dn,
|
|
2841
2842
|
a.vitest ? `
|
|
2842
2843
|
/// <reference types="vitest/config" />
|
|
2843
2844
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -2848,7 +2849,7 @@ declare module "@arcgis/lumina" {
|
|
|
2848
2849
|
`
|
|
2849
2850
|
].join("");
|
|
2850
2851
|
}
|
|
2851
|
-
const
|
|
2852
|
+
const Dn = `/**
|
|
2852
2853
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
2853
2854
|
* Manual edits will be overwritten.
|
|
2854
2855
|
*
|
|
@@ -2867,10 +2868,10 @@ const Fn = `/**
|
|
|
2867
2868
|
* is doing:
|
|
2868
2869
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
2869
2870
|
*/
|
|
2870
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
2871
|
+
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) => ({
|
|
2871
2872
|
name: be,
|
|
2872
2873
|
configResolved() {
|
|
2873
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
2874
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = On(e).catch(
|
|
2874
2875
|
(t) => E.error(be, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
2875
2876
|
));
|
|
2876
2877
|
},
|
|
@@ -2920,27 +2921,27 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
2920
2921
|
await e._updateLuminaTsPromise;
|
|
2921
2922
|
}
|
|
2922
2923
|
});
|
|
2923
|
-
async function
|
|
2924
|
+
async function On(e) {
|
|
2924
2925
|
const i = (await Promise.all([ie, Li(e)])).flat();
|
|
2925
2926
|
if (!await Ki(i, e.dir.src))
|
|
2926
2927
|
return;
|
|
2927
2928
|
let r = !1;
|
|
2928
2929
|
function n() {
|
|
2929
|
-
r || E.warn(be,
|
|
2930
|
+
r || E.warn(be, Mn), r = !0;
|
|
2930
2931
|
}
|
|
2931
2932
|
process.on("exit", () => {
|
|
2932
2933
|
n(), clearTimeout(c);
|
|
2933
2934
|
});
|
|
2934
2935
|
const c = setTimeout(n, 2e3);
|
|
2935
2936
|
}
|
|
2936
|
-
const
|
|
2937
|
+
const Mn = js.greenBright(
|
|
2937
2938
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
2938
2939
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
2939
|
-
),
|
|
2940
|
-
engines:
|
|
2940
|
+
), Jn = { node: "^24.11" }, V = {
|
|
2941
|
+
engines: Jn
|
|
2941
2942
|
};
|
|
2942
|
-
async function
|
|
2943
|
-
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await
|
|
2943
|
+
async function Bn(e) {
|
|
2944
|
+
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Ds(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
2944
2945
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? ae(e.options.documentation.apiJsonFileName) : le.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
2945
2946
|
{
|
|
2946
2947
|
type: "dynamic",
|
|
@@ -2948,7 +2949,7 @@ async function Jn(e) {
|
|
|
2948
2949
|
destination: m.join("../..", e._documentationFileNames.apiJson)
|
|
2949
2950
|
}
|
|
2950
2951
|
]);
|
|
2951
|
-
const s = i?.types?.typeScriptConfig ??
|
|
2952
|
+
const s = i?.types?.typeScriptConfig ?? Rs(
|
|
2952
2953
|
process.cwd(),
|
|
2953
2954
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
2954
2955
|
!0
|
|
@@ -3054,10 +3055,10 @@ function Dt(e, t) {
|
|
|
3054
3055
|
}
|
|
3055
3056
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, r !== void 0 && (e.componentFilesPromise = Promise.resolve(r));
|
|
3056
3057
|
}
|
|
3057
|
-
var
|
|
3058
|
+
var Kn = Object.defineProperty, I = (e, t, i, s) => {
|
|
3058
3059
|
for (var r = void 0, n = e.length - 1, a; n >= 0; n--)
|
|
3059
3060
|
(a = e[n]) && (r = a(t, i, r) || r);
|
|
3060
|
-
return r &&
|
|
3061
|
+
return r && Kn(t, i, r), r;
|
|
3061
3062
|
};
|
|
3062
3063
|
const J = "@arcgis/lumina:context";
|
|
3063
3064
|
class $ {
|
|
@@ -3102,7 +3103,7 @@ class $ {
|
|
|
3102
3103
|
extract: !0
|
|
3103
3104
|
}, (this.viteCommand === "build" ? p.build.watch : p.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
|
|
3104
3105
|
const L = this.viteCommand === "serve" && !this.isInStorybook, A = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3105
|
-
L && (A.context.isLuminaMinimalExtraction = !0, A.types.typeCheckedExtraction = !1, A.types.fullTypeCheck = !1), this.isInStorybook && (A.context.dtsEmitPath = ""), this._typeScriptPrinter =
|
|
3106
|
+
L && (A.context.isLuminaMinimalExtraction = !0, A.types.typeCheckedExtraction = !1, A.types.fullTypeCheck = !1), this.isInStorybook && (A.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
|
|
3106
3107
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3107
3108
|
target: o.ScriptTarget.ESNext,
|
|
3108
3109
|
sourceMap: p.build.sourcemap !== !1
|
|
@@ -3147,7 +3148,7 @@ class $ {
|
|
|
3147
3148
|
webTypes: c.jetBrains === !1 ? void 0 : c.jetBrains?.webTypesFileName ? ae(c.jetBrains.webTypesFileName) : le.webTypes,
|
|
3148
3149
|
vsCodeHtml: c.vsCode === !1 ? void 0 : c.vsCode?.htmlFileName ? ae(c.vsCode.htmlFileName) : le.vsCodeHtml,
|
|
3149
3150
|
vsCodeCss: c.vsCode === !1 ? void 0 : c.vsCode?.cssFileName ? ae(c.vsCode.cssFileName) : le.vsCodeCss
|
|
3150
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3151
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Bn(this);
|
|
3151
3152
|
const d = process.cwd().length + 1;
|
|
3152
3153
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3153
3154
|
const p = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, u = [];
|
|
@@ -3157,8 +3158,8 @@ class $ {
|
|
|
3157
3158
|
}
|
|
3158
3159
|
return u;
|
|
3159
3160
|
}), bi(void 0, t);
|
|
3160
|
-
const l = t.build?.preamble ??
|
|
3161
|
-
this.banner =
|
|
3161
|
+
const l = t.build?.preamble ?? Ln();
|
|
3162
|
+
this.banner = jn(l);
|
|
3162
3163
|
}
|
|
3163
3164
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3164
3165
|
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (E.warn(vi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -3305,7 +3306,7 @@ I([
|
|
|
3305
3306
|
I([
|
|
3306
3307
|
P("configResolved()")
|
|
3307
3308
|
], $.prototype, "_typeScriptPrinter");
|
|
3308
|
-
function
|
|
3309
|
+
function _n(e, t, i) {
|
|
3309
3310
|
const s = wi()[t] ?? Ui(e)[t];
|
|
3310
3311
|
if (s === void 0) {
|
|
3311
3312
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
@@ -3320,7 +3321,7 @@ function Kn(e, t, i) {
|
|
|
3320
3321
|
}
|
|
3321
3322
|
return s;
|
|
3322
3323
|
}
|
|
3323
|
-
function
|
|
3324
|
+
function Un(e, t) {
|
|
3324
3325
|
return e.packageName === void 0 ? fe(t, e.modulePath) : m.join(e.packageName, e.modulePath);
|
|
3325
3326
|
}
|
|
3326
3327
|
function Ui(e) {
|
|
@@ -3335,8 +3336,8 @@ function Ui(e) {
|
|
|
3335
3336
|
e.viteCommand === "build"
|
|
3336
3337
|
), e._localDefinedComponents;
|
|
3337
3338
|
}
|
|
3338
|
-
const Rt = "makeRuntime(",
|
|
3339
|
-
name:
|
|
3339
|
+
const Rt = "makeRuntime(", Wn = "@arcgis/core", zn = "@arcgis/lumina:injectRuntimeOptions", Hn = (e) => ({
|
|
3340
|
+
name: zn,
|
|
3340
3341
|
transform: {
|
|
3341
3342
|
filter: {
|
|
3342
3343
|
id: /\/src\/runtime\.ts$/u
|
|
@@ -3363,7 +3364,7 @@ const Rt = "makeRuntime(", Un = "@arcgis/core", Wn = "@arcgis/lumina:injectRunti
|
|
|
3363
3364
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3364
3365
|
// a cyclical dependency.
|
|
3365
3366
|
Ae ? `
|
|
3366
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3367
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Wn}/applications/Components/reactiveUtils.js";
|
|
3367
3368
|
createObservable,
|
|
3368
3369
|
runtime.t = trackAccess;
|
|
3369
3370
|
runtime.o = createObservable;
|
|
@@ -3375,11 +3376,11 @@ runtime.r = runTracked;` : ""
|
|
|
3375
3376
|
}
|
|
3376
3377
|
}
|
|
3377
3378
|
});
|
|
3378
|
-
function
|
|
3379
|
+
function qn(e) {
|
|
3379
3380
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Q}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3380
3381
|
`;
|
|
3381
3382
|
}
|
|
3382
|
-
const ve = "@arcgis/lumina:addNonLazyImports",
|
|
3383
|
+
const ve = "@arcgis/lumina:addNonLazyImports", Vn = (e) => ({
|
|
3383
3384
|
name: ve,
|
|
3384
3385
|
apply: () => e.viteCommand === "build",
|
|
3385
3386
|
generateBundle(t, i) {
|
|
@@ -3391,7 +3392,7 @@ const ve = "@arcgis/lumina:addNonLazyImports", qn = (e) => ({
|
|
|
3391
3392
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3392
3393
|
const l = m.dirname(m.join(e.dir.dist, a)), p = d === a ? l : m.dirname(m.join(e.dir.dist, d));
|
|
3393
3394
|
let u = c.code;
|
|
3394
|
-
u =
|
|
3395
|
+
u = Wr(u, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (n = !0, u = qn(e) + u), u = `${e.banner}${r}${u}`, c.code = u;
|
|
3395
3396
|
}
|
|
3396
3397
|
}), !n && !e.isInStorybook)
|
|
3397
3398
|
throw Error(b(ve, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3428,10 +3429,10 @@ Possible causes:
|
|
|
3428
3429
|
return [];
|
|
3429
3430
|
const d = m.dirname(n), l = e.dir.src + We(d.slice(e.dir.src.length), e.apiExtractor), p = m.relative(e.dir.src, l);
|
|
3430
3431
|
function u(T) {
|
|
3431
|
-
const x =
|
|
3432
|
+
const x = _n(e, T, n);
|
|
3432
3433
|
if (x === void 0)
|
|
3433
3434
|
return;
|
|
3434
|
-
const w =
|
|
3435
|
+
const w = Un(x, p);
|
|
3435
3436
|
if (w !== `./${p}`)
|
|
3436
3437
|
return w.startsWith(".") ? `${w}/${Ot}` : w;
|
|
3437
3438
|
}
|
|
@@ -3476,14 +3477,14 @@ function Z(e) {
|
|
|
3476
3477
|
return (
|
|
3477
3478
|
// Inlined string literal
|
|
3478
3479
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3479
|
-
|
|
3480
|
+
Gn.has(e.kind) || // Ternary with both branches never undefined
|
|
3480
3481
|
o.isConditionalExpression(e) && Z(e.whenTrue) && Z(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3481
|
-
o.isBinaryExpression(e) && (
|
|
3482
|
+
o.isBinaryExpression(e) && (Xn.has(e.operatorToken.kind) || Z(e.left) && Z(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3482
3483
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Z(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3483
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3484
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Qs.has(e.tag.text)
|
|
3484
3485
|
);
|
|
3485
3486
|
}
|
|
3486
|
-
const
|
|
3487
|
+
const Gn = /* @__PURE__ */ new Set([
|
|
3487
3488
|
o.SyntaxKind.NumericLiteral,
|
|
3488
3489
|
o.SyntaxKind.BigIntLiteral,
|
|
3489
3490
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3502,7 +3503,7 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3502
3503
|
o.SyntaxKind.ClassExpression,
|
|
3503
3504
|
// Trust? Trust.
|
|
3504
3505
|
o.SyntaxKind.NonNullExpression
|
|
3505
|
-
]),
|
|
3506
|
+
]), Xn = /* @__PURE__ */ new Set([
|
|
3506
3507
|
o.SyntaxKind.PlusEqualsToken,
|
|
3507
3508
|
o.SyntaxKind.MinusEqualsToken,
|
|
3508
3509
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3537,9 +3538,9 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3537
3538
|
o.SyntaxKind.SlashToken,
|
|
3538
3539
|
o.SyntaxKind.PercentToken,
|
|
3539
3540
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3540
|
-
]),
|
|
3541
|
+
]), Yn = {
|
|
3541
3542
|
property(e, t, i, s) {
|
|
3542
|
-
const r =
|
|
3543
|
+
const r = Qn(s, i, e), n = r?.type === "stringifiedReflected", a = r?.type === "reflected" || n;
|
|
3543
3544
|
if (a) {
|
|
3544
3545
|
const f = _e(t);
|
|
3545
3546
|
if (f === !0)
|
|
@@ -3556,7 +3557,7 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3556
3557
|
p,
|
|
3557
3558
|
e,
|
|
3558
3559
|
u ? "" : void 0
|
|
3559
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === Ce) ?
|
|
3560
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === Ce) ? eo(f, e) : f;
|
|
3560
3561
|
if (h !== p)
|
|
3561
3562
|
return [u ? `.${i}` : r.name, l, h];
|
|
3562
3563
|
}
|
|
@@ -3629,7 +3630,7 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3629
3630
|
return [o.factory.createIdentifier(r)];
|
|
3630
3631
|
}
|
|
3631
3632
|
};
|
|
3632
|
-
function
|
|
3633
|
+
function Qn(e, t, i) {
|
|
3633
3634
|
if (typeof e == "string") {
|
|
3634
3635
|
const n = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3635
3636
|
if (n !== void 0)
|
|
@@ -3704,7 +3705,7 @@ function Jt(e, t) {
|
|
|
3704
3705
|
if (i.length === 0)
|
|
3705
3706
|
return [];
|
|
3706
3707
|
const s = li(i);
|
|
3707
|
-
if (
|
|
3708
|
+
if (qs(s)) {
|
|
3708
3709
|
const r = s.replaceAll('"', """);
|
|
3709
3710
|
if (r.length > s.length) {
|
|
3710
3711
|
const n = s.replaceAll("'", "'");
|
|
@@ -3723,7 +3724,7 @@ function Bt(e, t, i) {
|
|
|
3723
3724
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3724
3725
|
);
|
|
3725
3726
|
const s = t.expression;
|
|
3726
|
-
if (
|
|
3727
|
+
if (Zn(s)) {
|
|
3727
3728
|
const n = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3728
3729
|
e.neededImports.add(n);
|
|
3729
3730
|
const a = e.importRenames[n], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3733,15 +3734,15 @@ function Bt(e, t, i) {
|
|
|
3733
3734
|
} else
|
|
3734
3735
|
return [i, ...we(e, t, !0)];
|
|
3735
3736
|
}
|
|
3736
|
-
const
|
|
3737
|
-
function
|
|
3737
|
+
const Zn = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3738
|
+
function eo(e, t) {
|
|
3738
3739
|
t.neededImports.add("live");
|
|
3739
3740
|
const i = t.importRenames.live;
|
|
3740
3741
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3741
3742
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3742
3743
|
]);
|
|
3743
3744
|
}
|
|
3744
|
-
function
|
|
3745
|
+
function to(e) {
|
|
3745
3746
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Kt && e.expression.arguments.length <= 1)
|
|
3746
3747
|
return {
|
|
3747
3748
|
propType: Kt[e.expression.expression.text],
|
|
@@ -3759,15 +3760,15 @@ const Kt = {
|
|
|
3759
3760
|
bindBooleanAttribute: "booleanAttribute",
|
|
3760
3761
|
bindEvent: "event"
|
|
3761
3762
|
};
|
|
3762
|
-
function
|
|
3763
|
-
return
|
|
3763
|
+
function io(e, t, i) {
|
|
3764
|
+
return ro.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ri.has(e) || e.includes("-") ? "attribute" : !rt(i) && (ni.has(e) || (i === He ? !1 : i === Ce ? (
|
|
3764
3765
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3765
3766
|
Object.values(qe).some((n) => n.has(e))
|
|
3766
3767
|
) : qe[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === He || i !== Ce && (it.has(i) || st.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3767
3768
|
}
|
|
3768
|
-
const
|
|
3769
|
+
const so = ["class", "style", "ref", "directives", "key", "deferLoad"], ro = new Set(so), no = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3769
3770
|
function Le({ key: e, parts: t, litTag: i }, s) {
|
|
3770
|
-
const r =
|
|
3771
|
+
const r = oo(t);
|
|
3771
3772
|
if (r.length % 2 === 0)
|
|
3772
3773
|
throw new Error("Normalized template parts array length must be odd");
|
|
3773
3774
|
const [n, ...a] = r;
|
|
@@ -3788,11 +3789,11 @@ function Le({ key: e, parts: t, litTag: i }, s) {
|
|
|
3788
3789
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3789
3790
|
o.factory.createIdentifier(d),
|
|
3790
3791
|
void 0,
|
|
3791
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n),
|
|
3792
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n), ao(a))
|
|
3792
3793
|
);
|
|
3793
3794
|
return Ue(s, e, l);
|
|
3794
3795
|
}
|
|
3795
|
-
const
|
|
3796
|
+
const oo = (e) => e.reduce(
|
|
3796
3797
|
(t, i, s) => {
|
|
3797
3798
|
const r = t.at(-1), n = typeof r == "string", a = typeof i == "string";
|
|
3798
3799
|
if (n && a)
|
|
@@ -3802,7 +3803,7 @@ const no = (e) => e.reduce(
|
|
|
3802
3803
|
},
|
|
3803
3804
|
[""]
|
|
3804
3805
|
);
|
|
3805
|
-
function
|
|
3806
|
+
function ao(e) {
|
|
3806
3807
|
if (!(e.length % 2 === 0))
|
|
3807
3808
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3808
3809
|
const i = e.length / 2;
|
|
@@ -3841,13 +3842,13 @@ function Hi(e, t) {
|
|
|
3841
3842
|
);
|
|
3842
3843
|
}
|
|
3843
3844
|
const dt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3844
|
-
function
|
|
3845
|
+
function lo(e) {
|
|
3845
3846
|
const t = dt(e);
|
|
3846
3847
|
if (t.length === 0)
|
|
3847
3848
|
return [e || " "];
|
|
3848
3849
|
const i = t.reduceRight(
|
|
3849
3850
|
([r, ...n], a) => {
|
|
3850
|
-
const c =
|
|
3851
|
+
const c = co(r), d = qi(c.slice(a.pos, a.end));
|
|
3851
3852
|
return [
|
|
3852
3853
|
c.slice(0, a.pos),
|
|
3853
3854
|
/**
|
|
@@ -3866,12 +3867,12 @@ function ao(e) {
|
|
|
3866
3867
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
3867
3868
|
}
|
|
3868
3869
|
const qi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3869
|
-
function
|
|
3870
|
+
function co(e) {
|
|
3870
3871
|
if (typeof e == "string")
|
|
3871
3872
|
return e;
|
|
3872
3873
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3873
3874
|
}
|
|
3874
|
-
function
|
|
3875
|
+
function po(e, t) {
|
|
3875
3876
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3876
3877
|
return t;
|
|
3877
3878
|
const s = t.arguments[0];
|
|
@@ -3905,7 +3906,7 @@ function co(e, t) {
|
|
|
3905
3906
|
const f = p.attributes.properties[u];
|
|
3906
3907
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3907
3908
|
return t;
|
|
3908
|
-
const g = ct(f.initializer, e.sourceFile), h =
|
|
3909
|
+
const g = ct(f.initializer, e.sourceFile), h = uo(n, s, g, d, e);
|
|
3909
3910
|
if (h === void 0)
|
|
3910
3911
|
return t;
|
|
3911
3912
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3938,7 +3939,7 @@ function Vi(e) {
|
|
|
3938
3939
|
void 0
|
|
3939
3940
|
), t;
|
|
3940
3941
|
}
|
|
3941
|
-
function
|
|
3942
|
+
function uo(e, t, i, s, r) {
|
|
3942
3943
|
const n = B(i);
|
|
3943
3944
|
if (n === void 0)
|
|
3944
3945
|
return;
|
|
@@ -3954,7 +3955,7 @@ function po(e, t, i, s, r) {
|
|
|
3954
3955
|
return;
|
|
3955
3956
|
}
|
|
3956
3957
|
if (!s) {
|
|
3957
|
-
const d =
|
|
3958
|
+
const d = fo(n, a, t);
|
|
3958
3959
|
if (d === void 0)
|
|
3959
3960
|
return;
|
|
3960
3961
|
a = d;
|
|
@@ -3993,7 +3994,7 @@ function B(e) {
|
|
|
3993
3994
|
}
|
|
3994
3995
|
return t;
|
|
3995
3996
|
} else {
|
|
3996
|
-
if (
|
|
3997
|
+
if (mo.has(e.kind))
|
|
3997
3998
|
return [];
|
|
3998
3999
|
{
|
|
3999
4000
|
const t = me(e);
|
|
@@ -4001,7 +4002,7 @@ function B(e) {
|
|
|
4001
4002
|
}
|
|
4002
4003
|
}
|
|
4003
4004
|
}
|
|
4004
|
-
const
|
|
4005
|
+
const mo = /* @__PURE__ */ new Set([
|
|
4005
4006
|
o.SyntaxKind.NumericLiteral,
|
|
4006
4007
|
o.SyntaxKind.BigIntLiteral,
|
|
4007
4008
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4010,12 +4011,12 @@ const uo = /* @__PURE__ */ new Set([
|
|
|
4010
4011
|
o.SyntaxKind.FalseKeyword,
|
|
4011
4012
|
o.SyntaxKind.NullKeyword,
|
|
4012
4013
|
o.SyntaxKind.TrueKeyword
|
|
4013
|
-
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ?
|
|
4014
|
-
function
|
|
4014
|
+
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? yo(e, t) : e;
|
|
4015
|
+
function fo(e, t, i) {
|
|
4015
4016
|
if (e.every(ke, t))
|
|
4016
4017
|
return t;
|
|
4017
4018
|
if (o.isIdentifier(t)) {
|
|
4018
|
-
const s = o.isBlock(i.body) ? ze(i.body.statements, (n) =>
|
|
4019
|
+
const s = o.isBlock(i.body) ? ze(i.body.statements, (n) => go(n, t)) : void 0;
|
|
4019
4020
|
if (s === void 0)
|
|
4020
4021
|
return;
|
|
4021
4022
|
const r = Gi(s, e);
|
|
@@ -4023,7 +4024,7 @@ function mo(e, t, i) {
|
|
|
4023
4024
|
return r;
|
|
4024
4025
|
}
|
|
4025
4026
|
}
|
|
4026
|
-
function
|
|
4027
|
+
function go(e, t) {
|
|
4027
4028
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4028
4029
|
return;
|
|
4029
4030
|
const i = e.declarationList.declarations[0];
|
|
@@ -4031,13 +4032,13 @@ function fo(e, t) {
|
|
|
4031
4032
|
}
|
|
4032
4033
|
function ke(e) {
|
|
4033
4034
|
const t = this;
|
|
4034
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4035
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(ho, e);
|
|
4035
4036
|
}
|
|
4036
|
-
function
|
|
4037
|
+
function ho(e) {
|
|
4037
4038
|
const t = this;
|
|
4038
4039
|
return o.isOmittedExpression(e) ? !1 : ke.call(e.name, t);
|
|
4039
4040
|
}
|
|
4040
|
-
function
|
|
4041
|
+
function yo(e, t) {
|
|
4041
4042
|
let i = !1;
|
|
4042
4043
|
const s = e.elements.filter((r) => o.isIdentifier(r.name) ? t.includes(r.name.text) : (i = !0, !0));
|
|
4043
4044
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
@@ -4046,13 +4047,13 @@ const Xi = (e, t) => t.liftedKeys.has(e);
|
|
|
4046
4047
|
function q(e, t, i) {
|
|
4047
4048
|
if (pe(i))
|
|
4048
4049
|
return Yi(e, i);
|
|
4049
|
-
const s = o.isCallExpression(i) ?
|
|
4050
|
+
const s = o.isCallExpression(i) ? po(e, i) : i, r = o.visitEachChild(
|
|
4050
4051
|
s,
|
|
4051
4052
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4052
4053
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4053
4054
|
e.transformationContext
|
|
4054
4055
|
);
|
|
4055
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || pe(me(i.right)) ||
|
|
4056
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || pe(me(i.right)) || ir(i.right)) ? wo(r) : r;
|
|
4056
4057
|
}
|
|
4057
4058
|
function Yi(e, t) {
|
|
4058
4059
|
const i = Qi(e, t);
|
|
@@ -4066,17 +4067,17 @@ function Qi(e, t) {
|
|
|
4066
4067
|
if (o.isJsxNamespacedName(n))
|
|
4067
4068
|
throw Error(`JSX namespaced elements are not supported. Found ${n.getText(e.sourceFile)} `);
|
|
4068
4069
|
if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !== Re && n.text !== Oe) {
|
|
4069
|
-
const w = o.isIdentifier(n) && n.text ===
|
|
4070
|
+
const w = o.isIdentifier(n) && n.text === Bs ? Se(i, e) : {
|
|
4070
4071
|
// No need to wrap the function call in a lit-html tag
|
|
4071
4072
|
litTag: void 0,
|
|
4072
|
-
parts: [
|
|
4073
|
+
parts: [bo(e, t, n, i)]
|
|
4073
4074
|
};
|
|
4074
4075
|
return {
|
|
4075
|
-
key:
|
|
4076
|
+
key: vo(r, e),
|
|
4076
4077
|
...w
|
|
4077
4078
|
};
|
|
4078
4079
|
}
|
|
4079
|
-
const c = n.text === Re ? Ce : n.text === Oe ? He : n.text, d = n.text === Re ? se : n.text === Oe ? X :
|
|
4080
|
+
const c = n.text === Re ? Ce : n.text === Oe ? He : n.text, d = n.text === Re ? se : n.text === Oe ? X : _s.has(c) ? ci : it.has(c) ? ee : re, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, u = p === void 0 ? void 0 : new Set(p);
|
|
4080
4081
|
let f;
|
|
4081
4082
|
const g = [];
|
|
4082
4083
|
let h = !1;
|
|
@@ -4089,13 +4090,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4089
4090
|
const { name: w, initializer: L } = x;
|
|
4090
4091
|
if (o.isJsxNamespacedName(w))
|
|
4091
4092
|
throw Error(`JSX namespaced attributes are not supported. Found ${w.getText(e.sourceFile)}`);
|
|
4092
|
-
const A = w.text, z =
|
|
4093
|
+
const A = w.text, z = to(L), j = z?.propType ?? io(A, L, c);
|
|
4093
4094
|
u?.delete(A);
|
|
4094
|
-
const N =
|
|
4095
|
+
const N = Yn[j](e, z?.initializer ?? L, A, c);
|
|
4095
4096
|
if (N.length === 0)
|
|
4096
4097
|
return [];
|
|
4097
|
-
const K = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4098
|
-
return j === "key" ? (f = typeof N[0] == "object" && !Xi(w, e) ? N[0] : void 0, K.some(
|
|
4098
|
+
const K = e.compiler.shouldMinifyJsx ? [" "] : lo(zi(w, e));
|
|
4099
|
+
return j === "key" ? (f = typeof N[0] == "object" && !Xi(w, e) ? N[0] : void 0, K.some(no) ? K : []) : j === "directives" || j === "ref" || A === "deferLoad" ? (h ||= j === "deferLoad", g.push(
|
|
4099
4100
|
...K,
|
|
4100
4101
|
...N.flatMap(
|
|
4101
4102
|
(D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
|
|
@@ -4111,7 +4112,7 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4111
4112
|
`JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
|
|
4112
4113
|
);
|
|
4113
4114
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4114
|
-
const v = typeof c == "string" &&
|
|
4115
|
+
const v = typeof c == "string" && Ks.has(c), C = Se(i, e);
|
|
4115
4116
|
if (v && C.parts.length > 0)
|
|
4116
4117
|
throw Error(
|
|
4117
4118
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
@@ -4135,12 +4136,12 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4135
4136
|
];
|
|
4136
4137
|
return { key: f, parts: T, litTag: d };
|
|
4137
4138
|
}
|
|
4138
|
-
function
|
|
4139
|
+
function vo(e, t) {
|
|
4139
4140
|
const i = e.attributes.properties[Zi(e)];
|
|
4140
4141
|
return i && o.isJsxAttribute(i) && !Xi(i.name, t) ? ct(i.initializer, t.sourceFile) : void 0;
|
|
4141
4142
|
}
|
|
4142
4143
|
const Zi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4143
|
-
function
|
|
4144
|
+
function bo(e, t, i, s) {
|
|
4144
4145
|
const n = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4145
4146
|
if (o.isJsxSpreadAttribute(d))
|
|
4146
4147
|
return Hi(zi(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
@@ -4165,7 +4166,7 @@ function Se(e, t) {
|
|
|
4165
4166
|
let i;
|
|
4166
4167
|
const s = e.flatMap((r) => {
|
|
4167
4168
|
if (o.isJsxText(r))
|
|
4168
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4169
|
+
return [t.compiler.shouldMinifyJsx ? Ws(r.text) : r.text];
|
|
4169
4170
|
if (o.isJsxExpression(r))
|
|
4170
4171
|
return pt(t, r, r);
|
|
4171
4172
|
{
|
|
@@ -4184,7 +4185,7 @@ function Se(e, t) {
|
|
|
4184
4185
|
});
|
|
4185
4186
|
return { litTag: i, parts: s };
|
|
4186
4187
|
}
|
|
4187
|
-
function
|
|
4188
|
+
function wo(e) {
|
|
4188
4189
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4189
4190
|
e,
|
|
4190
4191
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4240,12 +4241,12 @@ const es = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), t
|
|
|
4240
4241
|
([e, t]) => t.map((i) => [i, e])
|
|
4241
4242
|
)
|
|
4242
4243
|
), is = new Set(Object.keys(ts));
|
|
4243
|
-
function
|
|
4244
|
+
function So(e, t) {
|
|
4244
4245
|
const i = t.importClause, s = i === void 0, r = t.moduleSpecifier;
|
|
4245
4246
|
if (!o.isStringLiteral(r))
|
|
4246
4247
|
return t;
|
|
4247
|
-
const n =
|
|
4248
|
-
if (a && e.existingImportedModules.add(n),
|
|
4248
|
+
const n = Eo(e.sourceFile.fileName, r.text, ""), a = !i?.isTypeOnly;
|
|
4249
|
+
if (a && e.existingImportedModules.add(n), rr.test(r.text) && // If id already includes ?, bypass our custom behavior
|
|
4249
4250
|
!r.text.includes("?")) {
|
|
4250
4251
|
if (s) {
|
|
4251
4252
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4293,7 +4294,7 @@ function wo(e, t) {
|
|
|
4293
4294
|
let l = !1;
|
|
4294
4295
|
const p = c.elements.filter((f) => {
|
|
4295
4296
|
const g = (f.propertyName ?? f.name).text;
|
|
4296
|
-
return
|
|
4297
|
+
return sr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4297
4298
|
});
|
|
4298
4299
|
if (p.length === 0)
|
|
4299
4300
|
return;
|
|
@@ -4322,11 +4323,11 @@ function wo(e, t) {
|
|
|
4322
4323
|
}
|
|
4323
4324
|
return t;
|
|
4324
4325
|
}
|
|
4325
|
-
const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? X : e,
|
|
4326
|
-
function
|
|
4327
|
-
return o.isImportDeclaration(e) ?
|
|
4326
|
+
const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? X : e, Eo = (e, t, i) => t.startsWith(".") ? m.resolve(e, "..", `${t}${i}`) : t;
|
|
4327
|
+
function Co(e) {
|
|
4328
|
+
return o.isImportDeclaration(e) ? To(this, e) : e;
|
|
4328
4329
|
}
|
|
4329
|
-
function
|
|
4330
|
+
function To(e, t) {
|
|
4330
4331
|
const i = t.importClause, s = i?.namedBindings, r = t.moduleSpecifier;
|
|
4331
4332
|
if (!o.isStringLiteral(r) || !s || !o.isNamedImports(s) || !is.has(r.text))
|
|
4332
4333
|
return t;
|
|
@@ -4351,7 +4352,7 @@ function Co(e, t) {
|
|
|
4351
4352
|
t.attributes
|
|
4352
4353
|
) : t;
|
|
4353
4354
|
}
|
|
4354
|
-
function
|
|
4355
|
+
function $o(e) {
|
|
4355
4356
|
const t = es(
|
|
4356
4357
|
Array.from(e.neededImports, (i) => [te[i][0], i])
|
|
4357
4358
|
);
|
|
@@ -4377,12 +4378,12 @@ function rs(e, t) {
|
|
|
4377
4378
|
o.factory.createIdentifier(s)
|
|
4378
4379
|
);
|
|
4379
4380
|
}
|
|
4380
|
-
function
|
|
4381
|
-
const t =
|
|
4381
|
+
function Po(e) {
|
|
4382
|
+
const t = Tr().map(({ packageName: i }) => i);
|
|
4382
4383
|
return e.existingImportedModules.forEach((i) => {
|
|
4383
4384
|
if (m.isAbsolute(i))
|
|
4384
4385
|
return;
|
|
4385
|
-
const s =
|
|
4386
|
+
const s = Ms(i), r = i.slice(s.length + 1);
|
|
4386
4387
|
if (t.includes(s ?? "") && (r.startsWith("dist/components") || r.startsWith("components"))) {
|
|
4387
4388
|
const n = xe(e.sourceFile.fileName);
|
|
4388
4389
|
throw new Error(
|
|
@@ -4391,7 +4392,7 @@ function $o(e) {
|
|
|
4391
4392
|
}
|
|
4392
4393
|
}), [];
|
|
4393
4394
|
}
|
|
4394
|
-
function
|
|
4395
|
+
function Io(e) {
|
|
4395
4396
|
if (e.compiler.viteCommand === "serve")
|
|
4396
4397
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4397
4398
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4406,7 +4407,7 @@ function Po(e) {
|
|
|
4406
4407
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4407
4408
|
}), [];
|
|
4408
4409
|
}
|
|
4409
|
-
const
|
|
4410
|
+
const ko = (e, t) => {
|
|
4410
4411
|
const i = e.pragmas;
|
|
4411
4412
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4412
4413
|
return e.statements;
|
|
@@ -4430,7 +4431,7 @@ const Io = (e, t) => {
|
|
|
4430
4431
|
localComponents: Ui(t.compiler),
|
|
4431
4432
|
sourceFile: e,
|
|
4432
4433
|
transformationContext: t.transformation,
|
|
4433
|
-
importRenames:
|
|
4434
|
+
importRenames: xo(e),
|
|
4434
4435
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4435
4436
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4436
4437
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4444,7 +4445,7 @@ const Io = (e, t) => {
|
|
|
4444
4445
|
let a = [];
|
|
4445
4446
|
if (e.statements.every((d) => {
|
|
4446
4447
|
if (o.isImportDeclaration(d)) {
|
|
4447
|
-
const l =
|
|
4448
|
+
const l = So(n, d);
|
|
4448
4449
|
if (l === void 0)
|
|
4449
4450
|
return !0;
|
|
4450
4451
|
if (a.push(l), n.hasNonLuminaJsxImport)
|
|
@@ -4454,11 +4455,11 @@ const Io = (e, t) => {
|
|
|
4454
4455
|
return !0;
|
|
4455
4456
|
}), n.hasNonLuminaJsxImport)
|
|
4456
4457
|
return e.statements;
|
|
4457
|
-
if (n.neededImports.size > 0 && (a = a.map(
|
|
4458
|
+
if (n.neededImports.size > 0 && (a = a.map(Co, n), n.existingLitImports.size > 0))
|
|
4458
4459
|
throw new Error(
|
|
4459
4460
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
|
|
4460
4461
|
);
|
|
4461
|
-
const c = [
|
|
4462
|
+
const c = [$o, Po, Io].flatMap(
|
|
4462
4463
|
(d) => d(n)
|
|
4463
4464
|
);
|
|
4464
4465
|
if (n.neededImports.size > 0)
|
|
@@ -4467,18 +4468,18 @@ const Io = (e, t) => {
|
|
|
4467
4468
|
);
|
|
4468
4469
|
return [...c, ...a];
|
|
4469
4470
|
};
|
|
4470
|
-
function
|
|
4471
|
-
return
|
|
4472
|
-
|
|
4471
|
+
function xo(e) {
|
|
4472
|
+
return Ao(e), Object.fromEntries(
|
|
4473
|
+
tr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4473
4474
|
);
|
|
4474
4475
|
}
|
|
4475
|
-
function
|
|
4476
|
+
function Ao(e) {
|
|
4476
4477
|
if (!("identifiers" in e))
|
|
4477
4478
|
throw new Error(
|
|
4478
4479
|
"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."
|
|
4479
4480
|
);
|
|
4480
4481
|
}
|
|
4481
|
-
const Ut = "customElement",
|
|
4482
|
+
const Ut = "customElement", No = (e, t) => {
|
|
4482
4483
|
const i = [];
|
|
4483
4484
|
if (t.apiModule?.declarations.forEach((n) => {
|
|
4484
4485
|
const a = n;
|
|
@@ -4508,7 +4509,7 @@ const Ut = "customElement", Ao = (e, t) => {
|
|
|
4508
4509
|
o.factory.createStringLiteral(s)
|
|
4509
4510
|
), ...e.statements, ...i];
|
|
4510
4511
|
};
|
|
4511
|
-
function
|
|
4512
|
+
function Lo(e, t, i) {
|
|
4512
4513
|
return t.size === 0 ? e : [
|
|
4513
4514
|
o.factory.createPropertyDeclaration(
|
|
4514
4515
|
[
|
|
@@ -4523,7 +4524,7 @@ function No(e, t, i) {
|
|
|
4523
4524
|
t.entries(),
|
|
4524
4525
|
([s, r]) => o.factory.createPropertyAssignment(
|
|
4525
4526
|
ti(s) ? o.factory.createStringLiteral(s) : s,
|
|
4526
|
-
|
|
4527
|
+
jo(r, i)
|
|
4527
4528
|
)
|
|
4528
4529
|
)
|
|
4529
4530
|
)
|
|
@@ -4531,7 +4532,7 @@ function No(e, t, i) {
|
|
|
4531
4532
|
...e
|
|
4532
4533
|
];
|
|
4533
4534
|
}
|
|
4534
|
-
function
|
|
4535
|
+
function jo(e, t) {
|
|
4535
4536
|
let i = 0, s = !0;
|
|
4536
4537
|
const r = [], n = [];
|
|
4537
4538
|
for (const d of e.properties)
|
|
@@ -4576,7 +4577,7 @@ function Lo(e, t) {
|
|
|
4576
4577
|
...t ? [] : [o.factory.createObjectLiteralExpression(n)]
|
|
4577
4578
|
]);
|
|
4578
4579
|
}
|
|
4579
|
-
function
|
|
4580
|
+
function Fo(e, t, i) {
|
|
4580
4581
|
let s = -1, r = -1, n = -1;
|
|
4581
4582
|
e.options?.properties.forEach((p, u) => {
|
|
4582
4583
|
if (o.isSpreadAssignment(p))
|
|
@@ -4588,23 +4589,23 @@ function jo(e, t, i) {
|
|
|
4588
4589
|
f === "type" ? s = u : f === "attribute" ? r = u : f === "readOnly" && (n = u);
|
|
4589
4590
|
}
|
|
4590
4591
|
});
|
|
4591
|
-
const a = i.attribute === void 0 && r === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, d =
|
|
4592
|
+
const a = i.attribute === void 0 && r === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, d = Do(e, i, s), l = [
|
|
4592
4593
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4593
4594
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4594
4595
|
...d !== void 0 ? [d] : []
|
|
4595
4596
|
];
|
|
4596
4597
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4597
4598
|
}
|
|
4598
|
-
function
|
|
4599
|
+
function Do(e, t, i) {
|
|
4599
4600
|
if (t.attribute === void 0)
|
|
4600
4601
|
return;
|
|
4601
|
-
const s =
|
|
4602
|
+
const s = Ro(t.type.values);
|
|
4602
4603
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4603
4604
|
o.factory.createIdentifier("type"),
|
|
4604
4605
|
o.factory.createIdentifier(s)
|
|
4605
4606
|
);
|
|
4606
4607
|
}
|
|
4607
|
-
function
|
|
4608
|
+
function Ro(e) {
|
|
4608
4609
|
let t = !1, i = !1, s = !1;
|
|
4609
4610
|
if (e?.forEach((r) => {
|
|
4610
4611
|
t ||= r.type === "number", i ||= r.type === "boolean", s ||= r.type === "string" || r.type === "any" || r.type === "unknown";
|
|
@@ -4616,7 +4617,7 @@ function Do(e) {
|
|
|
4616
4617
|
}
|
|
4617
4618
|
return "Other";
|
|
4618
4619
|
}
|
|
4619
|
-
function
|
|
4620
|
+
function Oo(e, t, i, s, r, n) {
|
|
4620
4621
|
if (i.modifiers === void 0)
|
|
4621
4622
|
return i;
|
|
4622
4623
|
let a = -1, c = -1;
|
|
@@ -4626,7 +4627,7 @@ function Ro(e, t, i, s, r, n) {
|
|
|
4626
4627
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4627
4628
|
}
|
|
4628
4629
|
}), a !== -1) {
|
|
4629
|
-
const d =
|
|
4630
|
+
const d = Mo(e, t, i, s, r), l = Wt(i, a, r), p = Fo(l, r, d);
|
|
4630
4631
|
return n.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, zt(i, a);
|
|
4631
4632
|
} else if (c !== -1) {
|
|
4632
4633
|
const d = Wt(i, c, r), 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]), u = ii(i.name);
|
|
@@ -4636,7 +4637,7 @@ function Ro(e, t, i, s, r, n) {
|
|
|
4636
4637
|
} else
|
|
4637
4638
|
return i;
|
|
4638
4639
|
}
|
|
4639
|
-
function
|
|
4640
|
+
function Mo(e, t, i, s, r) {
|
|
4640
4641
|
const n = t ?? (e.compiler.isInTest ? {
|
|
4641
4642
|
members: []
|
|
4642
4643
|
} : void 0);
|
|
@@ -4696,7 +4697,7 @@ function zt(e, t) {
|
|
|
4696
4697
|
e.initializer
|
|
4697
4698
|
);
|
|
4698
4699
|
}
|
|
4699
|
-
function
|
|
4700
|
+
function Jo(e, t, i, s) {
|
|
4700
4701
|
let r;
|
|
4701
4702
|
if (e.apiJsonEnabled)
|
|
4702
4703
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4719,9 +4720,9 @@ function Mo(e, t, i, s) {
|
|
|
4719
4720
|
} finally {
|
|
4720
4721
|
c = i.statements, i.statements = a;
|
|
4721
4722
|
}
|
|
4722
|
-
return
|
|
4723
|
+
return Bo(i, c);
|
|
4723
4724
|
}
|
|
4724
|
-
const
|
|
4725
|
+
const Bo = (e, t) => o.factory.updateSourceFile(
|
|
4725
4726
|
e,
|
|
4726
4727
|
t,
|
|
4727
4728
|
/*
|
|
@@ -4736,10 +4737,10 @@ const Jo = (e, t) => o.factory.updateSourceFile(
|
|
|
4736
4737
|
e.hasNoDefaultLib,
|
|
4737
4738
|
e.libReferenceDirectives
|
|
4738
4739
|
);
|
|
4739
|
-
function
|
|
4740
|
+
function Ko(e, t) {
|
|
4740
4741
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4741
4742
|
}
|
|
4742
|
-
const
|
|
4743
|
+
const _o = (e, t) => {
|
|
4743
4744
|
let i;
|
|
4744
4745
|
if (t.apiModule !== void 0)
|
|
4745
4746
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4755,10 +4756,10 @@ const Ko = (e, t) => {
|
|
|
4755
4756
|
function r() {
|
|
4756
4757
|
s = /* @__PURE__ */ new Map();
|
|
4757
4758
|
}
|
|
4758
|
-
const n = (d) =>
|
|
4759
|
+
const n = (d) => Lo(d, s, t.compiler.shouldMinify);
|
|
4759
4760
|
function a(d, l) {
|
|
4760
|
-
const p =
|
|
4761
|
-
return
|
|
4761
|
+
const p = Wo(t, i, d, l, e, s);
|
|
4762
|
+
return Ko(p, t), p;
|
|
4762
4763
|
}
|
|
4763
4764
|
return e.statements.map(
|
|
4764
4765
|
(d) => ns(a, d, t, r, n)
|
|
@@ -4791,11 +4792,11 @@ function ns(e, t, i, s, r = si) {
|
|
|
4791
4792
|
i.transformation
|
|
4792
4793
|
) : t;
|
|
4793
4794
|
}
|
|
4794
|
-
const
|
|
4795
|
-
function
|
|
4795
|
+
const Uo = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4796
|
+
function Wo(e, t, i, s, r, n) {
|
|
4796
4797
|
if (o.isMethodDeclaration(i)) {
|
|
4797
4798
|
const a = i.modifiers?.filter(
|
|
4798
|
-
(c) => !o.isDecorator(c) || !
|
|
4799
|
+
(c) => !o.isDecorator(c) || !zo(c)
|
|
4799
4800
|
);
|
|
4800
4801
|
if (a?.length !== i.modifiers?.length)
|
|
4801
4802
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4809,7 +4810,7 @@ function Uo(e, t, i, s, r, n) {
|
|
|
4809
4810
|
i.type,
|
|
4810
4811
|
i.body
|
|
4811
4812
|
);
|
|
4812
|
-
if ("text" in i.name &&
|
|
4813
|
+
if ("text" in i.name && Uo.has(i.name.text) && i.body) {
|
|
4813
4814
|
const c = i.name.text;
|
|
4814
4815
|
return i.body.statements.some(
|
|
4815
4816
|
(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
|
|
@@ -4835,14 +4836,14 @@ function Uo(e, t, i, s, r, n) {
|
|
|
4835
4836
|
);
|
|
4836
4837
|
}
|
|
4837
4838
|
}
|
|
4838
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
4839
|
-
}
|
|
4840
|
-
const
|
|
4841
|
-
|
|
4842
|
-
|
|
4843
|
-
|
|
4844
|
-
],
|
|
4845
|
-
name:
|
|
4839
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Oo(e, t, i, s, r, n) : i;
|
|
4840
|
+
}
|
|
4841
|
+
const zo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", Ho = [
|
|
4842
|
+
ko,
|
|
4843
|
+
No,
|
|
4844
|
+
_o
|
|
4845
|
+
], qo = "@arcgis/lumina:transformComponents", Vo = (e) => ({
|
|
4846
|
+
name: qo,
|
|
4846
4847
|
transform: {
|
|
4847
4848
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4848
4849
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -4859,11 +4860,11 @@ const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4859
4860
|
e.apiJsonDeferred === void 0 ? [ie] : [ie, e.apiJsonDeferred.promise]
|
|
4860
4861
|
);
|
|
4861
4862
|
const s = e.getSourceFile(i, t), n = o.transform(s, [
|
|
4862
|
-
(u) => () =>
|
|
4863
|
+
(u) => () => Jo(e, u, s, [
|
|
4863
4864
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4864
|
-
...
|
|
4865
|
+
...Ho
|
|
4865
4866
|
])
|
|
4866
|
-
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(
|
|
4867
|
+
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(Go, m.basename(i), "", m.dirname(i), {}), d = yt.createTextWriter(`
|
|
4867
4868
|
`);
|
|
4868
4869
|
a.writeFile(n, d, c);
|
|
4869
4870
|
const l = d.getText(), p = c?.toJSON();
|
|
@@ -4873,10 +4874,10 @@ const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4873
4874
|
};
|
|
4874
4875
|
}
|
|
4875
4876
|
}
|
|
4876
|
-
}),
|
|
4877
|
+
}), Go = {
|
|
4877
4878
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
4878
4879
|
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? si : (e) => e.toLowerCase()
|
|
4879
|
-
},
|
|
4880
|
+
}, Xo = (e) => ({
|
|
4880
4881
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
4881
4882
|
configureServer(t) {
|
|
4882
4883
|
e.server = t, Ht(e).forEach(({ assets: i, transformers: s }) => de(e, i, s));
|
|
@@ -4895,20 +4896,20 @@ function Ht(e) {
|
|
|
4895
4896
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
4896
4897
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
4897
4898
|
}
|
|
4898
|
-
const et = "@arcgis/lumina:updatePackageJson",
|
|
4899
|
+
const et = "@arcgis/lumina:updatePackageJson", Yo = (e) => ({
|
|
4899
4900
|
name: et,
|
|
4900
4901
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
4901
4902
|
configResolved() {
|
|
4902
|
-
|
|
4903
|
+
Qo(e).catch(
|
|
4903
4904
|
(t) => E.error(et, `Failed to update package's package.json:${String(t)}`)
|
|
4904
4905
|
);
|
|
4905
4906
|
}
|
|
4906
4907
|
});
|
|
4907
|
-
async function
|
|
4908
|
-
const t = m.join(e.dir.root, "package.json"), i = JSON.parse(await H(t, "utf-8")), s =
|
|
4908
|
+
async function Qo(e) {
|
|
4909
|
+
const t = m.join(e.dir.root, "package.json"), i = JSON.parse(await H(t, "utf-8")), s = Zo(i, e);
|
|
4909
4910
|
s && ei(t, JSON.stringify(s, null, 2));
|
|
4910
4911
|
}
|
|
4911
|
-
function
|
|
4912
|
+
function Zo(e, t) {
|
|
4912
4913
|
const i = e?.devDependencies ?? {};
|
|
4913
4914
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
4914
4915
|
l in i || E.warn(
|
|
@@ -4947,20 +4948,20 @@ function Qo(e, t) {
|
|
|
4947
4948
|
if (s)
|
|
4948
4949
|
return e;
|
|
4949
4950
|
}
|
|
4950
|
-
const
|
|
4951
|
+
const ea = (e) => ({
|
|
4951
4952
|
timestamp: e.apiJson.timestamp,
|
|
4952
4953
|
compiler: e.apiJson.compiler,
|
|
4953
|
-
components:
|
|
4954
|
+
components: ta(e),
|
|
4954
4955
|
typeLibrary: {}
|
|
4955
4956
|
});
|
|
4956
|
-
function
|
|
4957
|
+
function ta(e) {
|
|
4957
4958
|
const t = [];
|
|
4958
4959
|
for (const i of e.apiJson.modules)
|
|
4959
4960
|
for (const s of i.declarations)
|
|
4960
|
-
s.customElement === !0 && t.push(
|
|
4961
|
+
s.customElement === !0 && t.push(ia(s, i.sourcePath));
|
|
4961
4962
|
return t;
|
|
4962
4963
|
}
|
|
4963
|
-
function
|
|
4964
|
+
function ia(e, t) {
|
|
4964
4965
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
4965
4966
|
return {
|
|
4966
4967
|
filePath: t,
|
|
@@ -4975,9 +4976,9 @@ function ta(e, t) {
|
|
|
4975
4976
|
dependencies: [],
|
|
4976
4977
|
dependencyGraph: {},
|
|
4977
4978
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
4978
|
-
props: e.members.map(
|
|
4979
|
-
methods: e.members.map(
|
|
4980
|
-
events: e.events?.map(
|
|
4979
|
+
props: e.members.map(sa).filter(F),
|
|
4980
|
+
methods: e.members.map(ra).filter(F),
|
|
4981
|
+
events: e.events?.map(na) ?? [],
|
|
4981
4982
|
styles: e.cssProperties?.map((s) => ({
|
|
4982
4983
|
name: s.name,
|
|
4983
4984
|
annotation: "prop",
|
|
@@ -4989,7 +4990,7 @@ function ta(e, t) {
|
|
|
4989
4990
|
listeners: []
|
|
4990
4991
|
};
|
|
4991
4992
|
}
|
|
4992
|
-
function
|
|
4993
|
+
function sa(e) {
|
|
4993
4994
|
if (e.kind !== "field")
|
|
4994
4995
|
return;
|
|
4995
4996
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], r = t.docsTags?.some((n) => n.name === "required") ?? !1;
|
|
@@ -5030,7 +5031,7 @@ const ut = (e) => Object.fromEntries(
|
|
|
5030
5031
|
]
|
|
5031
5032
|
) ?? []
|
|
5032
5033
|
);
|
|
5033
|
-
function
|
|
5034
|
+
function ra(e) {
|
|
5034
5035
|
if (e.kind !== "method")
|
|
5035
5036
|
return;
|
|
5036
5037
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: r, type: n, description: a }) => ({
|
|
@@ -5061,7 +5062,7 @@ function sa(e) {
|
|
|
5061
5062
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5062
5063
|
};
|
|
5063
5064
|
}
|
|
5064
|
-
function
|
|
5065
|
+
function na(e) {
|
|
5065
5066
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5066
5067
|
return {
|
|
5067
5068
|
event: e.name,
|
|
@@ -5090,7 +5091,7 @@ const os = (e) => e.flatMap(
|
|
|
5090
5091
|
description: i.description || void 0
|
|
5091
5092
|
})) ?? []
|
|
5092
5093
|
);
|
|
5093
|
-
function
|
|
5094
|
+
function oa(e) {
|
|
5094
5095
|
if (e.attributes === void 0)
|
|
5095
5096
|
return [];
|
|
5096
5097
|
const t = [];
|
|
@@ -5101,7 +5102,7 @@ function na(e) {
|
|
|
5101
5102
|
description: je(s.description, s.deprecated) || void 0,
|
|
5102
5103
|
default: s.default,
|
|
5103
5104
|
value: {
|
|
5104
|
-
type:
|
|
5105
|
+
type: aa(
|
|
5105
5106
|
s.type.values?.map(
|
|
5106
5107
|
(r) => r.type === "string" && r.value !== void 0 ? `"${r.value}"` : r.value ?? r.type
|
|
5107
5108
|
)
|
|
@@ -5111,7 +5112,7 @@ function na(e) {
|
|
|
5111
5112
|
}
|
|
5112
5113
|
return t;
|
|
5113
5114
|
}
|
|
5114
|
-
const
|
|
5115
|
+
const aa = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
|
|
5115
5116
|
slots: "Slots",
|
|
5116
5117
|
events: "Events",
|
|
5117
5118
|
cssProperties: "CSS Properties",
|
|
@@ -5119,7 +5120,7 @@ const oa = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1
|
|
|
5119
5120
|
methods: "Methods"
|
|
5120
5121
|
};
|
|
5121
5122
|
function ls(e) {
|
|
5122
|
-
const t =
|
|
5123
|
+
const t = la(e.slots), i = ca(e.events), s = da(e.cssProperties), r = pa(e.cssParts), n = ua(e.members), a = je(e.description, e.deprecated).trim();
|
|
5123
5124
|
return [...a ? [`${a}
|
|
5124
5125
|
--`] : [], i, n, t, s, r].filter(Boolean).join(`
|
|
5125
5126
|
|
|
@@ -5127,28 +5128,28 @@ function ls(e) {
|
|
|
5127
5128
|
}
|
|
5128
5129
|
const he = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5129
5130
|
${t.join(`
|
|
5130
|
-
`)}`,
|
|
5131
|
+
`)}`, la = (e) => he(
|
|
5131
5132
|
ge.slots,
|
|
5132
5133
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
5133
|
-
),
|
|
5134
|
+
), ca = (e) => he(
|
|
5134
5135
|
ge.events,
|
|
5135
5136
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
5136
|
-
),
|
|
5137
|
+
), da = (e = []) => he(
|
|
5137
5138
|
ge.cssProperties,
|
|
5138
5139
|
e?.map(
|
|
5139
5140
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5140
5141
|
)
|
|
5141
|
-
),
|
|
5142
|
+
), pa = (e) => he(
|
|
5142
5143
|
ge.cssParts,
|
|
5143
5144
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
5144
|
-
),
|
|
5145
|
+
), ua = (e) => he(
|
|
5145
5146
|
ge.methods,
|
|
5146
5147
|
e.filter(Cs).map(
|
|
5147
5148
|
(t) => [`- \`${t.name}${t.signature}\``, je(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
5148
5149
|
)
|
|
5149
5150
|
);
|
|
5150
|
-
function
|
|
5151
|
-
const i =
|
|
5151
|
+
function ma(e, t) {
|
|
5152
|
+
const i = fa(e), s = os(e), r = as(e), n = O();
|
|
5152
5153
|
return {
|
|
5153
5154
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5154
5155
|
name: n.name,
|
|
@@ -5166,11 +5167,11 @@ function ua(e, t) {
|
|
|
5166
5167
|
}
|
|
5167
5168
|
};
|
|
5168
5169
|
}
|
|
5169
|
-
const
|
|
5170
|
+
const fa = (e) => e.map((t) => ({
|
|
5170
5171
|
name: t.tagName,
|
|
5171
5172
|
description: ls(t),
|
|
5172
5173
|
"doc-url": t.demos?.[0]?.url,
|
|
5173
|
-
attributes:
|
|
5174
|
+
attributes: oa(t),
|
|
5174
5175
|
slots: t.slots?.map((i) => ({
|
|
5175
5176
|
name: i.name,
|
|
5176
5177
|
description: i.description
|
|
@@ -5178,10 +5179,10 @@ const ma = (e) => e.map((t) => ({
|
|
|
5178
5179
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5179
5180
|
events: qt(t),
|
|
5180
5181
|
js: {
|
|
5181
|
-
properties:
|
|
5182
|
+
properties: ga(t),
|
|
5182
5183
|
events: qt(t)
|
|
5183
5184
|
}
|
|
5184
|
-
})),
|
|
5185
|
+
})), ga = (e) => e.members.filter(Ts).map((t) => ({
|
|
5185
5186
|
name: t.name,
|
|
5186
5187
|
description: t.description,
|
|
5187
5188
|
type: t.type?.text
|
|
@@ -5189,34 +5190,34 @@ const ma = (e) => e.map((t) => ({
|
|
|
5189
5190
|
name: t.name,
|
|
5190
5191
|
type: t.type?.text,
|
|
5191
5192
|
description: t.description
|
|
5192
|
-
})) ?? [],
|
|
5193
|
+
})) ?? [], ha = (e) => e.map((t) => ({
|
|
5193
5194
|
name: t.tagName,
|
|
5194
5195
|
description: ls(t),
|
|
5195
|
-
attributes:
|
|
5196
|
+
attributes: ya(t),
|
|
5196
5197
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5197
|
-
})),
|
|
5198
|
+
})), ya = (e) => e.attributes?.map((t) => ({
|
|
5198
5199
|
name: t.name,
|
|
5199
5200
|
description: je(t.description, t.deprecated) || void 0,
|
|
5200
|
-
values:
|
|
5201
|
-
})) ?? [],
|
|
5201
|
+
values: va(t)
|
|
5202
|
+
})) ?? [], va = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], ba = (e) => ({
|
|
5202
5203
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5203
5204
|
version: 1.1,
|
|
5204
|
-
tags:
|
|
5205
|
-
}),
|
|
5205
|
+
tags: ha(e)
|
|
5206
|
+
}), wa = (e) => ({
|
|
5206
5207
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5207
5208
|
version: 1.1,
|
|
5208
5209
|
properties: os(e),
|
|
5209
5210
|
pseudoElements: as(e)
|
|
5210
|
-
}),
|
|
5211
|
-
function
|
|
5211
|
+
}), Sa = "@arcgis/lumina:generateDocs";
|
|
5212
|
+
function Ea(e) {
|
|
5212
5213
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5213
5214
|
{
|
|
5214
5215
|
type: "dynamic",
|
|
5215
|
-
source: () => JSON.stringify(
|
|
5216
|
+
source: () => JSON.stringify(ea(e), null, Ze(e)),
|
|
5216
5217
|
destination: m.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5217
5218
|
}
|
|
5218
5219
|
]), {
|
|
5219
|
-
name:
|
|
5220
|
+
name: Sa,
|
|
5220
5221
|
async writeBundle() {
|
|
5221
5222
|
if (e.isInStorybook)
|
|
5222
5223
|
return;
|
|
@@ -5226,53 +5227,53 @@ function Sa(e) {
|
|
|
5226
5227
|
await Mi(c);
|
|
5227
5228
|
const d = [];
|
|
5228
5229
|
if (r !== void 0) {
|
|
5229
|
-
const l = JSON.stringify(
|
|
5230
|
+
const l = JSON.stringify(ba(e.apiJsonComponents), null, t);
|
|
5230
5231
|
d.push(U(r, l));
|
|
5231
5232
|
}
|
|
5232
5233
|
if (n !== void 0) {
|
|
5233
|
-
const l = JSON.stringify(
|
|
5234
|
+
const l = JSON.stringify(wa(e.apiJsonComponents), null, t);
|
|
5234
5235
|
d.push(U(n, l));
|
|
5235
5236
|
}
|
|
5236
5237
|
if (a !== void 0) {
|
|
5237
|
-
const l =
|
|
5238
|
+
const l = ma(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5238
5239
|
d.push(U(a, JSON.stringify(l, null, t)));
|
|
5239
5240
|
}
|
|
5240
5241
|
await Promise.all(d);
|
|
5241
5242
|
}
|
|
5242
5243
|
};
|
|
5243
5244
|
}
|
|
5244
|
-
function
|
|
5245
|
+
function Ca(e) {
|
|
5245
5246
|
return {
|
|
5246
5247
|
name: "@arcgis/lumina:buildWrappers",
|
|
5247
5248
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5248
5249
|
async writeBundle() {
|
|
5249
5250
|
e.isInStorybook || await Promise.all(
|
|
5250
5251
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5251
|
-
t.type === "react18" && await
|
|
5252
|
+
t.type === "react18" && await Pa(e, t);
|
|
5252
5253
|
}) ?? []
|
|
5253
5254
|
);
|
|
5254
5255
|
}
|
|
5255
5256
|
};
|
|
5256
5257
|
}
|
|
5257
|
-
const
|
|
5258
|
-
import React from "${
|
|
5258
|
+
const Ta = "react", Vt = "@lit/react", $a = `
|
|
5259
|
+
import React from "${Ta}";
|
|
5259
5260
|
import { createComponent } from "${Vt}";
|
|
5260
5261
|
import type { EventName } from "${Vt}";
|
|
5261
5262
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5262
5263
|
|
|
5263
5264
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5264
5265
|
`;
|
|
5265
|
-
async function
|
|
5266
|
+
async function Pa(e, t) {
|
|
5266
5267
|
const { name: i } = O(), s = [];
|
|
5267
5268
|
for (const a of e.apiJson.modules)
|
|
5268
5269
|
for (const c of a.declarations)
|
|
5269
|
-
c.customElement === !0 && s.push(
|
|
5270
|
-
const r = [`/// <reference types="${i}" preserve="true" />`,
|
|
5270
|
+
c.customElement === !0 && s.push(Ia(c));
|
|
5271
|
+
const r = [`/// <reference types="${i}" preserve="true" />`, $a, ...s].join(""), n = m.resolve(t.proxiesFile);
|
|
5271
5272
|
await G(m.dirname(n), { recursive: !0 }), await U(n, r);
|
|
5272
5273
|
}
|
|
5273
|
-
function
|
|
5274
|
+
function Ia(e) {
|
|
5274
5275
|
const t = e.events?.map(
|
|
5275
|
-
(i) => ` ${
|
|
5276
|
+
(i) => ` ${Os(`on${ps(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5276
5277
|
).join(`
|
|
5277
5278
|
`);
|
|
5278
5279
|
return `
|
|
@@ -5287,29 +5288,29 @@ ${t}
|
|
|
5287
5288
|
);
|
|
5288
5289
|
`;
|
|
5289
5290
|
}
|
|
5290
|
-
function
|
|
5291
|
+
function Qa(e = {}) {
|
|
5291
5292
|
const t = new $(e), s = [
|
|
5292
5293
|
t._plugin,
|
|
5293
|
-
xn(t),
|
|
5294
5294
|
An(t),
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
qo(t),
|
|
5299
|
-
zn(t),
|
|
5300
|
-
rr(t),
|
|
5301
|
-
En(t),
|
|
5302
|
-
Go(t),
|
|
5303
|
-
qn(t),
|
|
5304
|
-
Dn(t),
|
|
5305
|
-
Ms(t),
|
|
5306
|
-
zr(t),
|
|
5295
|
+
Nn(t),
|
|
5296
|
+
Yo(t),
|
|
5297
|
+
vn(t),
|
|
5307
5298
|
Ea(t),
|
|
5308
|
-
|
|
5299
|
+
Vo(t),
|
|
5300
|
+
Hn(t),
|
|
5301
|
+
nr(t),
|
|
5302
|
+
Cn(t),
|
|
5303
|
+
Xo(t),
|
|
5304
|
+
Vn(t),
|
|
5305
|
+
Rn(t),
|
|
5306
|
+
Js(t),
|
|
5307
|
+
Hr(t),
|
|
5308
|
+
Ca(t),
|
|
5309
|
+
Tn(t)
|
|
5309
5310
|
].filter(F);
|
|
5310
5311
|
return s.context = t, s;
|
|
5311
5312
|
}
|
|
5312
|
-
const
|
|
5313
|
+
const Za = {
|
|
5313
5314
|
initializeComponentDependencies: bi,
|
|
5314
5315
|
updateLuminaTs: Ki,
|
|
5315
5316
|
propertyToAttributeMappings: W,
|
|
@@ -5321,7 +5322,7 @@ const Ya = {
|
|
|
5321
5322
|
htmlAlwaysAttributes: qe
|
|
5322
5323
|
};
|
|
5323
5324
|
export {
|
|
5324
|
-
|
|
5325
|
+
Za as exportsForCodemod,
|
|
5325
5326
|
Ne as inferCdnUrl,
|
|
5326
|
-
|
|
5327
|
+
Qa as useLumina
|
|
5327
5328
|
};
|