@arcgis/lumina-compiler 5.2.0-next.89 → 5.2.0-next.90
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 +240 -233
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -6,17 +6,17 @@ import { camelToKebab as ei, getPreamble as bs, uncapitalize as wt, capitalize a
|
|
|
6
6
|
import { lazyMetaSubItemJoiner as Ss, lazyMetaItemJoiner as Be, lazyMetaGroupJoiner as Cs, propertyFlagAttribute as St, propertyFlagReflect as Es, propertyFlagBoolean as Ts, propertyFlagNumber as $s, propertyFlagState as Ps, propertyFlagReadOnly as ks, propertyFlagNoAccessor as Is, propertyFlagUseDefault as xs } from "@arcgis/lumina/config";
|
|
7
7
|
import { path as u, isPosix as ti, toPosixPathSeparators as G, toSystemPathSeparators as Re, getCwd as ii } from "@arcgis/node-toolkit/path";
|
|
8
8
|
import { isApiMethodAsync as As, globalPackageIdentifier as Ls, isApiMethod as Ns, isApiProperty as js } from "@arcgis/api-extractor/utils/apiHelpers";
|
|
9
|
-
import { existsAsync as
|
|
10
|
-
import { readFile as z, readdir as ot, mkdir as X, writeFile as
|
|
9
|
+
import { existsAsync as _, findPath as si } from "@arcgis/node-toolkit/file";
|
|
10
|
+
import { readFile as z, readdir as ot, mkdir as X, writeFile as K, copyFile as Fs, rm as Rs, cp as Ds } from "node:fs/promises";
|
|
11
11
|
import { retrievePackageJson as j, fetchPackageLocation as $e, asyncRetrievePackageJson as ri } from "@arcgis/node-toolkit/packageJson";
|
|
12
12
|
import { build as Os } from "esbuild";
|
|
13
13
|
import Ms from "mime-types";
|
|
14
14
|
import { forEachWithConcurrency as Js } from "@arcgis/toolkit/promise";
|
|
15
15
|
import { glob as Bs } from "tinyglobby";
|
|
16
16
|
import { renameComponentFolder as Ge } from "@arcgis/api-extractor/extractor/webComponent/pathMapping";
|
|
17
|
-
import { useApiExtractor as
|
|
17
|
+
import { useApiExtractor as _s } from "@arcgis/api-extractor/vite/plugin";
|
|
18
18
|
import { writeFileSync as ni } from "node:fs";
|
|
19
|
-
import { styleText as
|
|
19
|
+
import { styleText as Ks } from "node:util";
|
|
20
20
|
import { unsafeGetUndocumentedPrinter as Ws, unsafeUndocumentedTs as Ct } from "@arcgis/api-extractor/utils/internalTypeScriptApis";
|
|
21
21
|
import { pathIsComponentEntrypoint as Pe } from "@arcgis/api-extractor/extractor/webComponent/findComponents";
|
|
22
22
|
import { loadApiExtractorConfig as Us, mergeApiExtractorConfigs as Et } from "@arcgis/api-extractor/extractor/config";
|
|
@@ -42,7 +42,7 @@ function Vs(e) {
|
|
|
42
42
|
e.isInStorybook && (i.resolveId = void 0);
|
|
43
43
|
}, i;
|
|
44
44
|
}
|
|
45
|
-
const Gs = "Fragment",
|
|
45
|
+
const Gs = "Fragment", _e = "DynamicHtmlTag", Ke = "DynamicSvgTag", ke = /* @__PURE__ */ Symbol("dynamic html tag name"), Ye = /* @__PURE__ */ Symbol("dynamic svg tag name"), li = /* @__PURE__ */ new Set([
|
|
46
46
|
/**
|
|
47
47
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
48
48
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -1442,7 +1442,7 @@ const Rr = /* @__PURE__ */ new Set([
|
|
|
1442
1442
|
let xe, et, re;
|
|
1443
1443
|
async function Pi(e, t) {
|
|
1444
1444
|
const i = await $e(e, t), s = await ri(i), r = "exports" in s, n = Hr.bind(void 0, r), a = "@stencil/core" in (s.dependencies ?? {}) || "@stencil/core" in (s.devDependencies ?? {}), l = u.join(i, "dist/esm/loader.js");
|
|
1445
|
-
if (a ? await
|
|
1445
|
+
if (a ? await _(l) : !1) {
|
|
1446
1446
|
const g = await z(l, "utf8"), h = Dr(g, "bootstrapLazy("), y = g.indexOf(", options", h), v = g.slice(h, y), w = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
1447
1447
|
try {
|
|
1448
1448
|
const C = JSON.parse(w), E = Ur(C, { packageName: e, getImportPath: n });
|
|
@@ -1469,7 +1469,7 @@ Error: ${String(C)}`);
|
|
|
1469
1469
|
return { type: "unknown", packageName: e, components: y, packageLocation: i, packageJson: s };
|
|
1470
1470
|
}
|
|
1471
1471
|
const m = u.join(i, "dist/components");
|
|
1472
|
-
if (await
|
|
1472
|
+
if (await _(m)) {
|
|
1473
1473
|
const g = await zr(m, {
|
|
1474
1474
|
packageName: e,
|
|
1475
1475
|
getImportPath: n
|
|
@@ -1534,7 +1534,7 @@ const Or = (e) => (
|
|
|
1534
1534
|
}
|
|
1535
1535
|
]
|
|
1536
1536
|
) ?? []
|
|
1537
|
-
), Jr = 1, Br = 2,
|
|
1537
|
+
), Jr = 1, Br = 2, _r = 4, Kr = 8, Wr = Jr | Br | _r | Kr, Ur = (e, t) => Object.fromEntries(
|
|
1538
1538
|
e.flatMap(
|
|
1539
1539
|
([i, s]) => s.map(
|
|
1540
1540
|
([r, n, a]) => [
|
|
@@ -1613,7 +1613,7 @@ async function xi(e, t, i = pt) {
|
|
|
1613
1613
|
else if (r.type === "dynamic") {
|
|
1614
1614
|
await X(u.dirname(n), { recursive: !0 });
|
|
1615
1615
|
const a = await Promise.resolve(r.source());
|
|
1616
|
-
await
|
|
1616
|
+
await K(n, a);
|
|
1617
1617
|
}
|
|
1618
1618
|
})
|
|
1619
1619
|
);
|
|
@@ -1632,7 +1632,7 @@ async function Pt(e, t, i, s) {
|
|
|
1632
1632
|
await Fs(e, t);
|
|
1633
1633
|
else {
|
|
1634
1634
|
const n = await z(e, "utf8"), a = r.transform(n, t, s);
|
|
1635
|
-
await
|
|
1635
|
+
await K(t, a);
|
|
1636
1636
|
}
|
|
1637
1637
|
}
|
|
1638
1638
|
function Li(e) {
|
|
@@ -1794,7 +1794,7 @@ const rn = -1, nn = -2, on = /["']\.\.?\/[^'"]+/gu, an = (e, t, i, s) => e.repla
|
|
|
1794
1794
|
};
|
|
1795
1795
|
async function cn(e, t, i) {
|
|
1796
1796
|
const s = u.resolve(e.dir.root, t);
|
|
1797
|
-
e.viteConfig.build.emptyOutDir !== !1 && await
|
|
1797
|
+
e.viteConfig.build.emptyOutDir !== !1 && await _(s) && await Rs(s, { recursive: !0, force: !0 }), await X(s, { recursive: !0 }), await Ds(e.dir.distCdn, u.join(s, "build"), { recursive: !0 });
|
|
1798
1798
|
const r = [
|
|
1799
1799
|
"index.html",
|
|
1800
1800
|
...await Bs("**/*.html", {
|
|
@@ -1831,7 +1831,7 @@ async function cn(e, t, i) {
|
|
|
1831
1831
|
if (C === Number.POSITIVE_INFINITY)
|
|
1832
1832
|
throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
|
|
1833
1833
|
const E = y.slice(0, C) + w + y.slice(C), P = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
|
|
1834
|
-
await
|
|
1834
|
+
await K(h, P, "utf-8");
|
|
1835
1835
|
})
|
|
1836
1836
|
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
1837
1837
|
}
|
|
@@ -2059,7 +2059,7 @@ ${p.text}`
|
|
|
2059
2059
|
c.set(f, X(n + f, { recursive: !0 }));
|
|
2060
2060
|
}
|
|
2061
2061
|
}
|
|
2062
|
-
await Promise.all(c.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await
|
|
2062
|
+
await Promise.all(c.values()), await Promise.all(Array.from(d.entries(), async ([p, { code: m }]) => await K(n + p, m)));
|
|
2063
2063
|
}
|
|
2064
2064
|
const un = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
2065
2065
|
function mn(e, t) {
|
|
@@ -2119,7 +2119,7 @@ function Mi(e, t) {
|
|
|
2119
2119
|
r.push(D), a.push([l, D.length, 0, ""]);
|
|
2120
2120
|
}
|
|
2121
2121
|
if (l = S.index + A.length, B)
|
|
2122
|
-
a.push([S.index, A.length, 0, ""]), s.push(`"${
|
|
2122
|
+
a.push([S.index, A.length, 0, ""]), s.push(`"${_i(N.slice(Le.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? U ?? F ?? "");
|
|
2123
2123
|
else {
|
|
2124
2124
|
const D = Bi(N, t), M = D?.isAsync === !0;
|
|
2125
2125
|
if (L !== void 0) {
|
|
@@ -2202,7 +2202,7 @@ function Bi(e, t) {
|
|
|
2202
2202
|
function xt(e, t) {
|
|
2203
2203
|
return e.replaceAll(hn, (i, s) => {
|
|
2204
2204
|
if (s.startsWith(Le))
|
|
2205
|
-
return `$arcgis.t(m=>m[0],"${
|
|
2205
|
+
return `$arcgis.t(m=>m[0],"${_i(s.slice(Le.length))}")`;
|
|
2206
2206
|
if (s.startsWith("./")) {
|
|
2207
2207
|
const r = Bi(s, t);
|
|
2208
2208
|
if (r?.isAsync === !0)
|
|
@@ -2211,7 +2211,7 @@ function xt(e, t) {
|
|
|
2211
2211
|
return i;
|
|
2212
2212
|
});
|
|
2213
2213
|
}
|
|
2214
|
-
const hn = /(?<![.\w\d])import\("([^"]+)"\)/gu,
|
|
2214
|
+
const hn = /(?<![.\w\d])import\("([^"]+)"\)/gu, _i = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
2215
2215
|
function yn(e) {
|
|
2216
2216
|
const t = [it];
|
|
2217
2217
|
return () => {
|
|
@@ -2222,11 +2222,11 @@ function yn(e) {
|
|
|
2222
2222
|
}
|
|
2223
2223
|
};
|
|
2224
2224
|
}
|
|
2225
|
-
const it = 0, mt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",
|
|
2225
|
+
const it = 0, mt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Ki = `${mt}0123456789`, vn = mt.length, bn = Ki.length;
|
|
2226
2226
|
function wn(e) {
|
|
2227
2227
|
let t = mt[e[0]];
|
|
2228
2228
|
for (let i = 1; i < e.length; ++i)
|
|
2229
|
-
t +=
|
|
2229
|
+
t += Ki[e[i]];
|
|
2230
2230
|
return t;
|
|
2231
2231
|
}
|
|
2232
2232
|
function Sn(e) {
|
|
@@ -2319,9 +2319,9 @@ async function Wi(e) {
|
|
|
2319
2319
|
}
|
|
2320
2320
|
async function At(e, t) {
|
|
2321
2321
|
const i = u.join(e, t, `${t}.css`), s = u.join(e, t, "assets"), r = u.join(e, t, `${t}.esm.js`), [n, a, l] = await Promise.all([
|
|
2322
|
-
|
|
2323
|
-
|
|
2324
|
-
|
|
2322
|
+
_(i),
|
|
2323
|
+
_(s),
|
|
2324
|
+
_(r)
|
|
2325
2325
|
]);
|
|
2326
2326
|
return n || a || l ? {
|
|
2327
2327
|
hasCss: n,
|
|
@@ -2466,7 +2466,7 @@ setupLuminaTest();
|
|
|
2466
2466
|
let Ne;
|
|
2467
2467
|
function jn(e) {
|
|
2468
2468
|
const t = /[\\\/]src[\\\/]loader\.ts$/u;
|
|
2469
|
-
return [
|
|
2469
|
+
return [_s(e.apiExtractorPluginConfig), {
|
|
2470
2470
|
name: Nn,
|
|
2471
2471
|
configResolved() {
|
|
2472
2472
|
Ne = `${e.dir.root}src/loader.ts`;
|
|
@@ -2550,10 +2550,10 @@ function Fn(e) {
|
|
|
2550
2550
|
};
|
|
2551
2551
|
}
|
|
2552
2552
|
async function Rt(e) {
|
|
2553
|
-
const t =
|
|
2553
|
+
const t = _("assets"), i = await e.componentFilesPromise, s = await Promise.all(
|
|
2554
2554
|
i.map(async (r) => {
|
|
2555
2555
|
const n = u.dirname(r), a = u.join(n, "assets");
|
|
2556
|
-
return await
|
|
2556
|
+
return await _(a) ? zi(a, n) : void 0;
|
|
2557
2557
|
})
|
|
2558
2558
|
);
|
|
2559
2559
|
return await t && s.push(Hi), s.filter(R);
|
|
@@ -2614,11 +2614,11 @@ const zi = (e, t) => ({
|
|
|
2614
2614
|
}), Dt = "\x1B[22m\x1B[1m\x1B[22m", Ot = "\x1B[2m", Dn = "\x1B[22m\x1B[36m", On = /\d+(?:,\d+)?\.\d{2} kB/gu, Mn = /\x1B\[\d+m/gu, Jn = new Intl.NumberFormat("en", {
|
|
2615
2615
|
maximumFractionDigits: 2,
|
|
2616
2616
|
minimumFractionDigits: 2
|
|
2617
|
-
}), Mt = (e) => `${Jn.format(e)} kB`, Bn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ut.slice(0, -3))), qi = "packages/core-packages/core/src",
|
|
2617
|
+
}), Mt = (e) => `${Jn.format(e)} kB`, Bn = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", ut.slice(0, -3))), qi = "packages/core-packages/core/src", _n = "packages/core-packages/core/output/npm/esm", de = !import.meta.url.includes("node_modules");
|
|
2618
2618
|
function Vi({ command: e }) {
|
|
2619
2619
|
return e === "serve" && process.argv.includes("--local-core");
|
|
2620
2620
|
}
|
|
2621
|
-
const Jt = "@arcgis/lumina:configureVite",
|
|
2621
|
+
const Jt = "@arcgis/lumina:configureVite", Kn = (e) => ({
|
|
2622
2622
|
name: Jt,
|
|
2623
2623
|
async config({
|
|
2624
2624
|
server: t,
|
|
@@ -2869,13 +2869,13 @@ function Vn(e) {
|
|
|
2869
2869
|
name: Se,
|
|
2870
2870
|
enforce: "pre",
|
|
2871
2871
|
apply(l) {
|
|
2872
|
-
const d =
|
|
2872
|
+
const d = Yn(e, l);
|
|
2873
2873
|
return d || (e._localCdnCore = void 0), d;
|
|
2874
2874
|
},
|
|
2875
2875
|
config: {
|
|
2876
2876
|
order: "post",
|
|
2877
2877
|
handler(l, d) {
|
|
2878
|
-
const c = l.server, p = Vi(d), m = p ? qi :
|
|
2878
|
+
const c = l.server, p = Vi(d), m = p ? qi : _n, f = si(m, import.meta.dirname);
|
|
2879
2879
|
if (f === void 0)
|
|
2880
2880
|
throw Error(b(Se, `Unable to find ${m}.`));
|
|
2881
2881
|
return e._localCdnCore = p ? { packageLocation: u.dirname(f), sourceLocation: f } : { packageLocation: f }, {
|
|
@@ -2907,35 +2907,42 @@ function Vn(e) {
|
|
|
2907
2907
|
return `import ${JSON.stringify(s)};
|
|
2908
2908
|
`;
|
|
2909
2909
|
if (l === n)
|
|
2910
|
-
return await
|
|
2910
|
+
return await Xn(e);
|
|
2911
2911
|
}
|
|
2912
|
+
},
|
|
2913
|
+
handleHotUpdate({ file: l, server: d }) {
|
|
2914
|
+
if (Gn(l, e._localCdnCore?.sourceLocation))
|
|
2915
|
+
return d.ws.send({ type: "full-reload" }), [];
|
|
2912
2916
|
}
|
|
2913
2917
|
};
|
|
2914
2918
|
}
|
|
2915
2919
|
function je(e) {
|
|
2916
2920
|
return new RegExp(`^${RegExp.escape(e)}$`, "u");
|
|
2917
2921
|
}
|
|
2918
|
-
|
|
2922
|
+
function Gn(e, t) {
|
|
2923
|
+
return t !== void 0 && e.startsWith(u.join(t, u.sep));
|
|
2924
|
+
}
|
|
2925
|
+
async function Xn(e) {
|
|
2919
2926
|
const t = e.viteConfig.server, i = t.origin?.replace(/\/$/u, "") ?? `${t.https ? "https" : "http"}://localhost:${String(t.port)}`;
|
|
2920
2927
|
return `${(await ne(e, `${i}/`)).flatMap((r) => "javascriptCode" in r ? r.javascriptCode : []).join(`
|
|
2921
2928
|
`)}
|
|
2922
2929
|
`;
|
|
2923
2930
|
}
|
|
2924
|
-
function
|
|
2931
|
+
function Yn(e, t) {
|
|
2925
2932
|
return de && e.viteCommand === "serve" && !e.isInTest && t.resolve?.conditions?.includes("storybook") !== !0 && t.server?.middlewareMode !== !0;
|
|
2926
2933
|
}
|
|
2927
|
-
const
|
|
2934
|
+
const Qn = (e) => ({
|
|
2928
2935
|
name: "@arcgis/lumina:setAssetPath",
|
|
2929
2936
|
apply: () => e.viteCommand === "build",
|
|
2930
2937
|
config: (t) => ({
|
|
2931
2938
|
base: t.base ?? e.options.assets?.defaultPath ?? De()
|
|
2932
2939
|
})
|
|
2933
2940
|
});
|
|
2934
|
-
function
|
|
2941
|
+
function Zn(e = j()) {
|
|
2935
2942
|
const t = e.version ?? "0.0.1";
|
|
2936
2943
|
return bs(t);
|
|
2937
2944
|
}
|
|
2938
|
-
const
|
|
2945
|
+
const eo = (e) => `/* ${e} */`, k = (e) => (t, i) => {
|
|
2939
2946
|
Object.defineProperty(t, i, {
|
|
2940
2947
|
get() {
|
|
2941
2948
|
throw Error(
|
|
@@ -2975,7 +2982,7 @@ const ue = {
|
|
|
2975
2982
|
stencilLikeDocsJson: "docs/docs.json"
|
|
2976
2983
|
}, rt = (e) => e.viteConfig.root.includes("/test-packages/") ? 2 : void 0;
|
|
2977
2984
|
async function Xi(e, t, i = j()) {
|
|
2978
|
-
const s =
|
|
2985
|
+
const s = to(e, i), r = u.join(t, "lumina.ts"), a = await _(r) ? await z(r, "utf8") : "";
|
|
2979
2986
|
if (a.trim().replaceAll(`\r
|
|
2980
2987
|
`, `
|
|
2981
2988
|
`) === s.trim())
|
|
@@ -2995,7 +3002,7 @@ ${a}`
|
|
|
2995
3002
|
);
|
|
2996
3003
|
return ni(r, s), !0;
|
|
2997
3004
|
}
|
|
2998
|
-
function
|
|
3005
|
+
function to(e, t = j()) {
|
|
2999
3006
|
const i = e.filter((d) => d.type === "@arcgis/lumina").map((d) => `
|
|
3000
3007
|
/// <reference types="${d.packageName}/types/lumina" />`), s = e.filter((d) => d.type === "stencil"), r = s.map(
|
|
3001
3008
|
(d, c) => `
|
|
@@ -3006,7 +3013,7 @@ declare module "@arcgis/lumina" {
|
|
|
3006
3013
|
interface ImportStencilElements extends ${s.map((d, c) => `JSX$${c}.IntrinsicElements`).join(", ")} {}
|
|
3007
3014
|
}`, a = t.devDependencies ?? {};
|
|
3008
3015
|
return [
|
|
3009
|
-
|
|
3016
|
+
io,
|
|
3010
3017
|
a.vitest ? `
|
|
3011
3018
|
/// <reference types="vitest/config" />
|
|
3012
3019
|
/// <reference types="vitest/browser" />` : "",
|
|
@@ -3017,7 +3024,7 @@ declare module "@arcgis/lumina" {
|
|
|
3017
3024
|
`
|
|
3018
3025
|
].join("");
|
|
3019
3026
|
}
|
|
3020
|
-
const
|
|
3027
|
+
const io = `/**
|
|
3021
3028
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
3022
3029
|
* Manual edits will be overwritten.
|
|
3023
3030
|
*
|
|
@@ -3036,13 +3043,13 @@ const to = `/**
|
|
|
3036
3043
|
* is doing:
|
|
3037
3044
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
3038
3045
|
*/
|
|
3039
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
3046
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, so = (e) => ({
|
|
3040
3047
|
name: Ce,
|
|
3041
3048
|
async configureServer(t) {
|
|
3042
3049
|
H && (e.server = t, await tn(e));
|
|
3043
3050
|
},
|
|
3044
3051
|
configResolved() {
|
|
3045
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
3052
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = ro(e).catch(
|
|
3046
3053
|
(t) => T.error(Ce, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
3047
3054
|
));
|
|
3048
3055
|
},
|
|
@@ -3092,25 +3099,25 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
3092
3099
|
await e._updateLuminaTsPromise;
|
|
3093
3100
|
}
|
|
3094
3101
|
});
|
|
3095
|
-
async function
|
|
3102
|
+
async function ro(e) {
|
|
3096
3103
|
const i = (await Promise.all([re, Ui(e)])).flat();
|
|
3097
3104
|
if (!await Xi(i, e.dir.src))
|
|
3098
3105
|
return;
|
|
3099
3106
|
let r = !1;
|
|
3100
3107
|
function n() {
|
|
3101
|
-
r || T.warn(Ce,
|
|
3108
|
+
r || T.warn(Ce, no), r = !0;
|
|
3102
3109
|
}
|
|
3103
3110
|
process.on("exit", () => {
|
|
3104
3111
|
n(), clearTimeout(l);
|
|
3105
3112
|
});
|
|
3106
3113
|
const l = setTimeout(n, 2e3);
|
|
3107
3114
|
}
|
|
3108
|
-
const
|
|
3115
|
+
const no = Ks(
|
|
3109
3116
|
"greenBright",
|
|
3110
3117
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
3111
3118
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
3112
3119
|
);
|
|
3113
|
-
async function
|
|
3120
|
+
async function oo(e) {
|
|
3114
3121
|
const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Us(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : Et(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
|
|
3115
3122
|
e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? pe(e.options.documentation.apiJsonFileName) : ue.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
3116
3123
|
{
|
|
@@ -3225,10 +3232,10 @@ function Bt(e, t) {
|
|
|
3225
3232
|
}
|
|
3226
3233
|
e._localDefinedComponents = void 0, e.privateApiJson = t, e.apiJsonComponents = s, e.apiJson = i, r !== void 0 && (e.componentFilesPromise = Promise.resolve(r));
|
|
3227
3234
|
}
|
|
3228
|
-
var
|
|
3235
|
+
var ao = Object.defineProperty, I = (e, t, i, s) => {
|
|
3229
3236
|
for (var r = void 0, n = e.length - 1, a; n >= 0; n--)
|
|
3230
3237
|
(a = e[n]) && (r = a(t, i, r) || r);
|
|
3231
|
-
return r &&
|
|
3238
|
+
return r && ao(t, i, r), r;
|
|
3232
3239
|
};
|
|
3233
3240
|
const V = "@arcgis/lumina:context";
|
|
3234
3241
|
class $ {
|
|
@@ -3305,7 +3312,7 @@ class $ {
|
|
|
3305
3312
|
webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? pe(i.jetBrains.webTypesFileName) : ue.webTypes,
|
|
3306
3313
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? pe(i.vsCode.htmlFileName) : ue.vsCodeHtml,
|
|
3307
3314
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? pe(i.vsCode.cssFileName) : ue.vsCodeCss
|
|
3308
|
-
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise =
|
|
3315
|
+
}, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = oo(this);
|
|
3309
3316
|
const s = process.cwd().length + 1;
|
|
3310
3317
|
this.componentFilesPromise = this.configsPromise.then(() => {
|
|
3311
3318
|
const n = this.apiExtractorPluginConfig.unsafeConfigOverride.types.typeScriptConfig.config.fileNames, a = [];
|
|
@@ -3315,8 +3322,8 @@ class $ {
|
|
|
3315
3322
|
}
|
|
3316
3323
|
return a;
|
|
3317
3324
|
}), Ti(void 0, t);
|
|
3318
|
-
const r = t.build?.preamble ??
|
|
3319
|
-
this.banner =
|
|
3325
|
+
const r = t.build?.preamble ?? Zn();
|
|
3326
|
+
this.banner = eo(r);
|
|
3320
3327
|
}
|
|
3321
3328
|
_inferBuildSetup({ command: t, mode: i }, s) {
|
|
3322
3329
|
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(Ei.name, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -3467,7 +3474,7 @@ I([
|
|
|
3467
3474
|
I([
|
|
3468
3475
|
k("configResolved()")
|
|
3469
3476
|
], $.prototype, "_typeScriptPrinter");
|
|
3470
|
-
function
|
|
3477
|
+
function co(e, t, i) {
|
|
3471
3478
|
const s = $i()[t] ?? Qi(e)[t];
|
|
3472
3479
|
if (s === void 0) {
|
|
3473
3480
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
@@ -3482,7 +3489,7 @@ function ao(e, t, i) {
|
|
|
3482
3489
|
}
|
|
3483
3490
|
return s;
|
|
3484
3491
|
}
|
|
3485
|
-
function
|
|
3492
|
+
function lo(e, t) {
|
|
3486
3493
|
return e.packageName === void 0 ? he(t, e.modulePath) : u.join(e.packageName, e.modulePath);
|
|
3487
3494
|
}
|
|
3488
3495
|
function Qi(e) {
|
|
@@ -3497,19 +3504,19 @@ function Qi(e) {
|
|
|
3497
3504
|
e.viteCommand === "build"
|
|
3498
3505
|
), e._localDefinedComponents;
|
|
3499
3506
|
}
|
|
3500
|
-
const
|
|
3501
|
-
name:
|
|
3507
|
+
const _t = "makeRuntime(", po = "@arcgis/core", uo = "@arcgis/lumina:injectRuntimeOptions", mo = (e) => ({
|
|
3508
|
+
name: uo,
|
|
3502
3509
|
transform: {
|
|
3503
3510
|
filter: {
|
|
3504
3511
|
id: /\/src\/runtime\.ts$/u
|
|
3505
3512
|
},
|
|
3506
3513
|
handler(t, i) {
|
|
3507
|
-
const s = t.indexOf(
|
|
3514
|
+
const s = t.indexOf(_t);
|
|
3508
3515
|
if (s === -1)
|
|
3509
3516
|
throw new Error(
|
|
3510
3517
|
`Failed to find makeRuntime() function call in src/runtime.ts. Id: ${i}. Code: ${t}`
|
|
3511
3518
|
);
|
|
3512
|
-
const r = s +
|
|
3519
|
+
const r = s + _t.length, n = e.options.css?.commonStylesPath;
|
|
3513
3520
|
return {
|
|
3514
3521
|
code: [
|
|
3515
3522
|
n === void 0 ? "" : `import commonStyles from "${he(e.dir.src, n)}${Ie}";`,
|
|
@@ -3525,7 +3532,7 @@ const Kt = "makeRuntime(", lo = "@arcgis/core", po = "@arcgis/lumina:injectRunti
|
|
|
3525
3532
|
// Dependency injection. Lumina cannot directly import these to avoid
|
|
3526
3533
|
// a cyclical dependency.
|
|
3527
3534
|
H ? `
|
|
3528
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
3535
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${po}/applications/Components/reactiveUtils.js";
|
|
3529
3536
|
createObservable,
|
|
3530
3537
|
runtime.t = trackAccess;
|
|
3531
3538
|
runtime.o = createObservable;
|
|
@@ -3537,11 +3544,11 @@ runtime.r = runTracked;` : ""
|
|
|
3537
3544
|
}
|
|
3538
3545
|
}
|
|
3539
3546
|
});
|
|
3540
|
-
function
|
|
3547
|
+
function fo(e) {
|
|
3541
3548
|
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ce}/${Z}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
3542
3549
|
`;
|
|
3543
3550
|
}
|
|
3544
|
-
const we = "@arcgis/lumina:addNonLazyImports",
|
|
3551
|
+
const we = "@arcgis/lumina:addNonLazyImports", go = (e) => ({
|
|
3545
3552
|
name: we,
|
|
3546
3553
|
apply: () => e.viteCommand === "build",
|
|
3547
3554
|
generateBundle(t, i) {
|
|
@@ -3553,7 +3560,7 @@ const we = "@arcgis/lumina:addNonLazyImports", fo = (e) => ({
|
|
|
3553
3560
|
if (d !== a && (l.fileName = d), l.type === "chunk") {
|
|
3554
3561
|
const c = u.dirname(u.join(e.dir.dist, a)), p = d === a ? c : u.dirname(u.join(e.dir.dist, d));
|
|
3555
3562
|
let m = l.code;
|
|
3556
|
-
m = an(m, e, p, c), !e.isInStorybook && d === "chunks/runtime.js" && (n = !0, m =
|
|
3563
|
+
m = an(m, e, p, c), !e.isInStorybook && d === "chunks/runtime.js" && (n = !0, m = fo(e) + m), m = `${e.banner}${r}${m}`, l.code = m;
|
|
3557
3564
|
}
|
|
3558
3565
|
}), !n && !e.isInStorybook)
|
|
3559
3566
|
throw Error(b(we, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
@@ -3590,12 +3597,12 @@ Possible causes:
|
|
|
3590
3597
|
return [];
|
|
3591
3598
|
const d = u.dirname(n), c = e.dir.src + Ge(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, c);
|
|
3592
3599
|
function m(P) {
|
|
3593
|
-
const x =
|
|
3600
|
+
const x = co(e, P, n);
|
|
3594
3601
|
if (x === void 0)
|
|
3595
3602
|
return;
|
|
3596
|
-
const S =
|
|
3603
|
+
const S = lo(x, p);
|
|
3597
3604
|
if (S !== `./${p}`)
|
|
3598
|
-
return S.startsWith(".") ? `${S}/${
|
|
3605
|
+
return S.startsWith(".") ? `${S}/${Kt}` : S;
|
|
3599
3606
|
}
|
|
3600
3607
|
const f = new Set(a), g = new Set(l), h = Array.from(f, m).filter(R), y = (P) => `import "${P}";
|
|
3601
3608
|
`, v = h.map(y).join(""), w = Array.from(g, (P) => {
|
|
@@ -3614,11 +3621,11 @@ Possible causes:
|
|
|
3614
3621
|
}).filter(R), C = `${v}export * from "./${ut}";`, E = w.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
3615
3622
|
${C}
|
|
3616
3623
|
deferredLoaders${w.join("")};` : C;
|
|
3617
|
-
return await
|
|
3624
|
+
return await K(u.join(e.dir.dist, p, Kt), E);
|
|
3618
3625
|
});
|
|
3619
3626
|
await Promise.all(r);
|
|
3620
3627
|
}
|
|
3621
|
-
}),
|
|
3628
|
+
}), Kt = "index.js", Zi = (e, t, i, s = /* @__PURE__ */ new Set()) => t.flatMap((r) => i.has(r) ? [r] : s.has(r) ? [] : (s.add(r), Zi(e, e[r].referencedBy, i, s)));
|
|
3622
3629
|
function Wt(e, t, i) {
|
|
3623
3630
|
if (ee(e))
|
|
3624
3631
|
return e;
|
|
@@ -3638,14 +3645,14 @@ function ee(e) {
|
|
|
3638
3645
|
return (
|
|
3639
3646
|
// Inlined string literal
|
|
3640
3647
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3641
|
-
|
|
3648
|
+
ho.has(e.kind) || // Ternary with both branches never undefined
|
|
3642
3649
|
o.isConditionalExpression(e) && ee(e.whenTrue) && ee(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3643
|
-
o.isBinaryExpression(e) && (
|
|
3650
|
+
o.isBinaryExpression(e) && (yo.has(e.operatorToken.kind) || ee(e.left) && ee(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3644
3651
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ee(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3645
3652
|
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && ar.has(e.tag.text)
|
|
3646
3653
|
);
|
|
3647
3654
|
}
|
|
3648
|
-
const
|
|
3655
|
+
const ho = /* @__PURE__ */ new Set([
|
|
3649
3656
|
o.SyntaxKind.NumericLiteral,
|
|
3650
3657
|
o.SyntaxKind.BigIntLiteral,
|
|
3651
3658
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3664,7 +3671,7 @@ const go = /* @__PURE__ */ new Set([
|
|
|
3664
3671
|
o.SyntaxKind.ClassExpression,
|
|
3665
3672
|
// Trust? Trust.
|
|
3666
3673
|
o.SyntaxKind.NonNullExpression
|
|
3667
|
-
]),
|
|
3674
|
+
]), yo = /* @__PURE__ */ new Set([
|
|
3668
3675
|
o.SyntaxKind.PlusEqualsToken,
|
|
3669
3676
|
o.SyntaxKind.MinusEqualsToken,
|
|
3670
3677
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3699,9 +3706,9 @@ const go = /* @__PURE__ */ new Set([
|
|
|
3699
3706
|
o.SyntaxKind.SlashToken,
|
|
3700
3707
|
o.SyntaxKind.PercentToken,
|
|
3701
3708
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3702
|
-
]),
|
|
3709
|
+
]), vo = {
|
|
3703
3710
|
property(e, t, i, s) {
|
|
3704
|
-
const r =
|
|
3711
|
+
const r = bo(s, i, e), n = r?.type === "stringifiedReflected", a = r?.type === "reflected" || n;
|
|
3705
3712
|
if (a) {
|
|
3706
3713
|
const f = qe(t);
|
|
3707
3714
|
if (f === !0)
|
|
@@ -3718,7 +3725,7 @@ const go = /* @__PURE__ */ new Set([
|
|
|
3718
3725
|
p,
|
|
3719
3726
|
e,
|
|
3720
3727
|
m ? "" : void 0
|
|
3721
|
-
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ?
|
|
3728
|
+
), h = i === "value" && (s === "input" || s === "textarea" || s === ke) ? So(f, e) : f;
|
|
3722
3729
|
if (h !== p)
|
|
3723
3730
|
return [m ? `.${i}` : r.name, c, h];
|
|
3724
3731
|
}
|
|
@@ -3791,7 +3798,7 @@ const go = /* @__PURE__ */ new Set([
|
|
|
3791
3798
|
return [o.factory.createIdentifier(r)];
|
|
3792
3799
|
}
|
|
3793
3800
|
};
|
|
3794
|
-
function
|
|
3801
|
+
function bo(e, t, i) {
|
|
3795
3802
|
if (typeof e == "string") {
|
|
3796
3803
|
const n = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3797
3804
|
if (n !== void 0)
|
|
@@ -3885,7 +3892,7 @@ function zt(e, t, i) {
|
|
|
3885
3892
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3886
3893
|
);
|
|
3887
3894
|
const s = t.expression;
|
|
3888
|
-
if (
|
|
3895
|
+
if (wo(s)) {
|
|
3889
3896
|
const n = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3890
3897
|
e.neededImports.add(n);
|
|
3891
3898
|
const a = e.importRenames[n], l = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3895,15 +3902,15 @@ function zt(e, t, i) {
|
|
|
3895
3902
|
} else
|
|
3896
3903
|
return [i, ...Ee(e, t, !0)];
|
|
3897
3904
|
}
|
|
3898
|
-
const
|
|
3899
|
-
function
|
|
3905
|
+
const wo = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3906
|
+
function So(e, t) {
|
|
3900
3907
|
t.neededImports.add("live");
|
|
3901
3908
|
const i = t.importRenames.live;
|
|
3902
3909
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3903
3910
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3904
3911
|
]);
|
|
3905
3912
|
}
|
|
3906
|
-
function
|
|
3913
|
+
function Co(e) {
|
|
3907
3914
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in Ht && e.expression.arguments.length <= 1)
|
|
3908
3915
|
return {
|
|
3909
3916
|
propType: Ht[e.expression.expression.text],
|
|
@@ -3921,15 +3928,15 @@ const Ht = {
|
|
|
3921
3928
|
bindBooleanAttribute: "booleanAttribute",
|
|
3922
3929
|
bindEvent: "event"
|
|
3923
3930
|
};
|
|
3924
|
-
function
|
|
3925
|
-
return
|
|
3931
|
+
function Eo(e, t, i) {
|
|
3932
|
+
return $o.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : li.has(e) || e.includes("-") ? "attribute" : !lt(i) && (di.has(e) || (i === Ye ? !1 : i === ke ? (
|
|
3926
3933
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3927
3934
|
Object.values(Qe).some((n) => n.has(e))
|
|
3928
3935
|
) : Qe[i]?.has(e) === !0)) ? Tt.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" : Tt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3929
3936
|
}
|
|
3930
|
-
const
|
|
3937
|
+
const To = ["class", "style", "ref", "directives", "key", "deferLoad"], $o = new Set(To), Po = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3931
3938
|
function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
3932
|
-
const r =
|
|
3939
|
+
const r = ko(t);
|
|
3933
3940
|
if (r.length % 2 === 0)
|
|
3934
3941
|
throw new Error("Normalized template parts array length must be odd");
|
|
3935
3942
|
const [n, ...a] = r;
|
|
@@ -3950,11 +3957,11 @@ function Oe({ key: e, parts: t, litTag: i }, s) {
|
|
|
3950
3957
|
const d = s.importRenames[l], c = o.factory.createTaggedTemplateExpression(
|
|
3951
3958
|
o.factory.createIdentifier(d),
|
|
3952
3959
|
void 0,
|
|
3953
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n),
|
|
3960
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(n) : o.factory.createTemplateExpression(o.factory.createTemplateHead(n), Io(a))
|
|
3954
3961
|
);
|
|
3955
3962
|
return Ve(s, e, c);
|
|
3956
3963
|
}
|
|
3957
|
-
const
|
|
3964
|
+
const ko = (e) => e.reduce(
|
|
3958
3965
|
(t, i, s) => {
|
|
3959
3966
|
const r = t.at(-1), n = typeof r == "string", a = typeof i == "string";
|
|
3960
3967
|
if (n && a)
|
|
@@ -3964,7 +3971,7 @@ const Po = (e) => e.reduce(
|
|
|
3964
3971
|
},
|
|
3965
3972
|
[""]
|
|
3966
3973
|
);
|
|
3967
|
-
function
|
|
3974
|
+
function Io(e) {
|
|
3968
3975
|
if (!(e.length % 2 === 0))
|
|
3969
3976
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3970
3977
|
const i = e.length / 2;
|
|
@@ -4003,13 +4010,13 @@ function ts(e, t) {
|
|
|
4003
4010
|
);
|
|
4004
4011
|
}
|
|
4005
4012
|
const gt = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
4006
|
-
function
|
|
4013
|
+
function xo(e) {
|
|
4007
4014
|
const t = gt(e);
|
|
4008
4015
|
if (t.length === 0)
|
|
4009
4016
|
return [e || " "];
|
|
4010
4017
|
const i = t.reduceRight(
|
|
4011
4018
|
([r, ...n], a) => {
|
|
4012
|
-
const l =
|
|
4019
|
+
const l = Ao(r), d = is(l.slice(a.pos, a.end));
|
|
4013
4020
|
return [
|
|
4014
4021
|
l.slice(0, a.pos),
|
|
4015
4022
|
/**
|
|
@@ -4028,12 +4035,12 @@ function Io(e) {
|
|
|
4028
4035
|
return (typeof s != "string" || s.trim() !== "") && i.push(" "), i;
|
|
4029
4036
|
}
|
|
4030
4037
|
const is = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
4031
|
-
function
|
|
4038
|
+
function Ao(e) {
|
|
4032
4039
|
if (typeof e == "string")
|
|
4033
4040
|
return e;
|
|
4034
4041
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
4035
4042
|
}
|
|
4036
|
-
function
|
|
4043
|
+
function Lo(e, t) {
|
|
4037
4044
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
4038
4045
|
return t;
|
|
4039
4046
|
const s = t.arguments[0];
|
|
@@ -4067,7 +4074,7 @@ function Ao(e, t) {
|
|
|
4067
4074
|
const f = p.attributes.properties[m];
|
|
4068
4075
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
4069
4076
|
return t;
|
|
4070
|
-
const g = ft(f.initializer, e.sourceFile), h =
|
|
4077
|
+
const g = ft(f.initializer, e.sourceFile), h = No(n, s, g, d, e);
|
|
4071
4078
|
if (h === void 0)
|
|
4072
4079
|
return t;
|
|
4073
4080
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -4100,7 +4107,7 @@ function ss(e) {
|
|
|
4100
4107
|
void 0
|
|
4101
4108
|
), t;
|
|
4102
4109
|
}
|
|
4103
|
-
function
|
|
4110
|
+
function No(e, t, i, s, r) {
|
|
4104
4111
|
const n = J(i);
|
|
4105
4112
|
if (n === void 0)
|
|
4106
4113
|
return;
|
|
@@ -4116,7 +4123,7 @@ function Lo(e, t, i, s, r) {
|
|
|
4116
4123
|
return;
|
|
4117
4124
|
}
|
|
4118
4125
|
if (!s) {
|
|
4119
|
-
const d =
|
|
4126
|
+
const d = Fo(n, a, t);
|
|
4120
4127
|
if (d === void 0)
|
|
4121
4128
|
return;
|
|
4122
4129
|
a = d;
|
|
@@ -4155,7 +4162,7 @@ function J(e) {
|
|
|
4155
4162
|
}
|
|
4156
4163
|
return t;
|
|
4157
4164
|
} else {
|
|
4158
|
-
if (
|
|
4165
|
+
if (jo.has(e.kind))
|
|
4159
4166
|
return [];
|
|
4160
4167
|
{
|
|
4161
4168
|
const t = ge(e);
|
|
@@ -4163,7 +4170,7 @@ function J(e) {
|
|
|
4163
4170
|
}
|
|
4164
4171
|
}
|
|
4165
4172
|
}
|
|
4166
|
-
const
|
|
4173
|
+
const jo = /* @__PURE__ */ new Set([
|
|
4167
4174
|
o.SyntaxKind.NumericLiteral,
|
|
4168
4175
|
o.SyntaxKind.BigIntLiteral,
|
|
4169
4176
|
o.SyntaxKind.StringLiteral,
|
|
@@ -4172,12 +4179,12 @@ const No = /* @__PURE__ */ new Set([
|
|
|
4172
4179
|
o.SyntaxKind.FalseKeyword,
|
|
4173
4180
|
o.SyntaxKind.NullKeyword,
|
|
4174
4181
|
o.SyntaxKind.TrueKeyword
|
|
4175
|
-
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, rs = (e, t) => o.isObjectBindingPattern(e) ?
|
|
4176
|
-
function
|
|
4182
|
+
]), ge = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ge(e.expression) : e, rs = (e, t) => o.isObjectBindingPattern(e) ? Oo(e, t) : e;
|
|
4183
|
+
function Fo(e, t, i) {
|
|
4177
4184
|
if (e.every(Fe, t))
|
|
4178
4185
|
return t;
|
|
4179
4186
|
if (o.isIdentifier(t)) {
|
|
4180
|
-
const s = o.isBlock(i.body) ? Xe(i.body.statements, (n) =>
|
|
4187
|
+
const s = o.isBlock(i.body) ? Xe(i.body.statements, (n) => Ro(n, t)) : void 0;
|
|
4181
4188
|
if (s === void 0)
|
|
4182
4189
|
return;
|
|
4183
4190
|
const r = rs(s, e);
|
|
@@ -4185,7 +4192,7 @@ function jo(e, t, i) {
|
|
|
4185
4192
|
return r;
|
|
4186
4193
|
}
|
|
4187
4194
|
}
|
|
4188
|
-
function
|
|
4195
|
+
function Ro(e, t) {
|
|
4189
4196
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
4190
4197
|
return;
|
|
4191
4198
|
const i = e.declarationList.declarations[0];
|
|
@@ -4193,13 +4200,13 @@ function Fo(e, t) {
|
|
|
4193
4200
|
}
|
|
4194
4201
|
function Fe(e) {
|
|
4195
4202
|
const t = this;
|
|
4196
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
4203
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(Do, e);
|
|
4197
4204
|
}
|
|
4198
|
-
function
|
|
4205
|
+
function Do(e) {
|
|
4199
4206
|
const t = this;
|
|
4200
4207
|
return o.isOmittedExpression(e) ? !1 : Fe.call(e.name, t);
|
|
4201
4208
|
}
|
|
4202
|
-
function
|
|
4209
|
+
function Oo(e, t) {
|
|
4203
4210
|
let i = !1;
|
|
4204
4211
|
const s = e.elements.filter((r) => o.isIdentifier(r.name) ? t.includes(r.name.text) : (i = !0, !0));
|
|
4205
4212
|
return i || s.length === 0 ? e : o.factory.updateObjectBindingPattern(e, s);
|
|
@@ -4208,13 +4215,13 @@ const ns = (e, t) => t.liftedKeys.has(e);
|
|
|
4208
4215
|
function q(e, t, i) {
|
|
4209
4216
|
if (fe(i))
|
|
4210
4217
|
return os(e, i);
|
|
4211
|
-
const s = o.isCallExpression(i) ?
|
|
4218
|
+
const s = o.isCallExpression(i) ? Lo(e, i) : i, r = o.visitEachChild(
|
|
4212
4219
|
s,
|
|
4213
4220
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
4214
4221
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
4215
4222
|
e.transformationContext
|
|
4216
4223
|
);
|
|
4217
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || pr(i.right)) ?
|
|
4224
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || fe(ge(i.right)) || pr(i.right)) ? Bo(r) : r;
|
|
4218
4225
|
}
|
|
4219
4226
|
function os(e, t) {
|
|
4220
4227
|
const i = as(e, t);
|
|
@@ -4227,18 +4234,18 @@ function as(e, t) {
|
|
|
4227
4234
|
const r = o.isJsxElement(t) ? t.openingElement : t, n = r.tagName;
|
|
4228
4235
|
if (o.isJsxNamespacedName(n))
|
|
4229
4236
|
throw Error(`JSX namespaced elements are not supported. Found ${n.getText(e.sourceFile)} `);
|
|
4230
|
-
if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !==
|
|
4237
|
+
if (!o.isIdentifier(n) || !n.text.startsWith(n.text[0].toLowerCase()) && n.text !== _e && n.text !== Ke) {
|
|
4231
4238
|
const S = o.isIdentifier(n) && n.text === Gs ? Te(i, e) : {
|
|
4232
4239
|
// No need to wrap the function call in a lit-html tag
|
|
4233
4240
|
litTag: void 0,
|
|
4234
|
-
parts: [
|
|
4241
|
+
parts: [Jo(e, t, n, i)]
|
|
4235
4242
|
};
|
|
4236
4243
|
return {
|
|
4237
|
-
key:
|
|
4244
|
+
key: Mo(r, e),
|
|
4238
4245
|
...S
|
|
4239
4246
|
};
|
|
4240
4247
|
}
|
|
4241
|
-
const l = n.text ===
|
|
4248
|
+
const l = n.text === _e ? ke : n.text === Ke ? Ye : n.text, d = n.text === _e ? oe : n.text === Ke ? Y : Ys.has(l) ? fi : at.has(l) ? ie : ae, c = lt(l), p = c ? e.localComponents[l]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
|
|
4242
4249
|
let f;
|
|
4243
4250
|
const g = [];
|
|
4244
4251
|
let h = !1;
|
|
@@ -4251,13 +4258,13 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4251
4258
|
const { name: S, initializer: A } = x;
|
|
4252
4259
|
if (o.isJsxNamespacedName(S))
|
|
4253
4260
|
throw Error(`JSX namespaced attributes are not supported. Found ${S.getText(e.sourceFile)}`);
|
|
4254
|
-
const L = S.text, U =
|
|
4261
|
+
const L = S.text, U = Co(A), F = U?.propType ?? Eo(L, A, l);
|
|
4255
4262
|
m?.delete(L);
|
|
4256
|
-
const N =
|
|
4263
|
+
const N = vo[F](e, U?.initializer ?? A, L, l);
|
|
4257
4264
|
if (N.length === 0)
|
|
4258
4265
|
return [];
|
|
4259
|
-
const B = e.compiler.shouldMinifyJsx ? [" "] :
|
|
4260
|
-
return F === "key" ? (f = typeof N[0] == "object" && !ns(S, e) ? N[0] : void 0, B.some(
|
|
4266
|
+
const B = e.compiler.shouldMinifyJsx ? [" "] : xo(es(S, e));
|
|
4267
|
+
return F === "key" ? (f = typeof N[0] == "object" && !ns(S, e) ? N[0] : void 0, B.some(Po) ? B : []) : F === "directives" || F === "ref" || L === "deferLoad" ? (h ||= F === "deferLoad", g.push(
|
|
4261
4268
|
...B,
|
|
4262
4269
|
...N.flatMap(
|
|
4263
4270
|
(D, M) => typeof D == "string" || M === 0 || typeof N[M - 1] == "string" ? D : [" ", D]
|
|
@@ -4297,12 +4304,12 @@ Found ${x.getText(e.sourceFile)}`
|
|
|
4297
4304
|
];
|
|
4298
4305
|
return { key: f, parts: P, litTag: d };
|
|
4299
4306
|
}
|
|
4300
|
-
function
|
|
4307
|
+
function Mo(e, t) {
|
|
4301
4308
|
const i = e.attributes.properties[cs(e)];
|
|
4302
4309
|
return i && o.isJsxAttribute(i) && !ns(i.name, t) ? ft(i.initializer, t.sourceFile) : void 0;
|
|
4303
4310
|
}
|
|
4304
4311
|
const cs = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
4305
|
-
function
|
|
4312
|
+
function Jo(e, t, i, s) {
|
|
4306
4313
|
const n = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
4307
4314
|
if (o.isJsxSpreadAttribute(d))
|
|
4308
4315
|
return ts(es(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
@@ -4346,7 +4353,7 @@ function Te(e, t) {
|
|
|
4346
4353
|
});
|
|
4347
4354
|
return { litTag: i, parts: s };
|
|
4348
4355
|
}
|
|
4349
|
-
function
|
|
4356
|
+
function Bo(e) {
|
|
4350
4357
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
4351
4358
|
e,
|
|
4352
4359
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -4402,7 +4409,7 @@ const ls = (e) => e.reduce((t, [i, s]) => (t[i] ??= [], t[i].push(s), t), {}), d
|
|
|
4402
4409
|
([e, t]) => t.map((i) => [i, e])
|
|
4403
4410
|
)
|
|
4404
4411
|
), ps = new Set(Object.keys(ds));
|
|
4405
|
-
function
|
|
4412
|
+
function _o(e, t) {
|
|
4406
4413
|
const i = t.importClause, s = i === void 0, r = t.moduleSpecifier;
|
|
4407
4414
|
if (!o.isStringLiteral(r))
|
|
4408
4415
|
return t;
|
|
@@ -4485,10 +4492,10 @@ function Bo(e, t) {
|
|
|
4485
4492
|
return t;
|
|
4486
4493
|
}
|
|
4487
4494
|
const us = (e, t) => e === ae && se.staticHtml.includes(t) ? oe : e === ie && se.staticSvg.includes(t) ? Y : e, Ko = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4488
|
-
function
|
|
4489
|
-
return o.isImportDeclaration(e) ?
|
|
4495
|
+
function Wo(e) {
|
|
4496
|
+
return o.isImportDeclaration(e) ? Uo(this, e) : e;
|
|
4490
4497
|
}
|
|
4491
|
-
function
|
|
4498
|
+
function Uo(e, t) {
|
|
4492
4499
|
const i = t.importClause, s = i?.namedBindings, r = t.moduleSpecifier;
|
|
4493
4500
|
if (!o.isStringLiteral(r) || !s || !o.isNamedImports(s) || !ps.has(r.text))
|
|
4494
4501
|
return t;
|
|
@@ -4513,7 +4520,7 @@ function Wo(e, t) {
|
|
|
4513
4520
|
t.attributes
|
|
4514
4521
|
) : t;
|
|
4515
4522
|
}
|
|
4516
|
-
function
|
|
4523
|
+
function zo(e) {
|
|
4517
4524
|
const t = ls(
|
|
4518
4525
|
Array.from(e.neededImports, (i) => [se[i][0], i])
|
|
4519
4526
|
);
|
|
@@ -4539,7 +4546,7 @@ function ms(e, t) {
|
|
|
4539
4546
|
o.factory.createIdentifier(s)
|
|
4540
4547
|
);
|
|
4541
4548
|
}
|
|
4542
|
-
function
|
|
4549
|
+
function Ho(e) {
|
|
4543
4550
|
const t = jr().map(({ packageName: i }) => i);
|
|
4544
4551
|
return e.existingImportedModules.forEach((i) => {
|
|
4545
4552
|
if (u.isAbsolute(i))
|
|
@@ -4553,7 +4560,7 @@ function zo(e) {
|
|
|
4553
4560
|
}
|
|
4554
4561
|
}), [];
|
|
4555
4562
|
}
|
|
4556
|
-
function
|
|
4563
|
+
function qo(e) {
|
|
4557
4564
|
if (e.compiler.viteCommand === "serve")
|
|
4558
4565
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4559
4566
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4568,7 +4575,7 @@ function Ho(e) {
|
|
|
4568
4575
|
t[s] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[s].referencedBy.push(e.sourceFile.fileName);
|
|
4569
4576
|
}), [];
|
|
4570
4577
|
}
|
|
4571
|
-
const
|
|
4578
|
+
const Vo = (e, t) => {
|
|
4572
4579
|
const i = e.pragmas;
|
|
4573
4580
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4574
4581
|
return e.statements;
|
|
@@ -4592,7 +4599,7 @@ const qo = (e, t) => {
|
|
|
4592
4599
|
localComponents: Qi(t.compiler),
|
|
4593
4600
|
sourceFile: e,
|
|
4594
4601
|
transformationContext: t.transformation,
|
|
4595
|
-
importRenames:
|
|
4602
|
+
importRenames: Go(e),
|
|
4596
4603
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4597
4604
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4598
4605
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4606,7 +4613,7 @@ const qo = (e, t) => {
|
|
|
4606
4613
|
let a = [];
|
|
4607
4614
|
if (e.statements.every((d) => {
|
|
4608
4615
|
if (o.isImportDeclaration(d)) {
|
|
4609
|
-
const c =
|
|
4616
|
+
const c = _o(n, d);
|
|
4610
4617
|
if (c === void 0)
|
|
4611
4618
|
return !0;
|
|
4612
4619
|
if (a.push(c), n.hasNonLuminaJsxImport)
|
|
@@ -4616,11 +4623,11 @@ const qo = (e, t) => {
|
|
|
4616
4623
|
return !0;
|
|
4617
4624
|
}), n.hasNonLuminaJsxImport)
|
|
4618
4625
|
return e.statements;
|
|
4619
|
-
if (n.neededImports.size > 0 && (a = a.map(
|
|
4626
|
+
if (n.neededImports.size > 0 && (a = a.map(Wo, n), n.existingLitImports.size > 0))
|
|
4620
4627
|
throw new Error(
|
|
4621
4628
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
|
|
4622
4629
|
);
|
|
4623
|
-
const l = [
|
|
4630
|
+
const l = [zo, Ho, qo].flatMap(
|
|
4624
4631
|
(d) => d(n)
|
|
4625
4632
|
);
|
|
4626
4633
|
if (n.neededImports.size > 0)
|
|
@@ -4629,18 +4636,18 @@ const qo = (e, t) => {
|
|
|
4629
4636
|
);
|
|
4630
4637
|
return [...l, ...a];
|
|
4631
4638
|
};
|
|
4632
|
-
function
|
|
4633
|
-
return
|
|
4639
|
+
function Go(e) {
|
|
4640
|
+
return Xo(e), Object.fromEntries(
|
|
4634
4641
|
dr.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4635
4642
|
);
|
|
4636
4643
|
}
|
|
4637
|
-
function
|
|
4644
|
+
function Xo(e) {
|
|
4638
4645
|
if (!("identifiers" in e))
|
|
4639
4646
|
throw new Error(
|
|
4640
4647
|
"Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
|
|
4641
4648
|
);
|
|
4642
4649
|
}
|
|
4643
|
-
const Vt = "customElement",
|
|
4650
|
+
const Vt = "customElement", Yo = (e, t) => {
|
|
4644
4651
|
const i = [];
|
|
4645
4652
|
if (t.apiModule?.declarations.forEach((n) => {
|
|
4646
4653
|
const a = n;
|
|
@@ -4670,7 +4677,7 @@ const Vt = "customElement", Xo = (e, t) => {
|
|
|
4670
4677
|
o.factory.createStringLiteral(s)
|
|
4671
4678
|
), ...e.statements, ...i];
|
|
4672
4679
|
};
|
|
4673
|
-
function
|
|
4680
|
+
function Qo(e, t, i) {
|
|
4674
4681
|
return t.size === 0 ? e : [
|
|
4675
4682
|
o.factory.createPropertyDeclaration(
|
|
4676
4683
|
[
|
|
@@ -4685,7 +4692,7 @@ function Yo(e, t, i) {
|
|
|
4685
4692
|
t.entries(),
|
|
4686
4693
|
([s, r]) => o.factory.createPropertyAssignment(
|
|
4687
4694
|
oi(s) ? o.factory.createStringLiteral(s) : s,
|
|
4688
|
-
|
|
4695
|
+
Zo(r, i)
|
|
4689
4696
|
)
|
|
4690
4697
|
)
|
|
4691
4698
|
)
|
|
@@ -4693,7 +4700,7 @@ function Yo(e, t, i) {
|
|
|
4693
4700
|
...e
|
|
4694
4701
|
];
|
|
4695
4702
|
}
|
|
4696
|
-
function
|
|
4703
|
+
function Zo(e, t) {
|
|
4697
4704
|
let i = 0, s = !0;
|
|
4698
4705
|
const r = [], n = [];
|
|
4699
4706
|
for (const d of e.properties)
|
|
@@ -4738,7 +4745,7 @@ function Qo(e, t) {
|
|
|
4738
4745
|
...t ? [] : [o.factory.createObjectLiteralExpression(n)]
|
|
4739
4746
|
]);
|
|
4740
4747
|
}
|
|
4741
|
-
function
|
|
4748
|
+
function ea(e, t, i) {
|
|
4742
4749
|
let s = -1, r = -1, n = -1;
|
|
4743
4750
|
e.options?.properties.forEach((p, m) => {
|
|
4744
4751
|
if (o.isSpreadAssignment(p))
|
|
@@ -4750,23 +4757,23 @@ function Zo(e, t, i) {
|
|
|
4750
4757
|
f === "type" ? s = m : f === "attribute" ? r = m : f === "readOnly" && (n = m);
|
|
4751
4758
|
}
|
|
4752
4759
|
});
|
|
4753
|
-
const a = i.attribute === void 0 && r === -1, l = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, d =
|
|
4760
|
+
const a = i.attribute === void 0 && r === -1, l = i.readonly === !0 && i.docsOnlyReadonly !== !0 && n === -1, d = ta(e, i, s), c = [
|
|
4754
4761
|
...a ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4755
4762
|
...l ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4756
4763
|
...d !== void 0 ? [d] : []
|
|
4757
4764
|
];
|
|
4758
4765
|
return c.length > 0 ? e.options === void 0 ? o.factory.createObjectLiteralExpression(c, !1) : o.factory.updateObjectLiteralExpression(e.options, [...e.options.properties, ...c]) : e.options;
|
|
4759
4766
|
}
|
|
4760
|
-
function
|
|
4767
|
+
function ta(e, t, i) {
|
|
4761
4768
|
if (t.attribute === void 0)
|
|
4762
4769
|
return;
|
|
4763
|
-
const s =
|
|
4770
|
+
const s = ia(t.type.values);
|
|
4764
4771
|
return s === "Other" || t.readonly === !0 && (s !== "Boolean" || t.reflects === void 0) || e.options?.properties[i] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4765
4772
|
o.factory.createIdentifier("type"),
|
|
4766
4773
|
o.factory.createIdentifier(s)
|
|
4767
4774
|
);
|
|
4768
4775
|
}
|
|
4769
|
-
function
|
|
4776
|
+
function ia(e) {
|
|
4770
4777
|
let t = !1, i = !1, s = !1;
|
|
4771
4778
|
if (e?.forEach((r) => {
|
|
4772
4779
|
t ||= r.type === "number", i ||= r.type === "boolean", s ||= r.type === "string" || r.type === "any" || r.type === "unknown";
|
|
@@ -4778,7 +4785,7 @@ function ta(e) {
|
|
|
4778
4785
|
}
|
|
4779
4786
|
return "Other";
|
|
4780
4787
|
}
|
|
4781
|
-
function
|
|
4788
|
+
function sa(e, t, i, s, r, n) {
|
|
4782
4789
|
if (i.modifiers === void 0)
|
|
4783
4790
|
return i;
|
|
4784
4791
|
let a = -1, l = -1;
|
|
@@ -4788,7 +4795,7 @@ function ia(e, t, i, s, r, n) {
|
|
|
4788
4795
|
p === "property" && (a = c), p === "state" && (l = c);
|
|
4789
4796
|
}
|
|
4790
4797
|
}), a !== -1) {
|
|
4791
|
-
const d =
|
|
4798
|
+
const d = ra(e, t, i, s, r), c = Gt(i, a, r), p = ea(c, r, d);
|
|
4792
4799
|
return n.set(d.name, p ?? o.factory.createObjectLiteralExpression()), c.options = p, Xt(i, a);
|
|
4793
4800
|
} else if (l !== -1) {
|
|
4794
4801
|
const d = Gt(i, l, r), c = o.factory.createPropertyAssignment("state", o.factory.createTrue()), p = d.options === void 0 ? o.factory.createObjectLiteralExpression([c]) : o.factory.updateObjectLiteralExpression(d.options, [...d.options.properties, c]), m = ai(i.name);
|
|
@@ -4798,7 +4805,7 @@ function ia(e, t, i, s, r, n) {
|
|
|
4798
4805
|
} else
|
|
4799
4806
|
return i;
|
|
4800
4807
|
}
|
|
4801
|
-
function
|
|
4808
|
+
function ra(e, t, i, s, r) {
|
|
4802
4809
|
const n = t ?? (e.compiler.isInTest ? {
|
|
4803
4810
|
members: []
|
|
4804
4811
|
} : void 0);
|
|
@@ -4858,7 +4865,7 @@ function Xt(e, t) {
|
|
|
4858
4865
|
e.initializer
|
|
4859
4866
|
);
|
|
4860
4867
|
}
|
|
4861
|
-
function
|
|
4868
|
+
function na(e, t, i, s) {
|
|
4862
4869
|
let r;
|
|
4863
4870
|
if (e.apiJsonEnabled)
|
|
4864
4871
|
for (let d = 0; d < e.privateApiJson.modules.length; ++d) {
|
|
@@ -4881,9 +4888,9 @@ function ra(e, t, i, s) {
|
|
|
4881
4888
|
} finally {
|
|
4882
4889
|
l = i.statements, i.statements = a;
|
|
4883
4890
|
}
|
|
4884
|
-
return
|
|
4891
|
+
return oa(i, l);
|
|
4885
4892
|
}
|
|
4886
|
-
const
|
|
4893
|
+
const oa = (e, t) => o.factory.updateSourceFile(
|
|
4887
4894
|
e,
|
|
4888
4895
|
t,
|
|
4889
4896
|
/*
|
|
@@ -4898,10 +4905,10 @@ const na = (e, t) => o.factory.updateSourceFile(
|
|
|
4898
4905
|
e.hasNoDefaultLib,
|
|
4899
4906
|
e.libReferenceDirectives
|
|
4900
4907
|
);
|
|
4901
|
-
function
|
|
4908
|
+
function aa(e, t) {
|
|
4902
4909
|
t.compiler.viteCommand === "build" && ("emitNode" in e && (e.emitNode ??= {}), o.setEmitFlags(e, o.EmitFlags.NoComments));
|
|
4903
4910
|
}
|
|
4904
|
-
const
|
|
4911
|
+
const ca = (e, t) => {
|
|
4905
4912
|
let i;
|
|
4906
4913
|
if (t.apiModule !== void 0)
|
|
4907
4914
|
for (let d = 0; d < t.apiModule.declarations.length; ++d) {
|
|
@@ -4917,10 +4924,10 @@ const aa = (e, t) => {
|
|
|
4917
4924
|
function r() {
|
|
4918
4925
|
s = /* @__PURE__ */ new Map();
|
|
4919
4926
|
}
|
|
4920
|
-
const n = (d) =>
|
|
4927
|
+
const n = (d) => Qo(d, s, t.compiler.shouldMinify);
|
|
4921
4928
|
function a(d, c) {
|
|
4922
|
-
const p =
|
|
4923
|
-
return
|
|
4929
|
+
const p = da(t, i, d, c, e, s);
|
|
4930
|
+
return aa(p, t), p;
|
|
4924
4931
|
}
|
|
4925
4932
|
return e.statements.map(
|
|
4926
4933
|
(d) => fs(a, d, t, r, n)
|
|
@@ -4953,11 +4960,11 @@ function fs(e, t, i, s, r = ci) {
|
|
|
4953
4960
|
i.transformation
|
|
4954
4961
|
) : t;
|
|
4955
4962
|
}
|
|
4956
|
-
const
|
|
4957
|
-
function
|
|
4963
|
+
const la = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4964
|
+
function da(e, t, i, s, r, n) {
|
|
4958
4965
|
if (o.isMethodDeclaration(i)) {
|
|
4959
4966
|
const a = i.modifiers?.filter(
|
|
4960
|
-
(l) => !o.isDecorator(l) || !
|
|
4967
|
+
(l) => !o.isDecorator(l) || !pa(l)
|
|
4961
4968
|
);
|
|
4962
4969
|
if (a?.length !== i.modifiers?.length)
|
|
4963
4970
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4971,7 +4978,7 @@ function la(e, t, i, s, r, n) {
|
|
|
4971
4978
|
i.type,
|
|
4972
4979
|
i.body
|
|
4973
4980
|
);
|
|
4974
|
-
if ("text" in i.name &&
|
|
4981
|
+
if ("text" in i.name && la.has(i.name.text) && i.body) {
|
|
4975
4982
|
const l = i.name.text;
|
|
4976
4983
|
return i.body.statements.some(
|
|
4977
4984
|
(c) => o.isExpressionStatement(c) && o.isCallExpression(c.expression) && o.isPropertyAccessExpression(c.expression.expression) && c.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && c.expression.expression.name.text === l
|
|
@@ -4997,14 +5004,14 @@ function la(e, t, i, s, r, n) {
|
|
|
4997
5004
|
);
|
|
4998
5005
|
}
|
|
4999
5006
|
}
|
|
5000
|
-
return o.isPropertyDeclaration(i) || o.isAccessor(i) ?
|
|
5001
|
-
}
|
|
5002
|
-
const
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
],
|
|
5007
|
-
name:
|
|
5007
|
+
return o.isPropertyDeclaration(i) || o.isAccessor(i) ? sa(e, t, i, s, r, n) : i;
|
|
5008
|
+
}
|
|
5009
|
+
const pa = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", ua = [
|
|
5010
|
+
Vo,
|
|
5011
|
+
Yo,
|
|
5012
|
+
ca
|
|
5013
|
+
], ma = "@arcgis/lumina:transformComponents", fa = (e) => ({
|
|
5014
|
+
name: ma,
|
|
5008
5015
|
transform: {
|
|
5009
5016
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
5010
5017
|
// Also, we need to run on the original fs file, before other transforms so
|
|
@@ -5024,11 +5031,11 @@ const da = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5024
5031
|
e.apiJsonDeferred === void 0 ? [re] : [re, e.apiJsonDeferred.promise]
|
|
5025
5032
|
);
|
|
5026
5033
|
const r = e.getSourceFile(i, t), a = o.transform(r, [
|
|
5027
|
-
(f) => () =>
|
|
5034
|
+
(f) => () => na(e, f, r, [
|
|
5028
5035
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
5029
|
-
...
|
|
5036
|
+
...ua
|
|
5030
5037
|
])
|
|
5031
|
-
]).transformed[0], l = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Ct.createSourceMapGenerator(
|
|
5038
|
+
]).transformed[0], l = e._typeScriptPrinter, d = e.viteConfig.build.sourcemap === !1 ? void 0 : Ct.createSourceMapGenerator(ga, u.basename(i), "", u.dirname(i), {}), c = Ct.createTextWriter(`
|
|
5032
5039
|
`);
|
|
5033
5040
|
l.writeFile(a, c, d);
|
|
5034
5041
|
const p = c.getText(), m = d?.toJSON();
|
|
@@ -5038,10 +5045,10 @@ const da = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expressio
|
|
|
5038
5045
|
};
|
|
5039
5046
|
}
|
|
5040
5047
|
}
|
|
5041
|
-
}),
|
|
5048
|
+
}), ga = {
|
|
5042
5049
|
getCurrentDirectory: o.sys.getCurrentDirectory,
|
|
5043
5050
|
getCanonicalFileName: o.sys.useCaseSensitiveFileNames ? ci : (e) => e.toLowerCase()
|
|
5044
|
-
},
|
|
5051
|
+
}, ha = (e) => ({
|
|
5045
5052
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
5046
5053
|
configureServer(t) {
|
|
5047
5054
|
e.server = t, Yt(e).forEach(({ assets: i, transformers: s }) => te(e, i, s));
|
|
@@ -5060,20 +5067,20 @@ function Yt(e) {
|
|
|
5060
5067
|
"type" in s ? t.push(s) : "assets" in s && t.push(...s.assets);
|
|
5061
5068
|
}), t.length > 0 && i.push({ assets: t }), e.isInBuildWatch || (e.assetsToProvide = void 0), i;
|
|
5062
5069
|
}
|
|
5063
|
-
const nt = "@arcgis/lumina:updatePackageJson",
|
|
5070
|
+
const nt = "@arcgis/lumina:updatePackageJson", ya = (e) => ({
|
|
5064
5071
|
name: nt,
|
|
5065
5072
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
5066
5073
|
configResolved() {
|
|
5067
|
-
|
|
5074
|
+
va(e).catch(
|
|
5068
5075
|
(t) => T.error(nt, `Failed to update package's package.json:${String(t)}`)
|
|
5069
5076
|
);
|
|
5070
5077
|
}
|
|
5071
5078
|
});
|
|
5072
|
-
async function
|
|
5073
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s =
|
|
5079
|
+
async function va(e) {
|
|
5080
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await z(t, "utf-8")), s = ba(i, e);
|
|
5074
5081
|
s && ni(t, JSON.stringify(s, null, 2));
|
|
5075
5082
|
}
|
|
5076
|
-
function
|
|
5083
|
+
function ba(e, t) {
|
|
5077
5084
|
const i = e?.devDependencies ?? {};
|
|
5078
5085
|
Object.keys(e?.peerDependencies ?? {}).forEach((c) => {
|
|
5079
5086
|
c in i || T.warn(
|
|
@@ -5112,21 +5119,21 @@ function va(e, t) {
|
|
|
5112
5119
|
if (s)
|
|
5113
5120
|
return e;
|
|
5114
5121
|
}
|
|
5115
|
-
const
|
|
5122
|
+
const wa = (e) => ({
|
|
5116
5123
|
deprecation: "docs.json is deprecated and will be removed in a future release. Use api.json instead",
|
|
5117
5124
|
timestamp: e.apiJson.timestamp,
|
|
5118
5125
|
compiler: e.apiJson.compiler,
|
|
5119
|
-
components:
|
|
5126
|
+
components: Sa(e),
|
|
5120
5127
|
typeLibrary: {}
|
|
5121
5128
|
});
|
|
5122
|
-
function
|
|
5129
|
+
function Sa(e) {
|
|
5123
5130
|
const t = [];
|
|
5124
5131
|
for (const i of e.apiJson.modules)
|
|
5125
5132
|
for (const s of i.declarations)
|
|
5126
|
-
s.customElement === !0 && t.push(
|
|
5133
|
+
s.customElement === !0 && t.push(Ca(s, i.sourcePath));
|
|
5127
5134
|
return t;
|
|
5128
5135
|
}
|
|
5129
|
-
function
|
|
5136
|
+
function Ca(e, t) {
|
|
5130
5137
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
5131
5138
|
return {
|
|
5132
5139
|
filePath: t,
|
|
@@ -5141,9 +5148,9 @@ function Sa(e, t) {
|
|
|
5141
5148
|
dependencies: [],
|
|
5142
5149
|
dependencyGraph: {},
|
|
5143
5150
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
5144
|
-
props: e.members.map(
|
|
5145
|
-
methods: e.members.map(
|
|
5146
|
-
events: e.events?.map(
|
|
5151
|
+
props: e.members.map(Ea).filter(R),
|
|
5152
|
+
methods: e.members.map(Ta).filter(R),
|
|
5153
|
+
events: e.events?.map($a) ?? [],
|
|
5147
5154
|
styles: e.cssProperties?.map((s) => ({
|
|
5148
5155
|
name: s.name,
|
|
5149
5156
|
annotation: "prop",
|
|
@@ -5155,7 +5162,7 @@ function Sa(e, t) {
|
|
|
5155
5162
|
listeners: []
|
|
5156
5163
|
};
|
|
5157
5164
|
}
|
|
5158
|
-
function
|
|
5165
|
+
function Ea(e) {
|
|
5159
5166
|
if (e.kind !== "field")
|
|
5160
5167
|
return;
|
|
5161
5168
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], s = t.readonly ? [{ name: "readonly", text: "" }] : [], r = t.docsTags?.some((n) => n.name === "required") ?? !1;
|
|
@@ -5196,7 +5203,7 @@ const yt = (e) => Object.fromEntries(
|
|
|
5196
5203
|
]
|
|
5197
5204
|
) ?? []
|
|
5198
5205
|
);
|
|
5199
|
-
function
|
|
5206
|
+
function Ta(e) {
|
|
5200
5207
|
if (e.kind !== "method")
|
|
5201
5208
|
return;
|
|
5202
5209
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], s = t.parameters?.map(({ name: r, type: n, description: a }) => ({
|
|
@@ -5227,7 +5234,7 @@ function Ea(e) {
|
|
|
5227
5234
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
5228
5235
|
};
|
|
5229
5236
|
}
|
|
5230
|
-
function
|
|
5237
|
+
function $a(e) {
|
|
5231
5238
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
5232
5239
|
return {
|
|
5233
5240
|
event: e.name,
|
|
@@ -5256,7 +5263,7 @@ const gs = (e) => e.flatMap(
|
|
|
5256
5263
|
description: i.description || void 0
|
|
5257
5264
|
})) ?? []
|
|
5258
5265
|
);
|
|
5259
|
-
function
|
|
5266
|
+
function Pa(e) {
|
|
5260
5267
|
if (e.attributes === void 0)
|
|
5261
5268
|
return [];
|
|
5262
5269
|
const t = [];
|
|
@@ -5267,7 +5274,7 @@ function $a(e) {
|
|
|
5267
5274
|
description: Me(s.description, s.deprecated) || void 0,
|
|
5268
5275
|
default: s.default,
|
|
5269
5276
|
value: {
|
|
5270
|
-
type:
|
|
5277
|
+
type: ka(
|
|
5271
5278
|
s.type.values?.map(
|
|
5272
5279
|
(r) => r.type === "string" && r.value !== void 0 ? `"${r.value}"` : r.value ?? r.type
|
|
5273
5280
|
)
|
|
@@ -5277,7 +5284,7 @@ function $a(e) {
|
|
|
5277
5284
|
}
|
|
5278
5285
|
return t;
|
|
5279
5286
|
}
|
|
5280
|
-
const
|
|
5287
|
+
const ka = (e) => e?.length === 1 ? e[0] : e, Me = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ye = {
|
|
5281
5288
|
slots: "Slots",
|
|
5282
5289
|
events: "Events",
|
|
5283
5290
|
cssProperties: "CSS Properties",
|
|
@@ -5285,7 +5292,7 @@ const Pa = (e) => e?.length === 1 ? e[0] : e, Me = (e = "", t = !1) => t === !1
|
|
|
5285
5292
|
methods: "Methods"
|
|
5286
5293
|
};
|
|
5287
5294
|
function ys(e) {
|
|
5288
|
-
const t =
|
|
5295
|
+
const t = Ia(e.slots), i = xa(e.events), s = Aa(e.cssProperties), r = La(e.cssParts), n = Na(e.members), a = Me(e.description, e.deprecated).trim();
|
|
5289
5296
|
return [...a ? [`${a}
|
|
5290
5297
|
--`] : [], i, n, t, s, r].filter(Boolean).join(`
|
|
5291
5298
|
|
|
@@ -5293,28 +5300,28 @@ function ys(e) {
|
|
|
5293
5300
|
}
|
|
5294
5301
|
const ve = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
5295
5302
|
${t.join(`
|
|
5296
|
-
`)}`,
|
|
5303
|
+
`)}`, Ia = (e) => ve(
|
|
5297
5304
|
ye.slots,
|
|
5298
5305
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
5299
|
-
),
|
|
5306
|
+
), xa = (e) => ve(
|
|
5300
5307
|
ye.events,
|
|
5301
5308
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
5302
|
-
),
|
|
5309
|
+
), Aa = (e = []) => ve(
|
|
5303
5310
|
ye.cssProperties,
|
|
5304
5311
|
e?.map(
|
|
5305
5312
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
5306
5313
|
)
|
|
5307
|
-
),
|
|
5314
|
+
), La = (e) => ve(
|
|
5308
5315
|
ye.cssParts,
|
|
5309
5316
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
5310
|
-
),
|
|
5317
|
+
), Na = (e) => ve(
|
|
5311
5318
|
ye.methods,
|
|
5312
5319
|
e.filter(Ns).map(
|
|
5313
5320
|
(t) => [`- \`${t.name}${t.signature}\``, Me(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
5314
5321
|
)
|
|
5315
5322
|
);
|
|
5316
|
-
function
|
|
5317
|
-
const i =
|
|
5323
|
+
function ja(e, t) {
|
|
5324
|
+
const i = Fa(e), s = gs(e), r = hs(e), n = j();
|
|
5318
5325
|
return {
|
|
5319
5326
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
5320
5327
|
name: n.name,
|
|
@@ -5332,11 +5339,11 @@ function Na(e, t) {
|
|
|
5332
5339
|
}
|
|
5333
5340
|
};
|
|
5334
5341
|
}
|
|
5335
|
-
const
|
|
5342
|
+
const Fa = (e) => e.map((t) => ({
|
|
5336
5343
|
name: t.tagName,
|
|
5337
5344
|
description: ys(t),
|
|
5338
5345
|
"doc-url": t.demos?.[0]?.url,
|
|
5339
|
-
attributes:
|
|
5346
|
+
attributes: Pa(t),
|
|
5340
5347
|
slots: t.slots?.map((i) => ({
|
|
5341
5348
|
name: i.name,
|
|
5342
5349
|
description: i.description
|
|
@@ -5344,10 +5351,10 @@ const ja = (e) => e.map((t) => ({
|
|
|
5344
5351
|
// REFACTOR: this was deprecated in the spec: https://github.com/JetBrains/web-types/blob/11e46e47cb65edc1930dc1fae854005ad45ac08f/schema/web-types.json#L866
|
|
5345
5352
|
events: Qt(t),
|
|
5346
5353
|
js: {
|
|
5347
|
-
properties:
|
|
5354
|
+
properties: Ra(t),
|
|
5348
5355
|
events: Qt(t)
|
|
5349
5356
|
}
|
|
5350
|
-
})),
|
|
5357
|
+
})), Ra = (e) => e.members.filter(js).map((t) => ({
|
|
5351
5358
|
name: t.name,
|
|
5352
5359
|
description: t.description,
|
|
5353
5360
|
type: t.type?.text
|
|
@@ -5355,34 +5362,34 @@ const ja = (e) => e.map((t) => ({
|
|
|
5355
5362
|
name: t.name,
|
|
5356
5363
|
type: t.type?.text,
|
|
5357
5364
|
description: t.description
|
|
5358
|
-
})) ?? [],
|
|
5365
|
+
})) ?? [], Da = (e) => e.map((t) => ({
|
|
5359
5366
|
name: t.tagName,
|
|
5360
5367
|
description: ys(t),
|
|
5361
|
-
attributes:
|
|
5368
|
+
attributes: Oa(t),
|
|
5362
5369
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
5363
|
-
})),
|
|
5370
|
+
})), Oa = (e) => e.attributes?.map((t) => ({
|
|
5364
5371
|
name: t.name,
|
|
5365
5372
|
description: Me(t.description, t.deprecated) || void 0,
|
|
5366
|
-
values:
|
|
5367
|
-
})) ?? [],
|
|
5373
|
+
values: Ma(t)
|
|
5374
|
+
})) ?? [], Ma = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Ja = (e) => ({
|
|
5368
5375
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
5369
5376
|
version: 1.1,
|
|
5370
|
-
tags:
|
|
5371
|
-
}),
|
|
5377
|
+
tags: Da(e)
|
|
5378
|
+
}), Ba = (e) => ({
|
|
5372
5379
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
5373
5380
|
version: 1.1,
|
|
5374
5381
|
properties: gs(e),
|
|
5375
5382
|
pseudoElements: hs(e)
|
|
5376
|
-
}),
|
|
5383
|
+
}), _a = "@arcgis/lumina:generateDocs";
|
|
5377
5384
|
function Ka(e) {
|
|
5378
5385
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
5379
5386
|
{
|
|
5380
5387
|
type: "dynamic",
|
|
5381
|
-
source: () => JSON.stringify(
|
|
5388
|
+
source: () => JSON.stringify(wa(e), null, rt(e)),
|
|
5382
5389
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
5383
5390
|
}
|
|
5384
5391
|
]), {
|
|
5385
|
-
name:
|
|
5392
|
+
name: _a,
|
|
5386
5393
|
async writeBundle() {
|
|
5387
5394
|
if (e.isInStorybook)
|
|
5388
5395
|
return;
|
|
@@ -5392,51 +5399,51 @@ function Ka(e) {
|
|
|
5392
5399
|
await Fi(l);
|
|
5393
5400
|
const d = [];
|
|
5394
5401
|
if (r !== void 0) {
|
|
5395
|
-
const c = JSON.stringify(
|
|
5396
|
-
d.push(
|
|
5402
|
+
const c = JSON.stringify(Ja(e.apiJsonComponents), null, t);
|
|
5403
|
+
d.push(K(r, c));
|
|
5397
5404
|
}
|
|
5398
5405
|
if (n !== void 0) {
|
|
5399
|
-
const c = JSON.stringify(
|
|
5400
|
-
d.push(
|
|
5406
|
+
const c = JSON.stringify(Ba(e.apiJsonComponents), null, t);
|
|
5407
|
+
d.push(K(n, c));
|
|
5401
5408
|
}
|
|
5402
5409
|
if (a !== void 0) {
|
|
5403
|
-
const c =
|
|
5404
|
-
d.push(
|
|
5410
|
+
const c = ja(e.apiJsonComponents, typeof i == "object" ? i : {});
|
|
5411
|
+
d.push(K(a, JSON.stringify(c, null, t)));
|
|
5405
5412
|
}
|
|
5406
5413
|
await Promise.all(d);
|
|
5407
5414
|
}
|
|
5408
5415
|
};
|
|
5409
5416
|
}
|
|
5410
|
-
function
|
|
5417
|
+
function Wa(e) {
|
|
5411
5418
|
return {
|
|
5412
5419
|
name: "@arcgis/lumina:buildWrappers",
|
|
5413
5420
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
5414
5421
|
async writeBundle() {
|
|
5415
5422
|
e.isInStorybook || await Promise.all(
|
|
5416
5423
|
e.options.build?.wrappers?.map(async (t) => {
|
|
5417
|
-
t.type === "react18" && await
|
|
5424
|
+
t.type === "react18" && await Ha(e, t);
|
|
5418
5425
|
}) ?? []
|
|
5419
5426
|
);
|
|
5420
5427
|
}
|
|
5421
5428
|
};
|
|
5422
5429
|
}
|
|
5423
|
-
const
|
|
5424
|
-
import React from "${
|
|
5430
|
+
const Ua = "react", Zt = "@lit/react", za = `
|
|
5431
|
+
import React from "${Ua}";
|
|
5425
5432
|
import { createComponent } from "${Zt}";
|
|
5426
5433
|
import type { EventName } from "${Zt}";
|
|
5427
5434
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
5428
5435
|
|
|
5429
5436
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
5430
5437
|
`;
|
|
5431
|
-
async function
|
|
5438
|
+
async function Ha(e, t) {
|
|
5432
5439
|
const { name: i } = j(), s = [];
|
|
5433
5440
|
for (const a of e.apiJson.modules)
|
|
5434
5441
|
for (const l of a.declarations)
|
|
5435
|
-
l.customElement === !0 && s.push(
|
|
5436
|
-
const r = [`/// <reference types="${i}" preserve="true" />`,
|
|
5437
|
-
await X(u.dirname(n), { recursive: !0 }), await
|
|
5442
|
+
l.customElement === !0 && s.push(qa(l));
|
|
5443
|
+
const r = [`/// <reference types="${i}" preserve="true" />`, za, ...s].join(""), n = u.resolve(t.proxiesFile);
|
|
5444
|
+
await X(u.dirname(n), { recursive: !0 }), await K(n, r);
|
|
5438
5445
|
}
|
|
5439
|
-
function
|
|
5446
|
+
function qa(e) {
|
|
5440
5447
|
const t = e.events?.map(
|
|
5441
5448
|
(i) => ` ${Hs(`on${ws(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
5442
5449
|
).join(`
|
|
@@ -5453,30 +5460,30 @@ ${t}
|
|
|
5453
5460
|
);
|
|
5454
5461
|
`;
|
|
5455
5462
|
}
|
|
5456
|
-
function
|
|
5463
|
+
function Sc(e = {}) {
|
|
5457
5464
|
const t = new $(e), s = [
|
|
5458
5465
|
t._plugin,
|
|
5459
|
-
|
|
5466
|
+
Kn(t),
|
|
5460
5467
|
Vn(t),
|
|
5461
|
-
|
|
5462
|
-
|
|
5468
|
+
Qn(t),
|
|
5469
|
+
ya(t),
|
|
5463
5470
|
jn(t),
|
|
5464
5471
|
Ka(t),
|
|
5465
|
-
|
|
5466
|
-
|
|
5472
|
+
fa(t),
|
|
5473
|
+
mo(t),
|
|
5467
5474
|
fr(t),
|
|
5468
5475
|
Fn(t),
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5476
|
+
ha(t),
|
|
5477
|
+
go(t),
|
|
5478
|
+
so(t),
|
|
5472
5479
|
Vs(t),
|
|
5473
5480
|
ln(t),
|
|
5474
|
-
|
|
5481
|
+
Wa(t),
|
|
5475
5482
|
Rn(t)
|
|
5476
5483
|
].filter(R);
|
|
5477
5484
|
return s.context = t, s;
|
|
5478
5485
|
}
|
|
5479
|
-
const
|
|
5486
|
+
const Cc = {
|
|
5480
5487
|
initializeComponentDependencies: Ti,
|
|
5481
5488
|
updateLuminaTs: Xi,
|
|
5482
5489
|
propertyToAttributeMappings: W,
|
|
@@ -5488,7 +5495,7 @@ const Sc = {
|
|
|
5488
5495
|
htmlAlwaysAttributes: Qe
|
|
5489
5496
|
};
|
|
5490
5497
|
export {
|
|
5491
|
-
|
|
5498
|
+
Cc as exportsForCodemod,
|
|
5492
5499
|
De as inferCdnUrl,
|
|
5493
|
-
|
|
5500
|
+
Sc as useLumina
|
|
5494
5501
|
};
|