@arcgis/lumina-compiler 5.2.0-next.110 → 5.2.0-next.111
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 +651 -646
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { externalizeDependencies as
|
|
1
|
+
import { externalizeDependencies as ws } from "@arcgis/node-toolkit/vite/externalizeDependenciesPlugin";
|
|
2
2
|
import { isNotUndefined as R } from "@arcgis/toolkit/predicate";
|
|
3
3
|
import { f as b, l as T } from "./logger-edpIalAo.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
|
|
9
|
-
import { existsAsync as _, findPath as
|
|
10
|
-
import { readFile as z, readdir as ot, mkdir as X, writeFile as K, copyFile as
|
|
11
|
-
import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import {
|
|
5
|
+
import { camelToKebab as ti, getPreamble as Ss, uncapitalize as St, capitalize as Cs } from "@arcgis/toolkit/string";
|
|
6
|
+
import { lazyMetaSubItemJoiner as Es, lazyMetaItemJoiner as Je, lazyMetaGroupJoiner as Ts, propertyFlagAttribute as Ct, propertyFlagReflect as $s, propertyFlagBoolean as Ps, propertyFlagNumber as ks, propertyFlagState as Is, propertyFlagReadOnly as xs, propertyFlagNoAccessor as As, propertyFlagUseDefault as Ls } from "@arcgis/lumina/config";
|
|
7
|
+
import { path as u, isPosix as ii, toPosixPathSeparators as G, toSystemPathSeparators as Re, getCwd as si } from "@arcgis/node-toolkit/path";
|
|
8
|
+
import { isApiMethodAsync as Ns, globalPackageIdentifier as js, isApiMethod as Fs, isApiProperty as Rs } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
|
+
import { existsAsync as _, findPath as ri } from "@arcgis/node-toolkit/file";
|
|
10
|
+
import { readFile as z, readdir as ot, mkdir as X, writeFile as K, copyFile as Ds, rm as Os, cp as Ms } from "node:fs/promises";
|
|
11
|
+
import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as ni } from "@arcgis/node-toolkit/packageJson";
|
|
12
|
+
import { getSystemVersion as oi } from "@arcgis/node-toolkit/workspace";
|
|
13
|
+
import { build as Js } from "esbuild";
|
|
14
|
+
import Bs from "mime-types";
|
|
15
|
+
import { forEachWithConcurrency as _s } from "@arcgis/toolkit/promise";
|
|
16
|
+
import { glob as Ks } from "tinyglobby";
|
|
16
17
|
import { renameComponentFolder as Ge } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { unsafeGetUndocumentedPrinter as Us, unsafeUndocumentedTs as Ct } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
18
|
+
import { useApiExtractor as Ws } from "@arcgis/api-extractor/vite/plugin";
|
|
19
|
+
import { writeFileSync as ai } from "node:fs";
|
|
20
|
+
import { styleText as Us } from "node:util";
|
|
21
|
+
import { unsafeGetUndocumentedPrinter as zs, unsafeUndocumentedTs as Et } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
22
22
|
import { pathIsComponentEntrypoint as Pe } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
23
|
-
import { loadApiExtractorConfig as
|
|
24
|
-
import { loadTypeScriptConfig as
|
|
23
|
+
import { loadApiExtractorConfig as Hs, mergeApiExtractorConfigs as Tt } from "@arcgis/api-extractor/extractor/config";
|
|
24
|
+
import { loadTypeScriptConfig as qs } from "@arcgis/node-toolkit/vite/typeScript";
|
|
25
25
|
import { mappedFind as Xe } from "@arcgis/toolkit/array";
|
|
26
|
-
import { isPropertyEscapeNeeded as
|
|
27
|
-
import { getPackageNameFromExternalSpecifier as
|
|
28
|
-
import { identity as
|
|
29
|
-
function
|
|
30
|
-
const t = e.options?.build?.dependencies ?? {}, i =
|
|
26
|
+
import { isPropertyEscapeNeeded as ci, maybeEscapePropertyName as Vs } from "@arcgis/api-extractor/utils/partPrinter";
|
|
27
|
+
import { getPackageNameFromExternalSpecifier as Gs, getMemberName as li } from "@arcgis/api-extractor/utils/astHelpers";
|
|
28
|
+
import { identity as di } from "@arcgis/toolkit/function";
|
|
29
|
+
function Xs(e) {
|
|
30
|
+
const t = e.options?.build?.dependencies ?? {}, i = ws({
|
|
31
31
|
bundleIn: t.bundleIn,
|
|
32
32
|
externalize: [
|
|
33
33
|
// TODO: remove these once Lit is declared as a peer dependency
|
|
@@ -43,7 +43,7 @@ function Gs(e) {
|
|
|
43
43
|
e.isInStorybook && (i.resolveId = void 0);
|
|
44
44
|
}, i;
|
|
45
45
|
}
|
|
46
|
-
const
|
|
46
|
+
const Ys = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), pi = /* @__PURE__ */ new Set([
|
|
47
47
|
/**
|
|
48
48
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
49
49
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -75,7 +75,7 @@ const Xs = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__P
|
|
|
75
75
|
"vocab",
|
|
76
76
|
// These don't exist as a property, only as an attribute
|
|
77
77
|
"exportParts"
|
|
78
|
-
]),
|
|
78
|
+
]), ui = /* @__PURE__ */ new Set([
|
|
79
79
|
/*
|
|
80
80
|
* From https://github.com/preactjs/preact/blob/f3edc902447dae7393de7fccaff3b722dee79467/src/diff/props.js#L107-L118
|
|
81
81
|
* See also https://github.com/facebook/react/blob/8fd963a1e5ec89459cac27fb1d9ad193a0604110/packages/react-dom-bindings/src/client/ReactDOMComponent.js#L389
|
|
@@ -914,9 +914,9 @@ const Xs = "Fragment", Be = "DynamicHtmlTag", _e = "DynamicSvgTag", ke = /* @__P
|
|
|
914
914
|
}
|
|
915
915
|
}
|
|
916
916
|
};
|
|
917
|
-
|
|
918
|
-
Object.values(W.perElement).forEach(
|
|
919
|
-
function
|
|
917
|
+
mi(W.common);
|
|
918
|
+
Object.values(W.perElement).forEach(mi);
|
|
919
|
+
function mi(e) {
|
|
920
920
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
921
921
|
/* @__PURE__ */ Object.create(null),
|
|
922
922
|
e.stringifiedReflected
|
|
@@ -925,7 +925,7 @@ function pi(e) {
|
|
|
925
925
|
e.stringifiedNonReflected
|
|
926
926
|
));
|
|
927
927
|
}
|
|
928
|
-
const
|
|
928
|
+
const $t = /* @__PURE__ */ new Set(["itemScope"]), fi = /* @__PURE__ */ new Set([
|
|
929
929
|
"abort",
|
|
930
930
|
"animationCancel",
|
|
931
931
|
"animationEnd",
|
|
@@ -1024,7 +1024,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
|
|
|
1024
1024
|
"volumeChange",
|
|
1025
1025
|
"waiting",
|
|
1026
1026
|
"wheel"
|
|
1027
|
-
]),
|
|
1027
|
+
]), Qs = /* @__PURE__ */ new Set([
|
|
1028
1028
|
"area",
|
|
1029
1029
|
"base",
|
|
1030
1030
|
"br",
|
|
@@ -1100,7 +1100,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
|
|
|
1100
1100
|
"tspan",
|
|
1101
1101
|
"use",
|
|
1102
1102
|
"view"
|
|
1103
|
-
]),
|
|
1103
|
+
]), Zs = /* @__PURE__ */ new Set(["title", "svg", "a", "script", "style"]), ct = /* @__PURE__ */ new Set([
|
|
1104
1104
|
"annotation-xml",
|
|
1105
1105
|
"annotation",
|
|
1106
1106
|
"maction",
|
|
@@ -1132,7 +1132,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
|
|
|
1132
1132
|
"munder",
|
|
1133
1133
|
"munderover",
|
|
1134
1134
|
"semantics"
|
|
1135
|
-
]),
|
|
1135
|
+
]), er = /* @__PURE__ */ new Set([
|
|
1136
1136
|
"annotation-xml",
|
|
1137
1137
|
"color-profile",
|
|
1138
1138
|
"font-face",
|
|
@@ -1142,7 +1142,7 @@ const Tt = /* @__PURE__ */ new Set(["itemScope"]), ui = /* @__PURE__ */ new Set(
|
|
|
1142
1142
|
"font-face-name",
|
|
1143
1143
|
"missing-glyph"
|
|
1144
1144
|
]);
|
|
1145
|
-
function
|
|
1145
|
+
function tr(e) {
|
|
1146
1146
|
if (e.length === 0)
|
|
1147
1147
|
return "";
|
|
1148
1148
|
const t = e[0];
|
|
@@ -1155,11 +1155,11 @@ function er(e) {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
return e.trim().length === 0 ? t : e;
|
|
1157
1157
|
}
|
|
1158
|
-
const
|
|
1158
|
+
const ir = (e) => e.replaceAll("\\", "\\\\").replace(sr, "\\${").replaceAll("`", "\\`"), sr = /\$\{/gu, rr = (e) => !nr.test(e), nr = /^[^\s"'=<>`]+$/u, or = /[&<>]/gu, ar = {
|
|
1159
1159
|
"&": "&",
|
|
1160
1160
|
"<": "<",
|
|
1161
1161
|
">": ">"
|
|
1162
|
-
},
|
|
1162
|
+
}, gi = (e) => e.replace(or, (t) => ar[t]), lt = (e) => typeof e == "string" && e.includes("-") && !er.has(e), cr = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Y = "staticSvg", ce = "html", se = "svg", hi = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), yi = "css", vi = "mathml", bi = [yi, ce, vi, ae, Y, se], lr = new Set(bi), dr = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], pr = "nothing", ur = [...cr, ...bi, ...dr, pr], mr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => fe(t)), fe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), re = {
|
|
1163
1163
|
[ce]: ["lit", "lit/html.js", "lit-html"],
|
|
1164
1164
|
/**
|
|
1165
1165
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1170,8 +1170,8 @@ const tr = (e) => e.replaceAll("\\", "\\\\").replace(ir, "\\${").replaceAll("`",
|
|
|
1170
1170
|
[ae]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1171
1171
|
[se]: ["lit", "lit-html", "lit/html.js"],
|
|
1172
1172
|
[Y]: ["lit/static-html.js", "lit-html/static.js"],
|
|
1173
|
-
[
|
|
1174
|
-
[
|
|
1173
|
+
[vi]: ["lit", "lit-html", "lit/html.js"],
|
|
1174
|
+
[yi]: ["lit", "@lit/reactive-element/css-tag.js", "@lit/reactive-element"],
|
|
1175
1175
|
safeClassMap: ["@arcgis/lumina"],
|
|
1176
1176
|
safeStyleMap: ["@arcgis/lumina"],
|
|
1177
1177
|
deferLoad: ["@arcgis/lumina"],
|
|
@@ -1181,7 +1181,7 @@ const tr = (e) => e.replaceAll("\\", "\\\\").replace(ir, "\\${").replaceAll("`",
|
|
|
1181
1181
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1182
1182
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1183
1183
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1184
|
-
},
|
|
1184
|
+
}, fr = /* @__PURE__ */ new Set([
|
|
1185
1185
|
"h",
|
|
1186
1186
|
"Fragment",
|
|
1187
1187
|
"state",
|
|
@@ -1191,7 +1191,7 @@ const tr = (e) => e.replaceAll("\\", "\\\\").replace(ir, "\\${").replaceAll("`",
|
|
|
1191
1191
|
"bindProperty",
|
|
1192
1192
|
"bindEvent",
|
|
1193
1193
|
"bindAttribute"
|
|
1194
|
-
]),
|
|
1194
|
+
]), gr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, de = "@arcgis/lumina:loadLitCss", Ie = "?litCss", Q = "?layeredLitCss", Ze = "?globalFileLitCss", hr = (e) => ({
|
|
1195
1195
|
name: de,
|
|
1196
1196
|
enforce: "pre",
|
|
1197
1197
|
configResolved(t) {
|
|
@@ -1231,14 +1231,14 @@ const tr = (e) => e.replaceAll("\\", "\\\\").replace(ir, "\\${").replaceAll("`",
|
|
|
1231
1231
|
if (l && (a = a.slice(0, -Ze.length)), !c && !d && !l)
|
|
1232
1232
|
return await s.handler.call(this, r, a);
|
|
1233
1233
|
const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1234
|
-
return typeof f != "string" || !f.startsWith(
|
|
1234
|
+
return typeof f != "string" || !f.startsWith(wi) || !f.endsWith(yr) ? (T.warn(
|
|
1235
1235
|
de,
|
|
1236
1236
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
1237
1237
|
f
|
|
1238
1238
|
)}`
|
|
1239
|
-
), m) : l ? (e._globalCssString =
|
|
1239
|
+
), m) : l ? (e._globalCssString = Si(f), { code: "", map: { mappings: "" } }) : {
|
|
1240
1240
|
...g,
|
|
1241
|
-
code:
|
|
1241
|
+
code: Sr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1242
1242
|
/**
|
|
1243
1243
|
* Vite's original transform does not generate source maps for inlined
|
|
1244
1244
|
* css, thus we can't either
|
|
@@ -1248,8 +1248,8 @@ const tr = (e) => e.replaceAll("\\", "\\\\").replace(ir, "\\${").replaceAll("`",
|
|
|
1248
1248
|
}
|
|
1249
1249
|
};
|
|
1250
1250
|
}
|
|
1251
|
-
}),
|
|
1252
|
-
export const styles = css\``,
|
|
1251
|
+
}), wi = 'export default "', yr = '"', vr = `import { css } from '${re.css[0]}';
|
|
1252
|
+
export const styles = css\``, br = "`;\nexport default styles;", wr = `
|
|
1253
1253
|
|
|
1254
1254
|
if(import.meta.hot) {
|
|
1255
1255
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1260,24 +1260,24 @@ if(import.meta.hot) {
|
|
|
1260
1260
|
}
|
|
1261
1261
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1262
1262
|
});
|
|
1263
|
-
}`,
|
|
1264
|
-
function
|
|
1265
|
-
const n =
|
|
1263
|
+
}`, Si = (e) => e.slice(wi.length - 1);
|
|
1264
|
+
function Sr(e, t, i, s) {
|
|
1265
|
+
const n = Si(e), r = JSON.parse(n), a = ir(r), c = s ? `@layer{${i ? "" : `
|
|
1266
1266
|
`}${a}${i ? "" : `
|
|
1267
1267
|
`}}` : a;
|
|
1268
|
-
return `${
|
|
1268
|
+
return `${vr}${c}${br}${t ? wr : ""}`;
|
|
1269
1269
|
}
|
|
1270
|
-
function
|
|
1271
|
-
return `import("${
|
|
1272
|
-
setCustomElementsManifest(${
|
|
1270
|
+
function Cr(e) {
|
|
1271
|
+
return `import("${Er}").then(({ setCustomElementsManifest }) => {
|
|
1272
|
+
setCustomElementsManifest(${Tr(e)});
|
|
1273
1273
|
});`;
|
|
1274
1274
|
}
|
|
1275
|
-
const
|
|
1276
|
-
function
|
|
1275
|
+
const Er = "@storybook/web-components-vite", Tr = (e) => `JSON.parse(\`${$r(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1276
|
+
function $r(e) {
|
|
1277
1277
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1278
1278
|
}
|
|
1279
|
-
function
|
|
1280
|
-
|
|
1279
|
+
function Pr(e) {
|
|
1280
|
+
kr(e);
|
|
1281
1281
|
const t = e.options.css?.globalStylesPath;
|
|
1282
1282
|
if (t === void 0)
|
|
1283
1283
|
return "";
|
|
@@ -1285,21 +1285,21 @@ function $r(e) {
|
|
|
1285
1285
|
return e.viteCommand === "serve" || e.isInStorybook ? [
|
|
1286
1286
|
`import globalStyles from "${i}${Q}";`,
|
|
1287
1287
|
"document.adoptedStyleSheets = [...document.adoptedStyleSheets, globalStyles.styleSheet!];",
|
|
1288
|
-
|
|
1288
|
+
Ei("", e)
|
|
1289
1289
|
].join(`
|
|
1290
1290
|
`) : `import "${i}${Ze}";`;
|
|
1291
1291
|
}
|
|
1292
|
-
const
|
|
1293
|
-
function
|
|
1292
|
+
const Ci = "hydrated";
|
|
1293
|
+
function kr(e) {
|
|
1294
1294
|
e._globalHydratedCssString = [
|
|
1295
1295
|
":not([",
|
|
1296
|
-
e.options.css?.hydratedAttribute ??
|
|
1296
|
+
e.options.css?.hydratedAttribute ?? Ci,
|
|
1297
1297
|
"]):is(",
|
|
1298
1298
|
e.apiJsonComponents.map((t) => t.tagName).join(","),
|
|
1299
1299
|
"){visibility:hidden}"
|
|
1300
1300
|
].join("");
|
|
1301
1301
|
}
|
|
1302
|
-
function
|
|
1302
|
+
function Ei(e, t) {
|
|
1303
1303
|
return [
|
|
1304
1304
|
"const globalCss = new CSSStyleSheet;",
|
|
1305
1305
|
`globalCss.replaceSync("@layer{${`${t._globalHydratedCssString}${t.shouldMinify ? "" : "\\n\\n"}${e ? e.slice(1, -1) : ""}`}}");`,
|
|
@@ -1307,71 +1307,71 @@ function Si(e, t) {
|
|
|
1307
1307
|
].join(`
|
|
1308
1308
|
`);
|
|
1309
1309
|
}
|
|
1310
|
-
const
|
|
1310
|
+
const Ir = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1311
1311
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1312
1312
|
|
|
1313
1313
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1314
1314
|
`}}`;
|
|
1315
|
-
function
|
|
1315
|
+
function xr(e) {
|
|
1316
1316
|
const t = [], i = [];
|
|
1317
1317
|
for (const s of e.privateApiJson.modules)
|
|
1318
1318
|
for (const n of s.declarations)
|
|
1319
|
-
n.customElement === !0 && (i.push(
|
|
1319
|
+
n.customElement === !0 && (i.push(Ar(n, e, s.sourcePath)), t.push(s.sourcePath));
|
|
1320
1320
|
return [
|
|
1321
1321
|
'import { runtime } from "./runtime.ts";',
|
|
1322
1322
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
1323
|
-
|
|
1324
|
-
e.hmrEnabled ?
|
|
1323
|
+
Pr(e),
|
|
1324
|
+
e.hmrEnabled ? Nr : "",
|
|
1325
1325
|
"",
|
|
1326
|
-
e.isInStorybook ?
|
|
1326
|
+
e.isInStorybook ? Cr(e.apiJson) : "",
|
|
1327
1327
|
"",
|
|
1328
1328
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
1329
1329
|
i.join(`,
|
|
1330
1330
|
`),
|
|
1331
1331
|
"});",
|
|
1332
|
-
e.hmrEnabled ?
|
|
1332
|
+
e.hmrEnabled ? jr(t) : ""
|
|
1333
1333
|
].join(`
|
|
1334
1334
|
`);
|
|
1335
1335
|
}
|
|
1336
|
-
const
|
|
1336
|
+
const Ar = (e, t, i) => [
|
|
1337
1337
|
` "${e.tagName}": [`,
|
|
1338
1338
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
1339
|
-
|
|
1339
|
+
Lr(e),
|
|
1340
1340
|
"]"
|
|
1341
1341
|
].join("");
|
|
1342
|
-
function
|
|
1343
|
-
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } =
|
|
1344
|
-
return `${p.length > 0 || n ? `"${p.join(
|
|
1342
|
+
function Lr(e) {
|
|
1343
|
+
const { properties: t, asyncMethods: i, syncMethods: s, formAssociated: n } = Ti(e), r = t.map((g) => g.join(Es)).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);
|
|
1344
|
+
return `${p.length > 0 || n ? `"${p.join(Ts)}"` : ""}${n ? ",1" : ""}`;
|
|
1345
1345
|
}
|
|
1346
|
-
function
|
|
1346
|
+
function Ti(e) {
|
|
1347
1347
|
const t = [], i = [], s = [];
|
|
1348
1348
|
for (let r = 0; r < e.members.length; ++r) {
|
|
1349
1349
|
const a = e.members[r];
|
|
1350
1350
|
if (a.kind === "field") {
|
|
1351
|
-
const c = typeof a.attribute == "string", d = c && a.attribute !==
|
|
1351
|
+
const c = typeof a.attribute == "string", d = c && a.attribute !== ti(a.name);
|
|
1352
1352
|
t.push(
|
|
1353
1353
|
c && !d ? [a.name] : [a.name, d ? String(a.attribute) : ""]
|
|
1354
1354
|
);
|
|
1355
|
-
} else a.kind === "method" && a.name !== "componentOnReady" && (
|
|
1355
|
+
} else a.kind === "method" && a.name !== "componentOnReady" && (Ns(a) ? i.push(a.name) : s.push(a.name));
|
|
1356
1356
|
}
|
|
1357
1357
|
const n = e.formAssociated === !0;
|
|
1358
1358
|
return { tagName: e.tagName, properties: t, asyncMethods: i, syncMethods: s, formAssociated: n };
|
|
1359
1359
|
}
|
|
1360
|
-
const
|
|
1361
|
-
`,
|
|
1360
|
+
const Nr = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
1361
|
+
`, jr = (e) => `
|
|
1362
1362
|
if(import.meta.hot) {
|
|
1363
1363
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
1364
1364
|
import.meta.hot.accept([
|
|
1365
1365
|
${e.map((t) => ` "/${t}",`).join(`
|
|
1366
1366
|
`)}
|
|
1367
1367
|
], handleHmrUpdate);
|
|
1368
|
-
}`,
|
|
1369
|
-
name:
|
|
1368
|
+
}`, Fr = "@arcgis/lumina-compiler", $i = {
|
|
1369
|
+
name: Fr
|
|
1370
1370
|
};
|
|
1371
|
-
async function
|
|
1372
|
-
return ne ??=
|
|
1371
|
+
async function Pi(e, t) {
|
|
1372
|
+
return ne ??= Dr(e, t), await ne;
|
|
1373
1373
|
}
|
|
1374
|
-
function
|
|
1374
|
+
function Rr() {
|
|
1375
1375
|
if (xe === void 0)
|
|
1376
1376
|
throw Error(
|
|
1377
1377
|
b(
|
|
@@ -1381,7 +1381,7 @@ function Fr() {
|
|
|
1381
1381
|
);
|
|
1382
1382
|
return xe;
|
|
1383
1383
|
}
|
|
1384
|
-
function
|
|
1384
|
+
function ki() {
|
|
1385
1385
|
if (et === void 0)
|
|
1386
1386
|
throw Error(
|
|
1387
1387
|
b(
|
|
@@ -1391,9 +1391,9 @@ function $i() {
|
|
|
1391
1391
|
);
|
|
1392
1392
|
return et;
|
|
1393
1393
|
}
|
|
1394
|
-
async function
|
|
1394
|
+
async function Dr(e, t) {
|
|
1395
1395
|
const i = j(e), s = i.dependencies ?? {}, n = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
1396
|
-
[...Object.keys(s), ...Object.keys(n)].filter((l) => !
|
|
1396
|
+
[...Object.keys(s), ...Object.keys(n)].filter((l) => !Or.has(l)).flatMap(async (l) => await Ii(l, e))
|
|
1397
1397
|
)).filter(R);
|
|
1398
1398
|
xe ??= a, et = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
1399
1399
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -1401,7 +1401,7 @@ async function Rr(e, t) {
|
|
|
1401
1401
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
1402
1402
|
return xe ??= d, d;
|
|
1403
1403
|
}
|
|
1404
|
-
const
|
|
1404
|
+
const Or = /* @__PURE__ */ new Set([
|
|
1405
1405
|
"@arcgis/arcade-languageservice",
|
|
1406
1406
|
"@arcgis/node-toolkit",
|
|
1407
1407
|
"@arcgis/toolkit",
|
|
@@ -1441,29 +1441,29 @@ const Dr = /* @__PURE__ */ new Set([
|
|
|
1441
1441
|
"vscode-languageserver-types"
|
|
1442
1442
|
]);
|
|
1443
1443
|
let xe, et, ne;
|
|
1444
|
-
async function
|
|
1445
|
-
const i = await $e(e, t), s = await
|
|
1444
|
+
async function Ii(e, t) {
|
|
1445
|
+
const i = await $e(e, t), s = await ni(i), n = "exports" in s, r = Vr.bind(void 0, n), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
1446
1446
|
if (a ? await _(c) : !1) {
|
|
1447
|
-
const g = await z(c, "utf8"), h =
|
|
1447
|
+
const g = await z(c, "utf8"), h = Mr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1448
1448
|
try {
|
|
1449
|
-
const C = JSON.parse(w), E =
|
|
1449
|
+
const C = JSON.parse(w), E = Hr(C, { packageName: e, getImportPath: r });
|
|
1450
1450
|
return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
|
|
1451
1451
|
} catch (C) {
|
|
1452
1452
|
T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
1453
1453
|
Error: ${String(C)}`);
|
|
1454
1454
|
}
|
|
1455
1455
|
}
|
|
1456
|
-
const l =
|
|
1456
|
+
const l = Pt(s.customElements);
|
|
1457
1457
|
if (l != null) {
|
|
1458
|
-
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), y =
|
|
1458
|
+
const g = u.join(i, l), h = JSON.parse(await z(g, "utf-8")), y = Jr(h), v = xi(h, {
|
|
1459
1459
|
packageName: e,
|
|
1460
1460
|
getImportPath: r
|
|
1461
1461
|
});
|
|
1462
1462
|
return { type: y ? "@arcgis/lumina" : "unknown", packageName: e, components: v, packageLocation: i, packageJson: s };
|
|
1463
1463
|
}
|
|
1464
|
-
const p =
|
|
1464
|
+
const p = Pt(s["web-types"]);
|
|
1465
1465
|
if (p != null) {
|
|
1466
|
-
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y =
|
|
1466
|
+
const g = u.join(i, p), h = JSON.parse(await z(g, "utf-8")), y = Br(h, {
|
|
1467
1467
|
packageName: e,
|
|
1468
1468
|
getImportPath: r
|
|
1469
1469
|
});
|
|
@@ -1471,19 +1471,19 @@ Error: ${String(C)}`);
|
|
|
1471
1471
|
}
|
|
1472
1472
|
const m = u.join(i, "dist/components");
|
|
1473
1473
|
if (await _(m)) {
|
|
1474
|
-
const g = await
|
|
1474
|
+
const g = await qr(m, {
|
|
1475
1475
|
packageName: e,
|
|
1476
1476
|
getImportPath: r
|
|
1477
1477
|
});
|
|
1478
1478
|
return { type: "unknown", packageName: e, components: g, packageLocation: i, packageJson: s };
|
|
1479
1479
|
}
|
|
1480
1480
|
}
|
|
1481
|
-
const
|
|
1482
|
-
function
|
|
1481
|
+
const Pt = (e) => Array.isArray(e) ? e[0] : e;
|
|
1482
|
+
function Mr(e, t) {
|
|
1483
1483
|
const i = e.indexOf(t);
|
|
1484
1484
|
return i === -1 ? -1 : i + t.length;
|
|
1485
1485
|
}
|
|
1486
|
-
function
|
|
1486
|
+
function xi(e, t, i = !1) {
|
|
1487
1487
|
const s = /* @__PURE__ */ Object.create(null);
|
|
1488
1488
|
if (e.modules === void 0)
|
|
1489
1489
|
return s;
|
|
@@ -1520,11 +1520,11 @@ function ki(e, t, i = !1) {
|
|
|
1520
1520
|
}
|
|
1521
1521
|
return s;
|
|
1522
1522
|
}
|
|
1523
|
-
const
|
|
1523
|
+
const Jr = (e) => (
|
|
1524
1524
|
// Since 5.0
|
|
1525
1525
|
e.compiler?.name === "@arcgis/api-extractor" || // Before 5.0
|
|
1526
|
-
e.compiler?.name ===
|
|
1527
|
-
),
|
|
1526
|
+
e.compiler?.name === $i.name
|
|
1527
|
+
), Br = (e, t) => Object.fromEntries(
|
|
1528
1528
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
1529
1529
|
(i) => [
|
|
1530
1530
|
i.name,
|
|
@@ -1535,7 +1535,7 @@ const Mr = (e) => (
|
|
|
1535
1535
|
}
|
|
1536
1536
|
]
|
|
1537
1537
|
) ?? []
|
|
1538
|
-
),
|
|
1538
|
+
), _r = 1, Kr = 2, Wr = 4, Ur = 8, zr = _r | Kr | Wr | Ur, Hr = (e, t) => Object.fromEntries(
|
|
1539
1539
|
e.flatMap(
|
|
1540
1540
|
([i, s]) => s.map(
|
|
1541
1541
|
([n, r, a]) => [
|
|
@@ -1544,13 +1544,13 @@ const Mr = (e) => (
|
|
|
1544
1544
|
packageName: t.packageName,
|
|
1545
1545
|
modulePath: t.getImportPath(r),
|
|
1546
1546
|
propToAttribute: Object.fromEntries(
|
|
1547
|
-
Object.entries(a ?? {}).filter(([c, [d]]) => d &
|
|
1547
|
+
Object.entries(a ?? {}).filter(([c, [d]]) => d & zr).map(([c, [d, l = c]]) => [c, l])
|
|
1548
1548
|
)
|
|
1549
1549
|
}
|
|
1550
1550
|
]
|
|
1551
1551
|
)
|
|
1552
1552
|
)
|
|
1553
|
-
),
|
|
1553
|
+
), qr = async (e, t) => Object.fromEntries(
|
|
1554
1554
|
(await ot(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
1555
1555
|
const s = i.slice(0, -5);
|
|
1556
1556
|
return [
|
|
@@ -1562,31 +1562,34 @@ const Mr = (e) => (
|
|
|
1562
1562
|
}
|
|
1563
1563
|
];
|
|
1564
1564
|
})
|
|
1565
|
-
),
|
|
1566
|
-
function
|
|
1565
|
+
), Vr = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, Gr = (e) => e.startsWith("/") ? e : `/${e}`, dt = (e, t) => `${e}@fs${Gr(t)}`;
|
|
1566
|
+
function Xr(e, t) {
|
|
1567
1567
|
const i = u.resolve(e), s = u.resolve(i, t.split(/[?#]/u)[0].replace(/^[/\\]+/u, "")), n = u.relative(i, s);
|
|
1568
1568
|
return n === ".." || n.startsWith(`..${u.sep}`) || u.isAbsolute(n) ? void 0 : s;
|
|
1569
1569
|
}
|
|
1570
|
-
const
|
|
1571
|
-
function
|
|
1570
|
+
const Ai = "packages/core-packages/core/src", Yr = "packages/core-packages/core/output/npm/esm", te = !import.meta.url.includes("node_modules");
|
|
1571
|
+
function pt(e) {
|
|
1572
|
+
return te && e.name !== "@esri/calcite-components" ? oi().version : e.version;
|
|
1573
|
+
}
|
|
1574
|
+
function Li({ command: e }) {
|
|
1572
1575
|
return e === "serve" && process.argv.includes("--local-core");
|
|
1573
1576
|
}
|
|
1574
|
-
function
|
|
1577
|
+
function Ni(e) {
|
|
1575
1578
|
const t = e?.apiExtractorPluginConfig.unsafeConfigOverride?.types?.typeScriptConfig?.config.options.target ?? o.ScriptTarget.ESNext, i = o.ScriptTarget[t].toLowerCase();
|
|
1576
1579
|
return i === "latest" ? "esnext" : i;
|
|
1577
1580
|
}
|
|
1578
1581
|
const tt = "@arcgis/lumina:provideAssets";
|
|
1579
|
-
function ie(e, t, i =
|
|
1582
|
+
function ie(e, t, i = ut, s = "max-age=31536000, immutable") {
|
|
1580
1583
|
if (e.viteCommand !== "serve")
|
|
1581
1584
|
throw Error(b(tt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
1582
1585
|
const n = e._serverConfigured, r = e.server.middlewares.stack.length;
|
|
1583
1586
|
if (t.forEach((a) => {
|
|
1584
|
-
const c =
|
|
1587
|
+
const c = Fi(a), d = Di(e.dir, Ri(c)), l = Zr(e.viteConfig.base, d, e.dir.distCdn);
|
|
1585
1588
|
e.server.middlewares.use(l, (p, m, f) => {
|
|
1586
|
-
const g =
|
|
1589
|
+
const g = en(p.url), h = c.type === "directory" ? Xr(c.source, g) : c.source, y = u.join(d, g), v = i.find((w) => w.match(y, e));
|
|
1587
1590
|
return h === void 0 ? (m.statusCode = 403, m.end(), !0) : ((typeof h == "function" ? Promise.resolve(h()) : z(h)).then((w) => {
|
|
1588
1591
|
const C = (typeof h == "function" ? void 0 : v?.transform(w.toString("utf8"), y, e)) ?? w;
|
|
1589
|
-
m.setHeader("Cache-Control", s), m.setHeader("Content-Type",
|
|
1592
|
+
m.setHeader("Cache-Control", s), m.setHeader("Content-Type", Bs.lookup(g) || "application/octet-stream"), m.write(C), m.end();
|
|
1590
1593
|
}).catch((w) => {
|
|
1591
1594
|
(c.type !== "directory" || process.env.DEBUG) && T.warn(
|
|
1592
1595
|
tt,
|
|
@@ -1599,22 +1602,22 @@ function ie(e, t, i = pt, s = "max-age=31536000, immutable") {
|
|
|
1599
1602
|
e.server.middlewares.stack.splice(0, 0, ...a);
|
|
1600
1603
|
}
|
|
1601
1604
|
}
|
|
1602
|
-
async function
|
|
1605
|
+
async function ji(e, t, i = ut) {
|
|
1603
1606
|
await Promise.all(
|
|
1604
1607
|
t.map(async (s) => {
|
|
1605
|
-
const n =
|
|
1608
|
+
const n = Fi(s), r = Di(e.dir, Ri(n));
|
|
1606
1609
|
if (n.type === "directory") {
|
|
1607
1610
|
const a = u.resolve(n.source), d = (await ot(a, { recursive: !0, withFileTypes: !0 })).filter((l) => l.isFile()).map((l) => {
|
|
1608
1611
|
const p = u.resolve(l.parentPath, l.name), m = u.relative(a, p), f = u.join(r, m);
|
|
1609
1612
|
return [p, f];
|
|
1610
1613
|
});
|
|
1611
|
-
await
|
|
1614
|
+
await Mi(d.map(([l, p]) => p)), await _s(
|
|
1612
1615
|
d,
|
|
1613
1616
|
16,
|
|
1614
|
-
async ([l, p]) => await
|
|
1617
|
+
async ([l, p]) => await kt(l, p, i, e)
|
|
1615
1618
|
);
|
|
1616
1619
|
} else if (n.type === "file")
|
|
1617
|
-
await X(u.dirname(r), { recursive: !0 }), await
|
|
1620
|
+
await X(u.dirname(r), { recursive: !0 }), await kt(n.source, r, i, e);
|
|
1618
1621
|
else if (n.type === "dynamic") {
|
|
1619
1622
|
await X(u.dirname(r), { recursive: !0 });
|
|
1620
1623
|
const a = await Promise.resolve(n.source());
|
|
@@ -1623,7 +1626,7 @@ async function Li(e, t, i = pt) {
|
|
|
1623
1626
|
})
|
|
1624
1627
|
);
|
|
1625
1628
|
}
|
|
1626
|
-
const
|
|
1629
|
+
const Fi = ii ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
1627
1630
|
...e,
|
|
1628
1631
|
destination: G(e.destination)
|
|
1629
1632
|
} : {
|
|
@@ -1631,16 +1634,16 @@ const Ni = ti ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
1631
1634
|
source: G(e.source),
|
|
1632
1635
|
destination: G(e.destination)
|
|
1633
1636
|
};
|
|
1634
|
-
async function
|
|
1637
|
+
async function kt(e, t, i, s) {
|
|
1635
1638
|
const n = i.find((r) => r.match(t, s));
|
|
1636
1639
|
if (n === void 0)
|
|
1637
|
-
await
|
|
1640
|
+
await Ds(e, t);
|
|
1638
1641
|
else {
|
|
1639
1642
|
const r = await z(e, "utf8"), a = n.transform(r, t, s);
|
|
1640
1643
|
await K(t, a);
|
|
1641
1644
|
}
|
|
1642
1645
|
}
|
|
1643
|
-
function
|
|
1646
|
+
function Ri(e) {
|
|
1644
1647
|
if (e.type === "dynamic")
|
|
1645
1648
|
return e.destination;
|
|
1646
1649
|
if (e.source.endsWith(u.sep)) {
|
|
@@ -1655,40 +1658,40 @@ function ji(e) {
|
|
|
1655
1658
|
}
|
|
1656
1659
|
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;
|
|
1657
1660
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const s =
|
|
1661
|
+
function Di({ dist: e, distCdnAssets: t }, i) {
|
|
1662
|
+
const s = Qr(i), n = u.join(
|
|
1660
1663
|
t,
|
|
1661
1664
|
s ? u.relative(t, i) : i
|
|
1662
|
-
), r = u.relative(e, n), a =
|
|
1665
|
+
), r = u.relative(e, n), a = Oi(r);
|
|
1663
1666
|
return u.join(e, a);
|
|
1664
1667
|
}
|
|
1665
|
-
function
|
|
1668
|
+
function Qr(e) {
|
|
1666
1669
|
if (e.startsWith(u.sep)) {
|
|
1667
|
-
const t =
|
|
1670
|
+
const t = si(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
1668
1671
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
1669
1672
|
} else
|
|
1670
|
-
return !!(!
|
|
1673
|
+
return !!(!ii && u.isAbsolute(e));
|
|
1671
1674
|
}
|
|
1672
|
-
function
|
|
1673
|
-
const s =
|
|
1675
|
+
function Zr(e, t, i) {
|
|
1676
|
+
const s = Oi(u.relative(i, t)), n = s.startsWith("/") ? s.slice(1) : s;
|
|
1674
1677
|
return `${e}${n}`;
|
|
1675
1678
|
}
|
|
1676
|
-
const
|
|
1677
|
-
async function
|
|
1679
|
+
const Oi = (e) => e.replaceAll("../", ""), en = (e = "") => e.split("?")[0].split("#")[0];
|
|
1680
|
+
async function Mi(e) {
|
|
1678
1681
|
const t = new Set(e.map(u.dirname));
|
|
1679
1682
|
await Promise.all(Array.from(t, async (i) => await X(i, { recursive: !0 })));
|
|
1680
1683
|
}
|
|
1681
|
-
const
|
|
1684
|
+
const tn = {
|
|
1682
1685
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
1683
1686
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
1684
|
-
},
|
|
1687
|
+
}, ut = [tn], Ae = "@arcgis/core", me = "@arcgis/core/assets", Ke = j(), H = Ae in (Ke.dependencies ?? {}) || Ae in (Ke.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
1685
1688
|
Ke.name === "@arcgis/lumina";
|
|
1686
|
-
async function
|
|
1689
|
+
async function sn(e, t, i, s) {
|
|
1687
1690
|
if (!H)
|
|
1688
1691
|
return [];
|
|
1689
1692
|
const n = e._localCdnCore, r = n?.packageLocation ?? await $e(Ae);
|
|
1690
1693
|
if (i === "cdn") {
|
|
1691
|
-
const a = await
|
|
1694
|
+
const a = await ni(r), c = De(a, s);
|
|
1692
1695
|
return [
|
|
1693
1696
|
// Use the ESM CDN
|
|
1694
1697
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -1704,17 +1707,17 @@ async function tn(e, t, i, s) {
|
|
|
1704
1707
|
})
|
|
1705
1708
|
},
|
|
1706
1709
|
// <link rel="stylesheet" id="arcgisCoreStylesheet" href="https://jsdev.arcgis.com/VERSION/esri/themes/light/main.css" />
|
|
1707
|
-
|
|
1710
|
+
Ji(c)
|
|
1708
1711
|
];
|
|
1709
1712
|
} else
|
|
1710
|
-
return
|
|
1713
|
+
return rn(t, r, n?.sourceLocation !== void 0);
|
|
1711
1714
|
}
|
|
1712
|
-
function
|
|
1715
|
+
function rn(e, t, i) {
|
|
1713
1716
|
const s = `${e}${me}`;
|
|
1714
1717
|
return [
|
|
1715
1718
|
// Browser tests import this as a Vite CSS module and adopt its stylesheet, so CSS must remain on the /@fs route.
|
|
1716
1719
|
// Core's prebuilt JavaScript assets use the untransformed route configured below.
|
|
1717
|
-
|
|
1720
|
+
Ji(
|
|
1718
1721
|
i ? `${e}${me}/` : dt(e, `${t}/assets/`)
|
|
1719
1722
|
),
|
|
1720
1723
|
{
|
|
@@ -1728,7 +1731,7 @@ function sn(e, t, i) {
|
|
|
1728
1731
|
}
|
|
1729
1732
|
];
|
|
1730
1733
|
}
|
|
1731
|
-
async function
|
|
1734
|
+
async function nn(e) {
|
|
1732
1735
|
const t = e._localCdnCore, i = t?.packageLocation ?? await $e(Ae), s = t?.sourceLocation !== void 0 ? [
|
|
1733
1736
|
{
|
|
1734
1737
|
type: "directory",
|
|
@@ -1769,26 +1772,28 @@ async function rn(e) {
|
|
|
1769
1772
|
}
|
|
1770
1773
|
];
|
|
1771
1774
|
e.server.middlewares.use("/builddate.txt", (n, r) => {
|
|
1772
|
-
r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain")
|
|
1775
|
+
r.setHeader("Cache-Control", "no-cache"), r.setHeader("Content-Type", "text/plain");
|
|
1776
|
+
const a = t?.sourceLocation ? oi().version : j(i).version;
|
|
1777
|
+
r.end(JSON.stringify({ version: a }));
|
|
1773
1778
|
}), ie(e, s, [], "no-cache");
|
|
1774
1779
|
}
|
|
1775
|
-
const
|
|
1780
|
+
const Ji = (e) => ({
|
|
1776
1781
|
// Not using join() because it would turn https:// into https:/
|
|
1777
1782
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
1778
1783
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
1779
1784
|
id: "arcgisCoreStylesheet"
|
|
1780
|
-
}),
|
|
1781
|
-
function
|
|
1785
|
+
}), mt = "customElement.js";
|
|
1786
|
+
function on(e, t) {
|
|
1782
1787
|
if (!t.startsWith(e))
|
|
1783
1788
|
return t;
|
|
1784
1789
|
const s = t.split(u.sep);
|
|
1785
|
-
return s.at(
|
|
1790
|
+
return s.at(an) !== s.at(cn) ? t : u.join(s.slice(0, -1).join(u.sep), mt);
|
|
1786
1791
|
}
|
|
1787
|
-
const
|
|
1792
|
+
const an = -1, cn = -2, ln = /["']\.\.?\/[^'"]+/gu, dn = (e, t, i, s) => e.replaceAll(ln, (n) => {
|
|
1788
1793
|
const r = n.slice(1);
|
|
1789
1794
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
1790
1795
|
return n;
|
|
1791
|
-
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ?
|
|
1796
|
+
const a = u.join(s, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? on(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
1797
|
if (i === s && a === d)
|
|
1793
1798
|
return n;
|
|
1794
1799
|
const l = he(i, d), p = n.endsWith("/") ? `${l}/` : l;
|
|
@@ -1797,12 +1802,12 @@ const on = -1, an = -2, cn = /["']\.\.?\/[^'"]+/gu, ln = (e, t, i, s) => e.repla
|
|
|
1797
1802
|
const i = u.relative(e, t);
|
|
1798
1803
|
return i.startsWith(".") ? i : `.${u.sep}${i}`;
|
|
1799
1804
|
};
|
|
1800
|
-
async function
|
|
1805
|
+
async function pn(e, t, i) {
|
|
1801
1806
|
const s = u.resolve(e.dir.root, t);
|
|
1802
|
-
e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await
|
|
1807
|
+
e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Os(s, { recursive: !0, force: !0 }), await X(s, { recursive: !0 }), await Ms(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1803
1808
|
const n = [
|
|
1804
1809
|
"index.html",
|
|
1805
|
-
...await
|
|
1810
|
+
...await Ks("**/*.html", {
|
|
1806
1811
|
cwd: e.dir.src,
|
|
1807
1812
|
onlyFiles: !0,
|
|
1808
1813
|
// The files we are looking for are unlikely to be symbolic links
|
|
@@ -1840,7 +1845,7 @@ async function dn(e, t, i) {
|
|
|
1840
1845
|
})
|
|
1841
1846
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1842
1847
|
}
|
|
1843
|
-
const
|
|
1848
|
+
const Bi = /* @__PURE__ */ new Set([
|
|
1844
1849
|
"chunks",
|
|
1845
1850
|
"components",
|
|
1846
1851
|
"docs",
|
|
@@ -1853,13 +1858,13 @@ const Mi = /* @__PURE__ */ new Set([
|
|
|
1853
1858
|
"collection",
|
|
1854
1859
|
"extras",
|
|
1855
1860
|
"support"
|
|
1856
|
-
]), O = "@arcgis/lumina:buildCdn", le = "cdn",
|
|
1857
|
-
function
|
|
1861
|
+
]), O = "@arcgis/lumina:buildCdn", le = "cdn", _i = "index", Z = "main";
|
|
1862
|
+
function un(e) {
|
|
1858
1863
|
const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
|
|
1859
1864
|
if (a) {
|
|
1860
1865
|
if (i.toLowerCase() !== i)
|
|
1861
1866
|
throw new Error(`Expected CDN namespace to be all lowercase. Received: ${i}`);
|
|
1862
|
-
if (
|
|
1867
|
+
if (Bi.has(i))
|
|
1863
1868
|
throw new Error(
|
|
1864
1869
|
`Namespace name "${i}" is restricted as it collides with a well-known Lumina dist/ folder name or Stencil dist/ folder name.`
|
|
1865
1870
|
);
|
|
@@ -1867,11 +1872,11 @@ function pn(e) {
|
|
|
1867
1872
|
'The "namespace" option in the "build.cdn" is deprecated and will be removed in the next major version.'
|
|
1868
1873
|
);
|
|
1869
1874
|
}
|
|
1870
|
-
const c = i ??
|
|
1875
|
+
const c = i ?? _i;
|
|
1871
1876
|
if (e.provideAssets([
|
|
1872
1877
|
{
|
|
1873
1878
|
type: "dynamic",
|
|
1874
|
-
source: () =>
|
|
1879
|
+
source: () => Ir(e),
|
|
1875
1880
|
destination: `../${a ? c : Z}.css`
|
|
1876
1881
|
}
|
|
1877
1882
|
]), !t)
|
|
@@ -1887,7 +1892,7 @@ function pn(e) {
|
|
|
1887
1892
|
);
|
|
1888
1893
|
return;
|
|
1889
1894
|
}
|
|
1890
|
-
const d = H && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await
|
|
1895
|
+
const d = H && j().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await mn(
|
|
1891
1896
|
e,
|
|
1892
1897
|
c,
|
|
1893
1898
|
s,
|
|
@@ -1895,7 +1900,7 @@ function pn(e) {
|
|
|
1895
1900
|
n,
|
|
1896
1901
|
d
|
|
1897
1902
|
);
|
|
1898
|
-
await
|
|
1903
|
+
await fn(
|
|
1899
1904
|
m,
|
|
1900
1905
|
e,
|
|
1901
1906
|
a ? `${c}.esm` : c,
|
|
@@ -1903,11 +1908,11 @@ function pn(e) {
|
|
|
1903
1908
|
d
|
|
1904
1909
|
);
|
|
1905
1910
|
const f = Date.now();
|
|
1906
|
-
T.info(O, `CDN was built in ${f - l}ms`), r && await
|
|
1911
|
+
T.info(O, `CDN was built in ${f - l}ms`), r && await pn(e, r, `${a ? `${c}.esm` : c}.js`);
|
|
1907
1912
|
}
|
|
1908
1913
|
};
|
|
1909
1914
|
}
|
|
1910
|
-
async function
|
|
1915
|
+
async function mn(e, t, i, s, n, r) {
|
|
1911
1916
|
const a = e.environment;
|
|
1912
1917
|
if (i.minify && r)
|
|
1913
1918
|
throw Error(
|
|
@@ -1930,8 +1935,8 @@ async function un(e, t, i, s, n, r) {
|
|
|
1930
1935
|
* The script's file name will be stripped inside defineCustomElements.
|
|
1931
1936
|
**/
|
|
1932
1937
|
defineCustomElements({resourcesUrl: import.meta.url});
|
|
1933
|
-
${
|
|
1934
|
-
return await
|
|
1938
|
+
${Ei(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
1939
|
+
return await Js({
|
|
1935
1940
|
bundle: !0,
|
|
1936
1941
|
minify: r ? !0 : a === "production",
|
|
1937
1942
|
treeShaking: !0,
|
|
@@ -1956,7 +1961,7 @@ ${Si(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
1956
1961
|
chunkNames: "[hash]",
|
|
1957
1962
|
resolveExtensions: [".js", ".json"],
|
|
1958
1963
|
banner: { js: e.banner },
|
|
1959
|
-
target:
|
|
1964
|
+
target: Ni(e),
|
|
1960
1965
|
...i,
|
|
1961
1966
|
write: !1,
|
|
1962
1967
|
plugins: [
|
|
@@ -2015,8 +2020,8 @@ ${Si(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
|
|
|
2015
2020
|
}
|
|
2016
2021
|
});
|
|
2017
2022
|
}
|
|
2018
|
-
const
|
|
2019
|
-
async function
|
|
2023
|
+
const It = "stdin.js";
|
|
2024
|
+
async function fn(e, t, i, s, n) {
|
|
2020
2025
|
const r = t.dir.distCdn, a = `${i}.js`;
|
|
2021
2026
|
let c;
|
|
2022
2027
|
n && (c = new Set(s.map((p) => `${p.out}.js`)), c.add(a));
|
|
@@ -2028,15 +2033,15 @@ async function mn(e, t, i, s, n) {
|
|
|
2028
2033
|
isAsync: void 0,
|
|
2029
2034
|
oldSingleExportName: void 0
|
|
2030
2035
|
}, f = G(p.path.slice(r.length));
|
|
2031
|
-
if (f ===
|
|
2036
|
+
if (f === It) {
|
|
2032
2037
|
if (n) {
|
|
2033
|
-
const h = p.text.match(
|
|
2038
|
+
const h = p.text.match(gn)?.[0];
|
|
2034
2039
|
if (h === void 0)
|
|
2035
2040
|
throw Error(
|
|
2036
|
-
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${
|
|
2041
|
+
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. ${It} contents:
|
|
2037
2042
|
${p.text}`
|
|
2038
2043
|
);
|
|
2039
|
-
m.code = `${m.code.trimEnd()}${
|
|
2044
|
+
m.code = `${m.code.trimEnd()}${hn(h, s)}`, m.isAsync = !1;
|
|
2040
2045
|
}
|
|
2041
2046
|
return [a, m];
|
|
2042
2047
|
}
|
|
@@ -2046,7 +2051,7 @@ ${p.text}`
|
|
|
2046
2051
|
n && d.forEach((p, m) => {
|
|
2047
2052
|
if (p.isAsync === void 0)
|
|
2048
2053
|
if (m.endsWith(".js")) {
|
|
2049
|
-
if (
|
|
2054
|
+
if (Ki(p, d), c?.has(m) === !0 && p.code.includes(Wi))
|
|
2050
2055
|
throw Error(
|
|
2051
2056
|
b(
|
|
2052
2057
|
O,
|
|
@@ -2066,8 +2071,8 @@ ${p.text}`
|
|
|
2066
2071
|
}
|
|
2067
2072
|
await Promise.all(l.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await K(r + p, m)));
|
|
2068
2073
|
}
|
|
2069
|
-
const
|
|
2070
|
-
function
|
|
2074
|
+
const gn = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2075
|
+
function hn(e, t) {
|
|
2071
2076
|
let i = [
|
|
2072
2077
|
"window.$arcgis",
|
|
2073
2078
|
"||",
|
|
@@ -2108,15 +2113,15 @@ function gn(e, t) {
|
|
|
2108
2113
|
}
|
|
2109
2114
|
return i += ")", i;
|
|
2110
2115
|
}
|
|
2111
|
-
function
|
|
2116
|
+
function Ki(e, t) {
|
|
2112
2117
|
if (e.isProcessing) {
|
|
2113
|
-
e.isAsync = !0,
|
|
2118
|
+
e.isAsync = !0, xt(e);
|
|
2114
2119
|
return;
|
|
2115
2120
|
}
|
|
2116
2121
|
e.isProcessing = !0;
|
|
2117
2122
|
const i = [], s = [], n = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
2118
2123
|
let c = 0;
|
|
2119
|
-
const d = e.code.matchAll(
|
|
2124
|
+
const d = e.code.matchAll(yn);
|
|
2120
2125
|
for (const S of d) {
|
|
2121
2126
|
const [A, L, U, F, N] = S, B = N.startsWith(Le);
|
|
2122
2127
|
if (c !== 0 && c !== S.index) {
|
|
@@ -2124,14 +2129,14 @@ function Bi(e, t) {
|
|
|
2124
2129
|
n.push(D), a.push([c, D.length, 0, ""]);
|
|
2125
2130
|
}
|
|
2126
2131
|
if (c = S.index + A.length, B)
|
|
2127
|
-
a.push([S.index, A.length, 0, ""]), s.push(`"${
|
|
2132
|
+
a.push([S.index, A.length, 0, ""]), s.push(`"${zi(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? F ?? "");
|
|
2128
2133
|
else {
|
|
2129
|
-
const D =
|
|
2134
|
+
const D = Ui(N, t), M = D?.isAsync === !0;
|
|
2130
2135
|
if (L !== void 0) {
|
|
2131
2136
|
const be = [];
|
|
2132
2137
|
for (const Me of L.slice(1, -1).split(",")) {
|
|
2133
|
-
const [
|
|
2134
|
-
M || r.add(
|
|
2138
|
+
const [bt, wt = bt] = Me.split(" as ");
|
|
2139
|
+
M || r.add(wt), be.push(`${bt}:${wt}`);
|
|
2135
2140
|
}
|
|
2136
2141
|
if (M) {
|
|
2137
2142
|
const Me = D.oldSingleExportName === void 0 ? `{${be.join(",")}}` : be[0].split(":")[1];
|
|
@@ -2155,10 +2160,10 @@ ${D.code}`
|
|
|
2155
2160
|
e.isProcessing = !1;
|
|
2156
2161
|
const l = e.isAsync === !0;
|
|
2157
2162
|
if (e.isAsync = l || a.length > 0, !e.isAsync) {
|
|
2158
|
-
e.code =
|
|
2163
|
+
e.code = At(e.code, t);
|
|
2159
2164
|
return;
|
|
2160
2165
|
}
|
|
2161
|
-
const p =
|
|
2166
|
+
const p = wn(r);
|
|
2162
2167
|
let m = e.code.slice(0, c);
|
|
2163
2168
|
for (let S = a.length - 1; S >= 0; S--) {
|
|
2164
2169
|
const [A, L, U, F] = a[S];
|
|
@@ -2169,15 +2174,15 @@ ${D.code}`
|
|
|
2169
2174
|
}
|
|
2170
2175
|
m = m.slice(0, A) + B + m.slice(A + N);
|
|
2171
2176
|
}
|
|
2172
|
-
const [f, g] =
|
|
2177
|
+
const [f, g] = xt(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})`;
|
|
2173
2178
|
let P = e.code.slice(c, f);
|
|
2174
|
-
P = `${n.join("")}${P}`, P =
|
|
2179
|
+
P = `${n.join("")}${P}`, P = At(P, t);
|
|
2175
2180
|
const x = `${m}${w}${P}${E}`;
|
|
2176
2181
|
e.code = x;
|
|
2177
2182
|
}
|
|
2178
|
-
const
|
|
2179
|
-
function
|
|
2180
|
-
const t =
|
|
2183
|
+
const Wi = "export default $arcgis.t(";
|
|
2184
|
+
function xt(e) {
|
|
2185
|
+
const t = vn.exec(e.code), i = t?.index ?? e.code.length;
|
|
2181
2186
|
let s = "";
|
|
2182
2187
|
if (t !== null) {
|
|
2183
2188
|
const n = t[1].split(",");
|
|
@@ -2193,51 +2198,51 @@ function It(e) {
|
|
|
2193
2198
|
}
|
|
2194
2199
|
return [i, s];
|
|
2195
2200
|
}
|
|
2196
|
-
const
|
|
2197
|
-
function
|
|
2201
|
+
const yn = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, vn = /export\{([^}]+)\};\n$/u, Le = "@arcgis/core/";
|
|
2202
|
+
function Ui(e, t) {
|
|
2198
2203
|
if (!e.startsWith("./"))
|
|
2199
2204
|
return;
|
|
2200
2205
|
const i = e.slice(2), s = t.get(i);
|
|
2201
2206
|
if (s === void 0)
|
|
2202
2207
|
throw Error(b(O, `Failed to find the ${e} module`));
|
|
2203
|
-
if (s.isAsync === void 0 &&
|
|
2208
|
+
if (s.isAsync === void 0 && Ki(s, t), s.isAsync === void 0)
|
|
2204
2209
|
throw Error(b(O, `Failed to infer whether the ${e} module has top-level await`));
|
|
2205
2210
|
return s;
|
|
2206
2211
|
}
|
|
2207
|
-
function
|
|
2208
|
-
return e.replaceAll(
|
|
2212
|
+
function At(e, t) {
|
|
2213
|
+
return e.replaceAll(bn, (i, s) => {
|
|
2209
2214
|
if (s.startsWith(Le))
|
|
2210
|
-
return `$arcgis.t(m=>m[0],"${
|
|
2215
|
+
return `$arcgis.t(m=>m[0],"${zi(s.slice(Le.length))}")`;
|
|
2211
2216
|
if (s.startsWith("./")) {
|
|
2212
|
-
const n =
|
|
2217
|
+
const n = Ui(s, t);
|
|
2213
2218
|
if (n?.isAsync === !0)
|
|
2214
2219
|
return `${i}.then(m=>m.default${n.oldSingleExportName === void 0 ? "" : `.then(e=>({${n.oldSingleExportName}:e}))`})`;
|
|
2215
2220
|
}
|
|
2216
2221
|
return i;
|
|
2217
2222
|
});
|
|
2218
2223
|
}
|
|
2219
|
-
const
|
|
2220
|
-
function
|
|
2224
|
+
const bn = /(?<![.\w\d])import\("([^"]+)"\)/gu, zi = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2225
|
+
function wn(e) {
|
|
2221
2226
|
const t = [it];
|
|
2222
2227
|
return () => {
|
|
2223
2228
|
for (; ; ) {
|
|
2224
|
-
const i =
|
|
2225
|
-
if (
|
|
2229
|
+
const i = En(t);
|
|
2230
|
+
if (Tn(t), !e.has(i))
|
|
2226
2231
|
return e.add(i), i;
|
|
2227
2232
|
}
|
|
2228
2233
|
};
|
|
2229
2234
|
}
|
|
2230
|
-
const it = 0,
|
|
2231
|
-
function
|
|
2232
|
-
let t =
|
|
2235
|
+
const it = 0, ft = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Hi = `${ft}0123456789`, Sn = ft.length, Cn = Hi.length;
|
|
2236
|
+
function En(e) {
|
|
2237
|
+
let t = ft[e[0]];
|
|
2233
2238
|
for (let i = 1; i < e.length; ++i)
|
|
2234
|
-
t +=
|
|
2239
|
+
t += Hi[e[i]];
|
|
2235
2240
|
return t;
|
|
2236
2241
|
}
|
|
2237
|
-
function
|
|
2242
|
+
function Tn(e) {
|
|
2238
2243
|
let t = e.length - 1;
|
|
2239
2244
|
for (; t >= 0; ) {
|
|
2240
|
-
const i = t === 0 ?
|
|
2245
|
+
const i = t === 0 ? Sn : Cn;
|
|
2241
2246
|
if (e[t] += 1, e[t] >= i)
|
|
2242
2247
|
e[t] = it, t--;
|
|
2243
2248
|
else
|
|
@@ -2246,10 +2251,10 @@ function En(e) {
|
|
|
2246
2251
|
e.push(it);
|
|
2247
2252
|
}
|
|
2248
2253
|
function De(e = j(), t = !1) {
|
|
2249
|
-
const i = e.name === "@esri/calcite-components", s =
|
|
2254
|
+
const i = e.name === "@esri/calcite-components", s = pt(e) ?? e.version, n = s.includes("next");
|
|
2250
2255
|
if (i && n)
|
|
2251
2256
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${s}/dist/${le}/`;
|
|
2252
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
2257
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = $n(e.name), c = Pn(s);
|
|
2253
2258
|
if (c === void 0)
|
|
2254
2259
|
throw Error(
|
|
2255
2260
|
b(
|
|
@@ -2259,16 +2264,16 @@ function De(e = j(), t = !1) {
|
|
|
2259
2264
|
);
|
|
2260
2265
|
return a === "core" ? `https://${r}/${c}/` : i ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
2261
2266
|
}
|
|
2262
|
-
const
|
|
2263
|
-
function
|
|
2267
|
+
const $n = (e) => e.split("/").pop() ?? e;
|
|
2268
|
+
function Pn(e) {
|
|
2264
2269
|
const t = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)(?<prerelease>-.*)?$/u, i = e.match(t);
|
|
2265
2270
|
if (i?.groups === void 0)
|
|
2266
2271
|
return;
|
|
2267
2272
|
const { major: s, minor: n, patch: r, prerelease: a } = i.groups, c = `${s}.${n}.${r}`;
|
|
2268
2273
|
return a?.startsWith("-next") ? `${c}-next` : c;
|
|
2269
2274
|
}
|
|
2270
|
-
async function
|
|
2271
|
-
const r = t.packageName, { hasCss: a, cdnName: c } = await
|
|
2275
|
+
async function kn(e, t, i, s, n) {
|
|
2276
|
+
const r = t.packageName, { hasCss: a, cdnName: c } = await qi(t.packageLocation) ?? {};
|
|
2272
2277
|
if (i === "cdn") {
|
|
2273
2278
|
const m = t.cdnUrl ?? De(t.packageJson, n);
|
|
2274
2279
|
return [
|
|
@@ -2311,18 +2316,18 @@ async function Pn(e, t, i, s, n) {
|
|
|
2311
2316
|
}
|
|
2312
2317
|
];
|
|
2313
2318
|
}
|
|
2314
|
-
async function
|
|
2319
|
+
async function qi(e) {
|
|
2315
2320
|
const t = u.join(e, "dist"), i = u.basename(e), n = (await ot(t)).filter(
|
|
2316
|
-
(a) => !
|
|
2321
|
+
(a) => !Bi.has(a) && !a.includes(".")
|
|
2317
2322
|
), r = n.find(
|
|
2318
2323
|
(a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
|
|
2319
2324
|
a === i
|
|
2320
2325
|
);
|
|
2321
2326
|
return r === void 0 ? await Promise.all(
|
|
2322
|
-
n.map(async (a) => await
|
|
2323
|
-
).then((a) => a.find(R)) : await
|
|
2327
|
+
n.map(async (a) => await Lt(t, a))
|
|
2328
|
+
).then((a) => a.find(R)) : await Lt(t, r);
|
|
2324
2329
|
}
|
|
2325
|
-
async function
|
|
2330
|
+
async function Lt(e, t) {
|
|
2326
2331
|
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([
|
|
2327
2332
|
_(i),
|
|
2328
2333
|
_(s),
|
|
@@ -2333,8 +2338,8 @@ async function At(e, t) {
|
|
|
2333
2338
|
cdnName: t
|
|
2334
2339
|
} : void 0;
|
|
2335
2340
|
}
|
|
2336
|
-
async function
|
|
2337
|
-
const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await
|
|
2341
|
+
async function In(e, t, i, s, n) {
|
|
2342
|
+
const a = t.packageJson.exports?.[`./${Z}.css`] === void 0 ? await qi(t.packageLocation) : void 0, c = a?.cdnName ?? le, d = a === void 0 ? `${_i}.js` : `${a.cdnName}.esm.js`;
|
|
2338
2343
|
if (i === "cdn")
|
|
2339
2344
|
return {
|
|
2340
2345
|
tag: "script",
|
|
@@ -2343,7 +2348,7 @@ async function kn(e, t, i, s, n) {
|
|
|
2343
2348
|
src: `${t.cdnUrl ?? De(t.packageJson, n)}${d}`
|
|
2344
2349
|
}
|
|
2345
2350
|
};
|
|
2346
|
-
const l =
|
|
2351
|
+
const l = xn(t.packageJson), p = `${t.packageName}/${u.normalize(l)}${Q}`, m = [
|
|
2347
2352
|
`import styles$${s} from "${p}";`,
|
|
2348
2353
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${s}.styleSheet];`
|
|
2349
2354
|
], f = `${t.packageName}/loader`;
|
|
@@ -2362,7 +2367,7 @@ async function kn(e, t, i, s, n) {
|
|
|
2362
2367
|
]
|
|
2363
2368
|
};
|
|
2364
2369
|
}
|
|
2365
|
-
function
|
|
2370
|
+
function xn(e) {
|
|
2366
2371
|
const { exports: t } = e;
|
|
2367
2372
|
if (t === void 0)
|
|
2368
2373
|
throw new Error(
|
|
@@ -2372,21 +2377,21 @@ function In(e) {
|
|
|
2372
2377
|
return s ? s[0] : i.length > 0 ? i[0][0] : `./${Z}.css`;
|
|
2373
2378
|
}
|
|
2374
2379
|
async function oe(e, t) {
|
|
2375
|
-
return t !== void 0 ? await
|
|
2380
|
+
return t !== void 0 ? await Nt(e, t) : (e._loadersCache ??= Nt(e), await e._loadersCache);
|
|
2376
2381
|
}
|
|
2377
|
-
async function
|
|
2382
|
+
async function Nt(e, t) {
|
|
2378
2383
|
const i = e.viteCommand === "build" ? "cdn" : "lazyNpm", s = e.environment === "development", n = t ?? e.viteConfig.base;
|
|
2379
2384
|
let r = 0;
|
|
2380
2385
|
const a = async (m) => (await Promise.all(
|
|
2381
2386
|
m.map(async (f) => {
|
|
2382
2387
|
const g = r++;
|
|
2383
|
-
return f.type === "stencil" ? await
|
|
2388
|
+
return f.type === "stencil" ? await kn(n, f, i, g, s) : f.type === "@arcgis/lumina" ? await In(n, f, i, g, s) : void 0;
|
|
2384
2389
|
})
|
|
2385
2390
|
)).filter(R).flat(), c = await Promise.all([
|
|
2386
2391
|
// This may contain an import map so must be first
|
|
2387
|
-
|
|
2392
|
+
sn(e, n, i, s),
|
|
2388
2393
|
ne.then(a),
|
|
2389
|
-
|
|
2394
|
+
Vi(e).then(a)
|
|
2390
2395
|
]), d = u.join(e.dir.src, "loader.ts"), l = t ?? (i === "cdn" ? `./${e.options.build?.cdn?.namespace ?? le}/` : void 0);
|
|
2391
2396
|
return [
|
|
2392
2397
|
...c.flat(),
|
|
@@ -2405,11 +2410,11 @@ async function Lt(e, t) {
|
|
|
2405
2410
|
}
|
|
2406
2411
|
];
|
|
2407
2412
|
}
|
|
2408
|
-
async function
|
|
2413
|
+
async function Vi(e) {
|
|
2409
2414
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
2410
2415
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
2411
2416
|
t.map(async (i) => {
|
|
2412
|
-
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await
|
|
2417
|
+
const s = typeof i == "string" ? void 0 : i, n = typeof i == "string" ? i : i.name, r = await Ii(n);
|
|
2413
2418
|
if (r === void 0)
|
|
2414
2419
|
throw Error(
|
|
2415
2420
|
b(
|
|
@@ -2424,8 +2429,8 @@ async function Hi(e) {
|
|
|
2424
2429
|
})
|
|
2425
2430
|
).then((i) => i.filter(R)), await e._serveOnlyDependencies);
|
|
2426
2431
|
}
|
|
2427
|
-
const
|
|
2428
|
-
async function
|
|
2432
|
+
const An = "/C:@arcgis/lumina-compiler/testSetupFile", Ln = /^\/C:@arcgis\/lumina-compiler\/testSetupFile/u, We = [An];
|
|
2433
|
+
async function Nn(e) {
|
|
2429
2434
|
if (
|
|
2430
2435
|
/**
|
|
2431
2436
|
* Only import custom element dependencies if we are running in Vitest browser mode.
|
|
@@ -2437,7 +2442,7 @@ async function Ln(e) {
|
|
|
2437
2442
|
*/
|
|
2438
2443
|
!e.apiJsonEnabled
|
|
2439
2444
|
)
|
|
2440
|
-
return
|
|
2445
|
+
return jt(e);
|
|
2441
2446
|
const i = (await oe(e)).map((s, n) => {
|
|
2442
2447
|
if ("javascriptCode" in s)
|
|
2443
2448
|
return s.javascriptCode.join(`
|
|
@@ -2461,18 +2466,18 @@ async function Ln(e) {
|
|
|
2461
2466
|
}).join(`
|
|
2462
2467
|
|
|
2463
2468
|
`);
|
|
2464
|
-
return [
|
|
2469
|
+
return [jt(e), i].join("");
|
|
2465
2470
|
}
|
|
2466
|
-
const
|
|
2471
|
+
const jt = (e) => [e.isInPuppeteerTestBackEnd ? jn : "", Fn].join(""), jn = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
2467
2472
|
setupPuppeteerTest();
|
|
2468
|
-
`,
|
|
2473
|
+
`, Fn = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
2469
2474
|
setupLuminaTest();
|
|
2470
|
-
`,
|
|
2475
|
+
`, Rn = "@arcgis/lumina:generateLoaderTs";
|
|
2471
2476
|
let Ne;
|
|
2472
|
-
function
|
|
2477
|
+
function Dn(e) {
|
|
2473
2478
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2474
|
-
return [
|
|
2475
|
-
name:
|
|
2479
|
+
return [Ws(e.apiExtractorPluginConfig), {
|
|
2480
|
+
name: Rn,
|
|
2476
2481
|
configResolved() {
|
|
2477
2482
|
Ne = `${e.dir.root}src/loader.ts`;
|
|
2478
2483
|
},
|
|
@@ -2487,7 +2492,7 @@ function Rn(e) {
|
|
|
2487
2492
|
id: t
|
|
2488
2493
|
},
|
|
2489
2494
|
async handler() {
|
|
2490
|
-
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise,
|
|
2495
|
+
return e.apiJsonDeferred !== void 0 && await e.apiJsonDeferred.promise, xr(e);
|
|
2491
2496
|
}
|
|
2492
2497
|
},
|
|
2493
2498
|
async handleHotUpdate() {
|
|
@@ -2497,27 +2502,27 @@ function Rn(e) {
|
|
|
2497
2502
|
name: "@arcgis/lumina:generateTestSetupVirtualFile",
|
|
2498
2503
|
load: {
|
|
2499
2504
|
filter: {
|
|
2500
|
-
id:
|
|
2505
|
+
id: Ln
|
|
2501
2506
|
},
|
|
2502
|
-
handler: async () => await
|
|
2507
|
+
handler: async () => await Nn(e)
|
|
2503
2508
|
}
|
|
2504
2509
|
}];
|
|
2505
2510
|
}
|
|
2506
|
-
function
|
|
2511
|
+
function Ft(e) {
|
|
2507
2512
|
const t = e.server.moduleGraph.getModuleById(Ne);
|
|
2508
2513
|
t !== void 0 && e.server.moduleGraph.invalidateModule(t);
|
|
2509
2514
|
}
|
|
2510
|
-
const
|
|
2515
|
+
const Rt = (e) => {
|
|
2511
2516
|
e.server.ws.send({
|
|
2512
2517
|
type: "full-reload",
|
|
2513
2518
|
path: u.join("/", u.relative(e.dir.root, Ne))
|
|
2514
2519
|
});
|
|
2515
2520
|
};
|
|
2516
|
-
function
|
|
2521
|
+
function On(e) {
|
|
2517
2522
|
let t;
|
|
2518
2523
|
const i = () => [
|
|
2519
2524
|
...e.options.assets?.transformers ?? [],
|
|
2520
|
-
...
|
|
2525
|
+
...ut
|
|
2521
2526
|
];
|
|
2522
2527
|
return {
|
|
2523
2528
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
@@ -2536,38 +2541,38 @@ function Dn(e) {
|
|
|
2536
2541
|
* `configureServer`.
|
|
2537
2542
|
*/
|
|
2538
2543
|
configResolved() {
|
|
2539
|
-
e.viteCommand === "serve" && (t =
|
|
2544
|
+
e.viteCommand === "serve" && (t = Dt(e));
|
|
2540
2545
|
},
|
|
2541
2546
|
options() {
|
|
2542
|
-
e.viteCommand === "build" && (t =
|
|
2547
|
+
e.viteCommand === "build" && (t = Dt(e));
|
|
2543
2548
|
},
|
|
2544
2549
|
async configureServer(s) {
|
|
2545
2550
|
e.server = s, ie(e, await t, i()), s.watcher.on("addDir", (n) => {
|
|
2546
2551
|
if (n.endsWith("assets")) {
|
|
2547
2552
|
const r = u.dirname(n);
|
|
2548
|
-
u.join(r, "/") === e.dir.root ? ie(e, [
|
|
2553
|
+
u.join(r, "/") === e.dir.root ? ie(e, [Xi], i()) : n.startsWith(e.dir.srcComponents) && ie(e, [Gi(n, r)], i());
|
|
2549
2554
|
}
|
|
2550
2555
|
});
|
|
2551
2556
|
},
|
|
2552
2557
|
async writeBundle() {
|
|
2553
|
-
await
|
|
2558
|
+
await ji(e, await t, i());
|
|
2554
2559
|
}
|
|
2555
2560
|
};
|
|
2556
2561
|
}
|
|
2557
|
-
async function
|
|
2562
|
+
async function Dt(e) {
|
|
2558
2563
|
const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2559
2564
|
i.map(async (n) => {
|
|
2560
2565
|
const r = u.dirname(n), a = u.join(r, "assets");
|
|
2561
|
-
return await _(a) ?
|
|
2566
|
+
return await _(a) ? Gi(a, r) : void 0;
|
|
2562
2567
|
})
|
|
2563
2568
|
);
|
|
2564
|
-
return await t && s.push(
|
|
2569
|
+
return await t && s.push(Xi), s.filter(R);
|
|
2565
2570
|
}
|
|
2566
|
-
const
|
|
2571
|
+
const Gi = (e, t) => ({
|
|
2567
2572
|
type: "directory",
|
|
2568
2573
|
source: e,
|
|
2569
2574
|
destination: u.basename(t)
|
|
2570
|
-
}),
|
|
2575
|
+
}), Xi = { type: "directory", source: "assets/", destination: "" }, Ue = "@arcgis/lumina:printTotalBuildSize", Mn = (e) => ({
|
|
2571
2576
|
name: Ue,
|
|
2572
2577
|
apply: () => e.viteCommand === "build",
|
|
2573
2578
|
configResolved(t) {
|
|
@@ -2586,10 +2591,10 @@ const qi = (e, t) => ({
|
|
|
2586
2591
|
const m = console.log;
|
|
2587
2592
|
console.log = function(...g) {
|
|
2588
2593
|
if (m.apply(console, g), g.length === 1 && typeof g[0] == "string") {
|
|
2589
|
-
const [h, y] = g[0].match(
|
|
2594
|
+
const [h, y] = g[0].match(Bn) ?? [];
|
|
2590
2595
|
if (!h)
|
|
2591
2596
|
return;
|
|
2592
|
-
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(
|
|
2597
|
+
p || (p = g[0].slice(0, g[0].indexOf(h) + h.length).replaceAll(_n, "").length);
|
|
2593
2598
|
const v = Number.parseFloat(h.replace(" kB", "").replaceAll(",", ""));
|
|
2594
2599
|
y ? (l += Number.parseFloat(y.replace(" kB", "").replaceAll(",", "")), d += v) : c += v;
|
|
2595
2600
|
}
|
|
@@ -2600,34 +2605,34 @@ const qi = (e, t) => ({
|
|
|
2600
2605
|
console.log = m;
|
|
2601
2606
|
}
|
|
2602
2607
|
if (d > 0) {
|
|
2603
|
-
const g = l > 0 ? d : c, h =
|
|
2608
|
+
const g = l > 0 ? d : c, h = Jt(g), y = e.dir.relativeDist;
|
|
2604
2609
|
console.log(
|
|
2605
2610
|
[
|
|
2606
|
-
|
|
2611
|
+
Mt,
|
|
2607
2612
|
y,
|
|
2608
|
-
|
|
2613
|
+
Jn,
|
|
2609
2614
|
"*",
|
|
2610
2615
|
" ".repeat(p - `${y}*`.length - h.length),
|
|
2611
2616
|
h,
|
|
2612
|
-
|
|
2613
|
-
l > 0 ? ` ${
|
|
2617
|
+
Ot,
|
|
2618
|
+
l > 0 ? ` ${Mt}│ gzip: ${Jt(l)}${Ot}` : ""
|
|
2614
2619
|
].join("")
|
|
2615
2620
|
);
|
|
2616
2621
|
}
|
|
2617
2622
|
};
|
|
2618
2623
|
}
|
|
2619
|
-
}),
|
|
2624
|
+
}), Ot = "\x1B[22m\x1B[1m\x1B[22m", Mt = "\x1B[2m", Jn = "\x1B[22m\x1B[36m", Bn = /\d+(?:,\d+)?\.\d{2} kB/gu, _n = /\x1B\[\d+m/gu, Kn = new Intl.NumberFormat("en", {
|
|
2620
2625
|
maximumFractionDigits: 2,
|
|
2621
2626
|
minimumFractionDigits: 2
|
|
2622
|
-
}),
|
|
2623
|
-
name:
|
|
2627
|
+
}), Jt = (e) => `${Kn.format(e)} kB`, Wn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", mt.slice(0, -3))), Bt = "@arcgis/lumina:configureVite", Un = (e) => ({
|
|
2628
|
+
name: Bt,
|
|
2624
2629
|
async config({
|
|
2625
2630
|
server: t,
|
|
2626
2631
|
publicDir: i,
|
|
2627
2632
|
build: { cssMinify: s, target: n, sourcemap: r, lib: a, rollupOptions: { output: c = [] } = {}, watch: d, emptyOutDir: l } = {},
|
|
2628
2633
|
test: p = {}
|
|
2629
2634
|
}, m) {
|
|
2630
|
-
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && te &&
|
|
2635
|
+
const f = d != null, { include: g, browser: h, environment: y, forceRerunTriggers: v } = p, w = H && te && Li(m) ? ri(Ai, import.meta.dirname) : void 0, C = w === void 0 ? [] : [
|
|
2631
2636
|
G(u.join(w, "**/*.{ts,tsx,mjs}")),
|
|
2632
2637
|
`!${G(u.join(w, "**/*.d.ts"))}`
|
|
2633
2638
|
], E = {
|
|
@@ -2757,7 +2762,7 @@ const qi = (e, t) => ({
|
|
|
2757
2762
|
if (typeof p.setupFiles == "string" ? p.setupFiles = [...We, p.setupFiles] : Array.isArray(p.setupFiles) ? p.setupFiles = [...We, ...p.setupFiles] : p.setupFiles = [...We], e.isInPuppeteerTestBackEnd) {
|
|
2758
2763
|
if (h?.enabled === !0)
|
|
2759
2764
|
throw Error(
|
|
2760
|
-
b(
|
|
2765
|
+
b(Bt, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
2761
2766
|
);
|
|
2762
2767
|
return {
|
|
2763
2768
|
test: {
|
|
@@ -2791,7 +2796,7 @@ const qi = (e, t) => ({
|
|
|
2791
2796
|
publicDir: i ?? !1,
|
|
2792
2797
|
build: {
|
|
2793
2798
|
cssMinify: s ?? (e.environment === "production" ? !0 : void 0),
|
|
2794
|
-
target: n ??
|
|
2799
|
+
target: n ?? Ni(e),
|
|
2795
2800
|
sourcemap: r ?? (e.environment === "development" ? "inline" : e.options.build?.enableSourceMapsInProduction ?? !1),
|
|
2796
2801
|
lib: {
|
|
2797
2802
|
entry: E,
|
|
@@ -2856,15 +2861,15 @@ const qi = (e, t) => ({
|
|
|
2856
2861
|
e._originalRollupInputOptions ??= t.input;
|
|
2857
2862
|
const s = { ...e._originalRollupInputOptions };
|
|
2858
2863
|
i.forEach((n) => {
|
|
2859
|
-
const r =
|
|
2864
|
+
const r = Wn(n);
|
|
2860
2865
|
s[r] = n;
|
|
2861
2866
|
}), t.input = s;
|
|
2862
2867
|
}
|
|
2863
|
-
}), Se = "@arcgis/lumina:serveLocalCdn",
|
|
2868
|
+
}), Se = "@arcgis/lumina:serveLocalCdn", zn = /^\/?@arcgis\/core(?=\/|$)/u, Yi = "/index.js", Hn = je(Yi), st = `\0${Se}:index`, qn = je(st), Vn = 3e3, Gn = [
|
|
2864
2869
|
/^https?:\/\/localhost(?::[0-9]+)?$/u,
|
|
2865
2870
|
/^https?:\/\/(?:[a-z0-9-]+\.)*(?:arcgis|esri)\.com(?::[0-9]+)?$/iu
|
|
2866
2871
|
];
|
|
2867
|
-
function
|
|
2872
|
+
function Xn(e) {
|
|
2868
2873
|
if (!H)
|
|
2869
2874
|
return;
|
|
2870
2875
|
const t = j().name, i = t.split("/").pop() ?? t, s = `/${i}/index.js`, n = je(s), r = `\0${Se}:${i}`, a = je(r);
|
|
@@ -2872,49 +2877,49 @@ function Gn(e) {
|
|
|
2872
2877
|
name: Se,
|
|
2873
2878
|
enforce: "pre",
|
|
2874
2879
|
apply(c) {
|
|
2875
|
-
const d =
|
|
2880
|
+
const d = Zn(e, c);
|
|
2876
2881
|
return d || (e._localCdnCore = void 0), d;
|
|
2877
2882
|
},
|
|
2878
2883
|
config: {
|
|
2879
2884
|
order: "post",
|
|
2880
2885
|
handler(c, d) {
|
|
2881
|
-
const l = c.server, p =
|
|
2886
|
+
const l = c.server, p = Li(d), m = p ? Ai : Yr, f = ri(m, import.meta.dirname);
|
|
2882
2887
|
if (f === void 0)
|
|
2883
2888
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2884
2889
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
2885
2890
|
server: {
|
|
2886
|
-
port: l?.port ??
|
|
2887
|
-
cors: l?.cors ?? { origin:
|
|
2891
|
+
port: l?.port ?? Vn,
|
|
2892
|
+
cors: l?.cors ?? { origin: Gn }
|
|
2888
2893
|
},
|
|
2889
2894
|
resolve: {
|
|
2890
2895
|
// The alias also matches CDN-rooted requests such as /@arcgis/core/WebMap.js. Vite resolves .js requests
|
|
2891
2896
|
// to TypeScript in source mode and handles relative and bare imports from the resulting filesystem path.
|
|
2892
|
-
alias: [{ find:
|
|
2897
|
+
alias: [{ find: zn, replacement: f }]
|
|
2893
2898
|
}
|
|
2894
2899
|
};
|
|
2895
2900
|
}
|
|
2896
2901
|
},
|
|
2897
2902
|
resolveId: {
|
|
2898
|
-
filter: { id: [
|
|
2903
|
+
filter: { id: [Hn, n] },
|
|
2899
2904
|
handler(c) {
|
|
2900
|
-
if (c ===
|
|
2905
|
+
if (c === Yi)
|
|
2901
2906
|
return st;
|
|
2902
2907
|
if (c === s)
|
|
2903
2908
|
return r;
|
|
2904
2909
|
}
|
|
2905
2910
|
},
|
|
2906
2911
|
load: {
|
|
2907
|
-
filter: { id: [
|
|
2912
|
+
filter: { id: [qn, a] },
|
|
2908
2913
|
async handler(c) {
|
|
2909
2914
|
if (c === st)
|
|
2910
2915
|
return `import ${JSON.stringify(s)};
|
|
2911
2916
|
`;
|
|
2912
2917
|
if (c === r)
|
|
2913
|
-
return await
|
|
2918
|
+
return await Qn(e);
|
|
2914
2919
|
}
|
|
2915
2920
|
},
|
|
2916
2921
|
handleHotUpdate({ file: c, server: d }) {
|
|
2917
|
-
if (
|
|
2922
|
+
if (Yn(c, e._localCdnCore?.sourceLocation))
|
|
2918
2923
|
return d.ws.send({ type: "full-reload" }), [];
|
|
2919
2924
|
}
|
|
2920
2925
|
};
|
|
@@ -2922,30 +2927,30 @@ function Gn(e) {
|
|
|
2922
2927
|
function je(e) {
|
|
2923
2928
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2924
2929
|
}
|
|
2925
|
-
function
|
|
2930
|
+
function Yn(e, t) {
|
|
2926
2931
|
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2927
2932
|
}
|
|
2928
|
-
async function
|
|
2933
|
+
async function Qn(e) {
|
|
2929
2934
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2930
2935
|
return `${(await oe(e, `${i}/`)).flatMap((n) => "javascriptCode" in n ? n.javascriptCode : []).join(`
|
|
2931
2936
|
`)}
|
|
2932
2937
|
`;
|
|
2933
2938
|
}
|
|
2934
|
-
function
|
|
2939
|
+
function Zn(e, t) {
|
|
2935
2940
|
return te && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2936
2941
|
}
|
|
2937
|
-
const
|
|
2942
|
+
const eo = (e) => ({
|
|
2938
2943
|
name: "@arcgis/lumina:setAssetPath",
|
|
2939
2944
|
apply: () => e.viteCommand === "build",
|
|
2940
2945
|
config: (t) => ({
|
|
2941
2946
|
base: t.base ?? e.options.assets?.defaultPath ?? De()
|
|
2942
2947
|
})
|
|
2943
2948
|
});
|
|
2944
|
-
function
|
|
2945
|
-
const t = e
|
|
2946
|
-
return
|
|
2949
|
+
function to(e = j()) {
|
|
2950
|
+
const t = pt(e) ?? "0.0.1";
|
|
2951
|
+
return Ss(t);
|
|
2947
2952
|
}
|
|
2948
|
-
const
|
|
2953
|
+
const io = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2949
2954
|
Object.defineProperty(t, i, {
|
|
2950
2955
|
get() {
|
|
2951
2956
|
throw Error(
|
|
@@ -2984,8 +2989,8 @@ const ue = {
|
|
|
2984
2989
|
apiJson: "docs/api.json",
|
|
2985
2990
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2986
2991
|
}, rt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2987
|
-
async function
|
|
2988
|
-
const s =
|
|
2992
|
+
async function Qi(e, t, i = j()) {
|
|
2993
|
+
const s = so(e, i), n = u.join(t, "lumina.ts"), a = await _(n) ? await z(n, "utf8") : "";
|
|
2989
2994
|
if (a.trim().replaceAll(`\r
|
|
2990
2995
|
`, `
|
|
2991
2996
|
`) === s.trim())
|
|
@@ -3003,9 +3008,9 @@ Current content:
|
|
|
3003
3008
|
${a}`
|
|
3004
3009
|
)
|
|
3005
3010
|
);
|
|
3006
|
-
return
|
|
3011
|
+
return ai(n, s), !0;
|
|
3007
3012
|
}
|
|
3008
|
-
function
|
|
3013
|
+
function so(e, t = j()) {
|
|
3009
3014
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3010
3015
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), n = s.map(
|
|
3011
3016
|
(d, l) => `
|
|
@@ -3016,7 +3021,7 @@ declare module "@arcgis/lumina" {
|
|
|
3016
3021
|
interface ImportStencilElements extends ${s.map((d, l) => `JSX$${l}.IntrinsicElements`).join(", ")} {}
|
|
3017
3022
|
}`, a = t.devDependencies ?? {};
|
|
3018
3023
|
return [
|
|
3019
|
-
|
|
3024
|
+
ro,
|
|
3020
3025
|
a.vitest ? `
|
|
3021
3026
|
/// <reference types="vitest/config" />
|
|
3022
3027
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3027,7 +3032,7 @@ declare module "@arcgis/lumina" {
|
|
|
3027
3032
|
`
|
|
3028
3033
|
].join("");
|
|
3029
3034
|
}
|
|
3030
|
-
const
|
|
3035
|
+
const ro = `/**
|
|
3031
3036
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3032
3037
|
* Manual edits will be overwritten.
|
|
3033
3038
|
*
|
|
@@ -3035,7 +3040,7 @@ const so = `/**
|
|
|
3035
3040
|
*
|
|
3036
3041
|
* If you need to provide additional types, create a separate file.
|
|
3037
3042
|
*/
|
|
3038
|
-
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport",
|
|
3043
|
+
/// <reference types="@arcgis/lumina/globalTypes" />`, Ce = "@arcgis/lumina:dependencySupport", Zi = (e, t) => e.viteCommand === "serve" && /**
|
|
3039
3044
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
3040
3045
|
* However, it is a bit buggy (see
|
|
3041
3046
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -3046,13 +3051,13 @@ const so = `/**
|
|
|
3046
3051
|
* is doing:
|
|
3047
3052
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3048
3053
|
*/
|
|
3049
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
3054
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, no = (e) => ({
|
|
3050
3055
|
name: Ce,
|
|
3051
3056
|
async configureServer(t) {
|
|
3052
|
-
H && (e.server = t, await
|
|
3057
|
+
H && (e.server = t, await nn(e));
|
|
3053
3058
|
},
|
|
3054
3059
|
configResolved() {
|
|
3055
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3060
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = oo(e).catch(
|
|
3056
3061
|
(t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3057
3062
|
));
|
|
3058
3063
|
},
|
|
@@ -3060,7 +3065,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3060
3065
|
// Add imports to index.html before Vite starts resolving imports
|
|
3061
3066
|
order: "pre",
|
|
3062
3067
|
async handler(t, i) {
|
|
3063
|
-
return
|
|
3068
|
+
return Zi(e, i) ? (await oe(e)).map(
|
|
3064
3069
|
(n) => "javascriptCode" in n ? {
|
|
3065
3070
|
tag: "script",
|
|
3066
3071
|
attrs: {
|
|
@@ -3102,26 +3107,26 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3102
3107
|
await e._updateLuminaTsPromise;
|
|
3103
3108
|
}
|
|
3104
3109
|
});
|
|
3105
|
-
async function
|
|
3106
|
-
const i = (await Promise.all([ne,
|
|
3107
|
-
if (!await
|
|
3110
|
+
async function oo(e) {
|
|
3111
|
+
const i = (await Promise.all([ne, Vi(e)])).flat();
|
|
3112
|
+
if (!await Qi(i, e.dir.src))
|
|
3108
3113
|
return;
|
|
3109
3114
|
let n = !1;
|
|
3110
3115
|
function r() {
|
|
3111
|
-
n || T.warn(Ce,
|
|
3116
|
+
n || T.warn(Ce, ao), n = !0;
|
|
3112
3117
|
}
|
|
3113
3118
|
process.on("exit", () => {
|
|
3114
3119
|
r(), clearTimeout(c);
|
|
3115
3120
|
});
|
|
3116
3121
|
const c = setTimeout(r, 2e3);
|
|
3117
3122
|
}
|
|
3118
|
-
const
|
|
3123
|
+
const ao = Us(
|
|
3119
3124
|
"greenBright",
|
|
3120
3125
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3121
3126
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3122
3127
|
);
|
|
3123
|
-
async function
|
|
3124
|
-
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await
|
|
3128
|
+
async function co(e) {
|
|
3129
|
+
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Hs(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : Tt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
3125
3130
|
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([
|
|
3126
3131
|
{
|
|
3127
3132
|
type: "dynamic",
|
|
@@ -3129,7 +3134,7 @@ async function ao(e) {
|
|
|
3129
3134
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
3130
3135
|
}
|
|
3131
3136
|
]);
|
|
3132
|
-
const s = i?.types?.typeScriptConfig ??
|
|
3137
|
+
const s = i?.types?.typeScriptConfig ?? qs(
|
|
3133
3138
|
process.cwd(),
|
|
3134
3139
|
e.options.types?.tsconfigPath ?? i?.types?.typeScriptConfigPath,
|
|
3135
3140
|
!0
|
|
@@ -3175,7 +3180,7 @@ async function ao(e) {
|
|
|
3175
3180
|
if ([...p.addedModules, ...p.removedModules].some(
|
|
3176
3181
|
(f) => Pe(f.sourcePath, "src/components/")
|
|
3177
3182
|
))
|
|
3178
|
-
|
|
3183
|
+
Ft(e), Rt(e);
|
|
3179
3184
|
else {
|
|
3180
3185
|
for (const f of p.changedModules) {
|
|
3181
3186
|
if (!Pe(f.new.sourcePath, "src/components/"))
|
|
@@ -3188,29 +3193,29 @@ async function ao(e) {
|
|
|
3188
3193
|
if (g === void 0 && h === void 0)
|
|
3189
3194
|
continue;
|
|
3190
3195
|
if (g !== void 0 && h === void 0 || g === void 0 && h !== void 0 || g.tagName !== h.tagName || g.formAssociated !== h.formAssociated) {
|
|
3191
|
-
|
|
3196
|
+
Rt(e);
|
|
3192
3197
|
break;
|
|
3193
3198
|
}
|
|
3194
|
-
const y =
|
|
3199
|
+
const y = Ti(h);
|
|
3195
3200
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: y });
|
|
3196
3201
|
}
|
|
3197
|
-
|
|
3202
|
+
Ft(e);
|
|
3198
3203
|
}
|
|
3199
|
-
|
|
3204
|
+
_t(e, p.apiJson);
|
|
3200
3205
|
}
|
|
3201
3206
|
}
|
|
3202
3207
|
},
|
|
3203
3208
|
afterApiJsonCreate: (l) => {
|
|
3204
|
-
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(),
|
|
3209
|
+
e.options.apiJson?.afterCreate?.(l.apiJson, !r), r = !0, (e.viteCommand === "build" ? e.viteConfig.build.watch : e.viteConfig.server.watch) === null && (e.apiJsonDeferred.resolve(), _t(e, l.apiJson));
|
|
3205
3210
|
}
|
|
3206
|
-
}, c = i === void 0 ? a :
|
|
3211
|
+
}, c = i === void 0 ? a : Tt(i, a);
|
|
3207
3212
|
e.apiExtractorPluginConfig.configFilePath = "", e.apiExtractorPluginConfig.unsafeConfigOverride = c;
|
|
3208
3213
|
const d = e.apiExtractorPluginConfig.afterExtractorCreated;
|
|
3209
3214
|
e.apiExtractorPluginConfig.afterExtractorCreated = (l) => {
|
|
3210
3215
|
e.apiExtractor = l, d?.(l);
|
|
3211
3216
|
};
|
|
3212
3217
|
}
|
|
3213
|
-
function
|
|
3218
|
+
function _t(e, t) {
|
|
3214
3219
|
const i = { ...t, modules: [] }, s = [], n = e.viteCommand === "build" ? [] : void 0;
|
|
3215
3220
|
for (const r of t.modules) {
|
|
3216
3221
|
const a = { ...r, declarations: [] };
|
|
@@ -3235,10 +3240,10 @@ function Bt(e, t) {
|
|
|
3235
3240
|
}
|
|
3236
3241
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, n !== void 0 && (e.componentFilesPromise = Promise.resolve(n));
|
|
3237
3242
|
}
|
|
3238
|
-
var
|
|
3243
|
+
var lo = Object.defineProperty, I = (e, t, i, s) => {
|
|
3239
3244
|
for (var n = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
3240
3245
|
(a = e[r]) && (n = a(t, i, n) || n);
|
|
3241
|
-
return n &&
|
|
3246
|
+
return n && lo(t, i, n), n;
|
|
3242
3247
|
};
|
|
3243
3248
|
const V = "@arcgis/lumina:context";
|
|
3244
3249
|
class $ {
|
|
@@ -3264,7 +3269,7 @@ class $ {
|
|
|
3264
3269
|
distComponents: f,
|
|
3265
3270
|
distCdn: g,
|
|
3266
3271
|
distCdnAssets: h
|
|
3267
|
-
}, T.initialize(r.logger, c), r.root !==
|
|
3272
|
+
}, T.initialize(r.logger, c), r.root !== si())
|
|
3268
3273
|
throw Error(
|
|
3269
3274
|
b(
|
|
3270
3275
|
V,
|
|
@@ -3283,11 +3288,11 @@ class $ {
|
|
|
3283
3288
|
extract: !0
|
|
3284
3289
|
}, (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);
|
|
3285
3290
|
const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
|
|
3286
|
-
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter =
|
|
3291
|
+
C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = zs({
|
|
3287
3292
|
// Do not downlevel. ESBuild will do that if needed.
|
|
3288
3293
|
target: o.ScriptTarget.ESNext,
|
|
3289
3294
|
sourceMap: r.build.sourcemap !== !1
|
|
3290
|
-
}),
|
|
3295
|
+
}), Zi(this) && oe(this);
|
|
3291
3296
|
}
|
|
3292
3297
|
},
|
|
3293
3298
|
configureServer: {
|
|
@@ -3315,7 +3320,7 @@ class $ {
|
|
|
3315
3320
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3316
3321
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3317
3322
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3318
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3323
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = co(this);
|
|
3319
3324
|
const s = process.cwd().length + 1;
|
|
3320
3325
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3321
3326
|
const r = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3324,12 +3329,12 @@ class $ {
|
|
|
3324
3329
|
Pe(l, "src/components") && a.push(l);
|
|
3325
3330
|
}
|
|
3326
3331
|
return a;
|
|
3327
|
-
}),
|
|
3328
|
-
const n = t.build?.preamble ??
|
|
3329
|
-
this.banner =
|
|
3332
|
+
}), Pi(void 0, t);
|
|
3333
|
+
const n = t.build?.preamble ?? to();
|
|
3334
|
+
this.banner = io(n);
|
|
3330
3335
|
}
|
|
3331
3336
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3332
|
-
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(
|
|
3337
|
+
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($i.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
3333
3338
|
const n = s?.__IS_IN_PUPPETEER__ === !0, r = this.viteCommand === "serve" && this.isInTest && this.options.puppeteerTesting?.enabled === !0;
|
|
3334
3339
|
this.isInPuppeteerTestBackEnd = r && !n, this.isInPuppeteerTestFrontEnd = r && n;
|
|
3335
3340
|
}
|
|
@@ -3477,8 +3482,8 @@ I([
|
|
|
3477
3482
|
I([
|
|
3478
3483
|
k("configResolved()")
|
|
3479
3484
|
], $.prototype, "_typeScriptPrinter");
|
|
3480
|
-
function
|
|
3481
|
-
const s =
|
|
3485
|
+
function po(e, t, i) {
|
|
3486
|
+
const s = ki()[t] ?? es(e)[t];
|
|
3482
3487
|
if (s === void 0) {
|
|
3483
3488
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
3484
3489
|
return;
|
|
@@ -3492,11 +3497,11 @@ function lo(e, t, i) {
|
|
|
3492
3497
|
}
|
|
3493
3498
|
return s;
|
|
3494
3499
|
}
|
|
3495
|
-
function
|
|
3500
|
+
function uo(e, t) {
|
|
3496
3501
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3497
3502
|
}
|
|
3498
|
-
function
|
|
3499
|
-
return e._localDefinedComponents ??=
|
|
3503
|
+
function es(e) {
|
|
3504
|
+
return e._localDefinedComponents ??= xi(
|
|
3500
3505
|
e.privateApiJson,
|
|
3501
3506
|
{
|
|
3502
3507
|
packageName: void 0,
|
|
@@ -3507,19 +3512,19 @@ function Qi(e) {
|
|
|
3507
3512
|
e.viteCommand === "build"
|
|
3508
3513
|
), e._localDefinedComponents;
|
|
3509
3514
|
}
|
|
3510
|
-
const
|
|
3511
|
-
name:
|
|
3515
|
+
const Kt = "makeRuntime(", mo = "@arcgis/core", fo = "@arcgis/lumina:injectRuntimeOptions", go = (e) => ({
|
|
3516
|
+
name: fo,
|
|
3512
3517
|
transform: {
|
|
3513
3518
|
filter: {
|
|
3514
3519
|
id: /\/src\/runtime\.ts$/u
|
|
3515
3520
|
},
|
|
3516
3521
|
handler(t, i) {
|
|
3517
|
-
const s = t.indexOf(
|
|
3522
|
+
const s = t.indexOf(Kt);
|
|
3518
3523
|
if (s === -1)
|
|
3519
3524
|
throw new Error(
|
|
3520
3525
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3521
3526
|
);
|
|
3522
|
-
const n = s +
|
|
3527
|
+
const n = s + Kt.length, r = e.options.css?.commonStylesPath;
|
|
3523
3528
|
return {
|
|
3524
3529
|
code: [
|
|
3525
3530
|
r === void 0 ? "" : `import commonStyles from "${he(e.dir.src, r)}${Ie}";`,
|
|
@@ -3527,7 +3532,7 @@ const _t = "makeRuntime(", uo = "@arcgis/core", mo = "@arcgis/lumina:injectRunti
|
|
|
3527
3532
|
"{",
|
|
3528
3533
|
"defaultAssetPath:import.meta.env.BASE_URL,",
|
|
3529
3534
|
'hydratedAttribute:"',
|
|
3530
|
-
e.options.css?.hydratedAttribute ??
|
|
3535
|
+
e.options.css?.hydratedAttribute ?? Ci,
|
|
3531
3536
|
'",',
|
|
3532
3537
|
r === void 0 ? "" : "commonStyles",
|
|
3533
3538
|
"}",
|
|
@@ -3535,7 +3540,7 @@ const _t = "makeRuntime(", uo = "@arcgis/core", mo = "@arcgis/lumina:injectRunti
|
|
|
3535
3540
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3536
3541
|
// a cyclical dependency.
|
|
3537
3542
|
H ? `
|
|
3538
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3543
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${mo}/applications/Components/reactiveUtils.js";
|
|
3539
3544
|
createObservable,
|
|
3540
3545
|
runtime.t = trackAccess;
|
|
3541
3546
|
runtime.o = createObservable;
|
|
@@ -3547,11 +3552,11 @@ runtime.r = runTracked;` : ""
|
|
|
3547
3552
|
}
|
|
3548
3553
|
}
|
|
3549
3554
|
});
|
|
3550
|
-
function
|
|
3555
|
+
function ho(e) {
|
|
3551
3556
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${le}/${Z}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3552
3557
|
`;
|
|
3553
3558
|
}
|
|
3554
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3559
|
+
const we = "@arcgis/lumina:addNonLazyImports", yo = (e) => ({
|
|
3555
3560
|
name: we,
|
|
3556
3561
|
apply: () => e.viteCommand === "build",
|
|
3557
3562
|
generateBundle(t, i) {
|
|
@@ -3563,7 +3568,7 @@ const we = "@arcgis/lumina:addNonLazyImports", ho = (e) => ({
|
|
|
3563
3568
|
if (d !== a && (c.fileName = d), c.type === "chunk") {
|
|
3564
3569
|
const l = u.dirname(u.join(e.dir.dist, a)), p = d === a ? l : u.dirname(u.join(e.dir.dist, d));
|
|
3565
3570
|
let m = c.code;
|
|
3566
|
-
m =
|
|
3571
|
+
m = dn(m, e, p, l), !e.isInStorybook && d === "chunks/runtime.js" && (r = !0, m = ho(e) + m), m = `${e.banner}${n}${m}`, c.code = m;
|
|
3567
3572
|
}
|
|
3568
3573
|
}), !r && !e.isInStorybook)
|
|
3569
3574
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3577,7 +3582,7 @@ const we = "@arcgis/lumina:addNonLazyImports", ho = (e) => ({
|
|
|
3577
3582
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
3578
3583
|
if (s.has(r) || a.length === 0 && c.length === 0)
|
|
3579
3584
|
return;
|
|
3580
|
-
const l =
|
|
3585
|
+
const l = ts(t, d, s);
|
|
3581
3586
|
if (l.forEach((p) => {
|
|
3582
3587
|
t[p].referencedTagNames.splice(0, 0, ...a), t[p].referencedDeferredTagNames.splice(0, 0, ...c);
|
|
3583
3588
|
}), (a.length > 0 || c.length > 0) && l.length === 0) {
|
|
@@ -3600,12 +3605,12 @@ Possible causes:
|
|
|
3600
3605
|
return [];
|
|
3601
3606
|
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);
|
|
3602
3607
|
function m(P) {
|
|
3603
|
-
const x =
|
|
3608
|
+
const x = po(e, P, r);
|
|
3604
3609
|
if (x === void 0)
|
|
3605
3610
|
return;
|
|
3606
|
-
const S =
|
|
3611
|
+
const S = uo(x, p);
|
|
3607
3612
|
if (S !== `./${p}`)
|
|
3608
|
-
return S.startsWith(".") ? `${S}/${
|
|
3613
|
+
return S.startsWith(".") ? `${S}/${Wt}` : S;
|
|
3609
3614
|
}
|
|
3610
3615
|
const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(R), y = (P) => `import "${P}";
|
|
3611
3616
|
`, v = h.map(y).join(""), w = Array.from(g, (P) => {
|
|
@@ -3621,15 +3626,15 @@ Possible causes:
|
|
|
3621
3626
|
return `.set("${P}", () => import("${x}"))
|
|
3622
3627
|
`;
|
|
3623
3628
|
}
|
|
3624
|
-
}).filter(R), C = `${v}export * from "./${
|
|
3629
|
+
}).filter(R), C = `${v}export * from "./${mt}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3625
3630
|
${C}
|
|
3626
3631
|
deferredLoaders${w.join("")};` : C;
|
|
3627
|
-
return await K(u.join(e.dir.dist, p,
|
|
3632
|
+
return await K(u.join(e.dir.dist, p, Wt), E);
|
|
3628
3633
|
});
|
|
3629
3634
|
await Promise.all(n);
|
|
3630
3635
|
}
|
|
3631
|
-
}),
|
|
3632
|
-
function
|
|
3636
|
+
}), Wt = "index.js", ts = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((n) => i.has(n) ? [n] : s.has(n) ? [] : (s.add(n), ts(e, e[n].referencedBy, i, s)));
|
|
3637
|
+
function Ut(e, t, i) {
|
|
3633
3638
|
if (ee(e))
|
|
3634
3639
|
return e;
|
|
3635
3640
|
{
|
|
@@ -3648,14 +3653,14 @@ function ee(e) {
|
|
|
3648
3653
|
return (
|
|
3649
3654
|
// Inlined string literal
|
|
3650
3655
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3651
|
-
|
|
3656
|
+
vo.has(e.kind) || // Ternary with both branches never undefined
|
|
3652
3657
|
o.isConditionalExpression(e) && ee(e.whenTrue) && ee(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3653
|
-
o.isBinaryExpression(e) && (
|
|
3658
|
+
o.isBinaryExpression(e) && (bo.has(e.operatorToken.kind) || ee(e.left) && ee(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3654
3659
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ee(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3655
|
-
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) &&
|
|
3660
|
+
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && lr.has(e.tag.text)
|
|
3656
3661
|
);
|
|
3657
3662
|
}
|
|
3658
|
-
const
|
|
3663
|
+
const vo = /* @__PURE__ */ new Set([
|
|
3659
3664
|
o.SyntaxKind.NumericLiteral,
|
|
3660
3665
|
o.SyntaxKind.BigIntLiteral,
|
|
3661
3666
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3674,7 +3679,7 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3674
3679
|
o.SyntaxKind.ClassExpression,
|
|
3675
3680
|
// Trust? Trust.
|
|
3676
3681
|
o.SyntaxKind.NonNullExpression
|
|
3677
|
-
]),
|
|
3682
|
+
]), bo = /* @__PURE__ */ new Set([
|
|
3678
3683
|
o.SyntaxKind.PlusEqualsToken,
|
|
3679
3684
|
o.SyntaxKind.MinusEqualsToken,
|
|
3680
3685
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3709,9 +3714,9 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3709
3714
|
o.SyntaxKind.SlashToken,
|
|
3710
3715
|
o.SyntaxKind.PercentToken,
|
|
3711
3716
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3712
|
-
]),
|
|
3717
|
+
]), wo = {
|
|
3713
3718
|
property(e, t, i, s) {
|
|
3714
|
-
const n =
|
|
3719
|
+
const n = So(s, i, e), r = n?.type === "stringifiedReflected", a = n?.type === "reflected" || r;
|
|
3715
3720
|
if (a) {
|
|
3716
3721
|
const f = He(t);
|
|
3717
3722
|
if (f === !0)
|
|
@@ -3724,11 +3729,11 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3724
3729
|
return [n.name, ...c];
|
|
3725
3730
|
const [l, p] = c, m = n?.type === "stringifiedNonReflected";
|
|
3726
3731
|
if (r || m) {
|
|
3727
|
-
const f =
|
|
3732
|
+
const f = Ut(
|
|
3728
3733
|
p,
|
|
3729
3734
|
e,
|
|
3730
3735
|
m ? "" : void 0
|
|
3731
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3736
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? Eo(f, e) : f;
|
|
3732
3737
|
if (h !== p)
|
|
3733
3738
|
return [m ? `.${i}` : n.name, l, h];
|
|
3734
3739
|
}
|
|
@@ -3740,7 +3745,7 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3740
3745
|
return [i];
|
|
3741
3746
|
if (s === !1)
|
|
3742
3747
|
return [];
|
|
3743
|
-
const n = Ee(e, t, !0), a = n[0] !== "=" ? n : [n[0],
|
|
3748
|
+
const n = Ee(e, t, !0), a = n[0] !== "=" ? n : [n[0], Ut(n[1], e)];
|
|
3744
3749
|
return [i, ...a];
|
|
3745
3750
|
},
|
|
3746
3751
|
booleanAttribute(e, t, i) {
|
|
@@ -3752,8 +3757,8 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3752
3757
|
throw new Error(
|
|
3753
3758
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3754
3759
|
);
|
|
3755
|
-
const s = i.slice(2), n =
|
|
3756
|
-
return [`@${
|
|
3760
|
+
const s = i.slice(2), n = St(s);
|
|
3761
|
+
return [`@${fi.has(n) ? s.toLowerCase() : St(s)}=`, ...yt(e, t, void 0)];
|
|
3757
3762
|
},
|
|
3758
3763
|
directives(e, t) {
|
|
3759
3764
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3788,9 +3793,9 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3788
3793
|
])
|
|
3789
3794
|
];
|
|
3790
3795
|
},
|
|
3791
|
-
class:
|
|
3792
|
-
style:
|
|
3793
|
-
key: (e, t) => [
|
|
3796
|
+
class: Ht,
|
|
3797
|
+
style: Ht,
|
|
3798
|
+
key: (e, t) => [gt(t, e.sourceFile)],
|
|
3794
3799
|
deferLoad(e, t, i, s) {
|
|
3795
3800
|
if (typeof s != "string")
|
|
3796
3801
|
throw Error("deferLoad prop is not currently supported on dynamic tag names.");
|
|
@@ -3801,7 +3806,7 @@ const yo = /* @__PURE__ */ new Set([
|
|
|
3801
3806
|
return [o.factory.createIdentifier(n)];
|
|
3802
3807
|
}
|
|
3803
3808
|
};
|
|
3804
|
-
function
|
|
3809
|
+
function So(e, t, i) {
|
|
3805
3810
|
if (typeof e == "string") {
|
|
3806
3811
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3807
3812
|
if (r !== void 0)
|
|
@@ -3833,7 +3838,7 @@ function ze(e, t) {
|
|
|
3833
3838
|
if (n !== void 0)
|
|
3834
3839
|
return { name: n, type: "stringifiedNonReflected" };
|
|
3835
3840
|
}
|
|
3836
|
-
function
|
|
3841
|
+
function gt(e, t) {
|
|
3837
3842
|
if (e !== void 0 && o.isJsxExpression(e) && e.expression !== void 0)
|
|
3838
3843
|
return e.expression;
|
|
3839
3844
|
if (e !== void 0 && o.isStringLiteral(e))
|
|
@@ -3856,10 +3861,10 @@ function Ee(e, t, i = !1) {
|
|
|
3856
3861
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3857
3862
|
);
|
|
3858
3863
|
if (o.isStringLiteral(t))
|
|
3859
|
-
return
|
|
3864
|
+
return zt(t, i);
|
|
3860
3865
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3861
3866
|
if (o.isStringLiteral(t.expression))
|
|
3862
|
-
return
|
|
3867
|
+
return zt(t.expression, i);
|
|
3863
3868
|
if (i) {
|
|
3864
3869
|
if (o.isNumericLiteral(t.expression))
|
|
3865
3870
|
return [`=${t.expression.text}`];
|
|
@@ -3867,16 +3872,16 @@ function Ee(e, t, i = !1) {
|
|
|
3867
3872
|
return [`=${t.expression.getText(e.sourceFile)}`];
|
|
3868
3873
|
}
|
|
3869
3874
|
}
|
|
3870
|
-
return ["=", ...
|
|
3875
|
+
return ["=", ...yt(e, t, void 0)];
|
|
3871
3876
|
}
|
|
3872
|
-
function
|
|
3877
|
+
function zt(e, t) {
|
|
3873
3878
|
if (!t)
|
|
3874
3879
|
return ["=", e];
|
|
3875
3880
|
const i = e.text;
|
|
3876
3881
|
if (i.length === 0)
|
|
3877
3882
|
return [];
|
|
3878
|
-
const s =
|
|
3879
|
-
if (
|
|
3883
|
+
const s = gi(i);
|
|
3884
|
+
if (rr(s)) {
|
|
3880
3885
|
const n = s.replaceAll('"', """);
|
|
3881
3886
|
if (n.length > s.length) {
|
|
3882
3887
|
const r = s.replaceAll("'", "'");
|
|
@@ -3887,7 +3892,7 @@ function Ut(e, t) {
|
|
|
3887
3892
|
} else
|
|
3888
3893
|
return [`=${s}`];
|
|
3889
3894
|
}
|
|
3890
|
-
function
|
|
3895
|
+
function Ht(e, t, i) {
|
|
3891
3896
|
if (t !== void 0 && o.isStringLiteral(t))
|
|
3892
3897
|
return [`${i}="${t.text}"`];
|
|
3893
3898
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3895,7 +3900,7 @@ function zt(e, t, i) {
|
|
|
3895
3900
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3896
3901
|
);
|
|
3897
3902
|
const s = t.expression;
|
|
3898
|
-
if (
|
|
3903
|
+
if (Co(s)) {
|
|
3899
3904
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3900
3905
|
e.neededImports.add(r);
|
|
3901
3906
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3905,18 +3910,18 @@ function zt(e, t, i) {
|
|
|
3905
3910
|
} else
|
|
3906
3911
|
return [i, ...Ee(e, t, !0)];
|
|
3907
3912
|
}
|
|
3908
|
-
const
|
|
3909
|
-
function
|
|
3913
|
+
const Co = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3914
|
+
function Eo(e, t) {
|
|
3910
3915
|
t.neededImports.add("live");
|
|
3911
3916
|
const i = t.importRenames.live;
|
|
3912
3917
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3913
3918
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3914
3919
|
]);
|
|
3915
3920
|
}
|
|
3916
|
-
function
|
|
3917
|
-
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in
|
|
3921
|
+
function To(e) {
|
|
3922
|
+
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in qt && e.expression.arguments.length <= 1)
|
|
3918
3923
|
return {
|
|
3919
|
-
propType:
|
|
3924
|
+
propType: qt[e.expression.expression.text],
|
|
3920
3925
|
// To simplify checking logic in convertProps, wrap expression in JSX expression
|
|
3921
3926
|
initializer: o.factory.createJsxExpression(
|
|
3922
3927
|
void 0,
|
|
@@ -3925,21 +3930,21 @@ function Eo(e) {
|
|
|
3925
3930
|
)
|
|
3926
3931
|
};
|
|
3927
3932
|
}
|
|
3928
|
-
const
|
|
3933
|
+
const qt = {
|
|
3929
3934
|
bindProperty: "property",
|
|
3930
3935
|
bindAttribute: "attribute",
|
|
3931
3936
|
bindBooleanAttribute: "booleanAttribute",
|
|
3932
3937
|
bindEvent: "event"
|
|
3933
3938
|
};
|
|
3934
|
-
function
|
|
3935
|
-
return
|
|
3939
|
+
function $o(e, t, i) {
|
|
3940
|
+
return ko.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : pi.has(e) || e.includes("-") ? "attribute" : !lt(i) && (ui.has(e) || (i === Ye ? !1 : i === ke ? (
|
|
3936
3941
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3937
3942
|
Object.values(Qe).some((r) => r.has(e))
|
|
3938
|
-
) : Qe[i]?.has(e) === !0)) ?
|
|
3943
|
+
) : Qe[i]?.has(e) === !0)) ? $t.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === Ye || i !== ke && (at.has(i) || ct.has(i)) ? e in W.common.reflected || e in W.common.stringifiedReflected || e in W.common.stringifiedNonReflected ? "property" : $t.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3939
3944
|
}
|
|
3940
|
-
const
|
|
3945
|
+
const Po = ["class", "style", "ref", "directives", "key", "deferLoad"], ko = new Set(Po), Io = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3941
3946
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3942
|
-
const n =
|
|
3947
|
+
const n = xo(t);
|
|
3943
3948
|
if (n.length % 2 === 0)
|
|
3944
3949
|
throw new Error("Normalized template parts array length must be odd");
|
|
3945
3950
|
const [r, ...a] = n;
|
|
@@ -3960,11 +3965,11 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3960
3965
|
const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3961
3966
|
o.factory.createIdentifier(d),
|
|
3962
3967
|
void 0,
|
|
3963
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3968
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Ao(a))
|
|
3964
3969
|
);
|
|
3965
3970
|
return qe(s, e, l);
|
|
3966
3971
|
}
|
|
3967
|
-
const
|
|
3972
|
+
const xo = (e) => e.reduce(
|
|
3968
3973
|
(t, i, s) => {
|
|
3969
3974
|
const n = t.at(-1), r = typeof n == "string", a = typeof i == "string";
|
|
3970
3975
|
if (r && a)
|
|
@@ -3974,7 +3979,7 @@ const Io = (e) => e.reduce(
|
|
|
3974
3979
|
},
|
|
3975
3980
|
[""]
|
|
3976
3981
|
);
|
|
3977
|
-
function
|
|
3982
|
+
function Ao(e) {
|
|
3978
3983
|
if (!(e.length % 2 === 0))
|
|
3979
3984
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3980
3985
|
const i = e.length / 2;
|
|
@@ -3999,27 +4004,27 @@ function qe(e, t, i) {
|
|
|
3999
4004
|
const s = e.importRenames.keyed;
|
|
4000
4005
|
return o.factory.createCallExpression(o.factory.createIdentifier(s), void 0, [t, i]);
|
|
4001
4006
|
}
|
|
4002
|
-
const
|
|
4003
|
-
function
|
|
4004
|
-
const i =
|
|
4007
|
+
const is = (e, t) => e.getFullText(t.sourceFile).slice(0, e.getLeadingTriviaWidth(t.sourceFile));
|
|
4008
|
+
function ss(e, t) {
|
|
4009
|
+
const i = ht(e);
|
|
4005
4010
|
return i.length === 0 ? t : o.setSyntheticLeadingComments(
|
|
4006
4011
|
t,
|
|
4007
4012
|
i.map((s) => ({
|
|
4008
4013
|
...s,
|
|
4009
4014
|
pos: -1,
|
|
4010
4015
|
end: -1,
|
|
4011
|
-
text:
|
|
4016
|
+
text: rs(e.slice(s.pos, s.end))
|
|
4012
4017
|
}))
|
|
4013
4018
|
);
|
|
4014
4019
|
}
|
|
4015
|
-
const
|
|
4016
|
-
function
|
|
4017
|
-
const t =
|
|
4020
|
+
const ht = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4021
|
+
function Lo(e) {
|
|
4022
|
+
const t = ht(e);
|
|
4018
4023
|
if (t.length === 0)
|
|
4019
4024
|
return [e || " "];
|
|
4020
4025
|
const i = t.reduceRight(
|
|
4021
4026
|
([n, ...r], a) => {
|
|
4022
|
-
const c =
|
|
4027
|
+
const c = No(n), d = rs(c.slice(a.pos, a.end));
|
|
4023
4028
|
return [
|
|
4024
4029
|
c.slice(0, a.pos),
|
|
4025
4030
|
/**
|
|
@@ -4037,13 +4042,13 @@ function Ao(e) {
|
|
|
4037
4042
|
const s = i.at(-1);
|
|
4038
4043
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4039
4044
|
}
|
|
4040
|
-
const
|
|
4041
|
-
function
|
|
4045
|
+
const rs = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4046
|
+
function No(e) {
|
|
4042
4047
|
if (typeof e == "string")
|
|
4043
4048
|
return e;
|
|
4044
4049
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4045
4050
|
}
|
|
4046
|
-
function
|
|
4051
|
+
function jo(e, t) {
|
|
4047
4052
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4048
4053
|
return t;
|
|
4049
4054
|
const s = t.arguments[0];
|
|
@@ -4055,7 +4060,7 @@ function No(e, t) {
|
|
|
4055
4060
|
return t;
|
|
4056
4061
|
const c = ge(s.body);
|
|
4057
4062
|
let d = !0, l;
|
|
4058
|
-
if (
|
|
4063
|
+
if (Vt(c))
|
|
4059
4064
|
l = c;
|
|
4060
4065
|
else {
|
|
4061
4066
|
if (!o.isBlock(c))
|
|
@@ -4064,20 +4069,20 @@ function No(e, t) {
|
|
|
4064
4069
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
4065
4070
|
return t;
|
|
4066
4071
|
const C = ge(v.expression);
|
|
4067
|
-
if (!
|
|
4072
|
+
if (!Vt(C))
|
|
4068
4073
|
return t;
|
|
4069
4074
|
const E = c.statements.slice(0, -1);
|
|
4070
|
-
if (E.some(
|
|
4075
|
+
if (E.some(ns))
|
|
4071
4076
|
return t;
|
|
4072
4077
|
d = E.length === 0, l = C;
|
|
4073
4078
|
}
|
|
4074
|
-
const p = o.isJsxElement(l) ? l.openingElement : l, m =
|
|
4079
|
+
const p = o.isJsxElement(l) ? l.openingElement : l, m = ds(p);
|
|
4075
4080
|
if (m === -1)
|
|
4076
4081
|
return t;
|
|
4077
4082
|
const f = p.attributes.properties[m];
|
|
4078
4083
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4079
4084
|
return t;
|
|
4080
|
-
const g =
|
|
4085
|
+
const g = gt(f.initializer, e.sourceFile), h = Fo(r, s, g, d, e);
|
|
4081
4086
|
if (h === void 0)
|
|
4082
4087
|
return t;
|
|
4083
4088
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4099,22 +4104,22 @@ function No(e, t) {
|
|
|
4099
4104
|
)
|
|
4100
4105
|
]);
|
|
4101
4106
|
}
|
|
4102
|
-
const
|
|
4103
|
-
function
|
|
4107
|
+
const Vt = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
4108
|
+
function ns(e) {
|
|
4104
4109
|
if (o.isReturnStatement(e))
|
|
4105
4110
|
return !0;
|
|
4106
4111
|
let t = !1;
|
|
4107
4112
|
return o.visitEachChild(
|
|
4108
4113
|
e,
|
|
4109
|
-
(i) => (t ||=
|
|
4114
|
+
(i) => (t ||= ns(i), i),
|
|
4110
4115
|
void 0
|
|
4111
4116
|
), t;
|
|
4112
4117
|
}
|
|
4113
|
-
function
|
|
4118
|
+
function Fo(e, t, i, s, n) {
|
|
4114
4119
|
const r = J(i);
|
|
4115
4120
|
if (r === void 0)
|
|
4116
4121
|
return;
|
|
4117
|
-
let a =
|
|
4122
|
+
let a = os(e.name, r);
|
|
4118
4123
|
const c = t.parameters.at(1);
|
|
4119
4124
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
4120
4125
|
r.every(Fe, c.name)) {
|
|
@@ -4126,7 +4131,7 @@ function jo(e, t, i, s, n) {
|
|
|
4126
4131
|
return;
|
|
4127
4132
|
}
|
|
4128
4133
|
if (!s) {
|
|
4129
|
-
const d =
|
|
4134
|
+
const d = Do(r, a, t);
|
|
4130
4135
|
if (d === void 0)
|
|
4131
4136
|
return;
|
|
4132
4137
|
a = d;
|
|
@@ -4165,7 +4170,7 @@ function J(e) {
|
|
|
4165
4170
|
}
|
|
4166
4171
|
return t;
|
|
4167
4172
|
} else {
|
|
4168
|
-
if (
|
|
4173
|
+
if (Ro.has(e.kind))
|
|
4169
4174
|
return [];
|
|
4170
4175
|
{
|
|
4171
4176
|
const t = ge(e);
|
|
@@ -4173,7 +4178,7 @@ function J(e) {
|
|
|
4173
4178
|
}
|
|
4174
4179
|
}
|
|
4175
4180
|
}
|
|
4176
|
-
const
|
|
4181
|
+
const Ro = /* @__PURE__ */ new Set([
|
|
4177
4182
|
o.SyntaxKind.NumericLiteral,
|
|
4178
4183
|
o.SyntaxKind.BigIntLiteral,
|
|
4179
4184
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4182,20 +4187,20 @@ const Fo = /* @__PURE__ */ new Set([
|
|
|
4182
4187
|
o.SyntaxKind.FalseKeyword,
|
|
4183
4188
|
o.SyntaxKind.NullKeyword,
|
|
4184
4189
|
o.SyntaxKind.TrueKeyword
|
|
4185
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e,
|
|
4186
|
-
function
|
|
4190
|
+
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, os = (e, t) => o.isObjectBindingPattern(e) ? Jo(e, t) : e;
|
|
4191
|
+
function Do(e, t, i) {
|
|
4187
4192
|
if (e.every(Fe, t))
|
|
4188
4193
|
return t;
|
|
4189
4194
|
if (o.isIdentifier(t)) {
|
|
4190
|
-
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) =>
|
|
4195
|
+
const s = o.isBlock(i.body) ? Xe(i.body.statements, (r) => Oo(r, t)) : void 0;
|
|
4191
4196
|
if (s === void 0)
|
|
4192
4197
|
return;
|
|
4193
|
-
const n =
|
|
4198
|
+
const n = os(s, e);
|
|
4194
4199
|
if (e.every(Fe, n))
|
|
4195
4200
|
return n;
|
|
4196
4201
|
}
|
|
4197
4202
|
}
|
|
4198
|
-
function
|
|
4203
|
+
function Oo(e, t) {
|
|
4199
4204
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4200
4205
|
return;
|
|
4201
4206
|
const i = e.declarationList.declarations[0];
|
|
@@ -4203,34 +4208,34 @@ function Do(e, t) {
|
|
|
4203
4208
|
}
|
|
4204
4209
|
function Fe(e) {
|
|
4205
4210
|
const t = this;
|
|
4206
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4211
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Mo, e);
|
|
4207
4212
|
}
|
|
4208
|
-
function
|
|
4213
|
+
function Mo(e) {
|
|
4209
4214
|
const t = this;
|
|
4210
4215
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4211
4216
|
}
|
|
4212
|
-
function
|
|
4217
|
+
function Jo(e, t) {
|
|
4213
4218
|
let i = !1;
|
|
4214
4219
|
const s = e.elements.filter((n) => o.isIdentifier(n.name) ? t.includes(n.name.text) : (i = !0, !0));
|
|
4215
4220
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
4216
4221
|
}
|
|
4217
|
-
const
|
|
4222
|
+
const as = (e, t) => t.liftedKeys.has(e);
|
|
4218
4223
|
function q(e, t, i) {
|
|
4219
4224
|
if (fe(i))
|
|
4220
|
-
return
|
|
4221
|
-
const s = o.isCallExpression(i) ?
|
|
4225
|
+
return cs(e, i);
|
|
4226
|
+
const s = o.isCallExpression(i) ? jo(e, i) : i, n = o.visitEachChild(
|
|
4222
4227
|
s,
|
|
4223
4228
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4224
4229
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4225
4230
|
e.transformationContext
|
|
4226
4231
|
);
|
|
4227
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) ||
|
|
4232
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || mr(i.right)) ? Ko(n) : n;
|
|
4228
4233
|
}
|
|
4229
|
-
function
|
|
4230
|
-
const i =
|
|
4234
|
+
function cs(e, t) {
|
|
4235
|
+
const i = ls(e, t);
|
|
4231
4236
|
return Oe(i, e);
|
|
4232
4237
|
}
|
|
4233
|
-
function
|
|
4238
|
+
function ls(e, t) {
|
|
4234
4239
|
const i = "children" in t ? t.children : [];
|
|
4235
4240
|
if (o.isJsxFragment(t))
|
|
4236
4241
|
return { key: void 0, ...Te(i, e) };
|
|
@@ -4238,17 +4243,17 @@ function as(e, t) {
|
|
|
4238
4243
|
if (o.isJsxNamespacedName(r))
|
|
4239
4244
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
4240
4245
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== Be && r.text !== _e) {
|
|
4241
|
-
const S = o.isIdentifier(r) && r.text ===
|
|
4246
|
+
const S = o.isIdentifier(r) && r.text === Ys ? Te(i, e) : {
|
|
4242
4247
|
// No need to wrap the function call in a lit-html tag
|
|
4243
4248
|
litTag: void 0,
|
|
4244
|
-
parts: [
|
|
4249
|
+
parts: [_o(e, t, r, i)]
|
|
4245
4250
|
};
|
|
4246
4251
|
return {
|
|
4247
|
-
key:
|
|
4252
|
+
key: Bo(n, e),
|
|
4248
4253
|
...S
|
|
4249
4254
|
};
|
|
4250
4255
|
}
|
|
4251
|
-
const c = r.text === Be ? ke : r.text === _e ? Ye : r.text, d = r.text === Be ? ae : r.text === _e ? Y :
|
|
4256
|
+
const c = r.text === Be ? ke : r.text === _e ? Ye : r.text, d = r.text === Be ? ae : r.text === _e ? Y : Zs.has(c) ? hi : at.has(c) ? se : ce, l = lt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4252
4257
|
let f;
|
|
4253
4258
|
const g = [];
|
|
4254
4259
|
let h = !1;
|
|
@@ -4261,13 +4266,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4261
4266
|
const { name: S, initializer: A } = x;
|
|
4262
4267
|
if (o.isJsxNamespacedName(S))
|
|
4263
4268
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
4264
|
-
const L = S.text, U =
|
|
4269
|
+
const L = S.text, U = To(A), F = U?.propType ?? $o(L, A, c);
|
|
4265
4270
|
m?.delete(L);
|
|
4266
|
-
const N =
|
|
4271
|
+
const N = wo[F](e, U?.initializer ?? A, L, c);
|
|
4267
4272
|
if (N.length === 0)
|
|
4268
4273
|
return [];
|
|
4269
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4270
|
-
return F === "key" ? (f = typeof N[0] == "object" && !
|
|
4274
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : Lo(is(S, e));
|
|
4275
|
+
return F === "key" ? (f = typeof N[0] == "object" && !as(S, e) ? N[0] : void 0, B.some(Io) ? B : []) : F === "directives" || F === "ref" || L === "deferLoad" ? (h ||= F === "deferLoad", g.push(
|
|
4271
4276
|
...B,
|
|
4272
4277
|
...N.flatMap(
|
|
4273
4278
|
(D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
|
|
@@ -4283,7 +4288,7 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4283
4288
|
`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`
|
|
4284
4289
|
);
|
|
4285
4290
|
l && (h ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
4286
|
-
const v = typeof c == "string" &&
|
|
4291
|
+
const v = typeof c == "string" && Qs.has(c), w = Te(i, e);
|
|
4287
4292
|
if (v && w.parts.length > 0)
|
|
4288
4293
|
throw Error(
|
|
4289
4294
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
@@ -4307,21 +4312,21 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4307
4312
|
];
|
|
4308
4313
|
return { key: f, parts: P, litTag: d };
|
|
4309
4314
|
}
|
|
4310
|
-
function
|
|
4311
|
-
const i = e.attributes.properties[
|
|
4312
|
-
return i && o.isJsxAttribute(i) && !
|
|
4315
|
+
function Bo(e, t) {
|
|
4316
|
+
const i = e.attributes.properties[ds(e)];
|
|
4317
|
+
return i && o.isJsxAttribute(i) && !as(i.name, t) ? gt(i.initializer, t.sourceFile) : void 0;
|
|
4313
4318
|
}
|
|
4314
|
-
const
|
|
4315
|
-
function
|
|
4319
|
+
const ds = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4320
|
+
function _o(e, t, i, s) {
|
|
4316
4321
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4317
4322
|
if (o.isJsxSpreadAttribute(d))
|
|
4318
|
-
return
|
|
4323
|
+
return ss(is(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
4319
4324
|
const { name: l, initializer: p } = d;
|
|
4320
4325
|
if (o.isJsxNamespacedName(l))
|
|
4321
4326
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
4322
4327
|
if (l.text === "key")
|
|
4323
4328
|
return;
|
|
4324
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ?
|
|
4329
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : fe(p) ? cs(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = ci(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
4325
4330
|
return o.factory.createPropertyAssignment(f, m);
|
|
4326
4331
|
}), { parts: a, litTag: c } = Te(s, e);
|
|
4327
4332
|
return a.length > 0 && r.push(
|
|
@@ -4337,13 +4342,13 @@ function Te(e, t) {
|
|
|
4337
4342
|
let i;
|
|
4338
4343
|
const s = e.flatMap((n) => {
|
|
4339
4344
|
if (o.isJsxText(n))
|
|
4340
|
-
return [t.compiler.shouldMinifyJsx ?
|
|
4345
|
+
return [t.compiler.shouldMinifyJsx ? tr(n.text) : n.text];
|
|
4341
4346
|
if (o.isJsxExpression(n))
|
|
4342
|
-
return
|
|
4347
|
+
return yt(t, n, n);
|
|
4343
4348
|
{
|
|
4344
|
-
const r =
|
|
4349
|
+
const r = ls(t, n);
|
|
4345
4350
|
if (r.key === void 0 && r.litTag !== ae && r.litTag !== Y) {
|
|
4346
|
-
if (r.litTag ===
|
|
4351
|
+
if (r.litTag === hi)
|
|
4347
4352
|
return r.parts;
|
|
4348
4353
|
if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
|
|
4349
4354
|
throw new Error(
|
|
@@ -4356,21 +4361,21 @@ function Te(e, t) {
|
|
|
4356
4361
|
});
|
|
4357
4362
|
return { litTag: i, parts: s };
|
|
4358
4363
|
}
|
|
4359
|
-
function
|
|
4364
|
+
function Ko(e) {
|
|
4360
4365
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4361
4366
|
e,
|
|
4362
4367
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
4363
4368
|
o.factory.createStringLiteral("")
|
|
4364
4369
|
) : e;
|
|
4365
4370
|
}
|
|
4366
|
-
function
|
|
4371
|
+
function yt(e, t, i) {
|
|
4367
4372
|
if (t.expression === void 0) {
|
|
4368
4373
|
if (e.compiler.shouldMinifyJsx)
|
|
4369
4374
|
return [];
|
|
4370
4375
|
const s = t.getText(e.sourceFile).slice(1, -1);
|
|
4371
|
-
return
|
|
4376
|
+
return ht(s).length === 0 ? [] : [ss(s, o.factory.createIdentifier("undefined"))];
|
|
4372
4377
|
}
|
|
4373
|
-
return o.isStringLiteral(t.expression) ? [
|
|
4378
|
+
return o.isStringLiteral(t.expression) ? [gi(t.expression.text)] : (
|
|
4374
4379
|
/**
|
|
4375
4380
|
* There is a bug in Chrome DevTools, where it won't let you set a
|
|
4376
4381
|
* breakpoint inside a tagged template literal. It seems like they did
|
|
@@ -4407,17 +4412,17 @@ function ht(e, t, i) {
|
|
|
4407
4412
|
] : [q(e, i, t.expression)]
|
|
4408
4413
|
);
|
|
4409
4414
|
}
|
|
4410
|
-
const
|
|
4415
|
+
const ps = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), us = ps(
|
|
4411
4416
|
Object.entries(re).flatMap(
|
|
4412
4417
|
([e, t]) => t.map((i) => [i, e])
|
|
4413
4418
|
)
|
|
4414
|
-
),
|
|
4415
|
-
function
|
|
4419
|
+
), ms = new Set(Object.keys(us));
|
|
4420
|
+
function Wo(e, t) {
|
|
4416
4421
|
const i = t.importClause, s = i === void 0, n = t.moduleSpecifier;
|
|
4417
4422
|
if (!o.isStringLiteral(n))
|
|
4418
4423
|
return t;
|
|
4419
|
-
const r =
|
|
4420
|
-
if (a && e.existingImportedModules.add(r),
|
|
4424
|
+
const r = Uo(e.sourceFile.fileName, n.text, ""), a = !i?.isTypeOnly;
|
|
4425
|
+
if (a && e.existingImportedModules.add(r), gr.test(n.text) && // If id already includes ?, bypass our custom behavior
|
|
4421
4426
|
!n.text.includes("?")) {
|
|
4422
4427
|
if (s) {
|
|
4423
4428
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
@@ -4450,12 +4455,12 @@ function Ko(e, t) {
|
|
|
4450
4455
|
const c = i.namedBindings;
|
|
4451
4456
|
if (c === void 0 || !o.isNamedImports(c))
|
|
4452
4457
|
return t;
|
|
4453
|
-
const d =
|
|
4458
|
+
const d = ms.has(n.text);
|
|
4454
4459
|
if (c.elements.forEach((l) => {
|
|
4455
4460
|
const p = (l.propertyName ?? l.name).text, m = re[p];
|
|
4456
4461
|
if (d) {
|
|
4457
4462
|
if (m?.some((h) => h === n.text)) {
|
|
4458
|
-
const h =
|
|
4463
|
+
const h = fs(p, r);
|
|
4459
4464
|
e.existingLitImports.add(h), e.importRenames[h] = l.name?.text ?? h;
|
|
4460
4465
|
}
|
|
4461
4466
|
} else (l.name.text === "h" || l.name.text === "createElement") && j().name !== "@arcgis/lumina" && (e.hasNonLuminaJsxImport = !0);
|
|
@@ -4465,7 +4470,7 @@ function Ko(e, t) {
|
|
|
4465
4470
|
let l = !1;
|
|
4466
4471
|
const p = c.elements.filter((f) => {
|
|
4467
4472
|
const g = (f.propertyName ?? f.name).text;
|
|
4468
|
-
return
|
|
4473
|
+
return fr.has(g) ? !1 : (l ||= !f.isTypeOnly, !0);
|
|
4469
4474
|
});
|
|
4470
4475
|
if (p.length === 0)
|
|
4471
4476
|
return;
|
|
@@ -4494,22 +4499,22 @@ function Ko(e, t) {
|
|
|
4494
4499
|
}
|
|
4495
4500
|
return t;
|
|
4496
4501
|
}
|
|
4497
|
-
const
|
|
4498
|
-
function
|
|
4499
|
-
return o.isImportDeclaration(e) ?
|
|
4502
|
+
const fs = (e, t) => e === ce && re.staticHtml.includes(t) ? ae : e === se && re.staticSvg.includes(t) ? Y : e, Uo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4503
|
+
function zo(e) {
|
|
4504
|
+
return o.isImportDeclaration(e) ? Ho(this, e) : e;
|
|
4500
4505
|
}
|
|
4501
|
-
function
|
|
4506
|
+
function Ho(e, t) {
|
|
4502
4507
|
const i = t.importClause, s = i?.namedBindings, n = t.moduleSpecifier;
|
|
4503
|
-
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !
|
|
4508
|
+
if (!o.isStringLiteral(n) || !s || !o.isNamedImports(s) || !ms.has(n.text))
|
|
4504
4509
|
return t;
|
|
4505
4510
|
const r = i.isTypeOnly;
|
|
4506
4511
|
let a = !1;
|
|
4507
4512
|
const c = s.elements.map((d) => {
|
|
4508
|
-
const l = (d.propertyName ?? d.name).text, p =
|
|
4513
|
+
const l = (d.propertyName ?? d.name).text, p = fs(l, n.text);
|
|
4509
4514
|
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;
|
|
4510
4515
|
});
|
|
4511
|
-
return
|
|
4512
|
-
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(
|
|
4516
|
+
return us[n.text]?.forEach((d) => {
|
|
4517
|
+
!e.neededImports.has(d) || e.existingLitImports.has(d) || (e.neededImports.delete(d), a = !0, c.push(gs(d, e)));
|
|
4513
4518
|
}), a ? o.factory.updateImportDeclaration(
|
|
4514
4519
|
t,
|
|
4515
4520
|
t.modifiers,
|
|
@@ -4523,8 +4528,8 @@ function zo(e, t) {
|
|
|
4523
4528
|
t.attributes
|
|
4524
4529
|
) : t;
|
|
4525
4530
|
}
|
|
4526
|
-
function
|
|
4527
|
-
const t =
|
|
4531
|
+
function qo(e) {
|
|
4532
|
+
const t = ps(
|
|
4528
4533
|
Array.from(e.neededImports, (i) => [re[i][0], i])
|
|
4529
4534
|
);
|
|
4530
4535
|
return Object.entries(t).map(
|
|
@@ -4534,14 +4539,14 @@ function Ho(e) {
|
|
|
4534
4539
|
!1,
|
|
4535
4540
|
void 0,
|
|
4536
4541
|
o.factory.createNamedImports(
|
|
4537
|
-
s.map((n) => (e.neededImports.delete(n),
|
|
4542
|
+
s.map((n) => (e.neededImports.delete(n), gs(n, e)))
|
|
4538
4543
|
)
|
|
4539
4544
|
),
|
|
4540
4545
|
o.factory.createStringLiteral(i)
|
|
4541
4546
|
)
|
|
4542
4547
|
);
|
|
4543
4548
|
}
|
|
4544
|
-
function
|
|
4549
|
+
function gs(e, t) {
|
|
4545
4550
|
const i = e === ae ? ce : e === Y ? se : e, s = t.importRenames[e];
|
|
4546
4551
|
return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
|
|
4547
4552
|
!1,
|
|
@@ -4549,12 +4554,12 @@ function ms(e, t) {
|
|
|
4549
4554
|
o.factory.createIdentifier(s)
|
|
4550
4555
|
);
|
|
4551
4556
|
}
|
|
4552
|
-
function
|
|
4553
|
-
const t =
|
|
4557
|
+
function Vo(e) {
|
|
4558
|
+
const t = Rr().map(({ packageName: i }) => i);
|
|
4554
4559
|
return e.existingImportedModules.forEach((i) => {
|
|
4555
4560
|
if (u.isAbsolute(i))
|
|
4556
4561
|
return;
|
|
4557
|
-
const s =
|
|
4562
|
+
const s = Gs(i), n = i.slice(s.length + 1);
|
|
4558
4563
|
if (t.includes(s ?? "") && (n.startsWith("dist/components") || n.startsWith("components"))) {
|
|
4559
4564
|
const r = Re(e.sourceFile.fileName);
|
|
4560
4565
|
throw new Error(
|
|
@@ -4563,7 +4568,7 @@ function qo(e) {
|
|
|
4563
4568
|
}
|
|
4564
4569
|
}), [];
|
|
4565
4570
|
}
|
|
4566
|
-
function
|
|
4571
|
+
function Go(e) {
|
|
4567
4572
|
if (e.compiler.viteCommand === "serve")
|
|
4568
4573
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4569
4574
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4578,7 +4583,7 @@ function Vo(e) {
|
|
|
4578
4583
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4579
4584
|
}), [];
|
|
4580
4585
|
}
|
|
4581
|
-
const
|
|
4586
|
+
const Xo = (e, t) => {
|
|
4582
4587
|
const i = e.pragmas;
|
|
4583
4588
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4584
4589
|
return e.statements;
|
|
@@ -4598,11 +4603,11 @@ const Go = (e, t) => {
|
|
|
4598
4603
|
}
|
|
4599
4604
|
const r = {
|
|
4600
4605
|
compiler: t.compiler,
|
|
4601
|
-
externalComponents:
|
|
4602
|
-
localComponents:
|
|
4606
|
+
externalComponents: ki(),
|
|
4607
|
+
localComponents: es(t.compiler),
|
|
4603
4608
|
sourceFile: e,
|
|
4604
4609
|
transformationContext: t.transformation,
|
|
4605
|
-
importRenames:
|
|
4610
|
+
importRenames: Yo(e),
|
|
4606
4611
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4607
4612
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4608
4613
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4616,7 +4621,7 @@ const Go = (e, t) => {
|
|
|
4616
4621
|
let a = [];
|
|
4617
4622
|
if (e.statements.every((d) => {
|
|
4618
4623
|
if (o.isImportDeclaration(d)) {
|
|
4619
|
-
const l =
|
|
4624
|
+
const l = Wo(r, d);
|
|
4620
4625
|
if (l === void 0)
|
|
4621
4626
|
return !0;
|
|
4622
4627
|
if (a.push(l), r.hasNonLuminaJsxImport)
|
|
@@ -4626,11 +4631,11 @@ const Go = (e, t) => {
|
|
|
4626
4631
|
return !0;
|
|
4627
4632
|
}), r.hasNonLuminaJsxImport)
|
|
4628
4633
|
return e.statements;
|
|
4629
|
-
if (r.neededImports.size > 0 && (a = a.map(
|
|
4634
|
+
if (r.neededImports.size > 0 && (a = a.map(zo, r), r.existingLitImports.size > 0))
|
|
4630
4635
|
throw new Error(
|
|
4631
4636
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(r.existingLitImports).join(", ")}`
|
|
4632
4637
|
);
|
|
4633
|
-
const c = [
|
|
4638
|
+
const c = [qo, Vo, Go].flatMap(
|
|
4634
4639
|
(d) => d(r)
|
|
4635
4640
|
);
|
|
4636
4641
|
if (r.neededImports.size > 0)
|
|
@@ -4639,24 +4644,24 @@ const Go = (e, t) => {
|
|
|
4639
4644
|
);
|
|
4640
4645
|
return [...c, ...a];
|
|
4641
4646
|
};
|
|
4642
|
-
function
|
|
4643
|
-
return
|
|
4644
|
-
|
|
4647
|
+
function Yo(e) {
|
|
4648
|
+
return Qo(e), Object.fromEntries(
|
|
4649
|
+
ur.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4645
4650
|
);
|
|
4646
4651
|
}
|
|
4647
|
-
function
|
|
4652
|
+
function Qo(e) {
|
|
4648
4653
|
if (!("identifiers" in e))
|
|
4649
4654
|
throw new Error(
|
|
4650
4655
|
"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."
|
|
4651
4656
|
);
|
|
4652
4657
|
}
|
|
4653
|
-
const
|
|
4658
|
+
const Gt = "customElement", Zo = (e, t) => {
|
|
4654
4659
|
const i = [];
|
|
4655
4660
|
if (t.apiModule?.declarations.forEach((r) => {
|
|
4656
4661
|
const a = r;
|
|
4657
4662
|
a.customElement !== void 0 && i.push(
|
|
4658
4663
|
o.factory.createExpressionStatement(
|
|
4659
|
-
o.factory.createCallExpression(o.factory.createIdentifier(
|
|
4664
|
+
o.factory.createCallExpression(o.factory.createIdentifier(Gt), void 0, [
|
|
4660
4665
|
o.factory.createStringLiteral(a.tagName ?? ""),
|
|
4661
4666
|
o.factory.createIdentifier(a.name)
|
|
4662
4667
|
])
|
|
@@ -4674,13 +4679,13 @@ const Vt = "customElement", Qo = (e, t) => {
|
|
|
4674
4679
|
!1,
|
|
4675
4680
|
void 0,
|
|
4676
4681
|
o.factory.createNamedImports([
|
|
4677
|
-
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(
|
|
4682
|
+
o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(Gt))
|
|
4678
4683
|
])
|
|
4679
4684
|
),
|
|
4680
4685
|
o.factory.createStringLiteral(s)
|
|
4681
4686
|
), ...e.statements, ...i];
|
|
4682
4687
|
};
|
|
4683
|
-
function
|
|
4688
|
+
function ea(e, t, i) {
|
|
4684
4689
|
return t.size === 0 ? e : [
|
|
4685
4690
|
o.factory.createPropertyDeclaration(
|
|
4686
4691
|
[
|
|
@@ -4694,8 +4699,8 @@ function Zo(e, t, i) {
|
|
|
4694
4699
|
Array.from(
|
|
4695
4700
|
t.entries(),
|
|
4696
4701
|
([s, n]) => o.factory.createPropertyAssignment(
|
|
4697
|
-
|
|
4698
|
-
|
|
4702
|
+
ci(s) ? o.factory.createStringLiteral(s) : s,
|
|
4703
|
+
ta(n, i)
|
|
4699
4704
|
)
|
|
4700
4705
|
)
|
|
4701
4706
|
)
|
|
@@ -4703,7 +4708,7 @@ function Zo(e, t, i) {
|
|
|
4703
4708
|
...e
|
|
4704
4709
|
];
|
|
4705
4710
|
}
|
|
4706
|
-
function
|
|
4711
|
+
function ta(e, t) {
|
|
4707
4712
|
let i = 0, s = !0;
|
|
4708
4713
|
const n = [], r = [];
|
|
4709
4714
|
for (const d of e.properties)
|
|
@@ -4713,27 +4718,27 @@ function ea(e, t) {
|
|
|
4713
4718
|
return !0;
|
|
4714
4719
|
const l = d.name.text, p = d.initializer, m = p.kind === o.SyntaxKind.TrueKeyword, f = p.kind === o.SyntaxKind.FalseKeyword;
|
|
4715
4720
|
if (l === "attribute")
|
|
4716
|
-
return s = !1, i |= m ?
|
|
4721
|
+
return s = !1, i |= m ? Ct : 0, !m && !f;
|
|
4717
4722
|
if (l === "reflect")
|
|
4718
|
-
return i |= m ?
|
|
4723
|
+
return i |= m ? $s : 0, !1;
|
|
4719
4724
|
if (l === "type" && o.isIdentifier(p)) {
|
|
4720
4725
|
if (p.text === "Boolean")
|
|
4721
|
-
return i |=
|
|
4726
|
+
return i |= Ps, !1;
|
|
4722
4727
|
if (p.text === "Number")
|
|
4723
|
-
return i |=
|
|
4728
|
+
return i |= ks, !1;
|
|
4724
4729
|
} else {
|
|
4725
4730
|
if (l === "state")
|
|
4726
|
-
return s = !1, i |= m ?
|
|
4731
|
+
return s = !1, i |= m ? Is : 0, !1;
|
|
4727
4732
|
if (l === "readOnly")
|
|
4728
|
-
return i |= m ?
|
|
4733
|
+
return i |= m ? xs : 0, !1;
|
|
4729
4734
|
if (l === "noAccessor")
|
|
4730
|
-
return i |= m ?
|
|
4735
|
+
return i |= m ? As : 0, !1;
|
|
4731
4736
|
if (l === "useDefault")
|
|
4732
|
-
return i |= m ?
|
|
4737
|
+
return i |= m ? Ls : 0, !1;
|
|
4733
4738
|
}
|
|
4734
4739
|
return !0;
|
|
4735
4740
|
}
|
|
4736
|
-
s && (i |=
|
|
4741
|
+
s && (i |= Ct);
|
|
4737
4742
|
const c = o.factory.createNumericLiteral(i);
|
|
4738
4743
|
return n.length === 0 && (t || r.length === 0) ? c : o.factory.createArrayLiteralExpression([
|
|
4739
4744
|
c,
|
|
@@ -4748,7 +4753,7 @@ function ea(e, t) {
|
|
|
4748
4753
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4749
4754
|
]);
|
|
4750
4755
|
}
|
|
4751
|
-
function
|
|
4756
|
+
function ia(e, t, i) {
|
|
4752
4757
|
let s = -1, n = -1, r = -1;
|
|
4753
4758
|
e.options?.properties.forEach((p, m) => {
|
|
4754
4759
|
if (o.isSpreadAssignment(p))
|
|
@@ -4760,23 +4765,23 @@ function ta(e, t, i) {
|
|
|
4760
4765
|
f === "type" ? s = m : f === "attribute" ? n = m : f === "readOnly" && (r = m);
|
|
4761
4766
|
}
|
|
4762
4767
|
});
|
|
4763
|
-
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d =
|
|
4768
|
+
const a = i.attribute === void 0 && n === -1, c = i.readonly === !0 && i.docsOnlyReadonly !== !0 && r === -1, d = sa(e, i, s), l = [
|
|
4764
4769
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4765
4770
|
...c ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4766
4771
|
...d !== void 0 ? [d] : []
|
|
4767
4772
|
];
|
|
4768
4773
|
return l.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(l, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...l]) : e.options;
|
|
4769
4774
|
}
|
|
4770
|
-
function
|
|
4775
|
+
function sa(e, t, i) {
|
|
4771
4776
|
if (t.attribute === void 0)
|
|
4772
4777
|
return;
|
|
4773
|
-
const s =
|
|
4778
|
+
const s = ra(t.type.values);
|
|
4774
4779
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4775
4780
|
o.factory.createIdentifier("type"),
|
|
4776
4781
|
o.factory.createIdentifier(s)
|
|
4777
4782
|
);
|
|
4778
4783
|
}
|
|
4779
|
-
function
|
|
4784
|
+
function ra(e) {
|
|
4780
4785
|
let t = !1, i = !1, s = !1;
|
|
4781
4786
|
if (e?.forEach((n) => {
|
|
4782
4787
|
t ||= n.type === "number", i ||= n.type === "boolean", s ||= n.type === "string" || n.type === "any" || n.type === "unknown";
|
|
@@ -4788,7 +4793,7 @@ function sa(e) {
|
|
|
4788
4793
|
}
|
|
4789
4794
|
return "Other";
|
|
4790
4795
|
}
|
|
4791
|
-
function
|
|
4796
|
+
function na(e, t, i, s, n, r) {
|
|
4792
4797
|
if (i.modifiers === void 0)
|
|
4793
4798
|
return i;
|
|
4794
4799
|
let a = -1, c = -1;
|
|
@@ -4798,23 +4803,23 @@ function ra(e, t, i, s, n, r) {
|
|
|
4798
4803
|
p === "property" && (a = l), p === "state" && (c = l);
|
|
4799
4804
|
}
|
|
4800
4805
|
}), a !== -1) {
|
|
4801
|
-
const d =
|
|
4802
|
-
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p,
|
|
4806
|
+
const d = oa(e, t, i, s, n), l = Xt(i, a, n), p = ia(l, n, d);
|
|
4807
|
+
return r.set(d.name, p ?? o.factory.createObjectLiteralExpression()), l.options = p, Yt(i, a);
|
|
4803
4808
|
} else if (c !== -1) {
|
|
4804
|
-
const d =
|
|
4809
|
+
const d = Xt(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 = li(i.name);
|
|
4805
4810
|
if (m === void 0)
|
|
4806
4811
|
throw new Error("Failed to statically determine the state property name");
|
|
4807
|
-
return r.set(m, p),
|
|
4812
|
+
return r.set(m, p), Yt(i, c);
|
|
4808
4813
|
} else
|
|
4809
4814
|
return i;
|
|
4810
4815
|
}
|
|
4811
|
-
function
|
|
4816
|
+
function oa(e, t, i, s, n) {
|
|
4812
4817
|
const r = t ?? (e.compiler.isInTest ? {
|
|
4813
4818
|
members: []
|
|
4814
4819
|
} : void 0);
|
|
4815
4820
|
if (r === void 0)
|
|
4816
4821
|
throw Error(`Failed to find API component for ${s} in ${n.fileName}`);
|
|
4817
|
-
const a =
|
|
4822
|
+
const a = li(i.name);
|
|
4818
4823
|
let c;
|
|
4819
4824
|
for (let d = 0; d < r.members.length; ++d) {
|
|
4820
4825
|
const l = r.members[d];
|
|
@@ -4829,11 +4834,11 @@ function na(e, t, i, s, n) {
|
|
|
4829
4834
|
throw Error(
|
|
4830
4835
|
`Failed to statically determine the property name: ${i.getText(n)} in ${s} in ${n.fileName}`
|
|
4831
4836
|
);
|
|
4832
|
-
c.name = a, c.attribute ??=
|
|
4837
|
+
c.name = a, c.attribute ??= ti(a);
|
|
4833
4838
|
}
|
|
4834
4839
|
return c;
|
|
4835
4840
|
}
|
|
4836
|
-
function
|
|
4841
|
+
function Xt(e, t, i) {
|
|
4837
4842
|
const s = e.modifiers[t], n = s.expression, r = n.arguments.at(0);
|
|
4838
4843
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4839
4844
|
throw new Error(
|
|
@@ -4841,7 +4846,7 @@ function Gt(e, t, i) {
|
|
|
4841
4846
|
);
|
|
4842
4847
|
return { decorator: s, callExpression: n, options: r };
|
|
4843
4848
|
}
|
|
4844
|
-
function
|
|
4849
|
+
function Yt(e, t) {
|
|
4845
4850
|
const i = [
|
|
4846
4851
|
...e.modifiers.slice(0, t),
|
|
4847
4852
|
...e.modifiers.slice(t + 1)
|
|
@@ -4868,7 +4873,7 @@ function Xt(e, t) {
|
|
|
4868
4873
|
e.initializer
|
|
4869
4874
|
);
|
|
4870
4875
|
}
|
|
4871
|
-
function
|
|
4876
|
+
function aa(e, t, i, s) {
|
|
4872
4877
|
let n;
|
|
4873
4878
|
if (e.apiJsonEnabled)
|
|
4874
4879
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4891,9 +4896,9 @@ function oa(e, t, i, s) {
|
|
|
4891
4896
|
} finally {
|
|
4892
4897
|
c = i.statements, i.statements = a;
|
|
4893
4898
|
}
|
|
4894
|
-
return
|
|
4899
|
+
return ca(i, c);
|
|
4895
4900
|
}
|
|
4896
|
-
const
|
|
4901
|
+
const ca = (e, t) => o.factory.updateSourceFile(
|
|
4897
4902
|
e,
|
|
4898
4903
|
t,
|
|
4899
4904
|
/*
|
|
@@ -4908,10 +4913,10 @@ const aa = (e, t) => o.factory.updateSourceFile(
|
|
|
4908
4913
|
e.hasNoDefaultLib,
|
|
4909
4914
|
e.libReferenceDirectives
|
|
4910
4915
|
);
|
|
4911
|
-
function
|
|
4916
|
+
function la(e, t) {
|
|
4912
4917
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4913
4918
|
}
|
|
4914
|
-
const
|
|
4919
|
+
const da = (e, t) => {
|
|
4915
4920
|
let i;
|
|
4916
4921
|
if (t.apiModule !== void 0)
|
|
4917
4922
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4927,16 +4932,16 @@ const la = (e, t) => {
|
|
|
4927
4932
|
function n() {
|
|
4928
4933
|
s = /* @__PURE__ */ new Map();
|
|
4929
4934
|
}
|
|
4930
|
-
const r = (d) =>
|
|
4935
|
+
const r = (d) => ea(d, s, t.compiler.shouldMinify);
|
|
4931
4936
|
function a(d, l) {
|
|
4932
|
-
const p =
|
|
4933
|
-
return
|
|
4937
|
+
const p = ua(t, i, d, l, e, s);
|
|
4938
|
+
return la(p, t), p;
|
|
4934
4939
|
}
|
|
4935
4940
|
return e.statements.map(
|
|
4936
|
-
(d) =>
|
|
4941
|
+
(d) => hs(a, d, t, n, r)
|
|
4937
4942
|
);
|
|
4938
4943
|
};
|
|
4939
|
-
function
|
|
4944
|
+
function hs(e, t, i, s, n = di) {
|
|
4940
4945
|
if (o.isClassDeclaration(t) && // Ignore classes that don't extend anything - those are definitely not components
|
|
4941
4946
|
t.heritageClauses?.some((r) => r.token === o.SyntaxKind.ExtendsKeyword)) {
|
|
4942
4947
|
let r = !1;
|
|
@@ -4959,15 +4964,15 @@ function fs(e, t, i, s, n = ci) {
|
|
|
4959
4964
|
} else
|
|
4960
4965
|
return i.compiler.isInTest ? o.visitEachChild(
|
|
4961
4966
|
t,
|
|
4962
|
-
(a) =>
|
|
4967
|
+
(a) => hs(e, a, i, s, n),
|
|
4963
4968
|
i.transformation
|
|
4964
4969
|
) : t;
|
|
4965
4970
|
}
|
|
4966
|
-
const
|
|
4967
|
-
function
|
|
4971
|
+
const pa = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4972
|
+
function ua(e, t, i, s, n, r) {
|
|
4968
4973
|
if (o.isMethodDeclaration(i)) {
|
|
4969
4974
|
const a = i.modifiers?.filter(
|
|
4970
|
-
(c) => !o.isDecorator(c) || !
|
|
4975
|
+
(c) => !o.isDecorator(c) || !ma(c)
|
|
4971
4976
|
);
|
|
4972
4977
|
if (a?.length !== i.modifiers?.length)
|
|
4973
4978
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4981,7 +4986,7 @@ function pa(e, t, i, s, n, r) {
|
|
|
4981
4986
|
i.type,
|
|
4982
4987
|
i.body
|
|
4983
4988
|
);
|
|
4984
|
-
if ("text" in i.name &&
|
|
4989
|
+
if ("text" in i.name && pa.has(i.name.text) && i.body) {
|
|
4985
4990
|
const c = i.name.text;
|
|
4986
4991
|
return i.body.statements.some(
|
|
4987
4992
|
(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
|
|
@@ -5007,14 +5012,14 @@ function pa(e, t, i, s, n, r) {
|
|
|
5007
5012
|
);
|
|
5008
5013
|
}
|
|
5009
5014
|
}
|
|
5010
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5011
|
-
}
|
|
5012
|
-
const
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
],
|
|
5017
|
-
name:
|
|
5015
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? na(e, t, i, s, n, r) : i;
|
|
5016
|
+
}
|
|
5017
|
+
const ma = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", fa = [
|
|
5018
|
+
Xo,
|
|
5019
|
+
Zo,
|
|
5020
|
+
da
|
|
5021
|
+
], ga = "@arcgis/lumina:transformComponents", ha = (e) => ({
|
|
5022
|
+
name: ga,
|
|
5018
5023
|
transform: {
|
|
5019
5024
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5020
5025
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5034,11 +5039,11 @@ const ua = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5034
5039
|
e.apiJsonDeferred === void 0 ? [ne] : [ne, e.apiJsonDeferred.promise]
|
|
5035
5040
|
);
|
|
5036
5041
|
const n = e.getSourceFile(i, t), a = o.transform(n, [
|
|
5037
|
-
(f) => () =>
|
|
5042
|
+
(f) => () => aa(e, f, n, [
|
|
5038
5043
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5039
|
-
...
|
|
5044
|
+
...fa
|
|
5040
5045
|
])
|
|
5041
|
-
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 :
|
|
5046
|
+
]).transformed[0], c = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Et.createSourceMapGenerator(ya, u.basename(i), "", u.dirname(i), {}), l = Et.createTextWriter(`
|
|
5042
5047
|
`);
|
|
5043
5048
|
c.writeFile(a, l, d);
|
|
5044
5049
|
const p = l.getText(), m = d?.toJSON();
|
|
@@ -5048,42 +5053,42 @@ const ua = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5048
5053
|
};
|
|
5049
5054
|
}
|
|
5050
5055
|
}
|
|
5051
|
-
}),
|
|
5056
|
+
}), ya = {
|
|
5052
5057
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5053
|
-
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ?
|
|
5054
|
-
},
|
|
5058
|
+
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? di : (e) => e.toLowerCase()
|
|
5059
|
+
}, va = (e) => ({
|
|
5055
5060
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5056
5061
|
configureServer(t) {
|
|
5057
|
-
e.server = t,
|
|
5062
|
+
e.server = t, Qt(e).forEach(({ assets: i, transformers: s }) => ie(e, i, s));
|
|
5058
5063
|
},
|
|
5059
5064
|
async writeBundle() {
|
|
5060
5065
|
await Promise.all(
|
|
5061
|
-
|
|
5062
|
-
async ({ assets: t, transformers: i }) => await
|
|
5066
|
+
Qt(e).map(
|
|
5067
|
+
async ({ assets: t, transformers: i }) => await ji(e, t, i)
|
|
5063
5068
|
)
|
|
5064
5069
|
);
|
|
5065
5070
|
}
|
|
5066
5071
|
});
|
|
5067
|
-
function
|
|
5072
|
+
function Qt(e) {
|
|
5068
5073
|
const t = [], i = e.assetsToProvide?.filter((s) => s.apply === void 0 || s.apply === e.viteCommand) ?? [];
|
|
5069
5074
|
return e.options.assets?.extra?.forEach((s) => {
|
|
5070
5075
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5071
5076
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5072
5077
|
}
|
|
5073
|
-
const nt = "@arcgis/lumina:updatePackageJson",
|
|
5078
|
+
const nt = "@arcgis/lumina:updatePackageJson", ba = (e) => ({
|
|
5074
5079
|
name: nt,
|
|
5075
5080
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5076
5081
|
configResolved() {
|
|
5077
|
-
|
|
5082
|
+
wa(e).catch(
|
|
5078
5083
|
(t) => T.error(nt, `Failed to update package's package.json:${String(t)}`)
|
|
5079
5084
|
);
|
|
5080
5085
|
}
|
|
5081
5086
|
});
|
|
5082
|
-
async function
|
|
5083
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s =
|
|
5084
|
-
s &&
|
|
5087
|
+
async function wa(e) {
|
|
5088
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = Sa(i, e);
|
|
5089
|
+
s && ai(t, JSON.stringify(s, null, 2));
|
|
5085
5090
|
}
|
|
5086
|
-
function
|
|
5091
|
+
function Sa(e, t) {
|
|
5087
5092
|
const i = e?.devDependencies ?? {};
|
|
5088
5093
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
5089
5094
|
l in i || T.warn(
|
|
@@ -5122,21 +5127,21 @@ function wa(e, t) {
|
|
|
5122
5127
|
if (s)
|
|
5123
5128
|
return e;
|
|
5124
5129
|
}
|
|
5125
|
-
const
|
|
5130
|
+
const Ca = (e) => ({
|
|
5126
5131
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5127
5132
|
timestamp: e.apiJson.timestamp,
|
|
5128
5133
|
compiler: e.apiJson.compiler,
|
|
5129
|
-
components:
|
|
5134
|
+
components: Ea(e),
|
|
5130
5135
|
typeLibrary: {}
|
|
5131
5136
|
});
|
|
5132
|
-
function
|
|
5137
|
+
function Ea(e) {
|
|
5133
5138
|
const t = [];
|
|
5134
5139
|
for (const i of e.apiJson.modules)
|
|
5135
5140
|
for (const s of i.declarations)
|
|
5136
|
-
s.customElement === !0 && t.push(
|
|
5141
|
+
s.customElement === !0 && t.push(Ta(s, i.sourcePath));
|
|
5137
5142
|
return t;
|
|
5138
5143
|
}
|
|
5139
|
-
function
|
|
5144
|
+
function Ta(e, t) {
|
|
5140
5145
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5141
5146
|
return {
|
|
5142
5147
|
filePath: t,
|
|
@@ -5151,9 +5156,9 @@ function Ea(e, t) {
|
|
|
5151
5156
|
dependencies: [],
|
|
5152
5157
|
dependencyGraph: {},
|
|
5153
5158
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5154
|
-
props: e.members.map(
|
|
5155
|
-
methods: e.members.map(
|
|
5156
|
-
events: e.events?.map(
|
|
5159
|
+
props: e.members.map($a).filter(R),
|
|
5160
|
+
methods: e.members.map(Pa).filter(R),
|
|
5161
|
+
events: e.events?.map(ka) ?? [],
|
|
5157
5162
|
styles: e.cssProperties?.map(({ name: s, description: n, deprecated: r }) => ({
|
|
5158
5163
|
name: s,
|
|
5159
5164
|
annotation: "prop",
|
|
@@ -5178,7 +5183,7 @@ function Ve(e, t = "") {
|
|
|
5178
5183
|
}
|
|
5179
5184
|
return t;
|
|
5180
5185
|
}
|
|
5181
|
-
function
|
|
5186
|
+
function $a(e) {
|
|
5182
5187
|
if (e.kind !== "field")
|
|
5183
5188
|
return;
|
|
5184
5189
|
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;
|
|
@@ -5188,7 +5193,7 @@ function Ta(e) {
|
|
|
5188
5193
|
complexType: t.type === void 0 ? void 0 : {
|
|
5189
5194
|
original: t.type.text,
|
|
5190
5195
|
resolved: t.type.text,
|
|
5191
|
-
references:
|
|
5196
|
+
references: vt(t.type.references)
|
|
5192
5197
|
},
|
|
5193
5198
|
mutable: !0,
|
|
5194
5199
|
attr: "attribute" in t && typeof t.attribute == "string" ? t.attribute : void 0,
|
|
@@ -5207,19 +5212,19 @@ function Ta(e) {
|
|
|
5207
5212
|
required: n
|
|
5208
5213
|
};
|
|
5209
5214
|
}
|
|
5210
|
-
const
|
|
5215
|
+
const vt = (e) => Object.fromEntries(
|
|
5211
5216
|
e?.map(
|
|
5212
5217
|
(t) => [
|
|
5213
5218
|
t.name,
|
|
5214
5219
|
{
|
|
5215
|
-
location: t.package ===
|
|
5220
|
+
location: t.package === js ? "global" : t.package === void 0 ? "local" : "import",
|
|
5216
5221
|
path: typeof t.module == "string" && typeof t.package == "string" ? u.join(t.package, t.module) : t.module ?? t.package,
|
|
5217
5222
|
id: "notImplemented"
|
|
5218
5223
|
}
|
|
5219
5224
|
]
|
|
5220
5225
|
) ?? []
|
|
5221
5226
|
);
|
|
5222
|
-
function
|
|
5227
|
+
function Pa(e) {
|
|
5223
5228
|
if (e.kind !== "method")
|
|
5224
5229
|
return;
|
|
5225
5230
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: n, type: r, description: a }) => ({
|
|
@@ -5238,7 +5243,7 @@ function $a(e) {
|
|
|
5238
5243
|
signature: t.signature ?? "()=>unknown",
|
|
5239
5244
|
parameters: s,
|
|
5240
5245
|
return: t.return?.type?.text ?? "void",
|
|
5241
|
-
references:
|
|
5246
|
+
references: vt([
|
|
5242
5247
|
...t.return?.type?.references ?? [],
|
|
5243
5248
|
...t.parameters?.flatMap((n) => n.type.references ?? []) ?? []
|
|
5244
5249
|
])
|
|
@@ -5250,7 +5255,7 @@ function $a(e) {
|
|
|
5250
5255
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5251
5256
|
};
|
|
5252
5257
|
}
|
|
5253
|
-
function
|
|
5258
|
+
function ka(e) {
|
|
5254
5259
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5255
5260
|
return {
|
|
5256
5261
|
event: e.name,
|
|
@@ -5259,7 +5264,7 @@ function Pa(e) {
|
|
|
5259
5264
|
complexType: {
|
|
5260
5265
|
original: e.type.text,
|
|
5261
5266
|
resolved: e.type.text,
|
|
5262
|
-
references:
|
|
5267
|
+
references: vt(e.type.references)
|
|
5263
5268
|
},
|
|
5264
5269
|
cancelable: e.cancelable ?? !0,
|
|
5265
5270
|
composed: e.composed ?? !0,
|
|
@@ -5275,8 +5280,8 @@ const ye = {
|
|
|
5275
5280
|
cssParts: "CSS Parts",
|
|
5276
5281
|
methods: "Methods"
|
|
5277
5282
|
};
|
|
5278
|
-
function
|
|
5279
|
-
const t =
|
|
5283
|
+
function ys(e) {
|
|
5284
|
+
const t = Ia(e.slots), i = xa(e.events), s = Aa(e.cssProperties), n = La(e.cssParts), r = Na(e.members), a = e.description?.trim();
|
|
5280
5285
|
return [...a ? [`${a}
|
|
5281
5286
|
--`] : [], i, r, t, s, n].filter(Boolean).join(`
|
|
5282
5287
|
|
|
@@ -5284,28 +5289,28 @@ function gs(e) {
|
|
|
5284
5289
|
}
|
|
5285
5290
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5286
5291
|
${t.join(`
|
|
5287
|
-
`)}`,
|
|
5292
|
+
`)}`, Ia = (e) => ve(
|
|
5288
5293
|
ye.slots,
|
|
5289
5294
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5290
5295
|
(t) => `- ${t.name ? `**${t.name}**` : "_default_"}${t.description === void 0 ? "" : ` - ${t.description}`}`
|
|
5291
5296
|
)
|
|
5292
|
-
),
|
|
5297
|
+
), xa = (e) => ve(
|
|
5293
5298
|
ye.events,
|
|
5294
5299
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5295
|
-
),
|
|
5300
|
+
), Aa = (e = []) => ve(
|
|
5296
5301
|
ye.cssProperties,
|
|
5297
5302
|
e?.filter((t) => t.deprecated === void 0).map(
|
|
5298
5303
|
(t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5299
5304
|
)
|
|
5300
|
-
),
|
|
5305
|
+
), La = (e) => ve(
|
|
5301
5306
|
ye.cssParts,
|
|
5302
5307
|
e?.filter((t) => t.deprecated === void 0).map((t) => `- **${t.name}**${t.description === void 0 ? "" : ` - ${t.description}`}`)
|
|
5303
|
-
),
|
|
5308
|
+
), Na = (e) => ve(
|
|
5304
5309
|
ye.methods,
|
|
5305
|
-
e.filter(
|
|
5310
|
+
e.filter(Fs).filter((t) => t.deprecated === void 0).map(
|
|
5306
5311
|
(t) => `- \`${t.name}${t.signature}\`${t.description ? ` - ${t.description}` : ""}`
|
|
5307
5312
|
)
|
|
5308
|
-
),
|
|
5313
|
+
), vs = (e) => {
|
|
5309
5314
|
const t = [], i = /* @__PURE__ */ new Set();
|
|
5310
5315
|
for (let s = 0; s < e.length; ++s) {
|
|
5311
5316
|
const n = e[s].cssProperties;
|
|
@@ -5319,13 +5324,13 @@ ${t.join(`
|
|
|
5319
5324
|
}
|
|
5320
5325
|
}
|
|
5321
5326
|
return t;
|
|
5322
|
-
},
|
|
5327
|
+
}, bs = (e) => e.flatMap(
|
|
5323
5328
|
(t) => t.cssParts?.filter((i) => i.deprecated === void 0).map((i) => ({
|
|
5324
5329
|
name: `::part(${i.name})`,
|
|
5325
5330
|
description: t.tagName + (i.description === void 0 ? "" : `: ${i.description}`)
|
|
5326
5331
|
})) ?? []
|
|
5327
5332
|
);
|
|
5328
|
-
function
|
|
5333
|
+
function ja(e) {
|
|
5329
5334
|
if (e.attributes === void 0)
|
|
5330
5335
|
return [];
|
|
5331
5336
|
const t = [];
|
|
@@ -5336,7 +5341,7 @@ function Na(e) {
|
|
|
5336
5341
|
description: s.description || void 0,
|
|
5337
5342
|
default: s.default,
|
|
5338
5343
|
value: {
|
|
5339
|
-
type:
|
|
5344
|
+
type: Fa(
|
|
5340
5345
|
s.type.values?.map(
|
|
5341
5346
|
(n) => n.type === "string" && n.value !== void 0 ? `"${n.value}"` : n.value ?? n.type
|
|
5342
5347
|
)
|
|
@@ -5346,13 +5351,13 @@ function Na(e) {
|
|
|
5346
5351
|
}
|
|
5347
5352
|
return t;
|
|
5348
5353
|
}
|
|
5349
|
-
const
|
|
5350
|
-
function
|
|
5351
|
-
const i =
|
|
5354
|
+
const Fa = (e) => e?.length === 1 ? e[0] : e;
|
|
5355
|
+
function Ra(e, t) {
|
|
5356
|
+
const i = Da(e), s = vs(e), n = bs(e), r = j();
|
|
5352
5357
|
return {
|
|
5353
5358
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5354
5359
|
name: r.name,
|
|
5355
|
-
version: r.version,
|
|
5360
|
+
version: pt(r) ?? r.version,
|
|
5356
5361
|
"description-markup": "markdown",
|
|
5357
5362
|
"default-icon": t.defaultIcon,
|
|
5358
5363
|
contributions: {
|
|
@@ -5366,113 +5371,113 @@ function Fa(e, t) {
|
|
|
5366
5371
|
}
|
|
5367
5372
|
};
|
|
5368
5373
|
}
|
|
5369
|
-
const
|
|
5374
|
+
const Da = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5370
5375
|
name: t.tagName,
|
|
5371
|
-
description:
|
|
5376
|
+
description: ys(t),
|
|
5372
5377
|
"doc-url": t.demos?.[0]?.url,
|
|
5373
|
-
attributes:
|
|
5378
|
+
attributes: ja(t),
|
|
5374
5379
|
slots: t.slots?.map((i) => ({
|
|
5375
5380
|
name: i.name,
|
|
5376
5381
|
description: i.description
|
|
5377
5382
|
})),
|
|
5378
5383
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5379
|
-
events:
|
|
5384
|
+
events: Zt(t),
|
|
5380
5385
|
js: {
|
|
5381
|
-
properties:
|
|
5382
|
-
events:
|
|
5386
|
+
properties: Oa(t),
|
|
5387
|
+
events: Zt(t)
|
|
5383
5388
|
}
|
|
5384
|
-
})),
|
|
5389
|
+
})), Oa = (e) => e.members.filter(Rs).filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5385
5390
|
name: t.name,
|
|
5386
5391
|
description: t.description,
|
|
5387
5392
|
type: t.type?.text
|
|
5388
|
-
})) ?? [],
|
|
5393
|
+
})) ?? [], Zt = (e) => e.events?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5389
5394
|
name: t.name,
|
|
5390
5395
|
type: t.type?.text,
|
|
5391
5396
|
description: t.description
|
|
5392
|
-
})) ?? [],
|
|
5397
|
+
})) ?? [], Ma = (e) => e.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5393
5398
|
name: t.tagName,
|
|
5394
|
-
description:
|
|
5395
|
-
attributes:
|
|
5399
|
+
description: ys(t),
|
|
5400
|
+
attributes: Ja(t),
|
|
5396
5401
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5397
|
-
})),
|
|
5402
|
+
})), Ja = (e) => e.attributes?.filter((t) => t.deprecated === void 0).map((t) => ({
|
|
5398
5403
|
name: t.name,
|
|
5399
5404
|
description: t.description || void 0,
|
|
5400
|
-
values:
|
|
5401
|
-
})) ?? [],
|
|
5405
|
+
values: Ba(t)
|
|
5406
|
+
})) ?? [], Ba = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], _a = (e) => ({
|
|
5402
5407
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5403
5408
|
version: 1.1,
|
|
5404
|
-
tags:
|
|
5405
|
-
}),
|
|
5409
|
+
tags: Ma(e)
|
|
5410
|
+
}), Ka = (e) => ({
|
|
5406
5411
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5407
5412
|
version: 1.1,
|
|
5408
|
-
properties:
|
|
5409
|
-
pseudoElements:
|
|
5410
|
-
}),
|
|
5411
|
-
function
|
|
5413
|
+
properties: vs(e),
|
|
5414
|
+
pseudoElements: bs(e)
|
|
5415
|
+
}), Wa = "@arcgis/lumina:generateDocs";
|
|
5416
|
+
function Ua(e) {
|
|
5412
5417
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5413
5418
|
{
|
|
5414
5419
|
type: "dynamic",
|
|
5415
|
-
source: () => JSON.stringify(
|
|
5420
|
+
source: () => JSON.stringify(Ca(e), null, rt(e)),
|
|
5416
5421
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5417
5422
|
}
|
|
5418
5423
|
]), {
|
|
5419
|
-
name:
|
|
5424
|
+
name: Wa,
|
|
5420
5425
|
async writeBundle() {
|
|
5421
5426
|
if (e.isInStorybook)
|
|
5422
5427
|
return;
|
|
5423
5428
|
const t = rt(e), { jetBrains: i } = e.options.documentation ?? {}, s = e._documentationFileNames, n = s.vsCodeHtml === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeHtml), r = s.vsCodeCss === void 0 ? void 0 : u.join(e.dir.dist, s.vsCodeCss), a = s.webTypes === void 0 ? void 0 : u.join(e.dir.dist, s.webTypes), c = [n, r, a].filter(R);
|
|
5424
5429
|
if (c.length === 0)
|
|
5425
5430
|
return;
|
|
5426
|
-
await
|
|
5431
|
+
await Mi(c);
|
|
5427
5432
|
const d = [];
|
|
5428
5433
|
if (n !== void 0) {
|
|
5429
|
-
const l = JSON.stringify(
|
|
5434
|
+
const l = JSON.stringify(_a(e.apiJsonComponents), null, t);
|
|
5430
5435
|
d.push(K(n, l));
|
|
5431
5436
|
}
|
|
5432
5437
|
if (r !== void 0) {
|
|
5433
|
-
const l = JSON.stringify(
|
|
5438
|
+
const l = JSON.stringify(Ka(e.apiJsonComponents), null, t);
|
|
5434
5439
|
d.push(K(r, l));
|
|
5435
5440
|
}
|
|
5436
5441
|
if (a !== void 0) {
|
|
5437
|
-
const l =
|
|
5442
|
+
const l = Ra(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5438
5443
|
d.push(K(a, JSON.stringify(l, null, t)));
|
|
5439
5444
|
}
|
|
5440
5445
|
await Promise.all(d);
|
|
5441
5446
|
}
|
|
5442
5447
|
};
|
|
5443
5448
|
}
|
|
5444
|
-
function
|
|
5449
|
+
function za(e) {
|
|
5445
5450
|
return {
|
|
5446
5451
|
name: "@arcgis/lumina:buildWrappers",
|
|
5447
5452
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5448
5453
|
async writeBundle() {
|
|
5449
5454
|
e.isInStorybook || await Promise.all(
|
|
5450
5455
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5451
|
-
t.type === "react18" && await
|
|
5456
|
+
t.type === "react18" && await Va(e, t);
|
|
5452
5457
|
}) ?? []
|
|
5453
5458
|
);
|
|
5454
5459
|
}
|
|
5455
5460
|
};
|
|
5456
5461
|
}
|
|
5457
|
-
const
|
|
5458
|
-
import React from "${
|
|
5459
|
-
import { createComponent } from "${
|
|
5460
|
-
import type { EventName } from "${
|
|
5462
|
+
const Ha = "react", ei = "@lit/react", qa = `
|
|
5463
|
+
import React from "${Ha}";
|
|
5464
|
+
import { createComponent } from "${ei}";
|
|
5465
|
+
import type { EventName } from "${ei}";
|
|
5461
5466
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5462
5467
|
|
|
5463
5468
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5464
5469
|
`;
|
|
5465
|
-
async function
|
|
5470
|
+
async function Va(e, t) {
|
|
5466
5471
|
const { name: i } = j(), s = [];
|
|
5467
5472
|
for (const a of e.apiJson.modules)
|
|
5468
5473
|
for (const c of a.declarations)
|
|
5469
|
-
c.customElement === !0 && s.push(
|
|
5470
|
-
const n = [`/// <reference types="${i}" preserve="true" />`,
|
|
5474
|
+
c.customElement === !0 && s.push(Ga(c));
|
|
5475
|
+
const n = [`/// <reference types="${i}" preserve="true" />`, qa, ...s].join(""), r = u.resolve(t.proxiesFile);
|
|
5471
5476
|
await X(u.dirname(r), { recursive: !0 }), await K(r, n);
|
|
5472
5477
|
}
|
|
5473
|
-
function
|
|
5478
|
+
function Ga(e) {
|
|
5474
5479
|
const t = e.events?.map(
|
|
5475
|
-
(i) => ` ${
|
|
5480
|
+
(i) => ` ${Vs(`on${Cs(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5476
5481
|
).join(`
|
|
5477
5482
|
`);
|
|
5478
5483
|
return `
|
|
@@ -5487,42 +5492,42 @@ ${t}
|
|
|
5487
5492
|
);
|
|
5488
5493
|
`;
|
|
5489
5494
|
}
|
|
5490
|
-
function
|
|
5495
|
+
function Tc(e = {}) {
|
|
5491
5496
|
const t = new $(e), s = [
|
|
5492
5497
|
t._plugin,
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
Rn(t),
|
|
5498
|
-
Wa(t),
|
|
5499
|
-
ga(t),
|
|
5500
|
-
fo(t),
|
|
5501
|
-
gr(t),
|
|
5498
|
+
Un(t),
|
|
5499
|
+
Xn(t),
|
|
5500
|
+
eo(t),
|
|
5501
|
+
ba(t),
|
|
5502
5502
|
Dn(t),
|
|
5503
|
-
ya(t),
|
|
5504
|
-
ho(t),
|
|
5505
|
-
ro(t),
|
|
5506
|
-
Gs(t),
|
|
5507
|
-
pn(t),
|
|
5508
5503
|
Ua(t),
|
|
5509
|
-
|
|
5504
|
+
ha(t),
|
|
5505
|
+
go(t),
|
|
5506
|
+
hr(t),
|
|
5507
|
+
On(t),
|
|
5508
|
+
va(t),
|
|
5509
|
+
yo(t),
|
|
5510
|
+
no(t),
|
|
5511
|
+
Xs(t),
|
|
5512
|
+
un(t),
|
|
5513
|
+
za(t),
|
|
5514
|
+
Mn(t)
|
|
5510
5515
|
].filter(R);
|
|
5511
5516
|
return s.context = t, s;
|
|
5512
5517
|
}
|
|
5513
|
-
const
|
|
5514
|
-
initializeComponentDependencies:
|
|
5515
|
-
updateLuminaTs:
|
|
5518
|
+
const $c = {
|
|
5519
|
+
initializeComponentDependencies: Pi,
|
|
5520
|
+
updateLuminaTs: Qi,
|
|
5516
5521
|
propertyToAttributeMappings: W,
|
|
5517
|
-
nativeEvents:
|
|
5522
|
+
nativeEvents: fi,
|
|
5518
5523
|
svgElements: at,
|
|
5519
5524
|
mathMlElements: ct,
|
|
5520
|
-
alwaysAttributes:
|
|
5521
|
-
nativeAlwaysAttributes:
|
|
5525
|
+
alwaysAttributes: pi,
|
|
5526
|
+
nativeAlwaysAttributes: ui,
|
|
5522
5527
|
htmlAlwaysAttributes: Qe
|
|
5523
5528
|
};
|
|
5524
5529
|
export {
|
|
5525
|
-
|
|
5530
|
+
$c as exportsForCodemod,
|
|
5526
5531
|
De as inferCdnUrl,
|
|
5527
|
-
|
|
5532
|
+
Tc as useLumina
|
|
5528
5533
|
};
|