@arcgis/lumina-compiler 5.2.0-next.129 → 5.2.0-next.130
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 +545 -546
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,33 +1,32 @@
|
|
|
1
|
-
import { externalizeDependencies as
|
|
1
|
+
import { externalizeDependencies as Cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
|
|
2
2
|
import { isNotUndefined as R } from "@arcgis/toolkit/predicate";
|
|
3
3
|
import { f as b, l as T } from "./chunks/logger.js";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { camelToKebab as si, getPreamble as
|
|
6
|
-
import { lazyMetaSubItemJoiner as
|
|
5
|
+
import { camelToKebab as si, getPreamble as Es, uncapitalize as Ct, capitalize as Ts } from "@arcgis/toolkit/string";
|
|
6
|
+
import { lazyMetaSubItemJoiner as $s, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as Ps, propertyFlagAttribute as Et, propertyFlagReflect as ks, propertyFlagBoolean as Is, propertyFlagNumber as xs, propertyFlagState as As, propertyFlagReadOnly as Ls, propertyFlagNoAccessor as Ns, propertyFlagUseDefault as js } from "@arcgis/lumina/config";
|
|
7
7
|
import { path as u, isPosix as ri, toPosixPathSeparators as G, toSystemPathSeparators as Re, getCwd as ni } from "@arcgis/node-toolkit/path";
|
|
8
|
-
import { isApiMethodAsync as
|
|
8
|
+
import { isApiMethodAsync as Fs, globalPackageIdentifier as Rs, isApiMethod as Ds, isApiProperty as Os } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
9
|
import { existsAsync as K, findPath as oi } from "@arcgis/node-toolkit/file";
|
|
10
|
-
import { readFile as z, readdir as at, mkdir as X, writeFile as _, copyFile as
|
|
10
|
+
import { readFile as z, readdir as at, mkdir as X, writeFile as _, copyFile as Ms, rm as Js, cp as Bs } from "node:fs/promises";
|
|
11
11
|
import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as ai } from "@arcgis/node-toolkit/packageJson";
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import Ws from "
|
|
15
|
-
import {
|
|
16
|
-
import { glob as zs } from "tinyglobby";
|
|
12
|
+
import { build as Ks } from "esbuild";
|
|
13
|
+
import _s from "mime-types";
|
|
14
|
+
import { forEachWithConcurrency as Ws } from "@arcgis/toolkit/promise";
|
|
15
|
+
import { glob as Us } from "tinyglobby";
|
|
17
16
|
import { renameComponentFolder as Ge } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
18
|
-
import { useApiExtractor as
|
|
19
|
-
import { writeFileSync as
|
|
20
|
-
import { styleText as
|
|
21
|
-
import { unsafeGetUndocumentedPrinter as
|
|
17
|
+
import { useApiExtractor as zs } from "@arcgis/api-extractor/vite/plugin";
|
|
18
|
+
import { writeFileSync as ci } from "node:fs";
|
|
19
|
+
import { styleText as Hs } from "node:util";
|
|
20
|
+
import { unsafeGetUndocumentedPrinter as qs, unsafeUndocumentedTs as Tt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
22
21
|
import { pathIsComponentEntrypoint as Pe } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
23
|
-
import { loadApiExtractorConfig as
|
|
24
|
-
import { loadTypeScriptConfig as
|
|
22
|
+
import { loadApiExtractorConfig as Vs, mergeApiExtractorConfigs as $t } from "@arcgis/api-extractor/extractor/config";
|
|
23
|
+
import { loadTypeScriptConfig as Gs } from "@arcgis/node-toolkit/vite/typeScript";
|
|
25
24
|
import { mappedFind as Xe } from "@arcgis/toolkit/array";
|
|
26
|
-
import { isPropertyEscapeNeeded as
|
|
27
|
-
import { getPackageNameFromExternalSpecifier as
|
|
28
|
-
import { identity as
|
|
29
|
-
function
|
|
30
|
-
const t = e.options?.build?.dependencies ?? {}, i =
|
|
25
|
+
import { isPropertyEscapeNeeded as li, maybeEscapePropertyName as Xs } from "@arcgis/api-extractor/utils/partPrinter";
|
|
26
|
+
import { getPackageNameFromExternalSpecifier as Ys, getMemberName as di } from "@arcgis/api-extractor/utils/astHelpers";
|
|
27
|
+
import { identity as pi } from "@arcgis/toolkit/function";
|
|
28
|
+
function Qs(e) {
|
|
29
|
+
const t = e.options?.build?.dependencies ?? {}, i = Cs({
|
|
31
30
|
bundleIn: t.bundleIn,
|
|
32
31
|
externalize: [
|
|
33
32
|
// TODO: remove these once Lit is declared as a peer dependency
|
|
@@ -43,7 +42,7 @@ function Zs(e) {
|
|
|
43
42
|
e.isInStorybook && (i.resolveId = void 0);
|
|
44
43
|
}, i;
|
|
45
44
|
}
|
|
46
|
-
const
|
|
45
|
+
const Zs = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), ui = /* @__PURE__ */ new Set([
|
|
47
46
|
/**
|
|
48
47
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
49
48
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -75,7 +74,7 @@ const er = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
75
74
|
"vocab",
|
|
76
75
|
// These don't exist as a property, only as an attribute
|
|
77
76
|
"exportParts"
|
|
78
|
-
]),
|
|
77
|
+
]), mi = /* @__PURE__ */ new Set([
|
|
79
78
|
/*
|
|
80
79
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
81
80
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -914,9 +913,9 @@ const er = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
914
913
|
}
|
|
915
914
|
}
|
|
916
915
|
};
|
|
917
|
-
|
|
918
|
-
Object.values(W.perElement).forEach(
|
|
919
|
-
function
|
|
916
|
+
fi(W.common);
|
|
917
|
+
Object.values(W.perElement).forEach(fi);
|
|
918
|
+
function fi(e) {
|
|
920
919
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
921
920
|
/* @__PURE__ */ Object.create(null),
|
|
922
921
|
e.stringifiedReflected
|
|
@@ -925,7 +924,7 @@ function gi(e) {
|
|
|
925
924
|
e.stringifiedNonReflected
|
|
926
925
|
));
|
|
927
926
|
}
|
|
928
|
-
const Pt = /* @__PURE__ */ new Set(["itemScope"]),
|
|
927
|
+
const Pt = /* @__PURE__ */ new Set(["itemScope"]), gi = /* @__PURE__ */ new Set([
|
|
929
928
|
"abort",
|
|
930
929
|
"animationCancel",
|
|
931
930
|
"animationEnd",
|
|
@@ -1024,7 +1023,7 @@ const Pt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1024
1023
|
"volumeChange",
|
|
1025
1024
|
"waiting",
|
|
1026
1025
|
"wheel"
|
|
1027
|
-
]),
|
|
1026
|
+
]), er = /* @__PURE__ */ new Set([
|
|
1028
1027
|
"area",
|
|
1029
1028
|
"base",
|
|
1030
1029
|
"br",
|
|
@@ -1100,7 +1099,7 @@ const Pt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1100
1099
|
"tspan",
|
|
1101
1100
|
"use",
|
|
1102
1101
|
"view"
|
|
1103
|
-
]),
|
|
1102
|
+
]), tr = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), lt = /* @__PURE__ */ new Set([
|
|
1104
1103
|
"annotation-xml",
|
|
1105
1104
|
"annotation",
|
|
1106
1105
|
"maction",
|
|
@@ -1132,7 +1131,7 @@ const Pt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1132
1131
|
"munder",
|
|
1133
1132
|
"munderover",
|
|
1134
1133
|
"semantics"
|
|
1135
|
-
]),
|
|
1134
|
+
]), ir = /* @__PURE__ */ new Set([
|
|
1136
1135
|
"annotation-xml",
|
|
1137
1136
|
"color-profile",
|
|
1138
1137
|
"font-face",
|
|
@@ -1142,7 +1141,7 @@ const Pt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1142
1141
|
"font-face-name",
|
|
1143
1142
|
"missing-glyph"
|
|
1144
1143
|
]);
|
|
1145
|
-
function
|
|
1144
|
+
function sr(e) {
|
|
1146
1145
|
if (e.length === 0)
|
|
1147
1146
|
return "";
|
|
1148
1147
|
const t = e[0];
|
|
@@ -1155,11 +1154,11 @@ function rr(e) {
|
|
|
1155
1154
|
}
|
|
1156
1155
|
return e.trim().length === 0 ? t : e;
|
|
1157
1156
|
}
|
|
1158
|
-
const
|
|
1157
|
+
const rr = (e) => e.replaceAll("\\", "\\\\").replace(nr, "\\${").replaceAll("`", "\\`"), nr = /\$\{/gu, or = (e) => !ar.test(e), ar = /^[^\s"'=<>`]+$/u, cr = /[&<>]/gu, lr = {
|
|
1159
1158
|
"&": "&",
|
|
1160
1159
|
"<": "<",
|
|
1161
1160
|
">": ">"
|
|
1162
|
-
},
|
|
1161
|
+
}, hi = (e) => e.replace(cr, (t) => lr[t]), dt = (e) => typeof e == "string" && e.includes("-") && !ir.has(e), dr = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Y = "staticSvg", ce = "html", se = "svg", yi = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), vi = "css", bi = "mathml", wi = [vi, ce, bi, ae, Y, se], pr = new Set(wi), ur = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], mr = "nothing", fr = [...dr, ...wi, ...ur, mr], gr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => fe(t)), fe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), re = {
|
|
1163
1162
|
[ce]: ["lit", "lit/html.js", "lit-html"],
|
|
1164
1163
|
/**
|
|
1165
1164
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1170,8 +1169,8 @@ const nr = (e) => e.replaceAll("\\", "\\\\").replace(or, "\\${").replaceAll("`",
|
|
|
1170
1169
|
[ae]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1171
1170
|
[se]: ["lit", "lit-html", "lit/html.js"],
|
|
1172
1171
|
[Y]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1173
|
-
[
|
|
1174
|
-
[
|
|
1172
|
+
[bi]: ["lit", "lit-html", "lit/html.js"],
|
|
1173
|
+
[vi]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
1175
1174
|
safeClassMap: ["@arcgis/lumina"],
|
|
1176
1175
|
safeStyleMap: ["@arcgis/lumina"],
|
|
1177
1176
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -1181,7 +1180,7 @@ const nr = (e) => e.replaceAll("\\", "\\\\").replace(or, "\\${").replaceAll("`",
|
|
|
1181
1180
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1182
1181
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1183
1182
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1184
|
-
},
|
|
1183
|
+
}, hr = /* @__PURE__ */ new Set([
|
|
1185
1184
|
"h",
|
|
1186
1185
|
"Fragment",
|
|
1187
1186
|
"state",
|
|
@@ -1191,7 +1190,7 @@ const nr = (e) => e.replaceAll("\\", "\\\\").replace(or, "\\${").replaceAll("`",
|
|
|
1191
1190
|
"bindProperty",
|
|
1192
1191
|
"bindEvent",
|
|
1193
1192
|
"bindAttribute"
|
|
1194
|
-
]),
|
|
1193
|
+
]), yr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, de = "@arcgis/lumina:loadLitCss", Ie = "?litCss", Q = "?layeredLitCss", Ze = "?globalFileLitCss", vr = (e) => ({
|
|
1195
1194
|
name: de,
|
|
1196
1195
|
enforce: "pre",
|
|
1197
1196
|
configResolved(t) {
|
|
@@ -1231,14 +1230,14 @@ const nr = (e) => e.replaceAll("\\", "\\\\").replace(or, "\\${").replaceAll("`",
|
|
|
1231
1230
|
if (l && (a = a.slice(0, -Ze.length)), !c && !d && !l)
|
|
1232
1231
|
return await s.handler.call(this, r, a);
|
|
1233
1232
|
const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1234
|
-
return typeof f != "string" || !f.startsWith(
|
|
1233
|
+
return typeof f != "string" || !f.startsWith(Si) || !f.endsWith(br) ? (T.warn(
|
|
1235
1234
|
de,
|
|
1236
1235
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1237
1236
|
f
|
|
1238
1237
|
)}`
|
|
1239
|
-
), m) : l ? (e._globalCssString =
|
|
1238
|
+
), m) : l ? (e._globalCssString = Ci(f), { code: "", map: { mappings: "" } }) : {
|
|
1240
1239
|
...g,
|
|
1241
|
-
code:
|
|
1240
|
+
code: Er(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1242
1241
|
/**
|
|
1243
1242
|
* Vite's original transform does not generate source maps for inlined
|
|
1244
1243
|
* css, thus we can't either
|
|
@@ -1248,8 +1247,8 @@ const nr = (e) => e.replaceAll("\\", "\\\\").replace(or, "\\${").replaceAll("`",
|
|
|
1248
1247
|
}
|
|
1249
1248
|
};
|
|
1250
1249
|
}
|
|
1251
|
-
}),
|
|
1252
|
-
export const styles = css\``,
|
|
1250
|
+
}), Si = 'export default "', br = '"', wr = `import { css } from '${re.css[0]}';
|
|
1251
|
+
export const styles = css\``, Sr = "`;\nexport default styles;", Cr = `
|
|
1253
1252
|
|
|
1254
1253
|
if(import.meta.hot) {
|
|
1255
1254
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1260,24 +1259,24 @@ if(import.meta.hot) {
|
|
|
1260
1259
|
}
|
|
1261
1260
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1262
1261
|
});
|
|
1263
|
-
}`,
|
|
1264
|
-
function
|
|
1265
|
-
const n =
|
|
1262
|
+
}`, Ci = (e) => e.slice(Si.length - 1);
|
|
1263
|
+
function Er(e, t, i, s) {
|
|
1264
|
+
const n = Ci(e), r = JSON.parse(n), a = rr(r), c = s ? `@layer{${i ? "" : `
|
|
1266
1265
|
`}${a}${i ? "" : `
|
|
1267
1266
|
`}}` : a;
|
|
1268
|
-
return `${
|
|
1267
|
+
return `${wr}${c}${Sr}${t ? Cr : ""}`;
|
|
1269
1268
|
}
|
|
1270
|
-
function
|
|
1271
|
-
return `import("${
|
|
1272
|
-
setCustomElementsManifest(${
|
|
1269
|
+
function Tr(e) {
|
|
1270
|
+
return `import("${$r}").then(({ setCustomElementsManifest }) => {
|
|
1271
|
+
setCustomElementsManifest(${Pr(e)});
|
|
1273
1272
|
});`;
|
|
1274
1273
|
}
|
|
1275
|
-
const
|
|
1276
|
-
function
|
|
1274
|
+
const $r = "@storybook/web-components-vite", Pr = (e) => `JSON.parse(\`${kr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1275
|
+
function kr(e) {
|
|
1277
1276
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1278
1277
|
}
|
|
1279
|
-
function
|
|
1280
|
-
|
|
1278
|
+
function Ir(e) {
|
|
1279
|
+
xr(e);
|
|
1281
1280
|
const t = e.options.css?.globalStylesPath;
|
|
1282
1281
|
if (t === void 0)
|
|
1283
1282
|
return "";
|
|
@@ -1285,21 +1284,21 @@ function xr(e) {
|
|
|
1285
1284
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
1286
1285
|
`import globalStyles from "${i}${Q}";`,
|
|
1287
1286
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1288
|
-
|
|
1287
|
+
Ti("", e)
|
|
1289
1288
|
].join(`
|
|
1290
1289
|
`) : `import "${i}${Ze}";`;
|
|
1291
1290
|
}
|
|
1292
|
-
const
|
|
1293
|
-
function
|
|
1291
|
+
const Ei = "hydrated";
|
|
1292
|
+
function xr(e) {
|
|
1294
1293
|
e._globalHydratedCssString = [
|
|
1295
1294
|
":not([",
|
|
1296
|
-
e.options.css?.hydratedAttribute ??
|
|
1295
|
+
e.options.css?.hydratedAttribute ?? Ei,
|
|
1297
1296
|
"]):is(",
|
|
1298
1297
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
1299
1298
|
"){visibility:hidden}"
|
|
1300
1299
|
].join("");
|
|
1301
1300
|
}
|
|
1302
|
-
function
|
|
1301
|
+
function Ti(e, t) {
|
|
1303
1302
|
return [
|
|
1304
1303
|
"const globalCss = new CSSStyleSheet;",
|
|
1305
1304
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
|
|
@@ -1307,43 +1306,43 @@ function $i(e, t) {
|
|
|
1307
1306
|
].join(`
|
|
1308
1307
|
`);
|
|
1309
1308
|
}
|
|
1310
|
-
const
|
|
1309
|
+
const Ar = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1311
1310
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1312
1311
|
|
|
1313
1312
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1314
1313
|
`}}`;
|
|
1315
|
-
function
|
|
1314
|
+
function Lr(e) {
|
|
1316
1315
|
const t = [], i = [];
|
|
1317
1316
|
for (const s of e.privateApiJson.modules)
|
|
1318
1317
|
for (const n of s.declarations)
|
|
1319
|
-
n.customElement === !0 && (i.push(
|
|
1318
|
+
n.customElement === !0 && (i.push(Nr(n, e, s.sourcePath)), t.push(s.sourcePath));
|
|
1320
1319
|
return [
|
|
1321
1320
|
'import { runtime } from "./runtime.ts";',
|
|
1322
1321
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
1323
|
-
|
|
1324
|
-
e.hmrEnabled ?
|
|
1322
|
+
Ir(e),
|
|
1323
|
+
e.hmrEnabled ? Fr : "",
|
|
1325
1324
|
"",
|
|
1326
|
-
e.isInStorybook ?
|
|
1325
|
+
e.isInStorybook ? Tr(e.apiJson) : "",
|
|
1327
1326
|
"",
|
|
1328
1327
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
1329
1328
|
i.join(`,
|
|
1330
1329
|
`),
|
|
1331
1330
|
"});",
|
|
1332
|
-
e.hmrEnabled ?
|
|
1331
|
+
e.hmrEnabled ? Rr(t) : ""
|
|
1333
1332
|
].join(`
|
|
1334
1333
|
`);
|
|
1335
1334
|
}
|
|
1336
|
-
const
|
|
1335
|
+
const Nr = (e, t, i) => [
|
|
1337
1336
|
` "${e.tagName}": [`,
|
|
1338
1337
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
1339
|
-
|
|
1338
|
+
jr(e),
|
|
1340
1339
|
"]"
|
|
1341
1340
|
].join("");
|
|
1342
|
-
function
|
|
1343
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } =
|
|
1344
|
-
return `${p.length > 0 || n ? `"${p.join(
|
|
1341
|
+
function jr(e) {
|
|
1342
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = $i(e), r = t.map((g) => g.join($s)).join(Je), a = i.join(Je), c = s.join(Je), d = [r, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
|
|
1343
|
+
return `${p.length > 0 || n ? `"${p.join(Ps)}"` : ""}${n ? ",1" : ""}`;
|
|
1345
1344
|
}
|
|
1346
|
-
function
|
|
1345
|
+
function $i(e) {
|
|
1347
1346
|
const t = [], i = [], s = [];
|
|
1348
1347
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1349
1348
|
const a = e.members[r];
|
|
@@ -1352,27 +1351,27 @@ function Pi(e) {
|
|
|
1352
1351
|
t.push(
|
|
1353
1352
|
c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
|
|
1354
1353
|
);
|
|
1355
|
-
} else a.kind === "method" && a.name !== "componentOnReady" && (
|
|
1354
|
+
} else a.kind === "method" && a.name !== "componentOnReady" && (Fs(a) ? i.push(a.name) : s.push(a.name));
|
|
1356
1355
|
}
|
|
1357
1356
|
const n = e.formAssociated === !0;
|
|
1358
1357
|
return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: n };
|
|
1359
1358
|
}
|
|
1360
|
-
const
|
|
1361
|
-
`,
|
|
1359
|
+
const Fr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
1360
|
+
`, Rr = (e) => `
|
|
1362
1361
|
if(import.meta.hot) {
|
|
1363
1362
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
1364
1363
|
import.meta.hot.accept([
|
|
1365
1364
|
${e.map((t) => ` "/${t}",`).join(`
|
|
1366
1365
|
`)}
|
|
1367
1366
|
], handleHmrUpdate);
|
|
1368
|
-
}`,
|
|
1369
|
-
name:
|
|
1367
|
+
}`, Dr = "@arcgis/lumina-compiler", Pi = {
|
|
1368
|
+
name: Dr
|
|
1370
1369
|
};
|
|
1371
|
-
var
|
|
1372
|
-
async function
|
|
1373
|
-
return ne ??=
|
|
1370
|
+
var Or = ["@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/core", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-compiler", "@arcgis/lumina-toolkit", "@arcgis/node-toolkit", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
|
|
1371
|
+
async function ki(e, t) {
|
|
1372
|
+
return ne ??= Jr(e, t), await ne;
|
|
1374
1373
|
}
|
|
1375
|
-
function
|
|
1374
|
+
function Mr() {
|
|
1376
1375
|
if (xe === void 0)
|
|
1377
1376
|
throw Error(
|
|
1378
1377
|
b(
|
|
@@ -1382,7 +1381,7 @@ function Jr() {
|
|
|
1382
1381
|
);
|
|
1383
1382
|
return xe;
|
|
1384
1383
|
}
|
|
1385
|
-
function
|
|
1384
|
+
function Ii() {
|
|
1386
1385
|
if (et === void 0)
|
|
1387
1386
|
throw Error(
|
|
1388
1387
|
b(
|
|
@@ -1392,9 +1391,9 @@ function xi() {
|
|
|
1392
1391
|
);
|
|
1393
1392
|
return et;
|
|
1394
1393
|
}
|
|
1395
|
-
async function
|
|
1394
|
+
async function Jr(e, t) {
|
|
1396
1395
|
const i = j(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1397
|
-
[...Object.keys(s), ...Object.keys(n)].filter((l) => !
|
|
1396
|
+
[...Object.keys(s), ...Object.keys(n)].filter((l) => !Br.has(l)).flatMap(async (l) => await xi(l, e))
|
|
1398
1397
|
)).filter(R);
|
|
1399
1398
|
xe ??= a, et = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1400
1399
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -1402,8 +1401,8 @@ async function Br(e, t) {
|
|
|
1402
1401
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
1403
1402
|
return xe ??= d, d;
|
|
1404
1403
|
}
|
|
1405
|
-
const
|
|
1406
|
-
...
|
|
1404
|
+
const Br = /* @__PURE__ */ new Set([
|
|
1405
|
+
...Or,
|
|
1407
1406
|
"@arcgis/languages-sdk-specs",
|
|
1408
1407
|
"@commander-js/extra-typings",
|
|
1409
1408
|
"@custom-elements-manifest/analyzer",
|
|
@@ -1437,12 +1436,12 @@ const Kr = /* @__PURE__ */ new Set([
|
|
|
1437
1436
|
"vscode-languageserver-types"
|
|
1438
1437
|
]);
|
|
1439
1438
|
let xe, et, ne;
|
|
1440
|
-
async function
|
|
1441
|
-
const i = await $e(e, t), s = await ai(i), n = "exports" in s, r =
|
|
1439
|
+
async function xi(e, t) {
|
|
1440
|
+
const i = await $e(e, t), s = await ai(i), n = "exports" in s, r = Yr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
1442
1441
|
if (a ? await K(c) : !1) {
|
|
1443
|
-
const g = await z(c, "utf8"), h =
|
|
1442
|
+
const g = await z(c, "utf8"), h = Kr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1444
1443
|
try {
|
|
1445
|
-
const C = JSON.parse(w), E =
|
|
1444
|
+
const C = JSON.parse(w), E = Gr(C, { packageName: e, getImportPath: r });
|
|
1446
1445
|
return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
|
|
1447
1446
|
} catch (C) {
|
|
1448
1447
|
T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
@@ -1451,7 +1450,7 @@ Error: ${String(C)}`);
|
|
|
1451
1450
|
}
|
|
1452
1451
|
const l = kt(s.customElements);
|
|
1453
1452
|
if (l != null) {
|
|
1454
|
-
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), y =
|
|
1453
|
+
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), y = _r(h), v = Ai(h, {
|
|
1455
1454
|
packageName: e,
|
|
1456
1455
|
getImportPath: r
|
|
1457
1456
|
});
|
|
@@ -1459,7 +1458,7 @@ Error: ${String(C)}`);
|
|
|
1459
1458
|
}
|
|
1460
1459
|
const p = kt(s["web-types"]);
|
|
1461
1460
|
if (p != null) {
|
|
1462
|
-
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y =
|
|
1461
|
+
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y = Wr(h, {
|
|
1463
1462
|
packageName: e,
|
|
1464
1463
|
getImportPath: r
|
|
1465
1464
|
});
|
|
@@ -1467,7 +1466,7 @@ Error: ${String(C)}`);
|
|
|
1467
1466
|
}
|
|
1468
1467
|
const m = u.join(i, "dist/components");
|
|
1469
1468
|
if (await K(m)) {
|
|
1470
|
-
const g = await
|
|
1469
|
+
const g = await Xr(m, {
|
|
1471
1470
|
packageName: e,
|
|
1472
1471
|
getImportPath: r
|
|
1473
1472
|
});
|
|
@@ -1475,11 +1474,11 @@ Error: ${String(C)}`);
|
|
|
1475
1474
|
}
|
|
1476
1475
|
}
|
|
1477
1476
|
const kt = (e) => Array.isArray(e) ? e[0] : e;
|
|
1478
|
-
function
|
|
1477
|
+
function Kr(e, t) {
|
|
1479
1478
|
const i = e.indexOf(t);
|
|
1480
1479
|
return i === -1 ? -1 : i + t.length;
|
|
1481
1480
|
}
|
|
1482
|
-
function
|
|
1481
|
+
function Ai(e, t, i = !1) {
|
|
1483
1482
|
const s = /* @__PURE__ */ Object.create(null);
|
|
1484
1483
|
if (e.modules === void 0)
|
|
1485
1484
|
return s;
|
|
@@ -1516,11 +1515,11 @@ function Li(e, t, i = !1) {
|
|
|
1516
1515
|
}
|
|
1517
1516
|
return s;
|
|
1518
1517
|
}
|
|
1519
|
-
const
|
|
1518
|
+
const _r = (e) => (
|
|
1520
1519
|
// Since 5.0
|
|
1521
1520
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1522
|
-
e.compiler?.name ===
|
|
1523
|
-
),
|
|
1521
|
+
e.compiler?.name === Pi.name
|
|
1522
|
+
), Wr = (e, t) => Object.fromEntries(
|
|
1524
1523
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1525
1524
|
(i) => [
|
|
1526
1525
|
i.name,
|
|
@@ -1531,7 +1530,7 @@ const Wr = (e) => (
|
|
|
1531
1530
|
}
|
|
1532
1531
|
]
|
|
1533
1532
|
) ?? []
|
|
1534
|
-
),
|
|
1533
|
+
), Ur = 1, zr = 2, Hr = 4, qr = 8, Vr = Ur | zr | Hr | qr, Gr = (e, t) => Object.fromEntries(
|
|
1535
1534
|
e.flatMap(
|
|
1536
1535
|
([i, s]) => s.map(
|
|
1537
1536
|
([n, r, a]) => [
|
|
@@ -1540,13 +1539,13 @@ const Wr = (e) => (
|
|
|
1540
1539
|
packageName: t.packageName,
|
|
1541
1540
|
modulePath: t.getImportPath(r),
|
|
1542
1541
|
propToAttribute: Object.fromEntries(
|
|
1543
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
1542
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & Vr).map(([c, [d, l = c]]) => [c, l])
|
|
1544
1543
|
)
|
|
1545
1544
|
}
|
|
1546
1545
|
]
|
|
1547
1546
|
)
|
|
1548
1547
|
)
|
|
1549
|
-
),
|
|
1548
|
+
), Xr = async (e, t) => Object.fromEntries(
|
|
1550
1549
|
(await at(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
1551
1550
|
const s = i.slice(0, -5);
|
|
1552
1551
|
return [
|
|
@@ -1558,19 +1557,19 @@ const Wr = (e) => (
|
|
|
1558
1557
|
}
|
|
1559
1558
|
];
|
|
1560
1559
|
})
|
|
1561
|
-
),
|
|
1562
|
-
function
|
|
1560
|
+
), Yr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Qr = (e) => e.startsWith("/") ? e : `/${e}`, pt = (e, t) => `${e}@fs${Qr(t)}`;
|
|
1561
|
+
function Zr(e, t) {
|
|
1563
1562
|
const i = u.resolve(e), s = u.resolve(i, t.split(/[?#]/u)[0].replace(/^[/\\]+/u, "")), n = u.relative(i, s);
|
|
1564
1563
|
return n === ".." || n.startsWith(`..${u.sep}`) || u.isAbsolute(n) ? void 0 : s;
|
|
1565
1564
|
}
|
|
1566
|
-
const
|
|
1565
|
+
const Li = "packages/core-packages/core/src", en = "packages/core-packages/core/output/npm/esm", te = !import.meta.url.includes("node_modules");
|
|
1567
1566
|
function ut(e) {
|
|
1568
|
-
return te && e.name !== "@esri/calcite-components" ?
|
|
1567
|
+
return te && e.name !== "@esri/calcite-components" ? "5.2.0-next.129" : e.version;
|
|
1569
1568
|
}
|
|
1570
|
-
function
|
|
1569
|
+
function Ni({ command: e }) {
|
|
1571
1570
|
return e === "serve" && process.argv.includes("--local-core");
|
|
1572
1571
|
}
|
|
1573
|
-
function
|
|
1572
|
+
function ji(e) {
|
|
1574
1573
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1575
1574
|
return i === "latest" ? "esnext" : i;
|
|
1576
1575
|
}
|
|
@@ -1580,12 +1579,12 @@ function ie(e, t, i = mt, s = "max-age=31536000, immutable") {
|
|
|
1580
1579
|
throw Error(b(tt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
1581
1580
|
const n = e._serverConfigured, r = e.server.middlewares.stack.length;
|
|
1582
1581
|
if (t.forEach((a) => {
|
|
1583
|
-
const c =
|
|
1582
|
+
const c = Ri(a), d = Oi(e.dir, Di(c)), l = sn(e.viteConfig.base, d, e.dir.distCdn);
|
|
1584
1583
|
e.server.middlewares.use(l, (p, m, f) => {
|
|
1585
|
-
const g =
|
|
1584
|
+
const g = rn(p.url), h = c.type === "directory" ? Zr(c.source, g) : c.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
|
|
1586
1585
|
return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) : z(h)).then((w) => {
|
|
1587
1586
|
const C = (typeof h == "function" ? void 0 : v?.transform(w.toString("utf8"), y, e)) ?? w;
|
|
1588
|
-
m.setHeader("Cache-Control", s), m.setHeader("Content-Type",
|
|
1587
|
+
m.setHeader("Cache-Control", s), m.setHeader("Content-Type", _s.lookup(g) || "application/octet-stream"), m.write(C), m.end();
|
|
1589
1588
|
}).catch((w) => {
|
|
1590
1589
|
(c.type !== "directory" || process.env.DEBUG) && T.warn(
|
|
1591
1590
|
tt,
|
|
@@ -1598,16 +1597,16 @@ function ie(e, t, i = mt, s = "max-age=31536000, immutable") {
|
|
|
1598
1597
|
e.server.middlewares.stack.splice(0, 0, ...a);
|
|
1599
1598
|
}
|
|
1600
1599
|
}
|
|
1601
|
-
async function
|
|
1600
|
+
async function Fi(e, t, i = mt) {
|
|
1602
1601
|
await Promise.all(
|
|
1603
1602
|
t.map(async (s) => {
|
|
1604
|
-
const n =
|
|
1603
|
+
const n = Ri(s), r = Oi(e.dir, Di(n));
|
|
1605
1604
|
if (n.type === "directory") {
|
|
1606
1605
|
const a = u.resolve(n.source), d = (await at(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
|
|
1607
1606
|
const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
|
|
1608
1607
|
return [p, f];
|
|
1609
1608
|
});
|
|
1610
|
-
await
|
|
1609
|
+
await Ji(d.map(([l, p]) => p)), await Ws(
|
|
1611
1610
|
d,
|
|
1612
1611
|
16,
|
|
1613
1612
|
async ([l, p]) => await It(l, p, i, e)
|
|
@@ -1622,7 +1621,7 @@ async function Ri(e, t, i = mt) {
|
|
|
1622
1621
|
})
|
|
1623
1622
|
);
|
|
1624
1623
|
}
|
|
1625
|
-
const
|
|
1624
|
+
const Ri = ri ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
1626
1625
|
...e,
|
|
1627
1626
|
destination: G(e.destination)
|
|
1628
1627
|
} : {
|
|
@@ -1633,13 +1632,13 @@ const Di = ri ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
1633
1632
|
async function It(e, t, i, s) {
|
|
1634
1633
|
const n = i.find((r) => r.match(t, s));
|
|
1635
1634
|
if (n === void 0)
|
|
1636
|
-
await
|
|
1635
|
+
await Ms(e, t);
|
|
1637
1636
|
else {
|
|
1638
1637
|
const r = await z(e, "utf8"), a = n.transform(r, t, s);
|
|
1639
1638
|
await _(t, a);
|
|
1640
1639
|
}
|
|
1641
1640
|
}
|
|
1642
|
-
function
|
|
1641
|
+
function Di(e) {
|
|
1643
1642
|
if (e.type === "dynamic")
|
|
1644
1643
|
return e.destination;
|
|
1645
1644
|
if (e.source.endsWith(u.sep)) {
|
|
@@ -1654,35 +1653,35 @@ function Oi(e) {
|
|
|
1654
1653
|
}
|
|
1655
1654
|
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
1656
1655
|
}
|
|
1657
|
-
function
|
|
1658
|
-
const s =
|
|
1656
|
+
function Oi({ dist: e, distCdnAssets: t }, i) {
|
|
1657
|
+
const s = tn(i), n = u.join(
|
|
1659
1658
|
t,
|
|
1660
1659
|
s ? u.relative(t, i) : i
|
|
1661
|
-
), r = u.relative(e, n), a =
|
|
1660
|
+
), r = u.relative(e, n), a = Mi(r);
|
|
1662
1661
|
return u.join(e, a);
|
|
1663
1662
|
}
|
|
1664
|
-
function
|
|
1663
|
+
function tn(e) {
|
|
1665
1664
|
if (e.startsWith(u.sep)) {
|
|
1666
1665
|
const t = ni(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
1667
1666
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
1668
1667
|
} else
|
|
1669
1668
|
return !!(!ri && u.isAbsolute(e));
|
|
1670
1669
|
}
|
|
1671
|
-
function
|
|
1672
|
-
const s =
|
|
1670
|
+
function sn(e, t, i) {
|
|
1671
|
+
const s = Mi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
1673
1672
|
return `${e}${n}`;
|
|
1674
1673
|
}
|
|
1675
|
-
const
|
|
1676
|
-
async function
|
|
1674
|
+
const Mi = (e) => e.replaceAll("../", ""), rn = (e = "") => e.split("?")[0].split("#")[0];
|
|
1675
|
+
async function Ji(e) {
|
|
1677
1676
|
const t = new Set(e.map(u.dirname));
|
|
1678
1677
|
await Promise.all(Array.from(t, async (i) => await X(i, { recursive: !0 })));
|
|
1679
1678
|
}
|
|
1680
|
-
const
|
|
1679
|
+
const nn = {
|
|
1681
1680
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
1682
1681
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
1683
|
-
}, mt = [
|
|
1682
|
+
}, mt = [nn], Ae = "@arcgis/core", me = "@arcgis/core/assets", _e = j(), H = Ae in (_e.dependencies ?? {}) || Ae in (_e.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
1684
1683
|
_e.name === "@arcgis/lumina";
|
|
1685
|
-
async function
|
|
1684
|
+
async function on(e, t, i, s) {
|
|
1686
1685
|
if (!H)
|
|
1687
1686
|
return [];
|
|
1688
1687
|
const n = e._localCdnCore, r = n?.packageLocation ?? await $e(Ae);
|
|
@@ -1703,17 +1702,17 @@ async function an(e, t, i, s) {
|
|
|
1703
1702
|
})
|
|
1704
1703
|
},
|
|
1705
1704
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1706
|
-
|
|
1705
|
+
Bi(c)
|
|
1707
1706
|
];
|
|
1708
1707
|
} else
|
|
1709
|
-
return
|
|
1708
|
+
return an(t, r, n?.sourceLocation !== void 0);
|
|
1710
1709
|
}
|
|
1711
|
-
function
|
|
1710
|
+
function an(e, t, i) {
|
|
1712
1711
|
const s = `${e}${me}`;
|
|
1713
1712
|
return [
|
|
1714
1713
|
// Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
|
|
1715
1714
|
// Core's prebuilt JavaScript assets use the untransformed route configured below.
|
|
1716
|
-
|
|
1715
|
+
Bi(
|
|
1717
1716
|
i ? `${e}${me}/` : pt(e, `${t}/assets/`)
|
|
1718
1717
|
),
|
|
1719
1718
|
{
|
|
@@ -1727,7 +1726,7 @@ function cn(e, t, i) {
|
|
|
1727
1726
|
}
|
|
1728
1727
|
];
|
|
1729
1728
|
}
|
|
1730
|
-
async function
|
|
1729
|
+
async function cn(e) {
|
|
1731
1730
|
const t = e._localCdnCore, i = t?.packageLocation ?? await $e(Ae), s = t?.sourceLocation !== void 0 ? [
|
|
1732
1731
|
{
|
|
1733
1732
|
type: "directory",
|
|
@@ -1769,27 +1768,27 @@ async function ln(e) {
|
|
|
1769
1768
|
];
|
|
1770
1769
|
e.server.middlewares.use("/builddate.txt", (n, r) => {
|
|
1771
1770
|
r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain");
|
|
1772
|
-
const a = t?.sourceLocation ?
|
|
1771
|
+
const a = t?.sourceLocation ? "5.2.0-next.129" : j(i).version;
|
|
1773
1772
|
r.end(JSON.stringify({ version: a }));
|
|
1774
1773
|
}), ie(e, s, [], "no-cache");
|
|
1775
1774
|
}
|
|
1776
|
-
const
|
|
1775
|
+
const Bi = (e) => ({
|
|
1777
1776
|
// Not using join() because it would turn https:// into https:/
|
|
1778
1777
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
1779
1778
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1780
1779
|
id: "arcgisCoreStylesheet"
|
|
1781
1780
|
}), ft = "customElement.js";
|
|
1782
|
-
function
|
|
1781
|
+
function ln(e, t) {
|
|
1783
1782
|
if (!t.startsWith(e))
|
|
1784
1783
|
return t;
|
|
1785
1784
|
const s = t.split(u.sep);
|
|
1786
|
-
return s.at(
|
|
1785
|
+
return s.at(dn) !== s.at(pn) ? t : u.join(s.slice(0, -1).join(u.sep), ft);
|
|
1787
1786
|
}
|
|
1788
|
-
const
|
|
1787
|
+
const dn = -1, pn = -2, un = /["']\.\.?\/[^'"]+/gu, mn = (e, t, i, s) => e.replaceAll(un, (n) => {
|
|
1789
1788
|
const r = n.slice(1);
|
|
1790
1789
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1791
1790
|
return n;
|
|
1792
|
-
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
1791
|
+
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? ln(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + Ge(c.slice(t.dir.dist.length), t.apiExtractor) : c;
|
|
1793
1792
|
if (i === s && a === d)
|
|
1794
1793
|
return n;
|
|
1795
1794
|
const l = he(i, d), p = n.endsWith("/") ? `${l}/` : l;
|
|
@@ -1798,12 +1797,12 @@ const pn = -1, un = -2, mn = /["']\.\.?\/[^'"]+/gu, fn = (e, t, i, s) => e.repla
|
|
|
1798
1797
|
const i = u.relative(e, t);
|
|
1799
1798
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
1800
1799
|
};
|
|
1801
|
-
async function
|
|
1800
|
+
async function fn(e, t, i) {
|
|
1802
1801
|
const s = u.resolve(e.dir.root, t);
|
|
1803
|
-
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await
|
|
1802
|
+
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Js(s, { recursive: !0, force: !0 }), await X(s, { recursive: !0 }), await Bs(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1804
1803
|
const n = [
|
|
1805
1804
|
"index.html",
|
|
1806
|
-
...await
|
|
1805
|
+
...await Us("**/*.html", {
|
|
1807
1806
|
cwd: e.dir.src,
|
|
1808
1807
|
onlyFiles: !0,
|
|
1809
1808
|
// The files we are looking for are unlikely to be symbolic links
|
|
@@ -1841,7 +1840,7 @@ async function gn(e, t, i) {
|
|
|
1841
1840
|
})
|
|
1842
1841
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1843
1842
|
}
|
|
1844
|
-
const
|
|
1843
|
+
const Ki = /* @__PURE__ */ new Set([
|
|
1845
1844
|
"chunks",
|
|
1846
1845
|
"components",
|
|
1847
1846
|
"docs",
|
|
@@ -1854,13 +1853,13 @@ const _i = /* @__PURE__ */ new Set([
|
|
|
1854
1853
|
"collection",
|
|
1855
1854
|
"extras",
|
|
1856
1855
|
"support"
|
|
1857
|
-
]), O = "@arcgis/lumina:buildCdn", le = "cdn",
|
|
1858
|
-
function
|
|
1856
|
+
]), O = "@arcgis/lumina:buildCdn", le = "cdn", _i = "index", Z = "main";
|
|
1857
|
+
function gn(e) {
|
|
1859
1858
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1860
1859
|
if (a) {
|
|
1861
1860
|
if (i.toLowerCase() !== i)
|
|
1862
1861
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
1863
|
-
if (
|
|
1862
|
+
if (Ki.has(i))
|
|
1864
1863
|
throw new Error(
|
|
1865
1864
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
1866
1865
|
);
|
|
@@ -1868,11 +1867,11 @@ function hn(e) {
|
|
|
1868
1867
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
1869
1868
|
);
|
|
1870
1869
|
}
|
|
1871
|
-
const c = i ??
|
|
1870
|
+
const c = i ?? _i;
|
|
1872
1871
|
if (e.provideAssets([
|
|
1873
1872
|
{
|
|
1874
1873
|
type: "dynamic",
|
|
1875
|
-
source: () =>
|
|
1874
|
+
source: () => Ar(e),
|
|
1876
1875
|
destination: `../${a ? c : Z}.css`
|
|
1877
1876
|
}
|
|
1878
1877
|
]), !t)
|
|
@@ -1888,7 +1887,7 @@ function hn(e) {
|
|
|
1888
1887
|
);
|
|
1889
1888
|
return;
|
|
1890
1889
|
}
|
|
1891
|
-
const d = H && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await
|
|
1890
|
+
const d = H && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await hn(
|
|
1892
1891
|
e,
|
|
1893
1892
|
c,
|
|
1894
1893
|
s,
|
|
@@ -1896,7 +1895,7 @@ function hn(e) {
|
|
|
1896
1895
|
n,
|
|
1897
1896
|
d
|
|
1898
1897
|
);
|
|
1899
|
-
await
|
|
1898
|
+
await yn(
|
|
1900
1899
|
m,
|
|
1901
1900
|
e,
|
|
1902
1901
|
a ? `${c}.esm` : c,
|
|
@@ -1904,11 +1903,11 @@ function hn(e) {
|
|
|
1904
1903
|
d
|
|
1905
1904
|
);
|
|
1906
1905
|
const f = Date.now();
|
|
1907
|
-
T.info(O, `CDN was built in ${f - l}ms`), r && await
|
|
1906
|
+
T.info(O, `CDN was built in ${f - l}ms`), r && await fn(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
1908
1907
|
}
|
|
1909
1908
|
};
|
|
1910
1909
|
}
|
|
1911
|
-
async function
|
|
1910
|
+
async function hn(e, t, i, s, n, r) {
|
|
1912
1911
|
const a = e.environment;
|
|
1913
1912
|
if (i.minify && r)
|
|
1914
1913
|
throw Error(
|
|
@@ -1931,8 +1930,8 @@ async function yn(e, t, i, s, n, r) {
|
|
|
1931
1930
|
* The script's file name will be stripped inside defineCustomElements.
|
|
1932
1931
|
**/
|
|
1933
1932
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1934
|
-
${
|
|
1935
|
-
return await
|
|
1933
|
+
${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
1934
|
+
return await Ks({
|
|
1936
1935
|
bundle: !0,
|
|
1937
1936
|
minify: r ? !0 : a === "production",
|
|
1938
1937
|
treeShaking: !0,
|
|
@@ -1957,7 +1956,7 @@ ${$i(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1957
1956
|
chunkNames: "[hash]",
|
|
1958
1957
|
resolveExtensions: [".js", ".json"],
|
|
1959
1958
|
banner: { js: e.banner },
|
|
1960
|
-
target:
|
|
1959
|
+
target: ji(e),
|
|
1961
1960
|
...i,
|
|
1962
1961
|
write: !1,
|
|
1963
1962
|
plugins: [
|
|
@@ -2017,7 +2016,7 @@ ${$i(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
2017
2016
|
});
|
|
2018
2017
|
}
|
|
2019
2018
|
const xt = "stdin.js";
|
|
2020
|
-
async function
|
|
2019
|
+
async function yn(e, t, i, s, n) {
|
|
2021
2020
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
2022
2021
|
let c;
|
|
2023
2022
|
n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -2031,13 +2030,13 @@ async function vn(e, t, i, s, n) {
|
|
|
2031
2030
|
}, f = G(p.path.slice(r.length));
|
|
2032
2031
|
if (f === xt) {
|
|
2033
2032
|
if (n) {
|
|
2034
|
-
const h = p.text.match(
|
|
2033
|
+
const h = p.text.match(vn)?.[0];
|
|
2035
2034
|
if (h === void 0)
|
|
2036
2035
|
throw Error(
|
|
2037
2036
|
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${xt} contents:
|
|
2038
2037
|
${p.text}`
|
|
2039
2038
|
);
|
|
2040
|
-
m.code = `${m.code.trimEnd()}${
|
|
2039
|
+
m.code = `${m.code.trimEnd()}${bn(h, s)}`, m.isAsync = !1;
|
|
2041
2040
|
}
|
|
2042
2041
|
return [a, m];
|
|
2043
2042
|
}
|
|
@@ -2047,7 +2046,7 @@ ${p.text}`
|
|
|
2047
2046
|
n && d.forEach((p, m) => {
|
|
2048
2047
|
if (p.isAsync === void 0)
|
|
2049
2048
|
if (m.endsWith(".js")) {
|
|
2050
|
-
if (
|
|
2049
|
+
if (Wi(p, d), c?.has(m) === !0 && p.code.includes(Ui))
|
|
2051
2050
|
throw Error(
|
|
2052
2051
|
b(
|
|
2053
2052
|
O,
|
|
@@ -2067,8 +2066,8 @@ ${p.text}`
|
|
|
2067
2066
|
}
|
|
2068
2067
|
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await _(r + p, m)));
|
|
2069
2068
|
}
|
|
2070
|
-
const
|
|
2071
|
-
function
|
|
2069
|
+
const vn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2070
|
+
function bn(e, t) {
|
|
2072
2071
|
let i = [
|
|
2073
2072
|
"window.$arcgis",
|
|
2074
2073
|
"||",
|
|
@@ -2109,7 +2108,7 @@ function wn(e, t) {
|
|
|
2109
2108
|
}
|
|
2110
2109
|
return i += ")", i;
|
|
2111
2110
|
}
|
|
2112
|
-
function
|
|
2111
|
+
function Wi(e, t) {
|
|
2113
2112
|
if (e.isProcessing) {
|
|
2114
2113
|
e.isAsync = !0, At(e);
|
|
2115
2114
|
return;
|
|
@@ -2117,7 +2116,7 @@ function Ui(e, t) {
|
|
|
2117
2116
|
e.isProcessing = !0;
|
|
2118
2117
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
2119
2118
|
let c = 0;
|
|
2120
|
-
const d = e.code.matchAll(
|
|
2119
|
+
const d = e.code.matchAll(wn);
|
|
2121
2120
|
for (const S of d) {
|
|
2122
2121
|
const [A, L, U, F, N] = S, B = N.startsWith(Le);
|
|
2123
2122
|
if (c !== 0 && c !== S.index) {
|
|
@@ -2125,9 +2124,9 @@ function Ui(e, t) {
|
|
|
2125
2124
|
n.push(D), a.push([c, D.length, 0, ""]);
|
|
2126
2125
|
}
|
|
2127
2126
|
if (c = S.index + A.length, B)
|
|
2128
|
-
a.push([S.index, A.length, 0, ""]), s.push(`"${
|
|
2127
|
+
a.push([S.index, A.length, 0, ""]), s.push(`"${Hi(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? F ?? "");
|
|
2129
2128
|
else {
|
|
2130
|
-
const D =
|
|
2129
|
+
const D = zi(N, t), M = D?.isAsync === !0;
|
|
2131
2130
|
if (L !== void 0) {
|
|
2132
2131
|
const be = [];
|
|
2133
2132
|
for (const Me of L.slice(1, -1).split(",")) {
|
|
@@ -2159,7 +2158,7 @@ ${D.code}`
|
|
|
2159
2158
|
e.code = Lt(e.code, t);
|
|
2160
2159
|
return;
|
|
2161
2160
|
}
|
|
2162
|
-
const p =
|
|
2161
|
+
const p = En(r);
|
|
2163
2162
|
let m = e.code.slice(0, c);
|
|
2164
2163
|
for (let S = a.length - 1; S >= 0; S--) {
|
|
2165
2164
|
const [A, L, U, F] = a[S];
|
|
@@ -2170,15 +2169,15 @@ ${D.code}`
|
|
|
2170
2169
|
}
|
|
2171
2170
|
m = m.slice(0, A) + B + m.slice(A + N);
|
|
2172
2171
|
}
|
|
2173
|
-
const [f, g] = At(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${
|
|
2172
|
+
const [f, g] = At(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${Ui}${v}=>{`, C = s.join(","), E = `${g}},${C})`;
|
|
2174
2173
|
let P = e.code.slice(c, f);
|
|
2175
2174
|
P = `${n.join("")}${P}`, P = Lt(P, t);
|
|
2176
2175
|
const x = `${m}${w}${P}${E}`;
|
|
2177
2176
|
e.code = x;
|
|
2178
2177
|
}
|
|
2179
|
-
const
|
|
2178
|
+
const Ui = "export default $arcgis.t(";
|
|
2180
2179
|
function At(e) {
|
|
2181
|
-
const t =
|
|
2180
|
+
const t = Sn.exec(e.code), i = t?.index ?? e.code.length;
|
|
2182
2181
|
let s = "";
|
|
2183
2182
|
if (t !== null) {
|
|
2184
2183
|
const n = t[1].split(",");
|
|
@@ -2194,51 +2193,51 @@ function At(e) {
|
|
|
2194
2193
|
}
|
|
2195
2194
|
return [i, s];
|
|
2196
2195
|
}
|
|
2197
|
-
const
|
|
2198
|
-
function
|
|
2196
|
+
const wn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Sn = /export\{([^}]+)\};\n$/u, Le = "@arcgis/core/";
|
|
2197
|
+
function zi(e, t) {
|
|
2199
2198
|
if (!e.startsWith("./"))
|
|
2200
2199
|
return;
|
|
2201
2200
|
const i = e.slice(2), s = t.get(i);
|
|
2202
2201
|
if (s === void 0)
|
|
2203
2202
|
throw Error(b(O, `Failed to find the ${e} module`));
|
|
2204
|
-
if (s.isAsync === void 0 &&
|
|
2203
|
+
if (s.isAsync === void 0 && Wi(s, t), s.isAsync === void 0)
|
|
2205
2204
|
throw Error(b(O, `Failed to infer whether the ${e} module has top-level await`));
|
|
2206
2205
|
return s;
|
|
2207
2206
|
}
|
|
2208
2207
|
function Lt(e, t) {
|
|
2209
|
-
return e.replaceAll(
|
|
2208
|
+
return e.replaceAll(Cn, (i, s) => {
|
|
2210
2209
|
if (s.startsWith(Le))
|
|
2211
|
-
return `$arcgis.t(m=>m[0],"${
|
|
2210
|
+
return `$arcgis.t(m=>m[0],"${Hi(s.slice(Le.length))}")`;
|
|
2212
2211
|
if (s.startsWith("./")) {
|
|
2213
|
-
const n =
|
|
2212
|
+
const n = zi(s, t);
|
|
2214
2213
|
if (n?.isAsync === !0)
|
|
2215
2214
|
return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
|
|
2216
2215
|
}
|
|
2217
2216
|
return i;
|
|
2218
2217
|
});
|
|
2219
2218
|
}
|
|
2220
|
-
const
|
|
2221
|
-
function
|
|
2219
|
+
const Cn = /(?<![.\w\d])import\("([^"]+)"\)/gu, Hi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2220
|
+
function En(e) {
|
|
2222
2221
|
const t = [it];
|
|
2223
2222
|
return () => {
|
|
2224
2223
|
for (; ; ) {
|
|
2225
|
-
const i =
|
|
2226
|
-
if (
|
|
2224
|
+
const i = Pn(t);
|
|
2225
|
+
if (kn(t), !e.has(i))
|
|
2227
2226
|
return e.add(i), i;
|
|
2228
2227
|
}
|
|
2229
2228
|
};
|
|
2230
2229
|
}
|
|
2231
|
-
const it = 0, gt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
|
|
2232
|
-
function
|
|
2230
|
+
const it = 0, gt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", qi = `${gt}0123456789`, Tn = gt.length, $n = qi.length;
|
|
2231
|
+
function Pn(e) {
|
|
2233
2232
|
let t = gt[e[0]];
|
|
2234
2233
|
for (let i = 1; i < e.length; ++i)
|
|
2235
|
-
t +=
|
|
2234
|
+
t += qi[e[i]];
|
|
2236
2235
|
return t;
|
|
2237
2236
|
}
|
|
2238
|
-
function
|
|
2237
|
+
function kn(e) {
|
|
2239
2238
|
let t = e.length - 1;
|
|
2240
2239
|
for (; t >= 0; ) {
|
|
2241
|
-
const i = t === 0 ?
|
|
2240
|
+
const i = t === 0 ? Tn : $n;
|
|
2242
2241
|
if (e[t] += 1, e[t] >= i)
|
|
2243
2242
|
e[t] = it, t--;
|
|
2244
2243
|
else
|
|
@@ -2250,7 +2249,7 @@ function De(e = j(), t = !1) {
|
|
|
2250
2249
|
const i = e.name === "@esri/calcite-components", s = ut(e) ?? e.version, n = s.includes("next");
|
|
2251
2250
|
if (i && n)
|
|
2252
2251
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${s}/dist/${le}/`;
|
|
2253
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
2252
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = In(e.name), c = xn(s);
|
|
2254
2253
|
if (c === void 0)
|
|
2255
2254
|
throw Error(
|
|
2256
2255
|
b(
|
|
@@ -2260,16 +2259,16 @@ function De(e = j(), t = !1) {
|
|
|
2260
2259
|
);
|
|
2261
2260
|
return a === "core" ? `https://${r}/${c}/` : i ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
2262
2261
|
}
|
|
2263
|
-
const
|
|
2264
|
-
function
|
|
2262
|
+
const In = (e) => e.split("/").pop() ?? e;
|
|
2263
|
+
function xn(e) {
|
|
2265
2264
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2266
2265
|
if (i?.groups === void 0)
|
|
2267
2266
|
return;
|
|
2268
2267
|
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
|
|
2269
2268
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2270
2269
|
}
|
|
2271
|
-
async function
|
|
2272
|
-
const r = t.packageName, { hasCss: a, cdnName: c } = await
|
|
2270
|
+
async function An(e, t, i, s, n) {
|
|
2271
|
+
const r = t.packageName, { hasCss: a, cdnName: c } = await Vi(t.packageLocation) ?? {};
|
|
2273
2272
|
if (i === "cdn") {
|
|
2274
2273
|
const m = t.cdnUrl ?? De(t.packageJson, n);
|
|
2275
2274
|
return [
|
|
@@ -2312,9 +2311,9 @@ async function Ln(e, t, i, s, n) {
|
|
|
2312
2311
|
}
|
|
2313
2312
|
];
|
|
2314
2313
|
}
|
|
2315
|
-
async function
|
|
2314
|
+
async function Vi(e) {
|
|
2316
2315
|
const t = u.join(e, "dist"), i = u.basename(e), n = (await at(t)).filter(
|
|
2317
|
-
(a) => !
|
|
2316
|
+
(a) => !Ki.has(a) && !a.includes(".")
|
|
2318
2317
|
), r = n.find(
|
|
2319
2318
|
(a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
|
|
2320
2319
|
a === i
|
|
@@ -2334,8 +2333,8 @@ async function Nt(e, t) {
|
|
|
2334
2333
|
cdnName: t
|
|
2335
2334
|
} : void 0;
|
|
2336
2335
|
}
|
|
2337
|
-
async function
|
|
2338
|
-
const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await
|
|
2336
|
+
async function Ln(e, t, i, s, n) {
|
|
2337
|
+
const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await Vi(t.packageLocation) : void 0, c = a?.cdnName ?? le, d = a === void 0 ? `${_i}.js` : `${a.cdnName}.esm.js`;
|
|
2339
2338
|
if (i === "cdn")
|
|
2340
2339
|
return {
|
|
2341
2340
|
tag: "script",
|
|
@@ -2344,7 +2343,7 @@ async function Nn(e, t, i, s, n) {
|
|
|
2344
2343
|
src: `${t.cdnUrl ?? De(t.packageJson, n)}${d}`
|
|
2345
2344
|
}
|
|
2346
2345
|
};
|
|
2347
|
-
const l =
|
|
2346
|
+
const l = Nn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${Q}`, m = [
|
|
2348
2347
|
`import styles$${s} from "${p}";`,
|
|
2349
2348
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2350
2349
|
], f = `${t.packageName}/loader`;
|
|
@@ -2363,7 +2362,7 @@ async function Nn(e, t, i, s, n) {
|
|
|
2363
2362
|
]
|
|
2364
2363
|
};
|
|
2365
2364
|
}
|
|
2366
|
-
function
|
|
2365
|
+
function Nn(e) {
|
|
2367
2366
|
const { exports: t } = e;
|
|
2368
2367
|
if (t === void 0)
|
|
2369
2368
|
throw new Error(
|
|
@@ -2381,13 +2380,13 @@ async function jt(e, t) {
|
|
|
2381
2380
|
const a = async (m) => (await Promise.all(
|
|
2382
2381
|
m.map(async (f) => {
|
|
2383
2382
|
const g = r++;
|
|
2384
|
-
return f.type === "stencil" ? await
|
|
2383
|
+
return f.type === "stencil" ? await An(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await Ln(n, f, i, g, s) : void 0;
|
|
2385
2384
|
})
|
|
2386
2385
|
)).filter(R).flat(), c = await Promise.all([
|
|
2387
2386
|
// This may contain an import map so must be first
|
|
2388
|
-
|
|
2387
|
+
on(e, n, i, s),
|
|
2389
2388
|
ne.then(a),
|
|
2390
|
-
|
|
2389
|
+
Gi(e).then(a)
|
|
2391
2390
|
]), d = u.join(e.dir.src, "loader.ts"), l = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? le}/` : void 0);
|
|
2392
2391
|
return [
|
|
2393
2392
|
...c.flat(),
|
|
@@ -2406,11 +2405,11 @@ async function jt(e, t) {
|
|
|
2406
2405
|
}
|
|
2407
2406
|
];
|
|
2408
2407
|
}
|
|
2409
|
-
async function
|
|
2408
|
+
async function Gi(e) {
|
|
2410
2409
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
2411
2410
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
2412
2411
|
t.map(async (i) => {
|
|
2413
|
-
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await
|
|
2412
|
+
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await xi(n);
|
|
2414
2413
|
if (r === void 0)
|
|
2415
2414
|
throw Error(
|
|
2416
2415
|
b(
|
|
@@ -2425,12 +2424,12 @@ async function Xi(e) {
|
|
|
2425
2424
|
})
|
|
2426
2425
|
).then((i) => i.filter(R)), await e._serveOnlyDependencies);
|
|
2427
2426
|
}
|
|
2428
|
-
const
|
|
2429
|
-
function
|
|
2427
|
+
const Xi = "/C:@arcgis/lumina-compiler/testSetupFile", st = `${Xi}/dependencies`, Ft = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, We = [Xi];
|
|
2428
|
+
function jn(e) {
|
|
2430
2429
|
return e.apiJsonEnabled ? `${Rt(e)}
|
|
2431
2430
|
import "${st}";` : Rt(e);
|
|
2432
2431
|
}
|
|
2433
|
-
async function
|
|
2432
|
+
async function Fn(e) {
|
|
2434
2433
|
return (await oe(e)).map((i, s) => {
|
|
2435
2434
|
if ("javascriptCode" in i)
|
|
2436
2435
|
return i.javascriptCode.join(`
|
|
@@ -2455,16 +2454,16 @@ async function Rn(e) {
|
|
|
2455
2454
|
|
|
2456
2455
|
`);
|
|
2457
2456
|
}
|
|
2458
|
-
const Rt = (e) => [e.isInPuppeteerTestBackEnd ?
|
|
2457
|
+
const Rt = (e) => [e.isInPuppeteerTestBackEnd ? Rn : "", Dn].join(""), Rn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2459
2458
|
setupPuppeteerTest();
|
|
2460
|
-
`,
|
|
2459
|
+
`, Dn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2461
2460
|
setupLuminaTest();
|
|
2462
|
-
`,
|
|
2461
|
+
`, On = "@arcgis/lumina:generateLoaderTs";
|
|
2463
2462
|
let Ne;
|
|
2464
|
-
function
|
|
2463
|
+
function Mn(e) {
|
|
2465
2464
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2466
|
-
return [
|
|
2467
|
-
name:
|
|
2465
|
+
return [zs(e.apiExtractorPluginConfig), {
|
|
2466
|
+
name: On,
|
|
2468
2467
|
configResolved() {
|
|
2469
2468
|
Ne = `${e.dir.root}src/loader.ts`;
|
|
2470
2469
|
},
|
|
@@ -2479,7 +2478,7 @@ function Jn(e) {
|
|
|
2479
2478
|
id: t
|
|
2480
2479
|
},
|
|
2481
2480
|
async handler() {
|
|
2482
|
-
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise,
|
|
2481
|
+
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, Lr(e);
|
|
2483
2482
|
}
|
|
2484
2483
|
},
|
|
2485
2484
|
async handleHotUpdate() {
|
|
@@ -2501,7 +2500,7 @@ function Jn(e) {
|
|
|
2501
2500
|
filter: {
|
|
2502
2501
|
id: Ft
|
|
2503
2502
|
},
|
|
2504
|
-
handler: async (r) => r.startsWith(st) ? await
|
|
2503
|
+
handler: async (r) => r.startsWith(st) ? await Fn(e) : jn(e)
|
|
2505
2504
|
}
|
|
2506
2505
|
}];
|
|
2507
2506
|
}
|
|
@@ -2515,7 +2514,7 @@ const Ot = (e) => {
|
|
|
2515
2514
|
path: u.join("/", u.relative(e.dir.root, Ne))
|
|
2516
2515
|
});
|
|
2517
2516
|
};
|
|
2518
|
-
function
|
|
2517
|
+
function Jn(e) {
|
|
2519
2518
|
let t;
|
|
2520
2519
|
const i = () => [
|
|
2521
2520
|
...e.options.assets?.transformers ?? [],
|
|
@@ -2547,12 +2546,12 @@ function Bn(e) {
|
|
|
2547
2546
|
e.server = s, ie(e, await t, i()), s.watcher.on("addDir", (n) => {
|
|
2548
2547
|
if (n.endsWith("assets")) {
|
|
2549
2548
|
const r = u.dirname(n);
|
|
2550
|
-
u.join(r, "/") === e.dir.root ? ie(e, [
|
|
2549
|
+
u.join(r, "/") === e.dir.root ? ie(e, [Qi], i()) : n.startsWith(e.dir.srcComponents) && ie(e, [Yi(n, r)], i());
|
|
2551
2550
|
}
|
|
2552
2551
|
});
|
|
2553
2552
|
},
|
|
2554
2553
|
async writeBundle() {
|
|
2555
|
-
await
|
|
2554
|
+
await Fi(e, await t, i());
|
|
2556
2555
|
}
|
|
2557
2556
|
};
|
|
2558
2557
|
}
|
|
@@ -2560,16 +2559,16 @@ async function Mt(e) {
|
|
|
2560
2559
|
const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2561
2560
|
i.map(async (n) => {
|
|
2562
2561
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
2563
|
-
return await K(a) ?
|
|
2562
|
+
return await K(a) ? Yi(a, r) : void 0;
|
|
2564
2563
|
})
|
|
2565
2564
|
);
|
|
2566
|
-
return await t && s.push(
|
|
2565
|
+
return await t && s.push(Qi), s.filter(R);
|
|
2567
2566
|
}
|
|
2568
|
-
const
|
|
2567
|
+
const Yi = (e, t) => ({
|
|
2569
2568
|
type: "directory",
|
|
2570
2569
|
source: e,
|
|
2571
2570
|
destination: u.basename(t)
|
|
2572
|
-
}),
|
|
2571
|
+
}), Qi = { type: "directory", source: "assets/", destination: "" }, Ue = "@arcgis/lumina:printTotalBuildSize", Bn = (e) => ({
|
|
2573
2572
|
name: Ue,
|
|
2574
2573
|
apply: () => e.viteCommand === "build",
|
|
2575
2574
|
configResolved(t) {
|
|
@@ -2588,10 +2587,10 @@ const Qi = (e, t) => ({
|
|
|
2588
2587
|
const m = console.log;
|
|
2589
2588
|
console.log = function(...g) {
|
|
2590
2589
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2591
|
-
const [h, y] = g[0].match(
|
|
2590
|
+
const [h, y] = g[0].match(_n) ?? [];
|
|
2592
2591
|
if (!h)
|
|
2593
2592
|
return;
|
|
2594
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2593
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Wn, "").length);
|
|
2595
2594
|
const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2596
2595
|
y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
|
|
2597
2596
|
}
|
|
@@ -2607,7 +2606,7 @@ const Qi = (e, t) => ({
|
|
|
2607
2606
|
[
|
|
2608
2607
|
Bt,
|
|
2609
2608
|
y,
|
|
2610
|
-
|
|
2609
|
+
Kn,
|
|
2611
2610
|
"*",
|
|
2612
2611
|
" ".repeat(p - `${y}*`.length - h.length),
|
|
2613
2612
|
h,
|
|
@@ -2618,12 +2617,12 @@ const Qi = (e, t) => ({
|
|
|
2618
2617
|
}
|
|
2619
2618
|
};
|
|
2620
2619
|
}
|
|
2621
|
-
}), Jt = "\x1B[22m\x1B[1m\x1B[22m", Bt = "\x1B[2m",
|
|
2620
|
+
}), Jt = "\x1B[22m\x1B[1m\x1B[22m", Bt = "\x1B[2m", Kn = "\x1B[22m\x1B[36m", _n = /\d+(?:,\d+)?\.\d{2} kB/gu, Wn = /\x1B\[\d+m/gu, Un = new Intl.NumberFormat("en", {
|
|
2622
2621
|
maximumFractionDigits: 2,
|
|
2623
2622
|
minimumFractionDigits: 2
|
|
2624
|
-
}), Kt = (e) => `${
|
|
2625
|
-
var
|
|
2626
|
-
const _t = "@arcgis/lumina:configureVite",
|
|
2623
|
+
}), Kt = (e) => `${Un.format(e)} kB`, zn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ft.slice(0, -3)));
|
|
2624
|
+
var Hn = ["@arcgis-test/lit-components/loader", "@arcgis/ai-components/loader", "@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/charts-components/loader", "@arcgis/coding-components/loader", "@arcgis/common-components/loader", "@arcgis/core", "@arcgis/embeddable-components/loader", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-toolkit", "@arcgis/map-components/loader", "@arcgis/node-toolkit", "@arcgis/portal-components/loader", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
|
|
2625
|
+
const _t = "@arcgis/lumina:configureVite", qn = (e) => ({
|
|
2627
2626
|
name: _t,
|
|
2628
2627
|
async config({
|
|
2629
2628
|
server: t,
|
|
@@ -2631,7 +2630,7 @@ const _t = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2631
2630
|
build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
|
|
2632
2631
|
test: p = {}
|
|
2633
2632
|
}, m) {
|
|
2634
|
-
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && te &&
|
|
2633
|
+
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && te && Ni(m) ? oi(Li, import.meta.dirname) : void 0, C = w === void 0 ? [] : [
|
|
2635
2634
|
G(u.join(w, "**/*.{ts,tsx,mjs}")),
|
|
2636
2635
|
`!${G(u.join(w, "**/*.d.ts"))}`
|
|
2637
2636
|
], E = {
|
|
@@ -2714,7 +2713,7 @@ const _t = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2714
2713
|
*/
|
|
2715
2714
|
exclude: [
|
|
2716
2715
|
...te ? [
|
|
2717
|
-
...
|
|
2716
|
+
...Hn,
|
|
2718
2717
|
// This exact import is also supplied through optimizableImports in `dependencies/arcgisCore.ts`
|
|
2719
2718
|
// Optimizing it in the monorepo creates a separate core config instance, so the app does not receive the
|
|
2720
2719
|
// configured assetsPath.
|
|
@@ -2781,7 +2780,7 @@ const _t = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2781
2780
|
publicDir: i ?? !1,
|
|
2782
2781
|
build: {
|
|
2783
2782
|
cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
|
|
2784
|
-
target: n ??
|
|
2783
|
+
target: n ?? ji(e),
|
|
2785
2784
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2786
2785
|
lib: {
|
|
2787
2786
|
entry: E,
|
|
@@ -2846,15 +2845,15 @@ const _t = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
|
2846
2845
|
e._originalRollupInputOptions ??= t.input;
|
|
2847
2846
|
const s = { ...e._originalRollupInputOptions };
|
|
2848
2847
|
i.forEach((n) => {
|
|
2849
|
-
const r =
|
|
2848
|
+
const r = zn(n);
|
|
2850
2849
|
s[r] = n;
|
|
2851
2850
|
}), t.input = s;
|
|
2852
2851
|
}
|
|
2853
|
-
}), Se = "@arcgis/lumina:serveLocalCdn",
|
|
2852
|
+
}), Se = "@arcgis/lumina:serveLocalCdn", Vn = /^\/?@arcgis\/core(?=\/|$)/u, Zi = "/index.js", Gn = je(Zi), rt = `\0${Se}:index`, Xn = je(rt), Yn = 3e3, Qn = [
|
|
2854
2853
|
/^https?:\/\/localhost(?::[0-9]+)?$/u,
|
|
2855
2854
|
/^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
|
|
2856
2855
|
];
|
|
2857
|
-
function
|
|
2856
|
+
function Zn(e) {
|
|
2858
2857
|
if (!H)
|
|
2859
2858
|
return;
|
|
2860
2859
|
const t = j().name, i = t.split("/").pop() ?? t, s = `/${i}/index.js`, n = je(s), r = `\0${Se}:${i}`, a = je(r);
|
|
@@ -2862,49 +2861,49 @@ function eo(e) {
|
|
|
2862
2861
|
name: Se,
|
|
2863
2862
|
enforce: "pre",
|
|
2864
2863
|
apply(c) {
|
|
2865
|
-
const d =
|
|
2864
|
+
const d = io(e, c);
|
|
2866
2865
|
return d || (e._localCdnCore = void 0), d;
|
|
2867
2866
|
},
|
|
2868
2867
|
config: {
|
|
2869
2868
|
order: "post",
|
|
2870
2869
|
handler(c, d) {
|
|
2871
|
-
const l = c.server, p =
|
|
2870
|
+
const l = c.server, p = Ni(d), m = p ? Li : en, f = oi(m, import.meta.dirname);
|
|
2872
2871
|
if (f === void 0)
|
|
2873
2872
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2874
2873
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
2875
2874
|
server: {
|
|
2876
|
-
port: l?.port ??
|
|
2877
|
-
cors: l?.cors ?? { origin:
|
|
2875
|
+
port: l?.port ?? Yn,
|
|
2876
|
+
cors: l?.cors ?? { origin: Qn }
|
|
2878
2877
|
},
|
|
2879
2878
|
resolve: {
|
|
2880
2879
|
// The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
|
|
2881
2880
|
// to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
|
|
2882
|
-
alias: [{ find:
|
|
2881
|
+
alias: [{ find: Vn, replacement: f }]
|
|
2883
2882
|
}
|
|
2884
2883
|
};
|
|
2885
2884
|
}
|
|
2886
2885
|
},
|
|
2887
2886
|
resolveId: {
|
|
2888
|
-
filter: { id: [
|
|
2887
|
+
filter: { id: [Gn, n] },
|
|
2889
2888
|
handler(c) {
|
|
2890
|
-
if (c ===
|
|
2889
|
+
if (c === Zi)
|
|
2891
2890
|
return rt;
|
|
2892
2891
|
if (c === s)
|
|
2893
2892
|
return r;
|
|
2894
2893
|
}
|
|
2895
2894
|
},
|
|
2896
2895
|
load: {
|
|
2897
|
-
filter: { id: [
|
|
2896
|
+
filter: { id: [Xn, a] },
|
|
2898
2897
|
async handler(c) {
|
|
2899
2898
|
if (c === rt)
|
|
2900
2899
|
return `import ${JSON.stringify(s)};
|
|
2901
2900
|
`;
|
|
2902
2901
|
if (c === r)
|
|
2903
|
-
return await
|
|
2902
|
+
return await to(e);
|
|
2904
2903
|
}
|
|
2905
2904
|
},
|
|
2906
2905
|
handleHotUpdate({ file: c, server: d }) {
|
|
2907
|
-
if (
|
|
2906
|
+
if (eo(c, e._localCdnCore?.sourceLocation))
|
|
2908
2907
|
return d.ws.send({ type: "full-reload" }), [];
|
|
2909
2908
|
}
|
|
2910
2909
|
};
|
|
@@ -2912,30 +2911,30 @@ function eo(e) {
|
|
|
2912
2911
|
function je(e) {
|
|
2913
2912
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2914
2913
|
}
|
|
2915
|
-
function
|
|
2914
|
+
function eo(e, t) {
|
|
2916
2915
|
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2917
2916
|
}
|
|
2918
|
-
async function
|
|
2917
|
+
async function to(e) {
|
|
2919
2918
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2920
2919
|
return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
|
|
2921
2920
|
`)}
|
|
2922
2921
|
`;
|
|
2923
2922
|
}
|
|
2924
|
-
function
|
|
2923
|
+
function io(e, t) {
|
|
2925
2924
|
return te && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2926
2925
|
}
|
|
2927
|
-
const
|
|
2926
|
+
const so = (e) => ({
|
|
2928
2927
|
name: "@arcgis/lumina:setAssetPath",
|
|
2929
2928
|
apply: () => e.viteCommand === "build",
|
|
2930
2929
|
config: (t) => ({
|
|
2931
2930
|
base: t.base ?? e.options.assets?.defaultPath ?? De()
|
|
2932
2931
|
})
|
|
2933
2932
|
});
|
|
2934
|
-
function
|
|
2933
|
+
function ro(e = j()) {
|
|
2935
2934
|
const t = ut(e) ?? "0.0.1";
|
|
2936
|
-
return
|
|
2935
|
+
return Es(t);
|
|
2937
2936
|
}
|
|
2938
|
-
const
|
|
2937
|
+
const no = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2939
2938
|
Object.defineProperty(t, i, {
|
|
2940
2939
|
get() {
|
|
2941
2940
|
throw Error(
|
|
@@ -2974,8 +2973,8 @@ const ue = {
|
|
|
2974
2973
|
apiJson: "docs/api.json",
|
|
2975
2974
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2976
2975
|
}, nt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2977
|
-
async function
|
|
2978
|
-
const s =
|
|
2976
|
+
async function es(e, t, i = j()) {
|
|
2977
|
+
const s = oo(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await z(n, "utf8") : "";
|
|
2979
2978
|
if (a.trim().replaceAll(`\r
|
|
2980
2979
|
`, `
|
|
2981
2980
|
`) === s.trim())
|
|
@@ -2993,9 +2992,9 @@ Current content:
|
|
|
2993
2992
|
${a}`
|
|
2994
2993
|
)
|
|
2995
2994
|
);
|
|
2996
|
-
return
|
|
2995
|
+
return ci(n, s), !0;
|
|
2997
2996
|
}
|
|
2998
|
-
function
|
|
2997
|
+
function oo(e, t = j()) {
|
|
2999
2998
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3000
2999
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
3001
3000
|
(d, l) => `
|
|
@@ -3006,7 +3005,7 @@ declare module "@arcgis/lumina" {
|
|
|
3006
3005
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
3007
3006
|
}`, a = t.devDependencies ?? {};
|
|
3008
3007
|
return [
|
|
3009
|
-
|
|
3008
|
+
ao,
|
|
3010
3009
|
a.vitest ? `
|
|
3011
3010
|
/// <reference types="vitest/config" />
|
|
3012
3011
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3017,7 +3016,7 @@ declare module "@arcgis/lumina" {
|
|
|
3017
3016
|
`
|
|
3018
3017
|
].join("");
|
|
3019
3018
|
}
|
|
3020
|
-
const
|
|
3019
|
+
const ao = `/**
|
|
3021
3020
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3022
3021
|
* Manual edits will be overwritten.
|
|
3023
3022
|
*
|
|
@@ -3025,7 +3024,7 @@ const co = `/**
|
|
|
3025
3024
|
*
|
|
3026
3025
|
* If you need to provide additional types, create a separate file.
|
|
3027
3026
|
*/
|
|
3028
|
-
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport",
|
|
3027
|
+
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport", ts = (e, t) => e.viteCommand === "serve" && /**
|
|
3029
3028
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
3030
3029
|
* However, it is a bit buggy (see
|
|
3031
3030
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -3036,13 +3035,13 @@ const co = `/**
|
|
|
3036
3035
|
* is doing:
|
|
3037
3036
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3038
3037
|
*/
|
|
3039
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
3038
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, co = (e) => ({
|
|
3040
3039
|
name: Ce,
|
|
3041
3040
|
async configureServer(t) {
|
|
3042
|
-
H && (e.server = t, await
|
|
3041
|
+
H && (e.server = t, await cn(e));
|
|
3043
3042
|
},
|
|
3044
3043
|
configResolved() {
|
|
3045
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3044
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = lo(e).catch(
|
|
3046
3045
|
(t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3047
3046
|
));
|
|
3048
3047
|
},
|
|
@@ -3050,7 +3049,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3050
3049
|
// Add imports to index.html before Vite starts resolving imports
|
|
3051
3050
|
order: "pre",
|
|
3052
3051
|
async handler(t, i) {
|
|
3053
|
-
return
|
|
3052
|
+
return ts(e, i) ? (await oe(e)).map(
|
|
3054
3053
|
(n) => "javascriptCode" in n ? {
|
|
3055
3054
|
tag: "script",
|
|
3056
3055
|
attrs: {
|
|
@@ -3092,26 +3091,26 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3092
3091
|
await e._updateLuminaTsPromise;
|
|
3093
3092
|
}
|
|
3094
3093
|
});
|
|
3095
|
-
async function
|
|
3096
|
-
const i = (await Promise.all([ne,
|
|
3097
|
-
if (!await
|
|
3094
|
+
async function lo(e) {
|
|
3095
|
+
const i = (await Promise.all([ne, Gi(e)])).flat();
|
|
3096
|
+
if (!await es(i, e.dir.src))
|
|
3098
3097
|
return;
|
|
3099
3098
|
let n = !1;
|
|
3100
3099
|
function r() {
|
|
3101
|
-
n || T.warn(Ce,
|
|
3100
|
+
n || T.warn(Ce, po), n = !0;
|
|
3102
3101
|
}
|
|
3103
3102
|
process.on("exit", () => {
|
|
3104
3103
|
r(), clearTimeout(c);
|
|
3105
3104
|
});
|
|
3106
3105
|
const c = setTimeout(r, 2e3);
|
|
3107
3106
|
}
|
|
3108
|
-
const
|
|
3107
|
+
const po = Hs(
|
|
3109
3108
|
"greenBright",
|
|
3110
3109
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3111
3110
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3112
3111
|
);
|
|
3113
|
-
async function
|
|
3114
|
-
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await
|
|
3112
|
+
async function uo(e) {
|
|
3113
|
+
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Vs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : $t(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
3115
3114
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? pe(e.options.documentation.apiJsonFileName) : ue.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
3116
3115
|
{
|
|
3117
3116
|
type: "dynamic",
|
|
@@ -3119,7 +3118,7 @@ async function mo(e) {
|
|
|
3119
3118
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
3120
3119
|
}
|
|
3121
3120
|
]);
|
|
3122
|
-
const s = i?.types?.typeScriptConfig ??
|
|
3121
|
+
const s = i?.types?.typeScriptConfig ?? Gs(
|
|
3123
3122
|
process.cwd(),
|
|
3124
3123
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
3125
3124
|
!0
|
|
@@ -3181,7 +3180,7 @@ async function mo(e) {
|
|
|
3181
3180
|
Ot(e);
|
|
3182
3181
|
break;
|
|
3183
3182
|
}
|
|
3184
|
-
const y =
|
|
3183
|
+
const y = $i(h);
|
|
3185
3184
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
|
|
3186
3185
|
}
|
|
3187
3186
|
Dt(e);
|
|
@@ -3225,10 +3224,10 @@ function Wt(e, t) {
|
|
|
3225
3224
|
}
|
|
3226
3225
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3227
3226
|
}
|
|
3228
|
-
var
|
|
3227
|
+
var mo = Object.defineProperty, I = (e, t, i, s) => {
|
|
3229
3228
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3230
3229
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3231
|
-
return n &&
|
|
3230
|
+
return n && mo(t, i, n), n;
|
|
3232
3231
|
};
|
|
3233
3232
|
const V = "@arcgis/lumina:context";
|
|
3234
3233
|
class $ {
|
|
@@ -3273,11 +3272,11 @@ class $ {
|
|
|
3273
3272
|
extract: !0
|
|
3274
3273
|
}, (this.viteCommand === "build" ? r.build.watch : r.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
|
|
3275
3274
|
const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3276
|
-
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter =
|
|
3275
|
+
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = qs({
|
|
3277
3276
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3278
3277
|
target: o.ScriptTarget.ESNext,
|
|
3279
3278
|
sourceMap: r.build.sourcemap !== !1
|
|
3280
|
-
}),
|
|
3279
|
+
}), ts(this) && oe(this);
|
|
3281
3280
|
}
|
|
3282
3281
|
},
|
|
3283
3282
|
configureServer: {
|
|
@@ -3305,7 +3304,7 @@ class $ {
|
|
|
3305
3304
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3306
3305
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3307
3306
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3308
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3307
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = uo(this);
|
|
3309
3308
|
const s = process.cwd().length + 1;
|
|
3310
3309
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3311
3310
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3314,12 +3313,12 @@ class $ {
|
|
|
3314
3313
|
Pe(l, "src/components") && a.push(l);
|
|
3315
3314
|
}
|
|
3316
3315
|
return a;
|
|
3317
|
-
}),
|
|
3318
|
-
const n = t.build?.preamble ??
|
|
3319
|
-
this.banner =
|
|
3316
|
+
}), ki(void 0, t);
|
|
3317
|
+
const n = t.build?.preamble ?? ro();
|
|
3318
|
+
this.banner = no(n);
|
|
3320
3319
|
}
|
|
3321
3320
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3322
|
-
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(
|
|
3321
|
+
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(Pi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
3323
3322
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3324
3323
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3325
3324
|
}
|
|
@@ -3467,8 +3466,8 @@ I([
|
|
|
3467
3466
|
I([
|
|
3468
3467
|
k("configResolved()")
|
|
3469
3468
|
], $.prototype, "_typeScriptPrinter");
|
|
3470
|
-
function
|
|
3471
|
-
const s =
|
|
3469
|
+
function fo(e, t, i) {
|
|
3470
|
+
const s = Ii()[t] ?? is(e)[t];
|
|
3472
3471
|
if (s === void 0) {
|
|
3473
3472
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3474
3473
|
return;
|
|
@@ -3482,11 +3481,11 @@ function go(e, t, i) {
|
|
|
3482
3481
|
}
|
|
3483
3482
|
return s;
|
|
3484
3483
|
}
|
|
3485
|
-
function
|
|
3484
|
+
function go(e, t) {
|
|
3486
3485
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3487
3486
|
}
|
|
3488
|
-
function
|
|
3489
|
-
return e._localDefinedComponents ??=
|
|
3487
|
+
function is(e) {
|
|
3488
|
+
return e._localDefinedComponents ??= Ai(
|
|
3490
3489
|
e.privateApiJson,
|
|
3491
3490
|
{
|
|
3492
3491
|
packageName: void 0,
|
|
@@ -3497,8 +3496,8 @@ function ss(e) {
|
|
|
3497
3496
|
e.viteCommand === "build"
|
|
3498
3497
|
), e._localDefinedComponents;
|
|
3499
3498
|
}
|
|
3500
|
-
const Ut = "makeRuntime(",
|
|
3501
|
-
name:
|
|
3499
|
+
const Ut = "makeRuntime(", ho = "@arcgis/core", yo = "@arcgis/lumina:injectRuntimeOptions", vo = (e) => ({
|
|
3500
|
+
name: yo,
|
|
3502
3501
|
transform: {
|
|
3503
3502
|
filter: {
|
|
3504
3503
|
id: /\/src\/runtime\.ts$/u
|
|
@@ -3517,7 +3516,7 @@ const Ut = "makeRuntime(", yo = "@arcgis/core", vo = "@arcgis/lumina:injectRunti
|
|
|
3517
3516
|
"{",
|
|
3518
3517
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
3519
3518
|
'hydratedAttribute:"',
|
|
3520
|
-
e.options.css?.hydratedAttribute ??
|
|
3519
|
+
e.options.css?.hydratedAttribute ?? Ei,
|
|
3521
3520
|
'",',
|
|
3522
3521
|
r === void 0 ? "" : "commonStyles",
|
|
3523
3522
|
"}",
|
|
@@ -3525,7 +3524,7 @@ const Ut = "makeRuntime(", yo = "@arcgis/core", vo = "@arcgis/lumina:injectRunti
|
|
|
3525
3524
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3526
3525
|
// a cyclical dependency.
|
|
3527
3526
|
H ? `
|
|
3528
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3527
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${ho}/applications/Components/reactiveUtils.js";
|
|
3529
3528
|
createObservable,
|
|
3530
3529
|
runtime.t = trackAccess;
|
|
3531
3530
|
runtime.o = createObservable;
|
|
@@ -3537,11 +3536,11 @@ runtime.r = runTracked;` : ""
|
|
|
3537
3536
|
}
|
|
3538
3537
|
}
|
|
3539
3538
|
});
|
|
3540
|
-
function
|
|
3539
|
+
function bo(e) {
|
|
3541
3540
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${Z}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3542
3541
|
`;
|
|
3543
3542
|
}
|
|
3544
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3543
|
+
const we = "@arcgis/lumina:addNonLazyImports", wo = (e) => ({
|
|
3545
3544
|
name: we,
|
|
3546
3545
|
apply: () => e.viteCommand === "build",
|
|
3547
3546
|
generateBundle(t, i) {
|
|
@@ -3553,7 +3552,7 @@ const we = "@arcgis/lumina:addNonLazyImports", So = (e) => ({
|
|
|
3553
3552
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3554
3553
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3555
3554
|
let m = c.code;
|
|
3556
|
-
m =
|
|
3555
|
+
m = mn(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = bo(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
|
|
3557
3556
|
}
|
|
3558
3557
|
}), !r && !e.isInStorybook)
|
|
3559
3558
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3567,7 +3566,7 @@ const we = "@arcgis/lumina:addNonLazyImports", So = (e) => ({
|
|
|
3567
3566
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
3568
3567
|
if (s.has(r) || a.length === 0 && c.length === 0)
|
|
3569
3568
|
return;
|
|
3570
|
-
const l =
|
|
3569
|
+
const l = ss(t, d, s);
|
|
3571
3570
|
if (l.forEach((p) => {
|
|
3572
3571
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
3573
3572
|
}), (a.length > 0 || c.length > 0) && l.length === 0) {
|
|
@@ -3590,10 +3589,10 @@ Possible causes:
|
|
|
3590
3589
|
return [];
|
|
3591
3590
|
const d = u.dirname(r), l = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
|
|
3592
3591
|
function m(P) {
|
|
3593
|
-
const x =
|
|
3592
|
+
const x = fo(e, P, r);
|
|
3594
3593
|
if (x === void 0)
|
|
3595
3594
|
return;
|
|
3596
|
-
const S =
|
|
3595
|
+
const S = go(x, p);
|
|
3597
3596
|
if (S !== `./${p}`)
|
|
3598
3597
|
return S.startsWith(".") ? `${S}/${zt}` : S;
|
|
3599
3598
|
}
|
|
@@ -3618,7 +3617,7 @@ deferredLoaders${w.join("")};` : C;
|
|
|
3618
3617
|
});
|
|
3619
3618
|
await Promise.all(n);
|
|
3620
3619
|
}
|
|
3621
|
-
}), zt = "index.js",
|
|
3620
|
+
}), zt = "index.js", ss = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), ss(e, e[n].referencedBy, i, s)));
|
|
3622
3621
|
function Ht(e, t, i) {
|
|
3623
3622
|
if (ee(e))
|
|
3624
3623
|
return e;
|
|
@@ -3638,14 +3637,14 @@ function ee(e) {
|
|
|
3638
3637
|
return (
|
|
3639
3638
|
// Inlined string literal
|
|
3640
3639
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3641
|
-
|
|
3640
|
+
So.has(e.kind) || // Ternary with both branches never undefined
|
|
3642
3641
|
o.isConditionalExpression(e) && ee(e.whenTrue) && ee(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3643
|
-
o.isBinaryExpression(e) && (
|
|
3642
|
+
o.isBinaryExpression(e) && (Co.has(e.operatorToken.kind) || ee(e.left) && ee(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3644
3643
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ee(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3645
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3644
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && pr.has(e.tag.text)
|
|
3646
3645
|
);
|
|
3647
3646
|
}
|
|
3648
|
-
const
|
|
3647
|
+
const So = /* @__PURE__ */ new Set([
|
|
3649
3648
|
o.SyntaxKind.NumericLiteral,
|
|
3650
3649
|
o.SyntaxKind.BigIntLiteral,
|
|
3651
3650
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3664,7 +3663,7 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3664
3663
|
o.SyntaxKind.ClassExpression,
|
|
3665
3664
|
// Trust? Trust.
|
|
3666
3665
|
o.SyntaxKind.NonNullExpression
|
|
3667
|
-
]),
|
|
3666
|
+
]), Co = /* @__PURE__ */ new Set([
|
|
3668
3667
|
o.SyntaxKind.PlusEqualsToken,
|
|
3669
3668
|
o.SyntaxKind.MinusEqualsToken,
|
|
3670
3669
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3699,9 +3698,9 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3699
3698
|
o.SyntaxKind.SlashToken,
|
|
3700
3699
|
o.SyntaxKind.PercentToken,
|
|
3701
3700
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3702
|
-
]),
|
|
3701
|
+
]), Eo = {
|
|
3703
3702
|
property(e, t, i, s) {
|
|
3704
|
-
const n =
|
|
3703
|
+
const n = To(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3705
3704
|
if (a) {
|
|
3706
3705
|
const f = He(t);
|
|
3707
3706
|
if (f === !0)
|
|
@@ -3718,7 +3717,7 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3718
3717
|
p,
|
|
3719
3718
|
e,
|
|
3720
3719
|
m ? "" : void 0
|
|
3721
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3720
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? Po(f, e) : f;
|
|
3722
3721
|
if (h !== p)
|
|
3723
3722
|
return [m ? `.${i}` : n.name, l, h];
|
|
3724
3723
|
}
|
|
@@ -3743,7 +3742,7 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3743
3742
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3744
3743
|
);
|
|
3745
3744
|
const s = i.slice(2), n = Ct(s);
|
|
3746
|
-
return [`@${
|
|
3745
|
+
return [`@${gi.has(n) ? s.toLowerCase() : Ct(s)}=`, ...vt(e, t, void 0)];
|
|
3747
3746
|
},
|
|
3748
3747
|
directives(e, t) {
|
|
3749
3748
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3791,7 +3790,7 @@ const Co = /* @__PURE__ */ new Set([
|
|
|
3791
3790
|
return [o.factory.createIdentifier(n)];
|
|
3792
3791
|
}
|
|
3793
3792
|
};
|
|
3794
|
-
function
|
|
3793
|
+
function To(e, t, i) {
|
|
3795
3794
|
if (typeof e == "string") {
|
|
3796
3795
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3797
3796
|
if (r !== void 0)
|
|
@@ -3865,8 +3864,8 @@ function qt(e, t) {
|
|
|
3865
3864
|
const i = e.text;
|
|
3866
3865
|
if (i.length === 0)
|
|
3867
3866
|
return [];
|
|
3868
|
-
const s =
|
|
3869
|
-
if (
|
|
3867
|
+
const s = hi(i);
|
|
3868
|
+
if (or(s)) {
|
|
3870
3869
|
const n = s.replaceAll('"', """);
|
|
3871
3870
|
if (n.length > s.length) {
|
|
3872
3871
|
const r = s.replaceAll("'", "'");
|
|
@@ -3885,7 +3884,7 @@ function Vt(e, t, i) {
|
|
|
3885
3884
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3886
3885
|
);
|
|
3887
3886
|
const s = t.expression;
|
|
3888
|
-
if (
|
|
3887
|
+
if ($o(s)) {
|
|
3889
3888
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3890
3889
|
e.neededImports.add(r);
|
|
3891
3890
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3895,15 +3894,15 @@ function Vt(e, t, i) {
|
|
|
3895
3894
|
} else
|
|
3896
3895
|
return [i, ...Ee(e, t, !0)];
|
|
3897
3896
|
}
|
|
3898
|
-
const
|
|
3899
|
-
function
|
|
3897
|
+
const $o = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3898
|
+
function Po(e, t) {
|
|
3900
3899
|
t.neededImports.add("live");
|
|
3901
3900
|
const i = t.importRenames.live;
|
|
3902
3901
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3903
3902
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3904
3903
|
]);
|
|
3905
3904
|
}
|
|
3906
|
-
function
|
|
3905
|
+
function ko(e) {
|
|
3907
3906
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Gt && e.expression.arguments.length <= 1)
|
|
3908
3907
|
return {
|
|
3909
3908
|
propType: Gt[e.expression.expression.text],
|
|
@@ -3921,15 +3920,15 @@ const Gt = {
|
|
|
3921
3920
|
bindBooleanAttribute: "booleanAttribute",
|
|
3922
3921
|
bindEvent: "event"
|
|
3923
3922
|
};
|
|
3924
|
-
function
|
|
3925
|
-
return
|
|
3923
|
+
function Io(e, t, i) {
|
|
3924
|
+
return Ao.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ui.has(e) || e.includes("-") ? "attribute" : !dt(i) && (mi.has(e) || (i === Ye ? !1 : i === ke ? (
|
|
3926
3925
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3927
3926
|
Object.values(Qe).some((r) => r.has(e))
|
|
3928
3927
|
) : Qe[i]?.has(e) === !0)) ? Pt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (ct.has(i) || lt.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : Pt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3929
3928
|
}
|
|
3930
|
-
const
|
|
3929
|
+
const xo = ["class", "style", "ref", "directives", "key", "deferLoad"], Ao = new Set(xo), Lo = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3931
3930
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3932
|
-
const n =
|
|
3931
|
+
const n = No(t);
|
|
3933
3932
|
if (n.length % 2 === 0)
|
|
3934
3933
|
throw new Error("Normalized template parts array length must be odd");
|
|
3935
3934
|
const [r, ...a] = n;
|
|
@@ -3950,11 +3949,11 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3950
3949
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3951
3950
|
o.factory.createIdentifier(d),
|
|
3952
3951
|
void 0,
|
|
3953
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3952
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), jo(a))
|
|
3954
3953
|
);
|
|
3955
3954
|
return qe(s, e, l);
|
|
3956
3955
|
}
|
|
3957
|
-
const
|
|
3956
|
+
const No = (e) => e.reduce(
|
|
3958
3957
|
(t, i, s) => {
|
|
3959
3958
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3960
3959
|
if (r && a)
|
|
@@ -3964,7 +3963,7 @@ const jo = (e) => e.reduce(
|
|
|
3964
3963
|
},
|
|
3965
3964
|
[""]
|
|
3966
3965
|
);
|
|
3967
|
-
function
|
|
3966
|
+
function jo(e) {
|
|
3968
3967
|
if (!(e.length % 2 === 0))
|
|
3969
3968
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3970
3969
|
const i = e.length / 2;
|
|
@@ -3989,8 +3988,8 @@ function qe(e, t, i) {
|
|
|
3989
3988
|
const s = e.importRenames.keyed;
|
|
3990
3989
|
return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
|
|
3991
3990
|
}
|
|
3992
|
-
const
|
|
3993
|
-
function
|
|
3991
|
+
const rs = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
3992
|
+
function ns(e, t) {
|
|
3994
3993
|
const i = yt(e);
|
|
3995
3994
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
3996
3995
|
t,
|
|
@@ -3998,18 +3997,18 @@ function os(e, t) {
|
|
|
3998
3997
|
...s,
|
|
3999
3998
|
pos: -1,
|
|
4000
3999
|
end: -1,
|
|
4001
|
-
text:
|
|
4000
|
+
text: os(e.slice(s.pos, s.end))
|
|
4002
4001
|
}))
|
|
4003
4002
|
);
|
|
4004
4003
|
}
|
|
4005
4004
|
const yt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4006
|
-
function
|
|
4005
|
+
function Fo(e) {
|
|
4007
4006
|
const t = yt(e);
|
|
4008
4007
|
if (t.length === 0)
|
|
4009
4008
|
return [e || " "];
|
|
4010
4009
|
const i = t.reduceRight(
|
|
4011
4010
|
([n, ...r], a) => {
|
|
4012
|
-
const c =
|
|
4011
|
+
const c = Ro(n), d = os(c.slice(a.pos, a.end));
|
|
4013
4012
|
return [
|
|
4014
4013
|
c.slice(0, a.pos),
|
|
4015
4014
|
/**
|
|
@@ -4027,13 +4026,13 @@ function Ro(e) {
|
|
|
4027
4026
|
const s = i.at(-1);
|
|
4028
4027
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4029
4028
|
}
|
|
4030
|
-
const
|
|
4031
|
-
function
|
|
4029
|
+
const os = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4030
|
+
function Ro(e) {
|
|
4032
4031
|
if (typeof e == "string")
|
|
4033
4032
|
return e;
|
|
4034
4033
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4035
4034
|
}
|
|
4036
|
-
function
|
|
4035
|
+
function Do(e, t) {
|
|
4037
4036
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4038
4037
|
return t;
|
|
4039
4038
|
const s = t.arguments[0];
|
|
@@ -4057,17 +4056,17 @@ function Oo(e, t) {
|
|
|
4057
4056
|
if (!Xt(C))
|
|
4058
4057
|
return t;
|
|
4059
4058
|
const E = c.statements.slice(0, -1);
|
|
4060
|
-
if (E.some(
|
|
4059
|
+
if (E.some(as))
|
|
4061
4060
|
return t;
|
|
4062
4061
|
d = E.length === 0, l = C;
|
|
4063
4062
|
}
|
|
4064
|
-
const p = o.isJsxElement(l) ? l.openingElement : l, m =
|
|
4063
|
+
const p = o.isJsxElement(l) ? l.openingElement : l, m = us(p);
|
|
4065
4064
|
if (m === -1)
|
|
4066
4065
|
return t;
|
|
4067
4066
|
const f = p.attributes.properties[m];
|
|
4068
4067
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4069
4068
|
return t;
|
|
4070
|
-
const g = ht(f.initializer, e.sourceFile), h =
|
|
4069
|
+
const g = ht(f.initializer, e.sourceFile), h = Oo(r, s, g, d, e);
|
|
4071
4070
|
if (h === void 0)
|
|
4072
4071
|
return t;
|
|
4073
4072
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4090,21 +4089,21 @@ function Oo(e, t) {
|
|
|
4090
4089
|
]);
|
|
4091
4090
|
}
|
|
4092
4091
|
const Xt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
4093
|
-
function
|
|
4092
|
+
function as(e) {
|
|
4094
4093
|
if (o.isReturnStatement(e))
|
|
4095
4094
|
return !0;
|
|
4096
4095
|
let t = !1;
|
|
4097
4096
|
return o.visitEachChild(
|
|
4098
4097
|
e,
|
|
4099
|
-
(i) => (t ||=
|
|
4098
|
+
(i) => (t ||= as(i), i),
|
|
4100
4099
|
void 0
|
|
4101
4100
|
), t;
|
|
4102
4101
|
}
|
|
4103
|
-
function
|
|
4102
|
+
function Oo(e, t, i, s, n) {
|
|
4104
4103
|
const r = J(i);
|
|
4105
4104
|
if (r === void 0)
|
|
4106
4105
|
return;
|
|
4107
|
-
let a =
|
|
4106
|
+
let a = cs(e.name, r);
|
|
4108
4107
|
const c = t.parameters.at(1);
|
|
4109
4108
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
4110
4109
|
r.every(Fe, c.name)) {
|
|
@@ -4116,7 +4115,7 @@ function Mo(e, t, i, s, n) {
|
|
|
4116
4115
|
return;
|
|
4117
4116
|
}
|
|
4118
4117
|
if (!s) {
|
|
4119
|
-
const d =
|
|
4118
|
+
const d = Jo(r, a, t);
|
|
4120
4119
|
if (d === void 0)
|
|
4121
4120
|
return;
|
|
4122
4121
|
a = d;
|
|
@@ -4155,7 +4154,7 @@ function J(e) {
|
|
|
4155
4154
|
}
|
|
4156
4155
|
return t;
|
|
4157
4156
|
} else {
|
|
4158
|
-
if (
|
|
4157
|
+
if (Mo.has(e.kind))
|
|
4159
4158
|
return [];
|
|
4160
4159
|
{
|
|
4161
4160
|
const t = ge(e);
|
|
@@ -4163,7 +4162,7 @@ function J(e) {
|
|
|
4163
4162
|
}
|
|
4164
4163
|
}
|
|
4165
4164
|
}
|
|
4166
|
-
const
|
|
4165
|
+
const Mo = /* @__PURE__ */ new Set([
|
|
4167
4166
|
o.SyntaxKind.NumericLiteral,
|
|
4168
4167
|
o.SyntaxKind.BigIntLiteral,
|
|
4169
4168
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4172,20 +4171,20 @@ const Jo = /* @__PURE__ */ new Set([
|
|
|
4172
4171
|
o.SyntaxKind.FalseKeyword,
|
|
4173
4172
|
o.SyntaxKind.NullKeyword,
|
|
4174
4173
|
o.SyntaxKind.TrueKeyword
|
|
4175
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e,
|
|
4176
|
-
function
|
|
4174
|
+
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, cs = (e, t) => o.isObjectBindingPattern(e) ? _o(e, t) : e;
|
|
4175
|
+
function Jo(e, t, i) {
|
|
4177
4176
|
if (e.every(Fe, t))
|
|
4178
4177
|
return t;
|
|
4179
4178
|
if (o.isIdentifier(t)) {
|
|
4180
|
-
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) =>
|
|
4179
|
+
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => Bo(r, t)) : void 0;
|
|
4181
4180
|
if (s === void 0)
|
|
4182
4181
|
return;
|
|
4183
|
-
const n =
|
|
4182
|
+
const n = cs(s, e);
|
|
4184
4183
|
if (e.every(Fe, n))
|
|
4185
4184
|
return n;
|
|
4186
4185
|
}
|
|
4187
4186
|
}
|
|
4188
|
-
function
|
|
4187
|
+
function Bo(e, t) {
|
|
4189
4188
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4190
4189
|
return;
|
|
4191
4190
|
const i = e.declarationList.declarations[0];
|
|
@@ -4193,34 +4192,34 @@ function Ko(e, t) {
|
|
|
4193
4192
|
}
|
|
4194
4193
|
function Fe(e) {
|
|
4195
4194
|
const t = this;
|
|
4196
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4195
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Ko, e);
|
|
4197
4196
|
}
|
|
4198
|
-
function
|
|
4197
|
+
function Ko(e) {
|
|
4199
4198
|
const t = this;
|
|
4200
4199
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4201
4200
|
}
|
|
4202
|
-
function
|
|
4201
|
+
function _o(e, t) {
|
|
4203
4202
|
let i = !1;
|
|
4204
4203
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4205
4204
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
4206
4205
|
}
|
|
4207
|
-
const
|
|
4206
|
+
const ls = (e, t) => t.liftedKeys.has(e);
|
|
4208
4207
|
function q(e, t, i) {
|
|
4209
4208
|
if (fe(i))
|
|
4210
|
-
return
|
|
4211
|
-
const s = o.isCallExpression(i) ?
|
|
4209
|
+
return ds(e, i);
|
|
4210
|
+
const s = o.isCallExpression(i) ? Do(e, i) : i, n = o.visitEachChild(
|
|
4212
4211
|
s,
|
|
4213
4212
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4214
4213
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4215
4214
|
e.transformationContext
|
|
4216
4215
|
);
|
|
4217
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) ||
|
|
4216
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || gr(i.right)) ? zo(n) : n;
|
|
4218
4217
|
}
|
|
4219
|
-
function
|
|
4220
|
-
const i =
|
|
4218
|
+
function ds(e, t) {
|
|
4219
|
+
const i = ps(e, t);
|
|
4221
4220
|
return Oe(i, e);
|
|
4222
4221
|
}
|
|
4223
|
-
function
|
|
4222
|
+
function ps(e, t) {
|
|
4224
4223
|
const i = "children" in t ? t.children : [];
|
|
4225
4224
|
if (o.isJsxFragment(t))
|
|
4226
4225
|
return { key: void 0, ...Te(i, e) };
|
|
@@ -4228,17 +4227,17 @@ function us(e, t) {
|
|
|
4228
4227
|
if (o.isJsxNamespacedName(r))
|
|
4229
4228
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4230
4229
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== Ke) {
|
|
4231
|
-
const S = o.isIdentifier(r) && r.text ===
|
|
4230
|
+
const S = o.isIdentifier(r) && r.text === Zs ? Te(i, e) : {
|
|
4232
4231
|
// No need to wrap the function call in a lit-html tag
|
|
4233
4232
|
litTag: void 0,
|
|
4234
|
-
parts: [
|
|
4233
|
+
parts: [Uo(e, t, r, i)]
|
|
4235
4234
|
};
|
|
4236
4235
|
return {
|
|
4237
|
-
key:
|
|
4236
|
+
key: Wo(n, e),
|
|
4238
4237
|
...S
|
|
4239
4238
|
};
|
|
4240
4239
|
}
|
|
4241
|
-
const c = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ? Y :
|
|
4240
|
+
const c = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ? Y : tr.has(c) ? yi : ct.has(c) ? se : ce, l = dt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4242
4241
|
let f;
|
|
4243
4242
|
const g = [];
|
|
4244
4243
|
let h = !1;
|
|
@@ -4251,13 +4250,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4251
4250
|
const { name: S, initializer: A } = x;
|
|
4252
4251
|
if (o.isJsxNamespacedName(S))
|
|
4253
4252
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
4254
|
-
const L = S.text, U =
|
|
4253
|
+
const L = S.text, U = ko(A), F = U?.propType ?? Io(L, A, c);
|
|
4255
4254
|
m?.delete(L);
|
|
4256
|
-
const N =
|
|
4255
|
+
const N = Eo[F](e, U?.initializer ?? A, L, c);
|
|
4257
4256
|
if (N.length === 0)
|
|
4258
4257
|
return [];
|
|
4259
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4260
|
-
return F === "key" ? (f = typeof N[0] == "object" && !
|
|
4258
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : Fo(rs(S, e));
|
|
4259
|
+
return F === "key" ? (f = typeof N[0] == "object" && !ls(S, e) ? N[0] : void 0, B.some(Lo) ? B : []) : F === "directives" || F === "ref" || L === "deferLoad" ? (h ||= F === "deferLoad", g.push(
|
|
4261
4260
|
...B,
|
|
4262
4261
|
...N.flatMap(
|
|
4263
4262
|
(D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
|
|
@@ -4273,7 +4272,7 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4273
4272
|
`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`
|
|
4274
4273
|
);
|
|
4275
4274
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4276
|
-
const v = typeof c == "string" &&
|
|
4275
|
+
const v = typeof c == "string" && er.has(c), w = Te(i, e);
|
|
4277
4276
|
if (v && w.parts.length > 0)
|
|
4278
4277
|
throw Error(
|
|
4279
4278
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
@@ -4297,21 +4296,21 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4297
4296
|
];
|
|
4298
4297
|
return { key: f, parts: P, litTag: d };
|
|
4299
4298
|
}
|
|
4300
|
-
function
|
|
4301
|
-
const i = e.attributes.properties[
|
|
4302
|
-
return i && o.isJsxAttribute(i) && !
|
|
4299
|
+
function Wo(e, t) {
|
|
4300
|
+
const i = e.attributes.properties[us(e)];
|
|
4301
|
+
return i && o.isJsxAttribute(i) && !ls(i.name, t) ? ht(i.initializer, t.sourceFile) : void 0;
|
|
4303
4302
|
}
|
|
4304
|
-
const
|
|
4305
|
-
function
|
|
4303
|
+
const us = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4304
|
+
function Uo(e, t, i, s) {
|
|
4306
4305
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4307
4306
|
if (o.isJsxSpreadAttribute(d))
|
|
4308
|
-
return
|
|
4307
|
+
return ns(rs(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4309
4308
|
const { name: l, initializer: p } = d;
|
|
4310
4309
|
if (o.isJsxNamespacedName(l))
|
|
4311
4310
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4312
4311
|
if (l.text === "key")
|
|
4313
4312
|
return;
|
|
4314
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ?
|
|
4313
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? ds(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = li(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
4315
4314
|
return o.factory.createPropertyAssignment(f, m);
|
|
4316
4315
|
}), { parts: a, litTag: c } = Te(s, e);
|
|
4317
4316
|
return a.length > 0 && r.push(
|
|
@@ -4327,13 +4326,13 @@ function Te(e, t) {
|
|
|
4327
4326
|
let i;
|
|
4328
4327
|
const s = e.flatMap((n) => {
|
|
4329
4328
|
if (o.isJsxText(n))
|
|
4330
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4329
|
+
return [t.compiler.shouldMinifyJsx ? sr(n.text) : n.text];
|
|
4331
4330
|
if (o.isJsxExpression(n))
|
|
4332
4331
|
return vt(t, n, n);
|
|
4333
4332
|
{
|
|
4334
|
-
const r =
|
|
4333
|
+
const r = ps(t, n);
|
|
4335
4334
|
if (r.key === void 0 && r.litTag !== ae && r.litTag !== Y) {
|
|
4336
|
-
if (r.litTag ===
|
|
4335
|
+
if (r.litTag === yi)
|
|
4337
4336
|
return r.parts;
|
|
4338
4337
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
4339
4338
|
throw new Error(
|
|
@@ -4346,7 +4345,7 @@ function Te(e, t) {
|
|
|
4346
4345
|
});
|
|
4347
4346
|
return { litTag: i, parts: s };
|
|
4348
4347
|
}
|
|
4349
|
-
function
|
|
4348
|
+
function zo(e) {
|
|
4350
4349
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4351
4350
|
e,
|
|
4352
4351
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4358,9 +4357,9 @@ function vt(e, t, i) {
|
|
|
4358
4357
|
if (e.compiler.shouldMinifyJsx)
|
|
4359
4358
|
return [];
|
|
4360
4359
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4361
|
-
return yt(s).length === 0 ? [] : [
|
|
4360
|
+
return yt(s).length === 0 ? [] : [ns(s, o.factory.createIdentifier("undefined"))];
|
|
4362
4361
|
}
|
|
4363
|
-
return o.isStringLiteral(t.expression) ? [
|
|
4362
|
+
return o.isStringLiteral(t.expression) ? [hi(t.expression.text)] : (
|
|
4364
4363
|
/**
|
|
4365
4364
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
4366
4365
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4397,17 +4396,17 @@ function vt(e, t, i) {
|
|
|
4397
4396
|
] : [q(e, i, t.expression)]
|
|
4398
4397
|
);
|
|
4399
4398
|
}
|
|
4400
|
-
const
|
|
4399
|
+
const ms = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), fs = ms(
|
|
4401
4400
|
Object.entries(re).flatMap(
|
|
4402
4401
|
([e, t]) => t.map((i) => [i, e])
|
|
4403
4402
|
)
|
|
4404
|
-
),
|
|
4405
|
-
function
|
|
4403
|
+
), gs = new Set(Object.keys(fs));
|
|
4404
|
+
function Ho(e, t) {
|
|
4406
4405
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4407
4406
|
if (!o.isStringLiteral(n))
|
|
4408
4407
|
return t;
|
|
4409
|
-
const r =
|
|
4410
|
-
if (a && e.existingImportedModules.add(r),
|
|
4408
|
+
const r = qo(e.sourceFile.fileName, n.text, ""), a = i?.phaseModifier !== o.SyntaxKind.TypeKeyword;
|
|
4409
|
+
if (a && e.existingImportedModules.add(r), yr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4411
4410
|
!n.text.includes("?")) {
|
|
4412
4411
|
if (s) {
|
|
4413
4412
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4440,12 +4439,12 @@ function qo(e, t) {
|
|
|
4440
4439
|
const c = i.namedBindings;
|
|
4441
4440
|
if (c === void 0 || !o.isNamedImports(c))
|
|
4442
4441
|
return t;
|
|
4443
|
-
const d =
|
|
4442
|
+
const d = gs.has(n.text);
|
|
4444
4443
|
if (c.elements.forEach((l) => {
|
|
4445
4444
|
const p = (l.propertyName ?? l.name).text, m = re[p];
|
|
4446
4445
|
if (d) {
|
|
4447
4446
|
if (m?.some((h) => h === n.text)) {
|
|
4448
|
-
const h =
|
|
4447
|
+
const h = hs(p, r);
|
|
4449
4448
|
e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
|
|
4450
4449
|
}
|
|
4451
4450
|
} else (l.name.text === "h" || l.name.text === "createElement") && j().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
|
|
@@ -4455,7 +4454,7 @@ function qo(e, t) {
|
|
|
4455
4454
|
let l = !1;
|
|
4456
4455
|
const p = c.elements.filter((f) => {
|
|
4457
4456
|
const g = (f.propertyName ?? f.name).text;
|
|
4458
|
-
return
|
|
4457
|
+
return hr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4459
4458
|
});
|
|
4460
4459
|
if (p.length === 0)
|
|
4461
4460
|
return;
|
|
@@ -4484,22 +4483,22 @@ function qo(e, t) {
|
|
|
4484
4483
|
}
|
|
4485
4484
|
return t;
|
|
4486
4485
|
}
|
|
4487
|
-
const
|
|
4488
|
-
function
|
|
4489
|
-
return o.isImportDeclaration(e) ?
|
|
4486
|
+
const hs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? Y : e, qo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4487
|
+
function Vo(e) {
|
|
4488
|
+
return o.isImportDeclaration(e) ? Go(this, e) : e;
|
|
4490
4489
|
}
|
|
4491
|
-
function
|
|
4490
|
+
function Go(e, t) {
|
|
4492
4491
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4493
|
-
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !
|
|
4492
|
+
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !gs.has(n.text))
|
|
4494
4493
|
return t;
|
|
4495
4494
|
const r = i.phaseModifier === o.SyntaxKind.TypeKeyword;
|
|
4496
4495
|
let a = !1;
|
|
4497
4496
|
const c = s.elements.map((d) => {
|
|
4498
|
-
const l = (d.propertyName ?? d.name).text, p =
|
|
4497
|
+
const l = (d.propertyName ?? d.name).text, p = hs(l, n.text);
|
|
4499
4498
|
return e.existingLitImports.delete(p), e.neededImports.has(p) ? (e.neededImports.delete(p), a = !0, o.factory.updateImportSpecifier(d, !1, d.propertyName, d.name)) : r ? o.factory.updateImportSpecifier(d, !0, d.propertyName, d.name) : d;
|
|
4500
4499
|
});
|
|
4501
|
-
return
|
|
4502
|
-
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(
|
|
4500
|
+
return fs[n.text]?.forEach((d) => {
|
|
4501
|
+
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(ys(d, e)));
|
|
4503
4502
|
}), a ? o.factory.updateImportDeclaration(
|
|
4504
4503
|
t,
|
|
4505
4504
|
t.modifiers,
|
|
@@ -4513,8 +4512,8 @@ function Xo(e, t) {
|
|
|
4513
4512
|
t.attributes
|
|
4514
4513
|
) : t;
|
|
4515
4514
|
}
|
|
4516
|
-
function
|
|
4517
|
-
const t =
|
|
4515
|
+
function Xo(e) {
|
|
4516
|
+
const t = ms(
|
|
4518
4517
|
Array.from(e.neededImports, (i) => [re[i][0], i])
|
|
4519
4518
|
);
|
|
4520
4519
|
return Object.entries(t).map(
|
|
@@ -4524,14 +4523,14 @@ function Yo(e) {
|
|
|
4524
4523
|
void 0,
|
|
4525
4524
|
void 0,
|
|
4526
4525
|
o.factory.createNamedImports(
|
|
4527
|
-
s.map((n) => (e.neededImports.delete(n),
|
|
4526
|
+
s.map((n) => (e.neededImports.delete(n), ys(n, e)))
|
|
4528
4527
|
)
|
|
4529
4528
|
),
|
|
4530
4529
|
o.factory.createStringLiteral(i)
|
|
4531
4530
|
)
|
|
4532
4531
|
);
|
|
4533
4532
|
}
|
|
4534
|
-
function
|
|
4533
|
+
function ys(e, t) {
|
|
4535
4534
|
const i = e === ae ? ce : e === Y ? se : e, s = t.importRenames[e];
|
|
4536
4535
|
return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4537
4536
|
!1,
|
|
@@ -4539,12 +4538,12 @@ function vs(e, t) {
|
|
|
4539
4538
|
o.factory.createIdentifier(s)
|
|
4540
4539
|
);
|
|
4541
4540
|
}
|
|
4542
|
-
function
|
|
4543
|
-
const t =
|
|
4541
|
+
function Yo(e) {
|
|
4542
|
+
const t = Mr().map(({ packageName: i }) => i);
|
|
4544
4543
|
return e.existingImportedModules.forEach((i) => {
|
|
4545
4544
|
if (u.isAbsolute(i))
|
|
4546
4545
|
return;
|
|
4547
|
-
const s =
|
|
4546
|
+
const s = Ys(i), n = i.slice(s.length + 1);
|
|
4548
4547
|
if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
|
|
4549
4548
|
const r = Re(e.sourceFile.fileName);
|
|
4550
4549
|
throw new Error(
|
|
@@ -4553,7 +4552,7 @@ function Qo(e) {
|
|
|
4553
4552
|
}
|
|
4554
4553
|
}), [];
|
|
4555
4554
|
}
|
|
4556
|
-
function
|
|
4555
|
+
function Qo(e) {
|
|
4557
4556
|
if (e.compiler.viteCommand === "serve")
|
|
4558
4557
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4559
4558
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4568,7 +4567,7 @@ function Zo(e) {
|
|
|
4568
4567
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4569
4568
|
}), [];
|
|
4570
4569
|
}
|
|
4571
|
-
const
|
|
4570
|
+
const Zo = (e, t) => {
|
|
4572
4571
|
const i = e.pragmas;
|
|
4573
4572
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4574
4573
|
return e.statements;
|
|
@@ -4588,11 +4587,11 @@ const ea = (e, t) => {
|
|
|
4588
4587
|
}
|
|
4589
4588
|
const r = {
|
|
4590
4589
|
compiler: t.compiler,
|
|
4591
|
-
externalComponents:
|
|
4592
|
-
localComponents:
|
|
4590
|
+
externalComponents: Ii(),
|
|
4591
|
+
localComponents: is(t.compiler),
|
|
4593
4592
|
sourceFile: e,
|
|
4594
4593
|
transformationContext: t.transformation,
|
|
4595
|
-
importRenames:
|
|
4594
|
+
importRenames: ea(e),
|
|
4596
4595
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4597
4596
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4598
4597
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4606,7 +4605,7 @@ const ea = (e, t) => {
|
|
|
4606
4605
|
let a = [];
|
|
4607
4606
|
if (e.statements.every((d) => {
|
|
4608
4607
|
if (o.isImportDeclaration(d)) {
|
|
4609
|
-
const l =
|
|
4608
|
+
const l = Ho(r, d);
|
|
4610
4609
|
if (l === void 0)
|
|
4611
4610
|
return !0;
|
|
4612
4611
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
@@ -4616,11 +4615,11 @@ const ea = (e, t) => {
|
|
|
4616
4615
|
return !0;
|
|
4617
4616
|
}), r.hasNonLuminaJsxImport)
|
|
4618
4617
|
return e.statements;
|
|
4619
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4618
|
+
if (r.neededImports.size > 0 && (a = a.map(Vo, r), r.existingLitImports.size > 0))
|
|
4620
4619
|
throw new Error(
|
|
4621
4620
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4622
4621
|
);
|
|
4623
|
-
const c = [Yo, Qo
|
|
4622
|
+
const c = [Xo, Yo, Qo].flatMap(
|
|
4624
4623
|
(d) => d(r)
|
|
4625
4624
|
);
|
|
4626
4625
|
if (r.neededImports.size > 0)
|
|
@@ -4629,18 +4628,18 @@ const ea = (e, t) => {
|
|
|
4629
4628
|
);
|
|
4630
4629
|
return [...c, ...a];
|
|
4631
4630
|
};
|
|
4632
|
-
function
|
|
4633
|
-
return
|
|
4634
|
-
|
|
4631
|
+
function ea(e) {
|
|
4632
|
+
return ta(e), Object.fromEntries(
|
|
4633
|
+
fr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4635
4634
|
);
|
|
4636
4635
|
}
|
|
4637
|
-
function
|
|
4636
|
+
function ta(e) {
|
|
4638
4637
|
if (!("identifiers" in e))
|
|
4639
4638
|
throw new Error(
|
|
4640
4639
|
"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."
|
|
4641
4640
|
);
|
|
4642
4641
|
}
|
|
4643
|
-
const Yt = "customElement",
|
|
4642
|
+
const Yt = "customElement", ia = (e, t) => {
|
|
4644
4643
|
const i = [];
|
|
4645
4644
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4646
4645
|
const a = r;
|
|
@@ -4670,7 +4669,7 @@ const Yt = "customElement", sa = (e, t) => {
|
|
|
4670
4669
|
o.factory.createStringLiteral(s)
|
|
4671
4670
|
), ...e.statements, ...i];
|
|
4672
4671
|
};
|
|
4673
|
-
function
|
|
4672
|
+
function sa(e, t, i) {
|
|
4674
4673
|
return t.size === 0 ? e : [
|
|
4675
4674
|
o.factory.createPropertyDeclaration(
|
|
4676
4675
|
[
|
|
@@ -4684,8 +4683,8 @@ function ra(e, t, i) {
|
|
|
4684
4683
|
Array.from(
|
|
4685
4684
|
t.entries(),
|
|
4686
4685
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4687
|
-
|
|
4688
|
-
|
|
4686
|
+
li(s) ? o.factory.createStringLiteral(s) : s,
|
|
4687
|
+
ra(n, i)
|
|
4689
4688
|
)
|
|
4690
4689
|
)
|
|
4691
4690
|
)
|
|
@@ -4693,7 +4692,7 @@ function ra(e, t, i) {
|
|
|
4693
4692
|
...e
|
|
4694
4693
|
];
|
|
4695
4694
|
}
|
|
4696
|
-
function
|
|
4695
|
+
function ra(e, t) {
|
|
4697
4696
|
let i = 0, s = !0;
|
|
4698
4697
|
const n = [], r = [];
|
|
4699
4698
|
for (const d of e.properties)
|
|
@@ -4705,21 +4704,21 @@ function na(e, t) {
|
|
|
4705
4704
|
if (l === "attribute")
|
|
4706
4705
|
return s = !1, i |= m ? Et : 0, !m && !f;
|
|
4707
4706
|
if (l === "reflect")
|
|
4708
|
-
return i |= m ?
|
|
4707
|
+
return i |= m ? ks : 0, !1;
|
|
4709
4708
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4710
4709
|
if (p.text === "Boolean")
|
|
4711
|
-
return i |=
|
|
4710
|
+
return i |= Is, !1;
|
|
4712
4711
|
if (p.text === "Number")
|
|
4713
|
-
return i |=
|
|
4712
|
+
return i |= xs, !1;
|
|
4714
4713
|
} else {
|
|
4715
4714
|
if (l === "state")
|
|
4716
|
-
return s = !1, i |= m ?
|
|
4715
|
+
return s = !1, i |= m ? As : 0, !1;
|
|
4717
4716
|
if (l === "readOnly")
|
|
4718
|
-
return i |= m ?
|
|
4717
|
+
return i |= m ? Ls : 0, !1;
|
|
4719
4718
|
if (l === "noAccessor")
|
|
4720
|
-
return i |= m ?
|
|
4719
|
+
return i |= m ? Ns : 0, !1;
|
|
4721
4720
|
if (l === "useDefault")
|
|
4722
|
-
return i |= m ?
|
|
4721
|
+
return i |= m ? js : 0, !1;
|
|
4723
4722
|
}
|
|
4724
4723
|
return !0;
|
|
4725
4724
|
}
|
|
@@ -4738,7 +4737,7 @@ function na(e, t) {
|
|
|
4738
4737
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4739
4738
|
]);
|
|
4740
4739
|
}
|
|
4741
|
-
function
|
|
4740
|
+
function na(e, t, i) {
|
|
4742
4741
|
let s = -1, n = -1, r = -1;
|
|
4743
4742
|
e.options?.properties.forEach((p, m) => {
|
|
4744
4743
|
if (o.isSpreadAssignment(p))
|
|
@@ -4750,23 +4749,23 @@ function oa(e, t, i) {
|
|
|
4750
4749
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4751
4750
|
}
|
|
4752
4751
|
});
|
|
4753
|
-
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d =
|
|
4752
|
+
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = oa(e, i, s), l = [
|
|
4754
4753
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4755
4754
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4756
4755
|
...d !== void 0 ? [d] : []
|
|
4757
4756
|
];
|
|
4758
4757
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4759
4758
|
}
|
|
4760
|
-
function
|
|
4759
|
+
function oa(e, t, i) {
|
|
4761
4760
|
if (t.attribute === void 0)
|
|
4762
4761
|
return;
|
|
4763
|
-
const s =
|
|
4762
|
+
const s = aa(t.type.values);
|
|
4764
4763
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4765
4764
|
o.factory.createIdentifier("type"),
|
|
4766
4765
|
o.factory.createIdentifier(s)
|
|
4767
4766
|
);
|
|
4768
4767
|
}
|
|
4769
|
-
function
|
|
4768
|
+
function aa(e) {
|
|
4770
4769
|
let t = !1, i = !1, s = !1;
|
|
4771
4770
|
if (e?.forEach((n) => {
|
|
4772
4771
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4778,7 +4777,7 @@ function ca(e) {
|
|
|
4778
4777
|
}
|
|
4779
4778
|
return "Other";
|
|
4780
4779
|
}
|
|
4781
|
-
function
|
|
4780
|
+
function ca(e, t, i, s, n, r) {
|
|
4782
4781
|
if (i.modifiers === void 0)
|
|
4783
4782
|
return i;
|
|
4784
4783
|
let a = -1, c = -1;
|
|
@@ -4788,23 +4787,23 @@ function la(e, t, i, s, n, r) {
|
|
|
4788
4787
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4789
4788
|
}
|
|
4790
4789
|
}), a !== -1) {
|
|
4791
|
-
const d =
|
|
4790
|
+
const d = la(e, t, i, s, n), l = Qt(i, a, n), p = na(l, n, d);
|
|
4792
4791
|
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Zt(i, a);
|
|
4793
4792
|
} else if (c !== -1) {
|
|
4794
|
-
const d = Qt(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m =
|
|
4793
|
+
const d = Qt(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m = di(i.name);
|
|
4795
4794
|
if (m === void 0)
|
|
4796
4795
|
throw new Error("Failed to statically determine the state property name");
|
|
4797
4796
|
return r.set(m, p), Zt(i, c);
|
|
4798
4797
|
} else
|
|
4799
4798
|
return i;
|
|
4800
4799
|
}
|
|
4801
|
-
function
|
|
4800
|
+
function la(e, t, i, s, n) {
|
|
4802
4801
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4803
4802
|
members: []
|
|
4804
4803
|
} : void 0);
|
|
4805
4804
|
if (r === void 0)
|
|
4806
4805
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4807
|
-
const a =
|
|
4806
|
+
const a = di(i.name);
|
|
4808
4807
|
let c;
|
|
4809
4808
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4810
4809
|
const l = r.members[d];
|
|
@@ -4858,7 +4857,7 @@ function Zt(e, t) {
|
|
|
4858
4857
|
e.initializer
|
|
4859
4858
|
);
|
|
4860
4859
|
}
|
|
4861
|
-
function
|
|
4860
|
+
function da(e, t, i, s) {
|
|
4862
4861
|
let n;
|
|
4863
4862
|
if (e.apiJsonEnabled)
|
|
4864
4863
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4881,9 +4880,9 @@ function pa(e, t, i, s) {
|
|
|
4881
4880
|
} finally {
|
|
4882
4881
|
c = i.statements, i.statements = a;
|
|
4883
4882
|
}
|
|
4884
|
-
return
|
|
4883
|
+
return pa(i, c);
|
|
4885
4884
|
}
|
|
4886
|
-
const
|
|
4885
|
+
const pa = (e, t) => o.factory.updateSourceFile(
|
|
4887
4886
|
e,
|
|
4888
4887
|
t,
|
|
4889
4888
|
/*
|
|
@@ -4898,10 +4897,10 @@ const ua = (e, t) => o.factory.updateSourceFile(
|
|
|
4898
4897
|
!1,
|
|
4899
4898
|
e.libReferenceDirectives
|
|
4900
4899
|
);
|
|
4901
|
-
function
|
|
4900
|
+
function ua(e, t) {
|
|
4902
4901
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4903
4902
|
}
|
|
4904
|
-
const
|
|
4903
|
+
const ma = (e, t) => {
|
|
4905
4904
|
let i;
|
|
4906
4905
|
if (t.apiModule !== void 0)
|
|
4907
4906
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4917,16 +4916,16 @@ const fa = (e, t) => {
|
|
|
4917
4916
|
function n() {
|
|
4918
4917
|
s = /* @__PURE__ */ new Map();
|
|
4919
4918
|
}
|
|
4920
|
-
const r = (d) =>
|
|
4919
|
+
const r = (d) => sa(d, s, t.compiler.shouldMinify);
|
|
4921
4920
|
function a(d, l) {
|
|
4922
|
-
const p =
|
|
4923
|
-
return
|
|
4921
|
+
const p = ga(t, i, d, l, e, s);
|
|
4922
|
+
return ua(p, t), p;
|
|
4924
4923
|
}
|
|
4925
4924
|
return e.statements.map(
|
|
4926
|
-
(d) =>
|
|
4925
|
+
(d) => vs(a, d, t, n, r)
|
|
4927
4926
|
);
|
|
4928
4927
|
};
|
|
4929
|
-
function
|
|
4928
|
+
function vs(e, t, i, s, n = pi) {
|
|
4930
4929
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4931
4930
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4932
4931
|
let r = !1;
|
|
@@ -4949,15 +4948,15 @@ function bs(e, t, i, s, n = ui) {
|
|
|
4949
4948
|
} else
|
|
4950
4949
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4951
4950
|
t,
|
|
4952
|
-
(a) =>
|
|
4951
|
+
(a) => vs(e, a, i, s, n),
|
|
4953
4952
|
i.transformation
|
|
4954
4953
|
) : t;
|
|
4955
4954
|
}
|
|
4956
|
-
const
|
|
4957
|
-
function
|
|
4955
|
+
const fa = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4956
|
+
function ga(e, t, i, s, n, r) {
|
|
4958
4957
|
if (o.isMethodDeclaration(i)) {
|
|
4959
4958
|
const a = i.modifiers?.filter(
|
|
4960
|
-
(c) => !o.isDecorator(c) || !
|
|
4959
|
+
(c) => !o.isDecorator(c) || !ha(c)
|
|
4961
4960
|
);
|
|
4962
4961
|
if (a?.length !== i.modifiers?.length)
|
|
4963
4962
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4971,7 +4970,7 @@ function ha(e, t, i, s, n, r) {
|
|
|
4971
4970
|
i.type,
|
|
4972
4971
|
i.body
|
|
4973
4972
|
);
|
|
4974
|
-
if ("text" in i.name &&
|
|
4973
|
+
if ("text" in i.name && fa.has(i.name.text) && i.body) {
|
|
4975
4974
|
const c = i.name.text;
|
|
4976
4975
|
return i.body.statements.some(
|
|
4977
4976
|
(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
|
|
@@ -4997,14 +4996,14 @@ function ha(e, t, i, s, n, r) {
|
|
|
4997
4996
|
);
|
|
4998
4997
|
}
|
|
4999
4998
|
}
|
|
5000
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5001
|
-
}
|
|
5002
|
-
const
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
],
|
|
5007
|
-
name:
|
|
4999
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? ca(e, t, i, s, n, r) : i;
|
|
5000
|
+
}
|
|
5001
|
+
const ha = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", ya = [
|
|
5002
|
+
Zo,
|
|
5003
|
+
ia,
|
|
5004
|
+
ma
|
|
5005
|
+
], va = "@arcgis/lumina:transformComponents", ba = (e) => ({
|
|
5006
|
+
name: va,
|
|
5008
5007
|
transform: {
|
|
5009
5008
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5010
5009
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5024,11 +5023,11 @@ const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5024
5023
|
e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
|
|
5025
5024
|
);
|
|
5026
5025
|
const n = e.getSourceFile(i, t), a = o.transform(n, [
|
|
5027
|
-
(f) => () =>
|
|
5026
|
+
(f) => () => da(e, f, n, [
|
|
5028
5027
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5029
|
-
...
|
|
5028
|
+
...ya
|
|
5030
5029
|
])
|
|
5031
|
-
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Tt.createSourceMapGenerator(
|
|
5030
|
+
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Tt.createSourceMapGenerator(wa, u.basename(i), "", u.dirname(i), {}), l = Tt.createTextWriter(`
|
|
5032
5031
|
`);
|
|
5033
5032
|
c.writeFile(a, l, d);
|
|
5034
5033
|
const p = l.getText(), m = d?.toJSON();
|
|
@@ -5038,10 +5037,10 @@ const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5038
5037
|
};
|
|
5039
5038
|
}
|
|
5040
5039
|
}
|
|
5041
|
-
}),
|
|
5040
|
+
}), wa = {
|
|
5042
5041
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5043
|
-
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ?
|
|
5044
|
-
},
|
|
5042
|
+
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? pi : (e) => e.toLowerCase()
|
|
5043
|
+
}, Sa = (e) => ({
|
|
5045
5044
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5046
5045
|
configureServer(t) {
|
|
5047
5046
|
e.server = t, ei(e).forEach(({ assets: i, transformers: s }) => ie(e, i, s));
|
|
@@ -5049,7 +5048,7 @@ const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5049
5048
|
async writeBundle() {
|
|
5050
5049
|
await Promise.all(
|
|
5051
5050
|
ei(e).map(
|
|
5052
|
-
async ({ assets: t, transformers: i }) => await
|
|
5051
|
+
async ({ assets: t, transformers: i }) => await Fi(e, t, i)
|
|
5053
5052
|
)
|
|
5054
5053
|
);
|
|
5055
5054
|
}
|
|
@@ -5060,20 +5059,20 @@ function ei(e) {
|
|
|
5060
5059
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5061
5060
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5062
5061
|
}
|
|
5063
|
-
const ot = "@arcgis/lumina:updatePackageJson",
|
|
5062
|
+
const ot = "@arcgis/lumina:updatePackageJson", Ca = (e) => ({
|
|
5064
5063
|
name: ot,
|
|
5065
5064
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5066
5065
|
configResolved() {
|
|
5067
|
-
|
|
5066
|
+
Ea(e).catch(
|
|
5068
5067
|
(t) => T.error(ot, `Failed to update package's package.json:${String(t)}`)
|
|
5069
5068
|
);
|
|
5070
5069
|
}
|
|
5071
5070
|
});
|
|
5072
|
-
async function
|
|
5073
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s =
|
|
5074
|
-
s &&
|
|
5071
|
+
async function Ea(e) {
|
|
5072
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = Ta(i, e);
|
|
5073
|
+
s && ci(t, JSON.stringify(s, null, 2));
|
|
5075
5074
|
}
|
|
5076
|
-
function
|
|
5075
|
+
function Ta(e, t) {
|
|
5077
5076
|
const i = e?.devDependencies ?? {};
|
|
5078
5077
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
5079
5078
|
l in i || T.warn(
|
|
@@ -5112,21 +5111,21 @@ function $a(e, t) {
|
|
|
5112
5111
|
if (s)
|
|
5113
5112
|
return e;
|
|
5114
5113
|
}
|
|
5115
|
-
const
|
|
5114
|
+
const $a = (e) => ({
|
|
5116
5115
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5117
5116
|
timestamp: e.apiJson.timestamp,
|
|
5118
5117
|
compiler: e.apiJson.compiler,
|
|
5119
|
-
components:
|
|
5118
|
+
components: Pa(e),
|
|
5120
5119
|
typeLibrary: {}
|
|
5121
5120
|
});
|
|
5122
|
-
function
|
|
5121
|
+
function Pa(e) {
|
|
5123
5122
|
const t = [];
|
|
5124
5123
|
for (const i of e.apiJson.modules)
|
|
5125
5124
|
for (const s of i.declarations)
|
|
5126
|
-
s.customElement === !0 && t.push(
|
|
5125
|
+
s.customElement === !0 && t.push(ka(s, i.sourcePath));
|
|
5127
5126
|
return t;
|
|
5128
5127
|
}
|
|
5129
|
-
function
|
|
5128
|
+
function ka(e, t) {
|
|
5130
5129
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5131
5130
|
return {
|
|
5132
5131
|
filePath: t,
|
|
@@ -5141,9 +5140,9 @@ function Ia(e, t) {
|
|
|
5141
5140
|
dependencies: [],
|
|
5142
5141
|
dependencyGraph: {},
|
|
5143
5142
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5144
|
-
props: e.members.map(
|
|
5145
|
-
methods: e.members.map(
|
|
5146
|
-
events: e.events?.map(
|
|
5143
|
+
props: e.members.map(Ia).filter(R),
|
|
5144
|
+
methods: e.members.map(xa).filter(R),
|
|
5145
|
+
events: e.events?.map(Aa) ?? [],
|
|
5147
5146
|
styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
|
|
5148
5147
|
name: s,
|
|
5149
5148
|
annotation: "prop",
|
|
@@ -5168,7 +5167,7 @@ function Ve(e, t = "") {
|
|
|
5168
5167
|
}
|
|
5169
5168
|
return t;
|
|
5170
5169
|
}
|
|
5171
|
-
function
|
|
5170
|
+
function Ia(e) {
|
|
5172
5171
|
if (e.kind !== "field")
|
|
5173
5172
|
return;
|
|
5174
5173
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], n = t.docsTags?.some((r) => r.name === "required") ?? !1;
|
|
@@ -5202,14 +5201,14 @@ const bt = (e) => Object.fromEntries(
|
|
|
5202
5201
|
(t) => [
|
|
5203
5202
|
t.name,
|
|
5204
5203
|
{
|
|
5205
|
-
location: t.package ===
|
|
5204
|
+
location: t.package === Rs ? "global" : t.package === void 0 ? "local" : "import",
|
|
5206
5205
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
5207
5206
|
id: "notImplemented"
|
|
5208
5207
|
}
|
|
5209
5208
|
]
|
|
5210
5209
|
) ?? []
|
|
5211
5210
|
);
|
|
5212
|
-
function
|
|
5211
|
+
function xa(e) {
|
|
5213
5212
|
if (e.kind !== "method")
|
|
5214
5213
|
return;
|
|
5215
5214
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5240,7 +5239,7 @@ function Aa(e) {
|
|
|
5240
5239
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5241
5240
|
};
|
|
5242
5241
|
}
|
|
5243
|
-
function
|
|
5242
|
+
function Aa(e) {
|
|
5244
5243
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5245
5244
|
return {
|
|
5246
5245
|
event: e.name,
|
|
@@ -5265,8 +5264,8 @@ const ye = {
|
|
|
5265
5264
|
cssParts: "CSS Parts",
|
|
5266
5265
|
methods: "Methods"
|
|
5267
5266
|
};
|
|
5268
|
-
function
|
|
5269
|
-
const t =
|
|
5267
|
+
function bs(e) {
|
|
5268
|
+
const t = La(e.slots), i = Na(e.events), s = ja(e.cssProperties), n = Fa(e.cssParts), r = Ra(e.members), a = e.description?.trim();
|
|
5270
5269
|
return [...a ? [`${a}
|
|
5271
5270
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5272
5271
|
|
|
@@ -5274,28 +5273,28 @@ function ws(e) {
|
|
|
5274
5273
|
}
|
|
5275
5274
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5276
5275
|
${t.join(`
|
|
5277
|
-
`)}`,
|
|
5276
|
+
`)}`, La = (e) => ve(
|
|
5278
5277
|
ye.slots,
|
|
5279
5278
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5280
5279
|
(t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
|
|
5281
5280
|
)
|
|
5282
|
-
),
|
|
5281
|
+
), Na = (e) => ve(
|
|
5283
5282
|
ye.events,
|
|
5284
5283
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5285
|
-
),
|
|
5284
|
+
), ja = (e = []) => ve(
|
|
5286
5285
|
ye.cssProperties,
|
|
5287
5286
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5288
5287
|
(t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5289
5288
|
)
|
|
5290
|
-
),
|
|
5289
|
+
), Fa = (e) => ve(
|
|
5291
5290
|
ye.cssParts,
|
|
5292
5291
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5293
|
-
),
|
|
5292
|
+
), Ra = (e) => ve(
|
|
5294
5293
|
ye.methods,
|
|
5295
|
-
e.filter(
|
|
5294
|
+
e.filter(Ds).filter((t) => t.deprecated === void 0).map(
|
|
5296
5295
|
(t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
|
|
5297
5296
|
)
|
|
5298
|
-
),
|
|
5297
|
+
), ws = (e) => {
|
|
5299
5298
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
5300
5299
|
for (let s = 0; s < e.length; ++s) {
|
|
5301
5300
|
const n = e[s].cssProperties;
|
|
@@ -5309,13 +5308,13 @@ ${t.join(`
|
|
|
5309
5308
|
}
|
|
5310
5309
|
}
|
|
5311
5310
|
return t;
|
|
5312
|
-
},
|
|
5311
|
+
}, Ss = (e) => e.flatMap(
|
|
5313
5312
|
(t) => t.cssParts?.filter((i) => i.deprecated === void 0).map((i) => ({
|
|
5314
5313
|
name: `::part(${i.name})`,
|
|
5315
5314
|
description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
|
|
5316
5315
|
})) ?? []
|
|
5317
5316
|
);
|
|
5318
|
-
function
|
|
5317
|
+
function Da(e) {
|
|
5319
5318
|
if (e.attributes === void 0)
|
|
5320
5319
|
return [];
|
|
5321
5320
|
const t = [];
|
|
@@ -5326,7 +5325,7 @@ function Oa(e) {
|
|
|
5326
5325
|
description: s.description || void 0,
|
|
5327
5326
|
default: s.default,
|
|
5328
5327
|
value: {
|
|
5329
|
-
type:
|
|
5328
|
+
type: Oa(
|
|
5330
5329
|
s.type.values?.map(
|
|
5331
5330
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5332
5331
|
)
|
|
@@ -5336,9 +5335,9 @@ function Oa(e) {
|
|
|
5336
5335
|
}
|
|
5337
5336
|
return t;
|
|
5338
5337
|
}
|
|
5339
|
-
const
|
|
5340
|
-
function
|
|
5341
|
-
const i =
|
|
5338
|
+
const Oa = (e) => e?.length === 1 ? e[0] : e;
|
|
5339
|
+
function Ma(e, t) {
|
|
5340
|
+
const i = Ja(e), s = ws(e), n = Ss(e), r = j();
|
|
5342
5341
|
return {
|
|
5343
5342
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5344
5343
|
name: r.name,
|
|
@@ -5356,11 +5355,11 @@ function Ja(e, t) {
|
|
|
5356
5355
|
}
|
|
5357
5356
|
};
|
|
5358
5357
|
}
|
|
5359
|
-
const
|
|
5358
|
+
const Ja = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5360
5359
|
name: t.tagName,
|
|
5361
|
-
description:
|
|
5360
|
+
description: bs(t),
|
|
5362
5361
|
"doc-url": t.demos?.[0]?.url,
|
|
5363
|
-
attributes:
|
|
5362
|
+
attributes: Da(t),
|
|
5364
5363
|
slots: t.slots?.map((i) => ({
|
|
5365
5364
|
name: i.name,
|
|
5366
5365
|
description: i.description
|
|
@@ -5368,10 +5367,10 @@ const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5368
5367
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5369
5368
|
events: ti(t),
|
|
5370
5369
|
js: {
|
|
5371
|
-
properties:
|
|
5370
|
+
properties: Ba(t),
|
|
5372
5371
|
events: ti(t)
|
|
5373
5372
|
}
|
|
5374
|
-
})),
|
|
5373
|
+
})), Ba = (e) => e.members.filter(Os).filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5375
5374
|
name: t.name,
|
|
5376
5375
|
description: t.description,
|
|
5377
5376
|
type: t.type?.text
|
|
@@ -5379,93 +5378,93 @@ const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5379
5378
|
name: t.name,
|
|
5380
5379
|
type: t.type?.text,
|
|
5381
5380
|
description: t.description
|
|
5382
|
-
})) ?? [],
|
|
5381
|
+
})) ?? [], Ka = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5383
5382
|
name: t.tagName,
|
|
5384
|
-
description:
|
|
5385
|
-
attributes:
|
|
5383
|
+
description: bs(t),
|
|
5384
|
+
attributes: _a(t),
|
|
5386
5385
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5387
|
-
})),
|
|
5386
|
+
})), _a = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5388
5387
|
name: t.name,
|
|
5389
5388
|
description: t.description || void 0,
|
|
5390
|
-
values:
|
|
5391
|
-
})) ?? [],
|
|
5389
|
+
values: Wa(t)
|
|
5390
|
+
})) ?? [], Wa = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Ua = (e) => ({
|
|
5392
5391
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5393
5392
|
version: 1.1,
|
|
5394
|
-
tags:
|
|
5395
|
-
}),
|
|
5393
|
+
tags: Ka(e)
|
|
5394
|
+
}), za = (e) => ({
|
|
5396
5395
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5397
5396
|
version: 1.1,
|
|
5398
|
-
properties:
|
|
5399
|
-
pseudoElements:
|
|
5400
|
-
}),
|
|
5401
|
-
function
|
|
5397
|
+
properties: ws(e),
|
|
5398
|
+
pseudoElements: Ss(e)
|
|
5399
|
+
}), Ha = "@arcgis/lumina:generateDocs";
|
|
5400
|
+
function qa(e) {
|
|
5402
5401
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5403
5402
|
{
|
|
5404
5403
|
type: "dynamic",
|
|
5405
|
-
source: () => JSON.stringify(
|
|
5404
|
+
source: () => JSON.stringify($a(e), null, nt(e)),
|
|
5406
5405
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5407
5406
|
}
|
|
5408
5407
|
]), {
|
|
5409
|
-
name:
|
|
5408
|
+
name: Ha,
|
|
5410
5409
|
async writeBundle() {
|
|
5411
5410
|
if (e.isInStorybook)
|
|
5412
5411
|
return;
|
|
5413
5412
|
const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [n, r, a].filter(R);
|
|
5414
5413
|
if (c.length === 0)
|
|
5415
5414
|
return;
|
|
5416
|
-
await
|
|
5415
|
+
await Ji(c);
|
|
5417
5416
|
const d = [];
|
|
5418
5417
|
if (n !== void 0) {
|
|
5419
|
-
const l = JSON.stringify(
|
|
5418
|
+
const l = JSON.stringify(Ua(e.apiJsonComponents), null, t);
|
|
5420
5419
|
d.push(_(n, l));
|
|
5421
5420
|
}
|
|
5422
5421
|
if (r !== void 0) {
|
|
5423
|
-
const l = JSON.stringify(
|
|
5422
|
+
const l = JSON.stringify(za(e.apiJsonComponents), null, t);
|
|
5424
5423
|
d.push(_(r, l));
|
|
5425
5424
|
}
|
|
5426
5425
|
if (a !== void 0) {
|
|
5427
|
-
const l =
|
|
5426
|
+
const l = Ma(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5428
5427
|
d.push(_(a, JSON.stringify(l, null, t)));
|
|
5429
5428
|
}
|
|
5430
5429
|
await Promise.all(d);
|
|
5431
5430
|
}
|
|
5432
5431
|
};
|
|
5433
5432
|
}
|
|
5434
|
-
function
|
|
5433
|
+
function Va(e) {
|
|
5435
5434
|
return {
|
|
5436
5435
|
name: "@arcgis/lumina:buildWrappers",
|
|
5437
5436
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5438
5437
|
async writeBundle() {
|
|
5439
5438
|
e.isInStorybook || await Promise.all(
|
|
5440
5439
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5441
|
-
t.type === "react18" && await
|
|
5440
|
+
t.type === "react18" && await Ya(e, t);
|
|
5442
5441
|
}) ?? []
|
|
5443
5442
|
);
|
|
5444
5443
|
}
|
|
5445
5444
|
};
|
|
5446
5445
|
}
|
|
5447
|
-
const
|
|
5448
|
-
import React from "${
|
|
5446
|
+
const Ga = "react", ii = "@lit/react", Xa = `
|
|
5447
|
+
import React from "${Ga}";
|
|
5449
5448
|
import { createComponent } from "${ii}";
|
|
5450
5449
|
import type { EventName } from "${ii}";
|
|
5451
5450
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5452
5451
|
|
|
5453
5452
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5454
5453
|
`;
|
|
5455
|
-
async function
|
|
5454
|
+
async function Ya(e, t) {
|
|
5456
5455
|
const { name: i } = j(), s = [];
|
|
5457
5456
|
for (const a of e.apiJson.modules)
|
|
5458
5457
|
for (const c of a.declarations)
|
|
5459
|
-
|
|
5460
|
-
const n = [`/// <reference types="${i}" preserve="true" />`,
|
|
5458
|
+
Qa(c) && s.push(Za(c));
|
|
5459
|
+
const n = [`/// <reference types="${i}" preserve="true" />`, Xa, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5461
5460
|
await X(u.dirname(r), { recursive: !0 }), await _(r, n);
|
|
5462
5461
|
}
|
|
5463
|
-
function
|
|
5462
|
+
function Qa(e) {
|
|
5464
5463
|
return e.customElement === !0 && e.abstract !== !0;
|
|
5465
5464
|
}
|
|
5466
|
-
function
|
|
5465
|
+
function Za(e) {
|
|
5467
5466
|
const t = e.events?.map(
|
|
5468
|
-
(i) => ` ${
|
|
5467
|
+
(i) => ` ${Xs(`on${Ts(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5469
5468
|
).join(`
|
|
5470
5469
|
`);
|
|
5471
5470
|
return `
|
|
@@ -5480,42 +5479,42 @@ ${t}
|
|
|
5480
5479
|
);
|
|
5481
5480
|
`;
|
|
5482
5481
|
}
|
|
5483
|
-
function
|
|
5482
|
+
function kc(e = {}) {
|
|
5484
5483
|
const t = new $(e), s = [
|
|
5485
5484
|
t._plugin,
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5485
|
+
qn(t),
|
|
5486
|
+
Zn(t),
|
|
5487
|
+
so(t),
|
|
5488
|
+
Ca(t),
|
|
5489
|
+
Mn(t),
|
|
5490
|
+
qa(t),
|
|
5491
|
+
ba(t),
|
|
5492
|
+
vo(t),
|
|
5493
|
+
vr(t),
|
|
5490
5494
|
Jn(t),
|
|
5495
|
+
Sa(t),
|
|
5496
|
+
wo(t),
|
|
5497
|
+
co(t),
|
|
5498
|
+
Qs(t),
|
|
5499
|
+
gn(t),
|
|
5491
5500
|
Va(t),
|
|
5492
|
-
|
|
5493
|
-
bo(t),
|
|
5494
|
-
br(t),
|
|
5495
|
-
Bn(t),
|
|
5496
|
-
Ca(t),
|
|
5497
|
-
So(t),
|
|
5498
|
-
lo(t),
|
|
5499
|
-
Zs(t),
|
|
5500
|
-
hn(t),
|
|
5501
|
-
Ga(t),
|
|
5502
|
-
Kn(t)
|
|
5501
|
+
Bn(t)
|
|
5503
5502
|
].filter(R);
|
|
5504
5503
|
return s.context = t, s;
|
|
5505
5504
|
}
|
|
5506
|
-
const
|
|
5507
|
-
initializeComponentDependencies:
|
|
5508
|
-
updateLuminaTs:
|
|
5505
|
+
const Ic = {
|
|
5506
|
+
initializeComponentDependencies: ki,
|
|
5507
|
+
updateLuminaTs: es,
|
|
5509
5508
|
propertyToAttributeMappings: W,
|
|
5510
|
-
nativeEvents:
|
|
5509
|
+
nativeEvents: gi,
|
|
5511
5510
|
svgElements: ct,
|
|
5512
5511
|
mathMlElements: lt,
|
|
5513
|
-
alwaysAttributes:
|
|
5514
|
-
nativeAlwaysAttributes:
|
|
5512
|
+
alwaysAttributes: ui,
|
|
5513
|
+
nativeAlwaysAttributes: mi,
|
|
5515
5514
|
htmlAlwaysAttributes: Qe
|
|
5516
5515
|
};
|
|
5517
5516
|
export {
|
|
5518
|
-
|
|
5517
|
+
Ic as exportsForCodemod,
|
|
5519
5518
|
De as inferCdnUrl,
|
|
5520
|
-
|
|
5519
|
+
kc as useLumina
|
|
5521
5520
|
};
|