@arcgis/lumina-compiler 6.0.0-next.12 → 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 +647 -695
- package/dist/options.d.ts +0 -32
- package/dist/testing/mount.d.ts +3 -2
- 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.
|
|
@@ -2758,13 +2757,16 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2758
2757
|
"lit-html",
|
|
2759
2758
|
"lit-element",
|
|
2760
2759
|
"@lit/reactive-element",
|
|
2761
|
-
"@lit/context"
|
|
2760
|
+
"@lit/context",
|
|
2761
|
+
// Workaround for Vite bug in pnpm repos
|
|
2762
|
+
// https://github.com/vitejs/vite/issues/21088
|
|
2763
|
+
"@lit/task"
|
|
2762
2764
|
]
|
|
2763
2765
|
};
|
|
2764
|
-
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) {
|
|
2765
2767
|
if (h?.enabled === !0)
|
|
2766
2768
|
throw Error(
|
|
2767
|
-
b(
|
|
2769
|
+
b(Wt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2768
2770
|
);
|
|
2769
2771
|
return {
|
|
2770
2772
|
test: {
|
|
@@ -2798,7 +2800,7 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2798
2800
|
publicDir: i ?? !1,
|
|
2799
2801
|
build: {
|
|
2800
2802
|
cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
|
|
2801
|
-
target: n ??
|
|
2803
|
+
target: n ?? ji(e),
|
|
2802
2804
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2803
2805
|
lib: {
|
|
2804
2806
|
entry: E,
|
|
@@ -2863,65 +2865,65 @@ const Ut = "@arcgis/lumina:configureVite", Yn = (e) => ({
|
|
|
2863
2865
|
e._originalRollupInputOptions ??= t.input;
|
|
2864
2866
|
const s = { ...e._originalRollupInputOptions };
|
|
2865
2867
|
i.forEach((n) => {
|
|
2866
|
-
const r =
|
|
2868
|
+
const r = qn(n);
|
|
2867
2869
|
s[r] = n;
|
|
2868
2870
|
}), t.input = s;
|
|
2869
2871
|
}
|
|
2870
|
-
}), 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 = [
|
|
2871
2873
|
/^https?:\/\/localhost(?::[0-9]+)?$/u,
|
|
2872
2874
|
/^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
|
|
2873
2875
|
];
|
|
2874
|
-
function
|
|
2875
|
-
if (!
|
|
2876
|
+
function eo(e) {
|
|
2877
|
+
if (!q)
|
|
2876
2878
|
return;
|
|
2877
|
-
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);
|
|
2878
2880
|
return {
|
|
2879
2881
|
name: Se,
|
|
2880
2882
|
enforce: "pre",
|
|
2881
2883
|
apply(c) {
|
|
2882
|
-
const d =
|
|
2884
|
+
const d = so(e, c);
|
|
2883
2885
|
return d || (e._localCdnCore = void 0), d;
|
|
2884
2886
|
},
|
|
2885
2887
|
config: {
|
|
2886
2888
|
order: "post",
|
|
2887
2889
|
handler(c, d) {
|
|
2888
|
-
const l = c.server, p =
|
|
2890
|
+
const l = c.server, p = Ni(d), m = p ? Li : Zr, f = at(m, import.meta.dirname);
|
|
2889
2891
|
if (f === void 0)
|
|
2890
2892
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2891
2893
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
2892
2894
|
server: {
|
|
2893
|
-
port: l?.port ??
|
|
2894
|
-
cors: l?.cors ?? { origin:
|
|
2895
|
+
port: l?.port ?? Qn,
|
|
2896
|
+
cors: l?.cors ?? { origin: Zn }
|
|
2895
2897
|
},
|
|
2896
2898
|
resolve: {
|
|
2897
2899
|
// The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
|
|
2898
2900
|
// to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
|
|
2899
|
-
alias: [{ find:
|
|
2901
|
+
alias: [{ find: Gn, replacement: f }]
|
|
2900
2902
|
}
|
|
2901
2903
|
};
|
|
2902
2904
|
}
|
|
2903
2905
|
},
|
|
2904
2906
|
resolveId: {
|
|
2905
|
-
filter: { id: [
|
|
2907
|
+
filter: { id: [Xn, n] },
|
|
2906
2908
|
handler(c) {
|
|
2907
|
-
if (c ===
|
|
2909
|
+
if (c === Zi)
|
|
2908
2910
|
return rt;
|
|
2909
2911
|
if (c === s)
|
|
2910
2912
|
return r;
|
|
2911
2913
|
}
|
|
2912
2914
|
},
|
|
2913
2915
|
load: {
|
|
2914
|
-
filter: { id: [
|
|
2916
|
+
filter: { id: [Yn, a] },
|
|
2915
2917
|
async handler(c) {
|
|
2916
2918
|
if (c === rt)
|
|
2917
2919
|
return `import ${JSON.stringify(s)};
|
|
2918
2920
|
`;
|
|
2919
2921
|
if (c === r)
|
|
2920
|
-
return await
|
|
2922
|
+
return await io(e);
|
|
2921
2923
|
}
|
|
2922
2924
|
},
|
|
2923
2925
|
handleHotUpdate({ file: c, server: d }) {
|
|
2924
|
-
if (
|
|
2926
|
+
if (to(c, e._localCdnCore?.sourceLocation))
|
|
2925
2927
|
return d.ws.send({ type: "full-reload" }), [];
|
|
2926
2928
|
}
|
|
2927
2929
|
};
|
|
@@ -2929,30 +2931,30 @@ function so(e) {
|
|
|
2929
2931
|
function je(e) {
|
|
2930
2932
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2931
2933
|
}
|
|
2932
|
-
function
|
|
2934
|
+
function to(e, t) {
|
|
2933
2935
|
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2934
2936
|
}
|
|
2935
|
-
async function
|
|
2937
|
+
async function io(e) {
|
|
2936
2938
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2937
2939
|
return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
|
|
2938
2940
|
`)}
|
|
2939
2941
|
`;
|
|
2940
2942
|
}
|
|
2941
|
-
function
|
|
2942
|
-
return
|
|
2943
|
+
function so(e, t) {
|
|
2944
|
+
return ee && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2943
2945
|
}
|
|
2944
|
-
const
|
|
2946
|
+
const ro = (e) => ({
|
|
2945
2947
|
name: "@arcgis/lumina:setAssetPath",
|
|
2946
2948
|
apply: () => e.viteCommand === "build",
|
|
2947
2949
|
config: (t) => ({
|
|
2948
2950
|
base: t.base ?? e.options.assets?.defaultPath ?? Re()
|
|
2949
2951
|
})
|
|
2950
2952
|
});
|
|
2951
|
-
function
|
|
2953
|
+
function no(e = D()) {
|
|
2952
2954
|
const t = mt(e) ?? "0.0.1";
|
|
2953
|
-
return
|
|
2955
|
+
return Es(t);
|
|
2954
2956
|
}
|
|
2955
|
-
const
|
|
2957
|
+
const oo = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2956
2958
|
Object.defineProperty(t, i, {
|
|
2957
2959
|
get() {
|
|
2958
2960
|
throw Error(
|
|
@@ -2991,8 +2993,8 @@ const ue = {
|
|
|
2991
2993
|
apiJson: "docs/api.json",
|
|
2992
2994
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2993
2995
|
}, nt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2994
|
-
async function
|
|
2995
|
-
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") : "";
|
|
2996
2998
|
if (a.trim().replaceAll(`\r
|
|
2997
2999
|
`, `
|
|
2998
3000
|
`) === s.trim())
|
|
@@ -3010,9 +3012,9 @@ Current content:
|
|
|
3010
3012
|
${a}`
|
|
3011
3013
|
)
|
|
3012
3014
|
);
|
|
3013
|
-
return
|
|
3015
|
+
return ci(n, s), !0;
|
|
3014
3016
|
}
|
|
3015
|
-
function
|
|
3017
|
+
function ao(e, t = D()) {
|
|
3016
3018
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3017
3019
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
3018
3020
|
(d, l) => `
|
|
@@ -3023,7 +3025,7 @@ declare module "@arcgis/lumina" {
|
|
|
3023
3025
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
3024
3026
|
}`, a = t.devDependencies ?? {};
|
|
3025
3027
|
return [
|
|
3026
|
-
|
|
3028
|
+
co,
|
|
3027
3029
|
a.vitest ? `
|
|
3028
3030
|
/// <reference types="vitest/config" />
|
|
3029
3031
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3034,7 +3036,7 @@ declare module "@arcgis/lumina" {
|
|
|
3034
3036
|
`
|
|
3035
3037
|
].join("");
|
|
3036
3038
|
}
|
|
3037
|
-
const
|
|
3039
|
+
const co = `/**
|
|
3038
3040
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3039
3041
|
* Manual edits will be overwritten.
|
|
3040
3042
|
*
|
|
@@ -3042,7 +3044,7 @@ const uo = `/**
|
|
|
3042
3044
|
*
|
|
3043
3045
|
* If you need to provide additional types, create a separate file.
|
|
3044
3046
|
*/
|
|
3045
|
-
/// <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" && /**
|
|
3046
3048
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
3047
3049
|
* However, it is a bit buggy (see
|
|
3048
3050
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -3053,13 +3055,13 @@ const uo = `/**
|
|
|
3053
3055
|
* is doing:
|
|
3054
3056
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3055
3057
|
*/
|
|
3056
|
-
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) => ({
|
|
3057
3059
|
name: Ce,
|
|
3058
3060
|
async configureServer(t) {
|
|
3059
|
-
|
|
3061
|
+
q && (e.server = t, await an(e));
|
|
3060
3062
|
},
|
|
3061
3063
|
configResolved() {
|
|
3062
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3064
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = po(e).catch(
|
|
3063
3065
|
(t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3064
3066
|
));
|
|
3065
3067
|
},
|
|
@@ -3067,7 +3069,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3067
3069
|
// Add imports to index.html before Vite starts resolving imports
|
|
3068
3070
|
order: "pre",
|
|
3069
3071
|
async handler(t, i) {
|
|
3070
|
-
return
|
|
3072
|
+
return ts(e, i) ? (await oe(e)).map(
|
|
3071
3073
|
(n) => "javascriptCode" in n ? {
|
|
3072
3074
|
tag: "script",
|
|
3073
3075
|
attrs: {
|
|
@@ -3109,26 +3111,26 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3109
3111
|
await e._updateLuminaTsPromise;
|
|
3110
3112
|
}
|
|
3111
3113
|
});
|
|
3112
|
-
async function
|
|
3113
|
-
const i = (await Promise.all([ne,
|
|
3114
|
-
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))
|
|
3115
3117
|
return;
|
|
3116
3118
|
let n = !1;
|
|
3117
3119
|
function r() {
|
|
3118
|
-
n || T.warn(Ce,
|
|
3120
|
+
n || T.warn(Ce, uo), n = !0;
|
|
3119
3121
|
}
|
|
3120
3122
|
process.on("exit", () => {
|
|
3121
3123
|
r(), clearTimeout(c);
|
|
3122
3124
|
});
|
|
3123
3125
|
const c = setTimeout(r, 2e3);
|
|
3124
3126
|
}
|
|
3125
|
-
const
|
|
3127
|
+
const uo = qs(
|
|
3126
3128
|
"greenBright",
|
|
3127
3129
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3128
3130
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3129
3131
|
);
|
|
3130
|
-
async function
|
|
3131
|
-
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);
|
|
3132
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([
|
|
3133
3135
|
{
|
|
3134
3136
|
type: "dynamic",
|
|
@@ -3136,7 +3138,7 @@ async function ho(e) {
|
|
|
3136
3138
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
3137
3139
|
}
|
|
3138
3140
|
]);
|
|
3139
|
-
const s = i?.types?.typeScriptConfig ??
|
|
3141
|
+
const s = i?.types?.typeScriptConfig ?? Gs(
|
|
3140
3142
|
process.cwd(),
|
|
3141
3143
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
3142
3144
|
!0
|
|
@@ -3198,7 +3200,7 @@ async function ho(e) {
|
|
|
3198
3200
|
Jt(e);
|
|
3199
3201
|
break;
|
|
3200
3202
|
}
|
|
3201
|
-
const y =
|
|
3203
|
+
const y = $i(h);
|
|
3202
3204
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
|
|
3203
3205
|
}
|
|
3204
3206
|
Mt(e);
|
|
@@ -3242,10 +3244,10 @@ function zt(e, t) {
|
|
|
3242
3244
|
}
|
|
3243
3245
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3244
3246
|
}
|
|
3245
|
-
var
|
|
3247
|
+
var fo = Object.defineProperty, I = (e, t, i, s) => {
|
|
3246
3248
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3247
3249
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3248
|
-
return n &&
|
|
3250
|
+
return n && fo(t, i, n), n;
|
|
3249
3251
|
};
|
|
3250
3252
|
const V = "@arcgis/lumina:context";
|
|
3251
3253
|
class $ {
|
|
@@ -3271,7 +3273,7 @@ class $ {
|
|
|
3271
3273
|
distComponents: f,
|
|
3272
3274
|
distCdn: g,
|
|
3273
3275
|
distCdnAssets: h
|
|
3274
|
-
}, T.initialize(r.logger, c), r.root !==
|
|
3276
|
+
}, T.initialize(r.logger, c), r.root !== oi())
|
|
3275
3277
|
throw Error(
|
|
3276
3278
|
b(
|
|
3277
3279
|
V,
|
|
@@ -3290,11 +3292,11 @@ class $ {
|
|
|
3290
3292
|
extract: !0
|
|
3291
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);
|
|
3292
3294
|
const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3293
|
-
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({
|
|
3294
3296
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3295
3297
|
target: o.ScriptTarget.ESNext,
|
|
3296
3298
|
sourceMap: r.build.sourcemap !== !1
|
|
3297
|
-
}),
|
|
3299
|
+
}), ts(this) && oe(this);
|
|
3298
3300
|
}
|
|
3299
3301
|
},
|
|
3300
3302
|
configureServer: {
|
|
@@ -3322,7 +3324,7 @@ class $ {
|
|
|
3322
3324
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3323
3325
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3324
3326
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3325
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3327
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = mo(this);
|
|
3326
3328
|
const s = process.cwd().length + 1;
|
|
3327
3329
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3328
3330
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3331,12 +3333,12 @@ class $ {
|
|
|
3331
3333
|
Pe(l, "src/components") && a.push(l);
|
|
3332
3334
|
}
|
|
3333
3335
|
return a;
|
|
3334
|
-
}),
|
|
3335
|
-
const n = t.build?.preamble ??
|
|
3336
|
-
this.banner =
|
|
3336
|
+
}), ki(void 0, t);
|
|
3337
|
+
const n = t.build?.preamble ?? no();
|
|
3338
|
+
this.banner = oo(n);
|
|
3337
3339
|
}
|
|
3338
3340
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3339
|
-
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;
|
|
3340
3342
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3341
3343
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3342
3344
|
}
|
|
@@ -3408,7 +3410,7 @@ class $ {
|
|
|
3408
3410
|
if (Array.isArray(this.assetsToProvide))
|
|
3409
3411
|
this.assetsToProvide.push({ assets: t, transformers: i, apply: s });
|
|
3410
3412
|
else if (this.viteCommand === "serve")
|
|
3411
|
-
s === "serve" &&
|
|
3413
|
+
s === "serve" && te(this, t, i);
|
|
3412
3414
|
else
|
|
3413
3415
|
throw Error(
|
|
3414
3416
|
b(
|
|
@@ -3484,8 +3486,8 @@ I([
|
|
|
3484
3486
|
I([
|
|
3485
3487
|
k("configResolved()")
|
|
3486
3488
|
], $.prototype, "_typeScriptPrinter");
|
|
3487
|
-
function
|
|
3488
|
-
const s =
|
|
3489
|
+
function go(e, t, i) {
|
|
3490
|
+
const s = Ii()[t] ?? is(e)[t];
|
|
3489
3491
|
if (s === void 0) {
|
|
3490
3492
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3491
3493
|
return;
|
|
@@ -3499,11 +3501,11 @@ function vo(e, t, i) {
|
|
|
3499
3501
|
}
|
|
3500
3502
|
return s;
|
|
3501
3503
|
}
|
|
3502
|
-
function
|
|
3504
|
+
function ho(e, t) {
|
|
3503
3505
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3504
3506
|
}
|
|
3505
|
-
function
|
|
3506
|
-
return e._localDefinedComponents ??=
|
|
3507
|
+
function is(e) {
|
|
3508
|
+
return e._localDefinedComponents ??= Ai(
|
|
3507
3509
|
e.privateApiJson,
|
|
3508
3510
|
{
|
|
3509
3511
|
packageName: void 0,
|
|
@@ -3514,19 +3516,19 @@ function ss(e) {
|
|
|
3514
3516
|
e.viteCommand === "build"
|
|
3515
3517
|
), e._localDefinedComponents;
|
|
3516
3518
|
}
|
|
3517
|
-
const
|
|
3518
|
-
name:
|
|
3519
|
+
const qt = "makeRuntime(", yo = "@arcgis/core", vo = "@arcgis/lumina:injectRuntimeOptions", bo = (e) => ({
|
|
3520
|
+
name: vo,
|
|
3519
3521
|
transform: {
|
|
3520
3522
|
filter: {
|
|
3521
3523
|
id: /\/src\/runtime\.ts$/u
|
|
3522
3524
|
},
|
|
3523
3525
|
handler(t, i) {
|
|
3524
|
-
const s = t.indexOf(
|
|
3526
|
+
const s = t.indexOf(qt);
|
|
3525
3527
|
if (s === -1)
|
|
3526
3528
|
throw new Error(
|
|
3527
3529
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3528
3530
|
);
|
|
3529
|
-
const n = s +
|
|
3531
|
+
const n = s + qt.length, r = e.options.css?.commonStylesPath;
|
|
3530
3532
|
return {
|
|
3531
3533
|
code: [
|
|
3532
3534
|
r === void 0 ? "" : `import commonStyles from "${he(e.dir.src, r)}${Ie}";`,
|
|
@@ -3534,15 +3536,15 @@ const Ht = "makeRuntime(", wo = "@arcgis/core", So = "@arcgis/lumina:injectRunti
|
|
|
3534
3536
|
"{",
|
|
3535
3537
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
3536
3538
|
'hydratedAttribute:"',
|
|
3537
|
-
e.options.css?.hydratedAttribute ??
|
|
3539
|
+
e.options.css?.hydratedAttribute ?? Ei,
|
|
3538
3540
|
'",',
|
|
3539
3541
|
r === void 0 ? "" : "commonStyles",
|
|
3540
3542
|
"}",
|
|
3541
3543
|
t.slice(n),
|
|
3542
3544
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3543
3545
|
// a cyclical dependency.
|
|
3544
|
-
|
|
3545
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3546
|
+
q ? `
|
|
3547
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${yo}/applications/Components/reactiveUtils.js";
|
|
3546
3548
|
createObservable,
|
|
3547
3549
|
runtime.t = trackAccess;
|
|
3548
3550
|
runtime.o = createObservable;
|
|
@@ -3554,11 +3556,11 @@ runtime.r = runTracked;` : ""
|
|
|
3554
3556
|
}
|
|
3555
3557
|
}
|
|
3556
3558
|
});
|
|
3557
|
-
function
|
|
3558
|
-
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`}";
|
|
3559
3561
|
`;
|
|
3560
3562
|
}
|
|
3561
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3563
|
+
const we = "@arcgis/lumina:addNonLazyImports", So = (e) => ({
|
|
3562
3564
|
name: we,
|
|
3563
3565
|
apply: () => e.viteCommand === "build",
|
|
3564
3566
|
generateBundle(t, i) {
|
|
@@ -3570,7 +3572,7 @@ const we = "@arcgis/lumina:addNonLazyImports", To = (e) => ({
|
|
|
3570
3572
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3571
3573
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3572
3574
|
let m = c.code;
|
|
3573
|
-
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;
|
|
3574
3576
|
}
|
|
3575
3577
|
}), !r && !e.isInStorybook)
|
|
3576
3578
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3584,7 +3586,7 @@ const we = "@arcgis/lumina:addNonLazyImports", To = (e) => ({
|
|
|
3584
3586
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
3585
3587
|
if (s.has(r) || a.length === 0 && c.length === 0)
|
|
3586
3588
|
return;
|
|
3587
|
-
const l =
|
|
3589
|
+
const l = ss(t, d, s);
|
|
3588
3590
|
if (l.forEach((p) => {
|
|
3589
3591
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
3590
3592
|
}), (a.length > 0 || c.length > 0) && l.length === 0) {
|
|
@@ -3607,14 +3609,14 @@ Possible causes:
|
|
|
3607
3609
|
return [];
|
|
3608
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);
|
|
3609
3611
|
function m(P) {
|
|
3610
|
-
const x =
|
|
3612
|
+
const x = go(e, P, r);
|
|
3611
3613
|
if (x === void 0)
|
|
3612
3614
|
return;
|
|
3613
|
-
const S =
|
|
3615
|
+
const S = ho(x, p);
|
|
3614
3616
|
if (S !== `./${p}`)
|
|
3615
|
-
return S.startsWith(".") ? `${S}/${
|
|
3617
|
+
return S.startsWith(".") ? `${S}/${Ht}` : S;
|
|
3616
3618
|
}
|
|
3617
|
-
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}";
|
|
3618
3620
|
`, v = h.map(y).join(""), w = Array.from(g, (P) => {
|
|
3619
3621
|
const x = m(P);
|
|
3620
3622
|
if (x !== void 0) {
|
|
@@ -3628,16 +3630,16 @@ Possible causes:
|
|
|
3628
3630
|
return `.set("${P}", () => import("${x}"))
|
|
3629
3631
|
`;
|
|
3630
3632
|
}
|
|
3631
|
-
}).filter(
|
|
3633
|
+
}).filter(F), C = `${v}export * from "./${gt}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3632
3634
|
${C}
|
|
3633
3635
|
deferredLoaders${w.join("")};` : C;
|
|
3634
|
-
return await
|
|
3636
|
+
return await z(u.join(e.dir.dist, p, Ht), E);
|
|
3635
3637
|
});
|
|
3636
3638
|
await Promise.all(n);
|
|
3637
3639
|
}
|
|
3638
|
-
}),
|
|
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)));
|
|
3639
3641
|
function Vt(e, t, i) {
|
|
3640
|
-
if (
|
|
3642
|
+
if (Z(e))
|
|
3641
3643
|
return e;
|
|
3642
3644
|
{
|
|
3643
3645
|
i === void 0 && t.neededImports.add("nothing");
|
|
@@ -3651,18 +3653,18 @@ function Vt(e, t, i) {
|
|
|
3651
3653
|
);
|
|
3652
3654
|
}
|
|
3653
3655
|
}
|
|
3654
|
-
function
|
|
3656
|
+
function Z(e) {
|
|
3655
3657
|
return (
|
|
3656
3658
|
// Inlined string literal
|
|
3657
3659
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3658
|
-
|
|
3659
|
-
o.isConditionalExpression(e) &&
|
|
3660
|
-
o.isBinaryExpression(e) && (
|
|
3661
|
-
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) &&
|
|
3662
|
-
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)
|
|
3663
3665
|
);
|
|
3664
3666
|
}
|
|
3665
|
-
const
|
|
3667
|
+
const Co = /* @__PURE__ */ new Set([
|
|
3666
3668
|
o.SyntaxKind.NumericLiteral,
|
|
3667
3669
|
o.SyntaxKind.BigIntLiteral,
|
|
3668
3670
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3681,7 +3683,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3681
3683
|
o.SyntaxKind.ClassExpression,
|
|
3682
3684
|
// Trust? Trust.
|
|
3683
3685
|
o.SyntaxKind.NonNullExpression
|
|
3684
|
-
]),
|
|
3686
|
+
]), Eo = /* @__PURE__ */ new Set([
|
|
3685
3687
|
o.SyntaxKind.PlusEqualsToken,
|
|
3686
3688
|
o.SyntaxKind.MinusEqualsToken,
|
|
3687
3689
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3716,11 +3718,11 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3716
3718
|
o.SyntaxKind.SlashToken,
|
|
3717
3719
|
o.SyntaxKind.PercentToken,
|
|
3718
3720
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3719
|
-
]),
|
|
3721
|
+
]), To = {
|
|
3720
3722
|
property(e, t, i, s) {
|
|
3721
|
-
const n =
|
|
3723
|
+
const n = $o(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3722
3724
|
if (a) {
|
|
3723
|
-
const f =
|
|
3725
|
+
const f = qe(t);
|
|
3724
3726
|
if (f === !0)
|
|
3725
3727
|
return [n.name];
|
|
3726
3728
|
if (f === !1)
|
|
@@ -3735,14 +3737,14 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3735
3737
|
p,
|
|
3736
3738
|
e,
|
|
3737
3739
|
m ? "" : void 0
|
|
3738
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3740
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? ko(f, e) : f;
|
|
3739
3741
|
if (h !== p)
|
|
3740
3742
|
return [m ? `.${i}` : n.name, l, h];
|
|
3741
3743
|
}
|
|
3742
3744
|
return [`.${i}`, ...c];
|
|
3743
3745
|
},
|
|
3744
3746
|
attribute(e, t, i) {
|
|
3745
|
-
const s = t === void 0 ||
|
|
3747
|
+
const s = t === void 0 || qe(t);
|
|
3746
3748
|
if (s === !0)
|
|
3747
3749
|
return [i];
|
|
3748
3750
|
if (s === !1)
|
|
@@ -3751,7 +3753,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3751
3753
|
return [i, ...a];
|
|
3752
3754
|
},
|
|
3753
3755
|
booleanAttribute(e, t, i) {
|
|
3754
|
-
const s = t === void 0 ||
|
|
3756
|
+
const s = t === void 0 || qe(t);
|
|
3755
3757
|
return s === !0 ? [i] : s === !1 ? [] : [`?${i}`, ...Ee(e, t, !1)];
|
|
3756
3758
|
},
|
|
3757
3759
|
event(e, t, i) {
|
|
@@ -3760,7 +3762,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3760
3762
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3761
3763
|
);
|
|
3762
3764
|
const s = i.slice(2), n = Et(s);
|
|
3763
|
-
return [`@${
|
|
3765
|
+
return [`@${gi.has(n) ? s.toLowerCase() : Et(s)}=`, ...bt(e, t, void 0)];
|
|
3764
3766
|
},
|
|
3765
3767
|
directives(e, t) {
|
|
3766
3768
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3776,7 +3778,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3776
3778
|
throw new Error(
|
|
3777
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))}`
|
|
3778
3780
|
);
|
|
3779
|
-
return
|
|
3781
|
+
return H(e, void 0, n);
|
|
3780
3782
|
});
|
|
3781
3783
|
},
|
|
3782
3784
|
ref(e, t) {
|
|
@@ -3791,7 +3793,7 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3791
3793
|
const n = s ? e.importRenames.stabilizedRef : e.importRenames.ref;
|
|
3792
3794
|
return [
|
|
3793
3795
|
o.factory.createCallExpression(o.factory.createIdentifier(n), void 0, [
|
|
3794
|
-
|
|
3796
|
+
H(e, void 0, t.expression)
|
|
3795
3797
|
])
|
|
3796
3798
|
];
|
|
3797
3799
|
},
|
|
@@ -3808,21 +3810,21 @@ const $o = /* @__PURE__ */ new Set([
|
|
|
3808
3810
|
return [o.factory.createIdentifier(n)];
|
|
3809
3811
|
}
|
|
3810
3812
|
};
|
|
3811
|
-
function
|
|
3813
|
+
function $o(e, t, i) {
|
|
3812
3814
|
if (typeof e == "string") {
|
|
3813
3815
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3814
3816
|
if (r !== void 0)
|
|
3815
3817
|
return { name: r, type: "reflected" };
|
|
3816
3818
|
}
|
|
3817
|
-
const s = ze(
|
|
3819
|
+
const s = ze(_.common, t);
|
|
3818
3820
|
if (s !== void 0)
|
|
3819
3821
|
return s;
|
|
3820
3822
|
if (typeof e == "string") {
|
|
3821
|
-
const n = ze(
|
|
3823
|
+
const n = ze(_.perElement[e], t);
|
|
3822
3824
|
if (n !== void 0)
|
|
3823
3825
|
return n;
|
|
3824
3826
|
} else {
|
|
3825
|
-
const n = Object.values(
|
|
3827
|
+
const n = Object.values(_.perElement).map(
|
|
3826
3828
|
(a) => ze(a, t)
|
|
3827
3829
|
), r = Xe(n, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? Xe(n, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3828
3830
|
if (r !== void 0)
|
|
@@ -3847,7 +3849,7 @@ function yt(e, t) {
|
|
|
3847
3849
|
return e;
|
|
3848
3850
|
throw new Error(`key prop value must be an expression. Found ${String(e?.getText(t))}`);
|
|
3849
3851
|
}
|
|
3850
|
-
function
|
|
3852
|
+
function qe(e) {
|
|
3851
3853
|
if (e === void 0)
|
|
3852
3854
|
return !0;
|
|
3853
3855
|
if (o.isJsxExpression(e)) {
|
|
@@ -3882,8 +3884,8 @@ function Gt(e, t) {
|
|
|
3882
3884
|
const i = e.text;
|
|
3883
3885
|
if (i.length === 0)
|
|
3884
3886
|
return [];
|
|
3885
|
-
const s =
|
|
3886
|
-
if (
|
|
3887
|
+
const s = hi(i);
|
|
3888
|
+
if (nr(s)) {
|
|
3887
3889
|
const n = s.replaceAll('"', """);
|
|
3888
3890
|
if (n.length > s.length) {
|
|
3889
3891
|
const r = s.replaceAll("'", "'");
|
|
@@ -3902,25 +3904,25 @@ function Xt(e, t, i) {
|
|
|
3902
3904
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3903
3905
|
);
|
|
3904
3906
|
const s = t.expression;
|
|
3905
|
-
if (
|
|
3907
|
+
if (Po(s)) {
|
|
3906
3908
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3907
3909
|
e.neededImports.add(r);
|
|
3908
3910
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
3909
|
-
|
|
3911
|
+
H(e, void 0, s)
|
|
3910
3912
|
]);
|
|
3911
3913
|
return [`${i}=`, c];
|
|
3912
3914
|
} else
|
|
3913
3915
|
return [i, ...Ee(e, t, !0)];
|
|
3914
3916
|
}
|
|
3915
|
-
const
|
|
3916
|
-
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) {
|
|
3917
3919
|
t.neededImports.add("live");
|
|
3918
3920
|
const i = t.importRenames.live;
|
|
3919
3921
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3920
3922
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3921
3923
|
]);
|
|
3922
3924
|
}
|
|
3923
|
-
function
|
|
3925
|
+
function Io(e) {
|
|
3924
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)
|
|
3925
3927
|
return {
|
|
3926
3928
|
propType: Yt[e.expression.expression.text],
|
|
@@ -3938,15 +3940,15 @@ const Yt = {
|
|
|
3938
3940
|
bindBooleanAttribute: "booleanAttribute",
|
|
3939
3941
|
bindEvent: "event"
|
|
3940
3942
|
};
|
|
3941
|
-
function
|
|
3942
|
-
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 ? (
|
|
3943
3945
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3944
3946
|
Object.values(Qe).some((r) => r.has(e))
|
|
3945
|
-
) : 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";
|
|
3946
3948
|
}
|
|
3947
|
-
const
|
|
3949
|
+
const Ao = ["class", "style", "ref", "directives", "key", "deferLoad"], Lo = new Set(Ao), No = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3948
3950
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3949
|
-
const n =
|
|
3951
|
+
const n = jo(t);
|
|
3950
3952
|
if (n.length % 2 === 0)
|
|
3951
3953
|
throw new Error("Normalized template parts array length must be odd");
|
|
3952
3954
|
const [r, ...a] = n;
|
|
@@ -3954,9 +3956,9 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3954
3956
|
throw new Error("First normalized template part must be a string");
|
|
3955
3957
|
if (i === void 0) {
|
|
3956
3958
|
if (a.length === 0)
|
|
3957
|
-
return
|
|
3959
|
+
return He(s, e, o.factory.createStringLiteral(r));
|
|
3958
3960
|
if (r === "" && a.length === 2 && a[1] === "")
|
|
3959
|
-
return
|
|
3961
|
+
return He(
|
|
3960
3962
|
s,
|
|
3961
3963
|
e,
|
|
3962
3964
|
typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
|
|
@@ -3967,11 +3969,11 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3967
3969
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3968
3970
|
o.factory.createIdentifier(d),
|
|
3969
3971
|
void 0,
|
|
3970
|
-
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))
|
|
3971
3973
|
);
|
|
3972
|
-
return
|
|
3974
|
+
return He(s, e, l);
|
|
3973
3975
|
}
|
|
3974
|
-
const
|
|
3976
|
+
const jo = (e) => e.reduce(
|
|
3975
3977
|
(t, i, s) => {
|
|
3976
3978
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3977
3979
|
if (r && a)
|
|
@@ -3981,7 +3983,7 @@ const Ro = (e) => e.reduce(
|
|
|
3981
3983
|
},
|
|
3982
3984
|
[""]
|
|
3983
3985
|
);
|
|
3984
|
-
function
|
|
3986
|
+
function Fo(e) {
|
|
3985
3987
|
if (!(e.length % 2 === 0))
|
|
3986
3988
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3987
3989
|
const i = e.length / 2;
|
|
@@ -3999,15 +4001,15 @@ function Oo(e) {
|
|
|
3999
4001
|
);
|
|
4000
4002
|
});
|
|
4001
4003
|
}
|
|
4002
|
-
function
|
|
4004
|
+
function He(e, t, i) {
|
|
4003
4005
|
if (t === void 0)
|
|
4004
4006
|
return i;
|
|
4005
4007
|
e.neededImports.add("keyed");
|
|
4006
4008
|
const s = e.importRenames.keyed;
|
|
4007
4009
|
return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
|
|
4008
4010
|
}
|
|
4009
|
-
const
|
|
4010
|
-
function
|
|
4011
|
+
const rs = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
4012
|
+
function ns(e, t) {
|
|
4011
4013
|
const i = vt(e);
|
|
4012
4014
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
4013
4015
|
t,
|
|
@@ -4015,18 +4017,18 @@ function os(e, t) {
|
|
|
4015
4017
|
...s,
|
|
4016
4018
|
pos: -1,
|
|
4017
4019
|
end: -1,
|
|
4018
|
-
text:
|
|
4020
|
+
text: os(e.slice(s.pos, s.end))
|
|
4019
4021
|
}))
|
|
4020
4022
|
);
|
|
4021
4023
|
}
|
|
4022
4024
|
const vt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4023
|
-
function
|
|
4025
|
+
function Do(e) {
|
|
4024
4026
|
const t = vt(e);
|
|
4025
4027
|
if (t.length === 0)
|
|
4026
4028
|
return [e || " "];
|
|
4027
4029
|
const i = t.reduceRight(
|
|
4028
4030
|
([n, ...r], a) => {
|
|
4029
|
-
const c =
|
|
4031
|
+
const c = Ro(n), d = os(c.slice(a.pos, a.end));
|
|
4030
4032
|
return [
|
|
4031
4033
|
c.slice(0, a.pos),
|
|
4032
4034
|
/**
|
|
@@ -4044,13 +4046,13 @@ function Mo(e) {
|
|
|
4044
4046
|
const s = i.at(-1);
|
|
4045
4047
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4046
4048
|
}
|
|
4047
|
-
const
|
|
4048
|
-
function
|
|
4049
|
+
const os = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4050
|
+
function Ro(e) {
|
|
4049
4051
|
if (typeof e == "string")
|
|
4050
4052
|
return e;
|
|
4051
4053
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4052
4054
|
}
|
|
4053
|
-
function
|
|
4055
|
+
function Oo(e, t) {
|
|
4054
4056
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4055
4057
|
return t;
|
|
4056
4058
|
const s = t.arguments[0];
|
|
@@ -4074,17 +4076,17 @@ function Bo(e, t) {
|
|
|
4074
4076
|
if (!Qt(C))
|
|
4075
4077
|
return t;
|
|
4076
4078
|
const E = c.statements.slice(0, -1);
|
|
4077
|
-
if (E.some(
|
|
4079
|
+
if (E.some(as))
|
|
4078
4080
|
return t;
|
|
4079
4081
|
d = E.length === 0, l = C;
|
|
4080
4082
|
}
|
|
4081
|
-
const p = o.isJsxElement(l) ? l.openingElement : l, m =
|
|
4083
|
+
const p = o.isJsxElement(l) ? l.openingElement : l, m = us(p);
|
|
4082
4084
|
if (m === -1)
|
|
4083
4085
|
return t;
|
|
4084
4086
|
const f = p.attributes.properties[m];
|
|
4085
4087
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4086
4088
|
return t;
|
|
4087
|
-
const g = yt(f.initializer, e.sourceFile), h =
|
|
4089
|
+
const g = yt(f.initializer, e.sourceFile), h = Mo(r, s, g, d, e);
|
|
4088
4090
|
if (h === void 0)
|
|
4089
4091
|
return t;
|
|
4090
4092
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4107,21 +4109,21 @@ function Bo(e, t) {
|
|
|
4107
4109
|
]);
|
|
4108
4110
|
}
|
|
4109
4111
|
const Qt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
4110
|
-
function
|
|
4112
|
+
function as(e) {
|
|
4111
4113
|
if (o.isReturnStatement(e))
|
|
4112
4114
|
return !0;
|
|
4113
4115
|
let t = !1;
|
|
4114
4116
|
return o.visitEachChild(
|
|
4115
4117
|
e,
|
|
4116
|
-
(i) => (t ||=
|
|
4118
|
+
(i) => (t ||= as(i), i),
|
|
4117
4119
|
void 0
|
|
4118
4120
|
), t;
|
|
4119
4121
|
}
|
|
4120
|
-
function
|
|
4122
|
+
function Mo(e, t, i, s, n) {
|
|
4121
4123
|
const r = J(i);
|
|
4122
4124
|
if (r === void 0)
|
|
4123
4125
|
return;
|
|
4124
|
-
let a =
|
|
4126
|
+
let a = cs(e.name, r);
|
|
4125
4127
|
const c = t.parameters.at(1);
|
|
4126
4128
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
4127
4129
|
r.every(Fe, c.name)) {
|
|
@@ -4133,7 +4135,7 @@ function Ko(e, t, i, s, n) {
|
|
|
4133
4135
|
return;
|
|
4134
4136
|
}
|
|
4135
4137
|
if (!s) {
|
|
4136
|
-
const d =
|
|
4138
|
+
const d = Bo(r, a, t);
|
|
4137
4139
|
if (d === void 0)
|
|
4138
4140
|
return;
|
|
4139
4141
|
a = d;
|
|
@@ -4172,7 +4174,7 @@ function J(e) {
|
|
|
4172
4174
|
}
|
|
4173
4175
|
return t;
|
|
4174
4176
|
} else {
|
|
4175
|
-
if (
|
|
4177
|
+
if (Jo.has(e.kind))
|
|
4176
4178
|
return [];
|
|
4177
4179
|
{
|
|
4178
4180
|
const t = ge(e);
|
|
@@ -4180,7 +4182,7 @@ function J(e) {
|
|
|
4180
4182
|
}
|
|
4181
4183
|
}
|
|
4182
4184
|
}
|
|
4183
|
-
const
|
|
4185
|
+
const Jo = /* @__PURE__ */ new Set([
|
|
4184
4186
|
o.SyntaxKind.NumericLiteral,
|
|
4185
4187
|
o.SyntaxKind.BigIntLiteral,
|
|
4186
4188
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4189,20 +4191,20 @@ const _o = /* @__PURE__ */ new Set([
|
|
|
4189
4191
|
o.SyntaxKind.FalseKeyword,
|
|
4190
4192
|
o.SyntaxKind.NullKeyword,
|
|
4191
4193
|
o.SyntaxKind.TrueKeyword
|
|
4192
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e,
|
|
4193
|
-
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) {
|
|
4194
4196
|
if (e.every(Fe, t))
|
|
4195
4197
|
return t;
|
|
4196
4198
|
if (o.isIdentifier(t)) {
|
|
4197
|
-
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;
|
|
4198
4200
|
if (s === void 0)
|
|
4199
4201
|
return;
|
|
4200
|
-
const n =
|
|
4202
|
+
const n = cs(s, e);
|
|
4201
4203
|
if (e.every(Fe, n))
|
|
4202
4204
|
return n;
|
|
4203
4205
|
}
|
|
4204
4206
|
}
|
|
4205
|
-
function
|
|
4207
|
+
function Ko(e, t) {
|
|
4206
4208
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4207
4209
|
return;
|
|
4208
4210
|
const i = e.declarationList.declarations[0];
|
|
@@ -4210,34 +4212,34 @@ function Uo(e, t) {
|
|
|
4210
4212
|
}
|
|
4211
4213
|
function Fe(e) {
|
|
4212
4214
|
const t = this;
|
|
4213
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4215
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(_o, e);
|
|
4214
4216
|
}
|
|
4215
|
-
function
|
|
4217
|
+
function _o(e) {
|
|
4216
4218
|
const t = this;
|
|
4217
4219
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4218
4220
|
}
|
|
4219
|
-
function
|
|
4221
|
+
function Uo(e, t) {
|
|
4220
4222
|
let i = !1;
|
|
4221
4223
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4222
4224
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
4223
4225
|
}
|
|
4224
|
-
const
|
|
4225
|
-
function
|
|
4226
|
+
const ls = (e, t) => t.liftedKeys.has(e);
|
|
4227
|
+
function H(e, t, i) {
|
|
4226
4228
|
if (fe(i))
|
|
4227
|
-
return
|
|
4228
|
-
const s = o.isCallExpression(i) ?
|
|
4229
|
+
return ds(e, i);
|
|
4230
|
+
const s = o.isCallExpression(i) ? Oo(e, i) : i, n = o.visitEachChild(
|
|
4229
4231
|
s,
|
|
4230
4232
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4231
|
-
|
|
4233
|
+
H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4232
4234
|
e.transformationContext
|
|
4233
4235
|
);
|
|
4234
|
-
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;
|
|
4235
4237
|
}
|
|
4236
|
-
function
|
|
4237
|
-
const i =
|
|
4238
|
+
function ds(e, t) {
|
|
4239
|
+
const i = ps(e, t);
|
|
4238
4240
|
return Oe(i, e);
|
|
4239
4241
|
}
|
|
4240
|
-
function
|
|
4242
|
+
function ps(e, t) {
|
|
4241
4243
|
const i = "children" in t ? t.children : [];
|
|
4242
4244
|
if (o.isJsxFragment(t))
|
|
4243
4245
|
return { key: void 0, ...Te(i, e) };
|
|
@@ -4245,17 +4247,17 @@ function us(e, t) {
|
|
|
4245
4247
|
if (o.isJsxNamespacedName(r))
|
|
4246
4248
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4247
4249
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== Ke) {
|
|
4248
|
-
const S = o.isIdentifier(r) && r.text ===
|
|
4250
|
+
const S = o.isIdentifier(r) && r.text === Qs ? Te(i, e) : {
|
|
4249
4251
|
// No need to wrap the function call in a lit-html tag
|
|
4250
4252
|
litTag: void 0,
|
|
4251
|
-
parts: [
|
|
4253
|
+
parts: [zo(e, t, r, i)]
|
|
4252
4254
|
};
|
|
4253
4255
|
return {
|
|
4254
|
-
key:
|
|
4256
|
+
key: Wo(n, e),
|
|
4255
4257
|
...S
|
|
4256
4258
|
};
|
|
4257
4259
|
}
|
|
4258
|
-
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);
|
|
4259
4261
|
let f;
|
|
4260
4262
|
const g = [];
|
|
4261
4263
|
let h = !1;
|
|
@@ -4268,13 +4270,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4268
4270
|
const { name: S, initializer: A } = x;
|
|
4269
4271
|
if (o.isJsxNamespacedName(S))
|
|
4270
4272
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
4271
|
-
const L = S.text, U =
|
|
4273
|
+
const L = S.text, U = Io(A), j = U?.propType ?? xo(L, A, c);
|
|
4272
4274
|
m?.delete(L);
|
|
4273
|
-
const N =
|
|
4275
|
+
const N = To[j](e, U?.initializer ?? A, L, c);
|
|
4274
4276
|
if (N.length === 0)
|
|
4275
4277
|
return [];
|
|
4276
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4277
|
-
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(
|
|
4278
4280
|
...B,
|
|
4279
4281
|
...N.flatMap(
|
|
4280
4282
|
(R, M) => typeof R == "string" || M === 0 || typeof N[M - 1] == "string" ? R : [" ", R]
|
|
@@ -4290,12 +4292,12 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4290
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`
|
|
4291
4293
|
);
|
|
4292
4294
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4293
|
-
const v = typeof c == "string" &&
|
|
4295
|
+
const v = typeof c == "string" && Zs.has(c), w = Te(i, e);
|
|
4294
4296
|
if (v && w.parts.length > 0)
|
|
4295
4297
|
throw Error(
|
|
4296
4298
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
4297
4299
|
);
|
|
4298
|
-
const C = (d === se || d ===
|
|
4300
|
+
const C = (d === se || d === X) && w.parts.length === 0, E = [
|
|
4299
4301
|
"<",
|
|
4300
4302
|
typeof c == "string" ? c : r,
|
|
4301
4303
|
...y,
|
|
@@ -4314,21 +4316,21 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4314
4316
|
];
|
|
4315
4317
|
return { key: f, parts: P, litTag: d };
|
|
4316
4318
|
}
|
|
4317
|
-
function
|
|
4318
|
-
const i = e.attributes.properties[
|
|
4319
|
-
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;
|
|
4320
4322
|
}
|
|
4321
|
-
const
|
|
4322
|
-
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) {
|
|
4323
4325
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4324
4326
|
if (o.isJsxSpreadAttribute(d))
|
|
4325
|
-
return
|
|
4327
|
+
return ns(rs(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4326
4328
|
const { name: l, initializer: p } = d;
|
|
4327
4329
|
if (o.isJsxNamespacedName(l))
|
|
4328
4330
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4329
4331
|
if (l.text === "key")
|
|
4330
4332
|
return;
|
|
4331
|
-
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;
|
|
4332
4334
|
return o.factory.createPropertyAssignment(f, m);
|
|
4333
4335
|
}), { parts: a, litTag: c } = Te(s, e);
|
|
4334
4336
|
return a.length > 0 && r.push(
|
|
@@ -4337,20 +4339,20 @@ function Vo(e, t, i, s) {
|
|
|
4337
4339
|
Oe({ key: void 0, parts: a, litTag: c }, e)
|
|
4338
4340
|
)
|
|
4339
4341
|
), o.factory.createCallExpression(i, void 0, [
|
|
4340
|
-
o.factory.createObjectLiteralExpression(r.filter(
|
|
4342
|
+
o.factory.createObjectLiteralExpression(r.filter(F))
|
|
4341
4343
|
]);
|
|
4342
4344
|
}
|
|
4343
4345
|
function Te(e, t) {
|
|
4344
4346
|
let i;
|
|
4345
4347
|
const s = e.flatMap((n) => {
|
|
4346
4348
|
if (o.isJsxText(n))
|
|
4347
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4349
|
+
return [t.compiler.shouldMinifyJsx ? ir(n.text) : n.text];
|
|
4348
4350
|
if (o.isJsxExpression(n))
|
|
4349
4351
|
return bt(t, n, n);
|
|
4350
4352
|
{
|
|
4351
|
-
const r =
|
|
4352
|
-
if (r.key === void 0 && r.litTag !== ae && r.litTag !==
|
|
4353
|
-
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)
|
|
4354
4356
|
return r.parts;
|
|
4355
4357
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
4356
4358
|
throw new Error(
|
|
@@ -4363,7 +4365,7 @@ function Te(e, t) {
|
|
|
4363
4365
|
});
|
|
4364
4366
|
return { litTag: i, parts: s };
|
|
4365
4367
|
}
|
|
4366
|
-
function
|
|
4368
|
+
function qo(e) {
|
|
4367
4369
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4368
4370
|
e,
|
|
4369
4371
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4375,9 +4377,9 @@ function bt(e, t, i) {
|
|
|
4375
4377
|
if (e.compiler.shouldMinifyJsx)
|
|
4376
4378
|
return [];
|
|
4377
4379
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4378
|
-
return vt(s).length === 0 ? [] : [
|
|
4380
|
+
return vt(s).length === 0 ? [] : [ns(s, o.factory.createIdentifier("undefined"))];
|
|
4379
4381
|
}
|
|
4380
|
-
return o.isStringLiteral(t.expression) ? [
|
|
4382
|
+
return o.isStringLiteral(t.expression) ? [hi(t.expression.text)] : (
|
|
4381
4383
|
/**
|
|
4382
4384
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
4383
4385
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4398,7 +4400,7 @@ function bt(e, t, i) {
|
|
|
4398
4400
|
* making this change useless.
|
|
4399
4401
|
*/
|
|
4400
4402
|
e.compiler.viteCommand === "serve" && e.compiler.viteConfig.build.sourcemap !== !1 && !e.compiler.shouldMinifyJsx && o.isArrowFunction(t.expression) && !o.isBlock(t.expression.body) ? [
|
|
4401
|
-
|
|
4403
|
+
H(
|
|
4402
4404
|
e,
|
|
4403
4405
|
i,
|
|
4404
4406
|
o.factory.updateArrowFunction(
|
|
@@ -4411,20 +4413,20 @@ function bt(e, t, i) {
|
|
|
4411
4413
|
o.factory.createBlock([o.factory.createReturnStatement(t.expression.body)], !0)
|
|
4412
4414
|
)
|
|
4413
4415
|
)
|
|
4414
|
-
] : [
|
|
4416
|
+
] : [H(e, i, t.expression)]
|
|
4415
4417
|
);
|
|
4416
4418
|
}
|
|
4417
|
-
const
|
|
4419
|
+
const ms = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), fs = ms(
|
|
4418
4420
|
Object.entries(re).flatMap(
|
|
4419
4421
|
([e, t]) => t.map((i) => [i, e])
|
|
4420
4422
|
)
|
|
4421
|
-
),
|
|
4422
|
-
function
|
|
4423
|
+
), gs = new Set(Object.keys(fs));
|
|
4424
|
+
function Ho(e, t) {
|
|
4423
4425
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4424
4426
|
if (!o.isStringLiteral(n))
|
|
4425
4427
|
return t;
|
|
4426
|
-
const r =
|
|
4427
|
-
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
|
|
4428
4430
|
!n.text.includes("?")) {
|
|
4429
4431
|
if (s) {
|
|
4430
4432
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4444,7 +4446,7 @@ function Xo(e, t) {
|
|
|
4444
4446
|
// runs for .tsx files, so .css imports in .ts files won't work. However,
|
|
4445
4447
|
// that is unlikely for web component libraries. A workaround is to
|
|
4446
4448
|
// rename the file or explicitly add (undocumented) ?litCss flag
|
|
4447
|
-
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ?
|
|
4449
|
+
o.factory.createStringLiteral(n.text + (e.isInLightDomComponent ? Y : Ie)),
|
|
4448
4450
|
t.attributes
|
|
4449
4451
|
);
|
|
4450
4452
|
}
|
|
@@ -4457,22 +4459,22 @@ function Xo(e, t) {
|
|
|
4457
4459
|
const c = i.namedBindings;
|
|
4458
4460
|
if (c === void 0 || !o.isNamedImports(c))
|
|
4459
4461
|
return t;
|
|
4460
|
-
const d =
|
|
4462
|
+
const d = gs.has(n.text);
|
|
4461
4463
|
if (c.elements.forEach((l) => {
|
|
4462
4464
|
const p = (l.propertyName ?? l.name).text, m = re[p];
|
|
4463
4465
|
if (d) {
|
|
4464
4466
|
if (m?.some((h) => h === n.text)) {
|
|
4465
|
-
const h =
|
|
4467
|
+
const h = hs(p, r);
|
|
4466
4468
|
e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
|
|
4467
4469
|
}
|
|
4468
|
-
} 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);
|
|
4469
4471
|
const f = p.startsWith(p[0].toUpperCase()), g = u.isAbsolute(r);
|
|
4470
4472
|
a && !l.isTypeOnly && f && g && e.importedFunctionComponentsFromModules.add(r);
|
|
4471
4473
|
}), n.text === "@arcgis/lumina") {
|
|
4472
4474
|
let l = !1;
|
|
4473
4475
|
const p = c.elements.filter((f) => {
|
|
4474
4476
|
const g = (f.propertyName ?? f.name).text;
|
|
4475
|
-
return
|
|
4477
|
+
return gr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4476
4478
|
});
|
|
4477
4479
|
if (p.length === 0)
|
|
4478
4480
|
return;
|
|
@@ -4501,22 +4503,22 @@ function Xo(e, t) {
|
|
|
4501
4503
|
}
|
|
4502
4504
|
return t;
|
|
4503
4505
|
}
|
|
4504
|
-
const
|
|
4505
|
-
function
|
|
4506
|
-
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;
|
|
4507
4509
|
}
|
|
4508
|
-
function
|
|
4510
|
+
function Xo(e, t) {
|
|
4509
4511
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4510
|
-
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !
|
|
4512
|
+
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !gs.has(n.text))
|
|
4511
4513
|
return t;
|
|
4512
4514
|
const r = i.phaseModifier === o.SyntaxKind.TypeKeyword;
|
|
4513
4515
|
let a = !1;
|
|
4514
4516
|
const c = s.elements.map((d) => {
|
|
4515
|
-
const l = (d.propertyName ?? d.name).text, p =
|
|
4517
|
+
const l = (d.propertyName ?? d.name).text, p = hs(l, n.text);
|
|
4516
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;
|
|
4517
4519
|
});
|
|
4518
|
-
return
|
|
4519
|
-
!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)));
|
|
4520
4522
|
}), a ? o.factory.updateImportDeclaration(
|
|
4521
4523
|
t,
|
|
4522
4524
|
t.modifiers,
|
|
@@ -4530,8 +4532,8 @@ function Zo(e, t) {
|
|
|
4530
4532
|
t.attributes
|
|
4531
4533
|
) : t;
|
|
4532
4534
|
}
|
|
4533
|
-
function
|
|
4534
|
-
const t =
|
|
4535
|
+
function Yo(e) {
|
|
4536
|
+
const t = ms(
|
|
4535
4537
|
Array.from(e.neededImports, (i) => [re[i][0], i])
|
|
4536
4538
|
);
|
|
4537
4539
|
return Object.entries(t).map(
|
|
@@ -4541,27 +4543,27 @@ function ea(e) {
|
|
|
4541
4543
|
void 0,
|
|
4542
4544
|
void 0,
|
|
4543
4545
|
o.factory.createNamedImports(
|
|
4544
|
-
s.map((n) => (e.neededImports.delete(n),
|
|
4546
|
+
s.map((n) => (e.neededImports.delete(n), ys(n, e)))
|
|
4545
4547
|
)
|
|
4546
4548
|
),
|
|
4547
4549
|
o.factory.createStringLiteral(i)
|
|
4548
4550
|
)
|
|
4549
4551
|
);
|
|
4550
4552
|
}
|
|
4551
|
-
function
|
|
4552
|
-
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];
|
|
4553
4555
|
return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4554
4556
|
!1,
|
|
4555
4557
|
o.factory.createIdentifier(i),
|
|
4556
4558
|
o.factory.createIdentifier(s)
|
|
4557
4559
|
);
|
|
4558
4560
|
}
|
|
4559
|
-
function
|
|
4560
|
-
const t =
|
|
4561
|
+
function Qo(e) {
|
|
4562
|
+
const t = Or().map(({ packageName: i }) => i);
|
|
4561
4563
|
return e.existingImportedModules.forEach((i) => {
|
|
4562
4564
|
if (u.isAbsolute(i))
|
|
4563
4565
|
return;
|
|
4564
|
-
const s =
|
|
4566
|
+
const s = Xs(i), n = i.slice(s.length + 1);
|
|
4565
4567
|
if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
|
|
4566
4568
|
const r = De(e.sourceFile.fileName);
|
|
4567
4569
|
throw new Error(
|
|
@@ -4570,7 +4572,7 @@ function ta(e) {
|
|
|
4570
4572
|
}
|
|
4571
4573
|
}), [];
|
|
4572
4574
|
}
|
|
4573
|
-
function
|
|
4575
|
+
function Zo(e) {
|
|
4574
4576
|
if (e.compiler.viteCommand === "serve")
|
|
4575
4577
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4576
4578
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4585,7 +4587,7 @@ function ia(e) {
|
|
|
4585
4587
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4586
4588
|
}), [];
|
|
4587
4589
|
}
|
|
4588
|
-
const
|
|
4590
|
+
const ea = (e, t) => {
|
|
4589
4591
|
const i = e.pragmas;
|
|
4590
4592
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4591
4593
|
return e.statements;
|
|
@@ -4605,11 +4607,11 @@ const sa = (e, t) => {
|
|
|
4605
4607
|
}
|
|
4606
4608
|
const r = {
|
|
4607
4609
|
compiler: t.compiler,
|
|
4608
|
-
externalComponents:
|
|
4609
|
-
localComponents:
|
|
4610
|
+
externalComponents: Ii(),
|
|
4611
|
+
localComponents: is(t.compiler),
|
|
4610
4612
|
sourceFile: e,
|
|
4611
4613
|
transformationContext: t.transformation,
|
|
4612
|
-
importRenames:
|
|
4614
|
+
importRenames: ta(e),
|
|
4613
4615
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4614
4616
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4615
4617
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4623,21 +4625,21 @@ const sa = (e, t) => {
|
|
|
4623
4625
|
let a = [];
|
|
4624
4626
|
if (e.statements.every((d) => {
|
|
4625
4627
|
if (o.isImportDeclaration(d)) {
|
|
4626
|
-
const l =
|
|
4628
|
+
const l = Ho(r, d);
|
|
4627
4629
|
if (l === void 0)
|
|
4628
4630
|
return !0;
|
|
4629
4631
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
4630
4632
|
return !1;
|
|
4631
4633
|
} else
|
|
4632
|
-
a.push(
|
|
4634
|
+
a.push(H(r, void 0, d));
|
|
4633
4635
|
return !0;
|
|
4634
4636
|
}), r.hasNonLuminaJsxImport)
|
|
4635
4637
|
return e.statements;
|
|
4636
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4638
|
+
if (r.neededImports.size > 0 && (a = a.map(Go, r), r.existingLitImports.size > 0))
|
|
4637
4639
|
throw new Error(
|
|
4638
4640
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4639
4641
|
);
|
|
4640
|
-
const c = [
|
|
4642
|
+
const c = [Yo, Qo, Zo].flatMap(
|
|
4641
4643
|
(d) => d(r)
|
|
4642
4644
|
);
|
|
4643
4645
|
if (r.neededImports.size > 0)
|
|
@@ -4646,18 +4648,18 @@ const sa = (e, t) => {
|
|
|
4646
4648
|
);
|
|
4647
4649
|
return [...c, ...a];
|
|
4648
4650
|
};
|
|
4649
|
-
function
|
|
4650
|
-
return
|
|
4651
|
-
|
|
4651
|
+
function ta(e) {
|
|
4652
|
+
return ia(e), Object.fromEntries(
|
|
4653
|
+
mr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4652
4654
|
);
|
|
4653
4655
|
}
|
|
4654
|
-
function
|
|
4656
|
+
function ia(e) {
|
|
4655
4657
|
if (!("identifiers" in e))
|
|
4656
4658
|
throw new Error(
|
|
4657
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."
|
|
4658
4660
|
);
|
|
4659
4661
|
}
|
|
4660
|
-
const Zt = "customElement",
|
|
4662
|
+
const Zt = "customElement", sa = (e, t) => {
|
|
4661
4663
|
const i = [];
|
|
4662
4664
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4663
4665
|
const a = r;
|
|
@@ -4687,7 +4689,7 @@ const Zt = "customElement", oa = (e, t) => {
|
|
|
4687
4689
|
o.factory.createStringLiteral(s)
|
|
4688
4690
|
), ...e.statements, ...i];
|
|
4689
4691
|
};
|
|
4690
|
-
function
|
|
4692
|
+
function ra(e, t, i) {
|
|
4691
4693
|
return t.size === 0 ? e : [
|
|
4692
4694
|
o.factory.createPropertyDeclaration(
|
|
4693
4695
|
[
|
|
@@ -4701,8 +4703,8 @@ function aa(e, t, i) {
|
|
|
4701
4703
|
Array.from(
|
|
4702
4704
|
t.entries(),
|
|
4703
4705
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4704
|
-
|
|
4705
|
-
|
|
4706
|
+
li(s) ? o.factory.createStringLiteral(s) : s,
|
|
4707
|
+
na(n, i)
|
|
4706
4708
|
)
|
|
4707
4709
|
)
|
|
4708
4710
|
)
|
|
@@ -4710,7 +4712,7 @@ function aa(e, t, i) {
|
|
|
4710
4712
|
...e
|
|
4711
4713
|
];
|
|
4712
4714
|
}
|
|
4713
|
-
function
|
|
4715
|
+
function na(e, t) {
|
|
4714
4716
|
let i = 0, s = !0;
|
|
4715
4717
|
const n = [], r = [];
|
|
4716
4718
|
for (const d of e.properties)
|
|
@@ -4722,21 +4724,21 @@ function ca(e, t) {
|
|
|
4722
4724
|
if (l === "attribute")
|
|
4723
4725
|
return s = !1, i |= m ? Tt : 0, !m && !f;
|
|
4724
4726
|
if (l === "reflect")
|
|
4725
|
-
return i |= m ?
|
|
4727
|
+
return i |= m ? Ps : 0, !1;
|
|
4726
4728
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4727
4729
|
if (p.text === "Boolean")
|
|
4728
|
-
return i |=
|
|
4730
|
+
return i |= ks, !1;
|
|
4729
4731
|
if (p.text === "Number")
|
|
4730
|
-
return i |=
|
|
4732
|
+
return i |= Is, !1;
|
|
4731
4733
|
} else {
|
|
4732
4734
|
if (l === "state")
|
|
4733
|
-
return s = !1, i |= m ?
|
|
4735
|
+
return s = !1, i |= m ? xs : 0, !1;
|
|
4734
4736
|
if (l === "readOnly")
|
|
4735
|
-
return i |= m ?
|
|
4737
|
+
return i |= m ? As : 0, !1;
|
|
4736
4738
|
if (l === "noAccessor")
|
|
4737
|
-
return i |= m ?
|
|
4739
|
+
return i |= m ? Ls : 0, !1;
|
|
4738
4740
|
if (l === "useDefault")
|
|
4739
|
-
return i |= m ?
|
|
4741
|
+
return i |= m ? Ns : 0, !1;
|
|
4740
4742
|
}
|
|
4741
4743
|
return !0;
|
|
4742
4744
|
}
|
|
@@ -4755,7 +4757,7 @@ function ca(e, t) {
|
|
|
4755
4757
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4756
4758
|
]);
|
|
4757
4759
|
}
|
|
4758
|
-
function
|
|
4760
|
+
function oa(e, t, i) {
|
|
4759
4761
|
let s = -1, n = -1, r = -1;
|
|
4760
4762
|
e.options?.properties.forEach((p, m) => {
|
|
4761
4763
|
if (o.isSpreadAssignment(p))
|
|
@@ -4767,23 +4769,23 @@ function la(e, t, i) {
|
|
|
4767
4769
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4768
4770
|
}
|
|
4769
4771
|
});
|
|
4770
|
-
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 = [
|
|
4771
4773
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4772
4774
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4773
4775
|
...d !== void 0 ? [d] : []
|
|
4774
4776
|
];
|
|
4775
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;
|
|
4776
4778
|
}
|
|
4777
|
-
function
|
|
4779
|
+
function aa(e, t, i) {
|
|
4778
4780
|
if (t.attribute === void 0)
|
|
4779
4781
|
return;
|
|
4780
|
-
const s =
|
|
4782
|
+
const s = ca(t.type.values);
|
|
4781
4783
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4782
4784
|
o.factory.createIdentifier("type"),
|
|
4783
4785
|
o.factory.createIdentifier(s)
|
|
4784
4786
|
);
|
|
4785
4787
|
}
|
|
4786
|
-
function
|
|
4788
|
+
function ca(e) {
|
|
4787
4789
|
let t = !1, i = !1, s = !1;
|
|
4788
4790
|
if (e?.forEach((n) => {
|
|
4789
4791
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4795,7 +4797,7 @@ function pa(e) {
|
|
|
4795
4797
|
}
|
|
4796
4798
|
return "Other";
|
|
4797
4799
|
}
|
|
4798
|
-
function
|
|
4800
|
+
function la(e, t, i, s, n, r) {
|
|
4799
4801
|
if (i.modifiers === void 0)
|
|
4800
4802
|
return i;
|
|
4801
4803
|
let a = -1, c = -1;
|
|
@@ -4805,23 +4807,23 @@ function ua(e, t, i, s, n, r) {
|
|
|
4805
4807
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4806
4808
|
}
|
|
4807
4809
|
}), a !== -1) {
|
|
4808
|
-
const d =
|
|
4810
|
+
const d = da(e, t, i, s, n), l = ei(i, a, n), p = oa(l, n, d);
|
|
4809
4811
|
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, ti(i, a);
|
|
4810
4812
|
} else if (c !== -1) {
|
|
4811
|
-
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);
|
|
4812
4814
|
if (m === void 0)
|
|
4813
4815
|
throw new Error("Failed to statically determine the state property name");
|
|
4814
4816
|
return r.set(m, p), ti(i, c);
|
|
4815
4817
|
} else
|
|
4816
4818
|
return i;
|
|
4817
4819
|
}
|
|
4818
|
-
function
|
|
4820
|
+
function da(e, t, i, s, n) {
|
|
4819
4821
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4820
4822
|
members: []
|
|
4821
4823
|
} : void 0);
|
|
4822
4824
|
if (r === void 0)
|
|
4823
4825
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4824
|
-
const a =
|
|
4826
|
+
const a = di(i.name);
|
|
4825
4827
|
let c;
|
|
4826
4828
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4827
4829
|
const l = r.members[d];
|
|
@@ -4836,7 +4838,7 @@ function ma(e, t, i, s, n) {
|
|
|
4836
4838
|
throw Error(
|
|
4837
4839
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4838
4840
|
);
|
|
4839
|
-
c.name = a, c.attribute ??=
|
|
4841
|
+
c.name = a, c.attribute ??= ri(a);
|
|
4840
4842
|
}
|
|
4841
4843
|
return c;
|
|
4842
4844
|
}
|
|
@@ -4875,7 +4877,7 @@ function ti(e, t) {
|
|
|
4875
4877
|
e.initializer
|
|
4876
4878
|
);
|
|
4877
4879
|
}
|
|
4878
|
-
function
|
|
4880
|
+
function pa(e, t, i, s) {
|
|
4879
4881
|
let n;
|
|
4880
4882
|
if (e.apiJsonEnabled)
|
|
4881
4883
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4898,9 +4900,9 @@ function fa(e, t, i, s) {
|
|
|
4898
4900
|
} finally {
|
|
4899
4901
|
c = i.statements, i.statements = a;
|
|
4900
4902
|
}
|
|
4901
|
-
return
|
|
4903
|
+
return ua(i, c);
|
|
4902
4904
|
}
|
|
4903
|
-
const
|
|
4905
|
+
const ua = (e, t) => o.factory.updateSourceFile(
|
|
4904
4906
|
e,
|
|
4905
4907
|
t,
|
|
4906
4908
|
/*
|
|
@@ -4915,10 +4917,10 @@ const ga = (e, t) => o.factory.updateSourceFile(
|
|
|
4915
4917
|
!1,
|
|
4916
4918
|
e.libReferenceDirectives
|
|
4917
4919
|
);
|
|
4918
|
-
function
|
|
4920
|
+
function ma(e, t) {
|
|
4919
4921
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4920
4922
|
}
|
|
4921
|
-
const
|
|
4923
|
+
const fa = (e, t) => {
|
|
4922
4924
|
let i;
|
|
4923
4925
|
if (t.apiModule !== void 0)
|
|
4924
4926
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4934,16 +4936,16 @@ const ya = (e, t) => {
|
|
|
4934
4936
|
function n() {
|
|
4935
4937
|
s = /* @__PURE__ */ new Map();
|
|
4936
4938
|
}
|
|
4937
|
-
const r = (d) =>
|
|
4939
|
+
const r = (d) => ra(d, s, t.compiler.shouldMinify);
|
|
4938
4940
|
function a(d, l) {
|
|
4939
|
-
const p =
|
|
4940
|
-
return
|
|
4941
|
+
const p = ha(t, i, d, l, e, s);
|
|
4942
|
+
return ma(p, t), p;
|
|
4941
4943
|
}
|
|
4942
4944
|
return e.statements.map(
|
|
4943
|
-
(d) =>
|
|
4945
|
+
(d) => vs(a, d, t, n, r)
|
|
4944
4946
|
);
|
|
4945
4947
|
};
|
|
4946
|
-
function
|
|
4948
|
+
function vs(e, t, i, s, n = pi) {
|
|
4947
4949
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4948
4950
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4949
4951
|
let r = !1;
|
|
@@ -4966,15 +4968,15 @@ function bs(e, t, i, s, n = ui) {
|
|
|
4966
4968
|
} else
|
|
4967
4969
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4968
4970
|
t,
|
|
4969
|
-
(a) =>
|
|
4971
|
+
(a) => vs(e, a, i, s, n),
|
|
4970
4972
|
i.transformation
|
|
4971
4973
|
) : t;
|
|
4972
4974
|
}
|
|
4973
|
-
const
|
|
4974
|
-
function
|
|
4975
|
+
const ga = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4976
|
+
function ha(e, t, i, s, n, r) {
|
|
4975
4977
|
if (o.isMethodDeclaration(i)) {
|
|
4976
4978
|
const a = i.modifiers?.filter(
|
|
4977
|
-
(c) => !o.isDecorator(c) || !
|
|
4979
|
+
(c) => !o.isDecorator(c) || !ya(c)
|
|
4978
4980
|
);
|
|
4979
4981
|
if (a?.length !== i.modifiers?.length)
|
|
4980
4982
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4988,7 +4990,7 @@ function ba(e, t, i, s, n, r) {
|
|
|
4988
4990
|
i.type,
|
|
4989
4991
|
i.body
|
|
4990
4992
|
);
|
|
4991
|
-
if ("text" in i.name &&
|
|
4993
|
+
if ("text" in i.name && ga.has(i.name.text) && i.body) {
|
|
4992
4994
|
const c = i.name.text;
|
|
4993
4995
|
return i.body.statements.some(
|
|
4994
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
|
|
@@ -5014,14 +5016,14 @@ function ba(e, t, i, s, n, r) {
|
|
|
5014
5016
|
);
|
|
5015
5017
|
}
|
|
5016
5018
|
}
|
|
5017
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5019
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? la(e, t, i, s, n, r) : i;
|
|
5018
5020
|
}
|
|
5019
|
-
const
|
|
5021
|
+
const ya = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", va = [
|
|
5022
|
+
ea,
|
|
5020
5023
|
sa,
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
name: Ca,
|
|
5024
|
+
fa
|
|
5025
|
+
], ba = "@arcgis/lumina:transformComponents", wa = (e) => ({
|
|
5026
|
+
name: ba,
|
|
5025
5027
|
transform: {
|
|
5026
5028
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5027
5029
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5041,11 +5043,11 @@ const wa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5041
5043
|
e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
|
|
5042
5044
|
);
|
|
5043
5045
|
const n = e.getSourceFile(i, t), a = o.transform(n, [
|
|
5044
|
-
(f) => () =>
|
|
5046
|
+
(f) => () => pa(e, f, n, [
|
|
5045
5047
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5046
|
-
...
|
|
5048
|
+
...va
|
|
5047
5049
|
])
|
|
5048
|
-
]).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(`
|
|
5049
5051
|
`);
|
|
5050
5052
|
c.writeFile(a, l, d);
|
|
5051
5053
|
const p = l.getText(), m = d?.toJSON();
|
|
@@ -5055,18 +5057,18 @@ const wa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5055
5057
|
};
|
|
5056
5058
|
}
|
|
5057
5059
|
}
|
|
5058
|
-
}),
|
|
5060
|
+
}), Sa = {
|
|
5059
5061
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5060
|
-
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ?
|
|
5061
|
-
},
|
|
5062
|
+
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? pi : (e) => e.toLowerCase()
|
|
5063
|
+
}, Ca = (e) => ({
|
|
5062
5064
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5063
5065
|
configureServer(t) {
|
|
5064
|
-
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));
|
|
5065
5067
|
},
|
|
5066
5068
|
async writeBundle() {
|
|
5067
5069
|
await Promise.all(
|
|
5068
5070
|
ii(e).map(
|
|
5069
|
-
async ({ assets: t, transformers: i }) => await
|
|
5071
|
+
async ({ assets: t, transformers: i }) => await Fi(e, t, i)
|
|
5070
5072
|
)
|
|
5071
5073
|
);
|
|
5072
5074
|
}
|
|
@@ -5077,20 +5079,20 @@ function ii(e) {
|
|
|
5077
5079
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5078
5080
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5079
5081
|
}
|
|
5080
|
-
const ot = "@arcgis/lumina:updatePackageJson",
|
|
5082
|
+
const ot = "@arcgis/lumina:updatePackageJson", Ea = (e) => ({
|
|
5081
5083
|
name: ot,
|
|
5082
5084
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5083
5085
|
configResolved() {
|
|
5084
|
-
|
|
5086
|
+
Ta(e).catch(
|
|
5085
5087
|
(t) => T.error(ot, `Failed to update package's package.json:${String(t)}`)
|
|
5086
5088
|
);
|
|
5087
5089
|
}
|
|
5088
5090
|
});
|
|
5089
|
-
async function
|
|
5090
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await
|
|
5091
|
-
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));
|
|
5092
5094
|
}
|
|
5093
|
-
function
|
|
5095
|
+
function $a(e, t) {
|
|
5094
5096
|
const i = e?.devDependencies ?? {};
|
|
5095
5097
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
5096
5098
|
l in i || T.warn(
|
|
@@ -5116,7 +5118,7 @@ function Ia(e, t) {
|
|
|
5116
5118
|
const l = n(r.webTypes);
|
|
5117
5119
|
e["web-types"] !== l && (s = !0, e["web-types"] = l);
|
|
5118
5120
|
}
|
|
5119
|
-
const a = `./${
|
|
5121
|
+
const a = `./${Q}.css`, c = t.options.build?.cdn?.namespace !== void 0, d = he(
|
|
5120
5122
|
t.dir.root,
|
|
5121
5123
|
u.join(t.dir.distCdn, a)
|
|
5122
5124
|
);
|
|
@@ -5129,21 +5131,21 @@ function Ia(e, t) {
|
|
|
5129
5131
|
if (s)
|
|
5130
5132
|
return e;
|
|
5131
5133
|
}
|
|
5132
|
-
const
|
|
5134
|
+
const Pa = (e) => ({
|
|
5133
5135
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5134
5136
|
timestamp: e.apiJson.timestamp,
|
|
5135
5137
|
compiler: e.apiJson.compiler,
|
|
5136
|
-
components:
|
|
5138
|
+
components: ka(e),
|
|
5137
5139
|
typeLibrary: {}
|
|
5138
5140
|
});
|
|
5139
|
-
function
|
|
5141
|
+
function ka(e) {
|
|
5140
5142
|
const t = [];
|
|
5141
5143
|
for (const i of e.apiJson.modules)
|
|
5142
5144
|
for (const s of i.declarations)
|
|
5143
|
-
s.customElement === !0 && t.push(
|
|
5145
|
+
s.customElement === !0 && t.push(Ia(s, i.sourcePath));
|
|
5144
5146
|
return t;
|
|
5145
5147
|
}
|
|
5146
|
-
function
|
|
5148
|
+
function Ia(e, t) {
|
|
5147
5149
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5148
5150
|
return {
|
|
5149
5151
|
filePath: t,
|
|
@@ -5158,9 +5160,9 @@ function La(e, t) {
|
|
|
5158
5160
|
dependencies: [],
|
|
5159
5161
|
dependencyGraph: {},
|
|
5160
5162
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5161
|
-
props: e.members.map(
|
|
5162
|
-
methods: e.members.map(
|
|
5163
|
-
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) ?? [],
|
|
5164
5166
|
styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
|
|
5165
5167
|
name: s,
|
|
5166
5168
|
annotation: "prop",
|
|
@@ -5185,7 +5187,7 @@ function Ve(e, t = "") {
|
|
|
5185
5187
|
}
|
|
5186
5188
|
return t;
|
|
5187
5189
|
}
|
|
5188
|
-
function
|
|
5190
|
+
function xa(e) {
|
|
5189
5191
|
if (e.kind !== "field")
|
|
5190
5192
|
return;
|
|
5191
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;
|
|
@@ -5219,14 +5221,14 @@ const wt = (e) => Object.fromEntries(
|
|
|
5219
5221
|
(t) => [
|
|
5220
5222
|
t.name,
|
|
5221
5223
|
{
|
|
5222
|
-
location: t.package ===
|
|
5224
|
+
location: t.package === Fs ? "global" : t.package === void 0 ? "local" : "import",
|
|
5223
5225
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
5224
5226
|
id: "notImplemented"
|
|
5225
5227
|
}
|
|
5226
5228
|
]
|
|
5227
5229
|
) ?? []
|
|
5228
5230
|
);
|
|
5229
|
-
function
|
|
5231
|
+
function Aa(e) {
|
|
5230
5232
|
if (e.kind !== "method")
|
|
5231
5233
|
return;
|
|
5232
5234
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5257,7 +5259,7 @@ function ja(e) {
|
|
|
5257
5259
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5258
5260
|
};
|
|
5259
5261
|
}
|
|
5260
|
-
function
|
|
5262
|
+
function La(e) {
|
|
5261
5263
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5262
5264
|
return {
|
|
5263
5265
|
event: e.name,
|
|
@@ -5282,8 +5284,8 @@ const ye = {
|
|
|
5282
5284
|
cssParts: "CSS Parts",
|
|
5283
5285
|
methods: "Methods"
|
|
5284
5286
|
};
|
|
5285
|
-
function
|
|
5286
|
-
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();
|
|
5287
5289
|
return [...a ? [`${a}
|
|
5288
5290
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5289
5291
|
|
|
@@ -5291,28 +5293,28 @@ function ws(e) {
|
|
|
5291
5293
|
}
|
|
5292
5294
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5293
5295
|
${t.join(`
|
|
5294
|
-
`)}`,
|
|
5296
|
+
`)}`, Na = (e) => ve(
|
|
5295
5297
|
ye.slots,
|
|
5296
5298
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5297
5299
|
(t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
|
|
5298
5300
|
)
|
|
5299
|
-
),
|
|
5301
|
+
), ja = (e) => ve(
|
|
5300
5302
|
ye.events,
|
|
5301
5303
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5302
|
-
),
|
|
5304
|
+
), Fa = (e = []) => ve(
|
|
5303
5305
|
ye.cssProperties,
|
|
5304
5306
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5305
5307
|
(t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5306
5308
|
)
|
|
5307
|
-
),
|
|
5309
|
+
), Da = (e) => ve(
|
|
5308
5310
|
ye.cssParts,
|
|
5309
5311
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5310
|
-
),
|
|
5312
|
+
), Ra = (e) => ve(
|
|
5311
5313
|
ye.methods,
|
|
5312
|
-
e.filter(
|
|
5314
|
+
e.filter(Ds).filter((t) => t.deprecated === void 0).map(
|
|
5313
5315
|
(t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
|
|
5314
5316
|
)
|
|
5315
|
-
),
|
|
5317
|
+
), ws = (e) => {
|
|
5316
5318
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
5317
5319
|
for (let s = 0; s < e.length; ++s) {
|
|
5318
5320
|
const n = e[s].cssProperties;
|
|
@@ -5326,13 +5328,13 @@ ${t.join(`
|
|
|
5326
5328
|
}
|
|
5327
5329
|
}
|
|
5328
5330
|
return t;
|
|
5329
|
-
},
|
|
5331
|
+
}, Ss = (e) => e.flatMap(
|
|
5330
5332
|
(t) => t.cssParts?.filter((i) => i.deprecated === void 0).map((i) => ({
|
|
5331
5333
|
name: `::part(${i.name})`,
|
|
5332
5334
|
description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
|
|
5333
5335
|
})) ?? []
|
|
5334
5336
|
);
|
|
5335
|
-
function
|
|
5337
|
+
function Oa(e) {
|
|
5336
5338
|
if (e.attributes === void 0)
|
|
5337
5339
|
return [];
|
|
5338
5340
|
const t = [];
|
|
@@ -5343,7 +5345,7 @@ function Ba(e) {
|
|
|
5343
5345
|
description: s.description || void 0,
|
|
5344
5346
|
default: s.default,
|
|
5345
5347
|
value: {
|
|
5346
|
-
type:
|
|
5348
|
+
type: Ma(
|
|
5347
5349
|
s.type.values?.map(
|
|
5348
5350
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5349
5351
|
)
|
|
@@ -5353,9 +5355,9 @@ function Ba(e) {
|
|
|
5353
5355
|
}
|
|
5354
5356
|
return t;
|
|
5355
5357
|
}
|
|
5356
|
-
const
|
|
5357
|
-
function
|
|
5358
|
-
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();
|
|
5359
5361
|
return {
|
|
5360
5362
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5361
5363
|
name: r.name,
|
|
@@ -5373,11 +5375,11 @@ function _a(e, t) {
|
|
|
5373
5375
|
}
|
|
5374
5376
|
};
|
|
5375
5377
|
}
|
|
5376
|
-
const
|
|
5378
|
+
const Ba = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5377
5379
|
name: t.tagName,
|
|
5378
|
-
description:
|
|
5380
|
+
description: bs(t),
|
|
5379
5381
|
"doc-url": t.demos?.[0]?.url,
|
|
5380
|
-
attributes:
|
|
5382
|
+
attributes: Oa(t),
|
|
5381
5383
|
slots: t.slots?.map((i) => ({
|
|
5382
5384
|
name: i.name,
|
|
5383
5385
|
description: i.description
|
|
@@ -5385,10 +5387,10 @@ const Wa = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5385
5387
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5386
5388
|
events: si(t),
|
|
5387
5389
|
js: {
|
|
5388
|
-
properties:
|
|
5390
|
+
properties: Ka(t),
|
|
5389
5391
|
events: si(t)
|
|
5390
5392
|
}
|
|
5391
|
-
})),
|
|
5393
|
+
})), Ka = (e) => e.members.filter(Rs).filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5392
5394
|
name: t.name,
|
|
5393
5395
|
description: t.description,
|
|
5394
5396
|
type: t.type?.text
|
|
@@ -5396,143 +5398,93 @@ const Wa = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
|
5396
5398
|
name: t.name,
|
|
5397
5399
|
type: t.type?.text,
|
|
5398
5400
|
description: t.description
|
|
5399
|
-
})) ?? [],
|
|
5401
|
+
})) ?? [], _a = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5400
5402
|
name: t.tagName,
|
|
5401
|
-
description:
|
|
5402
|
-
attributes:
|
|
5403
|
+
description: bs(t),
|
|
5404
|
+
attributes: Ua(t),
|
|
5403
5405
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5404
|
-
})),
|
|
5406
|
+
})), Ua = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5405
5407
|
name: t.name,
|
|
5406
5408
|
description: t.description || void 0,
|
|
5407
|
-
values:
|
|
5408
|
-
})) ?? [],
|
|
5409
|
+
values: Wa(t)
|
|
5410
|
+
})) ?? [], Wa = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], za = (e) => ({
|
|
5409
5411
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5410
5412
|
version: 1.1,
|
|
5411
|
-
tags:
|
|
5412
|
-
}),
|
|
5413
|
+
tags: _a(e)
|
|
5414
|
+
}), qa = (e) => ({
|
|
5413
5415
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5414
5416
|
version: 1.1,
|
|
5415
|
-
properties:
|
|
5416
|
-
pseudoElements:
|
|
5417
|
-
}),
|
|
5418
|
-
function
|
|
5417
|
+
properties: ws(e),
|
|
5418
|
+
pseudoElements: Ss(e)
|
|
5419
|
+
}), Ha = "@arcgis/lumina:generateDocs";
|
|
5420
|
+
function Va(e) {
|
|
5419
5421
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5420
5422
|
{
|
|
5421
5423
|
type: "dynamic",
|
|
5422
|
-
source: () => JSON.stringify(
|
|
5424
|
+
source: () => JSON.stringify(Pa(e), null, nt(e)),
|
|
5423
5425
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5424
5426
|
}
|
|
5425
5427
|
]), {
|
|
5426
|
-
name:
|
|
5428
|
+
name: Ha,
|
|
5427
5429
|
async writeBundle() {
|
|
5428
5430
|
if (e.isInStorybook)
|
|
5429
5431
|
return;
|
|
5430
|
-
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);
|
|
5431
5433
|
if (c.length === 0)
|
|
5432
5434
|
return;
|
|
5433
|
-
await
|
|
5435
|
+
await Ji(c);
|
|
5434
5436
|
const d = [];
|
|
5435
5437
|
if (n !== void 0) {
|
|
5436
|
-
const l = JSON.stringify(
|
|
5437
|
-
d.push(
|
|
5438
|
+
const l = JSON.stringify(za(e.apiJsonComponents), null, t);
|
|
5439
|
+
d.push(z(n, l));
|
|
5438
5440
|
}
|
|
5439
5441
|
if (r !== void 0) {
|
|
5440
|
-
const l = JSON.stringify(
|
|
5441
|
-
d.push(
|
|
5442
|
+
const l = JSON.stringify(qa(e.apiJsonComponents), null, t);
|
|
5443
|
+
d.push(z(r, l));
|
|
5442
5444
|
}
|
|
5443
5445
|
if (a !== void 0) {
|
|
5444
|
-
const l =
|
|
5445
|
-
d.push(
|
|
5446
|
+
const l = Ja(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5447
|
+
d.push(z(a, JSON.stringify(l, null, t)));
|
|
5446
5448
|
}
|
|
5447
5449
|
await Promise.all(d);
|
|
5448
5450
|
}
|
|
5449
5451
|
};
|
|
5450
5452
|
}
|
|
5451
|
-
function
|
|
5452
|
-
return {
|
|
5453
|
-
name: "@arcgis/lumina:buildWrappers",
|
|
5454
|
-
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5455
|
-
async writeBundle() {
|
|
5456
|
-
e.isInStorybook || await Promise.all(
|
|
5457
|
-
e.options.build?.wrappers?.map(async (t) => {
|
|
5458
|
-
t.type === "react18" && await tc(e, t);
|
|
5459
|
-
}) ?? []
|
|
5460
|
-
);
|
|
5461
|
-
}
|
|
5462
|
-
};
|
|
5463
|
-
}
|
|
5464
|
-
const Za = "react", ri = "@lit/react", ec = `
|
|
5465
|
-
import React from "${Za}";
|
|
5466
|
-
import { createComponent } from "${ri}";
|
|
5467
|
-
import type { EventName } from "${ri}";
|
|
5468
|
-
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5469
|
-
|
|
5470
|
-
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5471
|
-
`;
|
|
5472
|
-
async function tc(e, t) {
|
|
5473
|
-
const { name: i } = j(), s = [];
|
|
5474
|
-
for (const a of e.apiJson.modules)
|
|
5475
|
-
for (const c of a.declarations)
|
|
5476
|
-
ic(c) && s.push(sc(c));
|
|
5477
|
-
const n = [`/// <reference types="${i}" preserve="true" />`, ec, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5478
|
-
await X(u.dirname(r), { recursive: !0 }), await _(r, n);
|
|
5479
|
-
}
|
|
5480
|
-
function ic(e) {
|
|
5481
|
-
return e.customElement === !0 && e.abstract !== !0;
|
|
5482
|
-
}
|
|
5483
|
-
function sc(e) {
|
|
5484
|
-
const t = e.events?.map(
|
|
5485
|
-
(i) => ` ${Qs(`on${$s(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5486
|
-
).join(`
|
|
5487
|
-
`);
|
|
5488
|
-
return `
|
|
5489
|
-
/** @deprecated since 5.0. React wrappers are not needed in React 19 or above. Use \`<${e.tagName} />\` directly. */
|
|
5490
|
-
export const ${e.pascalCaseName} = /*@__PURE__*/ createWrapper(
|
|
5491
|
-
getReactWrapperOptions(
|
|
5492
|
-
"${e.tagName}" as unknown as HTML${e.pascalCaseName}Element,
|
|
5493
|
-
{${t ? `
|
|
5494
|
-
${t}
|
|
5495
|
-
` : ""}}
|
|
5496
|
-
)
|
|
5497
|
-
);
|
|
5498
|
-
`;
|
|
5499
|
-
}
|
|
5500
|
-
function Lc(e = {}) {
|
|
5453
|
+
function Cc(e = {}) {
|
|
5501
5454
|
const t = new $(e), s = [
|
|
5502
5455
|
t._plugin,
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
Pa(t),
|
|
5507
|
-
_n(t),
|
|
5508
|
-
Ya(t),
|
|
5456
|
+
Vn(t),
|
|
5457
|
+
eo(t),
|
|
5458
|
+
ro(t),
|
|
5509
5459
|
Ea(t),
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5516
|
-
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
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);
|
|
5521
5473
|
return s.context = t, s;
|
|
5522
5474
|
}
|
|
5523
|
-
const
|
|
5524
|
-
initializeComponentDependencies:
|
|
5525
|
-
updateLuminaTs:
|
|
5526
|
-
propertyToAttributeMappings:
|
|
5527
|
-
nativeEvents:
|
|
5475
|
+
const Ec = {
|
|
5476
|
+
initializeComponentDependencies: ki,
|
|
5477
|
+
updateLuminaTs: es,
|
|
5478
|
+
propertyToAttributeMappings: _,
|
|
5479
|
+
nativeEvents: gi,
|
|
5528
5480
|
svgElements: lt,
|
|
5529
5481
|
mathMlElements: dt,
|
|
5530
|
-
alwaysAttributes:
|
|
5531
|
-
nativeAlwaysAttributes:
|
|
5482
|
+
alwaysAttributes: ui,
|
|
5483
|
+
nativeAlwaysAttributes: mi,
|
|
5532
5484
|
htmlAlwaysAttributes: Qe
|
|
5533
5485
|
};
|
|
5534
5486
|
export {
|
|
5535
|
-
|
|
5487
|
+
Ec as exportsForCodemod,
|
|
5536
5488
|
Re as inferCdnUrl,
|
|
5537
|
-
|
|
5489
|
+
Cc as useLumina
|
|
5538
5490
|
};
|