@arcgis/lumina-compiler 6.0.0-next.13 → 6.0.0-next.14
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 +643 -694
- package/dist/options.d.ts +0 -32
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { externalizeDependencies as
|
|
2
|
-
import { isNotUndefined as
|
|
1
|
+
import { externalizeDependencies as Cs } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
|
|
2
|
+
import { isNotUndefined as F } from "@arcgis/toolkit/predicate";
|
|
3
3
|
import { f as b, l as T } from "./chunks/logger.js";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { camelToKebab as
|
|
6
|
-
import { lazyMetaSubItemJoiner as
|
|
7
|
-
import { path as u, isPosix as
|
|
8
|
-
import { isApiMethodAsync as
|
|
5
|
+
import { camelToKebab as ri, getPreamble as Es, uncapitalize as Et } from "@arcgis/toolkit/string";
|
|
6
|
+
import { lazyMetaSubItemJoiner as Ts, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as $s, propertyFlagAttribute as Tt, propertyFlagReflect as Ps, propertyFlagBoolean as ks, propertyFlagNumber as Is, propertyFlagState as xs, propertyFlagReadOnly as As, propertyFlagNoAccessor as Ls, propertyFlagUseDefault as Ns } from "@arcgis/lumina/config";
|
|
7
|
+
import { path as u, isPosix as ni, toPosixPathSeparators as G, toSystemPathSeparators as De, getCwd as oi } from "@arcgis/node-toolkit/path";
|
|
8
|
+
import { isApiMethodAsync as js, globalPackageIdentifier as Fs, isApiMethod as Ds, isApiProperty as Rs } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
9
|
import { existsAsync as K, findPath as at } from "@arcgis/node-toolkit/file";
|
|
10
|
-
import { readFile as
|
|
11
|
-
import { retrievePackageJson as
|
|
12
|
-
import { build as
|
|
13
|
-
import
|
|
14
|
-
import { forEachWithConcurrency as
|
|
15
|
-
import { glob as
|
|
10
|
+
import { readFile as W, readdir as ct, mkdir as ie, writeFile as z, copyFile as Os, rm as Ms, cp as Js } from "node:fs/promises";
|
|
11
|
+
import { retrievePackageJson as D, fetchPackageLocation as $e, asyncRetrievePackageJson as ai } from "@arcgis/node-toolkit/packageJson";
|
|
12
|
+
import { build as Bs } from "esbuild";
|
|
13
|
+
import Ks from "mime-types";
|
|
14
|
+
import { forEachWithConcurrency as _s } from "@arcgis/toolkit/promise";
|
|
15
|
+
import { glob as Us } from "tinyglobby";
|
|
16
16
|
import { renameComponentFolder as Ge } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
17
|
-
import { readFileSync as
|
|
18
|
-
import { useApiExtractor as
|
|
19
|
-
import { styleText as
|
|
20
|
-
import { unsafeGetUndocumentedPrinter as
|
|
17
|
+
import { readFileSync as Ws, writeFileSync as ci } from "node:fs";
|
|
18
|
+
import { useApiExtractor as zs } from "@arcgis/api-extractor/vite/plugin";
|
|
19
|
+
import { styleText as qs } from "node:util";
|
|
20
|
+
import { unsafeGetUndocumentedPrinter as Hs, unsafeUndocumentedTs as $t } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
21
21
|
import { pathIsComponentEntrypoint as Pe } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
22
|
-
import { loadApiExtractorConfig as
|
|
23
|
-
import { loadTypeScriptConfig as
|
|
22
|
+
import { loadApiExtractorConfig as Vs, mergeApiExtractorConfigs as Pt } from "@arcgis/api-extractor/extractor/config";
|
|
23
|
+
import { loadTypeScriptConfig as Gs } from "@arcgis/node-toolkit/vite/typeScript";
|
|
24
24
|
import { mappedFind as Xe } from "@arcgis/toolkit/array";
|
|
25
|
-
import { isPropertyEscapeNeeded as
|
|
26
|
-
import { getPackageNameFromExternalSpecifier as
|
|
27
|
-
import { identity as
|
|
28
|
-
function
|
|
29
|
-
const t = e.options?.build?.dependencies ?? {}, i =
|
|
25
|
+
import { isPropertyEscapeNeeded as li } from "@arcgis/api-extractor/utils/partPrinter";
|
|
26
|
+
import { getPackageNameFromExternalSpecifier as Xs, getMemberName as di } from "@arcgis/api-extractor/utils/astHelpers";
|
|
27
|
+
import { identity as pi } from "@arcgis/toolkit/function";
|
|
28
|
+
function Ys(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 er(e) {
|
|
|
42
42
|
e.isInStorybook && (i.resolveId = void 0);
|
|
43
43
|
}, i;
|
|
44
44
|
}
|
|
45
|
-
const
|
|
45
|
+
const Qs = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), ui = /* @__PURE__ */ new Set([
|
|
46
46
|
/**
|
|
47
47
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
48
48
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -74,7 +74,7 @@ const tr = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
74
74
|
"vocab",
|
|
75
75
|
// These don't exist as a property, only as an attribute
|
|
76
76
|
"exportParts"
|
|
77
|
-
]),
|
|
77
|
+
]), mi = /* @__PURE__ */ new Set([
|
|
78
78
|
/*
|
|
79
79
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
80
80
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -100,7 +100,7 @@ const tr = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
100
100
|
meta: /* @__PURE__ */ new Set(["charset"]),
|
|
101
101
|
math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
|
|
102
102
|
menu: /* @__PURE__ */ new Set(["label", "type"])
|
|
103
|
-
},
|
|
103
|
+
}, _ = {
|
|
104
104
|
common: {
|
|
105
105
|
reflected: {
|
|
106
106
|
hidden: "hidden",
|
|
@@ -913,9 +913,9 @@ const tr = "Fragment", Be = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__P
|
|
|
913
913
|
}
|
|
914
914
|
}
|
|
915
915
|
};
|
|
916
|
-
|
|
917
|
-
Object.values(
|
|
918
|
-
function
|
|
916
|
+
fi(_.common);
|
|
917
|
+
Object.values(_.perElement).forEach(fi);
|
|
918
|
+
function fi(e) {
|
|
919
919
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
920
920
|
/* @__PURE__ */ Object.create(null),
|
|
921
921
|
e.stringifiedReflected
|
|
@@ -924,7 +924,7 @@ function gi(e) {
|
|
|
924
924
|
e.stringifiedNonReflected
|
|
925
925
|
));
|
|
926
926
|
}
|
|
927
|
-
const kt = /* @__PURE__ */ new Set(["itemScope"]),
|
|
927
|
+
const kt = /* @__PURE__ */ new Set(["itemScope"]), gi = /* @__PURE__ */ new Set([
|
|
928
928
|
"abort",
|
|
929
929
|
"animationCancel",
|
|
930
930
|
"animationEnd",
|
|
@@ -1023,7 +1023,7 @@ const kt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1023
1023
|
"volumeChange",
|
|
1024
1024
|
"waiting",
|
|
1025
1025
|
"wheel"
|
|
1026
|
-
]),
|
|
1026
|
+
]), Zs = /* @__PURE__ */ new Set([
|
|
1027
1027
|
"area",
|
|
1028
1028
|
"base",
|
|
1029
1029
|
"br",
|
|
@@ -1099,7 +1099,7 @@ const kt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1099
1099
|
"tspan",
|
|
1100
1100
|
"use",
|
|
1101
1101
|
"view"
|
|
1102
|
-
]),
|
|
1102
|
+
]), er = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), dt = /* @__PURE__ */ new Set([
|
|
1103
1103
|
"annotation-xml",
|
|
1104
1104
|
"annotation",
|
|
1105
1105
|
"maction",
|
|
@@ -1131,7 +1131,7 @@ const kt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1131
1131
|
"munder",
|
|
1132
1132
|
"munderover",
|
|
1133
1133
|
"semantics"
|
|
1134
|
-
]),
|
|
1134
|
+
]), tr = /* @__PURE__ */ new Set([
|
|
1135
1135
|
"annotation-xml",
|
|
1136
1136
|
"color-profile",
|
|
1137
1137
|
"font-face",
|
|
@@ -1141,7 +1141,7 @@ const kt = /* @__PURE__ */ new Set(["itemScope"]), hi = /* @__PURE__ */ new Set(
|
|
|
1141
1141
|
"font-face-name",
|
|
1142
1142
|
"missing-glyph"
|
|
1143
1143
|
]);
|
|
1144
|
-
function
|
|
1144
|
+
function ir(e) {
|
|
1145
1145
|
if (e.length === 0)
|
|
1146
1146
|
return "";
|
|
1147
1147
|
const t = e[0];
|
|
@@ -1154,11 +1154,11 @@ function nr(e) {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
return e.trim().length === 0 ? t : e;
|
|
1156
1156
|
}
|
|
1157
|
-
const
|
|
1157
|
+
const sr = (e) => e.replaceAll("\\", "\\\\").replace(rr, "\\${").replaceAll("`", "\\`"), rr = /\$\{/gu, nr = (e) => !or.test(e), or = /^[^\s"'=<>`]+$/u, ar = /[&<>]/gu, cr = {
|
|
1158
1158
|
"&": "&",
|
|
1159
1159
|
"<": "<",
|
|
1160
1160
|
">": ">"
|
|
1161
|
-
},
|
|
1161
|
+
}, hi = (e) => e.replace(ar, (t) => cr[t]), pt = (e) => typeof e == "string" && e.includes("-") && !tr.has(e), lr = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", X = "staticSvg", ce = "html", se = "svg", yi = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), vi = "css", bi = "mathml", wi = [vi, ce, bi, ae, X, se], dr = new Set(wi), pr = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], ur = "nothing", mr = [...lr, ...wi, ...pr, ur], fr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => fe(t)), fe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), re = {
|
|
1162
1162
|
[ce]: ["lit", "lit/html.js", "lit-html"],
|
|
1163
1163
|
/**
|
|
1164
1164
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1168,9 +1168,9 @@ const or = (e) => e.replaceAll("\\", "\\\\").replace(ar, "\\${").replaceAll("`",
|
|
|
1168
1168
|
*/
|
|
1169
1169
|
[ae]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1170
1170
|
[se]: ["lit", "lit-html", "lit/html.js"],
|
|
1171
|
-
[
|
|
1172
|
-
[
|
|
1173
|
-
[
|
|
1171
|
+
[X]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1172
|
+
[bi]: ["lit", "lit-html", "lit/html.js"],
|
|
1173
|
+
[vi]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
1174
1174
|
safeClassMap: ["@arcgis/lumina"],
|
|
1175
1175
|
safeStyleMap: ["@arcgis/lumina"],
|
|
1176
1176
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -1180,7 +1180,7 @@ const or = (e) => e.replaceAll("\\", "\\\\").replace(ar, "\\${").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
|
+
}, gr = /* @__PURE__ */ new Set([
|
|
1184
1184
|
"h",
|
|
1185
1185
|
"Fragment",
|
|
1186
1186
|
"state",
|
|
@@ -1190,7 +1190,7 @@ const or = (e) => e.replaceAll("\\", "\\\\").replace(ar, "\\${").replaceAll("`",
|
|
|
1190
1190
|
"bindProperty",
|
|
1191
1191
|
"bindEvent",
|
|
1192
1192
|
"bindAttribute"
|
|
1193
|
-
]),
|
|
1193
|
+
]), hr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, de = "@arcgis/lumina:loadLitCss", Ie = "?litCss", Y = "?layeredLitCss", Ze = "?globalFileLitCss", yr = (e) => ({
|
|
1194
1194
|
name: de,
|
|
1195
1195
|
enforce: "pre",
|
|
1196
1196
|
configResolved(t) {
|
|
@@ -1224,20 +1224,20 @@ const or = (e) => e.replaceAll("\\", "\\\\").replace(ar, "\\${").replaceAll("`",
|
|
|
1224
1224
|
async handler(r, a) {
|
|
1225
1225
|
const c = a.endsWith(Ie);
|
|
1226
1226
|
c && (a = a.slice(0, -Ie.length));
|
|
1227
|
-
const d = a.endsWith(
|
|
1228
|
-
d && (a = a.slice(0, -
|
|
1227
|
+
const d = a.endsWith(Y);
|
|
1228
|
+
d && (a = a.slice(0, -Y.length));
|
|
1229
1229
|
const l = a.endsWith(Ze);
|
|
1230
1230
|
if (l && (a = a.slice(0, -Ze.length)), !c && !d && !l)
|
|
1231
1231
|
return await s.handler.call(this, r, a);
|
|
1232
1232
|
const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1233
|
-
return typeof f != "string" || !f.startsWith(
|
|
1233
|
+
return typeof f != "string" || !f.startsWith(Si) || !f.endsWith(vr) ? (T.warn(
|
|
1234
1234
|
de,
|
|
1235
1235
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1236
1236
|
f
|
|
1237
1237
|
)}`
|
|
1238
|
-
), m) : l ? (e._globalCssString =
|
|
1238
|
+
), m) : l ? (e._globalCssString = Ci(f), { code: "", map: { mappings: "" } }) : {
|
|
1239
1239
|
...g,
|
|
1240
|
-
code:
|
|
1240
|
+
code: Cr(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 or = (e) => e.replaceAll("\\", "\\\\").replace(ar, "\\${").replaceAll("`",
|
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
1249
|
}
|
|
1250
|
-
}),
|
|
1251
|
-
export const styles = css\``,
|
|
1250
|
+
}), Si = 'export default "', vr = '"', br = `import { css } from '${re.css[0]}';
|
|
1251
|
+
export const styles = css\``, wr = "`;\nexport default styles;", Sr = `
|
|
1252
1252
|
|
|
1253
1253
|
if(import.meta.hot) {
|
|
1254
1254
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1259,46 +1259,46 @@ if(import.meta.hot) {
|
|
|
1259
1259
|
}
|
|
1260
1260
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1261
1261
|
});
|
|
1262
|
-
}`,
|
|
1263
|
-
function
|
|
1264
|
-
const n =
|
|
1262
|
+
}`, Ci = (e) => e.slice(Si.length - 1);
|
|
1263
|
+
function Cr(e, t, i, s) {
|
|
1264
|
+
const n = Ci(e), r = JSON.parse(n), a = sr(r), c = s ? `@layer{${i ? "" : `
|
|
1265
1265
|
`}${a}${i ? "" : `
|
|
1266
1266
|
`}}` : a;
|
|
1267
|
-
return `${
|
|
1267
|
+
return `${br}${c}${wr}${t ? Sr : ""}`;
|
|
1268
1268
|
}
|
|
1269
|
-
function
|
|
1270
|
-
return `import("${
|
|
1271
|
-
setCustomElementsManifest(${
|
|
1269
|
+
function Er(e) {
|
|
1270
|
+
return `import("${Tr}").then(({ setCustomElementsManifest }) => {
|
|
1271
|
+
setCustomElementsManifest(${$r(e)});
|
|
1272
1272
|
});`;
|
|
1273
1273
|
}
|
|
1274
|
-
const
|
|
1275
|
-
function
|
|
1274
|
+
const Tr = "@storybook/web-components-vite", $r = (e) => `JSON.parse(\`${Pr(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1275
|
+
function Pr(e) {
|
|
1276
1276
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1277
1277
|
}
|
|
1278
|
-
function
|
|
1279
|
-
|
|
1278
|
+
function kr(e) {
|
|
1279
|
+
Ir(e);
|
|
1280
1280
|
const t = e.options.css?.globalStylesPath;
|
|
1281
1281
|
if (t === void 0)
|
|
1282
1282
|
return "";
|
|
1283
1283
|
const i = u.join(e.dir.root, t);
|
|
1284
1284
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
1285
|
-
`import globalStyles from "${i}${
|
|
1285
|
+
`import globalStyles from "${i}${Y}";`,
|
|
1286
1286
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1287
|
-
|
|
1287
|
+
Ti("", e)
|
|
1288
1288
|
].join(`
|
|
1289
1289
|
`) : `import "${i}${Ze}";`;
|
|
1290
1290
|
}
|
|
1291
|
-
const
|
|
1292
|
-
function
|
|
1291
|
+
const Ei = "hydrated";
|
|
1292
|
+
function Ir(e) {
|
|
1293
1293
|
e._globalHydratedCssString = [
|
|
1294
1294
|
":not([",
|
|
1295
|
-
e.options.css?.hydratedAttribute ??
|
|
1295
|
+
e.options.css?.hydratedAttribute ?? Ei,
|
|
1296
1296
|
"]):is(",
|
|
1297
1297
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
1298
1298
|
"){visibility:hidden}"
|
|
1299
1299
|
].join("");
|
|
1300
1300
|
}
|
|
1301
|
-
function
|
|
1301
|
+
function Ti(e, t) {
|
|
1302
1302
|
return [
|
|
1303
1303
|
"const globalCss = new CSSStyleSheet;",
|
|
1304
1304
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
|
|
@@ -1306,72 +1306,72 @@ function $i(e, t) {
|
|
|
1306
1306
|
].join(`
|
|
1307
1307
|
`);
|
|
1308
1308
|
}
|
|
1309
|
-
const
|
|
1309
|
+
const xr = (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 Ar(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(Lr(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
|
+
kr(e),
|
|
1323
|
+
e.hmrEnabled ? jr : "",
|
|
1324
1324
|
"",
|
|
1325
|
-
e.isInStorybook ?
|
|
1325
|
+
e.isInStorybook ? Er(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 ? Fr(t) : ""
|
|
1332
1332
|
].join(`
|
|
1333
1333
|
`);
|
|
1334
1334
|
}
|
|
1335
|
-
const
|
|
1335
|
+
const Lr = (e, t, i) => [
|
|
1336
1336
|
` "${e.tagName}": [`,
|
|
1337
1337
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
1338
|
-
|
|
1338
|
+
Nr(e),
|
|
1339
1339
|
"]"
|
|
1340
1340
|
].join("");
|
|
1341
|
-
function
|
|
1342
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } =
|
|
1343
|
-
return `${p.length > 0 || n ? `"${p.join(
|
|
1341
|
+
function Nr(e) {
|
|
1342
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = $i(e), r = t.map((g) => g.join(Ts)).join(Je), a = i.join(Je), c = s.join(Je), d = [r, a, c], l = d.findLastIndex((g) => g.length > 0), p = d.slice(0, l + 1);
|
|
1343
|
+
return `${p.length > 0 || n ? `"${p.join($s)}"` : ""}${n ? ",1" : ""}`;
|
|
1344
1344
|
}
|
|
1345
|
-
function
|
|
1345
|
+
function $i(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 !== ri(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" && (js(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 jr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
1360
|
+
`, Fr = (e) => `
|
|
1361
1361
|
if(import.meta.hot) {
|
|
1362
1362
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
1363
1363
|
import.meta.hot.accept([
|
|
1364
1364
|
${e.map((t) => ` "/${t}",`).join(`
|
|
1365
1365
|
`)}
|
|
1366
1366
|
], handleHmrUpdate);
|
|
1367
|
-
}`,
|
|
1368
|
-
name:
|
|
1367
|
+
}`, Dr = "@arcgis/lumina-compiler", Pi = {
|
|
1368
|
+
name: Dr
|
|
1369
1369
|
};
|
|
1370
|
-
var
|
|
1371
|
-
async function
|
|
1372
|
-
return ne ??=
|
|
1370
|
+
var Rr = ["@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/core", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-compiler", "@arcgis/lumina-toolkit", "@arcgis/node-toolkit", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
|
|
1371
|
+
async function ki(e, t) {
|
|
1372
|
+
return ne ??= Mr(e, t), await ne;
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function Or() {
|
|
1375
1375
|
if (xe === void 0)
|
|
1376
1376
|
throw Error(
|
|
1377
1377
|
b(
|
|
@@ -1381,7 +1381,7 @@ function Br() {
|
|
|
1381
1381
|
);
|
|
1382
1382
|
return xe;
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function Ii() {
|
|
1385
1385
|
if (et === void 0)
|
|
1386
1386
|
throw Error(
|
|
1387
1387
|
b(
|
|
@@ -1391,18 +1391,18 @@ function xi() {
|
|
|
1391
1391
|
);
|
|
1392
1392
|
return et;
|
|
1393
1393
|
}
|
|
1394
|
-
async function
|
|
1395
|
-
const i =
|
|
1396
|
-
[...Object.keys(s), ...Object.keys(n)].filter((l) => !
|
|
1397
|
-
)).filter(
|
|
1394
|
+
async function Mr(e, t) {
|
|
1395
|
+
const i = D(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1396
|
+
[...Object.keys(s), ...Object.keys(n)].filter((l) => !Jr.has(l)).flatMap(async (l) => await xi(l, e))
|
|
1397
|
+
)).filter(F);
|
|
1398
1398
|
xe ??= a, et = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1399
1399
|
const c = t?.serve?.extraDependencies?.map(
|
|
1400
1400
|
(l) => typeof l == "string" ? l : l.name
|
|
1401
1401
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
1402
1402
|
return xe ??= d, d;
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1405
|
-
...
|
|
1404
|
+
const Jr = /* @__PURE__ */ new Set([
|
|
1405
|
+
...Rr,
|
|
1406
1406
|
"@arcgis/languages-sdk-specs",
|
|
1407
1407
|
"@commander-js/extra-typings",
|
|
1408
1408
|
"@custom-elements-manifest/analyzer",
|
|
@@ -1412,7 +1412,6 @@ const _r = /* @__PURE__ */ new Set([
|
|
|
1412
1412
|
"@lit-labs/ssr",
|
|
1413
1413
|
"@lit/context",
|
|
1414
1414
|
"@lit-labs/ssr-client",
|
|
1415
|
-
"@lit/react",
|
|
1416
1415
|
"@types/color",
|
|
1417
1416
|
"@types/sortablejs",
|
|
1418
1417
|
"color",
|
|
@@ -1436,12 +1435,12 @@ const _r = /* @__PURE__ */ new Set([
|
|
|
1436
1435
|
"vscode-languageserver-types"
|
|
1437
1436
|
]);
|
|
1438
1437
|
let xe, et, ne;
|
|
1439
|
-
async function
|
|
1440
|
-
const i = await $e(e, t), s = await
|
|
1438
|
+
async function xi(e, t) {
|
|
1439
|
+
const i = await $e(e, t), s = await ai(i), n = "exports" in s, r = Xr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
1441
1440
|
if (a ? await K(c) : !1) {
|
|
1442
|
-
const g = await
|
|
1441
|
+
const g = await W(c, "utf8"), h = Br(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1443
1442
|
try {
|
|
1444
|
-
const C = JSON.parse(w), E =
|
|
1443
|
+
const C = JSON.parse(w), E = Vr(C, { packageName: e, getImportPath: r });
|
|
1445
1444
|
return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
|
|
1446
1445
|
} catch (C) {
|
|
1447
1446
|
T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
@@ -1450,7 +1449,7 @@ Error: ${String(C)}`);
|
|
|
1450
1449
|
}
|
|
1451
1450
|
const l = It(s.customElements);
|
|
1452
1451
|
if (l != null) {
|
|
1453
|
-
const g = u.join(i, l), h = JSON.parse(await
|
|
1452
|
+
const g = u.join(i, l), h = JSON.parse(await W(g, "utf-8")), y = Kr(h), v = Ai(h, {
|
|
1454
1453
|
packageName: e,
|
|
1455
1454
|
getImportPath: r
|
|
1456
1455
|
});
|
|
@@ -1458,7 +1457,7 @@ Error: ${String(C)}`);
|
|
|
1458
1457
|
}
|
|
1459
1458
|
const p = It(s["web-types"]);
|
|
1460
1459
|
if (p != null) {
|
|
1461
|
-
const g = u.join(i, p), h = JSON.parse(await
|
|
1460
|
+
const g = u.join(i, p), h = JSON.parse(await W(g, "utf-8")), y = _r(h, {
|
|
1462
1461
|
packageName: e,
|
|
1463
1462
|
getImportPath: r
|
|
1464
1463
|
});
|
|
@@ -1466,7 +1465,7 @@ Error: ${String(C)}`);
|
|
|
1466
1465
|
}
|
|
1467
1466
|
const m = u.join(i, "dist/components");
|
|
1468
1467
|
if (await K(m)) {
|
|
1469
|
-
const g = await
|
|
1468
|
+
const g = await Gr(m, {
|
|
1470
1469
|
packageName: e,
|
|
1471
1470
|
getImportPath: r
|
|
1472
1471
|
});
|
|
@@ -1474,11 +1473,11 @@ Error: ${String(C)}`);
|
|
|
1474
1473
|
}
|
|
1475
1474
|
}
|
|
1476
1475
|
const It = (e) => Array.isArray(e) ? e[0] : e;
|
|
1477
|
-
function
|
|
1476
|
+
function Br(e, t) {
|
|
1478
1477
|
const i = e.indexOf(t);
|
|
1479
1478
|
return i === -1 ? -1 : i + t.length;
|
|
1480
1479
|
}
|
|
1481
|
-
function
|
|
1480
|
+
function Ai(e, t, i = !1) {
|
|
1482
1481
|
const s = /* @__PURE__ */ Object.create(null);
|
|
1483
1482
|
if (e.modules === void 0)
|
|
1484
1483
|
return s;
|
|
@@ -1515,11 +1514,11 @@ function Li(e, t, i = !1) {
|
|
|
1515
1514
|
}
|
|
1516
1515
|
return s;
|
|
1517
1516
|
}
|
|
1518
|
-
const
|
|
1517
|
+
const Kr = (e) => (
|
|
1519
1518
|
// Since 5.0
|
|
1520
1519
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1521
|
-
e.compiler?.name ===
|
|
1522
|
-
),
|
|
1520
|
+
e.compiler?.name === Pi.name
|
|
1521
|
+
), _r = (e, t) => Object.fromEntries(
|
|
1523
1522
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1524
1523
|
(i) => [
|
|
1525
1524
|
i.name,
|
|
@@ -1530,7 +1529,7 @@ const Ur = (e) => (
|
|
|
1530
1529
|
}
|
|
1531
1530
|
]
|
|
1532
1531
|
) ?? []
|
|
1533
|
-
),
|
|
1532
|
+
), Ur = 1, Wr = 2, zr = 4, qr = 8, Hr = Ur | Wr | zr | qr, Vr = (e, t) => Object.fromEntries(
|
|
1534
1533
|
e.flatMap(
|
|
1535
1534
|
([i, s]) => s.map(
|
|
1536
1535
|
([n, r, a]) => [
|
|
@@ -1539,13 +1538,13 @@ const Ur = (e) => (
|
|
|
1539
1538
|
packageName: t.packageName,
|
|
1540
1539
|
modulePath: t.getImportPath(r),
|
|
1541
1540
|
propToAttribute: Object.fromEntries(
|
|
1542
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
1541
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & Hr).map(([c, [d, l = c]]) => [c, l])
|
|
1543
1542
|
)
|
|
1544
1543
|
}
|
|
1545
1544
|
]
|
|
1546
1545
|
)
|
|
1547
1546
|
)
|
|
1548
|
-
),
|
|
1547
|
+
), Gr = async (e, t) => Object.fromEntries(
|
|
1549
1548
|
(await ct(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
1550
1549
|
const s = i.slice(0, -5);
|
|
1551
1550
|
return [
|
|
@@ -1557,34 +1556,34 @@ const Ur = (e) => (
|
|
|
1557
1556
|
}
|
|
1558
1557
|
];
|
|
1559
1558
|
})
|
|
1560
|
-
),
|
|
1561
|
-
function
|
|
1559
|
+
), Xr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Yr = (e) => e.startsWith("/") ? e : `/${e}`, ut = (e, t) => `${e}@fs${Yr(t)}`;
|
|
1560
|
+
function Qr(e, t) {
|
|
1562
1561
|
const i = u.resolve(e), s = u.resolve(i, t.split(/[?#]/u)[0].replace(/^[/\\]+/u, "")), n = u.relative(i, s);
|
|
1563
1562
|
return n === ".." || n.startsWith(`..${u.sep}`) || u.isAbsolute(n) ? void 0 : s;
|
|
1564
1563
|
}
|
|
1565
|
-
const
|
|
1564
|
+
const Li = "packages/core-packages/core/src", Zr = "packages/core-packages/core/output/npm/esm", ee = !import.meta.url.includes("node_modules");
|
|
1566
1565
|
function mt(e) {
|
|
1567
|
-
return
|
|
1566
|
+
return ee && e.name !== "@esri/calcite-components" ? "6.0.0-next.14" : e.version;
|
|
1568
1567
|
}
|
|
1569
|
-
function
|
|
1568
|
+
function Ni({ command: e }) {
|
|
1570
1569
|
return e === "serve" && process.argv.includes("--local-core");
|
|
1571
1570
|
}
|
|
1572
|
-
function
|
|
1571
|
+
function ji(e) {
|
|
1573
1572
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1574
1573
|
return i === "latest" ? "esnext" : i;
|
|
1575
1574
|
}
|
|
1576
1575
|
const tt = "@arcgis/lumina:provideAssets";
|
|
1577
|
-
function
|
|
1576
|
+
function te(e, t, i = ft, s = "max-age=31536000, immutable") {
|
|
1578
1577
|
if (e.viteCommand !== "serve")
|
|
1579
1578
|
throw Error(b(tt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
1580
1579
|
const n = e._serverConfigured, r = e.server.middlewares.stack.length;
|
|
1581
1580
|
if (t.forEach((a) => {
|
|
1582
|
-
const c =
|
|
1581
|
+
const c = Di(a), d = Oi(e.dir, Ri(c)), l = tn(e.viteConfig.base, d, e.dir.distCdn);
|
|
1583
1582
|
e.server.middlewares.use(l, (p, m, f) => {
|
|
1584
|
-
const g =
|
|
1585
|
-
return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) :
|
|
1583
|
+
const g = sn(p.url), h = c.type === "directory" ? Qr(c.source, g) : c.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
|
|
1584
|
+
return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) : W(h)).then((w) => {
|
|
1586
1585
|
const C = (typeof h == "function" ? void 0 : v?.transform(w.toString("utf8"), y, e)) ?? w;
|
|
1587
|
-
m.setHeader("Cache-Control", s), m.setHeader("Content-Type",
|
|
1586
|
+
m.setHeader("Cache-Control", s), m.setHeader("Content-Type", Ks.lookup(g) || "application/octet-stream"), m.write(C), m.end();
|
|
1588
1587
|
}).catch((w) => {
|
|
1589
1588
|
(c.type !== "directory" || process.env.DEBUG) && T.warn(
|
|
1590
1589
|
tt,
|
|
@@ -1597,31 +1596,31 @@ function ie(e, t, i = ft, s = "max-age=31536000, immutable") {
|
|
|
1597
1596
|
e.server.middlewares.stack.splice(0, 0, ...a);
|
|
1598
1597
|
}
|
|
1599
1598
|
}
|
|
1600
|
-
async function
|
|
1599
|
+
async function Fi(e, t, i = ft) {
|
|
1601
1600
|
await Promise.all(
|
|
1602
1601
|
t.map(async (s) => {
|
|
1603
|
-
const n =
|
|
1602
|
+
const n = Di(s), r = Oi(e.dir, Ri(n));
|
|
1604
1603
|
if (n.type === "directory") {
|
|
1605
1604
|
const a = u.resolve(n.source), d = (await ct(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
|
|
1606
1605
|
const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
|
|
1607
1606
|
return [p, f];
|
|
1608
1607
|
});
|
|
1609
|
-
await
|
|
1608
|
+
await Ji(d.map(([l, p]) => p)), await _s(
|
|
1610
1609
|
d,
|
|
1611
1610
|
16,
|
|
1612
1611
|
async ([l, p]) => await xt(l, p, i, e)
|
|
1613
1612
|
);
|
|
1614
1613
|
} else if (n.type === "file")
|
|
1615
|
-
await
|
|
1614
|
+
await ie(u.dirname(r), { recursive: !0 }), await xt(n.source, r, i, e);
|
|
1616
1615
|
else if (n.type === "dynamic") {
|
|
1617
|
-
await
|
|
1616
|
+
await ie(u.dirname(r), { recursive: !0 });
|
|
1618
1617
|
const a = await Promise.resolve(n.source());
|
|
1619
|
-
await
|
|
1618
|
+
await z(r, a);
|
|
1620
1619
|
}
|
|
1621
1620
|
})
|
|
1622
1621
|
);
|
|
1623
1622
|
}
|
|
1624
|
-
const
|
|
1623
|
+
const Di = ni ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
1625
1624
|
...e,
|
|
1626
1625
|
destination: G(e.destination)
|
|
1627
1626
|
} : {
|
|
@@ -1632,13 +1631,13 @@ const Ri = oi ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
1632
1631
|
async function xt(e, t, i, s) {
|
|
1633
1632
|
const n = i.find((r) => r.match(t, s));
|
|
1634
1633
|
if (n === void 0)
|
|
1635
|
-
await
|
|
1634
|
+
await Os(e, t);
|
|
1636
1635
|
else {
|
|
1637
|
-
const r = await
|
|
1638
|
-
await
|
|
1636
|
+
const r = await W(e, "utf8"), a = n.transform(r, t, s);
|
|
1637
|
+
await z(t, a);
|
|
1639
1638
|
}
|
|
1640
1639
|
}
|
|
1641
|
-
function
|
|
1640
|
+
function Ri(e) {
|
|
1642
1641
|
if (e.type === "dynamic")
|
|
1643
1642
|
return e.destination;
|
|
1644
1643
|
if (e.source.endsWith(u.sep)) {
|
|
@@ -1653,40 +1652,40 @@ function Oi(e) {
|
|
|
1653
1652
|
}
|
|
1654
1653
|
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;
|
|
1655
1654
|
}
|
|
1656
|
-
function
|
|
1657
|
-
const s =
|
|
1655
|
+
function Oi({ dist: e, distCdnAssets: t }, i) {
|
|
1656
|
+
const s = en(i), n = u.join(
|
|
1658
1657
|
t,
|
|
1659
1658
|
s ? u.relative(t, i) : i
|
|
1660
|
-
), r = u.relative(e, n), a =
|
|
1659
|
+
), r = u.relative(e, n), a = Mi(r);
|
|
1661
1660
|
return u.join(e, a);
|
|
1662
1661
|
}
|
|
1663
|
-
function
|
|
1662
|
+
function en(e) {
|
|
1664
1663
|
if (e.startsWith(u.sep)) {
|
|
1665
|
-
const t =
|
|
1664
|
+
const t = oi(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
1666
1665
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
1667
1666
|
} else
|
|
1668
|
-
return !!(!
|
|
1667
|
+
return !!(!ni && u.isAbsolute(e));
|
|
1669
1668
|
}
|
|
1670
|
-
function
|
|
1671
|
-
const s =
|
|
1669
|
+
function tn(e, t, i) {
|
|
1670
|
+
const s = Mi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
1672
1671
|
return `${e}${n}`;
|
|
1673
1672
|
}
|
|
1674
|
-
const
|
|
1675
|
-
async function
|
|
1673
|
+
const Mi = (e) => e.replaceAll("../", ""), sn = (e = "") => e.split("?")[0].split("#")[0];
|
|
1674
|
+
async function Ji(e) {
|
|
1676
1675
|
const t = new Set(e.map(u.dirname));
|
|
1677
|
-
await Promise.all(Array.from(t, async (i) => await
|
|
1676
|
+
await Promise.all(Array.from(t, async (i) => await ie(i, { recursive: !0 })));
|
|
1678
1677
|
}
|
|
1679
|
-
const
|
|
1678
|
+
const rn = {
|
|
1680
1679
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
1681
1680
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
1682
|
-
}, ft = [
|
|
1681
|
+
}, ft = [rn], Ae = "@arcgis/core", me = "@arcgis/core/assets", _e = D(), q = Ae in (_e.dependencies ?? {}) || Ae in (_e.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
1683
1682
|
_e.name === "@arcgis/lumina";
|
|
1684
|
-
async function
|
|
1685
|
-
if (!
|
|
1683
|
+
async function nn(e, t, i, s) {
|
|
1684
|
+
if (!q)
|
|
1686
1685
|
return [];
|
|
1687
1686
|
const n = e._localCdnCore, r = n?.packageLocation ?? await $e(Ae);
|
|
1688
1687
|
if (i === "cdn") {
|
|
1689
|
-
const a = await
|
|
1688
|
+
const a = await ai(r), c = Re(a, s);
|
|
1690
1689
|
return [
|
|
1691
1690
|
// Use the ESM CDN
|
|
1692
1691
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -1702,17 +1701,17 @@ async function cn(e, t, i, s) {
|
|
|
1702
1701
|
})
|
|
1703
1702
|
},
|
|
1704
1703
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1705
|
-
|
|
1704
|
+
Bi(c)
|
|
1706
1705
|
];
|
|
1707
1706
|
} else
|
|
1708
|
-
return
|
|
1707
|
+
return on(t, r, n?.sourceLocation !== void 0);
|
|
1709
1708
|
}
|
|
1710
|
-
function
|
|
1709
|
+
function on(e, t, i) {
|
|
1711
1710
|
const s = `${e}${me}`;
|
|
1712
1711
|
return [
|
|
1713
1712
|
// Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
|
|
1714
1713
|
// Core's prebuilt JavaScript assets use the untransformed route configured below.
|
|
1715
|
-
|
|
1714
|
+
Bi(
|
|
1716
1715
|
i ? `${e}${me}/` : ut(e, `${t}/assets/`)
|
|
1717
1716
|
),
|
|
1718
1717
|
{
|
|
@@ -1726,7 +1725,7 @@ function ln(e, t, i) {
|
|
|
1726
1725
|
}
|
|
1727
1726
|
];
|
|
1728
1727
|
}
|
|
1729
|
-
async function
|
|
1728
|
+
async function an(e) {
|
|
1730
1729
|
const t = e._localCdnCore, i = t?.packageLocation ?? await $e(Ae), s = t?.sourceLocation !== void 0 ? [
|
|
1731
1730
|
{
|
|
1732
1731
|
type: "directory",
|
|
@@ -1768,27 +1767,27 @@ async function dn(e) {
|
|
|
1768
1767
|
];
|
|
1769
1768
|
e.server.middlewares.use("/builddate.txt", (n, r) => {
|
|
1770
1769
|
r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain");
|
|
1771
|
-
const a = t?.sourceLocation ? "6.0.0-next.
|
|
1770
|
+
const a = t?.sourceLocation ? "6.0.0-next.14" : D(i).version;
|
|
1772
1771
|
r.end(JSON.stringify({ version: a }));
|
|
1773
|
-
}),
|
|
1772
|
+
}), te(e, s, [], "no-cache");
|
|
1774
1773
|
}
|
|
1775
|
-
const
|
|
1774
|
+
const Bi = (e) => ({
|
|
1776
1775
|
// Not using join() because it would turn https:// into https:/
|
|
1777
1776
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
1778
1777
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1779
1778
|
id: "arcgisCoreStylesheet"
|
|
1780
1779
|
}), gt = "customElement.js";
|
|
1781
|
-
function
|
|
1780
|
+
function cn(e, t) {
|
|
1782
1781
|
if (!t.startsWith(e))
|
|
1783
1782
|
return t;
|
|
1784
1783
|
const s = t.split(u.sep);
|
|
1785
|
-
return s.at(
|
|
1784
|
+
return s.at(ln) !== s.at(dn) ? t : u.join(s.slice(0, -1).join(u.sep), gt);
|
|
1786
1785
|
}
|
|
1787
|
-
const
|
|
1786
|
+
const ln = -1, dn = -2, pn = /["']\.\.?\/[^'"]+/gu, un = (e, t, i, s) => e.replaceAll(pn, (n) => {
|
|
1788
1787
|
const r = n.slice(1);
|
|
1789
1788
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1790
1789
|
return n;
|
|
1791
|
-
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
1790
|
+
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? cn(t.dir.distComponents, a) : a, d = c.startsWith(t.dir.distComponents) ? t.dir.dist + Ge(c.slice(t.dir.dist.length), t.apiExtractor) : c;
|
|
1792
1791
|
if (i === s && a === d)
|
|
1793
1792
|
return n;
|
|
1794
1793
|
const l = he(i, d), p = n.endsWith("/") ? `${l}/` : l;
|
|
@@ -1797,12 +1796,12 @@ const un = -1, mn = -2, fn = /["']\.\.?\/[^'"]+/gu, gn = (e, t, i, s) => e.repla
|
|
|
1797
1796
|
const i = u.relative(e, t);
|
|
1798
1797
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
1799
1798
|
};
|
|
1800
|
-
async function
|
|
1799
|
+
async function mn(e, t, i) {
|
|
1801
1800
|
const s = u.resolve(e.dir.root, t);
|
|
1802
|
-
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await
|
|
1801
|
+
e.viteConfig.build.emptyOutDir !== !1 && await K(s) && await Ms(s, { recursive: !0, force: !0 }), await ie(s, { recursive: !0 }), await Js(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1803
1802
|
const n = [
|
|
1804
1803
|
"index.html",
|
|
1805
|
-
...await
|
|
1804
|
+
...await Us("**/*.html", {
|
|
1806
1805
|
cwd: e.dir.src,
|
|
1807
1806
|
onlyFiles: !0,
|
|
1808
1807
|
// The files we are looking for are unlikely to be symbolic links
|
|
@@ -1826,8 +1825,8 @@ async function hn(e, t, i) {
|
|
|
1826
1825
|
await Promise.all(
|
|
1827
1826
|
n.map(async (l, p) => {
|
|
1828
1827
|
const f = p === 0 ? l : u.join(r, l), g = u.join(e.dir.root, f), h = u.join(s, f);
|
|
1829
|
-
await
|
|
1830
|
-
const y = await
|
|
1828
|
+
await ie(u.dirname(h), { recursive: !0 });
|
|
1829
|
+
const y = await W(g, "utf-8"), v = he(u.dirname(f), `build/${i}`), w = `${d}<script type="module" src="${v}"><\/script>
|
|
1831
1830
|
`, C = Math.min(
|
|
1832
1831
|
...[y.indexOf("<style>"), y.indexOf("<script"), y.indexOf("</head>")].filter(
|
|
1833
1832
|
(x) => x !== -1
|
|
@@ -1836,25 +1835,25 @@ async function hn(e, t, i) {
|
|
|
1836
1835
|
if (C === Number.POSITIVE_INFINITY)
|
|
1837
1836
|
throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
|
|
1838
1837
|
const E = y.slice(0, C) + w + y.slice(C), P = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
|
|
1839
|
-
await
|
|
1838
|
+
await z(h, P, "utf-8");
|
|
1840
1839
|
})
|
|
1841
1840
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1842
1841
|
}
|
|
1843
1842
|
const At = /* @__PURE__ */ new Map();
|
|
1844
|
-
function
|
|
1843
|
+
function fn(e) {
|
|
1845
1844
|
const t = e.endsWith(".js") ? `${e.slice(0, -3)}.d.ts` : `${e}.d.ts`, i = at(`node_modules/${t}`);
|
|
1846
1845
|
if (i === void 0)
|
|
1847
1846
|
throw Error(`Could not find declarations for ${e} while transforming a dynamic CDN import.`);
|
|
1848
1847
|
const s = At.get(i);
|
|
1849
1848
|
if (s !== void 0)
|
|
1850
1849
|
return s;
|
|
1851
|
-
const r = o.createSourceFile(i,
|
|
1850
|
+
const r = o.createSourceFile(i, Ws(i, "utf8"), o.ScriptTarget.Latest).statements.some(gn);
|
|
1852
1851
|
return At.set(i, r), r;
|
|
1853
1852
|
}
|
|
1854
|
-
function
|
|
1853
|
+
function gn(e) {
|
|
1855
1854
|
return o.isExportAssignment(e) ? !e.isExportEquals : o.isClassDeclaration(e) || o.isFunctionDeclaration(e) ? e.modifiers?.some((t) => t.kind === o.SyntaxKind.DefaultKeyword) === !0 : o.isExportDeclaration(e) && !e.isTypeOnly && e.exportClause !== void 0 ? o.isNamedExports(e.exportClause) && e.exportClause.elements.some((t) => !t.isTypeOnly && t.name.text === "default") : !1;
|
|
1856
1855
|
}
|
|
1857
|
-
const
|
|
1856
|
+
const Ki = /* @__PURE__ */ new Set([
|
|
1858
1857
|
"chunks",
|
|
1859
1858
|
"components",
|
|
1860
1859
|
"docs",
|
|
@@ -1867,13 +1866,13 @@ const _i = /* @__PURE__ */ new Set([
|
|
|
1867
1866
|
"collection",
|
|
1868
1867
|
"extras",
|
|
1869
1868
|
"support"
|
|
1870
|
-
]), O = "@arcgis/lumina:buildCdn", le = "cdn",
|
|
1871
|
-
function
|
|
1869
|
+
]), O = "@arcgis/lumina:buildCdn", le = "cdn", _i = "index", Q = "main";
|
|
1870
|
+
function hn(e) {
|
|
1872
1871
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1873
1872
|
if (a) {
|
|
1874
1873
|
if (i.toLowerCase() !== i)
|
|
1875
1874
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
1876
|
-
if (
|
|
1875
|
+
if (Ki.has(i))
|
|
1877
1876
|
throw new Error(
|
|
1878
1877
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
1879
1878
|
);
|
|
@@ -1881,12 +1880,12 @@ function bn(e) {
|
|
|
1881
1880
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
1882
1881
|
);
|
|
1883
1882
|
}
|
|
1884
|
-
const c = i ??
|
|
1883
|
+
const c = i ?? _i;
|
|
1885
1884
|
if (e.provideAssets([
|
|
1886
1885
|
{
|
|
1887
1886
|
type: "dynamic",
|
|
1888
|
-
source: () =>
|
|
1889
|
-
destination: `../${a ? c :
|
|
1887
|
+
source: () => xr(e),
|
|
1888
|
+
destination: `../${a ? c : Q}.css`
|
|
1890
1889
|
}
|
|
1891
1890
|
]), !t)
|
|
1892
1891
|
return {
|
|
@@ -1901,7 +1900,7 @@ function bn(e) {
|
|
|
1901
1900
|
);
|
|
1902
1901
|
return;
|
|
1903
1902
|
}
|
|
1904
|
-
const d =
|
|
1903
|
+
const d = q && D().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 yn(
|
|
1905
1904
|
e,
|
|
1906
1905
|
c,
|
|
1907
1906
|
s,
|
|
@@ -1909,7 +1908,7 @@ function bn(e) {
|
|
|
1909
1908
|
n,
|
|
1910
1909
|
d
|
|
1911
1910
|
);
|
|
1912
|
-
await
|
|
1911
|
+
await vn(
|
|
1913
1912
|
m,
|
|
1914
1913
|
e,
|
|
1915
1914
|
a ? `${c}.esm` : c,
|
|
@@ -1917,11 +1916,11 @@ function bn(e) {
|
|
|
1917
1916
|
d
|
|
1918
1917
|
);
|
|
1919
1918
|
const f = Date.now();
|
|
1920
|
-
T.info(O, `CDN was built in ${f - l}ms`), r && await
|
|
1919
|
+
T.info(O, `CDN was built in ${f - l}ms`), r && await mn(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
1921
1920
|
}
|
|
1922
1921
|
};
|
|
1923
1922
|
}
|
|
1924
|
-
async function
|
|
1923
|
+
async function yn(e, t, i, s, n, r) {
|
|
1925
1924
|
const a = e.environment;
|
|
1926
1925
|
if (i.minify && r)
|
|
1927
1926
|
throw Error(
|
|
@@ -1944,8 +1943,8 @@ async function wn(e, t, i, s, n, r) {
|
|
|
1944
1943
|
* The script's file name will be stripped inside defineCustomElements.
|
|
1945
1944
|
**/
|
|
1946
1945
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1947
|
-
${
|
|
1948
|
-
return await
|
|
1946
|
+
${Ti(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
1947
|
+
return await Bs({
|
|
1949
1948
|
bundle: !0,
|
|
1950
1949
|
minify: r ? !0 : a === "production",
|
|
1951
1950
|
treeShaking: !0,
|
|
@@ -1970,7 +1969,7 @@ ${$i(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1970
1969
|
chunkNames: "[hash]",
|
|
1971
1970
|
resolveExtensions: [".js", ".json"],
|
|
1972
1971
|
banner: { js: e.banner },
|
|
1973
|
-
target:
|
|
1972
|
+
target: ji(e),
|
|
1974
1973
|
...i,
|
|
1975
1974
|
write: !1,
|
|
1976
1975
|
plugins: [
|
|
@@ -1997,7 +1996,7 @@ ${$i(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1997
1996
|
setup(l) {
|
|
1998
1997
|
const p = e.options.build?.cdn?.namespace === void 0 ? (
|
|
1999
1998
|
// eslint-disable-next-line require-unicode-regexp
|
|
2000
|
-
new RegExp(`\\/${le}\\/${
|
|
1999
|
+
new RegExp(`\\/${le}\\/${Q}\\.css$`)
|
|
2001
2000
|
) : (
|
|
2002
2001
|
// eslint-disable-next-line require-unicode-regexp
|
|
2003
2002
|
new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
|
|
@@ -2030,7 +2029,7 @@ ${$i(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
2030
2029
|
});
|
|
2031
2030
|
}
|
|
2032
2031
|
const Lt = "stdin.js";
|
|
2033
|
-
async function
|
|
2032
|
+
async function vn(e, t, i, s, n) {
|
|
2034
2033
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
2035
2034
|
let c;
|
|
2036
2035
|
n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -2044,13 +2043,13 @@ async function Sn(e, t, i, s, n) {
|
|
|
2044
2043
|
}, f = G(p.path.slice(r.length));
|
|
2045
2044
|
if (f === Lt) {
|
|
2046
2045
|
if (n) {
|
|
2047
|
-
const h = p.text.match(
|
|
2046
|
+
const h = p.text.match(bn)?.[0];
|
|
2048
2047
|
if (h === void 0)
|
|
2049
2048
|
throw Error(
|
|
2050
2049
|
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${Lt} contents:
|
|
2051
2050
|
${p.text}`
|
|
2052
2051
|
);
|
|
2053
|
-
m.code = `${m.code.trimEnd()}${
|
|
2052
|
+
m.code = `${m.code.trimEnd()}${wn(h, s)}`, m.isAsync = !1;
|
|
2054
2053
|
}
|
|
2055
2054
|
return [a, m];
|
|
2056
2055
|
}
|
|
@@ -2060,7 +2059,7 @@ ${p.text}`
|
|
|
2060
2059
|
n && d.forEach((p, m) => {
|
|
2061
2060
|
if (p.isAsync === void 0)
|
|
2062
2061
|
if (m.endsWith(".js")) {
|
|
2063
|
-
if (Ui(p, d), c?.has(m) === !0 && p.code.includes(
|
|
2062
|
+
if (Ui(p, d), c?.has(m) === !0 && p.code.includes(Wi))
|
|
2064
2063
|
throw Error(
|
|
2065
2064
|
b(
|
|
2066
2065
|
O,
|
|
@@ -2075,13 +2074,13 @@ ${p.text}`
|
|
|
2075
2074
|
const m = p.lastIndexOf("/");
|
|
2076
2075
|
if (m !== -1) {
|
|
2077
2076
|
const f = p.slice(0, m);
|
|
2078
|
-
l.set(f,
|
|
2077
|
+
l.set(f, ie(r + f, { recursive: !0 }));
|
|
2079
2078
|
}
|
|
2080
2079
|
}
|
|
2081
|
-
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await
|
|
2080
|
+
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await z(r + p, m)));
|
|
2082
2081
|
}
|
|
2083
|
-
const
|
|
2084
|
-
function
|
|
2082
|
+
const bn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2083
|
+
function wn(e, t) {
|
|
2085
2084
|
let i = [
|
|
2086
2085
|
"window.$arcgis",
|
|
2087
2086
|
"||",
|
|
@@ -2120,7 +2119,7 @@ function En(e, t) {
|
|
|
2120
2119
|
// minified to a variable name that is already used inside the closure).
|
|
2121
2120
|
`)($arcgis,${e}`
|
|
2122
2121
|
].join(""), s) {
|
|
2123
|
-
const r =
|
|
2122
|
+
const r = D().name;
|
|
2124
2123
|
i += `,"${r}/",".js"`;
|
|
2125
2124
|
}
|
|
2126
2125
|
return i += ")", i;
|
|
@@ -2133,17 +2132,17 @@ function Ui(e, t) {
|
|
|
2133
2132
|
e.isProcessing = !0;
|
|
2134
2133
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
2135
2134
|
let c = 0;
|
|
2136
|
-
const d = e.code.matchAll(
|
|
2135
|
+
const d = e.code.matchAll(Sn);
|
|
2137
2136
|
for (const S of d) {
|
|
2138
|
-
const [A, L, U,
|
|
2137
|
+
const [A, L, U, j, N] = S, B = N.startsWith(Le);
|
|
2139
2138
|
if (c !== 0 && c !== S.index) {
|
|
2140
2139
|
const R = e.code.slice(c, S.index);
|
|
2141
2140
|
n.push(R), a.push([c, R.length, 0, ""]);
|
|
2142
2141
|
}
|
|
2143
2142
|
if (c = S.index + A.length, B)
|
|
2144
|
-
a.push([S.index, A.length, 0, ""]), s.push(`"${qi(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ??
|
|
2143
|
+
a.push([S.index, A.length, 0, ""]), s.push(`"${qi(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? j ?? "");
|
|
2145
2144
|
else {
|
|
2146
|
-
const R =
|
|
2145
|
+
const R = zi(N, t), M = R?.isAsync === !0;
|
|
2147
2146
|
if (L !== void 0) {
|
|
2148
2147
|
const be = [];
|
|
2149
2148
|
for (const Me of L.slice(1, -1).split(",")) {
|
|
@@ -2154,7 +2153,7 @@ function Ui(e, t) {
|
|
|
2154
2153
|
const Me = R.oldSingleExportName === void 0 ? `{${be.join(",")}}` : be[0].split(":")[1];
|
|
2155
2154
|
a.push([S.index + 6, 0, L.length, Me]);
|
|
2156
2155
|
}
|
|
2157
|
-
} else if (U === void 0 &&
|
|
2156
|
+
} else if (U === void 0 && j === void 0)
|
|
2158
2157
|
M && a.push([S.index + 6, 0, 0, ""]);
|
|
2159
2158
|
else {
|
|
2160
2159
|
if (M)
|
|
@@ -2165,7 +2164,7 @@ function Ui(e, t) {
|
|
|
2165
2164
|
${R.code}`
|
|
2166
2165
|
)
|
|
2167
2166
|
);
|
|
2168
|
-
r.add(
|
|
2167
|
+
r.add(j ?? U);
|
|
2169
2168
|
}
|
|
2170
2169
|
}
|
|
2171
2170
|
}
|
|
@@ -2175,26 +2174,26 @@ ${R.code}`
|
|
|
2175
2174
|
e.code = jt(e.code, t);
|
|
2176
2175
|
return;
|
|
2177
2176
|
}
|
|
2178
|
-
const p =
|
|
2177
|
+
const p = Tn(r);
|
|
2179
2178
|
let m = e.code.slice(0, c);
|
|
2180
2179
|
for (let S = a.length - 1; S >= 0; S--) {
|
|
2181
|
-
const [A, L, U,
|
|
2180
|
+
const [A, L, U, j] = a[S];
|
|
2182
2181
|
let N = L, B = "";
|
|
2183
2182
|
if (L === 0) {
|
|
2184
2183
|
const M = p();
|
|
2185
|
-
s.push(M), B = ` ${M} from`,
|
|
2184
|
+
s.push(M), B = ` ${M} from`, j !== "" ? (N = U + 4, i.push(j)) : i.push("");
|
|
2186
2185
|
}
|
|
2187
2186
|
m = m.slice(0, A) + B + m.slice(A + N);
|
|
2188
2187
|
}
|
|
2189
|
-
const [f, g] = Nt(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${
|
|
2188
|
+
const [f, g] = Nt(e), h = i.findLastIndex((S) => S.length > 0), y = i.slice(0, h + 1).join(","), v = i.length === 0 ? "_" : `([${y}])`, w = `${Wi}${v}=>{`, C = s.join(","), E = `${g}},${C})`;
|
|
2190
2189
|
let P = e.code.slice(c, f);
|
|
2191
2190
|
P = `${n.join("")}${P}`, P = jt(P, t);
|
|
2192
2191
|
const x = `${m}${w}${P}${E}`;
|
|
2193
2192
|
e.code = x;
|
|
2194
2193
|
}
|
|
2195
|
-
const
|
|
2194
|
+
const Wi = "export default $arcgis.t(";
|
|
2196
2195
|
function Nt(e) {
|
|
2197
|
-
const t =
|
|
2196
|
+
const t = Cn.exec(e.code), i = t?.index ?? e.code.length;
|
|
2198
2197
|
let s = "";
|
|
2199
2198
|
if (t !== null) {
|
|
2200
2199
|
const n = t[1].split(",");
|
|
@@ -2210,8 +2209,8 @@ function Nt(e) {
|
|
|
2210
2209
|
}
|
|
2211
2210
|
return [i, s];
|
|
2212
2211
|
}
|
|
2213
|
-
const
|
|
2214
|
-
function
|
|
2212
|
+
const Sn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, Cn = /export\{([^}]+)\};\n$/u, Le = "@arcgis/core/";
|
|
2213
|
+
function zi(e, t) {
|
|
2215
2214
|
if (!e.startsWith("./"))
|
|
2216
2215
|
return;
|
|
2217
2216
|
const i = e.slice(2), s = t.get(i);
|
|
@@ -2222,40 +2221,40 @@ function Hi(e, t) {
|
|
|
2222
2221
|
return s;
|
|
2223
2222
|
}
|
|
2224
2223
|
function jt(e, t) {
|
|
2225
|
-
return e.replaceAll(
|
|
2224
|
+
return e.replaceAll(En, (i, s) => {
|
|
2226
2225
|
if (s.startsWith(Le)) {
|
|
2227
2226
|
const n = qi(s.slice(Le.length));
|
|
2228
|
-
return `$arcgis.t(m=>${
|
|
2227
|
+
return `$arcgis.t(m=>${fn(s) ? "({default:m[0]})" : "m[0]"},"${n}")`;
|
|
2229
2228
|
} else if (s.startsWith("./")) {
|
|
2230
|
-
const n =
|
|
2229
|
+
const n = zi(s, t);
|
|
2231
2230
|
if (n?.isAsync === !0)
|
|
2232
2231
|
return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
|
|
2233
2232
|
}
|
|
2234
2233
|
return i;
|
|
2235
2234
|
});
|
|
2236
2235
|
}
|
|
2237
|
-
const
|
|
2238
|
-
function
|
|
2236
|
+
const En = /(?<![.\w\d])import\("([^"]+)"\)/gu, qi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2237
|
+
function Tn(e) {
|
|
2239
2238
|
const t = [it];
|
|
2240
2239
|
return () => {
|
|
2241
2240
|
for (; ; ) {
|
|
2242
|
-
const i =
|
|
2243
|
-
if (
|
|
2241
|
+
const i = kn(t);
|
|
2242
|
+
if (In(t), !e.has(i))
|
|
2244
2243
|
return e.add(i), i;
|
|
2245
2244
|
}
|
|
2246
2245
|
};
|
|
2247
2246
|
}
|
|
2248
|
-
const it = 0, ht = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
|
|
2249
|
-
function
|
|
2247
|
+
const it = 0, ht = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Hi = `${ht}0123456789`, $n = ht.length, Pn = Hi.length;
|
|
2248
|
+
function kn(e) {
|
|
2250
2249
|
let t = ht[e[0]];
|
|
2251
2250
|
for (let i = 1; i < e.length; ++i)
|
|
2252
|
-
t +=
|
|
2251
|
+
t += Hi[e[i]];
|
|
2253
2252
|
return t;
|
|
2254
2253
|
}
|
|
2255
|
-
function
|
|
2254
|
+
function In(e) {
|
|
2256
2255
|
let t = e.length - 1;
|
|
2257
2256
|
for (; t >= 0; ) {
|
|
2258
|
-
const i = t === 0 ?
|
|
2257
|
+
const i = t === 0 ? $n : Pn;
|
|
2259
2258
|
if (e[t] += 1, e[t] >= i)
|
|
2260
2259
|
e[t] = it, t--;
|
|
2261
2260
|
else
|
|
@@ -2263,11 +2262,11 @@ function Ln(e) {
|
|
|
2263
2262
|
}
|
|
2264
2263
|
e.push(it);
|
|
2265
2264
|
}
|
|
2266
|
-
function Re(e =
|
|
2265
|
+
function Re(e = D(), t = !1) {
|
|
2267
2266
|
const i = e.name === "@esri/calcite-components", s = mt(e) ?? e.version, n = s.includes("next");
|
|
2268
2267
|
if (i && n)
|
|
2269
2268
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${s}/dist/${le}/`;
|
|
2270
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
2269
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = xn(e.name), c = An(s);
|
|
2271
2270
|
if (c === void 0)
|
|
2272
2271
|
throw Error(
|
|
2273
2272
|
b(
|
|
@@ -2277,16 +2276,16 @@ function Re(e = j(), t = !1) {
|
|
|
2277
2276
|
);
|
|
2278
2277
|
return a === "core" ? `https://${r}/${c}/` : i ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
2279
2278
|
}
|
|
2280
|
-
const
|
|
2281
|
-
function
|
|
2279
|
+
const xn = (e) => e.split("/").pop() ?? e;
|
|
2280
|
+
function An(e) {
|
|
2282
2281
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2283
2282
|
if (i?.groups === void 0)
|
|
2284
2283
|
return;
|
|
2285
2284
|
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
|
|
2286
2285
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2287
2286
|
}
|
|
2288
|
-
async function
|
|
2289
|
-
const r = t.packageName, { hasCss: a, cdnName: c } = await
|
|
2287
|
+
async function Ln(e, t, i, s, n) {
|
|
2288
|
+
const r = t.packageName, { hasCss: a, cdnName: c } = await Vi(t.packageLocation) ?? {};
|
|
2290
2289
|
if (i === "cdn") {
|
|
2291
2290
|
const m = t.cdnUrl ?? Re(t.packageJson, n);
|
|
2292
2291
|
return [
|
|
@@ -2308,7 +2307,7 @@ async function Fn(e, t, i, s, n) {
|
|
|
2308
2307
|
}
|
|
2309
2308
|
];
|
|
2310
2309
|
}
|
|
2311
|
-
const d = `${r}/dist/${c}/${c}.css${
|
|
2310
|
+
const d = `${r}/dist/${c}/${c}.css${Y}`, l = a ? [
|
|
2312
2311
|
`import styles$${s} from "${d}";`,
|
|
2313
2312
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2314
2313
|
] : [], p = `${r}/dist/esm/loader.js`;
|
|
@@ -2329,16 +2328,16 @@ async function Fn(e, t, i, s, n) {
|
|
|
2329
2328
|
}
|
|
2330
2329
|
];
|
|
2331
2330
|
}
|
|
2332
|
-
async function
|
|
2331
|
+
async function Vi(e) {
|
|
2333
2332
|
const t = u.join(e, "dist"), i = u.basename(e), n = (await ct(t)).filter(
|
|
2334
|
-
(a) => !
|
|
2333
|
+
(a) => !Ki.has(a) && !a.includes(".")
|
|
2335
2334
|
), r = n.find(
|
|
2336
2335
|
(a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
|
|
2337
2336
|
a === i
|
|
2338
2337
|
);
|
|
2339
2338
|
return r === void 0 ? await Promise.all(
|
|
2340
2339
|
n.map(async (a) => await Ft(t, a))
|
|
2341
|
-
).then((a) => a.find(
|
|
2340
|
+
).then((a) => a.find(F)) : await Ft(t, r);
|
|
2342
2341
|
}
|
|
2343
2342
|
async function Ft(e, t) {
|
|
2344
2343
|
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), n = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
|
|
@@ -2351,8 +2350,8 @@ async function Ft(e, t) {
|
|
|
2351
2350
|
cdnName: t
|
|
2352
2351
|
} : void 0;
|
|
2353
2352
|
}
|
|
2354
|
-
async function
|
|
2355
|
-
const a = t.packageJson.exports?.[`./${
|
|
2353
|
+
async function Nn(e, t, i, s, n) {
|
|
2354
|
+
const a = t.packageJson.exports?.[`./${Q}.css`] === void 0 ? await Vi(t.packageLocation) : void 0, c = a?.cdnName ?? le, d = a === void 0 ? `${_i}.js` : `${a.cdnName}.esm.js`;
|
|
2356
2355
|
if (i === "cdn")
|
|
2357
2356
|
return {
|
|
2358
2357
|
tag: "script",
|
|
@@ -2361,7 +2360,7 @@ async function Dn(e, t, i, s, n) {
|
|
|
2361
2360
|
src: `${t.cdnUrl ?? Re(t.packageJson, n)}${d}`
|
|
2362
2361
|
}
|
|
2363
2362
|
};
|
|
2364
|
-
const l =
|
|
2363
|
+
const l = jn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${Y}`, m = [
|
|
2365
2364
|
`import styles$${s} from "${p}";`,
|
|
2366
2365
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2367
2366
|
], f = `${t.packageName}/loader`;
|
|
@@ -2380,14 +2379,14 @@ async function Dn(e, t, i, s, n) {
|
|
|
2380
2379
|
]
|
|
2381
2380
|
};
|
|
2382
2381
|
}
|
|
2383
|
-
function
|
|
2382
|
+
function jn(e) {
|
|
2384
2383
|
const { exports: t } = e;
|
|
2385
2384
|
if (t === void 0)
|
|
2386
2385
|
throw new Error(
|
|
2387
2386
|
`Package "${e.name}" does not have an "exports" field. All Lumina packages must include an "exports" field.`
|
|
2388
2387
|
);
|
|
2389
|
-
const i = Object.entries(t).filter(([n]) => u.extname(n) === ".css"), s = i.find(([, n]) => n === `./${
|
|
2390
|
-
return s ? s[0] : i.length > 0 ? i[0][0] : `./${
|
|
2388
|
+
const i = Object.entries(t).filter(([n]) => u.extname(n) === ".css"), s = i.find(([, n]) => n === `./${Q}.css`);
|
|
2389
|
+
return s ? s[0] : i.length > 0 ? i[0][0] : `./${Q}.css`;
|
|
2391
2390
|
}
|
|
2392
2391
|
async function oe(e, t) {
|
|
2393
2392
|
return t !== void 0 ? await Dt(e, t) : (e._loadersCache ??= Dt(e), await e._loadersCache);
|
|
@@ -2398,13 +2397,13 @@ async function Dt(e, t) {
|
|
|
2398
2397
|
const a = async (m) => (await Promise.all(
|
|
2399
2398
|
m.map(async (f) => {
|
|
2400
2399
|
const g = r++;
|
|
2401
|
-
return f.type === "stencil" ? await
|
|
2400
|
+
return f.type === "stencil" ? await Ln(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await Nn(n, f, i, g, s) : void 0;
|
|
2402
2401
|
})
|
|
2403
|
-
)).filter(
|
|
2402
|
+
)).filter(F).flat(), c = await Promise.all([
|
|
2404
2403
|
// This may contain an import map so must be first
|
|
2405
|
-
|
|
2404
|
+
nn(e, n, i, s),
|
|
2406
2405
|
ne.then(a),
|
|
2407
|
-
|
|
2406
|
+
Gi(e).then(a)
|
|
2408
2407
|
]), d = u.join(e.dir.src, "loader.ts"), l = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? le}/` : void 0);
|
|
2409
2408
|
return [
|
|
2410
2409
|
...c.flat(),
|
|
@@ -2423,11 +2422,11 @@ async function Dt(e, t) {
|
|
|
2423
2422
|
}
|
|
2424
2423
|
];
|
|
2425
2424
|
}
|
|
2426
|
-
async function
|
|
2425
|
+
async function Gi(e) {
|
|
2427
2426
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
2428
2427
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
2429
2428
|
t.map(async (i) => {
|
|
2430
|
-
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await
|
|
2429
|
+
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await xi(n);
|
|
2431
2430
|
if (r === void 0)
|
|
2432
2431
|
throw Error(
|
|
2433
2432
|
b(
|
|
@@ -2440,14 +2439,14 @@ async function Xi(e) {
|
|
|
2440
2439
|
cdnUrl: s?.getCdnUrl(e)
|
|
2441
2440
|
};
|
|
2442
2441
|
})
|
|
2443
|
-
).then((i) => i.filter(
|
|
2442
|
+
).then((i) => i.filter(F)), await e._serveOnlyDependencies);
|
|
2444
2443
|
}
|
|
2445
|
-
const
|
|
2446
|
-
function
|
|
2444
|
+
const Xi = "/C:@arcgis/lumina-compiler/testSetupFile", st = `${Xi}/dependencies`, Rt = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, Ue = [Xi];
|
|
2445
|
+
function Fn(e) {
|
|
2447
2446
|
return e.apiJsonEnabled ? `${Ot(e)}
|
|
2448
2447
|
import "${st}";` : Ot(e);
|
|
2449
2448
|
}
|
|
2450
|
-
async function
|
|
2449
|
+
async function Dn(e) {
|
|
2451
2450
|
return (await oe(e)).map((i, s) => {
|
|
2452
2451
|
if ("javascriptCode" in i)
|
|
2453
2452
|
return i.javascriptCode.join(`
|
|
@@ -2458,7 +2457,7 @@ async function Mn(e) {
|
|
|
2458
2457
|
* The $index naming is already used by makeLoaders(), so we use the
|
|
2459
2458
|
* $t prefix to avoid collisions.
|
|
2460
2459
|
*/
|
|
2461
|
-
`import styles$t${s} from "${i.cssHref}${
|
|
2460
|
+
`import styles$t${s} from "${i.cssHref}${Y}";`,
|
|
2462
2461
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$t${s}.styleSheet];`
|
|
2463
2462
|
].join(`
|
|
2464
2463
|
`);
|
|
@@ -2472,16 +2471,16 @@ async function Mn(e) {
|
|
|
2472
2471
|
|
|
2473
2472
|
`);
|
|
2474
2473
|
}
|
|
2475
|
-
const Ot = (e) => [e.isInPuppeteerTestBackEnd ?
|
|
2474
|
+
const Ot = (e) => [e.isInPuppeteerTestBackEnd ? Rn : "", On].join(""), Rn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2476
2475
|
setupPuppeteerTest();
|
|
2477
|
-
`,
|
|
2476
|
+
`, On = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2478
2477
|
setupLuminaTest();
|
|
2479
|
-
`,
|
|
2478
|
+
`, Mn = "@arcgis/lumina:generateLoaderTs";
|
|
2480
2479
|
let Ne;
|
|
2481
|
-
function
|
|
2480
|
+
function Jn(e) {
|
|
2482
2481
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2483
|
-
return [
|
|
2484
|
-
name:
|
|
2482
|
+
return [zs(e.apiExtractorPluginConfig), {
|
|
2483
|
+
name: Mn,
|
|
2485
2484
|
configResolved() {
|
|
2486
2485
|
Ne = `${e.dir.root}src/loader.ts`;
|
|
2487
2486
|
},
|
|
@@ -2496,7 +2495,7 @@ function _n(e) {
|
|
|
2496
2495
|
id: t
|
|
2497
2496
|
},
|
|
2498
2497
|
async handler() {
|
|
2499
|
-
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise,
|
|
2498
|
+
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, Ar(e);
|
|
2500
2499
|
}
|
|
2501
2500
|
},
|
|
2502
2501
|
async handleHotUpdate() {
|
|
@@ -2518,7 +2517,7 @@ function _n(e) {
|
|
|
2518
2517
|
filter: {
|
|
2519
2518
|
id: Rt
|
|
2520
2519
|
},
|
|
2521
|
-
handler: async (r) => r.startsWith(st) ? await
|
|
2520
|
+
handler: async (r) => r.startsWith(st) ? await Dn(e) : Fn(e)
|
|
2522
2521
|
}
|
|
2523
2522
|
}];
|
|
2524
2523
|
}
|
|
@@ -2532,7 +2531,7 @@ const Jt = (e) => {
|
|
|
2532
2531
|
path: u.join("/", u.relative(e.dir.root, Ne))
|
|
2533
2532
|
});
|
|
2534
2533
|
};
|
|
2535
|
-
function
|
|
2534
|
+
function Bn(e) {
|
|
2536
2535
|
let t;
|
|
2537
2536
|
const i = () => [
|
|
2538
2537
|
...e.options.assets?.transformers ?? [],
|
|
@@ -2561,15 +2560,15 @@ function Wn(e) {
|
|
|
2561
2560
|
e.viteCommand === "build" && (t = Bt(e));
|
|
2562
2561
|
},
|
|
2563
2562
|
async configureServer(s) {
|
|
2564
|
-
e.server = s,
|
|
2563
|
+
e.server = s, te(e, await t, i()), s.watcher.on("addDir", (n) => {
|
|
2565
2564
|
if (n.endsWith("assets")) {
|
|
2566
2565
|
const r = u.dirname(n);
|
|
2567
|
-
u.join(r, "/") === e.dir.root ?
|
|
2566
|
+
u.join(r, "/") === e.dir.root ? te(e, [Qi], i()) : n.startsWith(e.dir.srcComponents) && te(e, [Yi(n, r)], i());
|
|
2568
2567
|
}
|
|
2569
2568
|
});
|
|
2570
2569
|
},
|
|
2571
2570
|
async writeBundle() {
|
|
2572
|
-
await
|
|
2571
|
+
await Fi(e, await t, i());
|
|
2573
2572
|
}
|
|
2574
2573
|
};
|
|
2575
2574
|
}
|
|
@@ -2577,38 +2576,38 @@ async function Bt(e) {
|
|
|
2577
2576
|
const t = K("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2578
2577
|
i.map(async (n) => {
|
|
2579
2578
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
2580
|
-
return await K(a) ?
|
|
2579
|
+
return await K(a) ? Yi(a, r) : void 0;
|
|
2581
2580
|
})
|
|
2582
2581
|
);
|
|
2583
|
-
return await t && s.push(
|
|
2582
|
+
return await t && s.push(Qi), s.filter(F);
|
|
2584
2583
|
}
|
|
2585
|
-
const
|
|
2584
|
+
const Yi = (e, t) => ({
|
|
2586
2585
|
type: "directory",
|
|
2587
2586
|
source: e,
|
|
2588
2587
|
destination: u.basename(t)
|
|
2589
|
-
}),
|
|
2590
|
-
name:
|
|
2588
|
+
}), Qi = { type: "directory", source: "assets/", destination: "" }, We = "@arcgis/lumina:printTotalBuildSize", Kn = (e) => ({
|
|
2589
|
+
name: We,
|
|
2591
2590
|
apply: () => e.viteCommand === "build",
|
|
2592
2591
|
configResolved(t) {
|
|
2593
2592
|
const i = t.plugins.find(({ name: n }) => n === "vite:reporter");
|
|
2594
2593
|
if (i === void 0) {
|
|
2595
2594
|
if ("rolldownVersion" in this.meta)
|
|
2596
2595
|
return;
|
|
2597
|
-
T.warn(
|
|
2596
|
+
T.warn(We, "Unable to find the vite's built-in vite:reporter plugin");
|
|
2598
2597
|
return;
|
|
2599
2598
|
}
|
|
2600
2599
|
const s = i.writeBundle;
|
|
2601
2600
|
if (typeof s != "function")
|
|
2602
|
-
throw Error(b(
|
|
2601
|
+
throw Error(b(We, "Expected vite:reporter to declare a writeBundle() function"));
|
|
2603
2602
|
i.writeBundle = async function(r, a) {
|
|
2604
2603
|
let c = 0, d = 0, l = 0, p = 0;
|
|
2605
2604
|
const m = console.log;
|
|
2606
2605
|
console.log = function(...g) {
|
|
2607
2606
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2608
|
-
const [h, y] = g[0].match(
|
|
2607
|
+
const [h, y] = g[0].match(Un) ?? [];
|
|
2609
2608
|
if (!h)
|
|
2610
2609
|
return;
|
|
2611
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2610
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(Wn, "").length);
|
|
2612
2611
|
const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2613
2612
|
y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
|
|
2614
2613
|
}
|
|
@@ -2619,36 +2618,36 @@ const Qi = (e, t) => ({
|
|
|
2619
2618
|
console.log = m;
|
|
2620
2619
|
}
|
|
2621
2620
|
if (d > 0) {
|
|
2622
|
-
const g = l > 0 ? d : c, h =
|
|
2621
|
+
const g = l > 0 ? d : c, h = Ut(g), y = e.dir.relativeDist;
|
|
2623
2622
|
console.log(
|
|
2624
2623
|
[
|
|
2625
2624
|
_t,
|
|
2626
2625
|
y,
|
|
2627
|
-
|
|
2626
|
+
_n,
|
|
2628
2627
|
"*",
|
|
2629
2628
|
" ".repeat(p - `${y}*`.length - h.length),
|
|
2630
2629
|
h,
|
|
2631
2630
|
Kt,
|
|
2632
|
-
l > 0 ? ` ${_t}│ gzip: ${
|
|
2631
|
+
l > 0 ? ` ${_t}│ gzip: ${Ut(l)}${Kt}` : ""
|
|
2633
2632
|
].join("")
|
|
2634
2633
|
);
|
|
2635
2634
|
}
|
|
2636
2635
|
};
|
|
2637
2636
|
}
|
|
2638
|
-
}), Kt = "\x1B[22m\x1B[1m\x1B[22m", _t = "\x1B[2m",
|
|
2637
|
+
}), Kt = "\x1B[22m\x1B[1m\x1B[22m", _t = "\x1B[2m", _n = "\x1B[22m\x1B[36m", Un = /\d+(?:,\d+)?\.\d{2} kB/gu, Wn = /\x1B\[\d+m/gu, zn = new Intl.NumberFormat("en", {
|
|
2639
2638
|
maximumFractionDigits: 2,
|
|
2640
2639
|
minimumFractionDigits: 2
|
|
2641
|
-
}),
|
|
2642
|
-
var
|
|
2643
|
-
const
|
|
2644
|
-
name:
|
|
2640
|
+
}), Ut = (e) => `${zn.format(e)} kB`, qn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", gt.slice(0, -3)));
|
|
2641
|
+
var Hn = ["@arcgis-test/lit-components/loader", "@arcgis/ai-components/loader", "@arcgis/api-extractor", "@arcgis/arcade-languageservice", "@arcgis/arcade-parser", "@arcgis/coding-components/loader", "@arcgis/common-components/loader", "@arcgis/core", "@arcgis/embeddable-components/loader", "@arcgis/languages-api-utils", "@arcgis/languages-sdk-spec", "@arcgis/lumina", "@arcgis/lumina-toolkit", "@arcgis/map-components/loader", "@arcgis/node-toolkit", "@arcgis/portal-components/loader", "@arcgis/stencil-to-lumina", "@arcgis/toolkit", "@arcgis/typescript-config"];
|
|
2642
|
+
const Wt = "@arcgis/lumina:configureVite", Vn = (e) => ({
|
|
2643
|
+
name: Wt,
|
|
2645
2644
|
async config({
|
|
2646
2645
|
server: t,
|
|
2647
2646
|
publicDir: i,
|
|
2648
2647
|
build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
|
|
2649
2648
|
test: p = {}
|
|
2650
2649
|
}, m) {
|
|
2651
|
-
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w =
|
|
2650
|
+
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = q && ee && Ni(m) ? at(Li, import.meta.dirname) : void 0, C = w === void 0 ? [] : [
|
|
2652
2651
|
G(u.join(w, "**/*.{ts,tsx,mjs}")),
|
|
2653
2652
|
`!${G(u.join(w, "**/*.d.ts"))}`
|
|
2654
2653
|
], E = {
|
|
@@ -2706,9 +2705,9 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2706
2705
|
include: [
|
|
2707
2706
|
// Used by controllers. Need to add manually because @arcgis/lumina is
|
|
2708
2707
|
// excluded per comment below, so Vite will discover these usages too late.
|
|
2709
|
-
...
|
|
2708
|
+
...q && !ee ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : [],
|
|
2710
2709
|
// Used by core. Because we exclude core from scanning, these are discovered late, causing errors
|
|
2711
|
-
...
|
|
2710
|
+
...q && ee ? [
|
|
2712
2711
|
"tslib",
|
|
2713
2712
|
"@arcgis/core > luxon",
|
|
2714
2713
|
"@arcgis/core > @esri/arcgis-html-sanitizer",
|
|
@@ -2730,8 +2729,8 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2730
2729
|
* inside the package, and by Calcite outside the package).
|
|
2731
2730
|
*/
|
|
2732
2731
|
exclude: [
|
|
2733
|
-
...
|
|
2734
|
-
...
|
|
2732
|
+
...ee ? [
|
|
2733
|
+
...Hn,
|
|
2735
2734
|
// This exact import is also supplied through optimizableImports in `dependencies/arcgisCore.ts`
|
|
2736
2735
|
// Optimizing it in the monorepo creates a separate core config instance, so the app does not receive the
|
|
2737
2736
|
// configured assetsPath.
|
|
@@ -2764,10 +2763,10 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2764
2763
|
"@lit/task"
|
|
2765
2764
|
]
|
|
2766
2765
|
};
|
|
2767
|
-
if (typeof p.setupFiles == "string" ? p.setupFiles = [...
|
|
2766
|
+
if (typeof p.setupFiles == "string" ? p.setupFiles = [...Ue, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...Ue, ...p.setupFiles] : p.setupFiles = [...Ue], e.isInPuppeteerTestBackEnd) {
|
|
2768
2767
|
if (h?.enabled === !0)
|
|
2769
2768
|
throw Error(
|
|
2770
|
-
b(
|
|
2769
|
+
b(Wt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2771
2770
|
);
|
|
2772
2771
|
return {
|
|
2773
2772
|
test: {
|
|
@@ -2801,7 +2800,7 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2801
2800
|
publicDir: i ?? !1,
|
|
2802
2801
|
build: {
|
|
2803
2802
|
cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
|
|
2804
|
-
target: n ??
|
|
2803
|
+
target: n ?? ji(e),
|
|
2805
2804
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2806
2805
|
lib: {
|
|
2807
2806
|
entry: E,
|
|
@@ -2866,65 +2865,65 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2866
2865
|
e._originalRollupInputOptions ??= t.input;
|
|
2867
2866
|
const s = { ...e._originalRollupInputOptions };
|
|
2868
2867
|
i.forEach((n) => {
|
|
2869
|
-
const r =
|
|
2868
|
+
const r = qn(n);
|
|
2870
2869
|
s[r] = n;
|
|
2871
2870
|
}), t.input = s;
|
|
2872
2871
|
}
|
|
2873
|
-
}), Se = "@arcgis/lumina:serveLocalCdn",
|
|
2872
|
+
}), Se = "@arcgis/lumina:serveLocalCdn", Gn = /^\/?@arcgis\/core(?=\/|$)/u, Zi = "/index.js", Xn = je(Zi), rt = `\0${Se}:index`, Yn = je(rt), Qn = 3e3, Zn = [
|
|
2874
2873
|
/^https?:\/\/localhost(?::[0-9]+)?$/u,
|
|
2875
2874
|
/^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
|
|
2876
2875
|
];
|
|
2877
|
-
function
|
|
2878
|
-
if (!
|
|
2876
|
+
function eo(e) {
|
|
2877
|
+
if (!q)
|
|
2879
2878
|
return;
|
|
2880
|
-
const t =
|
|
2879
|
+
const t = D().name, i = t.split("/").pop() ?? t, s = `/${i}/index.js`, n = je(s), r = `\0${Se}:${i}`, a = je(r);
|
|
2881
2880
|
return {
|
|
2882
2881
|
name: Se,
|
|
2883
2882
|
enforce: "pre",
|
|
2884
2883
|
apply(c) {
|
|
2885
|
-
const d =
|
|
2884
|
+
const d = so(e, c);
|
|
2886
2885
|
return d || (e._localCdnCore = void 0), d;
|
|
2887
2886
|
},
|
|
2888
2887
|
config: {
|
|
2889
2888
|
order: "post",
|
|
2890
2889
|
handler(c, d) {
|
|
2891
|
-
const l = c.server, p =
|
|
2890
|
+
const l = c.server, p = Ni(d), m = p ? Li : Zr, f = at(m, import.meta.dirname);
|
|
2892
2891
|
if (f === void 0)
|
|
2893
2892
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2894
2893
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
2895
2894
|
server: {
|
|
2896
|
-
port: l?.port ??
|
|
2897
|
-
cors: l?.cors ?? { origin:
|
|
2895
|
+
port: l?.port ?? Qn,
|
|
2896
|
+
cors: l?.cors ?? { origin: Zn }
|
|
2898
2897
|
},
|
|
2899
2898
|
resolve: {
|
|
2900
2899
|
// The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
|
|
2901
2900
|
// to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
|
|
2902
|
-
alias: [{ find:
|
|
2901
|
+
alias: [{ find: Gn, replacement: f }]
|
|
2903
2902
|
}
|
|
2904
2903
|
};
|
|
2905
2904
|
}
|
|
2906
2905
|
},
|
|
2907
2906
|
resolveId: {
|
|
2908
|
-
filter: { id: [
|
|
2907
|
+
filter: { id: [Xn, n] },
|
|
2909
2908
|
handler(c) {
|
|
2910
|
-
if (c ===
|
|
2909
|
+
if (c === Zi)
|
|
2911
2910
|
return rt;
|
|
2912
2911
|
if (c === s)
|
|
2913
2912
|
return r;
|
|
2914
2913
|
}
|
|
2915
2914
|
},
|
|
2916
2915
|
load: {
|
|
2917
|
-
filter: { id: [
|
|
2916
|
+
filter: { id: [Yn, a] },
|
|
2918
2917
|
async handler(c) {
|
|
2919
2918
|
if (c === rt)
|
|
2920
2919
|
return `import ${JSON.stringify(s)};
|
|
2921
2920
|
`;
|
|
2922
2921
|
if (c === r)
|
|
2923
|
-
return await
|
|
2922
|
+
return await io(e);
|
|
2924
2923
|
}
|
|
2925
2924
|
},
|
|
2926
2925
|
handleHotUpdate({ file: c, server: d }) {
|
|
2927
|
-
if (
|
|
2926
|
+
if (to(c, e._localCdnCore?.sourceLocation))
|
|
2928
2927
|
return d.ws.send({ type: "full-reload" }), [];
|
|
2929
2928
|
}
|
|
2930
2929
|
};
|
|
@@ -2932,30 +2931,30 @@ function so(e) {
|
|
|
2932
2931
|
function je(e) {
|
|
2933
2932
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2934
2933
|
}
|
|
2935
|
-
function
|
|
2934
|
+
function to(e, t) {
|
|
2936
2935
|
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2937
2936
|
}
|
|
2938
|
-
async function
|
|
2937
|
+
async function io(e) {
|
|
2939
2938
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2940
2939
|
return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
|
|
2941
2940
|
`)}
|
|
2942
2941
|
`;
|
|
2943
2942
|
}
|
|
2944
|
-
function
|
|
2945
|
-
return
|
|
2943
|
+
function so(e, t) {
|
|
2944
|
+
return ee && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2946
2945
|
}
|
|
2947
|
-
const
|
|
2946
|
+
const ro = (e) => ({
|
|
2948
2947
|
name: "@arcgis/lumina:setAssetPath",
|
|
2949
2948
|
apply: () => e.viteCommand === "build",
|
|
2950
2949
|
config: (t) => ({
|
|
2951
2950
|
base: t.base ?? e.options.assets?.defaultPath ?? Re()
|
|
2952
2951
|
})
|
|
2953
2952
|
});
|
|
2954
|
-
function
|
|
2953
|
+
function no(e = D()) {
|
|
2955
2954
|
const t = mt(e) ?? "0.0.1";
|
|
2956
|
-
return
|
|
2955
|
+
return Es(t);
|
|
2957
2956
|
}
|
|
2958
|
-
const
|
|
2957
|
+
const oo = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2959
2958
|
Object.defineProperty(t, i, {
|
|
2960
2959
|
get() {
|
|
2961
2960
|
throw Error(
|
|
@@ -2994,8 +2993,8 @@ const ue = {
|
|
|
2994
2993
|
apiJson: "docs/api.json",
|
|
2995
2994
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2996
2995
|
}, nt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2997
|
-
async function
|
|
2998
|
-
const s =
|
|
2996
|
+
async function es(e, t, i = D()) {
|
|
2997
|
+
const s = ao(e, i), n = u.join(t, "lumina.ts"), a = await K(n) ? await W(n, "utf8") : "";
|
|
2999
2998
|
if (a.trim().replaceAll(`\r
|
|
3000
2999
|
`, `
|
|
3001
3000
|
`) === s.trim())
|
|
@@ -3013,9 +3012,9 @@ Current content:
|
|
|
3013
3012
|
${a}`
|
|
3014
3013
|
)
|
|
3015
3014
|
);
|
|
3016
|
-
return
|
|
3015
|
+
return ci(n, s), !0;
|
|
3017
3016
|
}
|
|
3018
|
-
function
|
|
3017
|
+
function ao(e, t = D()) {
|
|
3019
3018
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3020
3019
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
3021
3020
|
(d, l) => `
|
|
@@ -3026,7 +3025,7 @@ declare module "@arcgis/lumina" {
|
|
|
3026
3025
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
3027
3026
|
}`, a = t.devDependencies ?? {};
|
|
3028
3027
|
return [
|
|
3029
|
-
|
|
3028
|
+
co,
|
|
3030
3029
|
a.vitest ? `
|
|
3031
3030
|
/// <reference types="vitest/config" />
|
|
3032
3031
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3037,7 +3036,7 @@ declare module "@arcgis/lumina" {
|
|
|
3037
3036
|
`
|
|
3038
3037
|
].join("");
|
|
3039
3038
|
}
|
|
3040
|
-
const
|
|
3039
|
+
const co = `/**
|
|
3041
3040
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3042
3041
|
* Manual edits will be overwritten.
|
|
3043
3042
|
*
|
|
@@ -3045,7 +3044,7 @@ const uo = `/**
|
|
|
3045
3044
|
*
|
|
3046
3045
|
* If you need to provide additional types, create a separate file.
|
|
3047
3046
|
*/
|
|
3048
|
-
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport",
|
|
3047
|
+
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport", ts = (e, t) => e.viteCommand === "serve" && /**
|
|
3049
3048
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
3050
3049
|
* However, it is a bit buggy (see
|
|
3051
3050
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -3056,13 +3055,13 @@ const uo = `/**
|
|
|
3056
3055
|
* is doing:
|
|
3057
3056
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3058
3057
|
*/
|
|
3059
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
3058
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, lo = (e) => ({
|
|
3060
3059
|
name: Ce,
|
|
3061
3060
|
async configureServer(t) {
|
|
3062
|
-
|
|
3061
|
+
q && (e.server = t, await an(e));
|
|
3063
3062
|
},
|
|
3064
3063
|
configResolved() {
|
|
3065
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3064
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = po(e).catch(
|
|
3066
3065
|
(t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3067
3066
|
));
|
|
3068
3067
|
},
|
|
@@ -3070,7 +3069,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3070
3069
|
// Add imports to index.html before Vite starts resolving imports
|
|
3071
3070
|
order: "pre",
|
|
3072
3071
|
async handler(t, i) {
|
|
3073
|
-
return
|
|
3072
|
+
return ts(e, i) ? (await oe(e)).map(
|
|
3074
3073
|
(n) => "javascriptCode" in n ? {
|
|
3075
3074
|
tag: "script",
|
|
3076
3075
|
attrs: {
|
|
@@ -3112,26 +3111,26 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3112
3111
|
await e._updateLuminaTsPromise;
|
|
3113
3112
|
}
|
|
3114
3113
|
});
|
|
3115
|
-
async function
|
|
3116
|
-
const i = (await Promise.all([ne,
|
|
3117
|
-
if (!await
|
|
3114
|
+
async function po(e) {
|
|
3115
|
+
const i = (await Promise.all([ne, Gi(e)])).flat();
|
|
3116
|
+
if (!await es(i, e.dir.src))
|
|
3118
3117
|
return;
|
|
3119
3118
|
let n = !1;
|
|
3120
3119
|
function r() {
|
|
3121
|
-
n || T.warn(Ce,
|
|
3120
|
+
n || T.warn(Ce, uo), n = !0;
|
|
3122
3121
|
}
|
|
3123
3122
|
process.on("exit", () => {
|
|
3124
3123
|
r(), clearTimeout(c);
|
|
3125
3124
|
});
|
|
3126
3125
|
const c = setTimeout(r, 2e3);
|
|
3127
3126
|
}
|
|
3128
|
-
const
|
|
3127
|
+
const uo = qs(
|
|
3129
3128
|
"greenBright",
|
|
3130
3129
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3131
3130
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3132
3131
|
);
|
|
3133
|
-
async function
|
|
3134
|
-
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await
|
|
3132
|
+
async function mo(e) {
|
|
3133
|
+
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Vs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : Pt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
3135
3134
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? pe(e.options.documentation.apiJsonFileName) : ue.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
3136
3135
|
{
|
|
3137
3136
|
type: "dynamic",
|
|
@@ -3139,7 +3138,7 @@ async function ho(e) {
|
|
|
3139
3138
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
3140
3139
|
}
|
|
3141
3140
|
]);
|
|
3142
|
-
const s = i?.types?.typeScriptConfig ??
|
|
3141
|
+
const s = i?.types?.typeScriptConfig ?? Gs(
|
|
3143
3142
|
process.cwd(),
|
|
3144
3143
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
3145
3144
|
!0
|
|
@@ -3201,7 +3200,7 @@ async function ho(e) {
|
|
|
3201
3200
|
Jt(e);
|
|
3202
3201
|
break;
|
|
3203
3202
|
}
|
|
3204
|
-
const y =
|
|
3203
|
+
const y = $i(h);
|
|
3205
3204
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
|
|
3206
3205
|
}
|
|
3207
3206
|
Mt(e);
|
|
@@ -3245,10 +3244,10 @@ function zt(e, t) {
|
|
|
3245
3244
|
}
|
|
3246
3245
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3247
3246
|
}
|
|
3248
|
-
var
|
|
3247
|
+
var fo = Object.defineProperty, I = (e, t, i, s) => {
|
|
3249
3248
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3250
3249
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3251
|
-
return n &&
|
|
3250
|
+
return n && fo(t, i, n), n;
|
|
3252
3251
|
};
|
|
3253
3252
|
const V = "@arcgis/lumina:context";
|
|
3254
3253
|
class $ {
|
|
@@ -3274,7 +3273,7 @@ class $ {
|
|
|
3274
3273
|
distComponents: f,
|
|
3275
3274
|
distCdn: g,
|
|
3276
3275
|
distCdnAssets: h
|
|
3277
|
-
}, T.initialize(r.logger, c), r.root !==
|
|
3276
|
+
}, T.initialize(r.logger, c), r.root !== oi())
|
|
3278
3277
|
throw Error(
|
|
3279
3278
|
b(
|
|
3280
3279
|
V,
|
|
@@ -3293,11 +3292,11 @@ class $ {
|
|
|
3293
3292
|
extract: !0
|
|
3294
3293
|
}, (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);
|
|
3295
3294
|
const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3296
|
-
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter =
|
|
3295
|
+
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = Hs({
|
|
3297
3296
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3298
3297
|
target: o.ScriptTarget.ESNext,
|
|
3299
3298
|
sourceMap: r.build.sourcemap !== !1
|
|
3300
|
-
}),
|
|
3299
|
+
}), ts(this) && oe(this);
|
|
3301
3300
|
}
|
|
3302
3301
|
},
|
|
3303
3302
|
configureServer: {
|
|
@@ -3325,7 +3324,7 @@ class $ {
|
|
|
3325
3324
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3326
3325
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3327
3326
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3328
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3327
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = mo(this);
|
|
3329
3328
|
const s = process.cwd().length + 1;
|
|
3330
3329
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3331
3330
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3334,12 +3333,12 @@ class $ {
|
|
|
3334
3333
|
Pe(l, "src/components") && a.push(l);
|
|
3335
3334
|
}
|
|
3336
3335
|
return a;
|
|
3337
|
-
}),
|
|
3338
|
-
const n = t.build?.preamble ??
|
|
3339
|
-
this.banner =
|
|
3336
|
+
}), ki(void 0, t);
|
|
3337
|
+
const n = t.build?.preamble ?? no();
|
|
3338
|
+
this.banner = oo(n);
|
|
3340
3339
|
}
|
|
3341
3340
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3342
|
-
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(
|
|
3341
|
+
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (T.warn(Pi.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
3343
3342
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3344
3343
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3345
3344
|
}
|
|
@@ -3411,7 +3410,7 @@ class $ {
|
|
|
3411
3410
|
if (Array.isArray(this.assetsToProvide))
|
|
3412
3411
|
this.assetsToProvide.push({ assets: t, transformers: i, apply: s });
|
|
3413
3412
|
else if (this.viteCommand === "serve")
|
|
3414
|
-
s === "serve" &&
|
|
3413
|
+
s === "serve" && te(this, t, i);
|
|
3415
3414
|
else
|
|
3416
3415
|
throw Error(
|
|
3417
3416
|
b(
|
|
@@ -3487,8 +3486,8 @@ I([
|
|
|
3487
3486
|
I([
|
|
3488
3487
|
k("configResolved()")
|
|
3489
3488
|
], $.prototype, "_typeScriptPrinter");
|
|
3490
|
-
function
|
|
3491
|
-
const s =
|
|
3489
|
+
function go(e, t, i) {
|
|
3490
|
+
const s = Ii()[t] ?? is(e)[t];
|
|
3492
3491
|
if (s === void 0) {
|
|
3493
3492
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3494
3493
|
return;
|
|
@@ -3502,11 +3501,11 @@ function vo(e, t, i) {
|
|
|
3502
3501
|
}
|
|
3503
3502
|
return s;
|
|
3504
3503
|
}
|
|
3505
|
-
function
|
|
3504
|
+
function ho(e, t) {
|
|
3506
3505
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3507
3506
|
}
|
|
3508
|
-
function
|
|
3509
|
-
return e._localDefinedComponents ??=
|
|
3507
|
+
function is(e) {
|
|
3508
|
+
return e._localDefinedComponents ??= Ai(
|
|
3510
3509
|
e.privateApiJson,
|
|
3511
3510
|
{
|
|
3512
3511
|
packageName: void 0,
|
|
@@ -3517,19 +3516,19 @@ function ss(e) {
|
|
|
3517
3516
|
e.viteCommand === "build"
|
|
3518
3517
|
), e._localDefinedComponents;
|
|
3519
3518
|
}
|
|
3520
|
-
const
|
|
3521
|
-
name:
|
|
3519
|
+
const qt = "makeRuntime(", yo = "@arcgis/core", vo = "@arcgis/lumina:injectRuntimeOptions", bo = (e) => ({
|
|
3520
|
+
name: vo,
|
|
3522
3521
|
transform: {
|
|
3523
3522
|
filter: {
|
|
3524
3523
|
id: /\/src\/runtime\.ts$/u
|
|
3525
3524
|
},
|
|
3526
3525
|
handler(t, i) {
|
|
3527
|
-
const s = t.indexOf(
|
|
3526
|
+
const s = t.indexOf(qt);
|
|
3528
3527
|
if (s === -1)
|
|
3529
3528
|
throw new Error(
|
|
3530
3529
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3531
3530
|
);
|
|
3532
|
-
const n = s +
|
|
3531
|
+
const n = s + qt.length, r = e.options.css?.commonStylesPath;
|
|
3533
3532
|
return {
|
|
3534
3533
|
code: [
|
|
3535
3534
|
r === void 0 ? "" : `import commonStyles from "${he(e.dir.src, r)}${Ie}";`,
|
|
@@ -3537,15 +3536,15 @@ const Ht = "makeRuntime(", wo = "@arcgis/core", So = "@arcgis/lumina:injectRunti
|
|
|
3537
3536
|
"{",
|
|
3538
3537
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
3539
3538
|
'hydratedAttribute:"',
|
|
3540
|
-
e.options.css?.hydratedAttribute ??
|
|
3539
|
+
e.options.css?.hydratedAttribute ?? Ei,
|
|
3541
3540
|
'",',
|
|
3542
3541
|
r === void 0 ? "" : "commonStyles",
|
|
3543
3542
|
"}",
|
|
3544
3543
|
t.slice(n),
|
|
3545
3544
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3546
3545
|
// a cyclical dependency.
|
|
3547
|
-
|
|
3548
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3546
|
+
q ? `
|
|
3547
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${yo}/applications/Components/reactiveUtils.js";
|
|
3549
3548
|
createObservable,
|
|
3550
3549
|
runtime.t = trackAccess;
|
|
3551
3550
|
runtime.o = createObservable;
|
|
@@ -3557,11 +3556,11 @@ runtime.r = runTracked;` : ""
|
|
|
3557
3556
|
}
|
|
3558
3557
|
}
|
|
3559
3558
|
});
|
|
3560
|
-
function
|
|
3561
|
-
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${
|
|
3559
|
+
function wo(e) {
|
|
3560
|
+
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${Q}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3562
3561
|
`;
|
|
3563
3562
|
}
|
|
3564
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3563
|
+
const we = "@arcgis/lumina:addNonLazyImports", So = (e) => ({
|
|
3565
3564
|
name: we,
|
|
3566
3565
|
apply: () => e.viteCommand === "build",
|
|
3567
3566
|
generateBundle(t, i) {
|
|
@@ -3573,7 +3572,7 @@ const we = "@arcgis/lumina:addNonLazyImports", To = (e) => ({
|
|
|
3573
3572
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3574
3573
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3575
3574
|
let m = c.code;
|
|
3576
|
-
m =
|
|
3575
|
+
m = un(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = wo(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
|
|
3577
3576
|
}
|
|
3578
3577
|
}), !r && !e.isInStorybook)
|
|
3579
3578
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3587,7 +3586,7 @@ const we = "@arcgis/lumina:addNonLazyImports", To = (e) => ({
|
|
|
3587
3586
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
3588
3587
|
if (s.has(r) || a.length === 0 && c.length === 0)
|
|
3589
3588
|
return;
|
|
3590
|
-
const l =
|
|
3589
|
+
const l = ss(t, d, s);
|
|
3591
3590
|
if (l.forEach((p) => {
|
|
3592
3591
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
3593
3592
|
}), (a.length > 0 || c.length > 0) && l.length === 0) {
|
|
@@ -3610,14 +3609,14 @@ Possible causes:
|
|
|
3610
3609
|
return [];
|
|
3611
3610
|
const d = u.dirname(r), l = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
|
|
3612
3611
|
function m(P) {
|
|
3613
|
-
const x =
|
|
3612
|
+
const x = go(e, P, r);
|
|
3614
3613
|
if (x === void 0)
|
|
3615
3614
|
return;
|
|
3616
|
-
const S =
|
|
3615
|
+
const S = ho(x, p);
|
|
3617
3616
|
if (S !== `./${p}`)
|
|
3618
|
-
return S.startsWith(".") ? `${S}/${
|
|
3617
|
+
return S.startsWith(".") ? `${S}/${Ht}` : S;
|
|
3619
3618
|
}
|
|
3620
|
-
const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(
|
|
3619
|
+
const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(F), y = (P) => `import "${P}";
|
|
3621
3620
|
`, v = h.map(y).join(""), w = Array.from(g, (P) => {
|
|
3622
3621
|
const x = m(P);
|
|
3623
3622
|
if (x !== void 0) {
|
|
@@ -3631,16 +3630,16 @@ Possible causes:
|
|
|
3631
3630
|
return `.set("${P}", () => import("${x}"))
|
|
3632
3631
|
`;
|
|
3633
3632
|
}
|
|
3634
|
-
}).filter(
|
|
3633
|
+
}).filter(F), C = `${v}export * from "./${gt}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3635
3634
|
${C}
|
|
3636
3635
|
deferredLoaders${w.join("")};` : C;
|
|
3637
|
-
return await
|
|
3636
|
+
return await z(u.join(e.dir.dist, p, Ht), E);
|
|
3638
3637
|
});
|
|
3639
3638
|
await Promise.all(n);
|
|
3640
3639
|
}
|
|
3641
|
-
}),
|
|
3640
|
+
}), Ht = "index.js", ss = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), ss(e, e[n].referencedBy, i, s)));
|
|
3642
3641
|
function Vt(e, t, i) {
|
|
3643
|
-
if (
|
|
3642
|
+
if (Z(e))
|
|
3644
3643
|
return e;
|
|
3645
3644
|
{
|
|
3646
3645
|
i === void 0 && t.neededImports.add("nothing");
|
|
@@ -3654,18 +3653,18 @@ function Vt(e, t, i) {
|
|
|
3654
3653
|
);
|
|
3655
3654
|
}
|
|
3656
3655
|
}
|
|
3657
|
-
function
|
|
3656
|
+
function Z(e) {
|
|
3658
3657
|
return (
|
|
3659
3658
|
// Inlined string literal
|
|
3660
3659
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3661
|
-
|
|
3662
|
-
o.isConditionalExpression(e) &&
|
|
3663
|
-
o.isBinaryExpression(e) && (
|
|
3664
|
-
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) &&
|
|
3665
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3660
|
+
Co.has(e.kind) || // Ternary with both branches never undefined
|
|
3661
|
+
o.isConditionalExpression(e) && Z(e.whenTrue) && Z(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3662
|
+
o.isBinaryExpression(e) && (Eo.has(e.operatorToken.kind) || Z(e.left) && Z(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3663
|
+
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && Z(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3664
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && dr.has(e.tag.text)
|
|
3666
3665
|
);
|
|
3667
3666
|
}
|
|
3668
|
-
const
|
|
3667
|
+
const Co = /* @__PURE__ */ new Set([
|
|
3669
3668
|
o.SyntaxKind.NumericLiteral,
|
|
3670
3669
|
o.SyntaxKind.BigIntLiteral,
|
|
3671
3670
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3684,7 +3683,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3684
3683
|
o.SyntaxKind.ClassExpression,
|
|
3685
3684
|
// Trust? Trust.
|
|
3686
3685
|
o.SyntaxKind.NonNullExpression
|
|
3687
|
-
]),
|
|
3686
|
+
]), Eo = /* @__PURE__ */ new Set([
|
|
3688
3687
|
o.SyntaxKind.PlusEqualsToken,
|
|
3689
3688
|
o.SyntaxKind.MinusEqualsToken,
|
|
3690
3689
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3719,11 +3718,11 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3719
3718
|
o.SyntaxKind.SlashToken,
|
|
3720
3719
|
o.SyntaxKind.PercentToken,
|
|
3721
3720
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3722
|
-
]),
|
|
3721
|
+
]), To = {
|
|
3723
3722
|
property(e, t, i, s) {
|
|
3724
|
-
const n =
|
|
3723
|
+
const n = $o(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3725
3724
|
if (a) {
|
|
3726
|
-
const f =
|
|
3725
|
+
const f = qe(t);
|
|
3727
3726
|
if (f === !0)
|
|
3728
3727
|
return [n.name];
|
|
3729
3728
|
if (f === !1)
|
|
@@ -3738,14 +3737,14 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3738
3737
|
p,
|
|
3739
3738
|
e,
|
|
3740
3739
|
m ? "" : void 0
|
|
3741
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3740
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? ko(f, e) : f;
|
|
3742
3741
|
if (h !== p)
|
|
3743
3742
|
return [m ? `.${i}` : n.name, l, h];
|
|
3744
3743
|
}
|
|
3745
3744
|
return [`.${i}`, ...c];
|
|
3746
3745
|
},
|
|
3747
3746
|
attribute(e, t, i) {
|
|
3748
|
-
const s = t === void 0 ||
|
|
3747
|
+
const s = t === void 0 || qe(t);
|
|
3749
3748
|
if (s === !0)
|
|
3750
3749
|
return [i];
|
|
3751
3750
|
if (s === !1)
|
|
@@ -3754,7 +3753,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3754
3753
|
return [i, ...a];
|
|
3755
3754
|
},
|
|
3756
3755
|
booleanAttribute(e, t, i) {
|
|
3757
|
-
const s = t === void 0 ||
|
|
3756
|
+
const s = t === void 0 || qe(t);
|
|
3758
3757
|
return s === !0 ? [i] : s === !1 ? [] : [`?${i}`, ...Ee(e, t, !1)];
|
|
3759
3758
|
},
|
|
3760
3759
|
event(e, t, i) {
|
|
@@ -3763,7 +3762,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3763
3762
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3764
3763
|
);
|
|
3765
3764
|
const s = i.slice(2), n = Et(s);
|
|
3766
|
-
return [`@${
|
|
3765
|
+
return [`@${gi.has(n) ? s.toLowerCase() : Et(s)}=`, ...bt(e, t, void 0)];
|
|
3767
3766
|
},
|
|
3768
3767
|
directives(e, t) {
|
|
3769
3768
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3779,7 +3778,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3779
3778
|
throw new Error(
|
|
3780
3779
|
`Directives prop cannot contain a spread argument - it needs to be statically analyzable. Still, the following are allowed: directives={[directiveA, condition ? a : b, c()]}. Found ${String(t.expression?.getText(e.sourceFile))}`
|
|
3781
3780
|
);
|
|
3782
|
-
return
|
|
3781
|
+
return H(e, void 0, n);
|
|
3783
3782
|
});
|
|
3784
3783
|
},
|
|
3785
3784
|
ref(e, t) {
|
|
@@ -3794,7 +3793,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3794
3793
|
const n = s ? e.importRenames.stabilizedRef : e.importRenames.ref;
|
|
3795
3794
|
return [
|
|
3796
3795
|
o.factory.createCallExpression(o.factory.createIdentifier(n), void 0, [
|
|
3797
|
-
|
|
3796
|
+
H(e, void 0, t.expression)
|
|
3798
3797
|
])
|
|
3799
3798
|
];
|
|
3800
3799
|
},
|
|
@@ -3811,21 +3810,21 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3811
3810
|
return [o.factory.createIdentifier(n)];
|
|
3812
3811
|
}
|
|
3813
3812
|
};
|
|
3814
|
-
function
|
|
3813
|
+
function $o(e, t, i) {
|
|
3815
3814
|
if (typeof e == "string") {
|
|
3816
3815
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3817
3816
|
if (r !== void 0)
|
|
3818
3817
|
return { name: r, type: "reflected" };
|
|
3819
3818
|
}
|
|
3820
|
-
const s = ze(
|
|
3819
|
+
const s = ze(_.common, t);
|
|
3821
3820
|
if (s !== void 0)
|
|
3822
3821
|
return s;
|
|
3823
3822
|
if (typeof e == "string") {
|
|
3824
|
-
const n = ze(
|
|
3823
|
+
const n = ze(_.perElement[e], t);
|
|
3825
3824
|
if (n !== void 0)
|
|
3826
3825
|
return n;
|
|
3827
3826
|
} else {
|
|
3828
|
-
const n = Object.values(
|
|
3827
|
+
const n = Object.values(_.perElement).map(
|
|
3829
3828
|
(a) => ze(a, t)
|
|
3830
3829
|
), r = Xe(n, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? Xe(n, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3831
3830
|
if (r !== void 0)
|
|
@@ -3850,7 +3849,7 @@ function yt(e, t) {
|
|
|
3850
3849
|
return e;
|
|
3851
3850
|
throw new Error(`key prop value must be an expression. Found ${String(e?.getText(t))}`);
|
|
3852
3851
|
}
|
|
3853
|
-
function
|
|
3852
|
+
function qe(e) {
|
|
3854
3853
|
if (e === void 0)
|
|
3855
3854
|
return !0;
|
|
3856
3855
|
if (o.isJsxExpression(e)) {
|
|
@@ -3885,8 +3884,8 @@ function Gt(e, t) {
|
|
|
3885
3884
|
const i = e.text;
|
|
3886
3885
|
if (i.length === 0)
|
|
3887
3886
|
return [];
|
|
3888
|
-
const s =
|
|
3889
|
-
if (
|
|
3887
|
+
const s = hi(i);
|
|
3888
|
+
if (nr(s)) {
|
|
3890
3889
|
const n = s.replaceAll('"', """);
|
|
3891
3890
|
if (n.length > s.length) {
|
|
3892
3891
|
const r = s.replaceAll("'", "'");
|
|
@@ -3905,25 +3904,25 @@ function Xt(e, t, i) {
|
|
|
3905
3904
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3906
3905
|
);
|
|
3907
3906
|
const s = t.expression;
|
|
3908
|
-
if (
|
|
3907
|
+
if (Po(s)) {
|
|
3909
3908
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3910
3909
|
e.neededImports.add(r);
|
|
3911
3910
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
3912
|
-
|
|
3911
|
+
H(e, void 0, s)
|
|
3913
3912
|
]);
|
|
3914
3913
|
return [`${i}=`, c];
|
|
3915
3914
|
} else
|
|
3916
3915
|
return [i, ...Ee(e, t, !0)];
|
|
3917
3916
|
}
|
|
3918
|
-
const
|
|
3919
|
-
function
|
|
3917
|
+
const Po = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3918
|
+
function ko(e, t) {
|
|
3920
3919
|
t.neededImports.add("live");
|
|
3921
3920
|
const i = t.importRenames.live;
|
|
3922
3921
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3923
3922
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3924
3923
|
]);
|
|
3925
3924
|
}
|
|
3926
|
-
function
|
|
3925
|
+
function Io(e) {
|
|
3927
3926
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Yt && e.expression.arguments.length <= 1)
|
|
3928
3927
|
return {
|
|
3929
3928
|
propType: Yt[e.expression.expression.text],
|
|
@@ -3941,15 +3940,15 @@ const Yt = {
|
|
|
3941
3940
|
bindBooleanAttribute: "booleanAttribute",
|
|
3942
3941
|
bindEvent: "event"
|
|
3943
3942
|
};
|
|
3944
|
-
function
|
|
3945
|
-
return
|
|
3943
|
+
function xo(e, t, i) {
|
|
3944
|
+
return Lo.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : ui.has(e) || e.includes("-") ? "attribute" : !pt(i) && (mi.has(e) || (i === Ye ? !1 : i === ke ? (
|
|
3946
3945
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3947
3946
|
Object.values(Qe).some((r) => r.has(e))
|
|
3948
|
-
) : Qe[i]?.has(e) === !0)) ? kt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (lt.has(i) || dt.has(i)) ? e in
|
|
3947
|
+
) : Qe[i]?.has(e) === !0)) ? kt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (lt.has(i) || dt.has(i)) ? e in _.common.reflected || e in _.common.stringifiedReflected || e in _.common.stringifiedNonReflected ? "property" : kt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3949
3948
|
}
|
|
3950
|
-
const
|
|
3949
|
+
const Ao = ["class", "style", "ref", "directives", "key", "deferLoad"], Lo = new Set(Ao), No = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3951
3950
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3952
|
-
const n =
|
|
3951
|
+
const n = jo(t);
|
|
3953
3952
|
if (n.length % 2 === 0)
|
|
3954
3953
|
throw new Error("Normalized template parts array length must be odd");
|
|
3955
3954
|
const [r, ...a] = n;
|
|
@@ -3957,9 +3956,9 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3957
3956
|
throw new Error("First normalized template part must be a string");
|
|
3958
3957
|
if (i === void 0) {
|
|
3959
3958
|
if (a.length === 0)
|
|
3960
|
-
return
|
|
3959
|
+
return He(s, e, o.factory.createStringLiteral(r));
|
|
3961
3960
|
if (r === "" && a.length === 2 && a[1] === "")
|
|
3962
|
-
return
|
|
3961
|
+
return He(
|
|
3963
3962
|
s,
|
|
3964
3963
|
e,
|
|
3965
3964
|
typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
|
|
@@ -3970,11 +3969,11 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3970
3969
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3971
3970
|
o.factory.createIdentifier(d),
|
|
3972
3971
|
void 0,
|
|
3973
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3972
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Fo(a))
|
|
3974
3973
|
);
|
|
3975
|
-
return
|
|
3974
|
+
return He(s, e, l);
|
|
3976
3975
|
}
|
|
3977
|
-
const
|
|
3976
|
+
const jo = (e) => e.reduce(
|
|
3978
3977
|
(t, i, s) => {
|
|
3979
3978
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3980
3979
|
if (r && a)
|
|
@@ -3984,7 +3983,7 @@ const Ro = (e) => e.reduce(
|
|
|
3984
3983
|
},
|
|
3985
3984
|
[""]
|
|
3986
3985
|
);
|
|
3987
|
-
function
|
|
3986
|
+
function Fo(e) {
|
|
3988
3987
|
if (!(e.length % 2 === 0))
|
|
3989
3988
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3990
3989
|
const i = e.length / 2;
|
|
@@ -4002,15 +4001,15 @@ function Oo(e) {
|
|
|
4002
4001
|
);
|
|
4003
4002
|
});
|
|
4004
4003
|
}
|
|
4005
|
-
function
|
|
4004
|
+
function He(e, t, i) {
|
|
4006
4005
|
if (t === void 0)
|
|
4007
4006
|
return i;
|
|
4008
4007
|
e.neededImports.add("keyed");
|
|
4009
4008
|
const s = e.importRenames.keyed;
|
|
4010
4009
|
return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
|
|
4011
4010
|
}
|
|
4012
|
-
const
|
|
4013
|
-
function
|
|
4011
|
+
const rs = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
4012
|
+
function ns(e, t) {
|
|
4014
4013
|
const i = vt(e);
|
|
4015
4014
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
4016
4015
|
t,
|
|
@@ -4018,18 +4017,18 @@ function os(e, t) {
|
|
|
4018
4017
|
...s,
|
|
4019
4018
|
pos: -1,
|
|
4020
4019
|
end: -1,
|
|
4021
|
-
text:
|
|
4020
|
+
text: os(e.slice(s.pos, s.end))
|
|
4022
4021
|
}))
|
|
4023
4022
|
);
|
|
4024
4023
|
}
|
|
4025
4024
|
const vt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4026
|
-
function
|
|
4025
|
+
function Do(e) {
|
|
4027
4026
|
const t = vt(e);
|
|
4028
4027
|
if (t.length === 0)
|
|
4029
4028
|
return [e || " "];
|
|
4030
4029
|
const i = t.reduceRight(
|
|
4031
4030
|
([n, ...r], a) => {
|
|
4032
|
-
const c =
|
|
4031
|
+
const c = Ro(n), d = os(c.slice(a.pos, a.end));
|
|
4033
4032
|
return [
|
|
4034
4033
|
c.slice(0, a.pos),
|
|
4035
4034
|
/**
|
|
@@ -4047,13 +4046,13 @@ function Mo(e) {
|
|
|
4047
4046
|
const s = i.at(-1);
|
|
4048
4047
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4049
4048
|
}
|
|
4050
|
-
const
|
|
4051
|
-
function
|
|
4049
|
+
const os = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4050
|
+
function Ro(e) {
|
|
4052
4051
|
if (typeof e == "string")
|
|
4053
4052
|
return e;
|
|
4054
4053
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4055
4054
|
}
|
|
4056
|
-
function
|
|
4055
|
+
function Oo(e, t) {
|
|
4057
4056
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4058
4057
|
return t;
|
|
4059
4058
|
const s = t.arguments[0];
|
|
@@ -4077,17 +4076,17 @@ function Bo(e, t) {
|
|
|
4077
4076
|
if (!Qt(C))
|
|
4078
4077
|
return t;
|
|
4079
4078
|
const E = c.statements.slice(0, -1);
|
|
4080
|
-
if (E.some(
|
|
4079
|
+
if (E.some(as))
|
|
4081
4080
|
return t;
|
|
4082
4081
|
d = E.length === 0, l = C;
|
|
4083
4082
|
}
|
|
4084
|
-
const p = o.isJsxElement(l) ? l.openingElement : l, m =
|
|
4083
|
+
const p = o.isJsxElement(l) ? l.openingElement : l, m = us(p);
|
|
4085
4084
|
if (m === -1)
|
|
4086
4085
|
return t;
|
|
4087
4086
|
const f = p.attributes.properties[m];
|
|
4088
4087
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4089
4088
|
return t;
|
|
4090
|
-
const g = yt(f.initializer, e.sourceFile), h =
|
|
4089
|
+
const g = yt(f.initializer, e.sourceFile), h = Mo(r, s, g, d, e);
|
|
4091
4090
|
if (h === void 0)
|
|
4092
4091
|
return t;
|
|
4093
4092
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4110,21 +4109,21 @@ function Bo(e, t) {
|
|
|
4110
4109
|
]);
|
|
4111
4110
|
}
|
|
4112
4111
|
const Qt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
4113
|
-
function
|
|
4112
|
+
function as(e) {
|
|
4114
4113
|
if (o.isReturnStatement(e))
|
|
4115
4114
|
return !0;
|
|
4116
4115
|
let t = !1;
|
|
4117
4116
|
return o.visitEachChild(
|
|
4118
4117
|
e,
|
|
4119
|
-
(i) => (t ||=
|
|
4118
|
+
(i) => (t ||= as(i), i),
|
|
4120
4119
|
void 0
|
|
4121
4120
|
), t;
|
|
4122
4121
|
}
|
|
4123
|
-
function
|
|
4122
|
+
function Mo(e, t, i, s, n) {
|
|
4124
4123
|
const r = J(i);
|
|
4125
4124
|
if (r === void 0)
|
|
4126
4125
|
return;
|
|
4127
|
-
let a =
|
|
4126
|
+
let a = cs(e.name, r);
|
|
4128
4127
|
const c = t.parameters.at(1);
|
|
4129
4128
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
4130
4129
|
r.every(Fe, c.name)) {
|
|
@@ -4136,7 +4135,7 @@ function Ko(e, t, i, s, n) {
|
|
|
4136
4135
|
return;
|
|
4137
4136
|
}
|
|
4138
4137
|
if (!s) {
|
|
4139
|
-
const d =
|
|
4138
|
+
const d = Bo(r, a, t);
|
|
4140
4139
|
if (d === void 0)
|
|
4141
4140
|
return;
|
|
4142
4141
|
a = d;
|
|
@@ -4175,7 +4174,7 @@ function J(e) {
|
|
|
4175
4174
|
}
|
|
4176
4175
|
return t;
|
|
4177
4176
|
} else {
|
|
4178
|
-
if (
|
|
4177
|
+
if (Jo.has(e.kind))
|
|
4179
4178
|
return [];
|
|
4180
4179
|
{
|
|
4181
4180
|
const t = ge(e);
|
|
@@ -4183,7 +4182,7 @@ function J(e) {
|
|
|
4183
4182
|
}
|
|
4184
4183
|
}
|
|
4185
4184
|
}
|
|
4186
|
-
const
|
|
4185
|
+
const Jo = /* @__PURE__ */ new Set([
|
|
4187
4186
|
o.SyntaxKind.NumericLiteral,
|
|
4188
4187
|
o.SyntaxKind.BigIntLiteral,
|
|
4189
4188
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4192,20 +4191,20 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
4192
4191
|
o.SyntaxKind.FalseKeyword,
|
|
4193
4192
|
o.SyntaxKind.NullKeyword,
|
|
4194
4193
|
o.SyntaxKind.TrueKeyword
|
|
4195
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e,
|
|
4196
|
-
function
|
|
4194
|
+
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, cs = (e, t) => o.isObjectBindingPattern(e) ? Uo(e, t) : e;
|
|
4195
|
+
function Bo(e, t, i) {
|
|
4197
4196
|
if (e.every(Fe, t))
|
|
4198
4197
|
return t;
|
|
4199
4198
|
if (o.isIdentifier(t)) {
|
|
4200
|
-
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) =>
|
|
4199
|
+
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => Ko(r, t)) : void 0;
|
|
4201
4200
|
if (s === void 0)
|
|
4202
4201
|
return;
|
|
4203
|
-
const n =
|
|
4202
|
+
const n = cs(s, e);
|
|
4204
4203
|
if (e.every(Fe, n))
|
|
4205
4204
|
return n;
|
|
4206
4205
|
}
|
|
4207
4206
|
}
|
|
4208
|
-
function
|
|
4207
|
+
function Ko(e, t) {
|
|
4209
4208
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4210
4209
|
return;
|
|
4211
4210
|
const i = e.declarationList.declarations[0];
|
|
@@ -4213,34 +4212,34 @@ function Uo(e, t) {
|
|
|
4213
4212
|
}
|
|
4214
4213
|
function Fe(e) {
|
|
4215
4214
|
const t = this;
|
|
4216
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4215
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(_o, e);
|
|
4217
4216
|
}
|
|
4218
|
-
function
|
|
4217
|
+
function _o(e) {
|
|
4219
4218
|
const t = this;
|
|
4220
4219
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4221
4220
|
}
|
|
4222
|
-
function
|
|
4221
|
+
function Uo(e, t) {
|
|
4223
4222
|
let i = !1;
|
|
4224
4223
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4225
4224
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
4226
4225
|
}
|
|
4227
|
-
const
|
|
4228
|
-
function
|
|
4226
|
+
const ls = (e, t) => t.liftedKeys.has(e);
|
|
4227
|
+
function H(e, t, i) {
|
|
4229
4228
|
if (fe(i))
|
|
4230
|
-
return
|
|
4231
|
-
const s = o.isCallExpression(i) ?
|
|
4229
|
+
return ds(e, i);
|
|
4230
|
+
const s = o.isCallExpression(i) ? Oo(e, i) : i, n = o.visitEachChild(
|
|
4232
4231
|
s,
|
|
4233
4232
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4234
|
-
|
|
4233
|
+
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4235
4234
|
e.transformationContext
|
|
4236
4235
|
);
|
|
4237
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) ||
|
|
4236
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || fr(i.right)) ? qo(n) : n;
|
|
4238
4237
|
}
|
|
4239
|
-
function
|
|
4240
|
-
const i =
|
|
4238
|
+
function ds(e, t) {
|
|
4239
|
+
const i = ps(e, t);
|
|
4241
4240
|
return Oe(i, e);
|
|
4242
4241
|
}
|
|
4243
|
-
function
|
|
4242
|
+
function ps(e, t) {
|
|
4244
4243
|
const i = "children" in t ? t.children : [];
|
|
4245
4244
|
if (o.isJsxFragment(t))
|
|
4246
4245
|
return { key: void 0, ...Te(i, e) };
|
|
@@ -4248,17 +4247,17 @@ function us(e, t) {
|
|
|
4248
4247
|
if (o.isJsxNamespacedName(r))
|
|
4249
4248
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4250
4249
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== Ke) {
|
|
4251
|
-
const S = o.isIdentifier(r) && r.text ===
|
|
4250
|
+
const S = o.isIdentifier(r) && r.text === Qs ? Te(i, e) : {
|
|
4252
4251
|
// No need to wrap the function call in a lit-html tag
|
|
4253
4252
|
litTag: void 0,
|
|
4254
|
-
parts: [
|
|
4253
|
+
parts: [zo(e, t, r, i)]
|
|
4255
4254
|
};
|
|
4256
4255
|
return {
|
|
4257
|
-
key:
|
|
4256
|
+
key: Wo(n, e),
|
|
4258
4257
|
...S
|
|
4259
4258
|
};
|
|
4260
4259
|
}
|
|
4261
|
-
const c = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ?
|
|
4260
|
+
const c = r.text === Be ? ke : r.text === Ke ? Ye : r.text, d = r.text === Be ? ae : r.text === Ke ? X : er.has(c) ? yi : lt.has(c) ? se : ce, l = pt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4262
4261
|
let f;
|
|
4263
4262
|
const g = [];
|
|
4264
4263
|
let h = !1;
|
|
@@ -4271,13 +4270,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4271
4270
|
const { name: S, initializer: A } = x;
|
|
4272
4271
|
if (o.isJsxNamespacedName(S))
|
|
4273
4272
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
4274
|
-
const L = S.text, U =
|
|
4273
|
+
const L = S.text, U = Io(A), j = U?.propType ?? xo(L, A, c);
|
|
4275
4274
|
m?.delete(L);
|
|
4276
|
-
const N =
|
|
4275
|
+
const N = To[j](e, U?.initializer ?? A, L, c);
|
|
4277
4276
|
if (N.length === 0)
|
|
4278
4277
|
return [];
|
|
4279
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4280
|
-
return
|
|
4278
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : Do(rs(S, e));
|
|
4279
|
+
return j === "key" ? (f = typeof N[0] == "object" && !ls(S, e) ? N[0] : void 0, B.some(No) ? B : []) : j === "directives" || j === "ref" || L === "deferLoad" ? (h ||= j === "deferLoad", g.push(
|
|
4281
4280
|
...B,
|
|
4282
4281
|
...N.flatMap(
|
|
4283
4282
|
(R, M) => typeof R == "string" || M === 0 || typeof N[M - 1] == "string" ? R : [" ", R]
|
|
@@ -4293,12 +4292,12 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4293
4292
|
`JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
|
|
4294
4293
|
);
|
|
4295
4294
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4296
|
-
const v = typeof c == "string" &&
|
|
4295
|
+
const v = typeof c == "string" && Zs.has(c), w = Te(i, e);
|
|
4297
4296
|
if (v && w.parts.length > 0)
|
|
4298
4297
|
throw Error(
|
|
4299
4298
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
4300
4299
|
);
|
|
4301
|
-
const C = (d === se || d ===
|
|
4300
|
+
const C = (d === se || d === X) && w.parts.length === 0, E = [
|
|
4302
4301
|
"<",
|
|
4303
4302
|
typeof c == "string" ? c : r,
|
|
4304
4303
|
...y,
|
|
@@ -4317,21 +4316,21 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4317
4316
|
];
|
|
4318
4317
|
return { key: f, parts: P, litTag: d };
|
|
4319
4318
|
}
|
|
4320
|
-
function
|
|
4321
|
-
const i = e.attributes.properties[
|
|
4322
|
-
return i && o.isJsxAttribute(i) && !
|
|
4319
|
+
function Wo(e, t) {
|
|
4320
|
+
const i = e.attributes.properties[us(e)];
|
|
4321
|
+
return i && o.isJsxAttribute(i) && !ls(i.name, t) ? yt(i.initializer, t.sourceFile) : void 0;
|
|
4323
4322
|
}
|
|
4324
|
-
const
|
|
4325
|
-
function
|
|
4323
|
+
const us = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4324
|
+
function zo(e, t, i, s) {
|
|
4326
4325
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4327
4326
|
if (o.isJsxSpreadAttribute(d))
|
|
4328
|
-
return
|
|
4327
|
+
return ns(rs(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4329
4328
|
const { name: l, initializer: p } = d;
|
|
4330
4329
|
if (o.isJsxNamespacedName(l))
|
|
4331
4330
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4332
4331
|
if (l.text === "key")
|
|
4333
4332
|
return;
|
|
4334
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ?
|
|
4333
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? ds(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = li(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
4335
4334
|
return o.factory.createPropertyAssignment(f, m);
|
|
4336
4335
|
}), { parts: a, litTag: c } = Te(s, e);
|
|
4337
4336
|
return a.length > 0 && r.push(
|
|
@@ -4340,20 +4339,20 @@ function Vo(e, t, i, s) {
|
|
|
4340
4339
|
Oe({ key: void 0, parts: a, litTag: c }, e)
|
|
4341
4340
|
)
|
|
4342
4341
|
), o.factory.createCallExpression(i, void 0, [
|
|
4343
|
-
o.factory.createObjectLiteralExpression(r.filter(
|
|
4342
|
+
o.factory.createObjectLiteralExpression(r.filter(F))
|
|
4344
4343
|
]);
|
|
4345
4344
|
}
|
|
4346
4345
|
function Te(e, t) {
|
|
4347
4346
|
let i;
|
|
4348
4347
|
const s = e.flatMap((n) => {
|
|
4349
4348
|
if (o.isJsxText(n))
|
|
4350
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4349
|
+
return [t.compiler.shouldMinifyJsx ? ir(n.text) : n.text];
|
|
4351
4350
|
if (o.isJsxExpression(n))
|
|
4352
4351
|
return bt(t, n, n);
|
|
4353
4352
|
{
|
|
4354
|
-
const r =
|
|
4355
|
-
if (r.key === void 0 && r.litTag !== ae && r.litTag !==
|
|
4356
|
-
if (r.litTag ===
|
|
4353
|
+
const r = ps(t, n);
|
|
4354
|
+
if (r.key === void 0 && r.litTag !== ae && r.litTag !== X) {
|
|
4355
|
+
if (r.litTag === yi)
|
|
4357
4356
|
return r.parts;
|
|
4358
4357
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
4359
4358
|
throw new Error(
|
|
@@ -4366,7 +4365,7 @@ function Te(e, t) {
|
|
|
4366
4365
|
});
|
|
4367
4366
|
return { litTag: i, parts: s };
|
|
4368
4367
|
}
|
|
4369
|
-
function
|
|
4368
|
+
function qo(e) {
|
|
4370
4369
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4371
4370
|
e,
|
|
4372
4371
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4378,9 +4377,9 @@ function bt(e, t, i) {
|
|
|
4378
4377
|
if (e.compiler.shouldMinifyJsx)
|
|
4379
4378
|
return [];
|
|
4380
4379
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4381
|
-
return vt(s).length === 0 ? [] : [
|
|
4380
|
+
return vt(s).length === 0 ? [] : [ns(s, o.factory.createIdentifier("undefined"))];
|
|
4382
4381
|
}
|
|
4383
|
-
return o.isStringLiteral(t.expression) ? [
|
|
4382
|
+
return o.isStringLiteral(t.expression) ? [hi(t.expression.text)] : (
|
|
4384
4383
|
/**
|
|
4385
4384
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
4386
4385
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4401,7 +4400,7 @@ function bt(e, t, i) {
|
|
|
4401
4400
|
* making this change useless.
|
|
4402
4401
|
*/
|
|
4403
4402
|
e.compiler.viteCommand === "serve" && e.compiler.viteConfig.build.sourcemap !== !1 && !e.compiler.shouldMinifyJsx && o.isArrowFunction(t.expression) && !o.isBlock(t.expression.body) ? [
|
|
4404
|
-
|
|
4403
|
+
H(
|
|
4405
4404
|
e,
|
|
4406
4405
|
i,
|
|
4407
4406
|
o.factory.updateArrowFunction(
|
|
@@ -4414,20 +4413,20 @@ function bt(e, t, i) {
|
|
|
4414
4413
|
o.factory.createBlock([o.factory.createReturnStatement(t.expression.body)], !0)
|
|
4415
4414
|
)
|
|
4416
4415
|
)
|
|
4417
|
-
] : [
|
|
4416
|
+
] : [H(e, i, t.expression)]
|
|
4418
4417
|
);
|
|
4419
4418
|
}
|
|
4420
|
-
const
|
|
4419
|
+
const ms = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), fs = ms(
|
|
4421
4420
|
Object.entries(re).flatMap(
|
|
4422
4421
|
([e, t]) => t.map((i) => [i, e])
|
|
4423
4422
|
)
|
|
4424
|
-
),
|
|
4425
|
-
function
|
|
4423
|
+
), gs = new Set(Object.keys(fs));
|
|
4424
|
+
function Ho(e, t) {
|
|
4426
4425
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4427
4426
|
if (!o.isStringLiteral(n))
|
|
4428
4427
|
return t;
|
|
4429
|
-
const r =
|
|
4430
|
-
if (a && e.existingImportedModules.add(r),
|
|
4428
|
+
const r = Vo(e.sourceFile.fileName, n.text, ""), a = i?.phaseModifier !== o.SyntaxKind.TypeKeyword;
|
|
4429
|
+
if (a && e.existingImportedModules.add(r), hr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4431
4430
|
!n.text.includes("?")) {
|
|
4432
4431
|
if (s) {
|
|
4433
4432
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4447,7 +4446,7 @@ function Xo(e, t) {
|
|
|
4447
4446
|
// runs for .tsx files, so .css imports in .ts files won't work. However,
|
|
4448
4447
|
// that is unlikely for web component libraries. A workaround is to
|
|
4449
4448
|
// rename the file or explicitly add (undocumented) ?litCss flag
|
|
4450
|
-
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ?
|
|
4449
|
+
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ? Y : Ie)),
|
|
4451
4450
|
t.attributes
|
|
4452
4451
|
);
|
|
4453
4452
|
}
|
|
@@ -4460,22 +4459,22 @@ function Xo(e, t) {
|
|
|
4460
4459
|
const c = i.namedBindings;
|
|
4461
4460
|
if (c === void 0 || !o.isNamedImports(c))
|
|
4462
4461
|
return t;
|
|
4463
|
-
const d =
|
|
4462
|
+
const d = gs.has(n.text);
|
|
4464
4463
|
if (c.elements.forEach((l) => {
|
|
4465
4464
|
const p = (l.propertyName ?? l.name).text, m = re[p];
|
|
4466
4465
|
if (d) {
|
|
4467
4466
|
if (m?.some((h) => h === n.text)) {
|
|
4468
|
-
const h =
|
|
4467
|
+
const h = hs(p, r);
|
|
4469
4468
|
e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
|
|
4470
4469
|
}
|
|
4471
|
-
} else (l.name.text === "h" || l.name.text === "createElement") &&
|
|
4470
|
+
} else (l.name.text === "h" || l.name.text === "createElement") && D().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
|
|
4472
4471
|
const f = p.startsWith(p[0].toUpperCase()), g = u.isAbsolute(r);
|
|
4473
4472
|
a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
|
|
4474
4473
|
}), n.text === "@arcgis/lumina") {
|
|
4475
4474
|
let l = !1;
|
|
4476
4475
|
const p = c.elements.filter((f) => {
|
|
4477
4476
|
const g = (f.propertyName ?? f.name).text;
|
|
4478
|
-
return
|
|
4477
|
+
return gr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4479
4478
|
});
|
|
4480
4479
|
if (p.length === 0)
|
|
4481
4480
|
return;
|
|
@@ -4504,22 +4503,22 @@ function Xo(e, t) {
|
|
|
4504
4503
|
}
|
|
4505
4504
|
return t;
|
|
4506
4505
|
}
|
|
4507
|
-
const
|
|
4508
|
-
function
|
|
4509
|
-
return o.isImportDeclaration(e) ?
|
|
4506
|
+
const hs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? X : e, Vo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4507
|
+
function Go(e) {
|
|
4508
|
+
return o.isImportDeclaration(e) ? Xo(this, e) : e;
|
|
4510
4509
|
}
|
|
4511
|
-
function
|
|
4510
|
+
function Xo(e, t) {
|
|
4512
4511
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4513
|
-
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !
|
|
4512
|
+
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !gs.has(n.text))
|
|
4514
4513
|
return t;
|
|
4515
4514
|
const r = i.phaseModifier === o.SyntaxKind.TypeKeyword;
|
|
4516
4515
|
let a = !1;
|
|
4517
4516
|
const c = s.elements.map((d) => {
|
|
4518
|
-
const l = (d.propertyName ?? d.name).text, p =
|
|
4517
|
+
const l = (d.propertyName ?? d.name).text, p = hs(l, n.text);
|
|
4519
4518
|
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;
|
|
4520
4519
|
});
|
|
4521
|
-
return
|
|
4522
|
-
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(
|
|
4520
|
+
return fs[n.text]?.forEach((d) => {
|
|
4521
|
+
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(ys(d, e)));
|
|
4523
4522
|
}), a ? o.factory.updateImportDeclaration(
|
|
4524
4523
|
t,
|
|
4525
4524
|
t.modifiers,
|
|
@@ -4533,8 +4532,8 @@ function Zo(e, t) {
|
|
|
4533
4532
|
t.attributes
|
|
4534
4533
|
) : t;
|
|
4535
4534
|
}
|
|
4536
|
-
function
|
|
4537
|
-
const t =
|
|
4535
|
+
function Yo(e) {
|
|
4536
|
+
const t = ms(
|
|
4538
4537
|
Array.from(e.neededImports, (i) => [re[i][0], i])
|
|
4539
4538
|
);
|
|
4540
4539
|
return Object.entries(t).map(
|
|
@@ -4544,27 +4543,27 @@ function ea(e) {
|
|
|
4544
4543
|
void 0,
|
|
4545
4544
|
void 0,
|
|
4546
4545
|
o.factory.createNamedImports(
|
|
4547
|
-
s.map((n) => (e.neededImports.delete(n),
|
|
4546
|
+
s.map((n) => (e.neededImports.delete(n), ys(n, e)))
|
|
4548
4547
|
)
|
|
4549
4548
|
),
|
|
4550
4549
|
o.factory.createStringLiteral(i)
|
|
4551
4550
|
)
|
|
4552
4551
|
);
|
|
4553
4552
|
}
|
|
4554
|
-
function
|
|
4555
|
-
const i = e === ae ? ce : e ===
|
|
4553
|
+
function ys(e, t) {
|
|
4554
|
+
const i = e === ae ? ce : e === X ? se : e, s = t.importRenames[e];
|
|
4556
4555
|
return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4557
4556
|
!1,
|
|
4558
4557
|
o.factory.createIdentifier(i),
|
|
4559
4558
|
o.factory.createIdentifier(s)
|
|
4560
4559
|
);
|
|
4561
4560
|
}
|
|
4562
|
-
function
|
|
4563
|
-
const t =
|
|
4561
|
+
function Qo(e) {
|
|
4562
|
+
const t = Or().map(({ packageName: i }) => i);
|
|
4564
4563
|
return e.existingImportedModules.forEach((i) => {
|
|
4565
4564
|
if (u.isAbsolute(i))
|
|
4566
4565
|
return;
|
|
4567
|
-
const s =
|
|
4566
|
+
const s = Xs(i), n = i.slice(s.length + 1);
|
|
4568
4567
|
if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
|
|
4569
4568
|
const r = De(e.sourceFile.fileName);
|
|
4570
4569
|
throw new Error(
|
|
@@ -4573,7 +4572,7 @@ function ta(e) {
|
|
|
4573
4572
|
}
|
|
4574
4573
|
}), [];
|
|
4575
4574
|
}
|
|
4576
|
-
function
|
|
4575
|
+
function Zo(e) {
|
|
4577
4576
|
if (e.compiler.viteCommand === "serve")
|
|
4578
4577
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4579
4578
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4588,7 +4587,7 @@ function ia(e) {
|
|
|
4588
4587
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4589
4588
|
}), [];
|
|
4590
4589
|
}
|
|
4591
|
-
const
|
|
4590
|
+
const ea = (e, t) => {
|
|
4592
4591
|
const i = e.pragmas;
|
|
4593
4592
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4594
4593
|
return e.statements;
|
|
@@ -4608,11 +4607,11 @@ const sa = (e, t) => {
|
|
|
4608
4607
|
}
|
|
4609
4608
|
const r = {
|
|
4610
4609
|
compiler: t.compiler,
|
|
4611
|
-
externalComponents:
|
|
4612
|
-
localComponents:
|
|
4610
|
+
externalComponents: Ii(),
|
|
4611
|
+
localComponents: is(t.compiler),
|
|
4613
4612
|
sourceFile: e,
|
|
4614
4613
|
transformationContext: t.transformation,
|
|
4615
|
-
importRenames:
|
|
4614
|
+
importRenames: ta(e),
|
|
4616
4615
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4617
4616
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4618
4617
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4626,21 +4625,21 @@ const sa = (e, t) => {
|
|
|
4626
4625
|
let a = [];
|
|
4627
4626
|
if (e.statements.every((d) => {
|
|
4628
4627
|
if (o.isImportDeclaration(d)) {
|
|
4629
|
-
const l =
|
|
4628
|
+
const l = Ho(r, d);
|
|
4630
4629
|
if (l === void 0)
|
|
4631
4630
|
return !0;
|
|
4632
4631
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
4633
4632
|
return !1;
|
|
4634
4633
|
} else
|
|
4635
|
-
a.push(
|
|
4634
|
+
a.push(H(r, void 0, d));
|
|
4636
4635
|
return !0;
|
|
4637
4636
|
}), r.hasNonLuminaJsxImport)
|
|
4638
4637
|
return e.statements;
|
|
4639
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4638
|
+
if (r.neededImports.size > 0 && (a = a.map(Go, r), r.existingLitImports.size > 0))
|
|
4640
4639
|
throw new Error(
|
|
4641
4640
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4642
4641
|
);
|
|
4643
|
-
const c = [
|
|
4642
|
+
const c = [Yo, Qo, Zo].flatMap(
|
|
4644
4643
|
(d) => d(r)
|
|
4645
4644
|
);
|
|
4646
4645
|
if (r.neededImports.size > 0)
|
|
@@ -4649,18 +4648,18 @@ const sa = (e, t) => {
|
|
|
4649
4648
|
);
|
|
4650
4649
|
return [...c, ...a];
|
|
4651
4650
|
};
|
|
4652
|
-
function
|
|
4653
|
-
return
|
|
4654
|
-
|
|
4651
|
+
function ta(e) {
|
|
4652
|
+
return ia(e), Object.fromEntries(
|
|
4653
|
+
mr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4655
4654
|
);
|
|
4656
4655
|
}
|
|
4657
|
-
function
|
|
4656
|
+
function ia(e) {
|
|
4658
4657
|
if (!("identifiers" in e))
|
|
4659
4658
|
throw new Error(
|
|
4660
4659
|
"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."
|
|
4661
4660
|
);
|
|
4662
4661
|
}
|
|
4663
|
-
const Zt = "customElement",
|
|
4662
|
+
const Zt = "customElement", sa = (e, t) => {
|
|
4664
4663
|
const i = [];
|
|
4665
4664
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4666
4665
|
const a = r;
|
|
@@ -4690,7 +4689,7 @@ const Zt = "customElement", oa = (e, t) => {
|
|
|
4690
4689
|
o.factory.createStringLiteral(s)
|
|
4691
4690
|
), ...e.statements, ...i];
|
|
4692
4691
|
};
|
|
4693
|
-
function
|
|
4692
|
+
function ra(e, t, i) {
|
|
4694
4693
|
return t.size === 0 ? e : [
|
|
4695
4694
|
o.factory.createPropertyDeclaration(
|
|
4696
4695
|
[
|
|
@@ -4704,8 +4703,8 @@ function aa(e, t, i) {
|
|
|
4704
4703
|
Array.from(
|
|
4705
4704
|
t.entries(),
|
|
4706
4705
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4707
|
-
|
|
4708
|
-
|
|
4706
|
+
li(s) ? o.factory.createStringLiteral(s) : s,
|
|
4707
|
+
na(n, i)
|
|
4709
4708
|
)
|
|
4710
4709
|
)
|
|
4711
4710
|
)
|
|
@@ -4713,7 +4712,7 @@ function aa(e, t, i) {
|
|
|
4713
4712
|
...e
|
|
4714
4713
|
];
|
|
4715
4714
|
}
|
|
4716
|
-
function
|
|
4715
|
+
function na(e, t) {
|
|
4717
4716
|
let i = 0, s = !0;
|
|
4718
4717
|
const n = [], r = [];
|
|
4719
4718
|
for (const d of e.properties)
|
|
@@ -4725,21 +4724,21 @@ function ca(e, t) {
|
|
|
4725
4724
|
if (l === "attribute")
|
|
4726
4725
|
return s = !1, i |= m ? Tt : 0, !m && !f;
|
|
4727
4726
|
if (l === "reflect")
|
|
4728
|
-
return i |= m ?
|
|
4727
|
+
return i |= m ? Ps : 0, !1;
|
|
4729
4728
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4730
4729
|
if (p.text === "Boolean")
|
|
4731
|
-
return i |=
|
|
4730
|
+
return i |= ks, !1;
|
|
4732
4731
|
if (p.text === "Number")
|
|
4733
|
-
return i |=
|
|
4732
|
+
return i |= Is, !1;
|
|
4734
4733
|
} else {
|
|
4735
4734
|
if (l === "state")
|
|
4736
|
-
return s = !1, i |= m ?
|
|
4735
|
+
return s = !1, i |= m ? xs : 0, !1;
|
|
4737
4736
|
if (l === "readOnly")
|
|
4738
|
-
return i |= m ?
|
|
4737
|
+
return i |= m ? As : 0, !1;
|
|
4739
4738
|
if (l === "noAccessor")
|
|
4740
|
-
return i |= m ?
|
|
4739
|
+
return i |= m ? Ls : 0, !1;
|
|
4741
4740
|
if (l === "useDefault")
|
|
4742
|
-
return i |= m ?
|
|
4741
|
+
return i |= m ? Ns : 0, !1;
|
|
4743
4742
|
}
|
|
4744
4743
|
return !0;
|
|
4745
4744
|
}
|
|
@@ -4758,7 +4757,7 @@ function ca(e, t) {
|
|
|
4758
4757
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4759
4758
|
]);
|
|
4760
4759
|
}
|
|
4761
|
-
function
|
|
4760
|
+
function oa(e, t, i) {
|
|
4762
4761
|
let s = -1, n = -1, r = -1;
|
|
4763
4762
|
e.options?.properties.forEach((p, m) => {
|
|
4764
4763
|
if (o.isSpreadAssignment(p))
|
|
@@ -4770,23 +4769,23 @@ function la(e, t, i) {
|
|
|
4770
4769
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4771
4770
|
}
|
|
4772
4771
|
});
|
|
4773
|
-
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d =
|
|
4772
|
+
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = aa(e, i, s), l = [
|
|
4774
4773
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4775
4774
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4776
4775
|
...d !== void 0 ? [d] : []
|
|
4777
4776
|
];
|
|
4778
4777
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4779
4778
|
}
|
|
4780
|
-
function
|
|
4779
|
+
function aa(e, t, i) {
|
|
4781
4780
|
if (t.attribute === void 0)
|
|
4782
4781
|
return;
|
|
4783
|
-
const s =
|
|
4782
|
+
const s = ca(t.type.values);
|
|
4784
4783
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4785
4784
|
o.factory.createIdentifier("type"),
|
|
4786
4785
|
o.factory.createIdentifier(s)
|
|
4787
4786
|
);
|
|
4788
4787
|
}
|
|
4789
|
-
function
|
|
4788
|
+
function ca(e) {
|
|
4790
4789
|
let t = !1, i = !1, s = !1;
|
|
4791
4790
|
if (e?.forEach((n) => {
|
|
4792
4791
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4798,7 +4797,7 @@ function pa(e) {
|
|
|
4798
4797
|
}
|
|
4799
4798
|
return "Other";
|
|
4800
4799
|
}
|
|
4801
|
-
function
|
|
4800
|
+
function la(e, t, i, s, n, r) {
|
|
4802
4801
|
if (i.modifiers === void 0)
|
|
4803
4802
|
return i;
|
|
4804
4803
|
let a = -1, c = -1;
|
|
@@ -4808,23 +4807,23 @@ function ua(e, t, i, s, n, r) {
|
|
|
4808
4807
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4809
4808
|
}
|
|
4810
4809
|
}), a !== -1) {
|
|
4811
|
-
const d =
|
|
4810
|
+
const d = da(e, t, i, s, n), l = ei(i, a, n), p = oa(l, n, d);
|
|
4812
4811
|
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, ti(i, a);
|
|
4813
4812
|
} else if (c !== -1) {
|
|
4814
|
-
const d = ei(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 =
|
|
4813
|
+
const d = ei(i, c, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, l]), m = di(i.name);
|
|
4815
4814
|
if (m === void 0)
|
|
4816
4815
|
throw new Error("Failed to statically determine the state property name");
|
|
4817
4816
|
return r.set(m, p), ti(i, c);
|
|
4818
4817
|
} else
|
|
4819
4818
|
return i;
|
|
4820
4819
|
}
|
|
4821
|
-
function
|
|
4820
|
+
function da(e, t, i, s, n) {
|
|
4822
4821
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4823
4822
|
members: []
|
|
4824
4823
|
} : void 0);
|
|
4825
4824
|
if (r === void 0)
|
|
4826
4825
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4827
|
-
const a =
|
|
4826
|
+
const a = di(i.name);
|
|
4828
4827
|
let c;
|
|
4829
4828
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4830
4829
|
const l = r.members[d];
|
|
@@ -4839,7 +4838,7 @@ function ma(e, t, i, s, n) {
|
|
|
4839
4838
|
throw Error(
|
|
4840
4839
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4841
4840
|
);
|
|
4842
|
-
c.name = a, c.attribute ??=
|
|
4841
|
+
c.name = a, c.attribute ??= ri(a);
|
|
4843
4842
|
}
|
|
4844
4843
|
return c;
|
|
4845
4844
|
}
|
|
@@ -4878,7 +4877,7 @@ function ti(e, t) {
|
|
|
4878
4877
|
e.initializer
|
|
4879
4878
|
);
|
|
4880
4879
|
}
|
|
4881
|
-
function
|
|
4880
|
+
function pa(e, t, i, s) {
|
|
4882
4881
|
let n;
|
|
4883
4882
|
if (e.apiJsonEnabled)
|
|
4884
4883
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4901,9 +4900,9 @@ function fa(e, t, i, s) {
|
|
|
4901
4900
|
} finally {
|
|
4902
4901
|
c = i.statements, i.statements = a;
|
|
4903
4902
|
}
|
|
4904
|
-
return
|
|
4903
|
+
return ua(i, c);
|
|
4905
4904
|
}
|
|
4906
|
-
const
|
|
4905
|
+
const ua = (e, t) => o.factory.updateSourceFile(
|
|
4907
4906
|
e,
|
|
4908
4907
|
t,
|
|
4909
4908
|
/*
|
|
@@ -4918,10 +4917,10 @@ const ga = (e, t) => o.factory.updateSourceFile(
|
|
|
4918
4917
|
!1,
|
|
4919
4918
|
e.libReferenceDirectives
|
|
4920
4919
|
);
|
|
4921
|
-
function
|
|
4920
|
+
function ma(e, t) {
|
|
4922
4921
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4923
4922
|
}
|
|
4924
|
-
const
|
|
4923
|
+
const fa = (e, t) => {
|
|
4925
4924
|
let i;
|
|
4926
4925
|
if (t.apiModule !== void 0)
|
|
4927
4926
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4937,16 +4936,16 @@ const ya = (e, t) => {
|
|
|
4937
4936
|
function n() {
|
|
4938
4937
|
s = /* @__PURE__ */ new Map();
|
|
4939
4938
|
}
|
|
4940
|
-
const r = (d) =>
|
|
4939
|
+
const r = (d) => ra(d, s, t.compiler.shouldMinify);
|
|
4941
4940
|
function a(d, l) {
|
|
4942
|
-
const p =
|
|
4943
|
-
return
|
|
4941
|
+
const p = ha(t, i, d, l, e, s);
|
|
4942
|
+
return ma(p, t), p;
|
|
4944
4943
|
}
|
|
4945
4944
|
return e.statements.map(
|
|
4946
|
-
(d) =>
|
|
4945
|
+
(d) => vs(a, d, t, n, r)
|
|
4947
4946
|
);
|
|
4948
4947
|
};
|
|
4949
|
-
function
|
|
4948
|
+
function vs(e, t, i, s, n = pi) {
|
|
4950
4949
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4951
4950
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4952
4951
|
let r = !1;
|
|
@@ -4969,15 +4968,15 @@ function bs(e, t, i, s, n = ui) {
|
|
|
4969
4968
|
} else
|
|
4970
4969
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4971
4970
|
t,
|
|
4972
|
-
(a) =>
|
|
4971
|
+
(a) => vs(e, a, i, s, n),
|
|
4973
4972
|
i.transformation
|
|
4974
4973
|
) : t;
|
|
4975
4974
|
}
|
|
4976
|
-
const
|
|
4977
|
-
function
|
|
4975
|
+
const ga = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4976
|
+
function ha(e, t, i, s, n, r) {
|
|
4978
4977
|
if (o.isMethodDeclaration(i)) {
|
|
4979
4978
|
const a = i.modifiers?.filter(
|
|
4980
|
-
(c) => !o.isDecorator(c) || !
|
|
4979
|
+
(c) => !o.isDecorator(c) || !ya(c)
|
|
4981
4980
|
);
|
|
4982
4981
|
if (a?.length !== i.modifiers?.length)
|
|
4983
4982
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4991,7 +4990,7 @@ function ba(e, t, i, s, n, r) {
|
|
|
4991
4990
|
i.type,
|
|
4992
4991
|
i.body
|
|
4993
4992
|
);
|
|
4994
|
-
if ("text" in i.name &&
|
|
4993
|
+
if ("text" in i.name && ga.has(i.name.text) && i.body) {
|
|
4995
4994
|
const c = i.name.text;
|
|
4996
4995
|
return i.body.statements.some(
|
|
4997
4996
|
(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
|
|
@@ -5017,14 +5016,14 @@ function ba(e, t, i, s, n, r) {
|
|
|
5017
5016
|
);
|
|
5018
5017
|
}
|
|
5019
5018
|
}
|
|
5020
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5019
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? la(e, t, i, s, n, r) : i;
|
|
5021
5020
|
}
|
|
5022
|
-
const
|
|
5021
|
+
const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", va = [
|
|
5022
|
+
ea,
|
|
5023
5023
|
sa,
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
name: Ca,
|
|
5024
|
+
fa
|
|
5025
|
+
], ba = "@arcgis/lumina:transformComponents", wa = (e) => ({
|
|
5026
|
+
name: ba,
|
|
5028
5027
|
transform: {
|
|
5029
5028
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5030
5029
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5044,11 +5043,11 @@ const wa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5044
5043
|
e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
|
|
5045
5044
|
);
|
|
5046
5045
|
const n = e.getSourceFile(i, t), a = o.transform(n, [
|
|
5047
|
-
(f) => () =>
|
|
5046
|
+
(f) => () => pa(e, f, n, [
|
|
5048
5047
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5049
|
-
...
|
|
5048
|
+
...va
|
|
5050
5049
|
])
|
|
5051
|
-
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : $t.createSourceMapGenerator(
|
|
5050
|
+
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : $t.createSourceMapGenerator(Sa, u.basename(i), "", u.dirname(i), {}), l = $t.createTextWriter(`
|
|
5052
5051
|
`);
|
|
5053
5052
|
c.writeFile(a, l, d);
|
|
5054
5053
|
const p = l.getText(), m = d?.toJSON();
|
|
@@ -5058,18 +5057,18 @@ const wa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5058
5057
|
};
|
|
5059
5058
|
}
|
|
5060
5059
|
}
|
|
5061
|
-
}),
|
|
5060
|
+
}), Sa = {
|
|
5062
5061
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5063
|
-
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ?
|
|
5064
|
-
},
|
|
5062
|
+
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? pi : (e) => e.toLowerCase()
|
|
5063
|
+
}, Ca = (e) => ({
|
|
5065
5064
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5066
5065
|
configureServer(t) {
|
|
5067
|
-
e.server = t, ii(e).forEach(({ assets: i, transformers: s }) =>
|
|
5066
|
+
e.server = t, ii(e).forEach(({ assets: i, transformers: s }) => te(e, i, s));
|
|
5068
5067
|
},
|
|
5069
5068
|
async writeBundle() {
|
|
5070
5069
|
await Promise.all(
|
|
5071
5070
|
ii(e).map(
|
|
5072
|
-
async ({ assets: t, transformers: i }) => await
|
|
5071
|
+
async ({ assets: t, transformers: i }) => await Fi(e, t, i)
|
|
5073
5072
|
)
|
|
5074
5073
|
);
|
|
5075
5074
|
}
|
|
@@ -5080,20 +5079,20 @@ function ii(e) {
|
|
|
5080
5079
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5081
5080
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5082
5081
|
}
|
|
5083
|
-
const ot = "@arcgis/lumina:updatePackageJson",
|
|
5082
|
+
const ot = "@arcgis/lumina:updatePackageJson", Ea = (e) => ({
|
|
5084
5083
|
name: ot,
|
|
5085
5084
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5086
5085
|
configResolved() {
|
|
5087
|
-
|
|
5086
|
+
Ta(e).catch(
|
|
5088
5087
|
(t) => T.error(ot, `Failed to update package's package.json:${String(t)}`)
|
|
5089
5088
|
);
|
|
5090
5089
|
}
|
|
5091
5090
|
});
|
|
5092
|
-
async function
|
|
5093
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await
|
|
5094
|
-
s &&
|
|
5091
|
+
async function Ta(e) {
|
|
5092
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await W(t, "utf-8")), s = $a(i, e);
|
|
5093
|
+
s && ci(t, JSON.stringify(s, null, 2));
|
|
5095
5094
|
}
|
|
5096
|
-
function
|
|
5095
|
+
function $a(e, t) {
|
|
5097
5096
|
const i = e?.devDependencies ?? {};
|
|
5098
5097
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
5099
5098
|
l in i || T.warn(
|
|
@@ -5119,7 +5118,7 @@ function Ia(e, t) {
|
|
|
5119
5118
|
const l = n(r.webTypes);
|
|
5120
5119
|
e["web-types"] !== l && (s = !0, e["web-types"] = l);
|
|
5121
5120
|
}
|
|
5122
|
-
const a = `./${
|
|
5121
|
+
const a = `./${Q}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = he(
|
|
5123
5122
|
t.dir.root,
|
|
5124
5123
|
u.join(t.dir.distCdn, a)
|
|
5125
5124
|
);
|
|
@@ -5132,21 +5131,21 @@ function Ia(e, t) {
|
|
|
5132
5131
|
if (s)
|
|
5133
5132
|
return e;
|
|
5134
5133
|
}
|
|
5135
|
-
const
|
|
5134
|
+
const Pa = (e) => ({
|
|
5136
5135
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5137
5136
|
timestamp: e.apiJson.timestamp,
|
|
5138
5137
|
compiler: e.apiJson.compiler,
|
|
5139
|
-
components:
|
|
5138
|
+
components: ka(e),
|
|
5140
5139
|
typeLibrary: {}
|
|
5141
5140
|
});
|
|
5142
|
-
function
|
|
5141
|
+
function ka(e) {
|
|
5143
5142
|
const t = [];
|
|
5144
5143
|
for (const i of e.apiJson.modules)
|
|
5145
5144
|
for (const s of i.declarations)
|
|
5146
|
-
s.customElement === !0 && t.push(
|
|
5145
|
+
s.customElement === !0 && t.push(Ia(s, i.sourcePath));
|
|
5147
5146
|
return t;
|
|
5148
5147
|
}
|
|
5149
|
-
function
|
|
5148
|
+
function Ia(e, t) {
|
|
5150
5149
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5151
5150
|
return {
|
|
5152
5151
|
filePath: t,
|
|
@@ -5161,9 +5160,9 @@ function La(e, t) {
|
|
|
5161
5160
|
dependencies: [],
|
|
5162
5161
|
dependencyGraph: {},
|
|
5163
5162
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5164
|
-
props: e.members.map(
|
|
5165
|
-
methods: e.members.map(
|
|
5166
|
-
events: e.events?.map(
|
|
5163
|
+
props: e.members.map(xa).filter(F),
|
|
5164
|
+
methods: e.members.map(Aa).filter(F),
|
|
5165
|
+
events: e.events?.map(La) ?? [],
|
|
5167
5166
|
styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
|
|
5168
5167
|
name: s,
|
|
5169
5168
|
annotation: "prop",
|
|
@@ -5188,7 +5187,7 @@ function Ve(e, t = "") {
|
|
|
5188
5187
|
}
|
|
5189
5188
|
return t;
|
|
5190
5189
|
}
|
|
5191
|
-
function
|
|
5190
|
+
function xa(e) {
|
|
5192
5191
|
if (e.kind !== "field")
|
|
5193
5192
|
return;
|
|
5194
5193
|
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;
|
|
@@ -5222,14 +5221,14 @@ const wt = (e) => Object.fromEntries(
|
|
|
5222
5221
|
(t) => [
|
|
5223
5222
|
t.name,
|
|
5224
5223
|
{
|
|
5225
|
-
location: t.package ===
|
|
5224
|
+
location: t.package === Fs ? "global" : t.package === void 0 ? "local" : "import",
|
|
5226
5225
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
5227
5226
|
id: "notImplemented"
|
|
5228
5227
|
}
|
|
5229
5228
|
]
|
|
5230
5229
|
) ?? []
|
|
5231
5230
|
);
|
|
5232
|
-
function
|
|
5231
|
+
function Aa(e) {
|
|
5233
5232
|
if (e.kind !== "method")
|
|
5234
5233
|
return;
|
|
5235
5234
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5260,7 +5259,7 @@ function ja(e) {
|
|
|
5260
5259
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5261
5260
|
};
|
|
5262
5261
|
}
|
|
5263
|
-
function
|
|
5262
|
+
function La(e) {
|
|
5264
5263
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5265
5264
|
return {
|
|
5266
5265
|
event: e.name,
|
|
@@ -5285,8 +5284,8 @@ const ye = {
|
|
|
5285
5284
|
cssParts: "CSS Parts",
|
|
5286
5285
|
methods: "Methods"
|
|
5287
5286
|
};
|
|
5288
|
-
function
|
|
5289
|
-
const t =
|
|
5287
|
+
function bs(e) {
|
|
5288
|
+
const t = Na(e.slots), i = ja(e.events), s = Fa(e.cssProperties), n = Da(e.cssParts), r = Ra(e.members), a = e.description?.trim();
|
|
5290
5289
|
return [...a ? [`${a}
|
|
5291
5290
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5292
5291
|
|
|
@@ -5294,28 +5293,28 @@ function ws(e) {
|
|
|
5294
5293
|
}
|
|
5295
5294
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5296
5295
|
${t.join(`
|
|
5297
|
-
`)}`,
|
|
5296
|
+
`)}`, Na = (e) => ve(
|
|
5298
5297
|
ye.slots,
|
|
5299
5298
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5300
5299
|
(t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
|
|
5301
5300
|
)
|
|
5302
|
-
),
|
|
5301
|
+
), ja = (e) => ve(
|
|
5303
5302
|
ye.events,
|
|
5304
5303
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5305
|
-
),
|
|
5304
|
+
), Fa = (e = []) => ve(
|
|
5306
5305
|
ye.cssProperties,
|
|
5307
5306
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5308
5307
|
(t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5309
5308
|
)
|
|
5310
|
-
),
|
|
5309
|
+
), Da = (e) => ve(
|
|
5311
5310
|
ye.cssParts,
|
|
5312
5311
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5313
|
-
),
|
|
5312
|
+
), Ra = (e) => ve(
|
|
5314
5313
|
ye.methods,
|
|
5315
|
-
e.filter(
|
|
5314
|
+
e.filter(Ds).filter((t) => t.deprecated === void 0).map(
|
|
5316
5315
|
(t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
|
|
5317
5316
|
)
|
|
5318
|
-
),
|
|
5317
|
+
), ws = (e) => {
|
|
5319
5318
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
5320
5319
|
for (let s = 0; s < e.length; ++s) {
|
|
5321
5320
|
const n = e[s].cssProperties;
|
|
@@ -5329,13 +5328,13 @@ ${t.join(`
|
|
|
5329
5328
|
}
|
|
5330
5329
|
}
|
|
5331
5330
|
return t;
|
|
5332
|
-
},
|
|
5331
|
+
}, Ss = (e) => e.flatMap(
|
|
5333
5332
|
(t) => t.cssParts?.filter((i) => i.deprecated === void 0).map((i) => ({
|
|
5334
5333
|
name: `::part(${i.name})`,
|
|
5335
5334
|
description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
|
|
5336
5335
|
})) ?? []
|
|
5337
5336
|
);
|
|
5338
|
-
function
|
|
5337
|
+
function Oa(e) {
|
|
5339
5338
|
if (e.attributes === void 0)
|
|
5340
5339
|
return [];
|
|
5341
5340
|
const t = [];
|
|
@@ -5346,7 +5345,7 @@ function Ba(e) {
|
|
|
5346
5345
|
description: s.description || void 0,
|
|
5347
5346
|
default: s.default,
|
|
5348
5347
|
value: {
|
|
5349
|
-
type:
|
|
5348
|
+
type: Ma(
|
|
5350
5349
|
s.type.values?.map(
|
|
5351
5350
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5352
5351
|
)
|
|
@@ -5356,9 +5355,9 @@ function Ba(e) {
|
|
|
5356
5355
|
}
|
|
5357
5356
|
return t;
|
|
5358
5357
|
}
|
|
5359
|
-
const
|
|
5360
|
-
function
|
|
5361
|
-
const i =
|
|
5358
|
+
const Ma = (e) => e?.length === 1 ? e[0] : e;
|
|
5359
|
+
function Ja(e, t) {
|
|
5360
|
+
const i = Ba(e), s = ws(e), n = Ss(e), r = D();
|
|
5362
5361
|
return {
|
|
5363
5362
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5364
5363
|
name: r.name,
|
|
@@ -5376,11 +5375,11 @@ function _a(e, t) {
|
|
|
5376
5375
|
}
|
|
5377
5376
|
};
|
|
5378
5377
|
}
|
|
5379
|
-
const
|
|
5378
|
+
const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5380
5379
|
name: t.tagName,
|
|
5381
|
-
description:
|
|
5380
|
+
description: bs(t),
|
|
5382
5381
|
"doc-url": t.demos?.[0]?.url,
|
|
5383
|
-
attributes:
|
|
5382
|
+
attributes: Oa(t),
|
|
5384
5383
|
slots: t.slots?.map((i) => ({
|
|
5385
5384
|
name: i.name,
|
|
5386
5385
|
description: i.description
|
|
@@ -5388,10 +5387,10 @@ const Wa = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5388
5387
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5389
5388
|
events: si(t),
|
|
5390
5389
|
js: {
|
|
5391
|
-
properties:
|
|
5390
|
+
properties: Ka(t),
|
|
5392
5391
|
events: si(t)
|
|
5393
5392
|
}
|
|
5394
|
-
})),
|
|
5393
|
+
})), Ka = (e) => e.members.filter(Rs).filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5395
5394
|
name: t.name,
|
|
5396
5395
|
description: t.description,
|
|
5397
5396
|
type: t.type?.text
|
|
@@ -5399,143 +5398,93 @@ const Wa = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5399
5398
|
name: t.name,
|
|
5400
5399
|
type: t.type?.text,
|
|
5401
5400
|
description: t.description
|
|
5402
|
-
})) ?? [],
|
|
5401
|
+
})) ?? [], _a = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5403
5402
|
name: t.tagName,
|
|
5404
|
-
description:
|
|
5405
|
-
attributes:
|
|
5403
|
+
description: bs(t),
|
|
5404
|
+
attributes: Ua(t),
|
|
5406
5405
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5407
|
-
})),
|
|
5406
|
+
})), Ua = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5408
5407
|
name: t.name,
|
|
5409
5408
|
description: t.description || void 0,
|
|
5410
|
-
values:
|
|
5411
|
-
})) ?? [],
|
|
5409
|
+
values: Wa(t)
|
|
5410
|
+
})) ?? [], Wa = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], za = (e) => ({
|
|
5412
5411
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5413
5412
|
version: 1.1,
|
|
5414
|
-
tags:
|
|
5415
|
-
}),
|
|
5413
|
+
tags: _a(e)
|
|
5414
|
+
}), qa = (e) => ({
|
|
5416
5415
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5417
5416
|
version: 1.1,
|
|
5418
|
-
properties:
|
|
5419
|
-
pseudoElements:
|
|
5420
|
-
}),
|
|
5421
|
-
function
|
|
5417
|
+
properties: ws(e),
|
|
5418
|
+
pseudoElements: Ss(e)
|
|
5419
|
+
}), Ha = "@arcgis/lumina:generateDocs";
|
|
5420
|
+
function Va(e) {
|
|
5422
5421
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5423
5422
|
{
|
|
5424
5423
|
type: "dynamic",
|
|
5425
|
-
source: () => JSON.stringify(
|
|
5424
|
+
source: () => JSON.stringify(Pa(e), null, nt(e)),
|
|
5426
5425
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5427
5426
|
}
|
|
5428
5427
|
]), {
|
|
5429
|
-
name:
|
|
5428
|
+
name: Ha,
|
|
5430
5429
|
async writeBundle() {
|
|
5431
5430
|
if (e.isInStorybook)
|
|
5432
5431
|
return;
|
|
5433
|
-
const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [n, r, a].filter(
|
|
5432
|
+
const t = nt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [n, r, a].filter(F);
|
|
5434
5433
|
if (c.length === 0)
|
|
5435
5434
|
return;
|
|
5436
|
-
await
|
|
5435
|
+
await Ji(c);
|
|
5437
5436
|
const d = [];
|
|
5438
5437
|
if (n !== void 0) {
|
|
5439
|
-
const l = JSON.stringify(
|
|
5440
|
-
d.push(
|
|
5438
|
+
const l = JSON.stringify(za(e.apiJsonComponents), null, t);
|
|
5439
|
+
d.push(z(n, l));
|
|
5441
5440
|
}
|
|
5442
5441
|
if (r !== void 0) {
|
|
5443
|
-
const l = JSON.stringify(
|
|
5444
|
-
d.push(
|
|
5442
|
+
const l = JSON.stringify(qa(e.apiJsonComponents), null, t);
|
|
5443
|
+
d.push(z(r, l));
|
|
5445
5444
|
}
|
|
5446
5445
|
if (a !== void 0) {
|
|
5447
|
-
const l =
|
|
5448
|
-
d.push(
|
|
5446
|
+
const l = Ja(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5447
|
+
d.push(z(a, JSON.stringify(l, null, t)));
|
|
5449
5448
|
}
|
|
5450
5449
|
await Promise.all(d);
|
|
5451
5450
|
}
|
|
5452
5451
|
};
|
|
5453
5452
|
}
|
|
5454
|
-
function
|
|
5455
|
-
return {
|
|
5456
|
-
name: "@arcgis/lumina:buildWrappers",
|
|
5457
|
-
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5458
|
-
async writeBundle() {
|
|
5459
|
-
e.isInStorybook || await Promise.all(
|
|
5460
|
-
e.options.build?.wrappers?.map(async (t) => {
|
|
5461
|
-
t.type === "react18" && await tc(e, t);
|
|
5462
|
-
}) ?? []
|
|
5463
|
-
);
|
|
5464
|
-
}
|
|
5465
|
-
};
|
|
5466
|
-
}
|
|
5467
|
-
const Za = "react", ri = "@lit/react", ec = `
|
|
5468
|
-
import React from "${Za}";
|
|
5469
|
-
import { createComponent } from "${ri}";
|
|
5470
|
-
import type { EventName } from "${ri}";
|
|
5471
|
-
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5472
|
-
|
|
5473
|
-
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5474
|
-
`;
|
|
5475
|
-
async function tc(e, t) {
|
|
5476
|
-
const { name: i } = j(), s = [];
|
|
5477
|
-
for (const a of e.apiJson.modules)
|
|
5478
|
-
for (const c of a.declarations)
|
|
5479
|
-
ic(c) && s.push(sc(c));
|
|
5480
|
-
const n = [`/// <reference types="${i}" preserve="true" />`, ec, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5481
|
-
await X(u.dirname(r), { recursive: !0 }), await _(r, n);
|
|
5482
|
-
}
|
|
5483
|
-
function ic(e) {
|
|
5484
|
-
return e.customElement === !0 && e.abstract !== !0;
|
|
5485
|
-
}
|
|
5486
|
-
function sc(e) {
|
|
5487
|
-
const t = e.events?.map(
|
|
5488
|
-
(i) => ` ${Qs(`on${$s(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5489
|
-
).join(`
|
|
5490
|
-
`);
|
|
5491
|
-
return `
|
|
5492
|
-
/** @deprecated since 5.0. React wrappers are not needed in React 19 or above. Use \`<${e.tagName} />\` directly. */
|
|
5493
|
-
export const ${e.pascalCaseName} = /*@__PURE__*/ createWrapper(
|
|
5494
|
-
getReactWrapperOptions(
|
|
5495
|
-
"${e.tagName}" as unknown as HTML${e.pascalCaseName}Element,
|
|
5496
|
-
{${t ? `
|
|
5497
|
-
${t}
|
|
5498
|
-
` : ""}}
|
|
5499
|
-
)
|
|
5500
|
-
);
|
|
5501
|
-
`;
|
|
5502
|
-
}
|
|
5503
|
-
function Lc(e = {}) {
|
|
5453
|
+
function Cc(e = {}) {
|
|
5504
5454
|
const t = new $(e), s = [
|
|
5505
5455
|
t._plugin,
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
Pa(t),
|
|
5510
|
-
_n(t),
|
|
5511
|
-
Ya(t),
|
|
5456
|
+
Vn(t),
|
|
5457
|
+
eo(t),
|
|
5458
|
+
ro(t),
|
|
5512
5459
|
Ea(t),
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5460
|
+
Jn(t),
|
|
5461
|
+
Va(t),
|
|
5462
|
+
wa(t),
|
|
5463
|
+
bo(t),
|
|
5464
|
+
yr(t),
|
|
5465
|
+
Bn(t),
|
|
5466
|
+
Ca(t),
|
|
5467
|
+
So(t),
|
|
5468
|
+
lo(t),
|
|
5469
|
+
Ys(t),
|
|
5470
|
+
hn(t),
|
|
5471
|
+
Kn(t)
|
|
5472
|
+
].filter(F);
|
|
5524
5473
|
return s.context = t, s;
|
|
5525
5474
|
}
|
|
5526
|
-
const
|
|
5527
|
-
initializeComponentDependencies:
|
|
5528
|
-
updateLuminaTs:
|
|
5529
|
-
propertyToAttributeMappings:
|
|
5530
|
-
nativeEvents:
|
|
5475
|
+
const Ec = {
|
|
5476
|
+
initializeComponentDependencies: ki,
|
|
5477
|
+
updateLuminaTs: es,
|
|
5478
|
+
propertyToAttributeMappings: _,
|
|
5479
|
+
nativeEvents: gi,
|
|
5531
5480
|
svgElements: lt,
|
|
5532
5481
|
mathMlElements: dt,
|
|
5533
|
-
alwaysAttributes:
|
|
5534
|
-
nativeAlwaysAttributes:
|
|
5482
|
+
alwaysAttributes: ui,
|
|
5483
|
+
nativeAlwaysAttributes: mi,
|
|
5535
5484
|
htmlAlwaysAttributes: Qe
|
|
5536
5485
|
};
|
|
5537
5486
|
export {
|
|
5538
|
-
|
|
5487
|
+
Ec as exportsForCodemod,
|
|
5539
5488
|
Re as inferCdnUrl,
|
|
5540
|
-
|
|
5489
|
+
Cc as useLumina
|
|
5541
5490
|
};
|