@arcgis/lumina-compiler 4.34.0-next.70 → 4.34.0-next.71
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
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { externalizeDependencies as ls, path as u, toSystemPathSeparators as te, retrievePackageJson as R, fetchPackageLocation as
|
|
1
|
+
import { externalizeDependencies as ls, path as u, toSystemPathSeparators as te, retrievePackageJson as R, fetchPackageLocation as Ue, asyncRetrievePackageJson as ze, existsAsync as _, findPath as ds, toPosixPathSeparators as Fe, isPosix as Ri, getCwd as Mi } from "@arcgis/components-build-utils";
|
|
2
2
|
import ps from "vite-plugin-dts";
|
|
3
3
|
import o from "typescript";
|
|
4
|
-
import { f as
|
|
4
|
+
import { f as S, l as T } from "./logger-KpGU2b3R.js";
|
|
5
5
|
import { getMemberName as Q, apiMemberToSynthesizedComments as X, globalPackageIdentifier as Oi, setApiDocFromJsDoc as fe, ApiExtractor as us, hasIgnoredModifier as ms, symbolToDocs as Wt, setDefaultFromInitializer as Bt, multipleJsDocTags as fs, findDecorator as _t, isApiMethod as gs, isApiProperty as ys } from "@arcgis/api-extractor";
|
|
6
6
|
import { isNotUndefined as j } from "@arcgis/toolkit/predicate";
|
|
7
|
-
import { readdir as
|
|
7
|
+
import { readdir as qe, readFile as J, rm as hs, mkdir as Z, cp as vs, writeFile as D, copyFile as ws } from "node:fs/promises";
|
|
8
8
|
import { mappedFind as he } from "@arcgis/toolkit/array";
|
|
9
|
-
import { camelToKebab as Tt, kebabToPascal as
|
|
10
|
-
import { lazyMetaSubItemJoiner as Es, lazyMetaItemJoiner as
|
|
9
|
+
import { camelToKebab as Tt, kebabToPascal as Ss, uncapitalize as ft, getPreamble as bs, capitalize as Ts } from "@arcgis/toolkit/string";
|
|
10
|
+
import { lazyMetaSubItemJoiner as Es, lazyMetaItemJoiner as tt, lazyMetaGroupJoiner as Cs, propertyFlagAttribute as Ht, propertyFlagReflect as $s, propertyFlagBoolean as xs, propertyFlagNumber as Ps, propertyFlagState as ks, propertyFlagReadOnly as Is, propertyFlagNoAccessor as As } from "@arcgis/lumina/config";
|
|
11
11
|
import { build as Ls } from "esbuild";
|
|
12
12
|
import { identity as Ji } from "@arcgis/toolkit/function";
|
|
13
13
|
import { Deferred as Fs } from "@arcgis/toolkit/promise";
|
|
@@ -207,7 +207,7 @@ ${e.content}`
|
|
|
207
207
|
const t = e.content.match(tr)?.[1] ?? e.content.match(ir)?.[1];
|
|
208
208
|
if (t !== void 0)
|
|
209
209
|
throw Error(
|
|
210
|
-
|
|
210
|
+
S(
|
|
211
211
|
"@arcgis/lumina:failOnJsonImport",
|
|
212
212
|
`Found a .json import (${t}). This can cause TypeScript errors for consumers of your package. See alternative options: https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2047
|
|
213
213
|
File content:
|
|
@@ -335,14 +335,14 @@ function gr(e, t, i) {
|
|
|
335
335
|
if (r === void 0)
|
|
336
336
|
return e;
|
|
337
337
|
const a = [], c = /* @__PURE__ */ new Set(), l = [], d = [];
|
|
338
|
-
|
|
338
|
+
gt = void 0;
|
|
339
339
|
for (let g = 0; g < n.members.length; g++) {
|
|
340
340
|
const y = n.members[g], v = hr(y, r, l, c, t);
|
|
341
341
|
v === void 0 ? a.push(y) : Array.isArray(v) ? d.push(...v) : (o.setEmitFlags(v, o.EmitFlags.NoComments), d.push(v));
|
|
342
342
|
}
|
|
343
343
|
c.size > 0 && a.forEach((g) => {
|
|
344
344
|
const y = Q(g.name);
|
|
345
|
-
(y !== void 0 && c.has(y) || yr(g)) && d.push(
|
|
345
|
+
(y !== void 0 && c.has(y) || yr(g)) && d.push(wr(g));
|
|
346
346
|
}), l.length > 0 && d.push(ur(l, t, i.compiler));
|
|
347
347
|
const p = o.factory.updateClassDeclaration(
|
|
348
348
|
n,
|
|
@@ -378,7 +378,7 @@ function yr(e) {
|
|
|
378
378
|
(t) => o.isImportTypeNode(t) && t.qualifier !== void 0 && o.isIdentifier(t.qualifier) && t.qualifier.escapedText === "T9nMeta"
|
|
379
379
|
);
|
|
380
380
|
}
|
|
381
|
-
let
|
|
381
|
+
let gt;
|
|
382
382
|
function hr(e, t, i, n, s) {
|
|
383
383
|
const r = Q(e.name);
|
|
384
384
|
if (r === void 0)
|
|
@@ -386,8 +386,8 @@ function hr(e, t, i, n, s) {
|
|
|
386
386
|
const a = t.members.find((l) => l.name === r);
|
|
387
387
|
if (a?.privacy !== void 0)
|
|
388
388
|
return;
|
|
389
|
-
const c =
|
|
390
|
-
if (
|
|
389
|
+
const c = gt;
|
|
390
|
+
if (gt = r, a === void 0) {
|
|
391
391
|
if (o.isPropertyDeclaration(e)) {
|
|
392
392
|
const l = t.events?.find((p) => p.name === r);
|
|
393
393
|
if (l === void 0)
|
|
@@ -397,7 +397,7 @@ function hr(e, t, i, n, s) {
|
|
|
397
397
|
Qt(e.modifiers),
|
|
398
398
|
e.name,
|
|
399
399
|
void 0,
|
|
400
|
-
|
|
400
|
+
Sr(e.type, s),
|
|
401
401
|
e.initializer
|
|
402
402
|
);
|
|
403
403
|
return o.setSyntheticLeadingComments(d, X(l)), d;
|
|
@@ -482,7 +482,7 @@ function Xt(e, t, i) {
|
|
|
482
482
|
return t;
|
|
483
483
|
}
|
|
484
484
|
const vr = /(?<=this.)[\w$]+/gu;
|
|
485
|
-
function
|
|
485
|
+
function wr(e) {
|
|
486
486
|
if (o.setEmitFlags(e, o.EmitFlags.NoComments), o.isPropertyDeclaration(e)) {
|
|
487
487
|
const t = Ie(e.modifiers);
|
|
488
488
|
if (t !== e.modifiers)
|
|
@@ -537,7 +537,7 @@ function Ie(e) {
|
|
|
537
537
|
)
|
|
538
538
|
];
|
|
539
539
|
}
|
|
540
|
-
function
|
|
540
|
+
function Sr(e, t) {
|
|
541
541
|
if (e === void 0)
|
|
542
542
|
return;
|
|
543
543
|
const i = o.isImportTypeNode(e) && e.qualifier && o.isIdentifier(e.qualifier) && e.qualifier.escapedText === "EventEmitter" ? e.typeArguments ?? [] : o.isTypeReferenceNode(e) && o.isIdentifier(e.typeName) && e.typeName.escapedText === "EventEmitter" ? e.typeArguments ?? [] : void 0;
|
|
@@ -564,7 +564,7 @@ function Tr(e) {
|
|
|
564
564
|
return [];
|
|
565
565
|
const s = e.typeScriptProgram.getSourceFile(n);
|
|
566
566
|
if (s === void 0)
|
|
567
|
-
throw Error(
|
|
567
|
+
throw Error(S(Zt, `Could not find source file: ${te(n)}`));
|
|
568
568
|
const r = [];
|
|
569
569
|
return e.typeScriptProgram.emit(
|
|
570
570
|
s,
|
|
@@ -612,7 +612,7 @@ function Pr(e) {
|
|
|
612
612
|
afterDiagnostic(r) {
|
|
613
613
|
const a = r.length > 0, c = e.viteCommand === "build";
|
|
614
614
|
if (a && c) {
|
|
615
|
-
const d = new Error(
|
|
615
|
+
const d = new Error(`${r.length} TypeScript errors reported. See error messages above`);
|
|
616
616
|
throw d.stack = "", d;
|
|
617
617
|
}
|
|
618
618
|
return t?.afterDiagnostic?.(r);
|
|
@@ -674,7 +674,7 @@ function Pr(e) {
|
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
const kr = "Fragment",
|
|
677
|
+
const kr = "Fragment", it = "DynamicHtmlTag", nt = "DynamicSvgTag", Me = Symbol("dynamic html tag name"), yt = Symbol("dynamic svg tag name"), Vi = /* @__PURE__ */ new Set([
|
|
678
678
|
/**
|
|
679
679
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
680
680
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -714,7 +714,7 @@ const kr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Me = Symbol(
|
|
|
714
714
|
"exportParts",
|
|
715
715
|
"hreflang",
|
|
716
716
|
"media"
|
|
717
|
-
]),
|
|
717
|
+
]), ht = {
|
|
718
718
|
button: /* @__PURE__ */ new Set(["popoverTarget"]),
|
|
719
719
|
input: /* @__PURE__ */ new Set(["list", "capture"]),
|
|
720
720
|
iframe: /* @__PURE__ */ new Set(["sandbox"]),
|
|
@@ -722,7 +722,7 @@ const kr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Me = Symbol(
|
|
|
722
722
|
meta: /* @__PURE__ */ new Set(["charset"]),
|
|
723
723
|
math: /* @__PURE__ */ new Set(["dir", "displaystyle", "scriptlevel"]),
|
|
724
724
|
menu: /* @__PURE__ */ new Set(["label", "type"])
|
|
725
|
-
},
|
|
725
|
+
}, H = {
|
|
726
726
|
common: {
|
|
727
727
|
reflected: {
|
|
728
728
|
hidden: "hidden",
|
|
@@ -1535,8 +1535,8 @@ const kr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Me = Symbol(
|
|
|
1535
1535
|
}
|
|
1536
1536
|
}
|
|
1537
1537
|
};
|
|
1538
|
-
Qi(
|
|
1539
|
-
Object.values(
|
|
1538
|
+
Qi(H.common);
|
|
1539
|
+
Object.values(H.perElement).forEach(Qi);
|
|
1540
1540
|
function Qi(e) {
|
|
1541
1541
|
e?.reflected !== void 0 && (e.reflected = Object.assign(/* @__PURE__ */ Object.create(null), e.reflected)), e?.stringifiedReflected !== void 0 && (e.stringifiedReflected = Object.assign(
|
|
1542
1542
|
/* @__PURE__ */ Object.create(null),
|
|
@@ -1782,7 +1782,7 @@ const Nr = (e) => e.replaceAll("\\", "\\\\").replace(Dr, "\\${").replaceAll("`",
|
|
|
1782
1782
|
">": ">"
|
|
1783
1783
|
}, Yi = (e) => e.replace(Mr, (t) => Or[t]), Pt = (e) => typeof e == "string" && e.includes("-") && !Lr.has(e), Jr = async (e) => Object.fromEntries(
|
|
1784
1784
|
(await e.componentFilesPromise).map((t) => [en(t), t])
|
|
1785
|
-
), en = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", Et.slice(0, -3))), kt = async (e, t, i = t) => await
|
|
1785
|
+
), en = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", Et.slice(0, -3))), kt = async (e, t, i = t) => await qe(i, { recursive: !0 }).catch((n) => {
|
|
1786
1786
|
if (String(n).includes("ENOENT"))
|
|
1787
1787
|
return T.error("@arcgis/lumina", `Unable to find the ${i} directory (cwd: ${process.cwd()})`), [];
|
|
1788
1788
|
throw n;
|
|
@@ -1791,23 +1791,23 @@ const Nr = (e) => e.replaceAll("\\", "\\\\").replace(Dr, "\\${").replaceAll("`",
|
|
|
1791
1791
|
if (!a.endsWith(".tsx"))
|
|
1792
1792
|
return;
|
|
1793
1793
|
const c = u.join(i, a);
|
|
1794
|
-
if (
|
|
1794
|
+
if (we(c, t))
|
|
1795
1795
|
return c;
|
|
1796
1796
|
a.endsWith(".stories.tsx") && c.startsWith(t) && s.push(c);
|
|
1797
1797
|
}).filter(j);
|
|
1798
1798
|
return e.componentFiles = r, e.componentStoryFiles = s, r;
|
|
1799
1799
|
});
|
|
1800
|
-
function
|
|
1800
|
+
function we(e, t) {
|
|
1801
1801
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
1802
1802
|
return !1;
|
|
1803
1803
|
const [i, n] = e.slice(0, -4).split(u.sep).slice(Kr);
|
|
1804
1804
|
return i === n;
|
|
1805
1805
|
}
|
|
1806
|
-
const Kr = -2, ei = 5, ti = 1, ii = 1, ni = 3, si = 4,
|
|
1807
|
-
Wr(
|
|
1808
|
-
Br(
|
|
1809
|
-
_r(
|
|
1810
|
-
const ge =
|
|
1806
|
+
const Kr = -2, ei = 5, ti = 1, ii = 1, ni = 3, si = 4, Ge = o;
|
|
1807
|
+
Wr(Ge.createSourceMapGenerator);
|
|
1808
|
+
Br(Ge.createTextWriter);
|
|
1809
|
+
_r(Ge.getNewLineCharacter);
|
|
1810
|
+
const ge = Ge;
|
|
1811
1811
|
function Wr(e) {
|
|
1812
1812
|
if (typeof e != "function")
|
|
1813
1813
|
throw new Error(
|
|
@@ -1913,11 +1913,11 @@ function Oe(e, t, i, n, s = !1) {
|
|
|
1913
1913
|
};
|
|
1914
1914
|
}
|
|
1915
1915
|
function oi(e) {
|
|
1916
|
-
Yr.writeNode(o.EmitHint.Unspecified, e, void 0,
|
|
1917
|
-
const t =
|
|
1918
|
-
return
|
|
1916
|
+
Yr.writeNode(o.EmitHint.Unspecified, e, void 0, st);
|
|
1917
|
+
const t = st.getText();
|
|
1918
|
+
return st.clear(), t;
|
|
1919
1919
|
}
|
|
1920
|
-
const Yr = tn({ removeComments: !0 }),
|
|
1920
|
+
const Yr = tn({ removeComments: !0 }), st = ge.createTextWriter(`
|
|
1921
1921
|
`), rn = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, eo = rn & o.TypeFormatFlags.NodeBuilderFlagsMask, to = eo | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
1922
1922
|
function io(e, t, i, n = !0) {
|
|
1923
1923
|
const s = /* @__PURE__ */ new Map();
|
|
@@ -1944,8 +1944,8 @@ function ci(e, t, i, n, s = !0) {
|
|
|
1944
1944
|
if (v.parameters.forEach((h) => {
|
|
1945
1945
|
if (h.type === void 0)
|
|
1946
1946
|
return;
|
|
1947
|
-
const
|
|
1948
|
-
se(
|
|
1947
|
+
const w = e.getTypeFromTypeNode(h.type);
|
|
1948
|
+
se(w, /* @__PURE__ */ new Map(), c, !1);
|
|
1949
1949
|
}), v.type !== void 0) {
|
|
1950
1950
|
const h = e.getTypeFromTypeNode(v.type);
|
|
1951
1951
|
se(h, /* @__PURE__ */ new Map(), c, !1);
|
|
@@ -2045,7 +2045,7 @@ function ro(e, t) {
|
|
|
2045
2045
|
};
|
|
2046
2046
|
}
|
|
2047
2047
|
function oo(e, t) {
|
|
2048
|
-
return
|
|
2048
|
+
return we(e, t.srcComponents) ? u.join(t.dist, en(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2049
2049
|
}
|
|
2050
2050
|
const ao = (e) => e.endsWith(".js") || e.endsWith(".d.ts") ? e : `${e.endsWith(".ts") ? e.slice(0, -3) : e.endsWith(".tsx") ? e.slice(0, -4) : e}.d.ts`;
|
|
2051
2051
|
function on(e) {
|
|
@@ -2121,19 +2121,19 @@ const uo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, mo = /\n\s+\
|
|
|
2121
2121
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
2122
2122
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
2123
2123
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
2124
|
-
},
|
|
2124
|
+
}, wo = ["css", "less", "sass", "scss", "styl", "stylus", "pcss", "postcss", "sss"], Ke = new RegExp(`\\.(${wo.join("|")})(\\?|$)`, "u"), So = /^import ["'](?<specifier>[^"']+)["'];$/gmu, bo = () => "throwError", V = "@arcgis/lumina:loadLitCss", ee = "?layered", Ne = "?global", To = (e) => ({
|
|
2125
2125
|
name: V,
|
|
2126
2126
|
enforce: "pre",
|
|
2127
2127
|
configResolved(t) {
|
|
2128
2128
|
const i = t.plugins.find(({ name: s }) => s === "vite:css-post");
|
|
2129
2129
|
if (i === void 0)
|
|
2130
|
-
throw Error(
|
|
2130
|
+
throw Error(S(V, "Unable to find the vite's built-in vite:css-post plugin"));
|
|
2131
2131
|
const n = i.transform;
|
|
2132
2132
|
if (typeof n != "object" || typeof n.handler != "function")
|
|
2133
|
-
throw Error(
|
|
2133
|
+
throw Error(S(V, "Expected vite:css-post to declare a transform:{handler()} property"));
|
|
2134
2134
|
if (Object.keys(n).length !== 1)
|
|
2135
2135
|
throw Error(
|
|
2136
|
-
|
|
2136
|
+
S(V, "Expected vite:css-post's transform handler to have only a single property: handler")
|
|
2137
2137
|
);
|
|
2138
2138
|
i.transform = async function(r, a) {
|
|
2139
2139
|
const c = a.endsWith(ee);
|
|
@@ -2162,10 +2162,10 @@ const uo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, mo = /\n\s+\
|
|
|
2162
2162
|
if (v.cssProperties === void 0)
|
|
2163
2163
|
v.cssProperties = Array.from(g);
|
|
2164
2164
|
else {
|
|
2165
|
-
const h = new Set(v.cssProperties.map((
|
|
2165
|
+
const h = new Set(v.cssProperties.map((w) => w.name));
|
|
2166
2166
|
v.cssProperties = [
|
|
2167
2167
|
...v.cssProperties,
|
|
2168
|
-
...g.filter((
|
|
2168
|
+
...g.filter((w) => !h.has(w.name))
|
|
2169
2169
|
];
|
|
2170
2170
|
}
|
|
2171
2171
|
}
|
|
@@ -2188,14 +2188,14 @@ const uo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, mo = /\n\s+\
|
|
|
2188
2188
|
let s = 0;
|
|
2189
2189
|
const r = co(i);
|
|
2190
2190
|
let a = !1;
|
|
2191
|
-
const c = t.replaceAll(
|
|
2191
|
+
const c = t.replaceAll(So, (l, d) => {
|
|
2192
2192
|
if (!Ke.test(d) || d.includes("?"))
|
|
2193
2193
|
return l;
|
|
2194
2194
|
if (r) {
|
|
2195
2195
|
if ((e.options.css?.sideEffectImportHandling ?? bo)(d, i) === "drop")
|
|
2196
2196
|
return a = !0, or(l);
|
|
2197
2197
|
throw Error(
|
|
2198
|
-
|
|
2198
|
+
S(
|
|
2199
2199
|
V,
|
|
2200
2200
|
`Found a side-effect CSS import \`${l}\`. Such import is not allowed as it won't work with shadow DOM. This file appears to be external so such import may not be under your control. To ignore this import, please set the css.sideEffectImportHandling property in useLumina() plugin to a function that will return "drop" for this import to indicate that you wish to have this style import dropped. Then, you would have to import the dropped manually in your component like so: \`import { styles } from "example.css";\` and then add \`static override styles = styles;\` to your component`,
|
|
2201
2201
|
i
|
|
@@ -2219,7 +2219,7 @@ const uo = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, mo = /\n\s+\
|
|
|
2219
2219
|
if (d.endsWith(Ne))
|
|
2220
2220
|
return l;
|
|
2221
2221
|
throw Error(
|
|
2222
|
-
|
|
2222
|
+
S(
|
|
2223
2223
|
V,
|
|
2224
2224
|
`Found a side-effect CSS import \`${l}\`. Such import is not allowed as it won't work with shadow DOM. Please use \`import { styles } from "example.css";\` instead and then add \`static override styles = styles;\` to your component`,
|
|
2225
2225
|
i
|
|
@@ -2326,7 +2326,7 @@ export declare const defineCustomElements: import("@arcgis/lumina").DefineCustom
|
|
|
2326
2326
|
"]"
|
|
2327
2327
|
].join("");
|
|
2328
2328
|
function Jo(e) {
|
|
2329
|
-
const { properties: t, asyncMethods: i, syncMethods: n } = gn(e), s = t.map((p) => p.join(Es)).join(
|
|
2329
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = gn(e), s = t.map((p) => p.join(Es)).join(tt), r = i.join(tt), a = n.join(tt), c = [s, r, a], l = c.findLastIndex((p) => p.length > 0), d = c.slice(0, l + 1);
|
|
2330
2330
|
return d.length > 0 ? `"${d.join(Cs)}"` : "";
|
|
2331
2331
|
}
|
|
2332
2332
|
function gn(e) {
|
|
@@ -2419,14 +2419,14 @@ function zo(e, t, i) {
|
|
|
2419
2419
|
if (s !== void 0) {
|
|
2420
2420
|
if (!o.isObjectLiteralExpression(s))
|
|
2421
2421
|
throw Error(
|
|
2422
|
-
|
|
2422
|
+
S(
|
|
2423
2423
|
"@arcgis/lumina:extractEventMeta",
|
|
2424
2424
|
`Expected object literal expression as first argument of ${Ae}(). Found ${t.name} = createEvent(${s.getText(i)})`
|
|
2425
2425
|
)
|
|
2426
2426
|
);
|
|
2427
2427
|
if (s.properties.some((r) => o.isSpreadAssignment(r)))
|
|
2428
2428
|
throw Error(
|
|
2429
|
-
|
|
2429
|
+
S(
|
|
2430
2430
|
"@arcgis/lumina:extractEventMeta",
|
|
2431
2431
|
`Unexpected spread syntax in ${Ae}() argument. ${Ae}() arguments must be statically parsable at compile time`
|
|
2432
2432
|
)
|
|
@@ -2441,7 +2441,7 @@ function re(e, t) {
|
|
|
2441
2441
|
if (e.kind === o.SyntaxKind.FalseKeyword)
|
|
2442
2442
|
return !1;
|
|
2443
2443
|
throw Error(
|
|
2444
|
-
|
|
2444
|
+
S(
|
|
2445
2445
|
"@arcgis/lumina:extractBooleanInitializer",
|
|
2446
2446
|
`Expected boolean literal. Instead found ${e?.getText(t)}`
|
|
2447
2447
|
)
|
|
@@ -2460,7 +2460,7 @@ class We extends us {
|
|
|
2460
2460
|
const i = super.extractModules(t);
|
|
2461
2461
|
for (const n of i)
|
|
2462
2462
|
for (const s of n.declarations)
|
|
2463
|
-
"customElement" in s && (this.context.isFullApiExtraction && Vo(s, this.context, this.indexedComponents), this.inheritMembers(s, i), this.context.isFullApiExtraction && (s.members.sort(
|
|
2463
|
+
"customElement" in s && (this.context.isFullApiExtraction && Vo(s, this.context, this.indexedComponents), this.inheritMembers(s, i), this.context.isFullApiExtraction && (s.members.sort(rt), s.attributes?.sort(rt), s.events?.sort(rt)));
|
|
2464
2464
|
return i;
|
|
2465
2465
|
}
|
|
2466
2466
|
extractDeclarations(t) {
|
|
@@ -2507,7 +2507,7 @@ class We extends us {
|
|
|
2507
2507
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2508
2508
|
* Stencil's behavior.
|
|
2509
2509
|
*/
|
|
2510
|
-
pascalCaseName:
|
|
2510
|
+
pascalCaseName: Ss(n),
|
|
2511
2511
|
privacy: void 0,
|
|
2512
2512
|
importPath: "",
|
|
2513
2513
|
members: [],
|
|
@@ -2520,7 +2520,7 @@ class We extends us {
|
|
|
2520
2520
|
}, r = t.heritageClauses?.find((a) => a.token === o.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;
|
|
2521
2521
|
if (r === void 0)
|
|
2522
2522
|
throw Error(
|
|
2523
|
-
|
|
2523
|
+
S(
|
|
2524
2524
|
"@arcgis/lumina:extractComponentDeclaration",
|
|
2525
2525
|
`Lumina component must extend LitElement class. Found ${i} in ${this.apiModule.path} that does not extend any class.`
|
|
2526
2526
|
)
|
|
@@ -2544,7 +2544,7 @@ class We extends us {
|
|
|
2544
2544
|
this.localCssImports = void 0;
|
|
2545
2545
|
}
|
|
2546
2546
|
fe(t.name, this.context.typeScriptTypeChecker, s);
|
|
2547
|
-
const c =
|
|
2547
|
+
const c = ft(s.name);
|
|
2548
2548
|
s.members.push({
|
|
2549
2549
|
kind: "method",
|
|
2550
2550
|
name: "componentOnReady",
|
|
@@ -2669,27 +2669,27 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2669
2669
|
} : Xr(this.context, d, f, this.file);
|
|
2670
2670
|
const g = o.isPropertyDeclaration(t) && t.type !== void 0 && t.initializer !== void 0 && o.isPropertyAccessExpression(t.initializer) && o.isPropertyAccessExpression(t.initializer.expression) && t.initializer.expression.expression.kind === o.SyntaxKind.ThisKeyword && o.isIdentifier(t.initializer.expression.name) && o.isIdentifier(t.initializer.name);
|
|
2671
2671
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || g) {
|
|
2672
|
-
const v = t.initializer, h = s.getSymbolAtLocation(v),
|
|
2673
|
-
if (
|
|
2674
|
-
const
|
|
2675
|
-
if (
|
|
2676
|
-
|
|
2672
|
+
const v = t.initializer, h = s.getSymbolAtLocation(v), w = h !== void 0 && ((h.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(h) : h, E = w?.getDeclarations() ?? [];
|
|
2673
|
+
if (w !== void 0) {
|
|
2674
|
+
const x = Wt(s, w);
|
|
2675
|
+
if (x.docsTags.length > 0) {
|
|
2676
|
+
x.docsTags = x.docsTags.filter(
|
|
2677
2677
|
(C) => !c.has(C.name) || fs.has(C.name)
|
|
2678
2678
|
);
|
|
2679
2679
|
const b = i.description;
|
|
2680
|
-
fe(t.name, s, i,
|
|
2680
|
+
fe(t.name, s, i, x), x.docsTags.forEach((C) => {
|
|
2681
2681
|
c.add(C.name);
|
|
2682
2682
|
}), i.description = b ?? i.description;
|
|
2683
2683
|
} else
|
|
2684
|
-
i.description ||=
|
|
2684
|
+
i.description ||= x.description;
|
|
2685
2685
|
}
|
|
2686
|
-
let
|
|
2687
|
-
E.forEach((
|
|
2688
|
-
if (
|
|
2686
|
+
let $, A;
|
|
2687
|
+
E.forEach((x) => {
|
|
2688
|
+
if ($ ??= o.isGetAccessor(x) ? x : void 0, A ??= o.isSetAccessor(x) ? x : void 0, !("initializer" in x))
|
|
2689
2689
|
return;
|
|
2690
|
-
const b =
|
|
2690
|
+
const b = x;
|
|
2691
2691
|
l ||= b.modifiers?.some((C) => C.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, Bt(b, i, b.getSourceFile());
|
|
2692
|
-
}), g &&
|
|
2692
|
+
}), g && $ !== void 0 && A !== void 0 && $.type?.getText() !== A.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${v.getText(this.file)}` });
|
|
2693
2693
|
}
|
|
2694
2694
|
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((v) => v.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && (We.loggedBooleanWarning || this.context.logLintWarning(
|
|
2695
2695
|
`Boolean properties should default to "false". Found default value "true" in ${this.apiComponent.name}.${i.name}. See https://qawebgis.esri.com/components/lumina/properties#boolean-properties`
|
|
@@ -2822,7 +2822,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2822
2822
|
const pe = {
|
|
2823
2823
|
name: "LitElement",
|
|
2824
2824
|
package: "@arcgis/lumina"
|
|
2825
|
-
},
|
|
2825
|
+
}, rt = (e, t) => e.name.localeCompare(t.name);
|
|
2826
2826
|
async function qo(e, t) {
|
|
2827
2827
|
t || (e.componentFilesPromise = kt(e, e.dir.srcComponents));
|
|
2828
2828
|
const i = await e.componentFilesPromise, n = await na(e, i);
|
|
@@ -2923,12 +2923,12 @@ function Le(e, t, i) {
|
|
|
2923
2923
|
), e.values?.forEach(Zo, t));
|
|
2924
2924
|
}
|
|
2925
2925
|
function O(e, t, i) {
|
|
2926
|
-
if (e.description && (e.description = e.description.replaceAll(
|
|
2926
|
+
if (e.description && (e.description = e.description.replaceAll(ot, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl)), e.docsTags)
|
|
2927
2927
|
for (const n of e.docsTags)
|
|
2928
|
-
n.text && (n.text = n.text.replaceAll(
|
|
2929
|
-
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(
|
|
2928
|
+
n.text && (n.text = n.text.replaceAll(ot, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2929
|
+
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(ot, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2930
2930
|
}
|
|
2931
|
-
const
|
|
2931
|
+
const ot = /\{@link ([^}]+)\}/gu, Xo = (e, t) => (i, n) => {
|
|
2932
2932
|
let s = n.indexOf(" ");
|
|
2933
2933
|
s === -1 && (s = n.length);
|
|
2934
2934
|
const r = n.slice(0, s), a = n.slice(s + 1);
|
|
@@ -2987,34 +2987,38 @@ async function na(e, t) {
|
|
|
2987
2987
|
})
|
|
2988
2988
|
);
|
|
2989
2989
|
}
|
|
2990
|
-
async function vn(e) {
|
|
2991
|
-
return
|
|
2990
|
+
async function vn(e, t) {
|
|
2991
|
+
return Se ??= ra(e, t), await Se;
|
|
2992
2992
|
}
|
|
2993
2993
|
function sa() {
|
|
2994
|
-
if (
|
|
2994
|
+
if (Be === void 0)
|
|
2995
2995
|
throw Error(
|
|
2996
|
-
|
|
2996
|
+
S(
|
|
2997
2997
|
"@arcgis/lumina:retrieveComponentDependencies",
|
|
2998
2998
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
2999
2999
|
)
|
|
3000
3000
|
);
|
|
3001
|
-
return
|
|
3001
|
+
return Be;
|
|
3002
3002
|
}
|
|
3003
|
-
function
|
|
3003
|
+
function wn() {
|
|
3004
3004
|
if (vt === void 0)
|
|
3005
3005
|
throw Error(
|
|
3006
|
-
|
|
3006
|
+
S(
|
|
3007
3007
|
"@arcgis/lumina:retrieveFlatComponentDependencies",
|
|
3008
3008
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
3009
3009
|
)
|
|
3010
3010
|
);
|
|
3011
3011
|
return vt;
|
|
3012
3012
|
}
|
|
3013
|
-
async function ra(e) {
|
|
3014
|
-
const
|
|
3015
|
-
[...Object.keys(
|
|
3013
|
+
async function ra(e, t) {
|
|
3014
|
+
const i = R(e), n = i.dependencies ?? {}, s = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
3015
|
+
[...Object.keys(n), ...Object.keys(s)].filter((d) => !oa.has(d)).flatMap(async (d) => await Sn(d, e))
|
|
3016
3016
|
)).filter(j);
|
|
3017
|
-
|
|
3017
|
+
Be ??= a, vt = Object.fromEntries(a.flatMap((d) => Object.entries(d.components)));
|
|
3018
|
+
const c = t?.serve?.extraDependencies?.map(
|
|
3019
|
+
(d) => typeof d == "string" ? d : d.name
|
|
3020
|
+
), l = c === void 0 ? a : a.filter((d) => !c.includes(d.packageName));
|
|
3021
|
+
return Be ??= l, l;
|
|
3018
3022
|
}
|
|
3019
3023
|
const oa = /* @__PURE__ */ new Set([
|
|
3020
3024
|
"@arcgis/arcade-languageservice",
|
|
@@ -3052,14 +3056,14 @@ const oa = /* @__PURE__ */ new Set([
|
|
|
3052
3056
|
"vscode-languageserver-textdocument",
|
|
3053
3057
|
"vscode-languageserver-types"
|
|
3054
3058
|
]);
|
|
3055
|
-
let
|
|
3056
|
-
async function
|
|
3057
|
-
const i = await
|
|
3058
|
-
if (a ? await
|
|
3059
|
-
const g = await J(c, "utf8"), y = aa(g, "bootstrapLazy("), v = g.indexOf(", options", y), h = g.slice(y, v),
|
|
3059
|
+
let Be, vt, Se;
|
|
3060
|
+
async function Sn(e, t) {
|
|
3061
|
+
const i = await Ue(e, t), n = await ze(i), s = "exports" in n, r = ua.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3062
|
+
if (a ? await _(c) : !1) {
|
|
3063
|
+
const g = await J(c, "utf8"), y = aa(g, "bootstrapLazy("), v = g.indexOf(", options", y), h = g.slice(y, v), w = h.startsWith('JSON.parse("') ? h.slice(12, -2).replaceAll('\\"', '"') : h;
|
|
3060
3064
|
try {
|
|
3061
|
-
const E = JSON.parse(
|
|
3062
|
-
return { packageName: e, type: "stencil", components:
|
|
3065
|
+
const E = JSON.parse(w), $ = da(E, { packageName: e, getImportPath: r });
|
|
3066
|
+
return { packageName: e, type: "stencil", components: $ };
|
|
3063
3067
|
} catch (E) {
|
|
3064
3068
|
T.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
3065
3069
|
Error: ${String(E)}`);
|
|
@@ -3083,7 +3087,7 @@ Error: ${String(E)}`);
|
|
|
3083
3087
|
return { type: "unknown", packageName: e, components: v };
|
|
3084
3088
|
}
|
|
3085
3089
|
const m = u.join(i, "dist/components");
|
|
3086
|
-
if (await
|
|
3090
|
+
if (await _(m)) {
|
|
3087
3091
|
const g = await pa(m, {
|
|
3088
3092
|
packageName: e,
|
|
3089
3093
|
getImportPath: r
|
|
@@ -3144,7 +3148,7 @@ const ca = (e) => e.compiler?.name === It, la = (e, t) => Object.fromEntries(
|
|
|
3144
3148
|
)
|
|
3145
3149
|
)
|
|
3146
3150
|
), pa = async (e, t) => Object.fromEntries(
|
|
3147
|
-
(await
|
|
3151
|
+
(await qe(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3148
3152
|
const n = i.slice(0, -5);
|
|
3149
3153
|
return [
|
|
3150
3154
|
n,
|
|
@@ -3156,7 +3160,7 @@ const ca = (e) => e.compiler?.name === It, la = (e, t) => Object.fromEntries(
|
|
|
3156
3160
|
];
|
|
3157
3161
|
})
|
|
3158
3162
|
), ua = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, ma = (e) => e.startsWith("/") ? e : `/${e}`, Lt = (e, t) => `${e}@fs${ma(t)}`;
|
|
3159
|
-
function
|
|
3163
|
+
function Ve(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3160
3164
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3161
3165
|
if (s && n)
|
|
3162
3166
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
@@ -3256,9 +3260,9 @@ const ya = /* @__PURE__ */ new Set([
|
|
|
3256
3260
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3257
3261
|
]), va = {
|
|
3258
3262
|
property(e, t, i, n) {
|
|
3259
|
-
const s =
|
|
3263
|
+
const s = wa(n, i, e), r = s?.type === "stringifiedReflected", a = s?.type === "reflected" || r;
|
|
3260
3264
|
if (a) {
|
|
3261
|
-
const f =
|
|
3265
|
+
const f = ct(t);
|
|
3262
3266
|
if (f === !0)
|
|
3263
3267
|
return [s.name];
|
|
3264
3268
|
if (f === !1)
|
|
@@ -3280,7 +3284,7 @@ const ya = /* @__PURE__ */ new Set([
|
|
|
3280
3284
|
return [`.${i}`, ...c];
|
|
3281
3285
|
},
|
|
3282
3286
|
attribute(e, t, i) {
|
|
3283
|
-
const n = t === void 0 ||
|
|
3287
|
+
const n = t === void 0 || ct(t);
|
|
3284
3288
|
if (n === !0)
|
|
3285
3289
|
return [i];
|
|
3286
3290
|
if (n === !1)
|
|
@@ -3289,7 +3293,7 @@ const ya = /* @__PURE__ */ new Set([
|
|
|
3289
3293
|
return [i, ...a];
|
|
3290
3294
|
},
|
|
3291
3295
|
booleanAttribute(e, t, i) {
|
|
3292
|
-
const n = t === void 0 ||
|
|
3296
|
+
const n = t === void 0 || ct(t);
|
|
3293
3297
|
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...De(e, t, !1)];
|
|
3294
3298
|
},
|
|
3295
3299
|
event(e, t, i) {
|
|
@@ -3297,8 +3301,8 @@ const ya = /* @__PURE__ */ new Set([
|
|
|
3297
3301
|
throw new Error(
|
|
3298
3302
|
`Event prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3299
3303
|
);
|
|
3300
|
-
const n = i.slice(2), s =
|
|
3301
|
-
return [`@${Zi.has(s) ? n.toLowerCase() :
|
|
3304
|
+
const n = i.slice(2), s = ft(n);
|
|
3305
|
+
return [`@${Zi.has(s) ? n.toLowerCase() : ft(n)}=`, ...Dt(e, t, void 0)];
|
|
3302
3306
|
},
|
|
3303
3307
|
directives(e, t) {
|
|
3304
3308
|
if (t === void 0 || !o.isJsxExpression(t))
|
|
@@ -3346,28 +3350,28 @@ const ya = /* @__PURE__ */ new Set([
|
|
|
3346
3350
|
return [o.factory.createIdentifier(s)];
|
|
3347
3351
|
}
|
|
3348
3352
|
};
|
|
3349
|
-
function
|
|
3353
|
+
function wa(e, t, i) {
|
|
3350
3354
|
if (typeof e == "string") {
|
|
3351
3355
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3352
3356
|
if (r !== void 0)
|
|
3353
3357
|
return { name: r, type: "reflected" };
|
|
3354
3358
|
}
|
|
3355
|
-
const n =
|
|
3359
|
+
const n = at(H.common, t);
|
|
3356
3360
|
if (n !== void 0)
|
|
3357
3361
|
return n;
|
|
3358
3362
|
if (typeof e == "string") {
|
|
3359
|
-
const s =
|
|
3363
|
+
const s = at(H.perElement[e], t);
|
|
3360
3364
|
if (s !== void 0)
|
|
3361
3365
|
return s;
|
|
3362
3366
|
} else {
|
|
3363
|
-
const s = Object.values(
|
|
3364
|
-
(a) =>
|
|
3367
|
+
const s = Object.values(H.perElement).map(
|
|
3368
|
+
(a) => at(a, t)
|
|
3365
3369
|
), r = he(s, (a) => a?.type === "stringifiedNonReflected" ? a : void 0) ?? he(s, (a) => a?.type === "stringifiedReflected" ? a : void 0);
|
|
3366
3370
|
if (r !== void 0)
|
|
3367
3371
|
return r;
|
|
3368
3372
|
}
|
|
3369
3373
|
}
|
|
3370
|
-
function
|
|
3374
|
+
function at(e, t) {
|
|
3371
3375
|
const i = e?.reflected?.[t];
|
|
3372
3376
|
if (i !== void 0)
|
|
3373
3377
|
return { name: i, type: "reflected" };
|
|
@@ -3385,7 +3389,7 @@ function Ft(e, t) {
|
|
|
3385
3389
|
return e;
|
|
3386
3390
|
throw new Error(`key prop value must be an expression. Found ${String(e?.getText(t))}`);
|
|
3387
3391
|
}
|
|
3388
|
-
function
|
|
3392
|
+
function ct(e) {
|
|
3389
3393
|
if (e === void 0)
|
|
3390
3394
|
return !0;
|
|
3391
3395
|
if (o.isJsxExpression(e)) {
|
|
@@ -3440,7 +3444,7 @@ function gi(e, t, i) {
|
|
|
3440
3444
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3441
3445
|
);
|
|
3442
3446
|
const n = t.expression;
|
|
3443
|
-
if (
|
|
3447
|
+
if (Sa(n)) {
|
|
3444
3448
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3445
3449
|
e.neededImports.add(r);
|
|
3446
3450
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3450,7 +3454,7 @@ function gi(e, t, i) {
|
|
|
3450
3454
|
} else
|
|
3451
3455
|
return [i, ...De(e, t, !0)];
|
|
3452
3456
|
}
|
|
3453
|
-
const
|
|
3457
|
+
const Sa = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3454
3458
|
function ba(e, t) {
|
|
3455
3459
|
t.neededImports.add("live");
|
|
3456
3460
|
const i = t.importRenames.live;
|
|
@@ -3477,13 +3481,13 @@ const yi = {
|
|
|
3477
3481
|
bindEvent: "event"
|
|
3478
3482
|
};
|
|
3479
3483
|
function Ea(e, t, i) {
|
|
3480
|
-
return $a.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (Vi.has(e) || e.includes("-")) && (e !== "itemId" || i !== "arcgis-map" && i !== "arcgis-scene") ? "attribute" : !Pt(i) && (Xi.has(e) || (i ===
|
|
3484
|
+
return $a.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : (Vi.has(e) || e.includes("-")) && (e !== "itemId" || i !== "arcgis-map" && i !== "arcgis-scene") ? "attribute" : !Pt(i) && (Xi.has(e) || (i === yt ? !1 : i === Me ? (
|
|
3481
3485
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3482
|
-
Object.values(
|
|
3483
|
-
) :
|
|
3486
|
+
Object.values(ht).some((r) => r.has(e))
|
|
3487
|
+
) : ht[i]?.has(e) === !0)) ? Yt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === yt || i !== Me && ($t.has(i) || xt.has(i)) ? e in H.common.reflected || e in H.common.stringifiedReflected || e in H.common.stringifiedNonReflected ? "property" : Yt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3484
3488
|
}
|
|
3485
3489
|
const Ca = ["class", "style", "ref", "directives", "key", "deferLoad"], $a = new Set(Ca), xa = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3486
|
-
function
|
|
3490
|
+
function Xe({ key: e, parts: t, litTag: i }, n) {
|
|
3487
3491
|
const s = Pa(t);
|
|
3488
3492
|
if (s.length % 2 === 0)
|
|
3489
3493
|
throw new Error("Normalized template parts array length must be odd");
|
|
@@ -3492,9 +3496,9 @@ function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
|
3492
3496
|
throw new Error("First normalized template part must be a string");
|
|
3493
3497
|
if (i === void 0) {
|
|
3494
3498
|
if (a.length === 0)
|
|
3495
|
-
return
|
|
3499
|
+
return lt(n, e, o.factory.createStringLiteral(r));
|
|
3496
3500
|
if (r === "" && a.length === 2 && a[1] === "")
|
|
3497
|
-
return
|
|
3501
|
+
return lt(
|
|
3498
3502
|
n,
|
|
3499
3503
|
e,
|
|
3500
3504
|
typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
|
|
@@ -3507,7 +3511,7 @@ function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
|
3507
3511
|
void 0,
|
|
3508
3512
|
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), ka(a))
|
|
3509
3513
|
);
|
|
3510
|
-
return
|
|
3514
|
+
return lt(n, e, d);
|
|
3511
3515
|
}
|
|
3512
3516
|
const Pa = (e) => e.reduce(
|
|
3513
3517
|
(t, i, n) => {
|
|
@@ -3537,7 +3541,7 @@ function ka(e) {
|
|
|
3537
3541
|
);
|
|
3538
3542
|
});
|
|
3539
3543
|
}
|
|
3540
|
-
function
|
|
3544
|
+
function lt(e, t, i) {
|
|
3541
3545
|
if (t === void 0)
|
|
3542
3546
|
return i;
|
|
3543
3547
|
e.neededImports.add("keyed");
|
|
@@ -3611,10 +3615,10 @@ function La(e, t) {
|
|
|
3611
3615
|
const E = be(h.expression);
|
|
3612
3616
|
if (!hi(E))
|
|
3613
3617
|
return t;
|
|
3614
|
-
const
|
|
3615
|
-
if (
|
|
3618
|
+
const $ = c.statements.slice(0, -1);
|
|
3619
|
+
if ($.some($n))
|
|
3616
3620
|
return t;
|
|
3617
|
-
l =
|
|
3621
|
+
l = $.length === 0, d = E;
|
|
3618
3622
|
}
|
|
3619
3623
|
const p = o.isJsxElement(d) ? d.openingElement : d, m = An(p);
|
|
3620
3624
|
if (m === -1)
|
|
@@ -3662,7 +3666,7 @@ function Fa(e, t, i, n, s) {
|
|
|
3662
3666
|
let a = xn(e.name, r);
|
|
3663
3667
|
const c = t.parameters.at(1);
|
|
3664
3668
|
if (c !== void 0 && o.isIdentifier(c.name) && // A more basic check is also provided in lumina/no-unnecessary-key rule
|
|
3665
|
-
r.every(
|
|
3669
|
+
r.every(_e, c.name)) {
|
|
3666
3670
|
T.warn(
|
|
3667
3671
|
"@arcgis/lumina:jsxToLitHtml",
|
|
3668
3672
|
"It looks like you are trying to use .map() index as a key={} prop value. Doing so is potentially pointless and may cause performance degradation. In Lit it is safe to omit the key={} prop. If you really mean to use index as the key, then use the keyed() Lit directive directly, rather than the JSX key={} prop.",
|
|
@@ -3720,14 +3724,14 @@ const Na = /* @__PURE__ */ new Set([
|
|
|
3720
3724
|
o.SyntaxKind.TrueKeyword
|
|
3721
3725
|
]), be = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? be(e.expression) : e, xn = (e, t) => o.isObjectBindingPattern(e) ? Ma(e, t) : e;
|
|
3722
3726
|
function Da(e, t, i) {
|
|
3723
|
-
if (e.every(
|
|
3727
|
+
if (e.every(_e, t))
|
|
3724
3728
|
return t;
|
|
3725
3729
|
if (o.isIdentifier(t)) {
|
|
3726
3730
|
const n = o.isBlock(i.body) ? he(i.body.statements, (r) => ja(r, t)) : void 0;
|
|
3727
3731
|
if (n === void 0)
|
|
3728
3732
|
return;
|
|
3729
3733
|
const s = xn(n, e);
|
|
3730
|
-
if (e.every(
|
|
3734
|
+
if (e.every(_e, s))
|
|
3731
3735
|
return s;
|
|
3732
3736
|
}
|
|
3733
3737
|
}
|
|
@@ -3737,13 +3741,13 @@ function ja(e, t) {
|
|
|
3737
3741
|
const i = e.declarationList.declarations[0];
|
|
3738
3742
|
return i?.initializer && o.isIdentifier(i.initializer) && i.initializer.text === t.text ? i.name : void 0;
|
|
3739
3743
|
}
|
|
3740
|
-
function
|
|
3744
|
+
function _e(e) {
|
|
3741
3745
|
const t = this;
|
|
3742
3746
|
return o.isIdentifier(t) ? t.text === e : t.elements.some(Ra, e);
|
|
3743
3747
|
}
|
|
3744
3748
|
function Ra(e) {
|
|
3745
3749
|
const t = this;
|
|
3746
|
-
return o.isOmittedExpression(e) ? !1 :
|
|
3750
|
+
return o.isOmittedExpression(e) ? !1 : _e.call(e.name, t);
|
|
3747
3751
|
}
|
|
3748
3752
|
function Ma(e, t) {
|
|
3749
3753
|
let i = !1;
|
|
@@ -3751,8 +3755,8 @@ function Ma(e, t) {
|
|
|
3751
3755
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3752
3756
|
}
|
|
3753
3757
|
const Pn = (e, t) => t.liftedKeys.has(e), Oa = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}";`).join(`
|
|
3754
|
-
`), Ja = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u,
|
|
3755
|
-
function
|
|
3758
|
+
`), Ja = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, Qe = (e) => !Ja.test(e), Ce = (e) => Qe(e) ? `"${e}"` : e;
|
|
3759
|
+
function Ze(e, t) {
|
|
3756
3760
|
const i = [], n = [];
|
|
3757
3761
|
let s = !1;
|
|
3758
3762
|
t?.forEach((p) => {
|
|
@@ -3787,7 +3791,7 @@ function q(e, t, i) {
|
|
|
3787
3791
|
}
|
|
3788
3792
|
function kn(e, t) {
|
|
3789
3793
|
const i = In(e, t);
|
|
3790
|
-
return
|
|
3794
|
+
return Xe(i, e);
|
|
3791
3795
|
}
|
|
3792
3796
|
function In(e, t) {
|
|
3793
3797
|
const i = "children" in t ? t.children : [];
|
|
@@ -3796,42 +3800,42 @@ function In(e, t) {
|
|
|
3796
3800
|
const s = o.isJsxElement(t) ? t.openingElement : t, r = s.tagName;
|
|
3797
3801
|
if (o.isJsxNamespacedName(r))
|
|
3798
3802
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
3799
|
-
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !==
|
|
3800
|
-
const
|
|
3803
|
+
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== it && r.text !== nt) {
|
|
3804
|
+
const x = o.isIdentifier(r) && r.text === kr ? je(i, e) : {
|
|
3801
3805
|
// No need to wrap the function call in a lit-html tag
|
|
3802
3806
|
litTag: void 0,
|
|
3803
3807
|
parts: [Wa(e, t, r, i)]
|
|
3804
3808
|
};
|
|
3805
3809
|
return {
|
|
3806
3810
|
key: Ka(s, e),
|
|
3807
|
-
|
|
3811
|
+
...x
|
|
3808
3812
|
};
|
|
3809
3813
|
}
|
|
3810
|
-
const c = r.text ===
|
|
3814
|
+
const c = r.text === it ? Me : r.text === nt ? yt : r.text, l = r.text === it ? le : r.text === nt ? Y : Ar.has(c) ? an : $t.has(c) ? oe : de, d = Pt(c);
|
|
3811
3815
|
let p;
|
|
3812
3816
|
d && e.compiler.viteCommand === "build" && (p = _a(e, c));
|
|
3813
3817
|
let m;
|
|
3814
3818
|
const f = [];
|
|
3815
3819
|
let g = !1;
|
|
3816
|
-
const y = s.attributes.properties.flatMap((
|
|
3817
|
-
if (o.isJsxSpreadAttribute(
|
|
3820
|
+
const y = s.attributes.properties.flatMap((A) => {
|
|
3821
|
+
if (o.isJsxSpreadAttribute(A))
|
|
3818
3822
|
throw Error(
|
|
3819
3823
|
`JSX spread attribute syntax is not supported. See alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes
|
|
3820
|
-
Found ${
|
|
3824
|
+
Found ${A.getText(e.sourceFile)}`
|
|
3821
3825
|
);
|
|
3822
|
-
const { name:
|
|
3823
|
-
if (o.isJsxNamespacedName(
|
|
3824
|
-
throw Error(`JSX namespaced attributes are not supported. Found ${
|
|
3825
|
-
const C =
|
|
3826
|
+
const { name: x, initializer: b } = A;
|
|
3827
|
+
if (o.isJsxNamespacedName(x))
|
|
3828
|
+
throw Error(`JSX namespaced attributes are not supported. Found ${x.getText(e.sourceFile)}`);
|
|
3829
|
+
const C = x.text, L = Ta(b), F = L?.propType ?? Ea(C, b, c);
|
|
3826
3830
|
p?.delete(C);
|
|
3827
|
-
const N = va[F](e,
|
|
3831
|
+
const N = va[F](e, L?.initializer ?? b, C, c);
|
|
3828
3832
|
if (N.length === 0)
|
|
3829
3833
|
return [];
|
|
3830
|
-
const M = e.compiler.shouldMinifyJsx ? [" "] : Ia(Tn(
|
|
3831
|
-
return F === "key" ? (m = typeof N[0] == "object" && !Pn(
|
|
3834
|
+
const M = e.compiler.shouldMinifyJsx ? [" "] : Ia(Tn(x, e));
|
|
3835
|
+
return F === "key" ? (m = typeof N[0] == "object" && !Pn(x, e) ? N[0] : void 0, M.some(xa) ? M : []) : F === "directives" || F === "ref" || C === "deferLoad" ? (g ||= F === "deferLoad", f.push(
|
|
3832
3836
|
...M,
|
|
3833
3837
|
...N.flatMap(
|
|
3834
|
-
(
|
|
3838
|
+
(z, K) => typeof z == "string" || K === 0 || typeof N[K - 1] == "string" ? z : [" ", z]
|
|
3835
3839
|
)
|
|
3836
3840
|
), []) : [...M, ...N];
|
|
3837
3841
|
});
|
|
@@ -3849,24 +3853,24 @@ Found ${L.getText(e.sourceFile)}`
|
|
|
3849
3853
|
throw Error(
|
|
3850
3854
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
3851
3855
|
);
|
|
3852
|
-
const
|
|
3856
|
+
const w = (l === oe || l === Y) && h.parts.length === 0, E = [
|
|
3853
3857
|
"<",
|
|
3854
3858
|
typeof c == "string" ? c : r,
|
|
3855
3859
|
...y,
|
|
3856
|
-
|
|
3857
|
-
],
|
|
3860
|
+
w ? `${y.length === 0 ? "" : " "}/>` : ">"
|
|
3861
|
+
], $ = v || w ? E : [
|
|
3858
3862
|
...E,
|
|
3859
3863
|
/**
|
|
3860
3864
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
3861
3865
|
* fragments (e.g. `<circle />`, then wrap the children in their own
|
|
3862
3866
|
* tagged template literal (e.g. svg``)
|
|
3863
3867
|
*/
|
|
3864
|
-
...h.litTag !== void 0 && h.litTag !== l ? [
|
|
3868
|
+
...h.litTag !== void 0 && h.litTag !== l ? [Xe({ key: void 0, ...h }, e)] : h.parts,
|
|
3865
3869
|
"</",
|
|
3866
3870
|
typeof c == "string" ? c : r,
|
|
3867
3871
|
">"
|
|
3868
3872
|
];
|
|
3869
|
-
return { key: m, parts:
|
|
3873
|
+
return { key: m, parts: $, litTag: l };
|
|
3870
3874
|
}
|
|
3871
3875
|
function Ka(e, t) {
|
|
3872
3876
|
const i = e.attributes.properties[An(e)];
|
|
@@ -3882,13 +3886,13 @@ function Wa(e, t, i, n) {
|
|
|
3882
3886
|
throw Error(`JSX namespaced attributes are not supported. Found ${d.getText(e.sourceFile)}`);
|
|
3883
3887
|
if (d.text === "key")
|
|
3884
3888
|
return;
|
|
3885
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Je(p) ? kn(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f =
|
|
3889
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Je(p) ? kn(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Qe(d.text) ? o.factory.createStringLiteral(d.text) : d;
|
|
3886
3890
|
return o.factory.createPropertyAssignment(f, m);
|
|
3887
3891
|
}), { parts: a, litTag: c } = je(n, e);
|
|
3888
3892
|
return a.length > 0 && r.push(
|
|
3889
3893
|
o.factory.createPropertyAssignment(
|
|
3890
3894
|
o.factory.createIdentifier("children"),
|
|
3891
|
-
|
|
3895
|
+
Xe({ key: void 0, parts: a, litTag: c }, e)
|
|
3892
3896
|
)
|
|
3893
3897
|
), o.factory.createCallExpression(i, void 0, [
|
|
3894
3898
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
@@ -3912,7 +3916,7 @@ function je(e, t) {
|
|
|
3912
3916
|
);
|
|
3913
3917
|
return i = r.litTag, r.parts;
|
|
3914
3918
|
} else
|
|
3915
|
-
return [
|
|
3919
|
+
return [Xe(r, t)];
|
|
3916
3920
|
}
|
|
3917
3921
|
});
|
|
3918
3922
|
return { litTag: i, parts: n };
|
|
@@ -4106,13 +4110,13 @@ function Xa(e) {
|
|
|
4106
4110
|
}), [];
|
|
4107
4111
|
}
|
|
4108
4112
|
function Qa(e, t, i) {
|
|
4109
|
-
const n =
|
|
4113
|
+
const n = wn()[t] ?? Rn(e)[t];
|
|
4110
4114
|
if (n === void 0) {
|
|
4111
4115
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
4112
4116
|
return;
|
|
4113
4117
|
const s = te(i);
|
|
4114
4118
|
throw Error(
|
|
4115
|
-
|
|
4119
|
+
S(
|
|
4116
4120
|
"@arcgis/lumina:resolveTagName",
|
|
4117
4121
|
`Unable to resolve the definition of the "${t}" custom element. Used in ${s}. If this is coming from an external package, make sure that package is installed as a peerDependency or a dependency. If in development-only you wish to use a component package that is defined as a devDependency, then provide serve.extraDependencies option to useLumina()`
|
|
4118
4122
|
)
|
|
@@ -4137,7 +4141,7 @@ const Ya = (e, t) => {
|
|
|
4137
4141
|
return e.statements;
|
|
4138
4142
|
const n = {
|
|
4139
4143
|
compiler: t.compiler,
|
|
4140
|
-
externalComponents:
|
|
4144
|
+
externalComponents: wn(),
|
|
4141
4145
|
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : Rn(t.compiler),
|
|
4142
4146
|
sourceFile: e,
|
|
4143
4147
|
transformationContext: t.transformation,
|
|
@@ -4201,7 +4205,7 @@ function ic(e, t, i) {
|
|
|
4201
4205
|
o.factory.createObjectLiteralExpression(
|
|
4202
4206
|
Array.from(t.entries()).map(
|
|
4203
4207
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4204
|
-
|
|
4208
|
+
Qe(n) ? o.factory.createStringLiteral(n) : n,
|
|
4205
4209
|
nc(s, i)
|
|
4206
4210
|
)
|
|
4207
4211
|
)
|
|
@@ -4319,14 +4323,14 @@ function cc(e, t, i, n, s) {
|
|
|
4319
4323
|
d === "property" && (r = l), d === "state" && (a = l);
|
|
4320
4324
|
}
|
|
4321
4325
|
}), r !== -1) {
|
|
4322
|
-
const c = lc(e, t, i, n), l =
|
|
4326
|
+
const c = lc(e, t, i, n), l = wi(t, r, n), d = sc(t, l, e, n, c);
|
|
4323
4327
|
let p = !1;
|
|
4324
|
-
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d,
|
|
4328
|
+
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, Si(t, l, r, p);
|
|
4325
4329
|
} else if (a !== -1) {
|
|
4326
|
-
const c =
|
|
4330
|
+
const c = wi(t, a, n), l = o.factory.createPropertyAssignment("state", o.factory.createTrue()), d = c.options === void 0 ? o.factory.createObjectLiteralExpression([l]) : o.factory.updateObjectLiteralExpression(c.options, [...c.options.properties, l]), p = Q(t.name);
|
|
4327
4331
|
if (p === void 0)
|
|
4328
4332
|
throw new Error("Failed to statically determine the state property name");
|
|
4329
|
-
return s.set(p, d),
|
|
4333
|
+
return s.set(p, d), Si(t, c, a, !0);
|
|
4330
4334
|
} else
|
|
4331
4335
|
return t;
|
|
4332
4336
|
}
|
|
@@ -4353,7 +4357,7 @@ function lc(e, t, i, n) {
|
|
|
4353
4357
|
}
|
|
4354
4358
|
return r;
|
|
4355
4359
|
}
|
|
4356
|
-
function
|
|
4360
|
+
function wi(e, t, i) {
|
|
4357
4361
|
const n = e.modifiers[t], s = n.expression, r = s.arguments.at(0);
|
|
4358
4362
|
if (r && !o.isObjectLiteralExpression(r))
|
|
4359
4363
|
throw new Error(
|
|
@@ -4361,7 +4365,7 @@ function Si(e, t, i) {
|
|
|
4361
4365
|
);
|
|
4362
4366
|
return { decorator: n, callExpression: s, options: r };
|
|
4363
4367
|
}
|
|
4364
|
-
function
|
|
4368
|
+
function Si(e, t, i, n) {
|
|
4365
4369
|
const s = n ? void 0 : o.factory.updateDecorator(
|
|
4366
4370
|
t.decorator,
|
|
4367
4371
|
o.factory.updateCallExpression(
|
|
@@ -4486,14 +4490,14 @@ function uc(e, t, i, n, s) {
|
|
|
4486
4490
|
}
|
|
4487
4491
|
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? cc(e, t, i, n, s) : t;
|
|
4488
4492
|
}
|
|
4489
|
-
const mc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method",
|
|
4490
|
-
|
|
4493
|
+
const mc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", wt = "@arcgis/core", dt = R(), $e = wt in (dt.dependencies ?? {}) || wt in (dt.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
4494
|
+
dt.name === "@arcgis/lumina";
|
|
4491
4495
|
async function fc(e, t) {
|
|
4492
4496
|
if (!$e)
|
|
4493
4497
|
return [];
|
|
4494
|
-
const i = await
|
|
4498
|
+
const i = await Ue(wt);
|
|
4495
4499
|
if (t === "cdn") {
|
|
4496
|
-
const n = await
|
|
4500
|
+
const n = await ze(i), s = Ve({ name: "", version: n.version }, !0);
|
|
4497
4501
|
return [
|
|
4498
4502
|
// Use the ESM CDN
|
|
4499
4503
|
// <script src="https://jsdev.arcgis.com/VERSION/"><\/script>
|
|
@@ -4570,7 +4574,7 @@ const hc = [
|
|
|
4570
4574
|
return;
|
|
4571
4575
|
}
|
|
4572
4576
|
const n = e.getSourceFile(i, t);
|
|
4573
|
-
await
|
|
4577
|
+
await Se;
|
|
4574
4578
|
const r = o.transform(n, [
|
|
4575
4579
|
(f) => () => zi(e, f, n, [
|
|
4576
4580
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
@@ -4592,7 +4596,7 @@ const hc = [
|
|
|
4592
4596
|
}
|
|
4593
4597
|
}
|
|
4594
4598
|
});
|
|
4595
|
-
function
|
|
4599
|
+
function wc(e) {
|
|
4596
4600
|
const t = e.typeScriptConfig;
|
|
4597
4601
|
return {
|
|
4598
4602
|
...t,
|
|
@@ -4624,11 +4628,11 @@ function Sc(e) {
|
|
|
4624
4628
|
skipLibCheck: !0
|
|
4625
4629
|
};
|
|
4626
4630
|
}
|
|
4627
|
-
function
|
|
4631
|
+
function Sc(e) {
|
|
4628
4632
|
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : ds(t ?? "tsconfig.json");
|
|
4629
4633
|
if (i === void 0)
|
|
4630
4634
|
throw Error(
|
|
4631
|
-
|
|
4635
|
+
S(
|
|
4632
4636
|
"@arcgis/lumina:loadTypeScriptConfig",
|
|
4633
4637
|
`Unable to find ${te(String(t))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`,
|
|
4634
4638
|
process.cwd()
|
|
@@ -4655,7 +4659,7 @@ function On(e) {
|
|
|
4655
4659
|
const t = e.target;
|
|
4656
4660
|
if (t === void 0)
|
|
4657
4661
|
throw Error(
|
|
4658
|
-
|
|
4662
|
+
S(
|
|
4659
4663
|
"@arcgis/lumina:resolveTargetVersion",
|
|
4660
4664
|
'TypeScript config must have a "target" property specified (or any parent tsconfig.json file if this config is extending another tsconfig.json)'
|
|
4661
4665
|
)
|
|
@@ -4685,11 +4689,11 @@ function bc(e, t) {
|
|
|
4685
4689
|
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Fs();
|
|
4686
4690
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4687
4691
|
}
|
|
4688
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter =
|
|
4692
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = wc(e), e._typeScriptPrinter = tn(e._compilerOptionsForPrinter);
|
|
4689
4693
|
}
|
|
4690
4694
|
async function Tc(e, t, i) {
|
|
4691
4695
|
const n = u.resolve(e.dir.root, t);
|
|
4692
|
-
await
|
|
4696
|
+
await _(n) && await hs(n, { recursive: !0, force: !0 }), await Z(n, { recursive: !0 }), await vs(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4693
4697
|
const s = [
|
|
4694
4698
|
"index.html",
|
|
4695
4699
|
...await Ns("**/*.html", {
|
|
@@ -4707,22 +4711,22 @@ async function Tc(e, t, i) {
|
|
|
4707
4711
|
if (typeof p == "string")
|
|
4708
4712
|
return `<${d.tag} ${Object.entries(d.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${d.tag}>`;
|
|
4709
4713
|
}
|
|
4710
|
-
throw Error(
|
|
4714
|
+
throw Error(S("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(d)}`));
|
|
4711
4715
|
}).join(`
|
|
4712
4716
|
`);
|
|
4713
4717
|
await Promise.all(
|
|
4714
4718
|
s.map(async (d, p) => {
|
|
4715
4719
|
const f = p === 0 ? d : u.join(r, d), g = u.join(e.dir.root, f), y = u.join(n, f);
|
|
4716
4720
|
await Z(u.dirname(y), { recursive: !0 });
|
|
4717
|
-
const v = await J(g, "utf-8"), h = ce(u.dirname(f), `build/${i}`),
|
|
4721
|
+
const v = await J(g, "utf-8"), h = ce(u.dirname(f), `build/${i}`), w = `${l}<script type="module" src="${h}"><\/script>
|
|
4718
4722
|
`;
|
|
4719
4723
|
let E = v.indexOf("<style>");
|
|
4720
4724
|
if (E === -1 && (E = v.indexOf("</head>")), E === -1)
|
|
4721
|
-
throw Error(
|
|
4722
|
-
const
|
|
4723
|
-
await D(y,
|
|
4725
|
+
throw Error(S("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
|
|
4726
|
+
const $ = v.slice(0, E) + w + v.slice(E), A = e.options?.build?.webApp?.transformFile?.($, y, e) ?? $;
|
|
4727
|
+
await D(y, A, "utf-8");
|
|
4724
4728
|
})
|
|
4725
|
-
);
|
|
4729
|
+
), await e.options.build?.webApp?.afterBuildEnd?.(e);
|
|
4726
4730
|
}
|
|
4727
4731
|
const Jn = /* @__PURE__ */ new Set([
|
|
4728
4732
|
"chunks",
|
|
@@ -4737,7 +4741,7 @@ const Jn = /* @__PURE__ */ new Set([
|
|
|
4737
4741
|
"collection",
|
|
4738
4742
|
"extras",
|
|
4739
4743
|
"support"
|
|
4740
|
-
]),
|
|
4744
|
+
]), U = "@arcgis/lumina:buildCdn", jt = "cdn", Kn = "index", Te = "main";
|
|
4741
4745
|
function Ec(e) {
|
|
4742
4746
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4743
4747
|
if (r) {
|
|
@@ -4760,7 +4764,7 @@ function Ec(e) {
|
|
|
4760
4764
|
}
|
|
4761
4765
|
]), !t)
|
|
4762
4766
|
return {
|
|
4763
|
-
name:
|
|
4767
|
+
name: U,
|
|
4764
4768
|
async writeBundle() {
|
|
4765
4769
|
if (e.isInStorybook)
|
|
4766
4770
|
return;
|
|
@@ -4773,7 +4777,7 @@ function Ec(e) {
|
|
|
4773
4777
|
c
|
|
4774
4778
|
);
|
|
4775
4779
|
const m = Date.now();
|
|
4776
|
-
T.info(
|
|
4780
|
+
T.info(U, `CDN was built in ${m - l}ms`), s && await Tc(e, s, `${r ? `${a}.esm` : a}.js`);
|
|
4777
4781
|
}
|
|
4778
4782
|
};
|
|
4779
4783
|
}
|
|
@@ -4781,15 +4785,15 @@ async function Cc(e, t, i, n, s) {
|
|
|
4781
4785
|
const r = e.environment;
|
|
4782
4786
|
if (i.minify && s)
|
|
4783
4787
|
throw Error(
|
|
4784
|
-
|
|
4785
|
-
|
|
4788
|
+
S(
|
|
4789
|
+
U,
|
|
4786
4790
|
"Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4787
4791
|
)
|
|
4788
4792
|
);
|
|
4789
4793
|
if (i.sourcemap && s)
|
|
4790
4794
|
throw Error(
|
|
4791
|
-
|
|
4792
|
-
|
|
4795
|
+
S(
|
|
4796
|
+
U,
|
|
4793
4797
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4794
4798
|
)
|
|
4795
4799
|
);
|
|
@@ -4839,6 +4843,12 @@ async function Cc(e, t, i, n, s) {
|
|
|
4839
4843
|
},
|
|
4840
4844
|
...i?.plugins ?? []
|
|
4841
4845
|
],
|
|
4846
|
+
logOverride: {
|
|
4847
|
+
// Workaround for a Rollup bug. https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/6527
|
|
4848
|
+
// TODO: remove this after migration to Rolldown
|
|
4849
|
+
"ignored-bare-import": "silent",
|
|
4850
|
+
...i.logOverride
|
|
4851
|
+
},
|
|
4842
4852
|
entryPoints: n,
|
|
4843
4853
|
stdin: {
|
|
4844
4854
|
contents: `import { defineCustomElements } from "./loader";
|
|
@@ -4896,11 +4906,11 @@ function Pc(e, t) {
|
|
|
4896
4906
|
const s = [];
|
|
4897
4907
|
for (const r of t) {
|
|
4898
4908
|
if (r.in.includes("*")) {
|
|
4899
|
-
T.warn(
|
|
4909
|
+
T.warn(U, `$arcgis.import does not support wildcard imports, so ${r.in} will be ignored.`);
|
|
4900
4910
|
continue;
|
|
4901
4911
|
}
|
|
4902
4912
|
if (r.out.startsWith(".") || r.out.startsWith("/"))
|
|
4903
|
-
throw Error(
|
|
4913
|
+
throw Error(S(U, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
|
|
4904
4914
|
s.push(r.out);
|
|
4905
4915
|
}
|
|
4906
4916
|
i += `"${s.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
|
|
@@ -4930,32 +4940,32 @@ function Wn(e, t) {
|
|
|
4930
4940
|
let c = 0;
|
|
4931
4941
|
const l = e.code.matchAll(kc);
|
|
4932
4942
|
for (const b of l) {
|
|
4933
|
-
const [C,
|
|
4943
|
+
const [C, L, F, N, M] = b, z = M.startsWith(He);
|
|
4934
4944
|
if (c !== 0 && c !== b.index) {
|
|
4935
4945
|
const K = e.code.slice(c, b.index);
|
|
4936
4946
|
s.push(K), a.push([c, K.length, 0, ""]);
|
|
4937
4947
|
}
|
|
4938
|
-
if (c = b.index + C.length,
|
|
4939
|
-
a.push([b.index, C.length, 0, ""]), n.push(`"${_n(M.slice(
|
|
4948
|
+
if (c = b.index + C.length, z)
|
|
4949
|
+
a.push([b.index, C.length, 0, ""]), n.push(`"${_n(M.slice(He.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? F ?? N ?? "");
|
|
4940
4950
|
else {
|
|
4941
4951
|
const K = Bn(M, t), G = K?.isAsync === !0;
|
|
4942
|
-
if (
|
|
4952
|
+
if (L !== void 0) {
|
|
4943
4953
|
const ke = [];
|
|
4944
|
-
for (const
|
|
4945
|
-
const [Jt, Kt = Jt] =
|
|
4954
|
+
for (const et of L.slice(1, -1).split(",")) {
|
|
4955
|
+
const [Jt, Kt = Jt] = et.split(" as ");
|
|
4946
4956
|
G || r.add(Kt), ke.push(`${Jt}:${Kt}`);
|
|
4947
4957
|
}
|
|
4948
4958
|
if (G) {
|
|
4949
|
-
const
|
|
4950
|
-
a.push([b.index + 6, 0,
|
|
4959
|
+
const et = K.oldSingleExportName === void 0 ? `{${ke.join(",")}}` : ke[0].split(":")[1];
|
|
4960
|
+
a.push([b.index + 6, 0, L.length, et]);
|
|
4951
4961
|
}
|
|
4952
4962
|
} else if (F === void 0 && N === void 0)
|
|
4953
4963
|
G && a.push([b.index + 6, 0, 0, ""]);
|
|
4954
4964
|
else {
|
|
4955
4965
|
if (G)
|
|
4956
4966
|
throw Error(
|
|
4957
|
-
|
|
4958
|
-
|
|
4967
|
+
S(
|
|
4968
|
+
U,
|
|
4959
4969
|
`Expected local import specifiers to use only named or side-effect import syntax. Found ${C} in a chunk:
|
|
4960
4970
|
${K.code}`
|
|
4961
4971
|
)
|
|
@@ -4971,13 +4981,13 @@ ${K.code}`
|
|
|
4971
4981
|
const d = Lc(r);
|
|
4972
4982
|
let p = e.code.slice(0, c);
|
|
4973
4983
|
for (let b = a.length - 1; b >= 0; b--) {
|
|
4974
|
-
const [C,
|
|
4975
|
-
let M =
|
|
4976
|
-
if (
|
|
4984
|
+
const [C, L, F, N] = a[b];
|
|
4985
|
+
let M = L, z = "";
|
|
4986
|
+
if (L === 0) {
|
|
4977
4987
|
const G = d();
|
|
4978
|
-
n.push(G),
|
|
4988
|
+
n.push(G), z = ` ${G} from`, N !== "" ? (M = F + 4, i.push(N)) : i.push("");
|
|
4979
4989
|
}
|
|
4980
|
-
p = p.slice(0, C) +
|
|
4990
|
+
p = p.slice(0, C) + z + p.slice(C + M);
|
|
4981
4991
|
}
|
|
4982
4992
|
const m = Ic.exec(e.code), f = m?.index ?? e.code.length;
|
|
4983
4993
|
let g = "";
|
|
@@ -4985,35 +4995,35 @@ ${K.code}`
|
|
|
4985
4995
|
const b = m[1].split(",");
|
|
4986
4996
|
if (b.length > 1)
|
|
4987
4997
|
g = `return{${b.map((C) => {
|
|
4988
|
-
const [
|
|
4989
|
-
return `${F}:${
|
|
4998
|
+
const [L, F = L] = C.split(" as ");
|
|
4999
|
+
return `${F}:${L}`;
|
|
4990
5000
|
}).join(",")}}`;
|
|
4991
5001
|
else {
|
|
4992
|
-
const [C,
|
|
4993
|
-
e.oldSingleExportName =
|
|
5002
|
+
const [C, L = C] = b[0].split(" as ");
|
|
5003
|
+
e.oldSingleExportName = L, g = `return ${C}`;
|
|
4994
5004
|
}
|
|
4995
5005
|
}
|
|
4996
|
-
const y = i.findLastIndex((b) => b.length > 0), v = i.slice(0, y + 1).join(","),
|
|
4997
|
-
let
|
|
4998
|
-
|
|
4999
|
-
const
|
|
5000
|
-
e.code =
|
|
5006
|
+
const y = i.findLastIndex((b) => b.length > 0), v = i.slice(0, y + 1).join(","), w = `export default $arcgis.t(${i.length === 0 ? "_" : `([${v}])`}=>{`, E = n.join(","), $ = `${g}},${E})`;
|
|
5007
|
+
let A = e.code.slice(c, f);
|
|
5008
|
+
A = `${s.join("")}${A}`, A = Ci(A, t);
|
|
5009
|
+
const x = `${p}${w}${A}${$}`;
|
|
5010
|
+
e.code = x;
|
|
5001
5011
|
}
|
|
5002
|
-
const kc = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, Ic = /export\{([^}]+)\};\n$/u,
|
|
5012
|
+
const kc = /import(?:(\{[^}]+\})from|\*as (\w+) from| ([\w$]+) from)?"([^"]+)";/gu, Ic = /export\{([^}]+)\};\n$/u, He = "@arcgis/core/";
|
|
5003
5013
|
function Bn(e, t) {
|
|
5004
5014
|
if (!e.startsWith("./"))
|
|
5005
5015
|
return;
|
|
5006
5016
|
const i = e.slice(2), n = t.get(i);
|
|
5007
5017
|
if (n === void 0)
|
|
5008
|
-
throw Error(
|
|
5018
|
+
throw Error(S(U, `Failed to find the ${e} module`));
|
|
5009
5019
|
if (n.isAsync === void 0 && Wn(n, t), n.isAsync === void 0)
|
|
5010
|
-
throw Error(
|
|
5020
|
+
throw Error(S(U, `Failed to infer whether the ${e} module has top-level await`));
|
|
5011
5021
|
return n;
|
|
5012
5022
|
}
|
|
5013
5023
|
function Ci(e, t) {
|
|
5014
5024
|
return e.replaceAll(Ac, (i, n) => {
|
|
5015
|
-
if (n.startsWith(
|
|
5016
|
-
return `$arcgis.t(m=>m[0],"${_n(n.slice(
|
|
5025
|
+
if (n.startsWith(He))
|
|
5026
|
+
return `$arcgis.t(m=>m[0],"${_n(n.slice(He.length))}")`;
|
|
5017
5027
|
if (n.startsWith("./")) {
|
|
5018
5028
|
const s = Bn(n, t);
|
|
5019
5029
|
if (s?.isAsync === !0)
|
|
@@ -5052,9 +5062,9 @@ function jc(e) {
|
|
|
5052
5062
|
e = new Array(e.length + 1).fill(Hn);
|
|
5053
5063
|
}
|
|
5054
5064
|
async function Rc(e, t, i, n) {
|
|
5055
|
-
const s = t.packageName, r = await
|
|
5065
|
+
const s = t.packageName, r = await Ue(s), { hasCss: a, cdnName: c } = await zn(r) ?? {};
|
|
5056
5066
|
if (i === "cdn") {
|
|
5057
|
-
const m = await
|
|
5067
|
+
const m = await ze(r), f = t.cdnUrl ?? Ve(m, !0);
|
|
5058
5068
|
return [
|
|
5059
5069
|
...a ? [
|
|
5060
5070
|
{
|
|
@@ -5096,47 +5106,52 @@ async function Rc(e, t, i, n) {
|
|
|
5096
5106
|
];
|
|
5097
5107
|
}
|
|
5098
5108
|
async function zn(e) {
|
|
5099
|
-
const i = (await
|
|
5100
|
-
(
|
|
5101
|
-
),
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
)
|
|
5109
|
+
const t = u.join(e, "dist"), i = u.basename(e), s = (await qe(t)).filter(
|
|
5110
|
+
(a) => !Jn.has(a) && !a.includes(".")
|
|
5111
|
+
), r = s.find(
|
|
5112
|
+
(a) => a.startsWith("arcgis-") || // This is the case for template-components and field-apps-custom-elements
|
|
5113
|
+
a === i
|
|
5114
|
+
);
|
|
5115
|
+
return r === void 0 ? await Promise.all(
|
|
5116
|
+
s.map(async (a) => await $i(t, a))
|
|
5117
|
+
).then((a) => a.find(j)) : await $i(t, r);
|
|
5105
5118
|
}
|
|
5106
5119
|
async function $i(e, t) {
|
|
5107
|
-
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"),
|
|
5108
|
-
|
|
5109
|
-
|
|
5120
|
+
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), s = u.join(e, t, `${t}.esm.js`), [r, a, c] = await Promise.all([
|
|
5121
|
+
_(i),
|
|
5122
|
+
_(n),
|
|
5123
|
+
_(s)
|
|
5124
|
+
]);
|
|
5125
|
+
return r || a || c ? {
|
|
5126
|
+
hasCss: r,
|
|
5110
5127
|
cdnName: t
|
|
5111
5128
|
} : void 0;
|
|
5112
5129
|
}
|
|
5113
5130
|
async function Mc(e, t, i, n) {
|
|
5114
|
-
const s = t.packageName, r = await
|
|
5115
|
-
if (i === "cdn")
|
|
5116
|
-
const g = a.exports?.[`./${Te}.css`] === void 0, y = g ? c.cdnName : Kn;
|
|
5131
|
+
const s = t.packageName, r = await Ue(s), a = await ze(r), l = a.exports?.[`./${Te}.css`] === void 0 ? await zn(r) : void 0, d = l?.cdnName ?? jt, p = l === void 0 ? `${Kn}.js` : `${l.cdnName}.esm.js`;
|
|
5132
|
+
if (i === "cdn")
|
|
5117
5133
|
return {
|
|
5118
5134
|
tag: "script",
|
|
5119
5135
|
attrs: {
|
|
5120
5136
|
type: "module",
|
|
5121
|
-
src: `${t.cdnUrl ??
|
|
5137
|
+
src: `${t.cdnUrl ?? Ve(a, !0)}${p}`
|
|
5122
5138
|
}
|
|
5123
5139
|
};
|
|
5124
|
-
}
|
|
5125
|
-
|
|
5126
|
-
`import styles$${n} from "${p}";`,
|
|
5140
|
+
const m = Oc(a), f = `${s}/${u.normalize(m)}${ee}`, g = [
|
|
5141
|
+
`import styles$${n} from "${f}";`,
|
|
5127
5142
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5128
|
-
],
|
|
5143
|
+
], y = `${s}/loader`;
|
|
5129
5144
|
return {
|
|
5130
5145
|
/*
|
|
5131
5146
|
* Do not pre-bundle CSS bundle as dep-optimizer ESBuild instance
|
|
5132
5147
|
* doesn't know how to load our CSS (without a plugin)
|
|
5133
5148
|
*/
|
|
5134
|
-
optimizableImports: [
|
|
5149
|
+
optimizableImports: [y],
|
|
5135
5150
|
javascriptCode: [
|
|
5136
|
-
...
|
|
5137
|
-
`import { defineCustomElements as defineCustomElements$${n} } from "${
|
|
5151
|
+
...g,
|
|
5152
|
+
`import { defineCustomElements as defineCustomElements$${n} } from "${y}";`,
|
|
5138
5153
|
`defineCustomElements$${n}({`,
|
|
5139
|
-
` resourcesUrl: "${Lt(e, r)}/dist/${
|
|
5154
|
+
` resourcesUrl: "${Lt(e, r)}/dist/${d}/",`,
|
|
5140
5155
|
"});"
|
|
5141
5156
|
]
|
|
5142
5157
|
};
|
|
@@ -5164,7 +5179,7 @@ async function Jc(e) {
|
|
|
5164
5179
|
)).filter(j).flat(), r = await Promise.all([
|
|
5165
5180
|
// This may contain an import map so must be first
|
|
5166
5181
|
fc(i, t),
|
|
5167
|
-
|
|
5182
|
+
Se.then(s),
|
|
5168
5183
|
qn(e).then(s)
|
|
5169
5184
|
]), a = u.join(e.dir.src, "loader.ts");
|
|
5170
5185
|
return [
|
|
@@ -5188,22 +5203,22 @@ async function qn(e) {
|
|
|
5188
5203
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
5189
5204
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
5190
5205
|
t.map(async (i) => {
|
|
5191
|
-
const n = typeof i == "string" ? i : i.name,
|
|
5192
|
-
if (
|
|
5206
|
+
const n = typeof i == "string" ? void 0 : i, s = typeof i == "string" ? i : i.name, r = await Sn(s);
|
|
5207
|
+
if (r === void 0)
|
|
5193
5208
|
throw Error(
|
|
5194
|
-
|
|
5209
|
+
S(
|
|
5195
5210
|
"@arcgis/lumina:computeServeOnlyDependencies",
|
|
5196
|
-
`Unable to resolve extra dependency "${
|
|
5211
|
+
`Unable to resolve extra dependency "${s}". Make sure it is a valid Stencil or Lumina package.`
|
|
5197
5212
|
)
|
|
5198
5213
|
);
|
|
5199
5214
|
return {
|
|
5200
|
-
...
|
|
5201
|
-
cdnUrl:
|
|
5215
|
+
...r,
|
|
5216
|
+
cdnUrl: n?.getCdnUrl(e)
|
|
5202
5217
|
};
|
|
5203
5218
|
})
|
|
5204
5219
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
5205
5220
|
}
|
|
5206
|
-
const Gn = "/@arcgis/lumina-compiler/testSetupFile",
|
|
5221
|
+
const Gn = "/@arcgis/lumina-compiler/testSetupFile", pt = [Gn];
|
|
5207
5222
|
async function Kc(e) {
|
|
5208
5223
|
if (!e.viteConfig.test?.browser?.enabled)
|
|
5209
5224
|
return xi(e);
|
|
@@ -5222,7 +5237,7 @@ async function Kc(e) {
|
|
|
5222
5237
|
].join(`
|
|
5223
5238
|
`);
|
|
5224
5239
|
throw Error(
|
|
5225
|
-
|
|
5240
|
+
S(
|
|
5226
5241
|
"@arcgis/lumina:buildTestSetupFile",
|
|
5227
5242
|
`Unexpected loader type for the browser test environment: ${JSON.stringify(n)}`
|
|
5228
5243
|
)
|
|
@@ -5250,8 +5265,8 @@ function _c(e) {
|
|
|
5250
5265
|
const v = y.startsWith(Gn);
|
|
5251
5266
|
if (!(!y.endsWith(".tsx") && y !== a && !v)) {
|
|
5252
5267
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5253
|
-
r === void 0 && clearTimeout(n), r ??= qo(e, t).catch((
|
|
5254
|
-
throw i = !0,
|
|
5268
|
+
r === void 0 && clearTimeout(n), r ??= qo(e, t).catch((w) => {
|
|
5269
|
+
throw i = !0, w;
|
|
5255
5270
|
}), t = !1;
|
|
5256
5271
|
const h = await r;
|
|
5257
5272
|
s ??= h;
|
|
@@ -5263,8 +5278,8 @@ function _c(e) {
|
|
|
5263
5278
|
e.isInStorybook || await D(u.join(e.dir.dist, "loader.d.ts"), Mo);
|
|
5264
5279
|
},
|
|
5265
5280
|
async handleHotUpdate({ file: y, modules: v, read: h }) {
|
|
5266
|
-
const
|
|
5267
|
-
return
|
|
5281
|
+
const w = await p(y, h);
|
|
5282
|
+
return w === void 0 ? void 0 : w ? v : (m(), []);
|
|
5268
5283
|
},
|
|
5269
5284
|
/**
|
|
5270
5285
|
* If a component was added, removed or renamed, regenerate the api.json and
|
|
@@ -5275,18 +5290,18 @@ function _c(e) {
|
|
|
5275
5290
|
return;
|
|
5276
5291
|
e.isInTest && y.watcher.on("change", (h) => {
|
|
5277
5292
|
p(h, async () => await J(h, "utf8")).catch(
|
|
5278
|
-
(
|
|
5293
|
+
(w) => T.warn(l, h, String(w))
|
|
5279
5294
|
);
|
|
5280
5295
|
}), y.watcher.on("add", v), y.watcher.on("unlink", v), y.watcher.on(
|
|
5281
5296
|
"addDir",
|
|
5282
5297
|
(h) => h.startsWith(e.dir.srcComponents) ? void kt(e, e.dir.srcComponents, h).then(
|
|
5283
|
-
(
|
|
5298
|
+
(w) => w.length > 0 ? m() : void 0
|
|
5284
5299
|
) : void 0
|
|
5285
5300
|
), y.watcher.on("unlinkDir", (h) => {
|
|
5286
5301
|
e.componentFiles.some((E) => E.startsWith(h)) && m();
|
|
5287
5302
|
});
|
|
5288
5303
|
function v(h) {
|
|
5289
|
-
|
|
5304
|
+
we(h, e.dir.srcComponents) && m();
|
|
5290
5305
|
}
|
|
5291
5306
|
y.watcher.on("change", () => {
|
|
5292
5307
|
if (!i)
|
|
@@ -5304,33 +5319,33 @@ function _c(e) {
|
|
|
5304
5319
|
let h;
|
|
5305
5320
|
if (e.isInStorybook) {
|
|
5306
5321
|
h = await v();
|
|
5307
|
-
const
|
|
5308
|
-
if (
|
|
5322
|
+
const $ = e.typeScriptProgram.getSourceFile(y);
|
|
5323
|
+
if ($ === void 0)
|
|
5309
5324
|
return;
|
|
5310
|
-
if (!(
|
|
5325
|
+
if (!($.text === h)) {
|
|
5311
5326
|
let C;
|
|
5312
5327
|
await Promise.race([
|
|
5313
5328
|
e._typeScriptReload.promise,
|
|
5314
|
-
new Promise((
|
|
5329
|
+
new Promise((L) => {
|
|
5315
5330
|
C = setTimeout(() => {
|
|
5316
5331
|
T.info(
|
|
5317
5332
|
l,
|
|
5318
5333
|
"Timed out waiting for TypeScript to finish type-checking. This may be a bug"
|
|
5319
|
-
),
|
|
5334
|
+
), L(void 0);
|
|
5320
5335
|
}, 1e4);
|
|
5321
5336
|
})
|
|
5322
5337
|
]), clearTimeout(C);
|
|
5323
5338
|
}
|
|
5324
5339
|
}
|
|
5325
|
-
if (!
|
|
5340
|
+
if (!we(y, e.dir.srcComponents))
|
|
5326
5341
|
return;
|
|
5327
5342
|
h ??= await v();
|
|
5328
5343
|
const E = Go(e, y, h);
|
|
5329
5344
|
if (E === void 0)
|
|
5330
5345
|
return !1;
|
|
5331
|
-
for (const
|
|
5332
|
-
const
|
|
5333
|
-
e.server.ws.send({ type: "custom", event: "component-meta-update", data:
|
|
5346
|
+
for (const $ of E) {
|
|
5347
|
+
const A = gn($);
|
|
5348
|
+
e.server.ws.send({ type: "custom", event: "component-meta-update", data: A });
|
|
5334
5349
|
}
|
|
5335
5350
|
return f(), !0;
|
|
5336
5351
|
}
|
|
@@ -5347,21 +5362,21 @@ function _c(e) {
|
|
|
5347
5362
|
});
|
|
5348
5363
|
return d;
|
|
5349
5364
|
}
|
|
5350
|
-
const
|
|
5365
|
+
const St = "@arcgis/lumina:provideAssets";
|
|
5351
5366
|
function ye(e, t, i = Mt) {
|
|
5352
5367
|
if (e.viteCommand !== "serve")
|
|
5353
|
-
throw Error(
|
|
5368
|
+
throw Error(S(St, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5354
5369
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5355
5370
|
if (t.forEach((r) => {
|
|
5356
5371
|
const a = Xn(r), c = Zn(e.dir, Qn(a)), l = Uc(e.viteConfig.base, c, e.dir.distCdn);
|
|
5357
5372
|
e.server.middlewares.use(l, (d, p, m) => {
|
|
5358
5373
|
const f = zc(d.url), g = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, y = u.join(c, f), v = i.find((h) => h.match(y, e));
|
|
5359
5374
|
return (typeof g == "function" ? Promise.resolve(g()) : J(g)).then((h) => {
|
|
5360
|
-
const
|
|
5361
|
-
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Ds.lookup(f) || "application/octet-stream"), p.write(
|
|
5375
|
+
const w = (typeof g == "function" ? void 0 : v?.transform(h.toString("utf8"), y, e)) ?? h;
|
|
5376
|
+
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Ds.lookup(f) || "application/octet-stream"), p.write(w), p.end();
|
|
5362
5377
|
}).catch((h) => {
|
|
5363
5378
|
(a.type !== "directory" || process.env.DEBUG) && T.warn(
|
|
5364
|
-
|
|
5379
|
+
St,
|
|
5365
5380
|
`Error occurred when trying to serve a file in response to request for "${d.originalUrl ?? f}":${String(h)}`
|
|
5366
5381
|
), m();
|
|
5367
5382
|
}), !0;
|
|
@@ -5376,7 +5391,7 @@ async function Vn(e, t, i = Mt) {
|
|
|
5376
5391
|
t.map(async (n) => {
|
|
5377
5392
|
const s = Xn(n), r = Zn(e.dir, Qn(s));
|
|
5378
5393
|
if (s.type === "directory") {
|
|
5379
|
-
const a = u.resolve(s.source), l = (await
|
|
5394
|
+
const a = u.resolve(s.source), l = (await qe(a, { recursive: !0, withFileTypes: !0 })).filter((d) => d.isFile()).map((d) => {
|
|
5380
5395
|
const p = u.resolve(d.parentPath, d.name), m = u.relative(a, p), f = u.join(r, m);
|
|
5381
5396
|
return [p, f];
|
|
5382
5397
|
});
|
|
@@ -5406,7 +5421,7 @@ const Xn = Ri ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
|
5406
5421
|
async function Pi(e, t, i, n) {
|
|
5407
5422
|
const s = i.find((r) => r.match(t, n));
|
|
5408
5423
|
if (s === void 0)
|
|
5409
|
-
await
|
|
5424
|
+
await ws(e, t);
|
|
5410
5425
|
else {
|
|
5411
5426
|
const r = await J(e, "utf8"), a = s.transform(r, t, n);
|
|
5412
5427
|
await D(t, a);
|
|
@@ -5418,8 +5433,8 @@ function Qn(e) {
|
|
|
5418
5433
|
if (e.source.endsWith(u.sep)) {
|
|
5419
5434
|
if (e.type === "file")
|
|
5420
5435
|
throw Error(
|
|
5421
|
-
|
|
5422
|
-
|
|
5436
|
+
S(
|
|
5437
|
+
St,
|
|
5423
5438
|
`Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${te(e.source)}. If source is meant to be a directory, change to "type":"directory". If source is a file, make sure source path does not end with / or \\`
|
|
5424
5439
|
)
|
|
5425
5440
|
);
|
|
@@ -5479,10 +5494,10 @@ function Gc(e) {
|
|
|
5479
5494
|
};
|
|
5480
5495
|
}
|
|
5481
5496
|
async function Vc(e) {
|
|
5482
|
-
const t =
|
|
5497
|
+
const t = _("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5483
5498
|
i.map(async (s) => {
|
|
5484
5499
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
5485
|
-
return await
|
|
5500
|
+
return await _(a) ? ts(a, r) : void 0;
|
|
5486
5501
|
})
|
|
5487
5502
|
);
|
|
5488
5503
|
return await t && n.push(is), n.filter(j);
|
|
@@ -5491,18 +5506,18 @@ const ts = (e, t) => ({
|
|
|
5491
5506
|
type: "directory",
|
|
5492
5507
|
source: e,
|
|
5493
5508
|
destination: u.basename(t)
|
|
5494
|
-
}), is = { type: "directory", source: "assets/", destination: "" },
|
|
5495
|
-
name:
|
|
5509
|
+
}), is = { type: "directory", source: "assets/", destination: "" }, ut = "@arcgis/lumina:printTotalBuildSize", Xc = (e) => ({
|
|
5510
|
+
name: ut,
|
|
5496
5511
|
apply: () => e.viteCommand === "build",
|
|
5497
5512
|
configResolved(t) {
|
|
5498
5513
|
const i = t.plugins.find(({ name: s }) => s === "vite:reporter");
|
|
5499
5514
|
if (i === void 0) {
|
|
5500
|
-
T.warn(
|
|
5515
|
+
T.warn(ut, "Unable to find the vite's built-in vite:reporter plugin");
|
|
5501
5516
|
return;
|
|
5502
5517
|
}
|
|
5503
5518
|
const n = i.writeBundle;
|
|
5504
5519
|
if (typeof n != "function")
|
|
5505
|
-
throw Error(
|
|
5520
|
+
throw Error(S(ut, "Expected vite:reporter to declare a writeBundle() function"));
|
|
5506
5521
|
i.writeBundle = async function(r, a) {
|
|
5507
5522
|
let c = 0, l = 0, d = 0, p = 0;
|
|
5508
5523
|
const m = console.log;
|
|
@@ -5561,7 +5576,7 @@ const ts = (e, t) => ({
|
|
|
5561
5576
|
...await Jr(e)
|
|
5562
5577
|
}, { loader: y, ...v } = g, h = e.environment === "development" || e.isInTest ? {
|
|
5563
5578
|
"process.env.ESRI_INTERNAL": "true"
|
|
5564
|
-
} : void 0,
|
|
5579
|
+
} : void 0, w = !import.meta.url.includes("node_modules"), E = {
|
|
5565
5580
|
/**
|
|
5566
5581
|
* Dependency pre-bundling by default scouts all index.html files to find
|
|
5567
5582
|
* what dependencies are used. Since Lumina adds imports to index.html
|
|
@@ -5608,7 +5623,7 @@ const ts = (e, t) => ({
|
|
|
5608
5623
|
* inside the package, and by Calcite outside the package).
|
|
5609
5624
|
*/
|
|
5610
5625
|
exclude: [
|
|
5611
|
-
...
|
|
5626
|
+
...w ? [
|
|
5612
5627
|
"@arcgis/lumina",
|
|
5613
5628
|
"@arcgis/components-controllers",
|
|
5614
5629
|
"@arcgis/components-utils",
|
|
@@ -5645,10 +5660,10 @@ const ts = (e, t) => ({
|
|
|
5645
5660
|
"@lit/context"
|
|
5646
5661
|
]
|
|
5647
5662
|
};
|
|
5648
|
-
if (typeof l.setupFiles == "string" ? l.setupFiles = [...
|
|
5663
|
+
if (typeof l.setupFiles == "string" ? l.setupFiles = [...pt, l.setupFiles] : Array.isArray(l.setupFiles) ? l.setupFiles = [...pt, ...l.setupFiles] : l.setupFiles = [...pt], e.isInPuppeteerTestBackEnd) {
|
|
5649
5664
|
if (p?.enabled === !0)
|
|
5650
5665
|
throw Error(
|
|
5651
|
-
|
|
5666
|
+
S(Li, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5652
5667
|
);
|
|
5653
5668
|
return {
|
|
5654
5669
|
test: {
|
|
@@ -5720,7 +5735,7 @@ const ts = (e, t) => ({
|
|
|
5720
5735
|
name: "@arcgis/lumina:setAssetPath",
|
|
5721
5736
|
apply: () => e.viteCommand === "build",
|
|
5722
5737
|
config: (t) => ({
|
|
5723
|
-
base: t.base ?? e.options.assets?.defaultPath ??
|
|
5738
|
+
base: t.base ?? e.options.assets?.defaultPath ?? Ve()
|
|
5724
5739
|
})
|
|
5725
5740
|
});
|
|
5726
5741
|
function nl(e = R()) {
|
|
@@ -5731,7 +5746,7 @@ const sl = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
|
5731
5746
|
Object.defineProperty(t, i, {
|
|
5732
5747
|
get() {
|
|
5733
5748
|
throw Error(
|
|
5734
|
-
|
|
5749
|
+
S(
|
|
5735
5750
|
"@arcgis/lumina:context",
|
|
5736
5751
|
`Tried to access '${String(i)}' before it was set. You can't access this property in global scope. However, it will be accessible by the time the following Vite plugin hook is called: ${e}`
|
|
5737
5752
|
)
|
|
@@ -5752,7 +5767,7 @@ const sl = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
|
5752
5767
|
function ue(e) {
|
|
5753
5768
|
if (u.isAbsolute(e))
|
|
5754
5769
|
throw Error(
|
|
5755
|
-
|
|
5770
|
+
S(
|
|
5756
5771
|
"@arcgis/lumina:context",
|
|
5757
5772
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5758
5773
|
)
|
|
@@ -5767,14 +5782,14 @@ const me = {
|
|
|
5767
5782
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5768
5783
|
};
|
|
5769
5784
|
async function ns(e, t, i, n, s = R()) {
|
|
5770
|
-
const r = rl(e, i, n, s), a = u.join(t, "lumina.ts"), l = await
|
|
5785
|
+
const r = rl(e, i, n, s), a = u.join(t, "lumina.ts"), l = await _(a) ? await J(a, "utf8") : "";
|
|
5771
5786
|
if (l.trim().replaceAll(`\r
|
|
5772
5787
|
`, `
|
|
5773
5788
|
`) === r.trim())
|
|
5774
5789
|
return !1;
|
|
5775
5790
|
if (process.env.CI)
|
|
5776
5791
|
throw Error(
|
|
5777
|
-
|
|
5792
|
+
S(
|
|
5778
5793
|
"@arcgis/lumina:updateLuminaTs",
|
|
5779
5794
|
`lumina.ts is out of date. Start the vite dev server or build locally at least once to update lumina.ts and commit the updated file. Tried to write the following content:
|
|
5780
5795
|
|
|
@@ -5883,7 +5898,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5883
5898
|
return n.optimizableImports;
|
|
5884
5899
|
if ("cssHref" in n)
|
|
5885
5900
|
return [];
|
|
5886
|
-
throw Error(
|
|
5901
|
+
throw Error(S(Re, `Unexpected loader type: ${JSON.stringify(n)}`));
|
|
5887
5902
|
});
|
|
5888
5903
|
e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
|
|
5889
5904
|
},
|
|
@@ -5892,7 +5907,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5892
5907
|
}
|
|
5893
5908
|
});
|
|
5894
5909
|
async function ll(e) {
|
|
5895
|
-
const i = (await Promise.all([
|
|
5910
|
+
const i = (await Promise.all([Se, qn(e)])).flat();
|
|
5896
5911
|
if (!await ns(
|
|
5897
5912
|
i,
|
|
5898
5913
|
e.dir.src,
|
|
@@ -5936,11 +5951,11 @@ async function pl(e, t) {
|
|
|
5936
5951
|
const E = y.lastIndexOf("/**");
|
|
5937
5952
|
v = y.slice(E + 3, -2).trim().replaceAll(gl, "");
|
|
5938
5953
|
}
|
|
5939
|
-
const h = r.slice(f, g).match(fl)?.[1] || m,
|
|
5954
|
+
const h = r.slice(f, g).match(fl)?.[1] || m, w = yl(m);
|
|
5940
5955
|
l.push({
|
|
5941
5956
|
description: `${h}${v ? `
|
|
5942
5957
|
${v}` : ""}`,
|
|
5943
|
-
url: `${t}?path=/story/${a}--${
|
|
5958
|
+
url: `${t}?path=/story/${a}--${w}&singleStory=true`
|
|
5944
5959
|
});
|
|
5945
5960
|
}
|
|
5946
5961
|
if (l.length === 0) {
|
|
@@ -5968,7 +5983,7 @@ var vl = Object.defineProperty, I = (e, t, i, n) => {
|
|
|
5968
5983
|
return s && vl(t, i, s), s;
|
|
5969
5984
|
};
|
|
5970
5985
|
const W = "@arcgis/lumina:context";
|
|
5971
|
-
class
|
|
5986
|
+
class P {
|
|
5972
5987
|
constructor(t) {
|
|
5973
5988
|
this.typeScriptProgram = void 0, this.typeScriptTypeChecker = void 0, this.typeScriptWatchProgram = void 0, this._typeScriptSourceFiles = /* @__PURE__ */ new Map(), this._typeScriptReload = void 0, this._plugin = {
|
|
5974
5989
|
name: W,
|
|
@@ -5993,7 +6008,7 @@ class x {
|
|
|
5993
6008
|
distCdnAssets: v
|
|
5994
6009
|
}, T.initialize(a.logger, l), a.root !== Mi())
|
|
5995
6010
|
throw Error(
|
|
5996
|
-
|
|
6011
|
+
S(
|
|
5997
6012
|
W,
|
|
5998
6013
|
"Vite's config.root is not equal process.cwd(). This is not officially supported by Lumina and may lead to unexpected behavior. If you need this to be supported, comment on https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2126 or contact Lumina maintainers."
|
|
5999
6014
|
)
|
|
@@ -6006,8 +6021,8 @@ class x {
|
|
|
6006
6021
|
"Vite output directory is outside the root directory. This is not officially supported by Lumina and may lead to unexpected behavior. Contact Lumina maintainers if you need this to be supported."
|
|
6007
6022
|
), this.isInStorybook = a.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(a.server?.hmr ?? !0);
|
|
6008
6023
|
const h = this.options.documentation?.publicStoryUrlPrefix;
|
|
6009
|
-
this.isFullApiExtraction && typeof h == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await pl(this.componentStoryFiles, h)).then((
|
|
6010
|
-
this.componentStories =
|
|
6024
|
+
this.isFullApiExtraction && typeof h == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await pl(this.componentStoryFiles, h)).then((w) => {
|
|
6025
|
+
this.componentStories = w;
|
|
6011
6026
|
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0), bc(this, a.build.sourcemap !== !1), ss(this) && Ee(this);
|
|
6012
6027
|
}
|
|
6013
6028
|
},
|
|
@@ -6047,7 +6062,7 @@ class x {
|
|
|
6047
6062
|
webTypes: s.jetBrains === !1 ? void 0 : s.jetBrains?.webTypesFileName ? ue(s.jetBrains.webTypesFileName) : me.webTypes,
|
|
6048
6063
|
vsCodeHtml: s.vsCode === !1 ? void 0 : s.vsCode?.htmlFileName ? ue(s.vsCode.htmlFileName) : me.vsCodeHtml,
|
|
6049
6064
|
vsCodeCss: s.vsCode === !1 ? void 0 : s.vsCode?.cssFileName ? ue(s.vsCode.cssFileName) : me.vsCodeCss
|
|
6050
|
-
}, vn(), this.componentFilesPromise = kt(this, u.resolve("src/components")),
|
|
6065
|
+
}, vn(void 0, t), this.componentFilesPromise = kt(this, u.resolve("src/components")), Sc(this);
|
|
6051
6066
|
const r = t.build?.preamble ?? nl();
|
|
6052
6067
|
this.banner = sl(r);
|
|
6053
6068
|
}
|
|
@@ -6071,7 +6086,7 @@ class x {
|
|
|
6071
6086
|
return n;
|
|
6072
6087
|
} else {
|
|
6073
6088
|
if (this.viteCommand === "build" || this.isInStorybook)
|
|
6074
|
-
throw Error(
|
|
6089
|
+
throw Error(S(W, t, "Unable to find the TypeScript source file"));
|
|
6075
6090
|
{
|
|
6076
6091
|
const r = this._typeScriptSourceFiles.get(t);
|
|
6077
6092
|
r !== void 0 && r.text === i && (n = r);
|
|
@@ -6119,7 +6134,7 @@ class x {
|
|
|
6119
6134
|
n === "serve" && ye(this, t, i);
|
|
6120
6135
|
else
|
|
6121
6136
|
throw Error(
|
|
6122
|
-
|
|
6137
|
+
S(
|
|
6123
6138
|
W,
|
|
6124
6139
|
"It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
|
|
6125
6140
|
)
|
|
@@ -6134,81 +6149,81 @@ class x {
|
|
|
6134
6149
|
}
|
|
6135
6150
|
I([
|
|
6136
6151
|
k("buildStart() in build mode or load() serve mode")
|
|
6137
|
-
],
|
|
6152
|
+
], P.prototype, "typeScriptHost");
|
|
6138
6153
|
I([
|
|
6139
6154
|
k("configResolved()")
|
|
6140
|
-
],
|
|
6155
|
+
], P.prototype, "shouldMinify");
|
|
6141
6156
|
I([
|
|
6142
6157
|
k("configResolved()")
|
|
6143
|
-
],
|
|
6158
|
+
], P.prototype, "shouldMinifyJsx");
|
|
6144
6159
|
I([
|
|
6145
6160
|
k("configResolved()")
|
|
6146
|
-
],
|
|
6161
|
+
], P.prototype, "dir");
|
|
6147
6162
|
I([
|
|
6148
6163
|
k("load()")
|
|
6149
|
-
],
|
|
6164
|
+
], P.prototype, "apiJson");
|
|
6150
6165
|
I([
|
|
6151
6166
|
k("load()")
|
|
6152
|
-
],
|
|
6167
|
+
], P.prototype, "apiJsonComponents");
|
|
6153
6168
|
I([
|
|
6154
6169
|
k("load()")
|
|
6155
|
-
],
|
|
6170
|
+
], P.prototype, "privateApiJson");
|
|
6156
6171
|
I([
|
|
6157
6172
|
k("load() when in build mode")
|
|
6158
|
-
],
|
|
6173
|
+
], P.prototype, "_componentPathMapping");
|
|
6159
6174
|
I([
|
|
6160
6175
|
k("apply()")
|
|
6161
|
-
],
|
|
6176
|
+
], P.prototype, "environment");
|
|
6162
6177
|
I([
|
|
6163
6178
|
k("apply()")
|
|
6164
|
-
],
|
|
6179
|
+
], P.prototype, "isInTest");
|
|
6165
6180
|
I([
|
|
6166
6181
|
k("apply()")
|
|
6167
|
-
],
|
|
6182
|
+
], P.prototype, "isInPuppeteerTestBackEnd");
|
|
6168
6183
|
I([
|
|
6169
6184
|
k("apply()")
|
|
6170
|
-
],
|
|
6185
|
+
], P.prototype, "isInPuppeteerTestFrontEnd");
|
|
6171
6186
|
I([
|
|
6172
6187
|
k("configResolved()")
|
|
6173
|
-
],
|
|
6188
|
+
], P.prototype, "isInStorybook");
|
|
6174
6189
|
I([
|
|
6175
6190
|
k("configResolved()")
|
|
6176
|
-
],
|
|
6191
|
+
], P.prototype, "hmrEnabled");
|
|
6177
6192
|
I([
|
|
6178
6193
|
k("apply()")
|
|
6179
|
-
],
|
|
6194
|
+
], P.prototype, "viteCommand");
|
|
6180
6195
|
I([
|
|
6181
6196
|
k("configResolved()")
|
|
6182
|
-
],
|
|
6197
|
+
], P.prototype, "isFullApiExtraction");
|
|
6183
6198
|
I([
|
|
6184
6199
|
k("configResolved()")
|
|
6185
|
-
],
|
|
6200
|
+
], P.prototype, "viteConfig");
|
|
6186
6201
|
I([
|
|
6187
6202
|
k("configResolved()")
|
|
6188
|
-
],
|
|
6203
|
+
], P.prototype, "server");
|
|
6189
6204
|
I([
|
|
6190
6205
|
k("load()")
|
|
6191
|
-
],
|
|
6206
|
+
], P.prototype, "componentFiles");
|
|
6192
6207
|
I([
|
|
6193
6208
|
k("load()")
|
|
6194
|
-
],
|
|
6209
|
+
], P.prototype, "componentStoryFiles");
|
|
6195
6210
|
I([
|
|
6196
6211
|
k("configResolved()")
|
|
6197
|
-
],
|
|
6212
|
+
], P.prototype, "componentStoriesPromise");
|
|
6198
6213
|
I([
|
|
6199
6214
|
k("load()")
|
|
6200
|
-
],
|
|
6215
|
+
], P.prototype, "componentStories");
|
|
6201
6216
|
I([
|
|
6202
6217
|
k("transform()")
|
|
6203
|
-
],
|
|
6218
|
+
], P.prototype, "_globalHydratedCssString");
|
|
6204
6219
|
I([
|
|
6205
6220
|
k("configResolved()")
|
|
6206
|
-
],
|
|
6221
|
+
], P.prototype, "_compilerOptionsForPrinter");
|
|
6207
6222
|
I([
|
|
6208
6223
|
k("configResolved()")
|
|
6209
|
-
],
|
|
6210
|
-
const
|
|
6211
|
-
name:
|
|
6224
|
+
], P.prototype, "_typeScriptPrinter");
|
|
6225
|
+
const mt = "@arcgis/lumina:addNonLazyImports", wl = (e) => ({
|
|
6226
|
+
name: mt,
|
|
6212
6227
|
apply: () => e.viteCommand === "build",
|
|
6213
6228
|
generateBundle(t, i) {
|
|
6214
6229
|
Object.entries(i).forEach(([n, s]) => {
|
|
@@ -6223,7 +6238,7 @@ const ut = "@arcgis/lumina:addNonLazyImports", Sl = (e) => ({
|
|
|
6223
6238
|
if (e.isInStorybook)
|
|
6224
6239
|
return;
|
|
6225
6240
|
const t = e._customElementDependencies, i = Object.entries(t), n = new Set(
|
|
6226
|
-
i.map(([r]) => r).filter((r) =>
|
|
6241
|
+
i.map(([r]) => r).filter((r) => we(r, e.dir.srcComponents))
|
|
6227
6242
|
);
|
|
6228
6243
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: l }]) => {
|
|
6229
6244
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
@@ -6234,8 +6249,8 @@ const ut = "@arcgis/lumina:addNonLazyImports", Sl = (e) => ({
|
|
|
6234
6249
|
}), (a.length > 0 || c.length > 0) && d.length === 0) {
|
|
6235
6250
|
const p = te(r);
|
|
6236
6251
|
throw Error(
|
|
6237
|
-
|
|
6238
|
-
|
|
6252
|
+
S(
|
|
6253
|
+
mt,
|
|
6239
6254
|
`Unable to determine what files imported ${p}. This is necessary because this file referenced other web components (${[...a, ...c].join(", ")}), and so the compiler needs to know what component entrypoints these imports should be added to. Please double check if you are referencing ${p} in the code dynamically in the way that Lumina cannot detect, and report this issue to the Lumina maintainers.`
|
|
6240
6255
|
)
|
|
6241
6256
|
);
|
|
@@ -6249,35 +6264,35 @@ const ut = "@arcgis/lumina:addNonLazyImports", Sl = (e) => ({
|
|
|
6249
6264
|
const C = Qa(e, b, r);
|
|
6250
6265
|
if (C === void 0)
|
|
6251
6266
|
return;
|
|
6252
|
-
const
|
|
6253
|
-
if (
|
|
6254
|
-
return
|
|
6267
|
+
const L = Za(C, p);
|
|
6268
|
+
if (L !== `./${p}`)
|
|
6269
|
+
return L.startsWith(".") ? `${L}/${Fi}` : L;
|
|
6255
6270
|
}
|
|
6256
6271
|
const f = new Set(a), g = new Set(c), y = Array.from(f, m).filter(j), v = (b) => `import "${b}";
|
|
6257
|
-
`, h = y.map(v).join(""),
|
|
6272
|
+
`, h = y.map(v).join(""), w = /* @__PURE__ */ new Set(), E = Array.from(g, (b) => {
|
|
6258
6273
|
const C = m(b);
|
|
6259
6274
|
if (C !== void 0) {
|
|
6260
6275
|
if (f.has(b)) {
|
|
6261
6276
|
T.warn(
|
|
6262
|
-
|
|
6277
|
+
mt,
|
|
6263
6278
|
`"${b}" is used both with and without deferLoad in ${r} (either directly in ${r} or via a functional component). deferLoad will be ignored in this case.`
|
|
6264
6279
|
);
|
|
6265
6280
|
return;
|
|
6266
6281
|
}
|
|
6267
|
-
return
|
|
6282
|
+
return w.add(v(C)), `.set("${b}", () => import("${C}"))
|
|
6268
6283
|
`;
|
|
6269
6284
|
}
|
|
6270
|
-
}).filter(j),
|
|
6271
|
-
${
|
|
6272
|
-
deferredLoaders${E.join("")};` :
|
|
6285
|
+
}).filter(j), $ = `${h}export * from "./${Et}";`, A = Array.from(w).join("") + $, x = E.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
6286
|
+
${$}
|
|
6287
|
+
deferredLoaders${E.join("")};` : $;
|
|
6273
6288
|
return [
|
|
6274
|
-
D(u.join(e.dir.dist, p, Fi),
|
|
6275
|
-
D(u.join(e.dir.dist, p,
|
|
6289
|
+
D(u.join(e.dir.dist, p, Fi), x),
|
|
6290
|
+
D(u.join(e.dir.dist, p, Sl), A)
|
|
6276
6291
|
];
|
|
6277
6292
|
});
|
|
6278
6293
|
await Promise.all(s);
|
|
6279
6294
|
}
|
|
6280
|
-
}), Fi = "index.js",
|
|
6295
|
+
}), Fi = "index.js", Sl = "index.d.ts", rs = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), rs(e, e[s].referencedBy, i, n))), bl = (e) => ({
|
|
6281
6296
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6282
6297
|
configureServer(t) {
|
|
6283
6298
|
e.server = t, !e.isInPuppeteerTestBackEnd && Ni(e).forEach(({ assets: i, transformers: n }) => ye(e, i, n));
|
|
@@ -6492,12 +6507,12 @@ const os = (e) => e.flatMap(
|
|
|
6492
6507
|
})) ?? []
|
|
6493
6508
|
), Ll = (e) => e.attributes?.map((t) => ({
|
|
6494
6509
|
name: t.name ?? "",
|
|
6495
|
-
description:
|
|
6510
|
+
description: Ye(t.description, t.deprecated) || void 0,
|
|
6496
6511
|
default: t.default,
|
|
6497
6512
|
value: {
|
|
6498
6513
|
type: Fl(t.type.values?.map(sn))
|
|
6499
6514
|
}
|
|
6500
|
-
})) ?? [], Fl = (e) => e?.length === 1 ? e[0] : e,
|
|
6515
|
+
})) ?? [], Fl = (e) => e?.length === 1 ? e[0] : e, Ye = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, xe = {
|
|
6501
6516
|
slots: "Slots",
|
|
6502
6517
|
events: "Events",
|
|
6503
6518
|
cssProperties: "CSS Properties",
|
|
@@ -6505,7 +6520,7 @@ const os = (e) => e.flatMap(
|
|
|
6505
6520
|
methods: "Methods"
|
|
6506
6521
|
};
|
|
6507
6522
|
function cs(e) {
|
|
6508
|
-
const t = Nl(e.slots), i = Dl(e.events), n = jl(e.cssProperties), s = Rl(e.cssParts), r = Ml(e.members), a =
|
|
6523
|
+
const t = Nl(e.slots), i = Dl(e.events), n = jl(e.cssProperties), s = Rl(e.cssParts), r = Ml(e.members), a = Ye(e.description, e.deprecated).trim();
|
|
6509
6524
|
return [...a ? [`${a}
|
|
6510
6525
|
--`] : [], i, r, t, n, s].filter(Boolean).join(`
|
|
6511
6526
|
|
|
@@ -6530,7 +6545,7 @@ ${t.join(`
|
|
|
6530
6545
|
), Ml = (e) => Pe(
|
|
6531
6546
|
xe.methods,
|
|
6532
6547
|
e.filter(gs).map(
|
|
6533
|
-
(t) => [`- \`${t.name}${t.signature}\``,
|
|
6548
|
+
(t) => [`- \`${t.name}${t.signature}\``, Ye(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6534
6549
|
)
|
|
6535
6550
|
);
|
|
6536
6551
|
function Ol(e, t) {
|
|
@@ -6581,7 +6596,7 @@ const Jl = (e) => e.map((t) => ({
|
|
|
6581
6596
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
6582
6597
|
})), Bl = (e) => e.attributes?.map((t) => ({
|
|
6583
6598
|
name: t.name,
|
|
6584
|
-
description:
|
|
6599
|
+
description: Ye(t.description, t.deprecated) || void 0,
|
|
6585
6600
|
values: _l(t)
|
|
6586
6601
|
})) ?? [], _l = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Hl = (e) => ({
|
|
6587
6602
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
@@ -6647,7 +6662,7 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6647
6662
|
}
|
|
6648
6663
|
}`;
|
|
6649
6664
|
function Vl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6650
|
-
const [s, r] =
|
|
6665
|
+
const [s, r] = Ze(e, i);
|
|
6651
6666
|
return [
|
|
6652
6667
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6653
6668
|
`,
|
|
@@ -6681,7 +6696,7 @@ ${t}
|
|
|
6681
6696
|
}`;
|
|
6682
6697
|
}
|
|
6683
6698
|
function Ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6684
|
-
const [s, r] =
|
|
6699
|
+
const [s, r] = Ze(e, i);
|
|
6685
6700
|
return [
|
|
6686
6701
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6687
6702
|
`,
|
|
@@ -6726,7 +6741,7 @@ ${t}
|
|
|
6726
6741
|
}`;
|
|
6727
6742
|
}
|
|
6728
6743
|
function Yl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6729
|
-
const [s, r] =
|
|
6744
|
+
const [s, r] = Ze(e, i);
|
|
6730
6745
|
return [
|
|
6731
6746
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6732
6747
|
`,
|
|
@@ -6760,7 +6775,7 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6760
6775
|
}
|
|
6761
6776
|
}`;
|
|
6762
6777
|
function td({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6763
|
-
const [s, r] =
|
|
6778
|
+
const [s, r] = Ze(e, i);
|
|
6764
6779
|
return [
|
|
6765
6780
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6766
6781
|
`,
|
|
@@ -6893,7 +6908,7 @@ ${t}
|
|
|
6893
6908
|
`;
|
|
6894
6909
|
}
|
|
6895
6910
|
function Id(e = {}) {
|
|
6896
|
-
const t = new
|
|
6911
|
+
const t = new P(e), n = [
|
|
6897
6912
|
t._plugin,
|
|
6898
6913
|
tl(t),
|
|
6899
6914
|
il(t),
|
|
@@ -6906,7 +6921,7 @@ function Id(e = {}) {
|
|
|
6906
6921
|
To(t),
|
|
6907
6922
|
Gc(t),
|
|
6908
6923
|
bl(t),
|
|
6909
|
-
|
|
6924
|
+
wl(t),
|
|
6910
6925
|
cl(t),
|
|
6911
6926
|
Rs(t),
|
|
6912
6927
|
Ec(t),
|
|
@@ -6918,19 +6933,19 @@ function Id(e = {}) {
|
|
|
6918
6933
|
const Ad = {
|
|
6919
6934
|
initializeComponentDependencies: vn,
|
|
6920
6935
|
updateLuminaTs: ns,
|
|
6921
|
-
propertyToAttributeMappings:
|
|
6936
|
+
propertyToAttributeMappings: H,
|
|
6922
6937
|
findDeclaredComponents: Hi,
|
|
6923
6938
|
nativeEvents: Zi,
|
|
6924
6939
|
svgElements: $t,
|
|
6925
6940
|
mathMlElements: xt,
|
|
6926
6941
|
alwaysAttributes: Vi,
|
|
6927
6942
|
nativeAlwaysAttributes: Xi,
|
|
6928
|
-
htmlAlwaysAttributes:
|
|
6929
|
-
isPropertyEscapeNeeded:
|
|
6943
|
+
htmlAlwaysAttributes: ht,
|
|
6944
|
+
isPropertyEscapeNeeded: Qe
|
|
6930
6945
|
};
|
|
6931
6946
|
export {
|
|
6932
6947
|
We as LuminaApiExtractor,
|
|
6933
6948
|
Ad as exportsForCodemod,
|
|
6934
|
-
|
|
6949
|
+
Ve as inferCdnUrl,
|
|
6935
6950
|
Id as useLumina
|
|
6936
6951
|
};
|