@arcgis/lumina-compiler 5.2.0-next.65 → 5.2.0-next.67
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 +848 -828
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { externalizeDependencies as
|
|
1
|
+
import { externalizeDependencies as cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
|
|
2
2
|
import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
|
|
3
3
|
import { f as b, l as $ } from "./logger-edpIalAo.js";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { camelToKebab as
|
|
6
|
-
import { lazyMetaSubItemJoiner as
|
|
7
|
-
import { path as u,
|
|
8
|
-
import { isApiMethodAsync as
|
|
5
|
+
import { camelToKebab as Vt, getPreamble as ds, uncapitalize as gt, capitalize as ps } from "@arcgis/toolkit/string";
|
|
6
|
+
import { lazyMetaSubItemJoiner as ms, lazyMetaItemJoiner as De, lazyMetaGroupJoiner as us, propertyFlagAttribute as ht, propertyFlagReflect as fs, propertyFlagBoolean as gs, propertyFlagNumber as hs, propertyFlagState as ys, propertyFlagReadOnly as vs, propertyFlagNoAccessor as bs, propertyFlagUseDefault as ws } from "@arcgis/lumina/config";
|
|
7
|
+
import { path as u, isPosix as Gt, toPosixPathSeparators as ce, toSystemPathSeparators as Ae, getCwd as Xt } from "@arcgis/node-toolkit/path";
|
|
8
|
+
import { isApiMethodAsync as Ss, globalPackageIdentifier as Cs, isApiMethod as Es, isApiProperty as Ts } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
9
|
import { existsAsync as K } from "@arcgis/node-toolkit/file";
|
|
10
|
-
import { readFile as z, readdir as et,
|
|
11
|
-
import { retrievePackageJson as R, fetchPackageLocation as
|
|
12
|
-
import { build as
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
10
|
+
import { readFile as z, readdir as et, mkdir as V, writeFile as _, copyFile as $s, rm as Ps, cp as Is } from "node:fs/promises";
|
|
11
|
+
import { retrievePackageJson as R, fetchPackageLocation as tt, asyncRetrievePackageJson as Yt } from "@arcgis/node-toolkit/packageJson";
|
|
12
|
+
import { build as ks } from "esbuild";
|
|
13
|
+
import xs from "mime-types";
|
|
14
|
+
import { forEachWithConcurrency as As } from "@arcgis/toolkit/promise";
|
|
15
|
+
import { glob as Ls } from "tinyglobby";
|
|
16
|
+
import { renameComponentFolder as We } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
17
|
+
import { useApiExtractor as Ns } from "@arcgis/api-extractor/vite/plugin";
|
|
18
18
|
import { writeFileSync as Qt } from "node:fs";
|
|
19
|
-
import { styleText as
|
|
20
|
-
import { unsafeGetUndocumentedPrinter as
|
|
21
|
-
import { pathIsComponentEntrypoint as
|
|
22
|
-
import { loadApiExtractorConfig as
|
|
23
|
-
import { loadTypeScriptConfig as
|
|
24
|
-
import { mappedFind as
|
|
25
|
-
import { isPropertyEscapeNeeded as Zt, maybeEscapePropertyName as
|
|
26
|
-
import { getPackageNameFromExternalSpecifier as
|
|
19
|
+
import { styleText as js } from "node:util";
|
|
20
|
+
import { unsafeGetUndocumentedPrinter as Fs, unsafeUndocumentedTs as yt } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
21
|
+
import { pathIsComponentEntrypoint as Ce } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
22
|
+
import { loadApiExtractorConfig as Ds, mergeApiExtractorConfigs as vt } from "@arcgis/api-extractor/extractor/config";
|
|
23
|
+
import { loadTypeScriptConfig as Rs } from "@arcgis/api-extractor/vite/typeScript";
|
|
24
|
+
import { mappedFind as ze } from "@arcgis/toolkit/array";
|
|
25
|
+
import { isPropertyEscapeNeeded as Zt, maybeEscapePropertyName as Os } from "@arcgis/api-extractor/utils/partPrinter";
|
|
26
|
+
import { getPackageNameFromExternalSpecifier as Ms, getMemberName as ei } from "@arcgis/api-extractor/utils/astHelpers";
|
|
27
27
|
import { identity as ti } from "@arcgis/toolkit/function";
|
|
28
|
-
function
|
|
29
|
-
const t = e.options?.build?.dependencies ?? {}, i =
|
|
28
|
+
function Js(e) {
|
|
29
|
+
const t = e.options?.build?.dependencies ?? {}, i = cs({
|
|
30
30
|
bundleIn: t.bundleIn,
|
|
31
31
|
externalize: [
|
|
32
32
|
// TODO: remove these once Lit is declared as a peer dependency
|
|
@@ -42,7 +42,7 @@ function Ms(e) {
|
|
|
42
42
|
e.isInStorybook && (i.resolveId = void 0);
|
|
43
43
|
}, i;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const Bs = "Fragment", Re = "DynamicHtmlTag", Oe = "DynamicSvgTag", Ee = /* @__PURE__ */ Symbol("dynamic html tag name"), He = /* @__PURE__ */ Symbol("dynamic svg tag name"), ii = /* @__PURE__ */ new Set([
|
|
46
46
|
/**
|
|
47
47
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
48
48
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -92,7 +92,7 @@ const Js = "Fragment", De = "DynamicHtmlTag", Re = "DynamicSvgTag", Ee = /* @__P
|
|
|
92
92
|
// These don't exist as a property, only as an attribute
|
|
93
93
|
"hreflang",
|
|
94
94
|
"media"
|
|
95
|
-
]),
|
|
95
|
+
]), qe = {
|
|
96
96
|
button: /* @__PURE__ */ new Set(["popoverTarget"]),
|
|
97
97
|
input: /* @__PURE__ */ new Set(["list", "capture"]),
|
|
98
98
|
iframe: /* @__PURE__ */ new Set(["sandbox"]),
|
|
@@ -924,7 +924,7 @@ function ri(e) {
|
|
|
924
924
|
e.stringifiedNonReflected
|
|
925
925
|
));
|
|
926
926
|
}
|
|
927
|
-
const
|
|
927
|
+
const bt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set([
|
|
928
928
|
"abort",
|
|
929
929
|
"animationCancel",
|
|
930
930
|
"animationEnd",
|
|
@@ -1023,7 +1023,7 @@ const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set(
|
|
|
1023
1023
|
"volumeChange",
|
|
1024
1024
|
"waiting",
|
|
1025
1025
|
"wheel"
|
|
1026
|
-
]),
|
|
1026
|
+
]), Ks = /* @__PURE__ */ new Set([
|
|
1027
1027
|
"area",
|
|
1028
1028
|
"base",
|
|
1029
1029
|
"br",
|
|
@@ -1040,7 +1040,7 @@ const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set(
|
|
|
1040
1040
|
"source",
|
|
1041
1041
|
"track",
|
|
1042
1042
|
"wbr"
|
|
1043
|
-
]),
|
|
1043
|
+
]), it = /* @__PURE__ */ new Set([
|
|
1044
1044
|
"animate",
|
|
1045
1045
|
"animateMotion",
|
|
1046
1046
|
"animateTransform",
|
|
@@ -1099,7 +1099,7 @@ const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set(
|
|
|
1099
1099
|
"tspan",
|
|
1100
1100
|
"use",
|
|
1101
1101
|
"view"
|
|
1102
|
-
]),
|
|
1102
|
+
]), _s = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), st = /* @__PURE__ */ new Set([
|
|
1103
1103
|
"annotation-xml",
|
|
1104
1104
|
"annotation",
|
|
1105
1105
|
"maction",
|
|
@@ -1131,7 +1131,7 @@ const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set(
|
|
|
1131
1131
|
"munder",
|
|
1132
1132
|
"munderover",
|
|
1133
1133
|
"semantics"
|
|
1134
|
-
]),
|
|
1134
|
+
]), Us = /* @__PURE__ */ new Set([
|
|
1135
1135
|
"annotation-xml",
|
|
1136
1136
|
"color-profile",
|
|
1137
1137
|
"font-face",
|
|
@@ -1141,7 +1141,7 @@ const vt = /* @__PURE__ */ new Set(["itemScope"]), ni = /* @__PURE__ */ new Set(
|
|
|
1141
1141
|
"font-face-name",
|
|
1142
1142
|
"missing-glyph"
|
|
1143
1143
|
]);
|
|
1144
|
-
function
|
|
1144
|
+
function Ws(e) {
|
|
1145
1145
|
if (e.length === 0)
|
|
1146
1146
|
return "";
|
|
1147
1147
|
const t = e[0];
|
|
@@ -1154,20 +1154,20 @@ function Us(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
return e.trim().length === 0 ? t : e;
|
|
1156
1156
|
}
|
|
1157
|
-
const
|
|
1157
|
+
const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`", "\\`"), Hs = /\$\{/gu, qs = (e) => !Vs.test(e), Vs = /^[^\s"'=<>`]+$/u, Gs = /[&<>]/gu, Xs = {
|
|
1158
1158
|
"&": "&",
|
|
1159
1159
|
"<": "<",
|
|
1160
1160
|
">": ">"
|
|
1161
|
-
}, oi = (e) => e.replace(
|
|
1162
|
-
[
|
|
1161
|
+
}, oi = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], se = "staticHtml", G = "staticSvg", re = "html", ee = "svg", ai = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), li = "css", ci = "mathml", di = [li, re, ci, se, G, ee], Qs = new Set(di), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...di, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
|
|
1162
|
+
[re]: ["lit", "lit/html.js", "lit-html"],
|
|
1163
1163
|
/**
|
|
1164
1164
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
1165
1165
|
* "staticSvg", leading to collision. We have to import them "as", as well as
|
|
1166
1166
|
* check for existing "html" and "svg" imports from these locations to prevent
|
|
1167
1167
|
* collisions.
|
|
1168
1168
|
*/
|
|
1169
|
-
[
|
|
1170
|
-
[
|
|
1169
|
+
[se]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1170
|
+
[ee]: ["lit", "lit-html", "lit/html.js"],
|
|
1171
1171
|
[G]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1172
1172
|
[ci]: ["lit", "lit-html", "lit/html.js"],
|
|
1173
1173
|
[li]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
@@ -1180,7 +1180,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1180
1180
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1181
1181
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1182
1182
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1183
|
-
},
|
|
1183
|
+
}, sr = /* @__PURE__ */ new Set([
|
|
1184
1184
|
"h",
|
|
1185
1185
|
"Fragment",
|
|
1186
1186
|
"state",
|
|
@@ -1190,15 +1190,15 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1190
1190
|
"bindProperty",
|
|
1191
1191
|
"bindEvent",
|
|
1192
1192
|
"bindAttribute"
|
|
1193
|
-
]),
|
|
1194
|
-
name:
|
|
1193
|
+
]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", Te = "?litCss", X = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
|
|
1194
|
+
name: oe,
|
|
1195
1195
|
enforce: "pre",
|
|
1196
1196
|
configResolved(t) {
|
|
1197
1197
|
const i = t.plugins.find(({ name: r }) => r === "vite:css-post");
|
|
1198
1198
|
if (i === void 0)
|
|
1199
1199
|
throw Error(
|
|
1200
1200
|
b(
|
|
1201
|
-
|
|
1201
|
+
oe,
|
|
1202
1202
|
"Unable to find the vite's built-in vite:css-post plugin. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
|
|
1203
1203
|
)
|
|
1204
1204
|
);
|
|
@@ -1206,7 +1206,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1206
1206
|
if (typeof s != "object" || typeof s.handler != "function")
|
|
1207
1207
|
throw Error(
|
|
1208
1208
|
b(
|
|
1209
|
-
|
|
1209
|
+
oe,
|
|
1210
1210
|
"Expected vite:css-post to declare a transform:{handler()} property. This may indicate you are trying to use Vite 6 with Lumina version that is designed for Vite 7. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
|
|
1211
1211
|
)
|
|
1212
1212
|
);
|
|
@@ -1214,7 +1214,7 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1214
1214
|
if (n.length !== 1)
|
|
1215
1215
|
throw Error(
|
|
1216
1216
|
b(
|
|
1217
|
-
|
|
1217
|
+
oe,
|
|
1218
1218
|
`Expected vite:css-post's transform handler to have only a single property: handler. Found: ${n.join(",")}. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use \`[p]npm list vite\`/\`yarn why vite\` to check the Vite version you are using.`
|
|
1219
1219
|
)
|
|
1220
1220
|
);
|
|
@@ -1222,22 +1222,22 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1222
1222
|
...s,
|
|
1223
1223
|
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
1224
1224
|
async handler(r, a) {
|
|
1225
|
-
const c = a.endsWith(
|
|
1226
|
-
c && (a = a.slice(0, -
|
|
1225
|
+
const c = a.endsWith(Te);
|
|
1226
|
+
c && (a = a.slice(0, -Te.length));
|
|
1227
1227
|
const d = a.endsWith(X);
|
|
1228
1228
|
d && (a = a.slice(0, -X.length));
|
|
1229
|
-
const l = a.endsWith(
|
|
1230
|
-
if (l && (a = a.slice(0, -
|
|
1229
|
+
const l = a.endsWith(Ve);
|
|
1230
|
+
if (l && (a = a.slice(0, -Ve.length)), !c && !d && !l)
|
|
1231
1231
|
return await s.handler.call(this, r, a);
|
|
1232
1232
|
const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1233
|
-
return typeof f != "string" || !f.startsWith(pi) || !f.endsWith(
|
|
1234
|
-
|
|
1233
|
+
return typeof f != "string" || !f.startsWith(pi) || !f.endsWith(or) ? ($.warn(
|
|
1234
|
+
oe,
|
|
1235
1235
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1236
1236
|
f
|
|
1237
1237
|
)}`
|
|
1238
1238
|
), m) : l ? (e._globalCssString = mi(f), { code: "", map: { mappings: "" } }) : {
|
|
1239
1239
|
...g,
|
|
1240
|
-
code:
|
|
1240
|
+
code: dr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1241
1241
|
/**
|
|
1242
1242
|
* Vite's original transform does not generate source maps for inlined
|
|
1243
1243
|
* css, thus we can't either
|
|
@@ -1247,8 +1247,8 @@ const Ws = (e) => e.replaceAll("\\", "\\\\").replace(zs, "\\${").replaceAll("`",
|
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
}), pi = 'export default "',
|
|
1251
|
-
export const styles = css\``,
|
|
1250
|
+
}), pi = 'export default "', or = '"', ar = `import { css } from '${te.css[0]}';
|
|
1251
|
+
export const styles = css\``, lr = "`;\nexport default styles;", cr = `
|
|
1252
1252
|
|
|
1253
1253
|
if(import.meta.hot) {
|
|
1254
1254
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1260,23 +1260,23 @@ if(import.meta.hot) {
|
|
|
1260
1260
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1261
1261
|
});
|
|
1262
1262
|
}`, mi = (e) => e.slice(pi.length - 1);
|
|
1263
|
-
function
|
|
1264
|
-
const n = mi(e), r = JSON.parse(n), a =
|
|
1263
|
+
function dr(e, t, i, s) {
|
|
1264
|
+
const n = mi(e), r = JSON.parse(n), a = zs(r), c = s ? `@layer{${i ? "" : `
|
|
1265
1265
|
`}${a}${i ? "" : `
|
|
1266
1266
|
`}}` : a;
|
|
1267
|
-
return `${
|
|
1267
|
+
return `${ar}${c}${lr}${t ? cr : ""}`;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return `import("${
|
|
1271
|
-
setCustomElementsManifest(${
|
|
1269
|
+
function pr(e) {
|
|
1270
|
+
return `import("${mr}").then(({ setCustomElementsManifest }) => {
|
|
1271
|
+
setCustomElementsManifest(${ur(e)});
|
|
1272
1272
|
});`;
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1275
|
-
function
|
|
1274
|
+
const mr = "@storybook/web-components-vite", ur = (e) => `JSON.parse(\`${fr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1275
|
+
function fr(e) {
|
|
1276
1276
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
|
|
1278
|
+
function gr(e) {
|
|
1279
|
+
hr(e);
|
|
1280
1280
|
const t = e.options.css?.globalStylesPath;
|
|
1281
1281
|
if (t === void 0)
|
|
1282
1282
|
return "";
|
|
@@ -1286,10 +1286,10 @@ function fr(e) {
|
|
|
1286
1286
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1287
1287
|
fi("", e)
|
|
1288
1288
|
].join(`
|
|
1289
|
-
`) : `import "${i}${
|
|
1289
|
+
`) : `import "${i}${Ve}";`;
|
|
1290
1290
|
}
|
|
1291
1291
|
const ui = "hydrated";
|
|
1292
|
-
function
|
|
1292
|
+
function hr(e) {
|
|
1293
1293
|
e._globalHydratedCssString = [
|
|
1294
1294
|
":not([",
|
|
1295
1295
|
e.options.css?.hydratedAttribute ?? ui,
|
|
@@ -1306,58 +1306,58 @@ function fi(e, t) {
|
|
|
1306
1306
|
].join(`
|
|
1307
1307
|
`);
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1309
|
+
const yr = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1310
1310
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1311
1311
|
|
|
1312
1312
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1313
1313
|
`}}`;
|
|
1314
|
-
function
|
|
1314
|
+
function vr(e) {
|
|
1315
1315
|
const t = [], i = [];
|
|
1316
1316
|
for (const s of e.privateApiJson.modules)
|
|
1317
1317
|
for (const n of s.declarations)
|
|
1318
|
-
n.customElement === !0 && (i.push(
|
|
1318
|
+
n.customElement === !0 && (i.push(br(n, e, s.sourcePath)), t.push(s.sourcePath));
|
|
1319
1319
|
return [
|
|
1320
1320
|
'import { runtime } from "./runtime.ts";',
|
|
1321
1321
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
1322
|
-
|
|
1323
|
-
e.hmrEnabled ?
|
|
1322
|
+
gr(e),
|
|
1323
|
+
e.hmrEnabled ? Sr : "",
|
|
1324
1324
|
"",
|
|
1325
|
-
e.isInStorybook ?
|
|
1325
|
+
e.isInStorybook ? pr(e.apiJson) : "",
|
|
1326
1326
|
"",
|
|
1327
1327
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
1328
1328
|
i.join(`,
|
|
1329
1329
|
`),
|
|
1330
1330
|
"});",
|
|
1331
|
-
e.hmrEnabled ?
|
|
1331
|
+
e.hmrEnabled ? Cr(t) : ""
|
|
1332
1332
|
].join(`
|
|
1333
1333
|
`);
|
|
1334
1334
|
}
|
|
1335
|
-
const
|
|
1335
|
+
const br = (e, t, i) => [
|
|
1336
1336
|
` "${e.tagName}": [`,
|
|
1337
1337
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
1338
|
-
|
|
1338
|
+
wr(e),
|
|
1339
1339
|
"]"
|
|
1340
1340
|
].join("");
|
|
1341
|
-
function
|
|
1342
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = gi(e), r = t.map((g) => g.join(
|
|
1343
|
-
return `${p.length > 0 || n ? `"${p.join(
|
|
1341
|
+
function wr(e) {
|
|
1342
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = gi(e), r = t.map((g) => g.join(ms)).join(De), a = i.join(De), c = s.join(De), 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(us)}"` : ""}${n ? ",1" : ""}`;
|
|
1344
1344
|
}
|
|
1345
1345
|
function gi(e) {
|
|
1346
1346
|
const t = [], i = [], s = [];
|
|
1347
1347
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1348
1348
|
const a = e.members[r];
|
|
1349
1349
|
if (a.kind === "field") {
|
|
1350
|
-
const c = typeof a.attribute == "string", d = c && a.attribute !==
|
|
1350
|
+
const c = typeof a.attribute == "string", d = c && a.attribute !== Vt(a.name);
|
|
1351
1351
|
t.push(
|
|
1352
1352
|
c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
|
|
1353
1353
|
);
|
|
1354
|
-
} else a.kind === "method" && a.name !== "componentOnReady" && (
|
|
1354
|
+
} else a.kind === "method" && a.name !== "componentOnReady" && (Ss(a) ? i.push(a.name) : s.push(a.name));
|
|
1355
1355
|
}
|
|
1356
1356
|
const n = e.formAssociated === !0;
|
|
1357
1357
|
return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: n };
|
|
1358
1358
|
}
|
|
1359
|
-
const
|
|
1360
|
-
`,
|
|
1359
|
+
const Sr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
1360
|
+
`, Cr = (e) => `
|
|
1361
1361
|
if(import.meta.hot) {
|
|
1362
1362
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
1363
1363
|
import.meta.hot.accept([
|
|
@@ -1368,39 +1368,39 @@ ${e.map((t) => ` "/${t}",`).join(`
|
|
|
1368
1368
|
name: Er
|
|
1369
1369
|
};
|
|
1370
1370
|
async function yi(e, t) {
|
|
1371
|
-
return
|
|
1371
|
+
return ie ??= $r(e, t), await ie;
|
|
1372
1372
|
}
|
|
1373
|
-
function
|
|
1374
|
-
if (
|
|
1373
|
+
function Tr() {
|
|
1374
|
+
if ($e === void 0)
|
|
1375
1375
|
throw Error(
|
|
1376
1376
|
b(
|
|
1377
1377
|
"@arcgis/lumina:retrieveComponentDependencies",
|
|
1378
1378
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
1379
1379
|
)
|
|
1380
1380
|
);
|
|
1381
|
-
return
|
|
1381
|
+
return $e;
|
|
1382
1382
|
}
|
|
1383
1383
|
function vi() {
|
|
1384
|
-
if (
|
|
1384
|
+
if (Ge === void 0)
|
|
1385
1385
|
throw Error(
|
|
1386
1386
|
b(
|
|
1387
1387
|
"@arcgis/lumina:retrieveFlatComponentDependencies",
|
|
1388
1388
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
1389
1389
|
)
|
|
1390
1390
|
);
|
|
1391
|
-
return
|
|
1391
|
+
return Ge;
|
|
1392
1392
|
}
|
|
1393
|
-
async function
|
|
1393
|
+
async function $r(e, t) {
|
|
1394
1394
|
const i = R(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1395
|
-
[...Object.keys(s), ...Object.keys(n)].filter((l) =>
|
|
1395
|
+
[...Object.keys(s), ...Object.keys(n)].filter((l) => !Pr.has(l)).flatMap(async (l) => await bi(l, e))
|
|
1396
1396
|
)).filter(j);
|
|
1397
|
-
|
|
1397
|
+
$e ??= a, Ge = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1398
1398
|
const c = t?.serve?.extraDependencies?.map(
|
|
1399
1399
|
(l) => typeof l == "string" ? l : l.name
|
|
1400
1400
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
1401
|
-
return
|
|
1401
|
+
return $e ??= d, d;
|
|
1402
1402
|
}
|
|
1403
|
-
const
|
|
1403
|
+
const Pr = /* @__PURE__ */ new Set([
|
|
1404
1404
|
"@arcgis/arcade-languageservice",
|
|
1405
1405
|
"@arcgis/node-toolkit",
|
|
1406
1406
|
"@arcgis/toolkit",
|
|
@@ -1412,6 +1412,7 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1412
1412
|
"@custom-elements-manifest/analyzer",
|
|
1413
1413
|
"@esri/calcite-ui-icons",
|
|
1414
1414
|
"@floating-ui/dom",
|
|
1415
|
+
"@floating-ui/utils",
|
|
1415
1416
|
"@lit-labs/ssr",
|
|
1416
1417
|
"@lit/context",
|
|
1417
1418
|
"@lit-labs/ssr-client",
|
|
@@ -1422,6 +1423,7 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1422
1423
|
"composed-offset-position",
|
|
1423
1424
|
"custom-elements-manifest",
|
|
1424
1425
|
"dayjs",
|
|
1426
|
+
"es-toolkit",
|
|
1425
1427
|
"focus-trap",
|
|
1426
1428
|
"interactjs",
|
|
1427
1429
|
"lit",
|
|
@@ -1429,6 +1431,7 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1429
1431
|
"monaco-editor",
|
|
1430
1432
|
"sortablejs",
|
|
1431
1433
|
"storybook",
|
|
1434
|
+
"tabbable",
|
|
1432
1435
|
"timezone-groups",
|
|
1433
1436
|
"type-fest",
|
|
1434
1437
|
"tslib",
|
|
@@ -1436,30 +1439,30 @@ const $r = /* @__PURE__ */ new Set([
|
|
|
1436
1439
|
"vscode-languageserver-textdocument",
|
|
1437
1440
|
"vscode-languageserver-types"
|
|
1438
1441
|
]);
|
|
1439
|
-
let
|
|
1442
|
+
let $e, Ge, ie;
|
|
1440
1443
|
async function bi(e, t) {
|
|
1441
|
-
const i = await
|
|
1444
|
+
const i = await tt(e, t), s = await Yt(i), n = "exports" in s, r = Or.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
1442
1445
|
if (a ? await K(c) : !1) {
|
|
1443
|
-
const g = await z(c, "utf8"), h =
|
|
1446
|
+
const g = await z(c, "utf8"), h = Ir(g, "bootstrapLazy("), v = g.indexOf(", options", h), y = g.slice(h, v), S = y.startsWith('JSON.parse("') ? y.slice(12, -2).replaceAll('\\"', '"') : y;
|
|
1444
1447
|
try {
|
|
1445
|
-
const
|
|
1446
|
-
return { packageName: e, type: "stencil", components:
|
|
1447
|
-
} catch (
|
|
1448
|
+
const C = JSON.parse(S), E = Dr(C, { packageName: e, getImportPath: r });
|
|
1449
|
+
return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
|
|
1450
|
+
} catch (C) {
|
|
1448
1451
|
$.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
1449
|
-
Error: ${String(
|
|
1452
|
+
Error: ${String(C)}`);
|
|
1450
1453
|
}
|
|
1451
1454
|
}
|
|
1452
|
-
const l =
|
|
1455
|
+
const l = wt(s.customElements);
|
|
1453
1456
|
if (l != null) {
|
|
1454
|
-
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), v =
|
|
1457
|
+
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), v = kr(h), y = wi(h, {
|
|
1455
1458
|
packageName: e,
|
|
1456
1459
|
getImportPath: r
|
|
1457
1460
|
});
|
|
1458
1461
|
return { type: v ? "@arcgis/lumina" : "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
|
|
1459
1462
|
}
|
|
1460
|
-
const p =
|
|
1463
|
+
const p = wt(s["web-types"]);
|
|
1461
1464
|
if (p != null) {
|
|
1462
|
-
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), v =
|
|
1465
|
+
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), v = xr(h, {
|
|
1463
1466
|
packageName: e,
|
|
1464
1467
|
getImportPath: r
|
|
1465
1468
|
});
|
|
@@ -1467,15 +1470,15 @@ Error: ${String(E)}`);
|
|
|
1467
1470
|
}
|
|
1468
1471
|
const m = u.join(i, "dist/components");
|
|
1469
1472
|
if (await K(m)) {
|
|
1470
|
-
const g = await
|
|
1473
|
+
const g = await Rr(m, {
|
|
1471
1474
|
packageName: e,
|
|
1472
1475
|
getImportPath: r
|
|
1473
1476
|
});
|
|
1474
1477
|
return { type: "unknown", packageName: e, components: g, packageLocation: i, packageJson: s };
|
|
1475
1478
|
}
|
|
1476
1479
|
}
|
|
1477
|
-
const
|
|
1478
|
-
function
|
|
1480
|
+
const wt = (e) => Array.isArray(e) ? e[0] : e;
|
|
1481
|
+
function Ir(e, t) {
|
|
1479
1482
|
const i = e.indexOf(t);
|
|
1480
1483
|
return i === -1 ? -1 : i + t.length;
|
|
1481
1484
|
}
|
|
@@ -1516,11 +1519,11 @@ function wi(e, t, i = !1) {
|
|
|
1516
1519
|
}
|
|
1517
1520
|
return s;
|
|
1518
1521
|
}
|
|
1519
|
-
const
|
|
1522
|
+
const kr = (e) => (
|
|
1520
1523
|
// Since 5.0
|
|
1521
1524
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1522
1525
|
e.compiler?.name === hi.name
|
|
1523
|
-
),
|
|
1526
|
+
), xr = (e, t) => Object.fromEntries(
|
|
1524
1527
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1525
1528
|
(i) => [
|
|
1526
1529
|
i.name,
|
|
@@ -1531,7 +1534,7 @@ const Ir = (e) => (
|
|
|
1531
1534
|
}
|
|
1532
1535
|
]
|
|
1533
1536
|
) ?? []
|
|
1534
|
-
),
|
|
1537
|
+
), Ar = 1, Lr = 2, Nr = 4, jr = 8, Fr = Ar | Lr | Nr | jr, Dr = (e, t) => Object.fromEntries(
|
|
1535
1538
|
e.flatMap(
|
|
1536
1539
|
([i, s]) => s.map(
|
|
1537
1540
|
([n, r, a]) => [
|
|
@@ -1540,13 +1543,13 @@ const Ir = (e) => (
|
|
|
1540
1543
|
packageName: t.packageName,
|
|
1541
1544
|
modulePath: t.getImportPath(r),
|
|
1542
1545
|
propToAttribute: Object.fromEntries(
|
|
1543
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
1546
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & Fr).map(([c, [d, l = c]]) => [c, l])
|
|
1544
1547
|
)
|
|
1545
1548
|
}
|
|
1546
1549
|
]
|
|
1547
1550
|
)
|
|
1548
1551
|
)
|
|
1549
|
-
),
|
|
1552
|
+
), Rr = async (e, t) => Object.fromEntries(
|
|
1550
1553
|
(await et(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
1551
1554
|
const s = i.slice(0, -5);
|
|
1552
1555
|
return [
|
|
@@ -1558,19 +1561,125 @@ const Ir = (e) => (
|
|
|
1558
1561
|
}
|
|
1559
1562
|
];
|
|
1560
1563
|
})
|
|
1561
|
-
),
|
|
1564
|
+
), Or = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Mr = (e) => e.startsWith("/") ? e : `/${e}`, nt = (e, t) => `${e}@fs${Mr(t)}`;
|
|
1562
1565
|
function Si(e) {
|
|
1563
1566
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1564
1567
|
return i === "latest" ? "esnext" : i;
|
|
1565
1568
|
}
|
|
1566
|
-
const
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1569
|
+
const Xe = "@arcgis/lumina:provideAssets";
|
|
1570
|
+
function Z(e, t, i = ot) {
|
|
1571
|
+
if (e.viteCommand !== "serve")
|
|
1572
|
+
throw Error(b(Xe, "serveAssets() is only available when Vite is running in serve mode"));
|
|
1573
|
+
const s = e._serverConfigured, n = e.server.middlewares.stack.length;
|
|
1574
|
+
if (t.forEach((r) => {
|
|
1575
|
+
const a = Ei(r), c = $i(e.dir, Ti(a)), d = Br(e.viteConfig.base, c, e.dir.distCdn);
|
|
1576
|
+
e.server.middlewares.use(d, (l, p, m) => {
|
|
1577
|
+
const f = Kr(l.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), v = i.find((y) => y.match(h, e));
|
|
1578
|
+
return (typeof g == "function" ? Promise.resolve(g()) : z(g)).then((y) => {
|
|
1579
|
+
const S = (typeof g == "function" ? void 0 : v?.transform(y.toString("utf8"), h, e)) ?? y;
|
|
1580
|
+
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", xs.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
1581
|
+
}).catch((y) => {
|
|
1582
|
+
(a.type !== "directory" || process.env.DEBUG) && $.warn(
|
|
1583
|
+
Xe,
|
|
1584
|
+
`Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? f}":${String(y)}`
|
|
1585
|
+
), m();
|
|
1586
|
+
}), !0;
|
|
1587
|
+
});
|
|
1588
|
+
}), s) {
|
|
1589
|
+
const r = e.server.middlewares.stack.splice(n);
|
|
1590
|
+
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
1591
|
+
}
|
|
1592
|
+
}
|
|
1593
|
+
async function Ci(e, t, i = ot) {
|
|
1594
|
+
await Promise.all(
|
|
1595
|
+
t.map(async (s) => {
|
|
1596
|
+
const n = Ei(s), r = $i(e.dir, Ti(n));
|
|
1597
|
+
if (n.type === "directory") {
|
|
1598
|
+
const a = u.resolve(n.source), d = (await et(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
|
|
1599
|
+
const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
|
|
1600
|
+
return [p, f];
|
|
1601
|
+
});
|
|
1602
|
+
await Ii(d.map(([l, p]) => p)), await As(
|
|
1603
|
+
d,
|
|
1604
|
+
16,
|
|
1605
|
+
async ([l, p]) => await St(l, p, i, e)
|
|
1606
|
+
);
|
|
1607
|
+
} else if (n.type === "file")
|
|
1608
|
+
await V(u.dirname(r), { recursive: !0 }), await St(n.source, r, i, e);
|
|
1609
|
+
else if (n.type === "dynamic") {
|
|
1610
|
+
await V(u.dirname(r), { recursive: !0 });
|
|
1611
|
+
const a = await Promise.resolve(n.source());
|
|
1612
|
+
await _(r, a);
|
|
1613
|
+
}
|
|
1614
|
+
})
|
|
1615
|
+
);
|
|
1616
|
+
}
|
|
1617
|
+
const Ei = Gt ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
1618
|
+
...e,
|
|
1619
|
+
destination: ce(e.destination)
|
|
1620
|
+
} : {
|
|
1621
|
+
...e,
|
|
1622
|
+
source: ce(e.source),
|
|
1623
|
+
destination: ce(e.destination)
|
|
1624
|
+
};
|
|
1625
|
+
async function St(e, t, i, s) {
|
|
1626
|
+
const n = i.find((r) => r.match(t, s));
|
|
1627
|
+
if (n === void 0)
|
|
1628
|
+
await $s(e, t);
|
|
1629
|
+
else {
|
|
1630
|
+
const r = await z(e, "utf8"), a = n.transform(r, t, s);
|
|
1631
|
+
await _(t, a);
|
|
1632
|
+
}
|
|
1633
|
+
}
|
|
1634
|
+
function Ti(e) {
|
|
1635
|
+
if (e.type === "dynamic")
|
|
1636
|
+
return e.destination;
|
|
1637
|
+
if (e.source.endsWith(u.sep)) {
|
|
1638
|
+
if (e.type === "file")
|
|
1639
|
+
throw Error(
|
|
1640
|
+
b(
|
|
1641
|
+
Xe,
|
|
1642
|
+
`Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${Ae(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
|
|
1643
|
+
)
|
|
1644
|
+
);
|
|
1645
|
+
return e.destination;
|
|
1646
|
+
}
|
|
1647
|
+
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;
|
|
1648
|
+
}
|
|
1649
|
+
function $i({ dist: e, distCdnAssets: t }, i) {
|
|
1650
|
+
const s = Jr(i), n = u.join(
|
|
1651
|
+
t,
|
|
1652
|
+
s ? u.relative(t, i) : i
|
|
1653
|
+
), r = u.relative(e, n), a = Pi(r);
|
|
1654
|
+
return u.join(e, a);
|
|
1655
|
+
}
|
|
1656
|
+
function Jr(e) {
|
|
1657
|
+
if (e.startsWith(u.sep)) {
|
|
1658
|
+
const t = Xt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
1659
|
+
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
1660
|
+
} else
|
|
1661
|
+
return !!(!Gt && u.isAbsolute(e));
|
|
1662
|
+
}
|
|
1663
|
+
function Br(e, t, i) {
|
|
1664
|
+
const s = Pi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
1665
|
+
return `${e}${n}`;
|
|
1666
|
+
}
|
|
1667
|
+
const Pi = (e) => e.replaceAll("../", ""), Kr = (e = "") => e.split("?")[0].split("#")[0];
|
|
1668
|
+
async function Ii(e) {
|
|
1669
|
+
const t = new Set(e.map(u.dirname));
|
|
1670
|
+
await Promise.all(Array.from(t, async (i) => await V(i, { recursive: !0 })));
|
|
1671
|
+
}
|
|
1672
|
+
const _r = {
|
|
1673
|
+
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
1674
|
+
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
1675
|
+
}, ot = [_r], Pe = "@arcgis/core", ki = "@arcgis/core/assets", Me = R(), ue = Pe in (Me.dependencies ?? {}) || Pe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
1676
|
+
Me.name === "@arcgis/lumina";
|
|
1677
|
+
async function Ur(e, t, i) {
|
|
1678
|
+
if (!ue)
|
|
1570
1679
|
return [];
|
|
1571
|
-
const s = await
|
|
1680
|
+
const s = await tt(Pe);
|
|
1572
1681
|
if (t === "cdn") {
|
|
1573
|
-
const n = await Yt(s), r =
|
|
1682
|
+
const n = await Yt(s), r = Le({ name: "", version: n.version }, i);
|
|
1574
1683
|
return [
|
|
1575
1684
|
// Use the ESM CDN
|
|
1576
1685
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -1586,20 +1695,20 @@ async function Mr(e, t, i) {
|
|
|
1586
1695
|
})
|
|
1587
1696
|
},
|
|
1588
1697
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1589
|
-
|
|
1698
|
+
xi(r)
|
|
1590
1699
|
];
|
|
1591
1700
|
} else
|
|
1592
|
-
return
|
|
1701
|
+
return Wr(e, s);
|
|
1593
1702
|
}
|
|
1594
|
-
function
|
|
1595
|
-
const i =
|
|
1703
|
+
function Wr(e, t) {
|
|
1704
|
+
const i = `${e}${ki}`;
|
|
1596
1705
|
return [
|
|
1597
|
-
|
|
1706
|
+
// Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
|
|
1707
|
+
// Core's prebuilt JavaScript assets use the untransformed route configured below.
|
|
1708
|
+
xi(nt(e, `${t}/assets/`)),
|
|
1598
1709
|
{
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
* configureVite excludes this exact import to keep the app and this assignment on the same core config instance.
|
|
1602
|
-
*/
|
|
1710
|
+
// This import is injected dynamically, so external consumers must tell Vite to optimize it. Within the monorepo,
|
|
1711
|
+
// configureVite excludes this exact import to keep the app and this assignment on the same core config instance.
|
|
1603
1712
|
optimizableImports: ["@arcgis/core/config.js"],
|
|
1604
1713
|
javascriptCode: [
|
|
1605
1714
|
'import esriConfig from "@arcgis/core/config.js";',
|
|
@@ -1608,37 +1717,51 @@ function Jr(e, t) {
|
|
|
1608
1717
|
}
|
|
1609
1718
|
];
|
|
1610
1719
|
}
|
|
1611
|
-
|
|
1720
|
+
async function zr(e) {
|
|
1721
|
+
const t = await tt(Pe);
|
|
1722
|
+
Z(
|
|
1723
|
+
e,
|
|
1724
|
+
[
|
|
1725
|
+
{
|
|
1726
|
+
type: "directory",
|
|
1727
|
+
source: u.join(t, "assets", u.sep),
|
|
1728
|
+
destination: `../${ki}`
|
|
1729
|
+
}
|
|
1730
|
+
],
|
|
1731
|
+
[]
|
|
1732
|
+
);
|
|
1733
|
+
}
|
|
1734
|
+
const xi = (e) => ({
|
|
1612
1735
|
// Not using join() because it would turn https:// into https:/
|
|
1613
1736
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
1614
1737
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1615
1738
|
id: "arcgisCoreStylesheet"
|
|
1616
|
-
}),
|
|
1617
|
-
function
|
|
1739
|
+
}), at = "customElement.js";
|
|
1740
|
+
function Hr(e, t) {
|
|
1618
1741
|
if (!t.startsWith(e))
|
|
1619
1742
|
return t;
|
|
1620
1743
|
const s = t.split(u.sep);
|
|
1621
|
-
return s.at(
|
|
1744
|
+
return s.at(qr) !== s.at(Vr) ? t : u.join(s.slice(0, -1).join(u.sep), at);
|
|
1622
1745
|
}
|
|
1623
|
-
const
|
|
1746
|
+
const qr = -1, Vr = -2, Gr = /["']\.\.?\/[^'"]+/gu, Xr = (e, t, i, s) => e.replaceAll(Gr, (n) => {
|
|
1624
1747
|
const r = n.slice(1);
|
|
1625
1748
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1626
1749
|
return n;
|
|
1627
|
-
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
1750
|
+
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Hr(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + We(c.slice(t.dir.dist.length), t.apiExtractor) : c;
|
|
1628
1751
|
if (i === s && a === d)
|
|
1629
1752
|
return n;
|
|
1630
|
-
const l =
|
|
1753
|
+
const l = fe(i, d), p = n.endsWith("/") ? `${l}/` : l;
|
|
1631
1754
|
return `${n[0]}${p}`;
|
|
1632
|
-
}),
|
|
1755
|
+
}), fe = (e, t) => {
|
|
1633
1756
|
const i = u.relative(e, t);
|
|
1634
1757
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
1635
1758
|
};
|
|
1636
|
-
async function
|
|
1759
|
+
async function Yr(e, t, i) {
|
|
1637
1760
|
const s = u.resolve(e.dir.root, t);
|
|
1638
|
-
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await
|
|
1761
|
+
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Ps(s, { recursive: !0, force: !0 }), await V(s, { recursive: !0 }), await Is(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1639
1762
|
const n = [
|
|
1640
1763
|
"index.html",
|
|
1641
|
-
...await
|
|
1764
|
+
...await Ls("**/*.html", {
|
|
1642
1765
|
cwd: e.dir.src,
|
|
1643
1766
|
onlyFiles: !0,
|
|
1644
1767
|
// The files we are looking for are unlikely to be symbolic links
|
|
@@ -1663,20 +1786,20 @@ async function zr(e, t, i) {
|
|
|
1663
1786
|
n.map(async (l, p) => {
|
|
1664
1787
|
const f = p === 0 ? l : u.join(r, l), g = u.join(e.dir.root, f), h = u.join(s, f);
|
|
1665
1788
|
await V(u.dirname(h), { recursive: !0 });
|
|
1666
|
-
const v = await z(g, "utf-8"), y =
|
|
1667
|
-
`,
|
|
1789
|
+
const v = await z(g, "utf-8"), y = fe(u.dirname(f), `build/${i}`), S = `${d}<script type="module" src="${y}"><\/script>
|
|
1790
|
+
`, C = Math.min(
|
|
1668
1791
|
...[v.indexOf("<style>"), v.indexOf("<script"), v.indexOf("</head>")].filter(
|
|
1669
1792
|
(x) => x !== -1
|
|
1670
1793
|
)
|
|
1671
1794
|
);
|
|
1672
|
-
if (
|
|
1795
|
+
if (C === Number.POSITIVE_INFINITY)
|
|
1673
1796
|
throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
|
|
1674
|
-
const
|
|
1797
|
+
const E = v.slice(0, C) + S + v.slice(C), T = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
|
|
1675
1798
|
await _(h, T, "utf-8");
|
|
1676
1799
|
})
|
|
1677
1800
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1678
1801
|
}
|
|
1679
|
-
const
|
|
1802
|
+
const Ai = /* @__PURE__ */ new Set([
|
|
1680
1803
|
"chunks",
|
|
1681
1804
|
"components",
|
|
1682
1805
|
"docs",
|
|
@@ -1689,13 +1812,13 @@ const Ci = /* @__PURE__ */ new Set([
|
|
|
1689
1812
|
"collection",
|
|
1690
1813
|
"extras",
|
|
1691
1814
|
"support"
|
|
1692
|
-
]), D = "@arcgis/lumina:buildCdn",
|
|
1693
|
-
function
|
|
1815
|
+
]), D = "@arcgis/lumina:buildCdn", ne = "cdn", Li = "index", Y = "main";
|
|
1816
|
+
function Qr(e) {
|
|
1694
1817
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1695
1818
|
if (a) {
|
|
1696
1819
|
if (i.toLowerCase() !== i)
|
|
1697
1820
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
1698
|
-
if (
|
|
1821
|
+
if (Ai.has(i))
|
|
1699
1822
|
throw new Error(
|
|
1700
1823
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
1701
1824
|
);
|
|
@@ -1703,11 +1826,11 @@ function Hr(e) {
|
|
|
1703
1826
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
1704
1827
|
);
|
|
1705
1828
|
}
|
|
1706
|
-
const c = i ??
|
|
1829
|
+
const c = i ?? Li;
|
|
1707
1830
|
if (e.provideAssets([
|
|
1708
1831
|
{
|
|
1709
1832
|
type: "dynamic",
|
|
1710
|
-
source: () =>
|
|
1833
|
+
source: () => yr(e),
|
|
1711
1834
|
destination: `../${a ? c : Y}.css`
|
|
1712
1835
|
}
|
|
1713
1836
|
]), !t)
|
|
@@ -1723,7 +1846,7 @@ function Hr(e) {
|
|
|
1723
1846
|
);
|
|
1724
1847
|
return;
|
|
1725
1848
|
}
|
|
1726
|
-
const d =
|
|
1849
|
+
const d = ue && R().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await Zr(
|
|
1727
1850
|
e,
|
|
1728
1851
|
c,
|
|
1729
1852
|
s,
|
|
@@ -1731,7 +1854,7 @@ function Hr(e) {
|
|
|
1731
1854
|
n,
|
|
1732
1855
|
d
|
|
1733
1856
|
);
|
|
1734
|
-
await
|
|
1857
|
+
await en(
|
|
1735
1858
|
m,
|
|
1736
1859
|
e,
|
|
1737
1860
|
a ? `${c}.esm` : c,
|
|
@@ -1739,11 +1862,11 @@ function Hr(e) {
|
|
|
1739
1862
|
d
|
|
1740
1863
|
);
|
|
1741
1864
|
const f = Date.now();
|
|
1742
|
-
$.info(D, `CDN was built in ${f - l}ms`), r && await
|
|
1865
|
+
$.info(D, `CDN was built in ${f - l}ms`), r && await Yr(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
1743
1866
|
}
|
|
1744
1867
|
};
|
|
1745
1868
|
}
|
|
1746
|
-
async function
|
|
1869
|
+
async function Zr(e, t, i, s, n, r) {
|
|
1747
1870
|
const a = e.environment;
|
|
1748
1871
|
if (i.minify && r)
|
|
1749
1872
|
throw Error(
|
|
@@ -1767,7 +1890,7 @@ async function qr(e, t, i, s, n, r) {
|
|
|
1767
1890
|
**/
|
|
1768
1891
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1769
1892
|
${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
1770
|
-
return await
|
|
1893
|
+
return await ks({
|
|
1771
1894
|
bundle: !0,
|
|
1772
1895
|
minify: r ? !0 : a === "production",
|
|
1773
1896
|
treeShaking: !0,
|
|
@@ -1819,7 +1942,7 @@ ${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1819
1942
|
setup(l) {
|
|
1820
1943
|
const p = e.options.build?.cdn?.namespace === void 0 ? (
|
|
1821
1944
|
// eslint-disable-next-line require-unicode-regexp
|
|
1822
|
-
new RegExp(`\\/${
|
|
1945
|
+
new RegExp(`\\/${ne}\\/${Y}\\.css$`)
|
|
1823
1946
|
) : (
|
|
1824
1947
|
// eslint-disable-next-line require-unicode-regexp
|
|
1825
1948
|
new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
|
|
@@ -1851,8 +1974,8 @@ ${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1851
1974
|
}
|
|
1852
1975
|
});
|
|
1853
1976
|
}
|
|
1854
|
-
const
|
|
1855
|
-
async function
|
|
1977
|
+
const Ct = "stdin.js";
|
|
1978
|
+
async function en(e, t, i, s, n) {
|
|
1856
1979
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
1857
1980
|
let c;
|
|
1858
1981
|
n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -1863,16 +1986,16 @@ async function Vr(e, t, i, s, n) {
|
|
|
1863
1986
|
isProcessing: !1,
|
|
1864
1987
|
isAsync: void 0,
|
|
1865
1988
|
oldSingleExportName: void 0
|
|
1866
|
-
}, f =
|
|
1867
|
-
if (f ===
|
|
1989
|
+
}, f = ce(p.path.slice(r.length));
|
|
1990
|
+
if (f === Ct) {
|
|
1868
1991
|
if (n) {
|
|
1869
|
-
const h = p.text.match(
|
|
1992
|
+
const h = p.text.match(tn)?.[0];
|
|
1870
1993
|
if (h === void 0)
|
|
1871
1994
|
throw Error(
|
|
1872
|
-
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${
|
|
1995
|
+
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Ct} contents:
|
|
1873
1996
|
${p.text}`
|
|
1874
1997
|
);
|
|
1875
|
-
m.code = `${m.code.trimEnd()}${
|
|
1998
|
+
m.code = `${m.code.trimEnd()}${sn(h, s)}`, m.isAsync = !1;
|
|
1876
1999
|
}
|
|
1877
2000
|
return [a, m];
|
|
1878
2001
|
}
|
|
@@ -1882,7 +2005,7 @@ ${p.text}`
|
|
|
1882
2005
|
n && d.forEach((p, m) => {
|
|
1883
2006
|
if (p.isAsync === void 0)
|
|
1884
2007
|
if (m.endsWith(".js")) {
|
|
1885
|
-
if (
|
|
2008
|
+
if (Ni(p, d), c?.has(m) === !0 && p.code.includes(ji))
|
|
1886
2009
|
throw Error(
|
|
1887
2010
|
b(
|
|
1888
2011
|
D,
|
|
@@ -1902,8 +2025,8 @@ ${p.text}`
|
|
|
1902
2025
|
}
|
|
1903
2026
|
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await _(r + p, m)));
|
|
1904
2027
|
}
|
|
1905
|
-
const
|
|
1906
|
-
function
|
|
2028
|
+
const tn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2029
|
+
function sn(e, t) {
|
|
1907
2030
|
let i = [
|
|
1908
2031
|
"window.$arcgis",
|
|
1909
2032
|
"||",
|
|
@@ -1944,34 +2067,34 @@ function Xr(e, t) {
|
|
|
1944
2067
|
}
|
|
1945
2068
|
return i += ")", i;
|
|
1946
2069
|
}
|
|
1947
|
-
function
|
|
2070
|
+
function Ni(e, t) {
|
|
1948
2071
|
if (e.isProcessing) {
|
|
1949
|
-
e.isAsync = !0,
|
|
2072
|
+
e.isAsync = !0, Et(e);
|
|
1950
2073
|
return;
|
|
1951
2074
|
}
|
|
1952
2075
|
e.isProcessing = !0;
|
|
1953
2076
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
1954
2077
|
let c = 0;
|
|
1955
|
-
const d = e.code.matchAll(
|
|
2078
|
+
const d = e.code.matchAll(rn);
|
|
1956
2079
|
for (const w of d) {
|
|
1957
|
-
const [O, L, W, N, A] = w, B = A.startsWith(
|
|
2080
|
+
const [O, L, W, N, A] = w, B = A.startsWith(Ie);
|
|
1958
2081
|
if (c !== 0 && c !== w.index) {
|
|
1959
2082
|
const F = e.code.slice(c, w.index);
|
|
1960
2083
|
n.push(F), a.push([c, F.length, 0, ""]);
|
|
1961
2084
|
}
|
|
1962
2085
|
if (c = w.index + O.length, B)
|
|
1963
|
-
a.push([w.index, O.length, 0, ""]), s.push(`"${
|
|
2086
|
+
a.push([w.index, O.length, 0, ""]), s.push(`"${Di(A.slice(Ie.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? W ?? N ?? "");
|
|
1964
2087
|
else {
|
|
1965
|
-
const F =
|
|
2088
|
+
const F = Fi(A, t), M = F?.isAsync === !0;
|
|
1966
2089
|
if (L !== void 0) {
|
|
1967
|
-
const
|
|
1968
|
-
for (const
|
|
1969
|
-
const [
|
|
1970
|
-
M || r.add(
|
|
2090
|
+
const ye = [];
|
|
2091
|
+
for (const Fe of L.slice(1, -1).split(",")) {
|
|
2092
|
+
const [ut, ft = ut] = Fe.split(" as ");
|
|
2093
|
+
M || r.add(ft), ye.push(`${ut}:${ft}`);
|
|
1971
2094
|
}
|
|
1972
2095
|
if (M) {
|
|
1973
|
-
const
|
|
1974
|
-
a.push([w.index + 6, 0, L.length,
|
|
2096
|
+
const Fe = F.oldSingleExportName === void 0 ? `{${ye.join(",")}}` : ye[0].split(":")[1];
|
|
2097
|
+
a.push([w.index + 6, 0, L.length, Fe]);
|
|
1975
2098
|
}
|
|
1976
2099
|
} else if (W === void 0 && N === void 0)
|
|
1977
2100
|
M && a.push([w.index + 6, 0, 0, ""]);
|
|
@@ -1991,10 +2114,10 @@ ${F.code}`
|
|
|
1991
2114
|
e.isProcessing = !1;
|
|
1992
2115
|
const l = e.isAsync === !0;
|
|
1993
2116
|
if (e.isAsync = l || a.length > 0, !e.isAsync) {
|
|
1994
|
-
e.code =
|
|
2117
|
+
e.code = Tt(e.code, t);
|
|
1995
2118
|
return;
|
|
1996
2119
|
}
|
|
1997
|
-
const p =
|
|
2120
|
+
const p = an(r);
|
|
1998
2121
|
let m = e.code.slice(0, c);
|
|
1999
2122
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
2000
2123
|
const [O, L, W, N] = a[w];
|
|
@@ -2005,15 +2128,15 @@ ${F.code}`
|
|
|
2005
2128
|
}
|
|
2006
2129
|
m = m.slice(0, O) + B + m.slice(O + A);
|
|
2007
2130
|
}
|
|
2008
|
-
const [f, g] =
|
|
2131
|
+
const [f, g] = Et(e), h = i.findLastIndex((w) => w.length > 0), v = i.slice(0, h + 1).join(","), y = i.length === 0 ? "_" : `([${v}])`, S = `${ji}${y}=>{`, C = s.join(","), E = `${g}},${C})`;
|
|
2009
2132
|
let T = e.code.slice(c, f);
|
|
2010
|
-
T = `${n.join("")}${T}`, T =
|
|
2011
|
-
const x = `${m}${S}${T}${
|
|
2133
|
+
T = `${n.join("")}${T}`, T = Tt(T, t);
|
|
2134
|
+
const x = `${m}${S}${T}${E}`;
|
|
2012
2135
|
e.code = x;
|
|
2013
2136
|
}
|
|
2014
|
-
const
|
|
2015
|
-
function
|
|
2016
|
-
const t =
|
|
2137
|
+
const ji = "export default $arcgis.t(";
|
|
2138
|
+
function Et(e) {
|
|
2139
|
+
const t = nn.exec(e.code), i = t?.index ?? e.code.length;
|
|
2017
2140
|
let s = "";
|
|
2018
2141
|
if (t !== null) {
|
|
2019
2142
|
const n = t[1].split(",");
|
|
@@ -2029,63 +2152,63 @@ function St(e) {
|
|
|
2029
2152
|
}
|
|
2030
2153
|
return [i, s];
|
|
2031
2154
|
}
|
|
2032
|
-
const
|
|
2033
|
-
function
|
|
2155
|
+
const rn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, nn = /export\{([^}]+)\};\n$/u, Ie = "@arcgis/core/";
|
|
2156
|
+
function Fi(e, t) {
|
|
2034
2157
|
if (!e.startsWith("./"))
|
|
2035
2158
|
return;
|
|
2036
2159
|
const i = e.slice(2), s = t.get(i);
|
|
2037
2160
|
if (s === void 0)
|
|
2038
2161
|
throw Error(b(D, `Failed to find the ${e} module`));
|
|
2039
|
-
if (s.isAsync === void 0 &&
|
|
2162
|
+
if (s.isAsync === void 0 && Ni(s, t), s.isAsync === void 0)
|
|
2040
2163
|
throw Error(b(D, `Failed to infer whether the ${e} module has top-level await`));
|
|
2041
2164
|
return s;
|
|
2042
2165
|
}
|
|
2043
|
-
function
|
|
2044
|
-
return e.replaceAll(
|
|
2045
|
-
if (s.startsWith(
|
|
2046
|
-
return `$arcgis.t(m=>m[0],"${
|
|
2166
|
+
function Tt(e, t) {
|
|
2167
|
+
return e.replaceAll(on, (i, s) => {
|
|
2168
|
+
if (s.startsWith(Ie))
|
|
2169
|
+
return `$arcgis.t(m=>m[0],"${Di(s.slice(Ie.length))}")`;
|
|
2047
2170
|
if (s.startsWith("./")) {
|
|
2048
|
-
const n =
|
|
2171
|
+
const n = Fi(s, t);
|
|
2049
2172
|
if (n?.isAsync === !0)
|
|
2050
2173
|
return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
|
|
2051
2174
|
}
|
|
2052
2175
|
return i;
|
|
2053
2176
|
});
|
|
2054
2177
|
}
|
|
2055
|
-
const
|
|
2056
|
-
function
|
|
2057
|
-
const t = [
|
|
2178
|
+
const on = /(?<![.\w\d])import\("([^"]+)"\)/gu, Di = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2179
|
+
function an(e) {
|
|
2180
|
+
const t = [Ye];
|
|
2058
2181
|
return () => {
|
|
2059
2182
|
for (; ; ) {
|
|
2060
|
-
const i =
|
|
2061
|
-
if (
|
|
2183
|
+
const i = dn(t);
|
|
2184
|
+
if (pn(t), !e.has(i))
|
|
2062
2185
|
return e.add(i), i;
|
|
2063
2186
|
}
|
|
2064
2187
|
};
|
|
2065
2188
|
}
|
|
2066
|
-
const
|
|
2067
|
-
function
|
|
2068
|
-
let t =
|
|
2189
|
+
const Ye = 0, lt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ri = `${lt}0123456789`, ln = lt.length, cn = Ri.length;
|
|
2190
|
+
function dn(e) {
|
|
2191
|
+
let t = lt[e[0]];
|
|
2069
2192
|
for (let i = 1; i < e.length; ++i)
|
|
2070
|
-
t +=
|
|
2193
|
+
t += Ri[e[i]];
|
|
2071
2194
|
return t;
|
|
2072
2195
|
}
|
|
2073
|
-
function
|
|
2196
|
+
function pn(e) {
|
|
2074
2197
|
let t = e.length - 1;
|
|
2075
2198
|
for (; t >= 0; ) {
|
|
2076
|
-
const i = t === 0 ?
|
|
2199
|
+
const i = t === 0 ? ln : cn;
|
|
2077
2200
|
if (e[t] += 1, e[t] >= i)
|
|
2078
|
-
e[t] =
|
|
2201
|
+
e[t] = Ye, t--;
|
|
2079
2202
|
else
|
|
2080
2203
|
return;
|
|
2081
2204
|
}
|
|
2082
|
-
e.push(
|
|
2205
|
+
e.push(Ye);
|
|
2083
2206
|
}
|
|
2084
|
-
function
|
|
2207
|
+
function Le(e = R(), t = !1) {
|
|
2085
2208
|
const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
2086
2209
|
if (s && i)
|
|
2087
|
-
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${
|
|
2088
|
-
const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r =
|
|
2210
|
+
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ne}/`;
|
|
2211
|
+
const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r = mn(e.name), a = un(e.version);
|
|
2089
2212
|
if (a === void 0)
|
|
2090
2213
|
throw Error(
|
|
2091
2214
|
b(
|
|
@@ -2095,18 +2218,18 @@ function Ae(e = R(), t = !1) {
|
|
|
2095
2218
|
);
|
|
2096
2219
|
return r.length === 0 ? `https://${n}/${a}/` : s ? `https://${n}/${r}/${a}/` : `https://${n}/${a}/${r}/`;
|
|
2097
2220
|
}
|
|
2098
|
-
const
|
|
2099
|
-
function
|
|
2221
|
+
const mn = (e) => e.split("/").pop() ?? e;
|
|
2222
|
+
function un(e) {
|
|
2100
2223
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2101
2224
|
if (i?.groups === void 0)
|
|
2102
2225
|
return;
|
|
2103
2226
|
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
|
|
2104
2227
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2105
2228
|
}
|
|
2106
|
-
async function
|
|
2107
|
-
const r = t.packageName, { hasCss: a, cdnName: c } = await
|
|
2229
|
+
async function fn(e, t, i, s, n) {
|
|
2230
|
+
const r = t.packageName, { hasCss: a, cdnName: c } = await Oi(t.packageLocation) ?? {};
|
|
2108
2231
|
if (i === "cdn") {
|
|
2109
|
-
const m = t.cdnUrl ??
|
|
2232
|
+
const m = t.cdnUrl ?? Le(t.packageJson, n);
|
|
2110
2233
|
return [
|
|
2111
2234
|
...a ? [
|
|
2112
2235
|
{
|
|
@@ -2141,24 +2264,24 @@ async function ln(e, t, i, s, n) {
|
|
|
2141
2264
|
...l,
|
|
2142
2265
|
`import { defineCustomElements as defineCustomElements$${s} } from "${p}";`,
|
|
2143
2266
|
`defineCustomElements$${s}(globalThis.window, {`,
|
|
2144
|
-
` resourcesUrl: "${
|
|
2267
|
+
` resourcesUrl: "${nt(e, t.packageLocation)}/dist/${c}/",`,
|
|
2145
2268
|
"});"
|
|
2146
2269
|
]
|
|
2147
2270
|
}
|
|
2148
2271
|
];
|
|
2149
2272
|
}
|
|
2150
|
-
async function
|
|
2273
|
+
async function Oi(e) {
|
|
2151
2274
|
const t = u.join(e, "dist"), i = u.basename(e), n = (await et(t)).filter(
|
|
2152
|
-
(a) => !
|
|
2275
|
+
(a) => !Ai.has(a) && !a.includes(".")
|
|
2153
2276
|
), r = n.find(
|
|
2154
2277
|
(a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
|
|
2155
2278
|
a === i
|
|
2156
2279
|
);
|
|
2157
2280
|
return r === void 0 ? await Promise.all(
|
|
2158
|
-
n.map(async (a) => await
|
|
2159
|
-
).then((a) => a.find(j)) : await
|
|
2281
|
+
n.map(async (a) => await $t(t, a))
|
|
2282
|
+
).then((a) => a.find(j)) : await $t(t, r);
|
|
2160
2283
|
}
|
|
2161
|
-
async function
|
|
2284
|
+
async function $t(e, t) {
|
|
2162
2285
|
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
|
|
2163
2286
|
K(i),
|
|
2164
2287
|
K(s),
|
|
@@ -2169,17 +2292,17 @@ async function Ct(e, t) {
|
|
|
2169
2292
|
cdnName: t
|
|
2170
2293
|
} : void 0;
|
|
2171
2294
|
}
|
|
2172
|
-
async function
|
|
2173
|
-
const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await
|
|
2295
|
+
async function gn(e, t, i, s, n) {
|
|
2296
|
+
const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await Oi(t.packageLocation) : void 0, c = a?.cdnName ?? ne, d = a === void 0 ? `${Li}.js` : `${a.cdnName}.esm.js`;
|
|
2174
2297
|
if (i === "cdn")
|
|
2175
2298
|
return {
|
|
2176
2299
|
tag: "script",
|
|
2177
2300
|
attrs: {
|
|
2178
2301
|
type: "module",
|
|
2179
|
-
src: `${t.cdnUrl ??
|
|
2302
|
+
src: `${t.cdnUrl ?? Le(t.packageJson, n)}${d}`
|
|
2180
2303
|
}
|
|
2181
2304
|
};
|
|
2182
|
-
const l =
|
|
2305
|
+
const l = hn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${X}`, m = [
|
|
2183
2306
|
`import styles$${s} from "${p}";`,
|
|
2184
2307
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2185
2308
|
], f = `${t.packageName}/loader`;
|
|
@@ -2193,12 +2316,12 @@ async function cn(e, t, i, s, n) {
|
|
|
2193
2316
|
...m,
|
|
2194
2317
|
`import { defineCustomElements as defineCustomElements$${s} } from "${f}";`,
|
|
2195
2318
|
`defineCustomElements$${s}({`,
|
|
2196
|
-
` resourcesUrl: "${
|
|
2319
|
+
` resourcesUrl: "${nt(e, t.packageLocation)}/dist/${c}/",`,
|
|
2197
2320
|
"});"
|
|
2198
2321
|
]
|
|
2199
2322
|
};
|
|
2200
2323
|
}
|
|
2201
|
-
function
|
|
2324
|
+
function hn(e) {
|
|
2202
2325
|
const { exports: t } = e;
|
|
2203
2326
|
if (t === void 0)
|
|
2204
2327
|
throw new Error(
|
|
@@ -2208,21 +2331,21 @@ function dn(e) {
|
|
|
2208
2331
|
return s ? s[0] : i.length > 0 ? i[0][0] : `./${Y}.css`;
|
|
2209
2332
|
}
|
|
2210
2333
|
async function pe(e) {
|
|
2211
|
-
return e._loadersCache ??=
|
|
2334
|
+
return e._loadersCache ??= yn(e), await e._loadersCache;
|
|
2212
2335
|
}
|
|
2213
|
-
async function
|
|
2336
|
+
async function yn(e) {
|
|
2214
2337
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.environment === "development", s = e.viteConfig.base;
|
|
2215
2338
|
let n = 0;
|
|
2216
2339
|
const r = async (l) => (await Promise.all(
|
|
2217
2340
|
l.map(async (p) => {
|
|
2218
2341
|
const m = n++;
|
|
2219
|
-
return p.type === "stencil" ? await
|
|
2342
|
+
return p.type === "stencil" ? await fn(s, p, t, m, i) : p.type === "@arcgis/lumina" ? await gn(s, p, t, m, i) : void 0;
|
|
2220
2343
|
})
|
|
2221
2344
|
)).filter(j).flat(), a = await Promise.all([
|
|
2222
2345
|
// This may contain an import map so must be first
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2346
|
+
Ur(s, t, i),
|
|
2347
|
+
ie.then(r),
|
|
2348
|
+
Mi(e).then(r)
|
|
2226
2349
|
]), c = u.join(e.dir.src, "loader.ts");
|
|
2227
2350
|
return [
|
|
2228
2351
|
...a.flat(),
|
|
@@ -2236,12 +2359,12 @@ async function pn(e) {
|
|
|
2236
2359
|
javascriptCode: [
|
|
2237
2360
|
`import { defineCustomElements } from "${c}";`,
|
|
2238
2361
|
"globalThis.devOnly$ownTagNames = new Set();",
|
|
2239
|
-
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ??
|
|
2362
|
+
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? ne}/"}` : ""});`
|
|
2240
2363
|
]
|
|
2241
2364
|
}
|
|
2242
2365
|
];
|
|
2243
2366
|
}
|
|
2244
|
-
async function
|
|
2367
|
+
async function Mi(e) {
|
|
2245
2368
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
2246
2369
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
2247
2370
|
t.map(async (i) => {
|
|
@@ -2260,8 +2383,8 @@ async function Li(e) {
|
|
|
2260
2383
|
})
|
|
2261
2384
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
2262
2385
|
}
|
|
2263
|
-
const
|
|
2264
|
-
async function
|
|
2386
|
+
const vn = "/C:@arcgis/lumina-compiler/testSetupFile", bn = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, Je = [vn];
|
|
2387
|
+
async function wn(e) {
|
|
2265
2388
|
if (
|
|
2266
2389
|
/**
|
|
2267
2390
|
* Only import custom element dependencies if we are running in Vitest browser mode.
|
|
@@ -2273,7 +2396,7 @@ async function fn(e) {
|
|
|
2273
2396
|
*/
|
|
2274
2397
|
!e.apiJsonEnabled
|
|
2275
2398
|
)
|
|
2276
|
-
return
|
|
2399
|
+
return Pt(e);
|
|
2277
2400
|
const i = (await pe(e)).map((s, n) => {
|
|
2278
2401
|
if ("javascriptCode" in s)
|
|
2279
2402
|
return s.javascriptCode.join(`
|
|
@@ -2297,33 +2420,33 @@ async function fn(e) {
|
|
|
2297
2420
|
}).join(`
|
|
2298
2421
|
|
|
2299
2422
|
`);
|
|
2300
|
-
return [
|
|
2423
|
+
return [Pt(e), i].join("");
|
|
2301
2424
|
}
|
|
2302
|
-
const
|
|
2425
|
+
const Pt = (e) => [e.isInPuppeteerTestBackEnd ? Sn : "", Cn].join(""), Sn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2303
2426
|
setupPuppeteerTest();
|
|
2304
|
-
`,
|
|
2427
|
+
`, Cn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2305
2428
|
setupLuminaTest();
|
|
2306
|
-
`,
|
|
2307
|
-
let
|
|
2308
|
-
function
|
|
2429
|
+
`, En = "@arcgis/lumina:generateLoaderTs";
|
|
2430
|
+
let ke;
|
|
2431
|
+
function Tn(e) {
|
|
2309
2432
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2310
|
-
return [
|
|
2311
|
-
name:
|
|
2433
|
+
return [Ns(e.apiExtractorPluginConfig), {
|
|
2434
|
+
name: En,
|
|
2312
2435
|
configResolved() {
|
|
2313
|
-
|
|
2436
|
+
ke = `${e.dir.root}src/loader.ts`;
|
|
2314
2437
|
},
|
|
2315
2438
|
resolveId: {
|
|
2316
2439
|
filter: {
|
|
2317
2440
|
id: t
|
|
2318
2441
|
},
|
|
2319
|
-
handler: () =>
|
|
2442
|
+
handler: () => ke
|
|
2320
2443
|
},
|
|
2321
2444
|
load: {
|
|
2322
2445
|
filter: {
|
|
2323
2446
|
id: t
|
|
2324
2447
|
},
|
|
2325
2448
|
async handler() {
|
|
2326
|
-
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise,
|
|
2449
|
+
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, vr(e);
|
|
2327
2450
|
}
|
|
2328
2451
|
},
|
|
2329
2452
|
async handleHotUpdate() {
|
|
@@ -2333,133 +2456,27 @@ function vn(e) {
|
|
|
2333
2456
|
name: "@arcgis/lumina:generateTestSetupVirtualFile",
|
|
2334
2457
|
load: {
|
|
2335
2458
|
filter: {
|
|
2336
|
-
id:
|
|
2459
|
+
id: bn
|
|
2337
2460
|
},
|
|
2338
|
-
handler: async () => await
|
|
2461
|
+
handler: async () => await wn(e)
|
|
2339
2462
|
}
|
|
2340
2463
|
}];
|
|
2341
2464
|
}
|
|
2342
|
-
function
|
|
2343
|
-
const t = e.server.moduleGraph.getModuleById(
|
|
2465
|
+
function It(e) {
|
|
2466
|
+
const t = e.server.moduleGraph.getModuleById(ke);
|
|
2344
2467
|
t !== void 0 && e.server.moduleGraph.invalidateModule(t);
|
|
2345
2468
|
}
|
|
2346
|
-
const
|
|
2469
|
+
const kt = (e) => {
|
|
2347
2470
|
e.server.ws.send({
|
|
2348
2471
|
type: "full-reload",
|
|
2349
|
-
path: u.join("/", u.relative(e.dir.root,
|
|
2472
|
+
path: u.join("/", u.relative(e.dir.root, ke))
|
|
2350
2473
|
});
|
|
2351
|
-
}, Ye = "@arcgis/lumina:provideAssets";
|
|
2352
|
-
function ce(e, t, i = at) {
|
|
2353
|
-
if (e.viteCommand !== "serve")
|
|
2354
|
-
throw Error(b(Ye, "serveAssets() is only available when Vite is running in serve mode"));
|
|
2355
|
-
const s = e._serverConfigured, n = e.server.middlewares.stack.length;
|
|
2356
|
-
if (t.forEach((r) => {
|
|
2357
|
-
const a = ji(r), c = Di(e.dir, Fi(a)), d = wn(e.viteConfig.base, c, e.dir.distCdn);
|
|
2358
|
-
e.server.middlewares.use(d, (l, p, m) => {
|
|
2359
|
-
const f = Sn(l.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, h = u.join(c, f), v = i.find((y) => y.match(h, e));
|
|
2360
|
-
return (typeof g == "function" ? Promise.resolve(g()) : z(g)).then((y) => {
|
|
2361
|
-
const S = (typeof g == "function" ? void 0 : v?.transform(y.toString("utf8"), h, e)) ?? y;
|
|
2362
|
-
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", As.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
2363
|
-
}).catch((y) => {
|
|
2364
|
-
(a.type !== "directory" || process.env.DEBUG) && $.warn(
|
|
2365
|
-
Ye,
|
|
2366
|
-
`Error occurred when trying to serve a file in response to request for "${l.originalUrl ?? f}":${String(y)}`
|
|
2367
|
-
), m();
|
|
2368
|
-
}), !0;
|
|
2369
|
-
});
|
|
2370
|
-
}), s) {
|
|
2371
|
-
const r = e.server.middlewares.stack.splice(n);
|
|
2372
|
-
e.server.middlewares.stack.splice(0, 0, ...r);
|
|
2373
|
-
}
|
|
2374
|
-
}
|
|
2375
|
-
async function Ni(e, t, i = at) {
|
|
2376
|
-
await Promise.all(
|
|
2377
|
-
t.map(async (s) => {
|
|
2378
|
-
const n = ji(s), r = Di(e.dir, Fi(n));
|
|
2379
|
-
if (n.type === "directory") {
|
|
2380
|
-
const a = u.resolve(n.source), d = (await et(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
|
|
2381
|
-
const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
|
|
2382
|
-
return [p, f];
|
|
2383
|
-
});
|
|
2384
|
-
await Oi(d.map(([l, p]) => p)), await Ls(
|
|
2385
|
-
d,
|
|
2386
|
-
16,
|
|
2387
|
-
async ([l, p]) => await It(l, p, i, e)
|
|
2388
|
-
);
|
|
2389
|
-
} else if (n.type === "file")
|
|
2390
|
-
await V(u.dirname(r), { recursive: !0 }), await It(n.source, r, i, e);
|
|
2391
|
-
else if (n.type === "dynamic") {
|
|
2392
|
-
await V(u.dirname(r), { recursive: !0 });
|
|
2393
|
-
const a = await Promise.resolve(n.source());
|
|
2394
|
-
await _(r, a);
|
|
2395
|
-
}
|
|
2396
|
-
})
|
|
2397
|
-
);
|
|
2398
|
-
}
|
|
2399
|
-
const ji = Vt ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
2400
|
-
...e,
|
|
2401
|
-
destination: le(e.destination)
|
|
2402
|
-
} : {
|
|
2403
|
-
...e,
|
|
2404
|
-
source: le(e.source),
|
|
2405
|
-
destination: le(e.destination)
|
|
2406
2474
|
};
|
|
2407
|
-
|
|
2408
|
-
const n = i.find((r) => r.match(t, s));
|
|
2409
|
-
if (n === void 0)
|
|
2410
|
-
await Ps(e, t);
|
|
2411
|
-
else {
|
|
2412
|
-
const r = await z(e, "utf8"), a = n.transform(r, t, s);
|
|
2413
|
-
await _(t, a);
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
function Fi(e) {
|
|
2417
|
-
if (e.type === "dynamic")
|
|
2418
|
-
return e.destination;
|
|
2419
|
-
if (e.source.endsWith(u.sep)) {
|
|
2420
|
-
if (e.type === "file")
|
|
2421
|
-
throw Error(
|
|
2422
|
-
b(
|
|
2423
|
-
Ye,
|
|
2424
|
-
`Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${ke(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
|
|
2425
|
-
)
|
|
2426
|
-
);
|
|
2427
|
-
return e.destination;
|
|
2428
|
-
}
|
|
2429
|
-
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
2430
|
-
}
|
|
2431
|
-
function Di({ dist: e, distCdnAssets: t }, i) {
|
|
2432
|
-
const s = bn(i), n = u.join(
|
|
2433
|
-
t,
|
|
2434
|
-
s ? u.relative(t, i) : i
|
|
2435
|
-
), r = u.relative(e, n), a = Ri(r);
|
|
2436
|
-
return u.join(e, a);
|
|
2437
|
-
}
|
|
2438
|
-
function bn(e) {
|
|
2439
|
-
if (e.startsWith(u.sep)) {
|
|
2440
|
-
const t = Gt(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
2441
|
-
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
2442
|
-
} else
|
|
2443
|
-
return !!(!Vt && u.isAbsolute(e));
|
|
2444
|
-
}
|
|
2445
|
-
function wn(e, t, i) {
|
|
2446
|
-
const s = Ri(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
2447
|
-
return `${e}${n}`;
|
|
2448
|
-
}
|
|
2449
|
-
const Ri = (e) => e.replaceAll("../", ""), Sn = (e = "") => e.split("?")[0].split("#")[0];
|
|
2450
|
-
async function Oi(e) {
|
|
2451
|
-
const t = new Set(e.map(u.dirname));
|
|
2452
|
-
await Promise.all(Array.from(t, async (i) => await V(i, { recursive: !0 })));
|
|
2453
|
-
}
|
|
2454
|
-
const En = {
|
|
2455
|
-
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
2456
|
-
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
2457
|
-
}, at = [En];
|
|
2458
|
-
function Cn(e) {
|
|
2475
|
+
function $n(e) {
|
|
2459
2476
|
let t;
|
|
2460
2477
|
const i = () => [
|
|
2461
2478
|
...e.options.assets?.transformers ?? [],
|
|
2462
|
-
...
|
|
2479
|
+
...ot
|
|
2463
2480
|
];
|
|
2464
2481
|
return {
|
|
2465
2482
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
@@ -2478,60 +2495,60 @@ function Cn(e) {
|
|
|
2478
2495
|
* `configureServer`.
|
|
2479
2496
|
*/
|
|
2480
2497
|
configResolved() {
|
|
2481
|
-
e.viteCommand === "serve" && (t =
|
|
2498
|
+
e.viteCommand === "serve" && (t = xt(e));
|
|
2482
2499
|
},
|
|
2483
2500
|
options() {
|
|
2484
|
-
e.viteCommand === "build" && (t =
|
|
2501
|
+
e.viteCommand === "build" && (t = xt(e));
|
|
2485
2502
|
},
|
|
2486
2503
|
async configureServer(s) {
|
|
2487
|
-
e.server = s,
|
|
2504
|
+
e.server = s, Z(e, await t, i()), s.watcher.on("addDir", (n) => {
|
|
2488
2505
|
if (n.endsWith("assets")) {
|
|
2489
2506
|
const r = u.dirname(n);
|
|
2490
|
-
u.join(r, "/") === e.dir.root ?
|
|
2507
|
+
u.join(r, "/") === e.dir.root ? Z(e, [Bi], i()) : n.startsWith(e.dir.srcComponents) && Z(e, [Ji(n, r)], i());
|
|
2491
2508
|
}
|
|
2492
2509
|
});
|
|
2493
2510
|
},
|
|
2494
2511
|
async writeBundle() {
|
|
2495
|
-
await
|
|
2512
|
+
await Ci(e, await t, i());
|
|
2496
2513
|
}
|
|
2497
2514
|
};
|
|
2498
2515
|
}
|
|
2499
|
-
async function
|
|
2516
|
+
async function xt(e) {
|
|
2500
2517
|
const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2501
2518
|
i.map(async (n) => {
|
|
2502
2519
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
2503
|
-
return await K(a) ?
|
|
2520
|
+
return await K(a) ? Ji(a, r) : void 0;
|
|
2504
2521
|
})
|
|
2505
2522
|
);
|
|
2506
|
-
return await t && s.push(
|
|
2523
|
+
return await t && s.push(Bi), s.filter(j);
|
|
2507
2524
|
}
|
|
2508
|
-
const
|
|
2525
|
+
const Ji = (e, t) => ({
|
|
2509
2526
|
type: "directory",
|
|
2510
2527
|
source: e,
|
|
2511
2528
|
destination: u.basename(t)
|
|
2512
|
-
}),
|
|
2513
|
-
name:
|
|
2529
|
+
}), Bi = { type: "directory", source: "assets/", destination: "" }, Be = "@arcgis/lumina:printTotalBuildSize", Pn = (e) => ({
|
|
2530
|
+
name: Be,
|
|
2514
2531
|
apply: () => e.viteCommand === "build",
|
|
2515
2532
|
configResolved(t) {
|
|
2516
2533
|
const i = t.plugins.find(({ name: n }) => n === "vite:reporter");
|
|
2517
2534
|
if (i === void 0) {
|
|
2518
2535
|
if ("rolldownVersion" in this.meta)
|
|
2519
2536
|
return;
|
|
2520
|
-
$.warn(
|
|
2537
|
+
$.warn(Be, "Unable to find the vite's built-in vite:reporter plugin");
|
|
2521
2538
|
return;
|
|
2522
2539
|
}
|
|
2523
2540
|
const s = i.writeBundle;
|
|
2524
2541
|
if (typeof s != "function")
|
|
2525
|
-
throw Error(b(
|
|
2542
|
+
throw Error(b(Be, "Expected vite:reporter to declare a writeBundle() function"));
|
|
2526
2543
|
i.writeBundle = async function(r, a) {
|
|
2527
2544
|
let c = 0, d = 0, l = 0, p = 0;
|
|
2528
2545
|
const m = console.log;
|
|
2529
2546
|
console.log = function(...g) {
|
|
2530
2547
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2531
|
-
const [h, v] = g[0].match(
|
|
2548
|
+
const [h, v] = g[0].match(kn) ?? [];
|
|
2532
2549
|
if (!h)
|
|
2533
2550
|
return;
|
|
2534
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2551
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(xn, "").length);
|
|
2535
2552
|
const y = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2536
2553
|
v ? (l += Number.parseFloat(v.replace(" kB", "").replaceAll(",", "")), d += y) : c += y;
|
|
2537
2554
|
}
|
|
@@ -2542,27 +2559,27 @@ const Mi = (e, t) => ({
|
|
|
2542
2559
|
console.log = m;
|
|
2543
2560
|
}
|
|
2544
2561
|
if (d > 0) {
|
|
2545
|
-
const g = l > 0 ? d : c, h =
|
|
2562
|
+
const g = l > 0 ? d : c, h = Nt(g), v = e.dir.relativeDist;
|
|
2546
2563
|
console.log(
|
|
2547
2564
|
[
|
|
2548
|
-
|
|
2565
|
+
Lt,
|
|
2549
2566
|
v,
|
|
2550
|
-
|
|
2567
|
+
In,
|
|
2551
2568
|
"*",
|
|
2552
2569
|
" ".repeat(p - `${v}*`.length - h.length),
|
|
2553
2570
|
h,
|
|
2554
|
-
|
|
2555
|
-
l > 0 ? ` ${
|
|
2571
|
+
At,
|
|
2572
|
+
l > 0 ? ` ${Lt}│ gzip: ${Nt(l)}${At}` : ""
|
|
2556
2573
|
].join("")
|
|
2557
2574
|
);
|
|
2558
2575
|
}
|
|
2559
2576
|
};
|
|
2560
2577
|
}
|
|
2561
|
-
}),
|
|
2578
|
+
}), At = "\x1B[22m\x1B[1m\x1B[22m", Lt = "\x1B[2m", In = "\x1B[22m\x1B[36m", kn = /\d+(?:,\d+)?\.\d{2} kB/gu, xn = /\x1B\[\d+m/gu, An = new Intl.NumberFormat("en", {
|
|
2562
2579
|
maximumFractionDigits: 2,
|
|
2563
2580
|
minimumFractionDigits: 2
|
|
2564
|
-
}),
|
|
2565
|
-
name:
|
|
2581
|
+
}), Nt = (e) => `${An.format(e)} kB`, Ln = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", at.slice(0, -3))), jt = "@arcgis/lumina:configureVite", Nn = (e) => ({
|
|
2582
|
+
name: jt,
|
|
2566
2583
|
async config({
|
|
2567
2584
|
server: t,
|
|
2568
2585
|
publicDir: i,
|
|
@@ -2577,7 +2594,7 @@ const Mi = (e, t) => ({
|
|
|
2577
2594
|
* the CDN build
|
|
2578
2595
|
*/
|
|
2579
2596
|
loader: "src/loader.ts"
|
|
2580
|
-
}, { loader: S, ...
|
|
2597
|
+
}, { loader: S, ...C } = y, E = e.environment === "development" || e.isInTest ? {
|
|
2581
2598
|
"process.env.ESRI_INTERNAL": "true"
|
|
2582
2599
|
} : void 0, T = !import.meta.url.includes("node_modules"), x = {
|
|
2583
2600
|
/**
|
|
@@ -2592,7 +2609,7 @@ const Mi = (e, t) => ({
|
|
|
2592
2609
|
* is not visible to dep-optimizer's ESBuild instance.
|
|
2593
2610
|
*/
|
|
2594
2611
|
entries: [
|
|
2595
|
-
...Object.values(
|
|
2612
|
+
...Object.values(C),
|
|
2596
2613
|
...await e.componentFilesPromise,
|
|
2597
2614
|
// Vitest scans setup files, but misses Lumina's because we add it
|
|
2598
2615
|
// dynamically. Include it because it imports js-beautify. Can't
|
|
@@ -2623,7 +2640,7 @@ const Mi = (e, t) => ({
|
|
|
2623
2640
|
include: [
|
|
2624
2641
|
// Used by controllers. Need to add manually because @arcgis/lumina is
|
|
2625
2642
|
// excluded per comment below, so Vite will discover these usages too late.
|
|
2626
|
-
...
|
|
2643
|
+
...ue ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
|
|
2627
2644
|
],
|
|
2628
2645
|
/**
|
|
2629
2646
|
* Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
|
|
@@ -2670,10 +2687,10 @@ const Mi = (e, t) => ({
|
|
|
2670
2687
|
"@lit/context"
|
|
2671
2688
|
]
|
|
2672
2689
|
};
|
|
2673
|
-
if (typeof p.setupFiles == "string" ? p.setupFiles = [...
|
|
2690
|
+
if (typeof p.setupFiles == "string" ? p.setupFiles = [...Je, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...Je, ...p.setupFiles] : p.setupFiles = [...Je], e.isInPuppeteerTestBackEnd) {
|
|
2674
2691
|
if (g?.enabled === !0)
|
|
2675
2692
|
throw Error(
|
|
2676
|
-
b(
|
|
2693
|
+
b(jt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2677
2694
|
);
|
|
2678
2695
|
return {
|
|
2679
2696
|
test: {
|
|
@@ -2696,7 +2713,7 @@ const Mi = (e, t) => ({
|
|
|
2696
2713
|
forceRerunTriggers: v === void 0 ? ["**/*.{ts,tsx}"] : void 0
|
|
2697
2714
|
},
|
|
2698
2715
|
optimizeDeps: x,
|
|
2699
|
-
define:
|
|
2716
|
+
define: E
|
|
2700
2717
|
};
|
|
2701
2718
|
}
|
|
2702
2719
|
return {
|
|
@@ -2740,7 +2757,7 @@ const Mi = (e, t) => ({
|
|
|
2740
2757
|
emptyOutDir: l ?? !m
|
|
2741
2758
|
},
|
|
2742
2759
|
optimizeDeps: x,
|
|
2743
|
-
define:
|
|
2760
|
+
define: E,
|
|
2744
2761
|
test: {
|
|
2745
2762
|
/*
|
|
2746
2763
|
* If in browser, run all test files that include *.e2e.* in the name.
|
|
@@ -2772,22 +2789,22 @@ const Mi = (e, t) => ({
|
|
|
2772
2789
|
e._originalRollupInputOptions ??= t.input;
|
|
2773
2790
|
const s = { ...e._originalRollupInputOptions };
|
|
2774
2791
|
i.forEach((n) => {
|
|
2775
|
-
const r =
|
|
2792
|
+
const r = Ln(n);
|
|
2776
2793
|
s[r] = n;
|
|
2777
2794
|
}), t.input = s;
|
|
2778
2795
|
}
|
|
2779
|
-
}),
|
|
2796
|
+
}), jn = (e) => ({
|
|
2780
2797
|
name: "@arcgis/lumina:setAssetPath",
|
|
2781
2798
|
apply: () => e.viteCommand === "build",
|
|
2782
2799
|
config: (t) => ({
|
|
2783
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
2800
|
+
base: t.base ?? e.options.assets?.defaultPath ?? Le()
|
|
2784
2801
|
})
|
|
2785
2802
|
});
|
|
2786
|
-
function
|
|
2803
|
+
function Fn(e = R()) {
|
|
2787
2804
|
const t = e.version ?? "0.0.1";
|
|
2788
|
-
return
|
|
2805
|
+
return ds(t);
|
|
2789
2806
|
}
|
|
2790
|
-
const
|
|
2807
|
+
const Dn = (e) => `/* ${e} */`, I = (e) => (t, i) => {
|
|
2791
2808
|
Object.defineProperty(t, i, {
|
|
2792
2809
|
get() {
|
|
2793
2810
|
throw Error(
|
|
@@ -2809,7 +2826,7 @@ const jn = (e) => `/* ${e} */`, I = (e) => (t, i) => {
|
|
|
2809
2826
|
enumerable: !0
|
|
2810
2827
|
});
|
|
2811
2828
|
};
|
|
2812
|
-
function
|
|
2829
|
+
function ae(e) {
|
|
2813
2830
|
if (u.isAbsolute(e))
|
|
2814
2831
|
throw Error(
|
|
2815
2832
|
b(
|
|
@@ -2817,17 +2834,17 @@ function oe(e) {
|
|
|
2817
2834
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
2818
2835
|
)
|
|
2819
2836
|
);
|
|
2820
|
-
return
|
|
2837
|
+
return ce(e);
|
|
2821
2838
|
}
|
|
2822
|
-
const
|
|
2839
|
+
const le = {
|
|
2823
2840
|
vsCodeHtml: "docs/vscode.html-custom-data.json",
|
|
2824
2841
|
vsCodeCss: "docs/vscode.css-custom-data.json",
|
|
2825
2842
|
webTypes: "docs/web-types.json",
|
|
2826
2843
|
apiJson: "docs/api.json",
|
|
2827
2844
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2828
2845
|
}, Qe = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2829
|
-
async function
|
|
2830
|
-
const s =
|
|
2846
|
+
async function Ki(e, t, i = R()) {
|
|
2847
|
+
const s = Rn(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await z(n, "utf8") : "";
|
|
2831
2848
|
if (a.trim().replaceAll(`\r
|
|
2832
2849
|
`, `
|
|
2833
2850
|
`) === s.trim())
|
|
@@ -2847,7 +2864,7 @@ ${a}`
|
|
|
2847
2864
|
);
|
|
2848
2865
|
return Qt(n, s), !0;
|
|
2849
2866
|
}
|
|
2850
|
-
function
|
|
2867
|
+
function Rn(e, t = R()) {
|
|
2851
2868
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
2852
2869
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
2853
2870
|
(d, l) => `
|
|
@@ -2858,7 +2875,7 @@ declare module "@arcgis/lumina" {
|
|
|
2858
2875
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
2859
2876
|
}`, a = t.devDependencies ?? {};
|
|
2860
2877
|
return [
|
|
2861
|
-
|
|
2878
|
+
On,
|
|
2862
2879
|
a.vitest ? `
|
|
2863
2880
|
/// <reference types="vitest/config" />
|
|
2864
2881
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -2869,7 +2886,7 @@ declare module "@arcgis/lumina" {
|
|
|
2869
2886
|
`
|
|
2870
2887
|
].join("");
|
|
2871
2888
|
}
|
|
2872
|
-
const
|
|
2889
|
+
const On = `/**
|
|
2873
2890
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
2874
2891
|
* Manual edits will be overwritten.
|
|
2875
2892
|
*
|
|
@@ -2877,7 +2894,7 @@ const Dn = `/**
|
|
|
2877
2894
|
*
|
|
2878
2895
|
* If you need to provide additional types, create a separate file.
|
|
2879
2896
|
*/
|
|
2880
|
-
/// <reference types="@arcgis/lumina/globalTypes" />`,
|
|
2897
|
+
/// <reference types="@arcgis/lumina/globalTypes" />`, be = "@arcgis/lumina:dependencySupport", _i = (e, t) => e.viteCommand === "serve" && /**
|
|
2881
2898
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
2882
2899
|
* However, it is a bit buggy (see
|
|
2883
2900
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -2888,18 +2905,21 @@ const Dn = `/**
|
|
|
2888
2905
|
* is doing:
|
|
2889
2906
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
2890
2907
|
*/
|
|
2891
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
2892
|
-
name:
|
|
2908
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Mn = (e) => ({
|
|
2909
|
+
name: be,
|
|
2910
|
+
async configureServer(t) {
|
|
2911
|
+
ue && (e.server = t, await zr(e));
|
|
2912
|
+
},
|
|
2893
2913
|
configResolved() {
|
|
2894
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
2895
|
-
(t) => $.error(
|
|
2914
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Jn(e).catch(
|
|
2915
|
+
(t) => $.error(be, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
2896
2916
|
));
|
|
2897
2917
|
},
|
|
2898
2918
|
transformIndexHtml: {
|
|
2899
2919
|
// Add imports to index.html before Vite starts resolving imports
|
|
2900
2920
|
order: "pre",
|
|
2901
2921
|
async handler(t, i) {
|
|
2902
|
-
return
|
|
2922
|
+
return _i(e, i) ? (await pe(e)).map(
|
|
2903
2923
|
(n) => "javascriptCode" in n ? {
|
|
2904
2924
|
tag: "script",
|
|
2905
2925
|
attrs: {
|
|
@@ -2931,7 +2951,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
2931
2951
|
return s.optimizableImports;
|
|
2932
2952
|
if ("cssHref" in s)
|
|
2933
2953
|
return [];
|
|
2934
|
-
throw Error(b(
|
|
2954
|
+
throw Error(b(be, `Unexpected loader type: ${JSON.stringify(s)}`));
|
|
2935
2955
|
});
|
|
2936
2956
|
e.viteConfig.optimizeDeps.include ??= [];
|
|
2937
2957
|
for (const s of i)
|
|
@@ -2941,34 +2961,34 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
2941
2961
|
await e._updateLuminaTsPromise;
|
|
2942
2962
|
}
|
|
2943
2963
|
});
|
|
2944
|
-
async function
|
|
2945
|
-
const i = (await Promise.all([
|
|
2946
|
-
if (!await
|
|
2964
|
+
async function Jn(e) {
|
|
2965
|
+
const i = (await Promise.all([ie, Mi(e)])).flat();
|
|
2966
|
+
if (!await Ki(i, e.dir.src))
|
|
2947
2967
|
return;
|
|
2948
2968
|
let n = !1;
|
|
2949
2969
|
function r() {
|
|
2950
|
-
n || $.warn(
|
|
2970
|
+
n || $.warn(be, Bn), n = !0;
|
|
2951
2971
|
}
|
|
2952
2972
|
process.on("exit", () => {
|
|
2953
2973
|
r(), clearTimeout(c);
|
|
2954
2974
|
});
|
|
2955
2975
|
const c = setTimeout(r, 2e3);
|
|
2956
2976
|
}
|
|
2957
|
-
const
|
|
2977
|
+
const Bn = js(
|
|
2958
2978
|
"greenBright",
|
|
2959
2979
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
2960
2980
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
2961
2981
|
);
|
|
2962
|
-
async function
|
|
2963
|
-
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await
|
|
2964
|
-
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ?
|
|
2982
|
+
async function Kn(e) {
|
|
2983
|
+
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Ds(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
2984
|
+
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? ae(e.options.documentation.apiJsonFileName) : le.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
2965
2985
|
{
|
|
2966
2986
|
type: "dynamic",
|
|
2967
2987
|
source: () => JSON.stringify(e.apiJson, null, Qe(e)),
|
|
2968
2988
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
2969
2989
|
}
|
|
2970
2990
|
]);
|
|
2971
|
-
const s = i?.types?.typeScriptConfig ??
|
|
2991
|
+
const s = i?.types?.typeScriptConfig ?? Rs(
|
|
2972
2992
|
process.cwd(),
|
|
2973
2993
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
2974
2994
|
!0
|
|
@@ -3012,12 +3032,12 @@ async function Jn(e) {
|
|
|
3012
3032
|
if (e.apiJsonDeferred.resolve(), e.apiJsonDeferred = void 0, p !== void 0) {
|
|
3013
3033
|
if (e.viteCommand === "serve")
|
|
3014
3034
|
if ([...p.addedModules, ...p.removedModules].some(
|
|
3015
|
-
(f) =>
|
|
3035
|
+
(f) => Ce(f.sourcePath, "src/components/")
|
|
3016
3036
|
))
|
|
3017
|
-
|
|
3037
|
+
It(e), kt(e);
|
|
3018
3038
|
else {
|
|
3019
3039
|
for (const f of p.changedModules) {
|
|
3020
|
-
if (!
|
|
3040
|
+
if (!Ce(f.new.sourcePath, "src/components/"))
|
|
3021
3041
|
continue;
|
|
3022
3042
|
const g = f.old.declarations.find(
|
|
3023
3043
|
(y) => y.customElement === !0
|
|
@@ -3027,29 +3047,29 @@ async function Jn(e) {
|
|
|
3027
3047
|
if (g === void 0 && h === void 0)
|
|
3028
3048
|
continue;
|
|
3029
3049
|
if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName || g.formAssociated !== h.formAssociated) {
|
|
3030
|
-
|
|
3050
|
+
kt(e);
|
|
3031
3051
|
break;
|
|
3032
3052
|
}
|
|
3033
3053
|
const v = gi(h);
|
|
3034
3054
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: v });
|
|
3035
3055
|
}
|
|
3036
|
-
|
|
3056
|
+
It(e);
|
|
3037
3057
|
}
|
|
3038
|
-
|
|
3058
|
+
Ft(e, p.apiJson);
|
|
3039
3059
|
}
|
|
3040
3060
|
}
|
|
3041
3061
|
},
|
|
3042
3062
|
afterApiJsonCreate: (l) => {
|
|
3043
|
-
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(),
|
|
3063
|
+
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), Ft(e, l.apiJson));
|
|
3044
3064
|
}
|
|
3045
|
-
}, c = i === void 0 ? a :
|
|
3065
|
+
}, c = i === void 0 ? a : vt(i, a);
|
|
3046
3066
|
e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
|
|
3047
3067
|
const d = e.apiExtractorPluginConfig.afterExtractorCreated;
|
|
3048
3068
|
e.apiExtractorPluginConfig.afterExtractorCreated = (l) => {
|
|
3049
3069
|
e.apiExtractor = l, d?.(l);
|
|
3050
3070
|
};
|
|
3051
3071
|
}
|
|
3052
|
-
function
|
|
3072
|
+
function Ft(e, t) {
|
|
3053
3073
|
const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
|
|
3054
3074
|
for (const r of t.modules) {
|
|
3055
3075
|
const a = { ...r, declarations: [] };
|
|
@@ -3074,10 +3094,10 @@ function jt(e, t) {
|
|
|
3074
3094
|
}
|
|
3075
3095
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3076
3096
|
}
|
|
3077
|
-
var
|
|
3097
|
+
var _n = Object.defineProperty, k = (e, t, i, s) => {
|
|
3078
3098
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3079
3099
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3080
|
-
return n &&
|
|
3100
|
+
return n && _n(t, i, n), n;
|
|
3081
3101
|
};
|
|
3082
3102
|
const q = "@arcgis/lumina:context";
|
|
3083
3103
|
class P {
|
|
@@ -3093,7 +3113,7 @@ class P {
|
|
|
3093
3113
|
this.viteConfig = r;
|
|
3094
3114
|
const a = r.build.minify !== !1;
|
|
3095
3115
|
this.shouldMinify = a && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
3096
|
-
const c = u.join(r.root, u.sep), d = u.join(c, "src", u.sep), l = u.join(d, "components", u.sep), p = u.join(u.resolve(c, r.build.outDir), u.sep), m = u.join(u.relative(c, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ??
|
|
3116
|
+
const c = u.join(r.root, u.sep), d = u.join(c, "src", u.sep), l = u.join(d, "components", u.sep), p = u.join(u.resolve(c, r.build.outDir), u.sep), m = u.join(u.relative(c, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? ne, u.sep), h = u.join(g, "assets", u.sep);
|
|
3097
3117
|
if (this.dir = {
|
|
3098
3118
|
root: c,
|
|
3099
3119
|
src: d,
|
|
@@ -3103,7 +3123,7 @@ class P {
|
|
|
3103
3123
|
distComponents: f,
|
|
3104
3124
|
distCdn: g,
|
|
3105
3125
|
distCdnAssets: h
|
|
3106
|
-
}, $.initialize(r.logger, c), r.root !==
|
|
3126
|
+
}, $.initialize(r.logger, c), r.root !== Xt())
|
|
3107
3127
|
throw Error(
|
|
3108
3128
|
b(
|
|
3109
3129
|
q,
|
|
@@ -3121,12 +3141,12 @@ class P {
|
|
|
3121
3141
|
this.apiJsonEnabled = !v && !this.isInPuppeteerTestBackEnd && !y && !S, this.apiJsonEnabled ? (this.apiExtractorPluginConfig.serve = {
|
|
3122
3142
|
extract: !0
|
|
3123
3143
|
}, (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);
|
|
3124
|
-
const
|
|
3125
|
-
|
|
3144
|
+
const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3145
|
+
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
|
|
3126
3146
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3127
3147
|
target: o.ScriptTarget.ESNext,
|
|
3128
3148
|
sourceMap: r.build.sourcemap !== !1
|
|
3129
|
-
}),
|
|
3149
|
+
}), _i(this) && pe(this);
|
|
3130
3150
|
}
|
|
3131
3151
|
},
|
|
3132
3152
|
configureServer: {
|
|
@@ -3150,22 +3170,22 @@ class P {
|
|
|
3150
3170
|
this._documentationFileNames = {
|
|
3151
3171
|
// Will be set once api-extractor.config.ts is loaded
|
|
3152
3172
|
apiJson: void 0,
|
|
3153
|
-
stencilLikeDocsJson: i.stencilLikeDocsJsonFileName === !1 ? void 0 : i.stencilLikeDocsJsonFileName ?
|
|
3154
|
-
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ?
|
|
3155
|
-
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ?
|
|
3156
|
-
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ?
|
|
3157
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3173
|
+
stencilLikeDocsJson: i.stencilLikeDocsJsonFileName === !1 ? void 0 : i.stencilLikeDocsJsonFileName ? ae(i.stencilLikeDocsJsonFileName) : le.stencilLikeDocsJson,
|
|
3174
|
+
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? ae(i.jetBrains.webTypesFileName) : le.webTypes,
|
|
3175
|
+
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? ae(i.vsCode.htmlFileName) : le.vsCodeHtml,
|
|
3176
|
+
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? ae(i.vsCode.cssFileName) : le.vsCodeCss
|
|
3177
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Kn(this);
|
|
3158
3178
|
const s = process.cwd().length + 1;
|
|
3159
3179
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3160
3180
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
3161
3181
|
for (let c = 0; c < r.length; ++c) {
|
|
3162
3182
|
const l = r[c].slice(s);
|
|
3163
|
-
|
|
3183
|
+
Ce(l, "src/components") && a.push(l);
|
|
3164
3184
|
}
|
|
3165
3185
|
return a;
|
|
3166
3186
|
}), yi(void 0, t);
|
|
3167
|
-
const n = t.build?.preamble ??
|
|
3168
|
-
this.banner =
|
|
3187
|
+
const n = t.build?.preamble ?? Fn();
|
|
3188
|
+
this.banner = Dn(n);
|
|
3169
3189
|
}
|
|
3170
3190
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3171
3191
|
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : ($.warn(hi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -3240,7 +3260,7 @@ class P {
|
|
|
3240
3260
|
if (Array.isArray(this.assetsToProvide))
|
|
3241
3261
|
this.assetsToProvide.push({ assets: t, transformers: i, apply: s });
|
|
3242
3262
|
else if (this.viteCommand === "serve")
|
|
3243
|
-
s === "serve" &&
|
|
3263
|
+
s === "serve" && Z(this, t, i);
|
|
3244
3264
|
else
|
|
3245
3265
|
throw Error(
|
|
3246
3266
|
b(
|
|
@@ -3316,12 +3336,12 @@ k([
|
|
|
3316
3336
|
k([
|
|
3317
3337
|
I("configResolved()")
|
|
3318
3338
|
], P.prototype, "_typeScriptPrinter");
|
|
3319
|
-
function
|
|
3320
|
-
const s = vi()[t] ??
|
|
3339
|
+
function Un(e, t, i) {
|
|
3340
|
+
const s = vi()[t] ?? Ui(e)[t];
|
|
3321
3341
|
if (s === void 0) {
|
|
3322
3342
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3323
3343
|
return;
|
|
3324
|
-
const n =
|
|
3344
|
+
const n = Ae(i);
|
|
3325
3345
|
throw Error(
|
|
3326
3346
|
b(
|
|
3327
3347
|
"@arcgis/lumina:resolveTagName",
|
|
@@ -3331,10 +3351,10 @@ function Kn(e, t, i) {
|
|
|
3331
3351
|
}
|
|
3332
3352
|
return s;
|
|
3333
3353
|
}
|
|
3334
|
-
function
|
|
3335
|
-
return e.packageName === void 0 ?
|
|
3354
|
+
function Wn(e, t) {
|
|
3355
|
+
return e.packageName === void 0 ? fe(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3336
3356
|
}
|
|
3337
|
-
function
|
|
3357
|
+
function Ui(e) {
|
|
3338
3358
|
return e._localDefinedComponents ??= wi(
|
|
3339
3359
|
e.privateApiJson,
|
|
3340
3360
|
{
|
|
@@ -3346,22 +3366,22 @@ function _i(e) {
|
|
|
3346
3366
|
e.viteCommand === "build"
|
|
3347
3367
|
), e._localDefinedComponents;
|
|
3348
3368
|
}
|
|
3349
|
-
const
|
|
3350
|
-
name:
|
|
3369
|
+
const Dt = "makeRuntime(", zn = "@arcgis/core", Hn = "@arcgis/lumina:injectRuntimeOptions", qn = (e) => ({
|
|
3370
|
+
name: Hn,
|
|
3351
3371
|
transform: {
|
|
3352
3372
|
filter: {
|
|
3353
3373
|
id: /\/src\/runtime\.ts$/u
|
|
3354
3374
|
},
|
|
3355
3375
|
handler(t, i) {
|
|
3356
|
-
const s = t.indexOf(
|
|
3376
|
+
const s = t.indexOf(Dt);
|
|
3357
3377
|
if (s === -1)
|
|
3358
3378
|
throw new Error(
|
|
3359
3379
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3360
3380
|
);
|
|
3361
|
-
const n = s +
|
|
3381
|
+
const n = s + Dt.length, r = e.options.css?.commonStylesPath;
|
|
3362
3382
|
return {
|
|
3363
3383
|
code: [
|
|
3364
|
-
r === void 0 ? "" : `import commonStyles from "${
|
|
3384
|
+
r === void 0 ? "" : `import commonStyles from "${fe(e.dir.src, r)}${Te}";`,
|
|
3365
3385
|
t.slice(0, n),
|
|
3366
3386
|
"{",
|
|
3367
3387
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
@@ -3373,8 +3393,8 @@ const Ft = "makeRuntime(", Un = "@arcgis/core", Wn = "@arcgis/lumina:injectRunti
|
|
|
3373
3393
|
t.slice(n),
|
|
3374
3394
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3375
3395
|
// a cyclical dependency.
|
|
3376
|
-
|
|
3377
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3396
|
+
ue ? `
|
|
3397
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${zn}/applications/Components/reactiveUtils.js";
|
|
3378
3398
|
createObservable,
|
|
3379
3399
|
runtime.t = trackAccess;
|
|
3380
3400
|
runtime.o = createObservable;
|
|
@@ -3386,44 +3406,44 @@ runtime.r = runTracked;` : ""
|
|
|
3386
3406
|
}
|
|
3387
3407
|
}
|
|
3388
3408
|
});
|
|
3389
|
-
function
|
|
3390
|
-
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${
|
|
3409
|
+
function Vn(e) {
|
|
3410
|
+
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3391
3411
|
`;
|
|
3392
3412
|
}
|
|
3393
|
-
const
|
|
3394
|
-
name:
|
|
3413
|
+
const ve = "@arcgis/lumina:addNonLazyImports", Gn = (e) => ({
|
|
3414
|
+
name: ve,
|
|
3395
3415
|
apply: () => e.viteCommand === "build",
|
|
3396
3416
|
generateBundle(t, i) {
|
|
3397
3417
|
const n = e.viteConfig.build.sourcemap !== !1 ? " " : `
|
|
3398
3418
|
`;
|
|
3399
3419
|
let r = !1;
|
|
3400
3420
|
if (Object.entries(i).forEach(([a, c]) => {
|
|
3401
|
-
const d =
|
|
3421
|
+
const d = We(a, e.apiExtractor);
|
|
3402
3422
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3403
3423
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3404
3424
|
let m = c.code;
|
|
3405
|
-
m =
|
|
3425
|
+
m = Xr(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = Vn(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
|
|
3406
3426
|
}
|
|
3407
3427
|
}), !r && !e.isInStorybook)
|
|
3408
|
-
throw Error(b(
|
|
3428
|
+
throw Error(b(ve, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
3409
3429
|
},
|
|
3410
3430
|
async writeBundle() {
|
|
3411
3431
|
if (e.isInStorybook)
|
|
3412
3432
|
return;
|
|
3413
3433
|
const t = e._customElementDependencies, i = Object.entries(t), s = new Set(
|
|
3414
|
-
i.map(([r]) => r).filter((r) =>
|
|
3434
|
+
i.map(([r]) => r).filter((r) => Ce(r, e.dir.srcComponents))
|
|
3415
3435
|
);
|
|
3416
3436
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
3417
3437
|
if (s.has(r) || a.length === 0 && c.length === 0)
|
|
3418
3438
|
return;
|
|
3419
|
-
const l =
|
|
3439
|
+
const l = Wi(t, d, s);
|
|
3420
3440
|
if (l.forEach((p) => {
|
|
3421
3441
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
3422
3442
|
}), (a.length > 0 || c.length > 0) && l.length === 0) {
|
|
3423
|
-
const p =
|
|
3443
|
+
const p = Ae(r);
|
|
3424
3444
|
throw Error(
|
|
3425
3445
|
b(
|
|
3426
|
-
|
|
3446
|
+
ve,
|
|
3427
3447
|
`Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...c].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.
|
|
3428
3448
|
|
|
3429
3449
|
Possible causes:
|
|
@@ -3437,14 +3457,14 @@ Possible causes:
|
|
|
3437
3457
|
const n = i.flatMap(async ([r, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
|
|
3438
3458
|
if (!s.has(r))
|
|
3439
3459
|
return [];
|
|
3440
|
-
const d = u.dirname(r), l = e.dir.src +
|
|
3460
|
+
const d = u.dirname(r), l = e.dir.src + We(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
|
|
3441
3461
|
function m(T) {
|
|
3442
|
-
const x =
|
|
3462
|
+
const x = Un(e, T, r);
|
|
3443
3463
|
if (x === void 0)
|
|
3444
3464
|
return;
|
|
3445
|
-
const w =
|
|
3465
|
+
const w = Wn(x, p);
|
|
3446
3466
|
if (w !== `./${p}`)
|
|
3447
|
-
return w.startsWith(".") ? `${w}/${
|
|
3467
|
+
return w.startsWith(".") ? `${w}/${Rt}` : w;
|
|
3448
3468
|
}
|
|
3449
3469
|
const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(j), v = (T) => `import "${T}";
|
|
3450
3470
|
`, y = h.map(v).join(""), S = Array.from(g, (T) => {
|
|
@@ -3452,7 +3472,7 @@ Possible causes:
|
|
|
3452
3472
|
if (x !== void 0) {
|
|
3453
3473
|
if (f.has(T)) {
|
|
3454
3474
|
$.warn(
|
|
3455
|
-
|
|
3475
|
+
ve,
|
|
3456
3476
|
`"${T}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
|
|
3457
3477
|
);
|
|
3458
3478
|
return;
|
|
@@ -3460,15 +3480,15 @@ Possible causes:
|
|
|
3460
3480
|
return `.set("${T}", () => import("${x}"))
|
|
3461
3481
|
`;
|
|
3462
3482
|
}
|
|
3463
|
-
}).filter(j),
|
|
3464
|
-
${
|
|
3465
|
-
deferredLoaders${S.join("")};` :
|
|
3466
|
-
return await _(u.join(e.dir.dist, p,
|
|
3483
|
+
}).filter(j), C = `${y}export * from "./${at}";`, E = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3484
|
+
${C}
|
|
3485
|
+
deferredLoaders${S.join("")};` : C;
|
|
3486
|
+
return await _(u.join(e.dir.dist, p, Rt), E);
|
|
3467
3487
|
});
|
|
3468
3488
|
await Promise.all(n);
|
|
3469
3489
|
}
|
|
3470
|
-
}),
|
|
3471
|
-
function
|
|
3490
|
+
}), Rt = "index.js", Wi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), Wi(e, e[n].referencedBy, i, s)));
|
|
3491
|
+
function Ot(e, t, i) {
|
|
3472
3492
|
if (Q(e))
|
|
3473
3493
|
return e;
|
|
3474
3494
|
{
|
|
@@ -3487,14 +3507,14 @@ function Q(e) {
|
|
|
3487
3507
|
return (
|
|
3488
3508
|
// Inlined string literal
|
|
3489
3509
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3490
|
-
|
|
3510
|
+
Xn.has(e.kind) || // Ternary with both branches never undefined
|
|
3491
3511
|
o.isConditionalExpression(e) && Q(e.whenTrue) && Q(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3492
|
-
o.isBinaryExpression(e) && (
|
|
3512
|
+
o.isBinaryExpression(e) && (Yn.has(e.operatorToken.kind) || Q(e.left) && Q(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3493
3513
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Q(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3494
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3514
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Qs.has(e.tag.text)
|
|
3495
3515
|
);
|
|
3496
3516
|
}
|
|
3497
|
-
const
|
|
3517
|
+
const Xn = /* @__PURE__ */ new Set([
|
|
3498
3518
|
o.SyntaxKind.NumericLiteral,
|
|
3499
3519
|
o.SyntaxKind.BigIntLiteral,
|
|
3500
3520
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3513,7 +3533,7 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3513
3533
|
o.SyntaxKind.ClassExpression,
|
|
3514
3534
|
// Trust? Trust.
|
|
3515
3535
|
o.SyntaxKind.NonNullExpression
|
|
3516
|
-
]),
|
|
3536
|
+
]), Yn = /* @__PURE__ */ new Set([
|
|
3517
3537
|
o.SyntaxKind.PlusEqualsToken,
|
|
3518
3538
|
o.SyntaxKind.MinusEqualsToken,
|
|
3519
3539
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3548,51 +3568,51 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3548
3568
|
o.SyntaxKind.SlashToken,
|
|
3549
3569
|
o.SyntaxKind.PercentToken,
|
|
3550
3570
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3551
|
-
]),
|
|
3571
|
+
]), Qn = {
|
|
3552
3572
|
property(e, t, i, s) {
|
|
3553
|
-
const n =
|
|
3573
|
+
const n = Zn(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3554
3574
|
if (a) {
|
|
3555
|
-
const f =
|
|
3575
|
+
const f = _e(t);
|
|
3556
3576
|
if (f === !0)
|
|
3557
3577
|
return [n.name];
|
|
3558
3578
|
if (f === !1)
|
|
3559
3579
|
return [];
|
|
3560
3580
|
}
|
|
3561
|
-
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] :
|
|
3581
|
+
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : we(e, t, a), d = c[0] !== "=";
|
|
3562
3582
|
if (a && d)
|
|
3563
3583
|
return [n.name, ...c];
|
|
3564
3584
|
const [l, p] = c, m = n?.type === "stringifiedNonReflected";
|
|
3565
3585
|
if (r || m) {
|
|
3566
|
-
const f =
|
|
3586
|
+
const f = Ot(
|
|
3567
3587
|
p,
|
|
3568
3588
|
e,
|
|
3569
3589
|
m ? "" : void 0
|
|
3570
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === Ee) ?
|
|
3590
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === Ee) ? to(f, e) : f;
|
|
3571
3591
|
if (h !== p)
|
|
3572
3592
|
return [m ? `.${i}` : n.name, l, h];
|
|
3573
3593
|
}
|
|
3574
3594
|
return [`.${i}`, ...c];
|
|
3575
3595
|
},
|
|
3576
3596
|
attribute(e, t, i) {
|
|
3577
|
-
const s = t === void 0 ||
|
|
3597
|
+
const s = t === void 0 || _e(t);
|
|
3578
3598
|
if (s === !0)
|
|
3579
3599
|
return [i];
|
|
3580
3600
|
if (s === !1)
|
|
3581
3601
|
return [];
|
|
3582
|
-
const n =
|
|
3602
|
+
const n = we(e, t, !0), a = n[0] !== "=" ? n : [n[0], Ot(n[1], e)];
|
|
3583
3603
|
return [i, ...a];
|
|
3584
3604
|
},
|
|
3585
3605
|
booleanAttribute(e, t, i) {
|
|
3586
|
-
const s = t === void 0 ||
|
|
3587
|
-
return s === !0 ? [i] : s === !1 ? [] : [`?${i}`, ...
|
|
3606
|
+
const s = t === void 0 || _e(t);
|
|
3607
|
+
return s === !0 ? [i] : s === !1 ? [] : [`?${i}`, ...we(e, t, !1)];
|
|
3588
3608
|
},
|
|
3589
3609
|
event(e, t, i) {
|
|
3590
3610
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
3591
3611
|
throw new Error(
|
|
3592
3612
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3593
3613
|
);
|
|
3594
|
-
const s = i.slice(2), n =
|
|
3595
|
-
return [`@${ni.has(n) ? s.toLowerCase() :
|
|
3614
|
+
const s = i.slice(2), n = gt(s);
|
|
3615
|
+
return [`@${ni.has(n) ? s.toLowerCase() : gt(s)}=`, ...pt(e, t, void 0)];
|
|
3596
3616
|
},
|
|
3597
3617
|
directives(e, t) {
|
|
3598
3618
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3627,41 +3647,41 @@ const Vn = /* @__PURE__ */ new Set([
|
|
|
3627
3647
|
])
|
|
3628
3648
|
];
|
|
3629
3649
|
},
|
|
3630
|
-
class:
|
|
3631
|
-
style:
|
|
3632
|
-
key: (e, t) => [
|
|
3650
|
+
class: Jt,
|
|
3651
|
+
style: Jt,
|
|
3652
|
+
key: (e, t) => [ct(t, e.sourceFile)],
|
|
3633
3653
|
deferLoad(e, t, i, s) {
|
|
3634
3654
|
if (typeof s != "string")
|
|
3635
3655
|
throw Error("deferLoad prop is not currently supported on dynamic tag names.");
|
|
3636
|
-
if (!
|
|
3656
|
+
if (!rt(s))
|
|
3637
3657
|
throw Error(`deferLoad prop is only supported on custom elements. Found ${String(s)}`);
|
|
3638
3658
|
e.neededImports.add("deferLoad");
|
|
3639
3659
|
const n = e.importRenames.deferLoad;
|
|
3640
3660
|
return [o.factory.createIdentifier(n)];
|
|
3641
3661
|
}
|
|
3642
3662
|
};
|
|
3643
|
-
function
|
|
3663
|
+
function Zn(e, t, i) {
|
|
3644
3664
|
if (typeof e == "string") {
|
|
3645
3665
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3646
3666
|
if (r !== void 0)
|
|
3647
3667
|
return { name: r, type: "reflected" };
|
|
3648
3668
|
}
|
|
3649
|
-
const s =
|
|
3669
|
+
const s = Ke(U.common, t);
|
|
3650
3670
|
if (s !== void 0)
|
|
3651
3671
|
return s;
|
|
3652
3672
|
if (typeof e == "string") {
|
|
3653
|
-
const n =
|
|
3673
|
+
const n = Ke(U.perElement[e], t);
|
|
3654
3674
|
if (n !== void 0)
|
|
3655
3675
|
return n;
|
|
3656
3676
|
} else {
|
|
3657
3677
|
const n = Object.values(U.perElement).map(
|
|
3658
|
-
(a) =>
|
|
3659
|
-
), r =
|
|
3678
|
+
(a) => Ke(a, t)
|
|
3679
|
+
), r = ze(n, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? ze(n, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3660
3680
|
if (r !== void 0)
|
|
3661
3681
|
return r;
|
|
3662
3682
|
}
|
|
3663
3683
|
}
|
|
3664
|
-
function
|
|
3684
|
+
function Ke(e, t) {
|
|
3665
3685
|
const i = e?.reflected?.[t];
|
|
3666
3686
|
if (i !== void 0)
|
|
3667
3687
|
return { name: i, type: "reflected" };
|
|
@@ -3672,14 +3692,14 @@ function Be(e, t) {
|
|
|
3672
3692
|
if (n !== void 0)
|
|
3673
3693
|
return { name: n, type: "stringifiedNonReflected" };
|
|
3674
3694
|
}
|
|
3675
|
-
function
|
|
3695
|
+
function ct(e, t) {
|
|
3676
3696
|
if (e !== void 0 && o.isJsxExpression(e) && e.expression !== void 0)
|
|
3677
3697
|
return e.expression;
|
|
3678
3698
|
if (e !== void 0 && o.isStringLiteral(e))
|
|
3679
3699
|
return e;
|
|
3680
3700
|
throw new Error(`key prop value must be an expression. Found ${String(e?.getText(t))}`);
|
|
3681
3701
|
}
|
|
3682
|
-
function
|
|
3702
|
+
function _e(e) {
|
|
3683
3703
|
if (e === void 0)
|
|
3684
3704
|
return !0;
|
|
3685
3705
|
if (o.isJsxExpression(e)) {
|
|
@@ -3689,16 +3709,16 @@ function Ke(e) {
|
|
|
3689
3709
|
return !1;
|
|
3690
3710
|
}
|
|
3691
3711
|
}
|
|
3692
|
-
function
|
|
3712
|
+
function we(e, t, i = !1) {
|
|
3693
3713
|
if (de(t))
|
|
3694
3714
|
throw new Error(
|
|
3695
3715
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3696
3716
|
);
|
|
3697
3717
|
if (o.isStringLiteral(t))
|
|
3698
|
-
return
|
|
3718
|
+
return Mt(t, i);
|
|
3699
3719
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3700
3720
|
if (o.isStringLiteral(t.expression))
|
|
3701
|
-
return
|
|
3721
|
+
return Mt(t.expression, i);
|
|
3702
3722
|
if (i) {
|
|
3703
3723
|
if (o.isNumericLiteral(t.expression))
|
|
3704
3724
|
return [`=${t.expression.text}`];
|
|
@@ -3706,16 +3726,16 @@ function be(e, t, i = !1) {
|
|
|
3706
3726
|
return [`=${t.expression.getText(e.sourceFile)}`];
|
|
3707
3727
|
}
|
|
3708
3728
|
}
|
|
3709
|
-
return ["=", ...
|
|
3729
|
+
return ["=", ...pt(e, t, void 0)];
|
|
3710
3730
|
}
|
|
3711
|
-
function
|
|
3731
|
+
function Mt(e, t) {
|
|
3712
3732
|
if (!t)
|
|
3713
3733
|
return ["=", e];
|
|
3714
3734
|
const i = e.text;
|
|
3715
3735
|
if (i.length === 0)
|
|
3716
3736
|
return [];
|
|
3717
3737
|
const s = oi(i);
|
|
3718
|
-
if (
|
|
3738
|
+
if (qs(s)) {
|
|
3719
3739
|
const n = s.replaceAll('"', """);
|
|
3720
3740
|
if (n.length > s.length) {
|
|
3721
3741
|
const r = s.replaceAll("'", "'");
|
|
@@ -3726,7 +3746,7 @@ function Ot(e, t) {
|
|
|
3726
3746
|
} else
|
|
3727
3747
|
return [`=${s}`];
|
|
3728
3748
|
}
|
|
3729
|
-
function
|
|
3749
|
+
function Jt(e, t, i) {
|
|
3730
3750
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3731
3751
|
return [`${i}="${t.text}"`];
|
|
3732
3752
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3734,7 +3754,7 @@ function Mt(e, t, i) {
|
|
|
3734
3754
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3735
3755
|
);
|
|
3736
3756
|
const s = t.expression;
|
|
3737
|
-
if (
|
|
3757
|
+
if (eo(s)) {
|
|
3738
3758
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3739
3759
|
e.neededImports.add(r);
|
|
3740
3760
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3742,20 +3762,20 @@ function Mt(e, t, i) {
|
|
|
3742
3762
|
]);
|
|
3743
3763
|
return [`${i}=`, c];
|
|
3744
3764
|
} else
|
|
3745
|
-
return [i, ...
|
|
3765
|
+
return [i, ...we(e, t, !0)];
|
|
3746
3766
|
}
|
|
3747
|
-
const
|
|
3748
|
-
function
|
|
3767
|
+
const eo = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3768
|
+
function to(e, t) {
|
|
3749
3769
|
t.neededImports.add("live");
|
|
3750
3770
|
const i = t.importRenames.live;
|
|
3751
3771
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3752
3772
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3753
3773
|
]);
|
|
3754
3774
|
}
|
|
3755
|
-
function
|
|
3756
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3775
|
+
function io(e) {
|
|
3776
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Bt && e.expression.arguments.length <= 1)
|
|
3757
3777
|
return {
|
|
3758
|
-
propType:
|
|
3778
|
+
propType: Bt[e.expression.expression.text],
|
|
3759
3779
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3760
3780
|
initializer: o.factory.createJsxExpression(
|
|
3761
3781
|
void 0,
|
|
@@ -3764,21 +3784,21 @@ function eo(e) {
|
|
|
3764
3784
|
)
|
|
3765
3785
|
};
|
|
3766
3786
|
}
|
|
3767
|
-
const
|
|
3787
|
+
const Bt = {
|
|
3768
3788
|
bindProperty: "property",
|
|
3769
3789
|
bindAttribute: "attribute",
|
|
3770
3790
|
bindBooleanAttribute: "booleanAttribute",
|
|
3771
3791
|
bindEvent: "event"
|
|
3772
3792
|
};
|
|
3773
|
-
function
|
|
3774
|
-
return
|
|
3793
|
+
function so(e, t, i) {
|
|
3794
|
+
return no.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ii.has(e) || e.includes("-") ? "attribute" : !rt(i) && (si.has(e) || (i === He ? !1 : i === Ee ? (
|
|
3775
3795
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3776
|
-
Object.values(
|
|
3777
|
-
) :
|
|
3796
|
+
Object.values(qe).some((r) => r.has(e))
|
|
3797
|
+
) : qe[i]?.has(e) === !0)) ? bt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === He || i !== Ee && (it.has(i) || st.has(i)) ? e in U.common.reflected || e in U.common.stringifiedReflected || e in U.common.stringifiedNonReflected ? "property" : bt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3778
3798
|
}
|
|
3779
|
-
const
|
|
3780
|
-
function
|
|
3781
|
-
const n =
|
|
3799
|
+
const ro = ["class", "style", "ref", "directives", "key", "deferLoad"], no = new Set(ro), oo = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3800
|
+
function Ne({ key: e, parts: t, litTag: i }, s) {
|
|
3801
|
+
const n = ao(t);
|
|
3782
3802
|
if (n.length % 2 === 0)
|
|
3783
3803
|
throw new Error("Normalized template parts array length must be odd");
|
|
3784
3804
|
const [r, ...a] = n;
|
|
@@ -3786,24 +3806,24 @@ function Le({ key: e, parts: t, litTag: i }, s) {
|
|
|
3786
3806
|
throw new Error("First normalized template part must be a string");
|
|
3787
3807
|
if (i === void 0) {
|
|
3788
3808
|
if (a.length === 0)
|
|
3789
|
-
return
|
|
3809
|
+
return Ue(s, e, o.factory.createStringLiteral(r));
|
|
3790
3810
|
if (r === "" && a.length === 2 && a[1] === "")
|
|
3791
|
-
return
|
|
3811
|
+
return Ue(
|
|
3792
3812
|
s,
|
|
3793
3813
|
e,
|
|
3794
3814
|
typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
|
|
3795
3815
|
);
|
|
3796
3816
|
}
|
|
3797
|
-
const c = typeof i == "string" ? i :
|
|
3817
|
+
const c = typeof i == "string" ? i : re;
|
|
3798
3818
|
s.neededImports.add(c);
|
|
3799
3819
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3800
3820
|
o.factory.createIdentifier(d),
|
|
3801
3821
|
void 0,
|
|
3802
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3822
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), lo(a))
|
|
3803
3823
|
);
|
|
3804
|
-
return
|
|
3824
|
+
return Ue(s, e, l);
|
|
3805
3825
|
}
|
|
3806
|
-
const
|
|
3826
|
+
const ao = (e) => e.reduce(
|
|
3807
3827
|
(t, i, s) => {
|
|
3808
3828
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3809
3829
|
if (r && a)
|
|
@@ -3813,7 +3833,7 @@ const no = (e) => e.reduce(
|
|
|
3813
3833
|
},
|
|
3814
3834
|
[""]
|
|
3815
3835
|
);
|
|
3816
|
-
function
|
|
3836
|
+
function lo(e) {
|
|
3817
3837
|
if (!(e.length % 2 === 0))
|
|
3818
3838
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3819
3839
|
const i = e.length / 2;
|
|
@@ -3831,34 +3851,34 @@ function oo(e) {
|
|
|
3831
3851
|
);
|
|
3832
3852
|
});
|
|
3833
3853
|
}
|
|
3834
|
-
function
|
|
3854
|
+
function Ue(e, t, i) {
|
|
3835
3855
|
if (t === void 0)
|
|
3836
3856
|
return i;
|
|
3837
3857
|
e.neededImports.add("keyed");
|
|
3838
3858
|
const s = e.importRenames.keyed;
|
|
3839
3859
|
return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
|
|
3840
3860
|
}
|
|
3841
|
-
const
|
|
3842
|
-
function
|
|
3843
|
-
const i =
|
|
3861
|
+
const zi = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
3862
|
+
function Hi(e, t) {
|
|
3863
|
+
const i = dt(e);
|
|
3844
3864
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
3845
3865
|
t,
|
|
3846
3866
|
i.map((s) => ({
|
|
3847
3867
|
...s,
|
|
3848
3868
|
pos: -1,
|
|
3849
3869
|
end: -1,
|
|
3850
|
-
text:
|
|
3870
|
+
text: qi(e.slice(s.pos, s.end))
|
|
3851
3871
|
}))
|
|
3852
3872
|
);
|
|
3853
3873
|
}
|
|
3854
|
-
const
|
|
3855
|
-
function
|
|
3856
|
-
const t =
|
|
3874
|
+
const dt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3875
|
+
function co(e) {
|
|
3876
|
+
const t = dt(e);
|
|
3857
3877
|
if (t.length === 0)
|
|
3858
3878
|
return [e || " "];
|
|
3859
3879
|
const i = t.reduceRight(
|
|
3860
3880
|
([n, ...r], a) => {
|
|
3861
|
-
const c =
|
|
3881
|
+
const c = po(n), d = qi(c.slice(a.pos, a.end));
|
|
3862
3882
|
return [
|
|
3863
3883
|
c.slice(0, a.pos),
|
|
3864
3884
|
/**
|
|
@@ -3876,13 +3896,13 @@ function ao(e) {
|
|
|
3876
3896
|
const s = i.at(-1);
|
|
3877
3897
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
3878
3898
|
}
|
|
3879
|
-
const
|
|
3880
|
-
function
|
|
3899
|
+
const qi = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3900
|
+
function po(e) {
|
|
3881
3901
|
if (typeof e == "string")
|
|
3882
3902
|
return e;
|
|
3883
3903
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3884
3904
|
}
|
|
3885
|
-
function
|
|
3905
|
+
function mo(e, t) {
|
|
3886
3906
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3887
3907
|
return t;
|
|
3888
3908
|
const s = t.arguments[0];
|
|
@@ -3894,7 +3914,7 @@ function co(e, t) {
|
|
|
3894
3914
|
return t;
|
|
3895
3915
|
const c = me(s.body);
|
|
3896
3916
|
let d = !0, l;
|
|
3897
|
-
if (
|
|
3917
|
+
if (Kt(c))
|
|
3898
3918
|
l = c;
|
|
3899
3919
|
else {
|
|
3900
3920
|
if (!o.isBlock(c))
|
|
@@ -3902,21 +3922,21 @@ function co(e, t) {
|
|
|
3902
3922
|
const y = c.statements.at(-1);
|
|
3903
3923
|
if (!(y && o.isReturnStatement(y) && y.expression))
|
|
3904
3924
|
return t;
|
|
3905
|
-
const
|
|
3906
|
-
if (!
|
|
3925
|
+
const C = me(y.expression);
|
|
3926
|
+
if (!Kt(C))
|
|
3907
3927
|
return t;
|
|
3908
|
-
const
|
|
3909
|
-
if (
|
|
3928
|
+
const E = c.statements.slice(0, -1);
|
|
3929
|
+
if (E.some(Vi))
|
|
3910
3930
|
return t;
|
|
3911
|
-
d =
|
|
3931
|
+
d = E.length === 0, l = C;
|
|
3912
3932
|
}
|
|
3913
|
-
const p = o.isJsxElement(l) ? l.openingElement : l, m =
|
|
3933
|
+
const p = o.isJsxElement(l) ? l.openingElement : l, m = Zi(p);
|
|
3914
3934
|
if (m === -1)
|
|
3915
3935
|
return t;
|
|
3916
3936
|
const f = p.attributes.properties[m];
|
|
3917
3937
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3918
3938
|
return t;
|
|
3919
|
-
const g =
|
|
3939
|
+
const g = ct(f.initializer, e.sourceFile), h = uo(r, s, g, d, e);
|
|
3920
3940
|
if (h === void 0)
|
|
3921
3941
|
return t;
|
|
3922
3942
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3938,25 +3958,25 @@ function co(e, t) {
|
|
|
3938
3958
|
)
|
|
3939
3959
|
]);
|
|
3940
3960
|
}
|
|
3941
|
-
const
|
|
3942
|
-
function
|
|
3961
|
+
const Kt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3962
|
+
function Vi(e) {
|
|
3943
3963
|
if (o.isReturnStatement(e))
|
|
3944
3964
|
return !0;
|
|
3945
3965
|
let t = !1;
|
|
3946
3966
|
return o.visitEachChild(
|
|
3947
3967
|
e,
|
|
3948
|
-
(i) => (t ||=
|
|
3968
|
+
(i) => (t ||= Vi(i), i),
|
|
3949
3969
|
void 0
|
|
3950
3970
|
), t;
|
|
3951
3971
|
}
|
|
3952
|
-
function
|
|
3972
|
+
function uo(e, t, i, s, n) {
|
|
3953
3973
|
const r = J(i);
|
|
3954
3974
|
if (r === void 0)
|
|
3955
3975
|
return;
|
|
3956
|
-
let a =
|
|
3976
|
+
let a = Gi(e.name, r);
|
|
3957
3977
|
const c = t.parameters.at(1);
|
|
3958
3978
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
3959
|
-
r.every(
|
|
3979
|
+
r.every(xe, c.name)) {
|
|
3960
3980
|
$.warn(
|
|
3961
3981
|
"@arcgis/lumina:jsxToLitHtml",
|
|
3962
3982
|
"It looks like you are trying to use .map() index as a key={} prop value. Doing so is potentially pointless and may cause performance degradation. In Lit it is safe to omit the key={} prop. If you really mean to use index as the key, then use the keyed() Lit directive directly, rather than the JSX key={} prop.",
|
|
@@ -3965,7 +3985,7 @@ function po(e, t, i, s, n) {
|
|
|
3965
3985
|
return;
|
|
3966
3986
|
}
|
|
3967
3987
|
if (!s) {
|
|
3968
|
-
const d =
|
|
3988
|
+
const d = go(r, a, t);
|
|
3969
3989
|
if (d === void 0)
|
|
3970
3990
|
return;
|
|
3971
3991
|
a = d;
|
|
@@ -4004,7 +4024,7 @@ function J(e) {
|
|
|
4004
4024
|
}
|
|
4005
4025
|
return t;
|
|
4006
4026
|
} else {
|
|
4007
|
-
if (
|
|
4027
|
+
if (fo.has(e.kind))
|
|
4008
4028
|
return [];
|
|
4009
4029
|
{
|
|
4010
4030
|
const t = me(e);
|
|
@@ -4012,7 +4032,7 @@ function J(e) {
|
|
|
4012
4032
|
}
|
|
4013
4033
|
}
|
|
4014
4034
|
}
|
|
4015
|
-
const
|
|
4035
|
+
const fo = /* @__PURE__ */ new Set([
|
|
4016
4036
|
o.SyntaxKind.NumericLiteral,
|
|
4017
4037
|
o.SyntaxKind.BigIntLiteral,
|
|
4018
4038
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4021,73 +4041,73 @@ const mo = /* @__PURE__ */ new Set([
|
|
|
4021
4041
|
o.SyntaxKind.FalseKeyword,
|
|
4022
4042
|
o.SyntaxKind.NullKeyword,
|
|
4023
4043
|
o.SyntaxKind.TrueKeyword
|
|
4024
|
-
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e,
|
|
4025
|
-
function
|
|
4026
|
-
if (e.every(
|
|
4044
|
+
]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? vo(e, t) : e;
|
|
4045
|
+
function go(e, t, i) {
|
|
4046
|
+
if (e.every(xe, t))
|
|
4027
4047
|
return t;
|
|
4028
4048
|
if (o.isIdentifier(t)) {
|
|
4029
|
-
const s = o.isBlock(i.body) ?
|
|
4049
|
+
const s = o.isBlock(i.body) ? ze(i.body.statements, (r) => ho(r, t)) : void 0;
|
|
4030
4050
|
if (s === void 0)
|
|
4031
4051
|
return;
|
|
4032
|
-
const n =
|
|
4033
|
-
if (e.every(
|
|
4052
|
+
const n = Gi(s, e);
|
|
4053
|
+
if (e.every(xe, n))
|
|
4034
4054
|
return n;
|
|
4035
4055
|
}
|
|
4036
4056
|
}
|
|
4037
|
-
function
|
|
4057
|
+
function ho(e, t) {
|
|
4038
4058
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4039
4059
|
return;
|
|
4040
4060
|
const i = e.declarationList.declarations[0];
|
|
4041
4061
|
return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
|
|
4042
4062
|
}
|
|
4043
|
-
function
|
|
4063
|
+
function xe(e) {
|
|
4044
4064
|
const t = this;
|
|
4045
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4065
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(yo, e);
|
|
4046
4066
|
}
|
|
4047
|
-
function
|
|
4067
|
+
function yo(e) {
|
|
4048
4068
|
const t = this;
|
|
4049
|
-
return o.isOmittedExpression(e) ? !1 :
|
|
4069
|
+
return o.isOmittedExpression(e) ? !1 : xe.call(e.name, t);
|
|
4050
4070
|
}
|
|
4051
|
-
function
|
|
4071
|
+
function vo(e, t) {
|
|
4052
4072
|
let i = !1;
|
|
4053
4073
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4054
4074
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
4055
4075
|
}
|
|
4056
|
-
const
|
|
4076
|
+
const Xi = (e, t) => t.liftedKeys.has(e);
|
|
4057
4077
|
function H(e, t, i) {
|
|
4058
4078
|
if (de(i))
|
|
4059
|
-
return
|
|
4060
|
-
const s = o.isCallExpression(i) ?
|
|
4079
|
+
return Yi(e, i);
|
|
4080
|
+
const s = o.isCallExpression(i) ? mo(e, i) : i, n = o.visitEachChild(
|
|
4061
4081
|
s,
|
|
4062
4082
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4063
4083
|
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4064
4084
|
e.transformationContext
|
|
4065
4085
|
);
|
|
4066
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) ||
|
|
4067
|
-
}
|
|
4068
|
-
function Xi(e, t) {
|
|
4069
|
-
const i = Yi(e, t);
|
|
4070
|
-
return Le(i, e);
|
|
4086
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || ir(i.right)) ? So(n) : n;
|
|
4071
4087
|
}
|
|
4072
4088
|
function Yi(e, t) {
|
|
4089
|
+
const i = Qi(e, t);
|
|
4090
|
+
return Ne(i, e);
|
|
4091
|
+
}
|
|
4092
|
+
function Qi(e, t) {
|
|
4073
4093
|
const i = "children" in t ? t.children : [];
|
|
4074
4094
|
if (o.isJsxFragment(t))
|
|
4075
|
-
return { key: void 0, ...
|
|
4095
|
+
return { key: void 0, ...Se(i, e) };
|
|
4076
4096
|
const n = o.isJsxElement(t) ? t.openingElement : t, r = n.tagName;
|
|
4077
4097
|
if (o.isJsxNamespacedName(r))
|
|
4078
4098
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4079
|
-
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !==
|
|
4080
|
-
const w = o.isIdentifier(r) && r.text ===
|
|
4099
|
+
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Re && r.text !== Oe) {
|
|
4100
|
+
const w = o.isIdentifier(r) && r.text === Bs ? Se(i, e) : {
|
|
4081
4101
|
// No need to wrap the function call in a lit-html tag
|
|
4082
4102
|
litTag: void 0,
|
|
4083
|
-
parts: [
|
|
4103
|
+
parts: [wo(e, t, r, i)]
|
|
4084
4104
|
};
|
|
4085
4105
|
return {
|
|
4086
|
-
key:
|
|
4106
|
+
key: bo(n, e),
|
|
4087
4107
|
...w
|
|
4088
4108
|
};
|
|
4089
4109
|
}
|
|
4090
|
-
const c = r.text ===
|
|
4110
|
+
const c = r.text === Re ? Ee : r.text === Oe ? He : r.text, d = r.text === Re ? se : r.text === Oe ? G : _s.has(c) ? ai : it.has(c) ? ee : re, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4091
4111
|
let f;
|
|
4092
4112
|
const g = [];
|
|
4093
4113
|
let h = !1;
|
|
@@ -4100,13 +4120,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4100
4120
|
const { name: w, initializer: O } = x;
|
|
4101
4121
|
if (o.isJsxNamespacedName(w))
|
|
4102
4122
|
throw Error(`JSX namespaced attributes are not supported. Found ${w.getText(e.sourceFile)}`);
|
|
4103
|
-
const L = w.text, W =
|
|
4123
|
+
const L = w.text, W = io(O), N = W?.propType ?? so(L, O, c);
|
|
4104
4124
|
m?.delete(L);
|
|
4105
|
-
const A =
|
|
4125
|
+
const A = Qn[N](e, W?.initializer ?? O, L, c);
|
|
4106
4126
|
if (A.length === 0)
|
|
4107
4127
|
return [];
|
|
4108
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4109
|
-
return N === "key" ? (f = typeof A[0] == "object" && !
|
|
4128
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : co(zi(w, e));
|
|
4129
|
+
return N === "key" ? (f = typeof A[0] == "object" && !Xi(w, e) ? A[0] : void 0, B.some(oo) ? B : []) : N === "directives" || N === "ref" || L === "deferLoad" ? (h ||= N === "deferLoad", g.push(
|
|
4110
4130
|
...B,
|
|
4111
4131
|
...A.flatMap(
|
|
4112
4132
|
(F, M) => typeof F == "string" || M === 0 || typeof A[M - 1] == "string" ? F : [" ", F]
|
|
@@ -4117,71 +4137,71 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4117
4137
|
"mustIncludeAllRequiredProperties",
|
|
4118
4138
|
e.sourceFile.fileName,
|
|
4119
4139
|
`Missing required properties for <${c}> }: ${Array.from(m).join(", ")}`
|
|
4120
|
-
), g.length > 0 && v.push(...g), typeof c == "string" &&
|
|
4140
|
+
), g.length > 0 && v.push(...g), typeof c == "string" && st.has(c))
|
|
4121
4141
|
throw Error(
|
|
4122
4142
|
`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`
|
|
4123
4143
|
);
|
|
4124
4144
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4125
|
-
const y = typeof c == "string" &&
|
|
4145
|
+
const y = typeof c == "string" && Ks.has(c), S = Se(i, e);
|
|
4126
4146
|
if (y && S.parts.length > 0)
|
|
4127
4147
|
throw Error(
|
|
4128
4148
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
4129
4149
|
);
|
|
4130
|
-
const
|
|
4150
|
+
const C = (d === ee || d === G) && S.parts.length === 0, E = [
|
|
4131
4151
|
"<",
|
|
4132
4152
|
typeof c == "string" ? c : r,
|
|
4133
4153
|
...v,
|
|
4134
|
-
|
|
4135
|
-
], T = y ||
|
|
4136
|
-
...
|
|
4154
|
+
C ? `${v.length === 0 ? "" : " "}/>` : ">"
|
|
4155
|
+
], T = y || C ? E : [
|
|
4156
|
+
...E,
|
|
4137
4157
|
/**
|
|
4138
4158
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
4139
4159
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
4140
4160
|
* tagged template literal (e.g. svg``)
|
|
4141
4161
|
*/
|
|
4142
|
-
...S.litTag !== void 0 && S.litTag !== d ? [
|
|
4162
|
+
...S.litTag !== void 0 && S.litTag !== d ? [Ne({ key: void 0, ...S }, e)] : S.parts,
|
|
4143
4163
|
"</",
|
|
4144
4164
|
typeof c == "string" ? c : r,
|
|
4145
4165
|
">"
|
|
4146
4166
|
];
|
|
4147
4167
|
return { key: f, parts: T, litTag: d };
|
|
4148
4168
|
}
|
|
4149
|
-
function
|
|
4150
|
-
const i = e.attributes.properties[
|
|
4151
|
-
return i && o.isJsxAttribute(i) && !
|
|
4169
|
+
function bo(e, t) {
|
|
4170
|
+
const i = e.attributes.properties[Zi(e)];
|
|
4171
|
+
return i && o.isJsxAttribute(i) && !Xi(i.name, t) ? ct(i.initializer, t.sourceFile) : void 0;
|
|
4152
4172
|
}
|
|
4153
|
-
const
|
|
4154
|
-
function
|
|
4173
|
+
const Zi = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4174
|
+
function wo(e, t, i, s) {
|
|
4155
4175
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4156
4176
|
if (o.isJsxSpreadAttribute(d))
|
|
4157
|
-
return zi(
|
|
4177
|
+
return Hi(zi(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4158
4178
|
const { name: l, initializer: p } = d;
|
|
4159
4179
|
if (o.isJsxNamespacedName(l))
|
|
4160
4180
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4161
4181
|
if (l.text === "key")
|
|
4162
4182
|
return;
|
|
4163
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ?
|
|
4183
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ? Yi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Zt(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
4164
4184
|
return o.factory.createPropertyAssignment(f, m);
|
|
4165
|
-
}), { parts: a, litTag: c } =
|
|
4185
|
+
}), { parts: a, litTag: c } = Se(s, e);
|
|
4166
4186
|
return a.length > 0 && r.push(
|
|
4167
4187
|
o.factory.createPropertyAssignment(
|
|
4168
4188
|
o.factory.createIdentifier("children"),
|
|
4169
|
-
|
|
4189
|
+
Ne({ key: void 0, parts: a, litTag: c }, e)
|
|
4170
4190
|
)
|
|
4171
4191
|
), o.factory.createCallExpression(i, void 0, [
|
|
4172
4192
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
4173
4193
|
]);
|
|
4174
4194
|
}
|
|
4175
|
-
function
|
|
4195
|
+
function Se(e, t) {
|
|
4176
4196
|
let i;
|
|
4177
4197
|
const s = e.flatMap((n) => {
|
|
4178
4198
|
if (o.isJsxText(n))
|
|
4179
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4199
|
+
return [t.compiler.shouldMinifyJsx ? Ws(n.text) : n.text];
|
|
4180
4200
|
if (o.isJsxExpression(n))
|
|
4181
|
-
return
|
|
4201
|
+
return pt(t, n, n);
|
|
4182
4202
|
{
|
|
4183
|
-
const r =
|
|
4184
|
-
if (r.key === void 0 && r.litTag !==
|
|
4203
|
+
const r = Qi(t, n);
|
|
4204
|
+
if (r.key === void 0 && r.litTag !== se && r.litTag !== G) {
|
|
4185
4205
|
if (r.litTag === ai)
|
|
4186
4206
|
return r.parts;
|
|
4187
4207
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
@@ -4190,24 +4210,24 @@ function we(e, t) {
|
|
|
4190
4210
|
);
|
|
4191
4211
|
return i = r.litTag, r.parts;
|
|
4192
4212
|
} else
|
|
4193
|
-
return [
|
|
4213
|
+
return [Ne(r, t)];
|
|
4194
4214
|
}
|
|
4195
4215
|
});
|
|
4196
4216
|
return { litTag: i, parts: s };
|
|
4197
4217
|
}
|
|
4198
|
-
function
|
|
4218
|
+
function So(e) {
|
|
4199
4219
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4200
4220
|
e,
|
|
4201
4221
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
4202
4222
|
o.factory.createStringLiteral("")
|
|
4203
4223
|
) : e;
|
|
4204
4224
|
}
|
|
4205
|
-
function
|
|
4225
|
+
function pt(e, t, i) {
|
|
4206
4226
|
if (t.expression === void 0) {
|
|
4207
4227
|
if (e.compiler.shouldMinifyJsx)
|
|
4208
4228
|
return [];
|
|
4209
4229
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4210
|
-
return
|
|
4230
|
+
return dt(s).length === 0 ? [] : [Hi(s, o.factory.createIdentifier("undefined"))];
|
|
4211
4231
|
}
|
|
4212
4232
|
return o.isStringLiteral(t.expression) ? [oi(t.expression.text)] : (
|
|
4213
4233
|
/**
|
|
@@ -4246,17 +4266,17 @@ function dt(e, t, i) {
|
|
|
4246
4266
|
] : [H(e, i, t.expression)]
|
|
4247
4267
|
);
|
|
4248
4268
|
}
|
|
4249
|
-
const
|
|
4250
|
-
Object.entries(
|
|
4269
|
+
const es = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), ts = es(
|
|
4270
|
+
Object.entries(te).flatMap(
|
|
4251
4271
|
([e, t]) => t.map((i) => [i, e])
|
|
4252
4272
|
)
|
|
4253
|
-
),
|
|
4254
|
-
function
|
|
4273
|
+
), is = new Set(Object.keys(ts));
|
|
4274
|
+
function Co(e, t) {
|
|
4255
4275
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4256
4276
|
if (!o.isStringLiteral(n))
|
|
4257
4277
|
return t;
|
|
4258
|
-
const r =
|
|
4259
|
-
if (a && e.existingImportedModules.add(r),
|
|
4278
|
+
const r = Eo(e.sourceFile.fileName, n.text, ""), a = !i?.isTypeOnly;
|
|
4279
|
+
if (a && e.existingImportedModules.add(r), rr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4260
4280
|
!n.text.includes("?")) {
|
|
4261
4281
|
if (s) {
|
|
4262
4282
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4276,7 +4296,7 @@ function wo(e, t) {
|
|
|
4276
4296
|
// runs for .tsx files, so .css imports in .ts files won't work. However,
|
|
4277
4297
|
// that is unlikely for web component libraries. A workaround is to
|
|
4278
4298
|
// rename the file or explicitly add (undocumented) ?litCss flag
|
|
4279
|
-
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ? X :
|
|
4299
|
+
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ? X : Te)),
|
|
4280
4300
|
t.attributes
|
|
4281
4301
|
);
|
|
4282
4302
|
}
|
|
@@ -4289,12 +4309,12 @@ function wo(e, t) {
|
|
|
4289
4309
|
const c = i.namedBindings;
|
|
4290
4310
|
if (c === void 0 || !o.isNamedImports(c))
|
|
4291
4311
|
return t;
|
|
4292
|
-
const d =
|
|
4312
|
+
const d = is.has(n.text);
|
|
4293
4313
|
if (c.elements.forEach((l) => {
|
|
4294
|
-
const p = (l.propertyName ?? l.name).text, m =
|
|
4314
|
+
const p = (l.propertyName ?? l.name).text, m = te[p];
|
|
4295
4315
|
if (d) {
|
|
4296
4316
|
if (m?.some((h) => h === n.text)) {
|
|
4297
|
-
const h =
|
|
4317
|
+
const h = ss(p, r);
|
|
4298
4318
|
e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
|
|
4299
4319
|
}
|
|
4300
4320
|
} else (l.name.text === "h" || l.name.text === "createElement") && R().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
|
|
@@ -4304,7 +4324,7 @@ function wo(e, t) {
|
|
|
4304
4324
|
let l = !1;
|
|
4305
4325
|
const p = c.elements.filter((f) => {
|
|
4306
4326
|
const g = (f.propertyName ?? f.name).text;
|
|
4307
|
-
return
|
|
4327
|
+
return sr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4308
4328
|
});
|
|
4309
4329
|
if (p.length === 0)
|
|
4310
4330
|
return;
|
|
@@ -4333,22 +4353,22 @@ function wo(e, t) {
|
|
|
4333
4353
|
}
|
|
4334
4354
|
return t;
|
|
4335
4355
|
}
|
|
4336
|
-
const
|
|
4337
|
-
function
|
|
4338
|
-
return o.isImportDeclaration(e) ?
|
|
4356
|
+
const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? G : e, Eo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4357
|
+
function To(e) {
|
|
4358
|
+
return o.isImportDeclaration(e) ? $o(this, e) : e;
|
|
4339
4359
|
}
|
|
4340
|
-
function
|
|
4360
|
+
function $o(e, t) {
|
|
4341
4361
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4342
|
-
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !
|
|
4362
|
+
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !is.has(n.text))
|
|
4343
4363
|
return t;
|
|
4344
4364
|
const r = i.isTypeOnly;
|
|
4345
4365
|
let a = !1;
|
|
4346
4366
|
const c = s.elements.map((d) => {
|
|
4347
|
-
const l = (d.propertyName ?? d.name).text, p =
|
|
4367
|
+
const l = (d.propertyName ?? d.name).text, p = ss(l, n.text);
|
|
4348
4368
|
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;
|
|
4349
4369
|
});
|
|
4350
|
-
return
|
|
4351
|
-
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(
|
|
4370
|
+
return ts[n.text]?.forEach((d) => {
|
|
4371
|
+
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(rs(d, e)));
|
|
4352
4372
|
}), a ? o.factory.updateImportDeclaration(
|
|
4353
4373
|
t,
|
|
4354
4374
|
t.modifiers,
|
|
@@ -4362,9 +4382,9 @@ function Co(e, t) {
|
|
|
4362
4382
|
t.attributes
|
|
4363
4383
|
) : t;
|
|
4364
4384
|
}
|
|
4365
|
-
function
|
|
4366
|
-
const t =
|
|
4367
|
-
Array.from(e.neededImports, (i) => [
|
|
4385
|
+
function Po(e) {
|
|
4386
|
+
const t = es(
|
|
4387
|
+
Array.from(e.neededImports, (i) => [te[i][0], i])
|
|
4368
4388
|
);
|
|
4369
4389
|
return Object.entries(t).map(
|
|
4370
4390
|
([i, s]) => o.factory.createImportDeclaration(
|
|
@@ -4373,36 +4393,36 @@ function To(e) {
|
|
|
4373
4393
|
!1,
|
|
4374
4394
|
void 0,
|
|
4375
4395
|
o.factory.createNamedImports(
|
|
4376
|
-
s.map((n) => (e.neededImports.delete(n),
|
|
4396
|
+
s.map((n) => (e.neededImports.delete(n), rs(n, e)))
|
|
4377
4397
|
)
|
|
4378
4398
|
),
|
|
4379
4399
|
o.factory.createStringLiteral(i)
|
|
4380
4400
|
)
|
|
4381
4401
|
);
|
|
4382
4402
|
}
|
|
4383
|
-
function
|
|
4384
|
-
const i = e ===
|
|
4403
|
+
function rs(e, t) {
|
|
4404
|
+
const i = e === se ? re : e === G ? ee : e, s = t.importRenames[e];
|
|
4385
4405
|
return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4386
4406
|
!1,
|
|
4387
4407
|
o.factory.createIdentifier(i),
|
|
4388
4408
|
o.factory.createIdentifier(s)
|
|
4389
4409
|
);
|
|
4390
4410
|
}
|
|
4391
|
-
function
|
|
4392
|
-
const t =
|
|
4411
|
+
function Io(e) {
|
|
4412
|
+
const t = Tr().map(({ packageName: i }) => i);
|
|
4393
4413
|
return e.existingImportedModules.forEach((i) => {
|
|
4394
4414
|
if (u.isAbsolute(i))
|
|
4395
4415
|
return;
|
|
4396
|
-
const s =
|
|
4416
|
+
const s = Ms(i), n = i.slice(s.length + 1);
|
|
4397
4417
|
if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
|
|
4398
|
-
const r =
|
|
4418
|
+
const r = Ae(e.sourceFile.fileName);
|
|
4399
4419
|
throw new Error(
|
|
4400
4420
|
`Did not expect to find any explicit imports for "${i}". Found import in ${r}. Imports for web components that your component consumes will be added automatically at build-time as appropriate for a given output target. Type-only imports are still allowed. If you believe this is an error, please notify Lumina maintainers.`
|
|
4401
4421
|
);
|
|
4402
4422
|
}
|
|
4403
4423
|
}), [];
|
|
4404
4424
|
}
|
|
4405
|
-
function
|
|
4425
|
+
function ko(e) {
|
|
4406
4426
|
if (e.compiler.viteCommand === "serve")
|
|
4407
4427
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4408
4428
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4417,7 +4437,7 @@ function Po(e) {
|
|
|
4417
4437
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4418
4438
|
}), [];
|
|
4419
4439
|
}
|
|
4420
|
-
const
|
|
4440
|
+
const xo = (e, t) => {
|
|
4421
4441
|
const i = e.pragmas;
|
|
4422
4442
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4423
4443
|
return e.statements;
|
|
@@ -4438,10 +4458,10 @@ const Io = (e, t) => {
|
|
|
4438
4458
|
const r = {
|
|
4439
4459
|
compiler: t.compiler,
|
|
4440
4460
|
externalComponents: vi(),
|
|
4441
|
-
localComponents:
|
|
4461
|
+
localComponents: Ui(t.compiler),
|
|
4442
4462
|
sourceFile: e,
|
|
4443
4463
|
transformationContext: t.transformation,
|
|
4444
|
-
importRenames:
|
|
4464
|
+
importRenames: Ao(e),
|
|
4445
4465
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4446
4466
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4447
4467
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4455,7 +4475,7 @@ const Io = (e, t) => {
|
|
|
4455
4475
|
let a = [];
|
|
4456
4476
|
if (e.statements.every((d) => {
|
|
4457
4477
|
if (o.isImportDeclaration(d)) {
|
|
4458
|
-
const l =
|
|
4478
|
+
const l = Co(r, d);
|
|
4459
4479
|
if (l === void 0)
|
|
4460
4480
|
return !0;
|
|
4461
4481
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
@@ -4465,11 +4485,11 @@ const Io = (e, t) => {
|
|
|
4465
4485
|
return !0;
|
|
4466
4486
|
}), r.hasNonLuminaJsxImport)
|
|
4467
4487
|
return e.statements;
|
|
4468
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4488
|
+
if (r.neededImports.size > 0 && (a = a.map(To, r), r.existingLitImports.size > 0))
|
|
4469
4489
|
throw new Error(
|
|
4470
4490
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4471
4491
|
);
|
|
4472
|
-
const c = [
|
|
4492
|
+
const c = [Po, Io, ko].flatMap(
|
|
4473
4493
|
(d) => d(r)
|
|
4474
4494
|
);
|
|
4475
4495
|
if (r.neededImports.size > 0)
|
|
@@ -4478,24 +4498,24 @@ const Io = (e, t) => {
|
|
|
4478
4498
|
);
|
|
4479
4499
|
return [...c, ...a];
|
|
4480
4500
|
};
|
|
4481
|
-
function
|
|
4482
|
-
return
|
|
4483
|
-
|
|
4501
|
+
function Ao(e) {
|
|
4502
|
+
return Lo(e), Object.fromEntries(
|
|
4503
|
+
tr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4484
4504
|
);
|
|
4485
4505
|
}
|
|
4486
|
-
function
|
|
4506
|
+
function Lo(e) {
|
|
4487
4507
|
if (!("identifiers" in e))
|
|
4488
4508
|
throw new Error(
|
|
4489
4509
|
"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."
|
|
4490
4510
|
);
|
|
4491
4511
|
}
|
|
4492
|
-
const
|
|
4512
|
+
const _t = "customElement", No = (e, t) => {
|
|
4493
4513
|
const i = [];
|
|
4494
4514
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4495
4515
|
const a = r;
|
|
4496
4516
|
a.customElement !== void 0 && i.push(
|
|
4497
4517
|
o.factory.createExpressionStatement(
|
|
4498
|
-
o.factory.createCallExpression(o.factory.createIdentifier(
|
|
4518
|
+
o.factory.createCallExpression(o.factory.createIdentifier(_t), void 0, [
|
|
4499
4519
|
o.factory.createStringLiteral(a.tagName ?? ""),
|
|
4500
4520
|
o.factory.createIdentifier(a.name)
|
|
4501
4521
|
])
|
|
@@ -4513,13 +4533,13 @@ const Kt = "customElement", Ao = (e, t) => {
|
|
|
4513
4533
|
!1,
|
|
4514
4534
|
void 0,
|
|
4515
4535
|
o.factory.createNamedImports([
|
|
4516
|
-
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(
|
|
4536
|
+
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(_t))
|
|
4517
4537
|
])
|
|
4518
4538
|
),
|
|
4519
4539
|
o.factory.createStringLiteral(s)
|
|
4520
4540
|
), ...e.statements, ...i];
|
|
4521
4541
|
};
|
|
4522
|
-
function
|
|
4542
|
+
function jo(e, t, i) {
|
|
4523
4543
|
return t.size === 0 ? e : [
|
|
4524
4544
|
o.factory.createPropertyDeclaration(
|
|
4525
4545
|
[
|
|
@@ -4534,7 +4554,7 @@ function Lo(e, t, i) {
|
|
|
4534
4554
|
t.entries(),
|
|
4535
4555
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4536
4556
|
Zt(s) ? o.factory.createStringLiteral(s) : s,
|
|
4537
|
-
|
|
4557
|
+
Fo(n, i)
|
|
4538
4558
|
)
|
|
4539
4559
|
)
|
|
4540
4560
|
)
|
|
@@ -4542,7 +4562,7 @@ function Lo(e, t, i) {
|
|
|
4542
4562
|
...e
|
|
4543
4563
|
];
|
|
4544
4564
|
}
|
|
4545
|
-
function
|
|
4565
|
+
function Fo(e, t) {
|
|
4546
4566
|
let i = 0, s = !0;
|
|
4547
4567
|
const n = [], r = [];
|
|
4548
4568
|
for (const d of e.properties)
|
|
@@ -4552,27 +4572,27 @@ function No(e, t) {
|
|
|
4552
4572
|
return !0;
|
|
4553
4573
|
const l = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
|
|
4554
4574
|
if (l === "attribute")
|
|
4555
|
-
return s = !1, i |= m ?
|
|
4575
|
+
return s = !1, i |= m ? ht : 0, !m && !f;
|
|
4556
4576
|
if (l === "reflect")
|
|
4557
|
-
return i |= m ?
|
|
4577
|
+
return i |= m ? fs : 0, !1;
|
|
4558
4578
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4559
4579
|
if (p.text === "Boolean")
|
|
4560
|
-
return i |= fs, !1;
|
|
4561
|
-
if (p.text === "Number")
|
|
4562
4580
|
return i |= gs, !1;
|
|
4581
|
+
if (p.text === "Number")
|
|
4582
|
+
return i |= hs, !1;
|
|
4563
4583
|
} else {
|
|
4564
4584
|
if (l === "state")
|
|
4565
|
-
return s = !1, i |= m ?
|
|
4585
|
+
return s = !1, i |= m ? ys : 0, !1;
|
|
4566
4586
|
if (l === "readOnly")
|
|
4567
|
-
return i |= m ? ys : 0, !1;
|
|
4568
|
-
if (l === "noAccessor")
|
|
4569
4587
|
return i |= m ? vs : 0, !1;
|
|
4570
|
-
if (l === "
|
|
4588
|
+
if (l === "noAccessor")
|
|
4571
4589
|
return i |= m ? bs : 0, !1;
|
|
4590
|
+
if (l === "useDefault")
|
|
4591
|
+
return i |= m ? ws : 0, !1;
|
|
4572
4592
|
}
|
|
4573
4593
|
return !0;
|
|
4574
4594
|
}
|
|
4575
|
-
s && (i |=
|
|
4595
|
+
s && (i |= ht);
|
|
4576
4596
|
const c = o.factory.createNumericLiteral(i);
|
|
4577
4597
|
return n.length === 0 && (t || r.length === 0) ? c : o.factory.createArrayLiteralExpression([
|
|
4578
4598
|
c,
|
|
@@ -4587,7 +4607,7 @@ function No(e, t) {
|
|
|
4587
4607
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4588
4608
|
]);
|
|
4589
4609
|
}
|
|
4590
|
-
function
|
|
4610
|
+
function Do(e, t, i) {
|
|
4591
4611
|
let s = -1, n = -1, r = -1;
|
|
4592
4612
|
e.options?.properties.forEach((p, m) => {
|
|
4593
4613
|
if (o.isSpreadAssignment(p))
|
|
@@ -4599,23 +4619,23 @@ function jo(e, t, i) {
|
|
|
4599
4619
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4600
4620
|
}
|
|
4601
4621
|
});
|
|
4602
|
-
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d =
|
|
4622
|
+
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = Ro(e, i, s), l = [
|
|
4603
4623
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4604
4624
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4605
4625
|
...d !== void 0 ? [d] : []
|
|
4606
4626
|
];
|
|
4607
4627
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4608
4628
|
}
|
|
4609
|
-
function
|
|
4629
|
+
function Ro(e, t, i) {
|
|
4610
4630
|
if (t.attribute === void 0)
|
|
4611
4631
|
return;
|
|
4612
|
-
const s =
|
|
4632
|
+
const s = Oo(t.type.values);
|
|
4613
4633
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4614
4634
|
o.factory.createIdentifier("type"),
|
|
4615
4635
|
o.factory.createIdentifier(s)
|
|
4616
4636
|
);
|
|
4617
4637
|
}
|
|
4618
|
-
function
|
|
4638
|
+
function Oo(e) {
|
|
4619
4639
|
let t = !1, i = !1, s = !1;
|
|
4620
4640
|
if (e?.forEach((n) => {
|
|
4621
4641
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4627,7 +4647,7 @@ function Do(e) {
|
|
|
4627
4647
|
}
|
|
4628
4648
|
return "Other";
|
|
4629
4649
|
}
|
|
4630
|
-
function
|
|
4650
|
+
function Mo(e, t, i, s, n, r) {
|
|
4631
4651
|
if (i.modifiers === void 0)
|
|
4632
4652
|
return i;
|
|
4633
4653
|
let a = -1, c = -1;
|
|
@@ -4637,17 +4657,17 @@ function Ro(e, t, i, s, n, r) {
|
|
|
4637
4657
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4638
4658
|
}
|
|
4639
4659
|
}), a !== -1) {
|
|
4640
|
-
const d =
|
|
4641
|
-
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p,
|
|
4660
|
+
const d = Jo(e, t, i, s, n), l = Ut(i, a, n), p = Do(l, n, d);
|
|
4661
|
+
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Wt(i, a);
|
|
4642
4662
|
} else if (c !== -1) {
|
|
4643
|
-
const d =
|
|
4663
|
+
const d = Ut(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m = ei(i.name);
|
|
4644
4664
|
if (m === void 0)
|
|
4645
4665
|
throw new Error("Failed to statically determine the state property name");
|
|
4646
|
-
return r.set(m, p),
|
|
4666
|
+
return r.set(m, p), Wt(i, c);
|
|
4647
4667
|
} else
|
|
4648
4668
|
return i;
|
|
4649
4669
|
}
|
|
4650
|
-
function
|
|
4670
|
+
function Jo(e, t, i, s, n) {
|
|
4651
4671
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4652
4672
|
members: []
|
|
4653
4673
|
} : void 0);
|
|
@@ -4668,11 +4688,11 @@ function Oo(e, t, i, s, n) {
|
|
|
4668
4688
|
throw Error(
|
|
4669
4689
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4670
4690
|
);
|
|
4671
|
-
c.name = a, c.attribute ??=
|
|
4691
|
+
c.name = a, c.attribute ??= Vt(a);
|
|
4672
4692
|
}
|
|
4673
4693
|
return c;
|
|
4674
4694
|
}
|
|
4675
|
-
function
|
|
4695
|
+
function Ut(e, t, i) {
|
|
4676
4696
|
const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
|
|
4677
4697
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4678
4698
|
throw new Error(
|
|
@@ -4680,7 +4700,7 @@ function _t(e, t, i) {
|
|
|
4680
4700
|
);
|
|
4681
4701
|
return { decorator: s, callExpression: n, options: r };
|
|
4682
4702
|
}
|
|
4683
|
-
function
|
|
4703
|
+
function Wt(e, t) {
|
|
4684
4704
|
const i = [
|
|
4685
4705
|
...e.modifiers.slice(0, t),
|
|
4686
4706
|
...e.modifiers.slice(t + 1)
|
|
@@ -4707,7 +4727,7 @@ function Ut(e, t) {
|
|
|
4707
4727
|
e.initializer
|
|
4708
4728
|
);
|
|
4709
4729
|
}
|
|
4710
|
-
function
|
|
4730
|
+
function Bo(e, t, i, s) {
|
|
4711
4731
|
let n;
|
|
4712
4732
|
if (e.apiJsonEnabled)
|
|
4713
4733
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4730,9 +4750,9 @@ function Mo(e, t, i, s) {
|
|
|
4730
4750
|
} finally {
|
|
4731
4751
|
c = i.statements, i.statements = a;
|
|
4732
4752
|
}
|
|
4733
|
-
return
|
|
4753
|
+
return Ko(i, c);
|
|
4734
4754
|
}
|
|
4735
|
-
const
|
|
4755
|
+
const Ko = (e, t) => o.factory.updateSourceFile(
|
|
4736
4756
|
e,
|
|
4737
4757
|
t,
|
|
4738
4758
|
/*
|
|
@@ -4747,10 +4767,10 @@ const Jo = (e, t) => o.factory.updateSourceFile(
|
|
|
4747
4767
|
e.hasNoDefaultLib,
|
|
4748
4768
|
e.libReferenceDirectives
|
|
4749
4769
|
);
|
|
4750
|
-
function
|
|
4770
|
+
function _o(e, t) {
|
|
4751
4771
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4752
4772
|
}
|
|
4753
|
-
const
|
|
4773
|
+
const Uo = (e, t) => {
|
|
4754
4774
|
let i;
|
|
4755
4775
|
if (t.apiModule !== void 0)
|
|
4756
4776
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4766,16 +4786,16 @@ const Ko = (e, t) => {
|
|
|
4766
4786
|
function n() {
|
|
4767
4787
|
s = /* @__PURE__ */ new Map();
|
|
4768
4788
|
}
|
|
4769
|
-
const r = (d) =>
|
|
4789
|
+
const r = (d) => jo(d, s, t.compiler.shouldMinify);
|
|
4770
4790
|
function a(d, l) {
|
|
4771
|
-
const p =
|
|
4772
|
-
return
|
|
4791
|
+
const p = zo(t, i, d, l, e, s);
|
|
4792
|
+
return _o(p, t), p;
|
|
4773
4793
|
}
|
|
4774
4794
|
return e.statements.map(
|
|
4775
|
-
(d) =>
|
|
4795
|
+
(d) => ns(a, d, t, n, r)
|
|
4776
4796
|
);
|
|
4777
4797
|
};
|
|
4778
|
-
function
|
|
4798
|
+
function ns(e, t, i, s, n = ti) {
|
|
4779
4799
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4780
4800
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4781
4801
|
let r = !1;
|
|
@@ -4798,15 +4818,15 @@ function rs(e, t, i, s, n = ti) {
|
|
|
4798
4818
|
} else
|
|
4799
4819
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4800
4820
|
t,
|
|
4801
|
-
(a) =>
|
|
4821
|
+
(a) => ns(e, a, i, s, n),
|
|
4802
4822
|
i.transformation
|
|
4803
4823
|
) : t;
|
|
4804
4824
|
}
|
|
4805
|
-
const
|
|
4806
|
-
function
|
|
4825
|
+
const Wo = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4826
|
+
function zo(e, t, i, s, n, r) {
|
|
4807
4827
|
if (o.isMethodDeclaration(i)) {
|
|
4808
4828
|
const a = i.modifiers?.filter(
|
|
4809
|
-
(c) => !o.isDecorator(c) || !
|
|
4829
|
+
(c) => !o.isDecorator(c) || !Ho(c)
|
|
4810
4830
|
);
|
|
4811
4831
|
if (a?.length !== i.modifiers?.length)
|
|
4812
4832
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4820,7 +4840,7 @@ function Uo(e, t, i, s, n, r) {
|
|
|
4820
4840
|
i.type,
|
|
4821
4841
|
i.body
|
|
4822
4842
|
);
|
|
4823
|
-
if ("text" in i.name &&
|
|
4843
|
+
if ("text" in i.name && Wo.has(i.name.text) && i.body) {
|
|
4824
4844
|
const c = i.name.text;
|
|
4825
4845
|
return i.body.statements.some(
|
|
4826
4846
|
(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
|
|
@@ -4846,14 +4866,14 @@ function Uo(e, t, i, s, n, r) {
|
|
|
4846
4866
|
);
|
|
4847
4867
|
}
|
|
4848
4868
|
}
|
|
4849
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
4850
|
-
}
|
|
4851
|
-
const
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
|
|
4855
|
-
],
|
|
4856
|
-
name:
|
|
4869
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? Mo(e, t, i, s, n, r) : i;
|
|
4870
|
+
}
|
|
4871
|
+
const Ho = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", qo = [
|
|
4872
|
+
xo,
|
|
4873
|
+
No,
|
|
4874
|
+
Uo
|
|
4875
|
+
], Vo = "@arcgis/lumina:transformComponents", Go = (e) => ({
|
|
4876
|
+
name: Vo,
|
|
4857
4877
|
transform: {
|
|
4858
4878
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
4859
4879
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -4867,14 +4887,14 @@ const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4867
4887
|
await Promise.all(
|
|
4868
4888
|
// False alarm because of |undefined.
|
|
4869
4889
|
// eslint-disable-next-line @typescript-eslint/await-thenable
|
|
4870
|
-
e.apiJsonDeferred === void 0 ? [
|
|
4890
|
+
e.apiJsonDeferred === void 0 ? [ie] : [ie, e.apiJsonDeferred.promise]
|
|
4871
4891
|
);
|
|
4872
4892
|
const s = e.getSourceFile(i, t), r = o.transform(s, [
|
|
4873
|
-
(m) => () =>
|
|
4893
|
+
(m) => () => Bo(e, m, s, [
|
|
4874
4894
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4875
|
-
...
|
|
4895
|
+
...qo
|
|
4876
4896
|
])
|
|
4877
|
-
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 :
|
|
4897
|
+
]).transformed[0], a = e._typeScriptPrinter, c = e.viteConfig.build.sourcemap === !1 ? void 0 : yt.createSourceMapGenerator(Xo, u.basename(i), "", u.dirname(i), {}), d = yt.createTextWriter(`
|
|
4878
4898
|
`);
|
|
4879
4899
|
a.writeFile(r, d, c);
|
|
4880
4900
|
const l = d.getText(), p = c?.toJSON();
|
|
@@ -4884,42 +4904,42 @@ const Wo = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
4884
4904
|
};
|
|
4885
4905
|
}
|
|
4886
4906
|
}
|
|
4887
|
-
}),
|
|
4907
|
+
}), Xo = {
|
|
4888
4908
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
4889
4909
|
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ti : (e) => e.toLowerCase()
|
|
4890
|
-
},
|
|
4910
|
+
}, Yo = (e) => ({
|
|
4891
4911
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
4892
4912
|
configureServer(t) {
|
|
4893
|
-
e.server = t,
|
|
4913
|
+
e.server = t, zt(e).forEach(({ assets: i, transformers: s }) => Z(e, i, s));
|
|
4894
4914
|
},
|
|
4895
4915
|
async writeBundle() {
|
|
4896
4916
|
await Promise.all(
|
|
4897
|
-
|
|
4898
|
-
async ({ assets: t, transformers: i }) => await
|
|
4917
|
+
zt(e).map(
|
|
4918
|
+
async ({ assets: t, transformers: i }) => await Ci(e, t, i)
|
|
4899
4919
|
)
|
|
4900
4920
|
);
|
|
4901
4921
|
}
|
|
4902
4922
|
});
|
|
4903
|
-
function
|
|
4923
|
+
function zt(e) {
|
|
4904
4924
|
const t = [], i = e.assetsToProvide?.filter((s) => s.apply === void 0 || s.apply === e.viteCommand) ?? [];
|
|
4905
4925
|
return e.options.assets?.extra?.forEach((s) => {
|
|
4906
4926
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
4907
4927
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
4908
4928
|
}
|
|
4909
|
-
const Ze = "@arcgis/lumina:updatePackageJson",
|
|
4929
|
+
const Ze = "@arcgis/lumina:updatePackageJson", Qo = (e) => ({
|
|
4910
4930
|
name: Ze,
|
|
4911
4931
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
4912
4932
|
configResolved() {
|
|
4913
|
-
|
|
4933
|
+
Zo(e).catch(
|
|
4914
4934
|
(t) => $.error(Ze, `Failed to update package's package.json:${String(t)}`)
|
|
4915
4935
|
);
|
|
4916
4936
|
}
|
|
4917
4937
|
});
|
|
4918
|
-
async function
|
|
4919
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s =
|
|
4938
|
+
async function Zo(e) {
|
|
4939
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = ea(i, e);
|
|
4920
4940
|
s && Qt(t, JSON.stringify(s, null, 2));
|
|
4921
4941
|
}
|
|
4922
|
-
function
|
|
4942
|
+
function ea(e, t) {
|
|
4923
4943
|
const i = e?.devDependencies ?? {};
|
|
4924
4944
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
4925
4945
|
l in i || $.warn(
|
|
@@ -4945,7 +4965,7 @@ function Qo(e, t) {
|
|
|
4945
4965
|
const l = n(r.webTypes);
|
|
4946
4966
|
e["web-types"] !== l && (s = !0, e["web-types"] = l);
|
|
4947
4967
|
}
|
|
4948
|
-
const a = `./${Y}.css`, c = t.options.build?.cdn?.namespace !== void 0, d =
|
|
4968
|
+
const a = `./${Y}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = fe(
|
|
4949
4969
|
t.dir.root,
|
|
4950
4970
|
u.join(t.dir.distCdn, a)
|
|
4951
4971
|
);
|
|
@@ -4958,21 +4978,21 @@ function Qo(e, t) {
|
|
|
4958
4978
|
if (s)
|
|
4959
4979
|
return e;
|
|
4960
4980
|
}
|
|
4961
|
-
const
|
|
4981
|
+
const ta = (e) => ({
|
|
4962
4982
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
4963
4983
|
timestamp: e.apiJson.timestamp,
|
|
4964
4984
|
compiler: e.apiJson.compiler,
|
|
4965
|
-
components:
|
|
4985
|
+
components: ia(e),
|
|
4966
4986
|
typeLibrary: {}
|
|
4967
4987
|
});
|
|
4968
|
-
function
|
|
4988
|
+
function ia(e) {
|
|
4969
4989
|
const t = [];
|
|
4970
4990
|
for (const i of e.apiJson.modules)
|
|
4971
4991
|
for (const s of i.declarations)
|
|
4972
|
-
s.customElement === !0 && t.push(
|
|
4992
|
+
s.customElement === !0 && t.push(sa(s, i.sourcePath));
|
|
4973
4993
|
return t;
|
|
4974
4994
|
}
|
|
4975
|
-
function
|
|
4995
|
+
function sa(e, t) {
|
|
4976
4996
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
4977
4997
|
return {
|
|
4978
4998
|
filePath: t,
|
|
@@ -4987,9 +5007,9 @@ function ta(e, t) {
|
|
|
4987
5007
|
dependencies: [],
|
|
4988
5008
|
dependencyGraph: {},
|
|
4989
5009
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
4990
|
-
props: e.members.map(
|
|
4991
|
-
methods: e.members.map(
|
|
4992
|
-
events: e.events?.map(
|
|
5010
|
+
props: e.members.map(ra).filter(j),
|
|
5011
|
+
methods: e.members.map(na).filter(j),
|
|
5012
|
+
events: e.events?.map(oa) ?? [],
|
|
4993
5013
|
styles: e.cssProperties?.map((s) => ({
|
|
4994
5014
|
name: s.name,
|
|
4995
5015
|
annotation: "prop",
|
|
@@ -5001,7 +5021,7 @@ function ta(e, t) {
|
|
|
5001
5021
|
listeners: []
|
|
5002
5022
|
};
|
|
5003
5023
|
}
|
|
5004
|
-
function
|
|
5024
|
+
function ra(e) {
|
|
5005
5025
|
if (e.kind !== "field")
|
|
5006
5026
|
return;
|
|
5007
5027
|
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;
|
|
@@ -5011,7 +5031,7 @@ function ia(e) {
|
|
|
5011
5031
|
complexType: t.type === void 0 ? void 0 : {
|
|
5012
5032
|
original: t.type.text,
|
|
5013
5033
|
resolved: t.type.text,
|
|
5014
|
-
references:
|
|
5034
|
+
references: mt(t.type.references)
|
|
5015
5035
|
},
|
|
5016
5036
|
mutable: !0,
|
|
5017
5037
|
attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
|
|
@@ -5030,19 +5050,19 @@ function ia(e) {
|
|
|
5030
5050
|
required: n
|
|
5031
5051
|
};
|
|
5032
5052
|
}
|
|
5033
|
-
const
|
|
5053
|
+
const mt = (e) => Object.fromEntries(
|
|
5034
5054
|
e?.map(
|
|
5035
5055
|
(t) => [
|
|
5036
5056
|
t.name,
|
|
5037
5057
|
{
|
|
5038
|
-
location: t.package ===
|
|
5058
|
+
location: t.package === Cs ? "global" : t.package === void 0 ? "local" : "import",
|
|
5039
5059
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
5040
5060
|
id: "notImplemented"
|
|
5041
5061
|
}
|
|
5042
5062
|
]
|
|
5043
5063
|
) ?? []
|
|
5044
5064
|
);
|
|
5045
|
-
function
|
|
5065
|
+
function na(e) {
|
|
5046
5066
|
if (e.kind !== "method")
|
|
5047
5067
|
return;
|
|
5048
5068
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5061,7 +5081,7 @@ function sa(e) {
|
|
|
5061
5081
|
signature: t.signature ?? "()=>unknown",
|
|
5062
5082
|
parameters: s,
|
|
5063
5083
|
return: t.return?.type?.text ?? "void",
|
|
5064
|
-
references:
|
|
5084
|
+
references: mt([
|
|
5065
5085
|
...t.return?.type?.references ?? [],
|
|
5066
5086
|
...t.parameters?.flatMap((n) => n.type.references ?? []) ?? []
|
|
5067
5087
|
])
|
|
@@ -5073,7 +5093,7 @@ function sa(e) {
|
|
|
5073
5093
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5074
5094
|
};
|
|
5075
5095
|
}
|
|
5076
|
-
function
|
|
5096
|
+
function oa(e) {
|
|
5077
5097
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5078
5098
|
return {
|
|
5079
5099
|
event: e.name,
|
|
@@ -5082,7 +5102,7 @@ function ra(e) {
|
|
|
5082
5102
|
complexType: {
|
|
5083
5103
|
original: e.type.text,
|
|
5084
5104
|
resolved: e.type.text,
|
|
5085
|
-
references:
|
|
5105
|
+
references: mt(e.type.references)
|
|
5086
5106
|
},
|
|
5087
5107
|
cancelable: e.cancelable ?? !0,
|
|
5088
5108
|
composed: e.composed ?? !0,
|
|
@@ -5091,18 +5111,18 @@ function ra(e) {
|
|
|
5091
5111
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated
|
|
5092
5112
|
};
|
|
5093
5113
|
}
|
|
5094
|
-
const
|
|
5114
|
+
const os = (e) => e.flatMap(
|
|
5095
5115
|
(t) => t.cssProperties?.map((i) => ({
|
|
5096
5116
|
name: i.name,
|
|
5097
5117
|
description: i.description || void 0
|
|
5098
5118
|
})) ?? []
|
|
5099
|
-
),
|
|
5119
|
+
), as = (e) => e.flatMap(
|
|
5100
5120
|
(t) => t.cssParts?.map((i) => ({
|
|
5101
5121
|
name: `::part(${i.name})`,
|
|
5102
5122
|
description: i.description || void 0
|
|
5103
5123
|
})) ?? []
|
|
5104
5124
|
);
|
|
5105
|
-
function
|
|
5125
|
+
function aa(e) {
|
|
5106
5126
|
if (e.attributes === void 0)
|
|
5107
5127
|
return [];
|
|
5108
5128
|
const t = [];
|
|
@@ -5110,10 +5130,10 @@ function na(e) {
|
|
|
5110
5130
|
const s = e.members[i];
|
|
5111
5131
|
s.kind === "field" && s.attribute !== void 0 && t.push({
|
|
5112
5132
|
name: s.attribute,
|
|
5113
|
-
description:
|
|
5133
|
+
description: je(s.description, s.deprecated) || void 0,
|
|
5114
5134
|
default: s.default,
|
|
5115
5135
|
value: {
|
|
5116
|
-
type:
|
|
5136
|
+
type: la(
|
|
5117
5137
|
s.type.values?.map(
|
|
5118
5138
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5119
5139
|
)
|
|
@@ -5123,44 +5143,44 @@ function na(e) {
|
|
|
5123
5143
|
}
|
|
5124
5144
|
return t;
|
|
5125
5145
|
}
|
|
5126
|
-
const
|
|
5146
|
+
const la = (e) => e?.length === 1 ? e[0] : e, je = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ge = {
|
|
5127
5147
|
slots: "Slots",
|
|
5128
5148
|
events: "Events",
|
|
5129
5149
|
cssProperties: "CSS Properties",
|
|
5130
5150
|
cssParts: "CSS Parts",
|
|
5131
5151
|
methods: "Methods"
|
|
5132
5152
|
};
|
|
5133
|
-
function
|
|
5134
|
-
const t =
|
|
5153
|
+
function ls(e) {
|
|
5154
|
+
const t = ca(e.slots), i = da(e.events), s = pa(e.cssProperties), n = ma(e.cssParts), r = ua(e.members), a = je(e.description, e.deprecated).trim();
|
|
5135
5155
|
return [...a ? [`${a}
|
|
5136
5156
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5137
5157
|
|
|
5138
5158
|
`);
|
|
5139
5159
|
}
|
|
5140
|
-
const
|
|
5160
|
+
const he = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5141
5161
|
${t.join(`
|
|
5142
|
-
`)}`,
|
|
5143
|
-
|
|
5162
|
+
`)}`, ca = (e) => he(
|
|
5163
|
+
ge.slots,
|
|
5144
5164
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
5145
|
-
),
|
|
5146
|
-
|
|
5165
|
+
), da = (e) => he(
|
|
5166
|
+
ge.events,
|
|
5147
5167
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
5148
|
-
),
|
|
5149
|
-
|
|
5168
|
+
), pa = (e = []) => he(
|
|
5169
|
+
ge.cssProperties,
|
|
5150
5170
|
e?.map(
|
|
5151
5171
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5152
5172
|
)
|
|
5153
|
-
),
|
|
5154
|
-
|
|
5173
|
+
), ma = (e) => he(
|
|
5174
|
+
ge.cssParts,
|
|
5155
5175
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
5156
|
-
),
|
|
5157
|
-
|
|
5176
|
+
), ua = (e) => he(
|
|
5177
|
+
ge.methods,
|
|
5158
5178
|
e.filter(Es).map(
|
|
5159
|
-
(t) => [`- \`${t.name}${t.signature}\``,
|
|
5179
|
+
(t) => [`- \`${t.name}${t.signature}\``, je(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
5160
5180
|
)
|
|
5161
5181
|
);
|
|
5162
|
-
function
|
|
5163
|
-
const i =
|
|
5182
|
+
function fa(e, t) {
|
|
5183
|
+
const i = ga(e), s = os(e), n = as(e), r = R();
|
|
5164
5184
|
return {
|
|
5165
5185
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5166
5186
|
name: r.name,
|
|
@@ -5178,113 +5198,113 @@ function ma(e, t) {
|
|
|
5178
5198
|
}
|
|
5179
5199
|
};
|
|
5180
5200
|
}
|
|
5181
|
-
const
|
|
5201
|
+
const ga = (e) => e.map((t) => ({
|
|
5182
5202
|
name: t.tagName,
|
|
5183
|
-
description:
|
|
5203
|
+
description: ls(t),
|
|
5184
5204
|
"doc-url": t.demos?.[0]?.url,
|
|
5185
|
-
attributes:
|
|
5205
|
+
attributes: aa(t),
|
|
5186
5206
|
slots: t.slots?.map((i) => ({
|
|
5187
5207
|
name: i.name,
|
|
5188
5208
|
description: i.description
|
|
5189
5209
|
})),
|
|
5190
5210
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5191
|
-
events:
|
|
5211
|
+
events: Ht(t),
|
|
5192
5212
|
js: {
|
|
5193
|
-
properties:
|
|
5194
|
-
events:
|
|
5213
|
+
properties: ha(t),
|
|
5214
|
+
events: Ht(t)
|
|
5195
5215
|
}
|
|
5196
|
-
})),
|
|
5216
|
+
})), ha = (e) => e.members.filter(Ts).map((t) => ({
|
|
5197
5217
|
name: t.name,
|
|
5198
5218
|
description: t.description,
|
|
5199
5219
|
type: t.type?.text
|
|
5200
|
-
})) ?? [],
|
|
5220
|
+
})) ?? [], Ht = (e) => e.events?.map((t) => ({
|
|
5201
5221
|
name: t.name,
|
|
5202
5222
|
type: t.type?.text,
|
|
5203
5223
|
description: t.description
|
|
5204
|
-
})) ?? [],
|
|
5224
|
+
})) ?? [], ya = (e) => e.map((t) => ({
|
|
5205
5225
|
name: t.tagName,
|
|
5206
|
-
description:
|
|
5207
|
-
attributes:
|
|
5226
|
+
description: ls(t),
|
|
5227
|
+
attributes: va(t),
|
|
5208
5228
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5209
|
-
})),
|
|
5229
|
+
})), va = (e) => e.attributes?.map((t) => ({
|
|
5210
5230
|
name: t.name,
|
|
5211
|
-
description:
|
|
5212
|
-
values:
|
|
5213
|
-
})) ?? [],
|
|
5231
|
+
description: je(t.description, t.deprecated) || void 0,
|
|
5232
|
+
values: ba(t)
|
|
5233
|
+
})) ?? [], ba = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], wa = (e) => ({
|
|
5214
5234
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5215
5235
|
version: 1.1,
|
|
5216
|
-
tags:
|
|
5217
|
-
}),
|
|
5236
|
+
tags: ya(e)
|
|
5237
|
+
}), Sa = (e) => ({
|
|
5218
5238
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5219
5239
|
version: 1.1,
|
|
5220
|
-
properties:
|
|
5221
|
-
pseudoElements:
|
|
5222
|
-
}),
|
|
5223
|
-
function
|
|
5240
|
+
properties: os(e),
|
|
5241
|
+
pseudoElements: as(e)
|
|
5242
|
+
}), Ca = "@arcgis/lumina:generateDocs";
|
|
5243
|
+
function Ea(e) {
|
|
5224
5244
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5225
5245
|
{
|
|
5226
5246
|
type: "dynamic",
|
|
5227
|
-
source: () => JSON.stringify(
|
|
5247
|
+
source: () => JSON.stringify(ta(e), null, Qe(e)),
|
|
5228
5248
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5229
5249
|
}
|
|
5230
5250
|
]), {
|
|
5231
|
-
name:
|
|
5251
|
+
name: Ca,
|
|
5232
5252
|
async writeBundle() {
|
|
5233
5253
|
if (e.isInStorybook)
|
|
5234
5254
|
return;
|
|
5235
5255
|
const t = Qe(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(j);
|
|
5236
5256
|
if (c.length === 0)
|
|
5237
5257
|
return;
|
|
5238
|
-
await
|
|
5258
|
+
await Ii(c);
|
|
5239
5259
|
const d = [];
|
|
5240
5260
|
if (n !== void 0) {
|
|
5241
|
-
const l = JSON.stringify(
|
|
5261
|
+
const l = JSON.stringify(wa(e.apiJsonComponents), null, t);
|
|
5242
5262
|
d.push(_(n, l));
|
|
5243
5263
|
}
|
|
5244
5264
|
if (r !== void 0) {
|
|
5245
|
-
const l = JSON.stringify(
|
|
5265
|
+
const l = JSON.stringify(Sa(e.apiJsonComponents), null, t);
|
|
5246
5266
|
d.push(_(r, l));
|
|
5247
5267
|
}
|
|
5248
5268
|
if (a !== void 0) {
|
|
5249
|
-
const l =
|
|
5269
|
+
const l = fa(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5250
5270
|
d.push(_(a, JSON.stringify(l, null, t)));
|
|
5251
5271
|
}
|
|
5252
5272
|
await Promise.all(d);
|
|
5253
5273
|
}
|
|
5254
5274
|
};
|
|
5255
5275
|
}
|
|
5256
|
-
function
|
|
5276
|
+
function Ta(e) {
|
|
5257
5277
|
return {
|
|
5258
5278
|
name: "@arcgis/lumina:buildWrappers",
|
|
5259
5279
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5260
5280
|
async writeBundle() {
|
|
5261
5281
|
e.isInStorybook || await Promise.all(
|
|
5262
5282
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5263
|
-
t.type === "react18" && await
|
|
5283
|
+
t.type === "react18" && await Ia(e, t);
|
|
5264
5284
|
}) ?? []
|
|
5265
5285
|
);
|
|
5266
5286
|
}
|
|
5267
5287
|
};
|
|
5268
5288
|
}
|
|
5269
|
-
const
|
|
5270
|
-
import React from "${
|
|
5271
|
-
import { createComponent } from "${
|
|
5272
|
-
import type { EventName } from "${
|
|
5289
|
+
const $a = "react", qt = "@lit/react", Pa = `
|
|
5290
|
+
import React from "${$a}";
|
|
5291
|
+
import { createComponent } from "${qt}";
|
|
5292
|
+
import type { EventName } from "${qt}";
|
|
5273
5293
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5274
5294
|
|
|
5275
5295
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5276
5296
|
`;
|
|
5277
|
-
async function
|
|
5297
|
+
async function Ia(e, t) {
|
|
5278
5298
|
const { name: i } = R(), s = [];
|
|
5279
5299
|
for (const a of e.apiJson.modules)
|
|
5280
5300
|
for (const c of a.declarations)
|
|
5281
|
-
c.customElement === !0 && s.push(
|
|
5282
|
-
const n = [`/// <reference types="${i}" preserve="true" />`,
|
|
5301
|
+
c.customElement === !0 && s.push(ka(c));
|
|
5302
|
+
const n = [`/// <reference types="${i}" preserve="true" />`, Pa, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5283
5303
|
await V(u.dirname(r), { recursive: !0 }), await _(r, n);
|
|
5284
5304
|
}
|
|
5285
|
-
function
|
|
5305
|
+
function ka(e) {
|
|
5286
5306
|
const t = e.events?.map(
|
|
5287
|
-
(i) => ` ${
|
|
5307
|
+
(i) => ` ${Os(`on${ps(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5288
5308
|
).join(`
|
|
5289
5309
|
`);
|
|
5290
5310
|
return `
|
|
@@ -5299,41 +5319,41 @@ ${t}
|
|
|
5299
5319
|
);
|
|
5300
5320
|
`;
|
|
5301
5321
|
}
|
|
5302
|
-
function
|
|
5322
|
+
function il(e = {}) {
|
|
5303
5323
|
const t = new P(e), s = [
|
|
5304
5324
|
t._plugin,
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
qo(t),
|
|
5311
|
-
zn(t),
|
|
5312
|
-
rr(t),
|
|
5313
|
-
Cn(t),
|
|
5325
|
+
Nn(t),
|
|
5326
|
+
jn(t),
|
|
5327
|
+
Qo(t),
|
|
5328
|
+
Tn(t),
|
|
5329
|
+
Ea(t),
|
|
5314
5330
|
Go(t),
|
|
5315
5331
|
qn(t),
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5332
|
+
nr(t),
|
|
5333
|
+
$n(t),
|
|
5334
|
+
Yo(t),
|
|
5335
|
+
Gn(t),
|
|
5336
|
+
Mn(t),
|
|
5337
|
+
Js(t),
|
|
5338
|
+
Qr(t),
|
|
5339
|
+
Ta(t),
|
|
5340
|
+
Pn(t)
|
|
5321
5341
|
].filter(j);
|
|
5322
5342
|
return s.context = t, s;
|
|
5323
5343
|
}
|
|
5324
|
-
const
|
|
5344
|
+
const sl = {
|
|
5325
5345
|
initializeComponentDependencies: yi,
|
|
5326
|
-
updateLuminaTs:
|
|
5346
|
+
updateLuminaTs: Ki,
|
|
5327
5347
|
propertyToAttributeMappings: U,
|
|
5328
5348
|
nativeEvents: ni,
|
|
5329
|
-
svgElements:
|
|
5330
|
-
mathMlElements:
|
|
5349
|
+
svgElements: it,
|
|
5350
|
+
mathMlElements: st,
|
|
5331
5351
|
alwaysAttributes: ii,
|
|
5332
5352
|
nativeAlwaysAttributes: si,
|
|
5333
|
-
htmlAlwaysAttributes:
|
|
5353
|
+
htmlAlwaysAttributes: qe
|
|
5334
5354
|
};
|
|
5335
5355
|
export {
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5356
|
+
sl as exportsForCodemod,
|
|
5357
|
+
Le as inferCdnUrl,
|
|
5358
|
+
il as useLumina
|
|
5339
5359
|
};
|