@arcgis/lumina-compiler 4.33.0-next.135 → 4.33.0-next.137
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 +326 -320
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { nodeExternals as ms } from "rollup-plugin-node-externals";
|
|
2
|
-
import { stringToStartsWithGlob as Wt, path as u, toSystemPathSeparators as Y, retrievePackageJson as R, fetchPackageLocation as Be, asyncRetrievePackageJson as _e, existsAsync as
|
|
2
|
+
import { stringToStartsWithGlob as Wt, path as u, toSystemPathSeparators as Y, retrievePackageJson as R, fetchPackageLocation as Be, asyncRetrievePackageJson as _e, existsAsync as U, findPath as fs, toPosixPathSeparators as Ie, isPosix as Ji, getCwd as Ki } from "@arcgis/components-build-utils";
|
|
3
3
|
import ys from "vite-plugin-dts";
|
|
4
4
|
import o from "typescript";
|
|
5
|
-
import { f as
|
|
6
|
-
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as Wi, setApiDocFromJsDoc as ue, ApiExtractor as
|
|
7
|
-
import { isNotUndefined as j, mappedFind as ye, camelToKebab as
|
|
8
|
-
import { readdir as He, readFile as J, rm as $s, mkdir as
|
|
5
|
+
import { f as w, l as C } from "./logger-KpGU2b3R.js";
|
|
6
|
+
import { getMemberName as X, apiMemberToSynthesizedComments as V, globalPackageIdentifier as Wi, setApiDocFromJsDoc as ue, ApiExtractor as gs, hasIgnoredModifier as hs, symbolToDocs as Bt, setDefaultFromInitializer as _t, multipleJsDocTags as vs, findDecorator as Ht, isApiMethod as Ss, isApiProperty as bs } from "@arcgis/api-extractor";
|
|
7
|
+
import { isNotUndefined as j, mappedFind as ye, camelToKebab as wt, kebabToPascal as ws, uncapitalize as ut, identity as Bi, Deferred as Ts, getPreamble as Es, capitalize as Cs } from "@arcgis/components-utils";
|
|
8
|
+
import { readdir as He, readFile as J, rm as $s, mkdir as z, cp as Ps, writeFile as F, copyFile as xs } from "node:fs/promises";
|
|
9
9
|
import { lazyMetaSubItemJoiner as As, lazyMetaItemJoiner as et, lazyMetaGroupJoiner as ks, propertyFlagAttribute as Ut, propertyFlagReflect as Is, propertyFlagBoolean as Ls, propertyFlagNumber as Fs, propertyFlagState as Ns, propertyFlagReadOnly as Ds, propertyFlagNoAccessor as js } from "@arcgis/lumina/config";
|
|
10
10
|
import { build as Rs } from "esbuild";
|
|
11
11
|
import { glob as Ms } from "glob";
|
|
@@ -44,7 +44,7 @@ function Bs(e, t, i) {
|
|
|
44
44
|
c === s.length - 1 ? r[""] ??= e : (r[a] ??= {}, r = r[a]);
|
|
45
45
|
}), r[""];
|
|
46
46
|
}
|
|
47
|
-
function
|
|
47
|
+
function ge(e, t, i) {
|
|
48
48
|
if (!e.startsWith(t))
|
|
49
49
|
return e;
|
|
50
50
|
const n = e.slice(t.length), s = _s(n, i);
|
|
@@ -63,7 +63,7 @@ function _s(e, t) {
|
|
|
63
63
|
return e;
|
|
64
64
|
}
|
|
65
65
|
const Hs = ({ filePath: e, content: t }, i) => {
|
|
66
|
-
const n = e.startsWith(i.dir.distComponents) ?
|
|
66
|
+
const n = e.startsWith(i.dir.distComponents) ? ge(
|
|
67
67
|
Ui(i.dir.distComponents, e),
|
|
68
68
|
i.dir.distComponents,
|
|
69
69
|
i
|
|
@@ -91,7 +91,7 @@ const Us = -1, zs = -2, qs = /["']\.\.?\/[^'"]+/gu, zi = (e, t, i, n) => e.repla
|
|
|
91
91
|
const r = s.slice(1);
|
|
92
92
|
if (!r.startsWith("./") && !r.startsWith("../"))
|
|
93
93
|
return s;
|
|
94
|
-
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Ui(t.dir.distComponents, a, "") : a, l =
|
|
94
|
+
const a = u.join(n, r), c = !r.endsWith(".js") && !r.split("/").at(-1).includes(".") ? Ui(t.dir.distComponents, a, "") : a, l = ge(c, t.dir.distComponents, t);
|
|
95
95
|
if (i === n && a === l)
|
|
96
96
|
return s;
|
|
97
97
|
const d = ee(i, l);
|
|
@@ -211,7 +211,7 @@ ${e.content}`
|
|
|
211
211
|
const t = e.content.match(rr)?.[1] ?? e.content.match(or)?.[1];
|
|
212
212
|
if (t !== void 0)
|
|
213
213
|
throw Error(
|
|
214
|
-
|
|
214
|
+
w(
|
|
215
215
|
"@arcgis/lumina:failOnJsonImport",
|
|
216
216
|
`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
|
|
217
217
|
File content:
|
|
@@ -301,14 +301,14 @@ function yr(e) {
|
|
|
301
301
|
return e;
|
|
302
302
|
}
|
|
303
303
|
const Qi = "_setterTypes";
|
|
304
|
-
function
|
|
304
|
+
function gr(e, t, i) {
|
|
305
305
|
return o.factory.createPropertyDeclaration(
|
|
306
306
|
[o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword)],
|
|
307
307
|
o.factory.createIdentifier(Qi),
|
|
308
308
|
void 0,
|
|
309
309
|
o.factory.createTypeLiteralNode(
|
|
310
310
|
e.map((n) => {
|
|
311
|
-
const [s, r] =
|
|
311
|
+
const [s, r] = hr(n.name, n.type, i._typeScriptPrinter, t);
|
|
312
312
|
return o.factory.createPropertySignature(
|
|
313
313
|
void 0,
|
|
314
314
|
s,
|
|
@@ -320,7 +320,7 @@ function hr(e, t, i) {
|
|
|
320
320
|
void 0
|
|
321
321
|
);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function hr(e, t, i, n) {
|
|
324
324
|
const s = i.printNode(o.EmitHint.Unspecified, e, n), r = i.printNode(o.EmitHint.Unspecified, t, n), a = `declare class A { ${s}: ${r} }`, d = o.createSourceFile(
|
|
325
325
|
"a.d.ts",
|
|
326
326
|
a,
|
|
@@ -341,13 +341,13 @@ function Sr(e, t, i) {
|
|
|
341
341
|
const a = [], c = /* @__PURE__ */ new Set(), l = [], d = [];
|
|
342
342
|
mt = void 0;
|
|
343
343
|
for (let y = 0; y < n.members.length; y++) {
|
|
344
|
-
const
|
|
345
|
-
|
|
344
|
+
const g = n.members[y], h = br(g, r, l, c, t);
|
|
345
|
+
h === void 0 ? a.push(g) : Array.isArray(h) ? d.push(...h) : (o.setEmitFlags(h, o.EmitFlags.NoComments), d.push(h));
|
|
346
346
|
}
|
|
347
347
|
c.size > 0 && a.forEach((y) => {
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
}), l.length > 0 && d.push(
|
|
348
|
+
const g = X(y.name);
|
|
349
|
+
g !== void 0 && c.has(g) && d.push(Tr(y));
|
|
350
|
+
}), l.length > 0 && d.push(gr(l, t, i.compiler));
|
|
351
351
|
const p = o.factory.updateClassDeclaration(
|
|
352
352
|
n,
|
|
353
353
|
n.modifiers,
|
|
@@ -378,7 +378,7 @@ function Sr(e, t, i) {
|
|
|
378
378
|
return e;
|
|
379
379
|
}
|
|
380
380
|
let mt;
|
|
381
|
-
function
|
|
381
|
+
function br(e, t, i, n, s) {
|
|
382
382
|
const r = X(e.name);
|
|
383
383
|
if (r === void 0)
|
|
384
384
|
return;
|
|
@@ -475,12 +475,12 @@ function wr(e, t, i, n, s) {
|
|
|
475
475
|
}
|
|
476
476
|
const Xt = /^typeof this\.(?<accessor>[^.]+)\.(?<boundProperty>[^.]+)$/u;
|
|
477
477
|
function Qt(e, t, i) {
|
|
478
|
-
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(
|
|
478
|
+
const s = (t?.pos !== -1 ? t?.getText(i) : void 0)?.match(wr) ?? [];
|
|
479
479
|
for (const r of s)
|
|
480
480
|
e.add(r);
|
|
481
481
|
return t;
|
|
482
482
|
}
|
|
483
|
-
const
|
|
483
|
+
const wr = /(?<=this.)[\w$]+/gu;
|
|
484
484
|
function Tr(e) {
|
|
485
485
|
if (o.setEmitFlags(e, o.EmitFlags.NoComments), o.isPropertyDeclaration(e)) {
|
|
486
486
|
const t = xe(e.modifiers);
|
|
@@ -563,7 +563,7 @@ function $r(e) {
|
|
|
563
563
|
return [];
|
|
564
564
|
const s = e.typeScriptProgram.getSourceFile(n);
|
|
565
565
|
if (s === void 0)
|
|
566
|
-
throw Error(
|
|
566
|
+
throw Error(w(Yt, `Could not find source file: ${Y(n)}`));
|
|
567
567
|
const r = [];
|
|
568
568
|
return e.typeScriptProgram.emit(
|
|
569
569
|
s,
|
|
@@ -1829,13 +1829,13 @@ const Ue = (e) => zr(Wr(e)), Gr = (e) => !Vr.test(e), Vr = /^[^\s"'=<>`]+$/u, Xr
|
|
|
1829
1829
|
if (!a.endsWith(".tsx"))
|
|
1830
1830
|
return;
|
|
1831
1831
|
const c = u.join(i, a);
|
|
1832
|
-
if (
|
|
1832
|
+
if (he(c, t))
|
|
1833
1833
|
return c;
|
|
1834
1834
|
a.endsWith(".stories.tsx") && c.startsWith(t) && s.push(c);
|
|
1835
1835
|
}).filter(j);
|
|
1836
1836
|
return e.componentFiles = r, e.componentStoryFiles = s, r;
|
|
1837
1837
|
});
|
|
1838
|
-
function
|
|
1838
|
+
function he(e, t) {
|
|
1839
1839
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
1840
1840
|
return !1;
|
|
1841
1841
|
const [i, n] = e.slice(0, -4).split(u.sep).slice(Yr);
|
|
@@ -1957,7 +1957,7 @@ function ci(e) {
|
|
|
1957
1957
|
}
|
|
1958
1958
|
const mo = on({ removeComments: !0 }), nt = me.createTextWriter(`
|
|
1959
1959
|
`), ln = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, fo = ln & o.TypeFormatFlags.NodeBuilderFlagsMask, yo = fo | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
1960
|
-
function
|
|
1960
|
+
function go(e, t, i, n = !0) {
|
|
1961
1961
|
const s = /* @__PURE__ */ new Map();
|
|
1962
1962
|
se(t, s, i, n);
|
|
1963
1963
|
const r = t.flags & o.TypeFlags.Union ? t.types.every(li) : li(t), a = e.typeToTypeNode(
|
|
@@ -1965,7 +1965,7 @@ function ho(e, t, i, n = !0) {
|
|
|
1965
1965
|
void 0,
|
|
1966
1966
|
yo & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
1967
1967
|
);
|
|
1968
|
-
return s.forEach(
|
|
1968
|
+
return s.forEach(ho), a === void 0 ? (C.warn("@arcgis/lumina", "Unexpected case: Failed to convert type to type node."), o.factory.createTypeReferenceNode(o.factory.createIdentifier("unknown"), void 0)) : a;
|
|
1969
1969
|
}
|
|
1970
1970
|
const li = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
1971
1971
|
function di(e, t, i, n, s = !0) {
|
|
@@ -1976,16 +1976,16 @@ function di(e, t, i, n, s = !0) {
|
|
|
1976
1976
|
return;
|
|
1977
1977
|
const f = p ? d.aliasTypeArguments?.[0]?.symbol?.escapedName ?? "" : m.name;
|
|
1978
1978
|
if (f.startsWith("_")) {
|
|
1979
|
-
const
|
|
1980
|
-
if (
|
|
1981
|
-
const
|
|
1982
|
-
if (
|
|
1979
|
+
const g = m.declarations?.[0];
|
|
1980
|
+
if (g?.kind === o.SyntaxKind.FunctionType) {
|
|
1981
|
+
const h = g;
|
|
1982
|
+
if (h.parameters.forEach((v) => {
|
|
1983
1983
|
if (v.type === void 0)
|
|
1984
1984
|
return;
|
|
1985
1985
|
const S = e.getTypeFromTypeNode(v.type);
|
|
1986
1986
|
se(S, /* @__PURE__ */ new Map(), c, !1);
|
|
1987
|
-
}),
|
|
1988
|
-
const v = e.getTypeFromTypeNode(
|
|
1987
|
+
}), h.type !== void 0) {
|
|
1988
|
+
const v = e.getTypeFromTypeNode(h.type);
|
|
1989
1989
|
se(v, /* @__PURE__ */ new Map(), c, !1);
|
|
1990
1990
|
}
|
|
1991
1991
|
}
|
|
@@ -2000,7 +2000,7 @@ function di(e, t, i, n, s = !0) {
|
|
|
2000
2000
|
} : vo(m, f, i, n);
|
|
2001
2001
|
r.push(y), a.add(f);
|
|
2002
2002
|
}
|
|
2003
|
-
return { typeNode:
|
|
2003
|
+
return { typeNode: go(e, t, c, s), references: r };
|
|
2004
2004
|
}
|
|
2005
2005
|
function se(e, t, i, n = !0) {
|
|
2006
2006
|
if (typeof e != "object" || e === null || !("checker" in e))
|
|
@@ -2030,7 +2030,7 @@ function se(e, t, i, n = !0) {
|
|
|
2030
2030
|
c !== "resolvedBaseConstructorType" && c !== "resolvedBaseTypes" && c !== "typeParameters" && c !== "typeParameter" && (Array.isArray(l) ? l.forEach((d) => se(d, t, i, n)) : se(l, t, i, n));
|
|
2031
2031
|
});
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function ho(e, t) {
|
|
2034
2034
|
e.origin !== void 0 && (t.origin = e.origin), e.aliasSymbol !== void 0 && (t.aliasSymbol = e.aliasSymbol), e.aliasTypeArguments !== void 0 && (t.aliasTypeArguments = e.aliasTypeArguments);
|
|
2035
2035
|
}
|
|
2036
2036
|
function vo(e, t, i, n) {
|
|
@@ -2079,13 +2079,13 @@ function So(e, t) {
|
|
|
2079
2079
|
}
|
|
2080
2080
|
return {
|
|
2081
2081
|
packageName: void 0,
|
|
2082
|
-
moduleName: u.relative(t.root, bo(
|
|
2082
|
+
moduleName: u.relative(t.root, wo(bo(e, t)))
|
|
2083
2083
|
};
|
|
2084
2084
|
}
|
|
2085
|
-
function
|
|
2086
|
-
return
|
|
2085
|
+
function bo(e, t) {
|
|
2086
|
+
return he(e, t.srcComponents) ? u.join(t.dist, rn(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2087
2087
|
}
|
|
2088
|
-
const
|
|
2088
|
+
const wo = (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`;
|
|
2089
2089
|
function dn(e) {
|
|
2090
2090
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2091
2091
|
return { packageName: s, moduleName: r };
|
|
@@ -2143,10 +2143,10 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2143
2143
|
configResolved(t) {
|
|
2144
2144
|
const i = t.plugins.find(({ name: s }) => s === "vite:css-post");
|
|
2145
2145
|
if (i === void 0)
|
|
2146
|
-
throw Error(
|
|
2146
|
+
throw Error(w(te, "Unable to find the vite's built-in vite:css-post plugin"));
|
|
2147
2147
|
const n = i.transform;
|
|
2148
2148
|
if (typeof n != "function")
|
|
2149
|
-
throw Error(
|
|
2149
|
+
throw Error(w(te, "Expected vite:css-post to declare a transform() function"));
|
|
2150
2150
|
i.transform = async function(r, a) {
|
|
2151
2151
|
const c = a.endsWith(Q);
|
|
2152
2152
|
c && (a = a.slice(0, -Q.length));
|
|
@@ -2167,16 +2167,16 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2167
2167
|
const y = e.isFullApiExtraction ? Co(r) : void 0;
|
|
2168
2168
|
if (y !== void 0) {
|
|
2169
2169
|
e._cssDocs ??= /* @__PURE__ */ new Map(), e._cssDocs.set(a, y);
|
|
2170
|
-
const
|
|
2171
|
-
if (
|
|
2172
|
-
for (const
|
|
2173
|
-
if (
|
|
2174
|
-
if (
|
|
2175
|
-
|
|
2170
|
+
const g = e._cssImports.get(a);
|
|
2171
|
+
if (g !== void 0) {
|
|
2172
|
+
for (const h of e.apiJsonComponents)
|
|
2173
|
+
if (g.has(h.tagName))
|
|
2174
|
+
if (h.cssProperties === void 0)
|
|
2175
|
+
h.cssProperties = Array.from(y);
|
|
2176
2176
|
else {
|
|
2177
|
-
const v = new Set(
|
|
2178
|
-
|
|
2179
|
-
...
|
|
2177
|
+
const v = new Set(h.cssProperties.map((S) => S.name));
|
|
2178
|
+
h.cssProperties = [
|
|
2179
|
+
...h.cssProperties,
|
|
2180
2180
|
...y.filter((S) => !v.has(S.name))
|
|
2181
2181
|
];
|
|
2182
2182
|
}
|
|
@@ -2207,7 +2207,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2207
2207
|
if ((e.options.css?.sideEffectImportHandling ?? ko)(d, i) === "drop")
|
|
2208
2208
|
return a = !0, dr(l);
|
|
2209
2209
|
throw Error(
|
|
2210
|
-
|
|
2210
|
+
w(
|
|
2211
2211
|
te,
|
|
2212
2212
|
`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`,
|
|
2213
2213
|
i
|
|
@@ -2231,7 +2231,7 @@ const $o = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Po = /\n\s+\
|
|
|
2231
2231
|
if (d.endsWith(Le))
|
|
2232
2232
|
return l;
|
|
2233
2233
|
throw Error(
|
|
2234
|
-
|
|
2234
|
+
w(
|
|
2235
2235
|
te,
|
|
2236
2236
|
`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`,
|
|
2237
2237
|
i
|
|
@@ -2341,12 +2341,12 @@ export declare const defineCustomElements: import("@arcgis/lumina").DefineCustom
|
|
|
2341
2341
|
"]"
|
|
2342
2342
|
].join("");
|
|
2343
2343
|
function qo(e) {
|
|
2344
|
-
const { properties: t, asyncMethods: i, syncMethods: n } =
|
|
2344
|
+
const { properties: t, asyncMethods: i, syncMethods: n } = gn(e), s = t.map((p) => p.join(As)).join(et), r = i.join(et), a = n.join(et), c = [s, r, a], l = c.findLastIndex((p) => p.length > 0), d = c.slice(0, l + 1);
|
|
2345
2345
|
return d.length > 0 ? `"${d.join(ks)}"` : "";
|
|
2346
2346
|
}
|
|
2347
|
-
function
|
|
2347
|
+
function gn(e) {
|
|
2348
2348
|
const t = e.members.filter((r) => r.kind === "field").map((r) => {
|
|
2349
|
-
const a = typeof r.attribute == "string", c = a && r.attribute !==
|
|
2349
|
+
const a = typeof r.attribute == "string", c = a && r.attribute !== wt(r.name);
|
|
2350
2350
|
return a && !c ? [r.name] : [r.name, c ? String(r.attribute) : ""];
|
|
2351
2351
|
}), i = e.members.filter(
|
|
2352
2352
|
(r) => r.kind === "method" && /**
|
|
@@ -2434,14 +2434,14 @@ function ea(e, t, i) {
|
|
|
2434
2434
|
if (s !== void 0) {
|
|
2435
2435
|
if (!o.isObjectLiteralExpression(s))
|
|
2436
2436
|
throw Error(
|
|
2437
|
-
|
|
2437
|
+
w(
|
|
2438
2438
|
"@arcgis/lumina:extractEventMeta",
|
|
2439
2439
|
`Expected object literal expression as first argument of ${Ae}(). Found ${t.name} = createEvent(${s.getText(i)})`
|
|
2440
2440
|
)
|
|
2441
2441
|
);
|
|
2442
2442
|
if (s.properties.some((r) => o.isSpreadAssignment(r)))
|
|
2443
2443
|
throw Error(
|
|
2444
|
-
|
|
2444
|
+
w(
|
|
2445
2445
|
"@arcgis/lumina:extractEventMeta",
|
|
2446
2446
|
`Unexpected spread syntax in ${Ae}() argument. ${Ae}() arguments must be statically parsable at compile time`
|
|
2447
2447
|
)
|
|
@@ -2456,14 +2456,14 @@ function re(e, t) {
|
|
|
2456
2456
|
if (e.kind === o.SyntaxKind.FalseKeyword)
|
|
2457
2457
|
return !1;
|
|
2458
2458
|
throw Error(
|
|
2459
|
-
|
|
2459
|
+
w(
|
|
2460
2460
|
"@arcgis/lumina:extractBooleanInitializer",
|
|
2461
2461
|
`Expected boolean literal. Instead found ${e?.getText(t)}`
|
|
2462
2462
|
)
|
|
2463
2463
|
);
|
|
2464
2464
|
}
|
|
2465
2465
|
const At = "@arcgis/lumina-compiler";
|
|
2466
|
-
class Oe extends
|
|
2466
|
+
class Oe extends gs {
|
|
2467
2467
|
constructor(t, i) {
|
|
2468
2468
|
super({ isFullApiExtraction: t.isFullApiExtraction, cwd: t.dir.root }), this.context = t, this.isPathOnly = i, this.localCssImports = void 0, this.localDeclaredComponents = void 0, this.indexedComponents = /* @__PURE__ */ new Map(), this.apiComponent = void 0, this.pairedSetter = void 0, this.copyDocDefinitions = void 0, this._resolvedInheritance = /* @__PURE__ */ new Map(), this.copyDocDefinitions = t.options.documentation?.copyDefinitions;
|
|
2469
2469
|
}
|
|
@@ -2522,7 +2522,7 @@ class Oe extends hs {
|
|
|
2522
2522
|
* prefix (Arcgis), where as tag name always does. This also matches
|
|
2523
2523
|
* Stencil's behavior.
|
|
2524
2524
|
*/
|
|
2525
|
-
pascalCaseName:
|
|
2525
|
+
pascalCaseName: ws(n),
|
|
2526
2526
|
privacy: void 0,
|
|
2527
2527
|
importPath: "",
|
|
2528
2528
|
members: [],
|
|
@@ -2535,7 +2535,7 @@ class Oe extends hs {
|
|
|
2535
2535
|
}, r = t.heritageClauses?.find((a) => a.token === o.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;
|
|
2536
2536
|
if (r === void 0)
|
|
2537
2537
|
throw Error(
|
|
2538
|
-
|
|
2538
|
+
w(
|
|
2539
2539
|
"@arcgis/lumina:extractComponentDeclaration",
|
|
2540
2540
|
`Lumina component must extend LitElement class. Found ${i} in ${this.apiModule.path} that does not extend any class.`
|
|
2541
2541
|
)
|
|
@@ -2553,8 +2553,8 @@ class Oe extends hs {
|
|
|
2553
2553
|
for (const f of this.localCssImports) {
|
|
2554
2554
|
const y = this.context._cssImports.get(f);
|
|
2555
2555
|
y === void 0 ? this.context._cssImports.set(f, /* @__PURE__ */ new Set([s.tagName])) : y.add(s.tagName);
|
|
2556
|
-
const
|
|
2557
|
-
|
|
2556
|
+
const g = this.context._cssDocs?.get(f);
|
|
2557
|
+
g !== void 0 && (s.cssProperties = g);
|
|
2558
2558
|
}
|
|
2559
2559
|
this.localCssImports = void 0;
|
|
2560
2560
|
}
|
|
@@ -2620,7 +2620,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2620
2620
|
return i;
|
|
2621
2621
|
}
|
|
2622
2622
|
extractComponentMember(t, i) {
|
|
2623
|
-
if (
|
|
2623
|
+
if (hs(t) || i === void 0) {
|
|
2624
2624
|
o.isPropertyDeclaration(t) && o.isIdentifier(t.name) && t.name.text === "shadowRootOptions" && t.initializer !== void 0 && o.isIdentifier(t.initializer) && t.initializer.text === "noShadowRoot" && (this.apiComponent.encapsulation = "none");
|
|
2625
2625
|
return;
|
|
2626
2626
|
}
|
|
@@ -2649,7 +2649,7 @@ ${c}.componentOnReady().then(() => {
|
|
|
2649
2649
|
default: void 0,
|
|
2650
2650
|
deprecated: void 0,
|
|
2651
2651
|
readonly: c || (s ? t.modifiers?.some((d) => d.kind === o.SyntaxKind.ReadonlyKeyword) : o.isGetAccessor(t) && this.pairedSetter === void 0) ? !0 : void 0,
|
|
2652
|
-
attribute: r === !1 ? void 0 : typeof r == "string" ? r :
|
|
2652
|
+
attribute: r === !1 ? void 0 : typeof r == "string" ? r : wt(i),
|
|
2653
2653
|
reflects: a || void 0,
|
|
2654
2654
|
docsTags: void 0,
|
|
2655
2655
|
getterType: void 0,
|
|
@@ -2670,26 +2670,26 @@ ${c}.componentOnReady().then(() => {
|
|
|
2670
2670
|
* When doing full API extraction, extract additional details for a field.
|
|
2671
2671
|
*/
|
|
2672
2672
|
extractComponentFieldDetails(t, i) {
|
|
2673
|
-
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 : Bt(s, r), c = new Set(a?.docsTags.map((
|
|
2673
|
+
const n = i.readonly === !0, s = this.context.typeScriptTypeChecker, r = s.getSymbolAtLocation(t.name), a = r === void 0 ? void 0 : Bt(s, r), c = new Set(a?.docsTags.map((h) => h.name) ?? []);
|
|
2674
2674
|
ue(t.name, this.context.typeScriptTypeChecker, i, a);
|
|
2675
2675
|
let l = !n && i.readonly === !0;
|
|
2676
2676
|
const d = this.pairedSetter ?? t, p = i.default;
|
|
2677
2677
|
_t(t, i, this.file);
|
|
2678
|
-
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((
|
|
2678
|
+
const m = p === void 0 && i.default === "true", f = i.docsTags?.some((h) => h.name === "required") ?? !1;
|
|
2679
2679
|
i.type = lo(this.context, d, f, this.file);
|
|
2680
2680
|
const y = 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);
|
|
2681
2681
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
|
|
2682
|
-
const
|
|
2682
|
+
const h = t.initializer, v = s.getSymbolAtLocation(h), S = v !== void 0 && ((v.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(v) : v, E = S?.getDeclarations() ?? [];
|
|
2683
2683
|
if (S !== void 0) {
|
|
2684
2684
|
const P = Bt(s, S);
|
|
2685
2685
|
if (P.docsTags.length > 0) {
|
|
2686
2686
|
P.docsTags = P.docsTags.filter(
|
|
2687
2687
|
(T) => !c.has(T.name) || vs.has(T.name)
|
|
2688
2688
|
);
|
|
2689
|
-
const
|
|
2689
|
+
const b = i.description;
|
|
2690
2690
|
ue(t.name, s, i, P), P.docsTags.forEach((T) => {
|
|
2691
2691
|
c.add(T.name);
|
|
2692
|
-
}), i.description =
|
|
2692
|
+
}), i.description = b ?? i.description;
|
|
2693
2693
|
} else
|
|
2694
2694
|
i.description ||= P.description;
|
|
2695
2695
|
}
|
|
@@ -2697,15 +2697,15 @@ ${c}.componentOnReady().then(() => {
|
|
|
2697
2697
|
E.forEach((P) => {
|
|
2698
2698
|
if ($ ??= o.isGetAccessor(P) ? P : void 0, I ??= o.isSetAccessor(P) ? P : void 0, !("initializer" in P))
|
|
2699
2699
|
return;
|
|
2700
|
-
const
|
|
2701
|
-
l ||=
|
|
2702
|
-
}), y && $ !== void 0 && I !== void 0 && $.type?.getText() !== I.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${
|
|
2700
|
+
const b = P;
|
|
2701
|
+
l ||= b.modifiers?.some((T) => T.kind === o.SyntaxKind.ReadonlyKeyword) ?? !1, _t(b, i, b.getSourceFile());
|
|
2702
|
+
}), y && $ !== void 0 && I !== void 0 && $.type?.getText() !== I.parameters[0]?.type?.getText() && (i.getterType = { text: `typeof ${h.getText(this.file)}` });
|
|
2703
2703
|
}
|
|
2704
|
-
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((
|
|
2704
|
+
if (l && (i.readonly = !0, n || (i.docsOnlyReadonly = !0)), i.type.values && i.type.values.length > 0 && i.type.values?.every((h) => h.type === "boolean") && (i.default ? m && this.context.viteCommand === "build" && i.deprecated === void 0 && (Oe.loggedBooleanWarning || this.context.logLintWarning(
|
|
2705
2705
|
`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`
|
|
2706
2706
|
), Oe.loggedBooleanWarning = !0) : i.default = "false"), this.pairedSetter !== void 0 && !i.readonly) {
|
|
2707
|
-
const
|
|
2708
|
-
|
|
2707
|
+
const h = this.pairedSetter.parameters.at(0)?.type?.getText(this.file), v = t.type?.getText(this.file);
|
|
2708
|
+
h !== v && v !== void 0 && h !== void 0 && (i.getterType = { text: v });
|
|
2709
2709
|
}
|
|
2710
2710
|
this.copyDoc(this.copyDocDefinitions?.properties?.[i.name], i, this.apiComponent);
|
|
2711
2711
|
}
|
|
@@ -2837,17 +2837,17 @@ async function ta(e, t) {
|
|
|
2837
2837
|
t || (e.componentFilesPromise = xt(e, e.dir.srcComponents));
|
|
2838
2838
|
const i = await e.componentFilesPromise, n = await pa(e, i);
|
|
2839
2839
|
await e.componentStoriesPromise, e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2840
|
-
const s =
|
|
2840
|
+
const s = hn(n, e, !1);
|
|
2841
2841
|
e.privateApiJson = s;
|
|
2842
2842
|
const [r, a] = vn(s);
|
|
2843
2843
|
return e.apiJsonComponents = a, e.apiJson = r, s;
|
|
2844
2844
|
}
|
|
2845
2845
|
function ia(e, t, i) {
|
|
2846
|
-
const n = e.getSourceFile(t, i), s =
|
|
2846
|
+
const n = e.getSourceFile(t, i), s = hn([n], e, !0), r = s.modules[0];
|
|
2847
2847
|
{
|
|
2848
|
-
const f = vn(s)[0].modules[0], y = e.apiJson.modules.findIndex((v) => v.path === f.path),
|
|
2849
|
-
|
|
2850
|
-
(v) => !
|
|
2848
|
+
const f = vn(s)[0].modules[0], y = e.apiJson.modules.findIndex((v) => v.path === f.path), g = e.apiJson.modules[y], h = Array.from(e.apiJson.modules);
|
|
2849
|
+
h.splice(y, 1, f), e.apiJson = { ...e.apiJson, modules: h }, e.apiJsonComponents = e.apiJsonComponents.filter(
|
|
2850
|
+
(v) => !g.declarations.includes(v)
|
|
2851
2851
|
);
|
|
2852
2852
|
for (const v of f.declarations)
|
|
2853
2853
|
"customElement" in v && e.apiJsonComponents.push(v);
|
|
@@ -2862,12 +2862,12 @@ function ia(e, t, i) {
|
|
|
2862
2862
|
), m = [];
|
|
2863
2863
|
for (const f of r.declarations)
|
|
2864
2864
|
if ("customElement" in f) {
|
|
2865
|
-
const
|
|
2866
|
-
d ||=
|
|
2865
|
+
const g = p.find((h) => h.tagName === f.tagName) === void 0;
|
|
2866
|
+
d ||= g, m.push(f);
|
|
2867
2867
|
}
|
|
2868
2868
|
return d ||= m.length !== p.length, d ? void 0 : m;
|
|
2869
2869
|
}
|
|
2870
|
-
function
|
|
2870
|
+
function hn(e, t, i) {
|
|
2871
2871
|
const n = t.options.apiJson?.Extractor ?? Oe, r = new n(t, i).extract(e);
|
|
2872
2872
|
return t.options.apiJson?.afterCreate?.(r, i), r;
|
|
2873
2873
|
}
|
|
@@ -2952,14 +2952,14 @@ const mi = /\{@link ([^}]+)\}/gu, sa = (e, t) => (i, n) => {
|
|
|
2952
2952
|
throw Error(
|
|
2953
2953
|
`Failed to find which component is referenced by the following link in ${t.name}: ${i}. Make sure the link follows the pattern {@link ComponentClassName} or {@link ComponentClassName#propertyOrMethodOrEventName}.`
|
|
2954
2954
|
);
|
|
2955
|
-
const p = d.demos?.find((
|
|
2955
|
+
const p = d.demos?.find((g) => g.description === "Docs")?.url;
|
|
2956
2956
|
if (p === void 0)
|
|
2957
2957
|
throw Error(
|
|
2958
2958
|
`Failed to find documentation URL for ${c} in ${t.name}. Make sure the following Lumina configuration option is set: documentation.getComponentDocsUrl`
|
|
2959
2959
|
);
|
|
2960
2960
|
if (l === void 0)
|
|
2961
2961
|
return `[${a || d.name}](${p})`;
|
|
2962
|
-
if ((d.members.find((
|
|
2962
|
+
if ((d.members.find((g) => g.name === l) ?? d.events?.find((g) => g.name === l)) === void 0)
|
|
2963
2963
|
throw Error(
|
|
2964
2964
|
`Failed to find ${l} member in ${c}. Found it referenced by the following link in ${t.name}: ${i}. Make sure the link follows the pattern {@link ComponentClassName#propertyOrMethodOrEventName}.`
|
|
2965
2965
|
);
|
|
@@ -2972,7 +2972,7 @@ function ra(e, t, i, n) {
|
|
|
2972
2972
|
)), n > 0 && (e.start !== void 0 && (e.start += n), e.end !== void 0 && (e.end += n)), e.package !== void 0)
|
|
2973
2973
|
return n;
|
|
2974
2974
|
if (e.module?.startsWith("dist/components/") === !0)
|
|
2975
|
-
e.module =
|
|
2975
|
+
e.module = ge(e.module, "dist/components/", i);
|
|
2976
2976
|
else if (e.module === "index.js" && e.name) {
|
|
2977
2977
|
const s = t.get(e.name);
|
|
2978
2978
|
if (s !== void 0) {
|
|
@@ -3004,30 +3004,30 @@ async function Sn(e) {
|
|
|
3004
3004
|
return ve ??= ma(e), await ve;
|
|
3005
3005
|
}
|
|
3006
3006
|
function ua() {
|
|
3007
|
-
if (
|
|
3007
|
+
if (gt === void 0)
|
|
3008
3008
|
throw Error(
|
|
3009
|
-
|
|
3009
|
+
w(
|
|
3010
3010
|
"@arcgis/lumina:retrieveComponentDependencies",
|
|
3011
3011
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
3012
3012
|
)
|
|
3013
3013
|
);
|
|
3014
|
-
return
|
|
3014
|
+
return gt;
|
|
3015
3015
|
}
|
|
3016
|
-
function
|
|
3017
|
-
if (
|
|
3016
|
+
function bn() {
|
|
3017
|
+
if (ht === void 0)
|
|
3018
3018
|
throw Error(
|
|
3019
|
-
|
|
3019
|
+
w(
|
|
3020
3020
|
"@arcgis/lumina:retrieveFlatComponentDependencies",
|
|
3021
3021
|
"Component dependencies have not yet been initialized. Await componentDependenciesPromise promise first."
|
|
3022
3022
|
)
|
|
3023
3023
|
);
|
|
3024
|
-
return
|
|
3024
|
+
return ht;
|
|
3025
3025
|
}
|
|
3026
3026
|
async function ma(e) {
|
|
3027
3027
|
const t = R(e), i = t.dependencies ?? {}, n = t.peerDependencies ?? {}, r = (await Promise.all(
|
|
3028
|
-
[...Object.keys(i), ...Object.keys(n)].filter((a) => !fa.has(a)).flatMap(async (a) => await
|
|
3028
|
+
[...Object.keys(i), ...Object.keys(n)].filter((a) => !fa.has(a)).flatMap(async (a) => await wn(a, e))
|
|
3029
3029
|
)).filter(j);
|
|
3030
|
-
return
|
|
3030
|
+
return gt ??= r, ht = Object.fromEntries(r.flatMap((a) => Object.entries(a.components))), r;
|
|
3031
3031
|
}
|
|
3032
3032
|
const fa = /* @__PURE__ */ new Set([
|
|
3033
3033
|
"@arcgis/arcade-languageservice",
|
|
@@ -3065,11 +3065,11 @@ const fa = /* @__PURE__ */ new Set([
|
|
|
3065
3065
|
"vscode-languageserver-textdocument",
|
|
3066
3066
|
"vscode-languageserver-types"
|
|
3067
3067
|
]);
|
|
3068
|
-
let
|
|
3069
|
-
async function
|
|
3070
|
-
const i = await Be(e, t), n = await _e(i), s = "exports" in n, r =
|
|
3071
|
-
if (a ? await
|
|
3072
|
-
const y = await J(c, "utf8"),
|
|
3068
|
+
let gt, ht, ve;
|
|
3069
|
+
async function wn(e, t) {
|
|
3070
|
+
const i = await Be(e, t), n = await _e(i), s = "exports" in n, r = ba.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3071
|
+
if (a ? await U(c) : !1) {
|
|
3072
|
+
const y = await J(c, "utf8"), g = ya(y, "bootstrapLazy("), h = y.indexOf(", options", g), v = y.slice(g, h), S = v.startsWith('JSON.parse("') ? v.slice(12, -2).replaceAll('\\"', '"') : v;
|
|
3073
3073
|
try {
|
|
3074
3074
|
const E = JSON.parse(S), $ = va(E, { packageName: e, getImportPath: r });
|
|
3075
3075
|
return { packageName: e, type: "stencil", components: $ };
|
|
@@ -3080,23 +3080,23 @@ Error: ${String(E)}`);
|
|
|
3080
3080
|
}
|
|
3081
3081
|
const d = yi(n.customElements);
|
|
3082
3082
|
if (d != null) {
|
|
3083
|
-
const y = u.join(i, d),
|
|
3083
|
+
const y = u.join(i, d), g = JSON.parse(await J(y, "utf-8")), h = ga(g), v = Tn(g, {
|
|
3084
3084
|
packageName: e,
|
|
3085
3085
|
getImportPath: r
|
|
3086
3086
|
});
|
|
3087
|
-
return { type:
|
|
3087
|
+
return { type: h ? "@arcgis/lumina" : "unknown", packageName: e, components: v };
|
|
3088
3088
|
}
|
|
3089
3089
|
const p = yi(n["web-types"]);
|
|
3090
3090
|
if (p != null) {
|
|
3091
|
-
const y = u.join(i, p),
|
|
3091
|
+
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), h = ha(g, {
|
|
3092
3092
|
packageName: e,
|
|
3093
3093
|
getImportPath: r,
|
|
3094
3094
|
packageRoot: i
|
|
3095
3095
|
});
|
|
3096
|
-
return { type: "unknown", packageName: e, components:
|
|
3096
|
+
return { type: "unknown", packageName: e, components: h };
|
|
3097
3097
|
}
|
|
3098
3098
|
const m = u.join(i, "dist/components");
|
|
3099
|
-
if (await
|
|
3099
|
+
if (await U(m)) {
|
|
3100
3100
|
const y = await Sa(m, {
|
|
3101
3101
|
packageName: e,
|
|
3102
3102
|
getImportPath: r
|
|
@@ -3127,7 +3127,7 @@ function Tn(e, t) {
|
|
|
3127
3127
|
}
|
|
3128
3128
|
return i;
|
|
3129
3129
|
}
|
|
3130
|
-
const
|
|
3130
|
+
const ga = (e) => e.compiler?.name === At, ha = (e, t) => Object.fromEntries(
|
|
3131
3131
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
3132
3132
|
(i) => [
|
|
3133
3133
|
i.name,
|
|
@@ -3168,7 +3168,7 @@ const ha = (e) => e.compiler?.name === At, ga = (e, t) => Object.fromEntries(
|
|
|
3168
3168
|
}
|
|
3169
3169
|
];
|
|
3170
3170
|
})
|
|
3171
|
-
),
|
|
3171
|
+
), ba = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, wa = (e) => e.startsWith("/") ? e : `/${e}`, It = (e, t) => `${e}@fs${wa(t)}`;
|
|
3172
3172
|
function qe(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3173
3173
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3174
3174
|
if (s && n)
|
|
@@ -3188,7 +3188,7 @@ function Ea(e, t) {
|
|
|
3188
3188
|
return "next";
|
|
3189
3189
|
}
|
|
3190
3190
|
const Ca = ["keyed", "ref", "repeat", "live"], ae = "staticHtml", Z = "staticSvg", ce = "html", oe = "svg", En = Symbol("maybe HTML namespace or maybe SVG"), Cn = "css", $n = "mathml", Pn = [Cn, ce, $n, ae, Z, oe], $a = new Set(Pn), Pa = ["safeClassMap", "safeStyleMap", "deferLoad"], xa = "nothing", Aa = [...Ca, ...Pn, ...Pa, xa], Je = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e);
|
|
3191
|
-
function
|
|
3191
|
+
function gi(e, t, i) {
|
|
3192
3192
|
if (ne(e))
|
|
3193
3193
|
return e;
|
|
3194
3194
|
{
|
|
@@ -3283,13 +3283,13 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3283
3283
|
return [s.name, ...c];
|
|
3284
3284
|
const [d, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
3285
3285
|
if (r || m) {
|
|
3286
|
-
const f =
|
|
3286
|
+
const f = gi(
|
|
3287
3287
|
p,
|
|
3288
3288
|
e,
|
|
3289
3289
|
m ? "" : void 0
|
|
3290
|
-
),
|
|
3291
|
-
if (
|
|
3292
|
-
return [m ? `.${i}` : s.name, d,
|
|
3290
|
+
), g = i === "value" && (n === "input" || n === "textarea" || n === je) ? Da(f, e) : f;
|
|
3291
|
+
if (g !== p)
|
|
3292
|
+
return [m ? `.${i}` : s.name, d, g];
|
|
3293
3293
|
}
|
|
3294
3294
|
return [`.${i}`, ...c];
|
|
3295
3295
|
},
|
|
@@ -3299,7 +3299,7 @@ const ka = /* @__PURE__ */ new Set([
|
|
|
3299
3299
|
return [i];
|
|
3300
3300
|
if (n === !1)
|
|
3301
3301
|
return [];
|
|
3302
|
-
const s = Fe(e, t, !0), a = s[0] !== "=" ? s : [s[0],
|
|
3302
|
+
const s = Fe(e, t, !0), a = s[0] !== "=" ? s : [s[0], gi(s[1], e)];
|
|
3303
3303
|
return [i, ...a];
|
|
3304
3304
|
},
|
|
3305
3305
|
booleanAttribute(e, t, i) {
|
|
@@ -3412,10 +3412,10 @@ function Fe(e, t, i = !1) {
|
|
|
3412
3412
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3413
3413
|
);
|
|
3414
3414
|
if (o.isStringLiteral(t))
|
|
3415
|
-
return
|
|
3415
|
+
return hi(t, i);
|
|
3416
3416
|
if (o.isJsxExpression(t) && t.expression) {
|
|
3417
3417
|
if (o.isStringLiteral(t.expression))
|
|
3418
|
-
return
|
|
3418
|
+
return hi(t.expression, i);
|
|
3419
3419
|
if (i) {
|
|
3420
3420
|
if (o.isNumericLiteral(t.expression))
|
|
3421
3421
|
return [`=${t.expression.text}`];
|
|
@@ -3425,7 +3425,7 @@ function Fe(e, t, i = !1) {
|
|
|
3425
3425
|
}
|
|
3426
3426
|
return ["=", ...Nt(e, t, void 0)];
|
|
3427
3427
|
}
|
|
3428
|
-
function
|
|
3428
|
+
function hi(e, t) {
|
|
3429
3429
|
if (!t)
|
|
3430
3430
|
return ["=", e];
|
|
3431
3431
|
const i = e.text;
|
|
@@ -3621,7 +3621,7 @@ function Ha(e, t) {
|
|
|
3621
3621
|
return t;
|
|
3622
3622
|
const c = Se(n.body);
|
|
3623
3623
|
let l = !0, d;
|
|
3624
|
-
if (
|
|
3624
|
+
if (bi(c))
|
|
3625
3625
|
d = c;
|
|
3626
3626
|
else {
|
|
3627
3627
|
if (!o.isBlock(c))
|
|
@@ -3630,7 +3630,7 @@ function Ha(e, t) {
|
|
|
3630
3630
|
if (!(v && o.isReturnStatement(v) && v.expression))
|
|
3631
3631
|
return t;
|
|
3632
3632
|
const E = Se(v.expression);
|
|
3633
|
-
if (!
|
|
3633
|
+
if (!bi(E))
|
|
3634
3634
|
return t;
|
|
3635
3635
|
const $ = c.statements.slice(0, -1);
|
|
3636
3636
|
if ($.some(In))
|
|
@@ -3643,16 +3643,16 @@ function Ha(e, t) {
|
|
|
3643
3643
|
const f = p.attributes.properties[m];
|
|
3644
3644
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3645
3645
|
return t;
|
|
3646
|
-
const y = Lt(f.initializer, e.sourceFile),
|
|
3647
|
-
if (
|
|
3646
|
+
const y = Lt(f.initializer, e.sourceFile), g = Ua(r, n, y, l, e);
|
|
3647
|
+
if (g === void 0)
|
|
3648
3648
|
return t;
|
|
3649
3649
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
3650
|
-
const
|
|
3651
|
-
return o.factory.updateCallExpression(t, o.factory.createIdentifier(
|
|
3650
|
+
const h = e.importRenames.repeat;
|
|
3651
|
+
return o.factory.updateCallExpression(t, o.factory.createIdentifier(h), t.typeArguments, [
|
|
3652
3652
|
// From `items.map()` get `items`
|
|
3653
3653
|
t.expression.expression,
|
|
3654
3654
|
// (item)=>item.key
|
|
3655
|
-
o.factory.createArrowFunction(void 0, void 0, [
|
|
3655
|
+
o.factory.createArrowFunction(void 0, void 0, [g], void 0, void 0, y),
|
|
3656
3656
|
// Keep arrow as is, but remove the key prop from the JSX element
|
|
3657
3657
|
o.factory.updateArrowFunction(
|
|
3658
3658
|
n,
|
|
@@ -3665,7 +3665,7 @@ function Ha(e, t) {
|
|
|
3665
3665
|
)
|
|
3666
3666
|
]);
|
|
3667
3667
|
}
|
|
3668
|
-
const
|
|
3668
|
+
const bi = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e);
|
|
3669
3669
|
function In(e) {
|
|
3670
3670
|
if (o.isReturnStatement(e))
|
|
3671
3671
|
return !0;
|
|
@@ -3786,7 +3786,7 @@ function Xe(e, t) {
|
|
|
3786
3786
|
}
|
|
3787
3787
|
m.docsTags?.some((y) => y.name === "required") ? i.push(p.name) : n.push(p.name);
|
|
3788
3788
|
});
|
|
3789
|
-
const r =
|
|
3789
|
+
const r = wi(i), a = wi(n), c = [
|
|
3790
3790
|
r ? `Required<Pick<${e}, ${r}>>` : "",
|
|
3791
3791
|
a ? `Partial<Pick<${e}, ${a}>>` : "",
|
|
3792
3792
|
s ? `${e}SetterTypes` : ""
|
|
@@ -3794,7 +3794,7 @@ function Xe(e, t) {
|
|
|
3794
3794
|
type ${e}SetterTypes = ${e}["${Qi}"]` : "", d = c.filter(Boolean).join(", ");
|
|
3795
3795
|
return [d.length === 0 ? "" : `${d}, `, l];
|
|
3796
3796
|
}
|
|
3797
|
-
const
|
|
3797
|
+
const wi = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3798
3798
|
function q(e, t, i) {
|
|
3799
3799
|
if (Je(i))
|
|
3800
3800
|
return Nn(e, i);
|
|
@@ -3834,25 +3834,25 @@ function Dn(e, t) {
|
|
|
3834
3834
|
let m;
|
|
3835
3835
|
const f = [];
|
|
3836
3836
|
let y = !1;
|
|
3837
|
-
const
|
|
3837
|
+
const g = s.attributes.properties.flatMap((I) => {
|
|
3838
3838
|
if (o.isJsxSpreadAttribute(I))
|
|
3839
3839
|
throw Error(
|
|
3840
3840
|
`JSX spread attribute syntax is not supported. See alternatives: https://qawebgis.esri.com/components/lumina/jsx#spread-attributes
|
|
3841
3841
|
Found ${I.getText(e.sourceFile)}`
|
|
3842
3842
|
);
|
|
3843
|
-
const { name: P, initializer:
|
|
3843
|
+
const { name: P, initializer: b } = I;
|
|
3844
3844
|
if (o.isJsxNamespacedName(P))
|
|
3845
3845
|
throw Error(`JSX namespaced attributes are not supported. Found ${P.getText(e.sourceFile)}`);
|
|
3846
|
-
const T = P.text, L = ja(
|
|
3846
|
+
const T = P.text, L = ja(b), N = L?.propType ?? Ra(T, b, c);
|
|
3847
3847
|
p?.delete(T);
|
|
3848
|
-
const D = La[N](e, L?.initializer ??
|
|
3848
|
+
const D = La[N](e, L?.initializer ?? b, T, c);
|
|
3849
3849
|
if (D.length === 0)
|
|
3850
3850
|
return [];
|
|
3851
3851
|
const M = e.compiler.shouldMinifyJsx ? [" "] : Ba(xn(P, e));
|
|
3852
3852
|
return N === "key" ? (m = typeof D[0] == "object" && !Fn(P, e) ? D[0] : void 0, M.some(Ja) ? M : []) : N === "directives" || N === "ref" || T === "deferLoad" ? (y ||= N === "deferLoad", f.push(
|
|
3853
3853
|
...M,
|
|
3854
3854
|
...D.flatMap(
|
|
3855
|
-
(
|
|
3855
|
+
(H, K) => typeof H == "string" || K === 0 || typeof D[K - 1] == "string" ? H : [" ", H]
|
|
3856
3856
|
)
|
|
3857
3857
|
), []) : [...M, ...D];
|
|
3858
3858
|
});
|
|
@@ -3860,22 +3860,22 @@ Found ${I.getText(e.sourceFile)}`
|
|
|
3860
3860
|
"mustIncludeAllRequiredProperties",
|
|
3861
3861
|
e.sourceFile.fileName,
|
|
3862
3862
|
`Missing required properties for <${c}> }: ${Array.from(p).join(", ")}`
|
|
3863
|
-
), f.length > 0 &&
|
|
3863
|
+
), f.length > 0 && g.push(...f), typeof c == "string" && $t.has(c))
|
|
3864
3864
|
throw Error(
|
|
3865
3865
|
`JSX syntax for MathML elements is not yet supported. If you need it, please request it. Otherwise, use the \`math\` function from Lit directly. Tried to use the "${c}" element`
|
|
3866
3866
|
);
|
|
3867
3867
|
d && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3868
|
-
const
|
|
3869
|
-
if (
|
|
3868
|
+
const h = typeof c == "string" && Fr.has(c), v = Ne(i, e);
|
|
3869
|
+
if (h && v.parts.length > 0)
|
|
3870
3870
|
throw Error(
|
|
3871
3871
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
3872
3872
|
);
|
|
3873
3873
|
const S = (l === oe || l === Z) && v.parts.length === 0, E = [
|
|
3874
3874
|
"<",
|
|
3875
3875
|
typeof c == "string" ? c : r,
|
|
3876
|
-
...
|
|
3877
|
-
S ? `${
|
|
3878
|
-
], $ =
|
|
3876
|
+
...g,
|
|
3877
|
+
S ? `${g.length === 0 ? "" : " "}/>` : ">"
|
|
3878
|
+
], $ = h || S ? E : [
|
|
3879
3879
|
...E,
|
|
3880
3880
|
/**
|
|
3881
3881
|
* If parent was an HTML element (e.g. `<svg>`), but children are SVG
|
|
@@ -4001,7 +4001,7 @@ function ic(e, t) {
|
|
|
4001
4001
|
return r;
|
|
4002
4002
|
}
|
|
4003
4003
|
}
|
|
4004
|
-
const Rn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}),
|
|
4004
|
+
const Rn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), be = {
|
|
4005
4005
|
[ce]: ["lit-html", "lit/html.js", "lit"],
|
|
4006
4006
|
/**
|
|
4007
4007
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -4023,7 +4023,7 @@ const Rn = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), w
|
|
|
4023
4023
|
ref: ["lit-html/directives/ref.js", "lit/directives/ref.js"],
|
|
4024
4024
|
nothing: ["lit-html", "lit/html.js", "lit-element/lit-element.js", "lit", "@arcgis/lumina"]
|
|
4025
4025
|
}, Mn = Rn(
|
|
4026
|
-
Object.entries(
|
|
4026
|
+
Object.entries(be).flatMap(([e, t]) => t.map((i) => [i, e]))
|
|
4027
4027
|
), Dt = new Set(Object.keys(Mn));
|
|
4028
4028
|
function nc(e, t) {
|
|
4029
4029
|
const i = t.importClause, n = t.moduleSpecifier;
|
|
@@ -4050,7 +4050,7 @@ function nc(e, t) {
|
|
|
4050
4050
|
return t;
|
|
4051
4051
|
const c = Dt.has(n.text);
|
|
4052
4052
|
return a.elements.forEach((l) => {
|
|
4053
|
-
const d = (l.propertyName ?? l.name).text, p =
|
|
4053
|
+
const d = (l.propertyName ?? l.name).text, p = be[d];
|
|
4054
4054
|
if (c) {
|
|
4055
4055
|
if (p?.some((y) => y === n.text)) {
|
|
4056
4056
|
const y = On(d, s);
|
|
@@ -4061,7 +4061,7 @@ function nc(e, t) {
|
|
|
4061
4061
|
r && !l.isTypeOnly && m && f && e.importedFunctionComponentsFromModules.add(s);
|
|
4062
4062
|
}), t;
|
|
4063
4063
|
}
|
|
4064
|
-
const On = (e, t) => e === ce &&
|
|
4064
|
+
const On = (e, t) => e === ce && be.staticHtml.includes(t) ? ae : e === oe && be.staticSvg.includes(t) ? Z : e, sc = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4065
4065
|
function rc(e) {
|
|
4066
4066
|
return o.isImportDeclaration(e) ? oc(this, e) : e;
|
|
4067
4067
|
}
|
|
@@ -4091,7 +4091,7 @@ function oc(e, t) {
|
|
|
4091
4091
|
) : t;
|
|
4092
4092
|
}
|
|
4093
4093
|
function ac(e) {
|
|
4094
|
-
const t = Rn(Array.from(e.neededImports, (i) => [
|
|
4094
|
+
const t = Rn(Array.from(e.neededImports, (i) => [be[i][0], i]));
|
|
4095
4095
|
return Object.entries(t).map(
|
|
4096
4096
|
([i, n]) => o.factory.createImportDeclaration(
|
|
4097
4097
|
void 0,
|
|
@@ -4144,11 +4144,11 @@ function lc(e) {
|
|
|
4144
4144
|
}), [];
|
|
4145
4145
|
}
|
|
4146
4146
|
function dc(e, t, i) {
|
|
4147
|
-
const n =
|
|
4147
|
+
const n = bn()[t] ?? Kn(e)[t];
|
|
4148
4148
|
if (n === void 0) {
|
|
4149
4149
|
const s = Y(i);
|
|
4150
4150
|
throw Error(
|
|
4151
|
-
|
|
4151
|
+
w(
|
|
4152
4152
|
"@arcgis/lumina:resolveTagName",
|
|
4153
4153
|
`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()`
|
|
4154
4154
|
)
|
|
@@ -4173,7 +4173,7 @@ const uc = (e, t) => {
|
|
|
4173
4173
|
return e.statements;
|
|
4174
4174
|
const n = {
|
|
4175
4175
|
compiler: t.compiler,
|
|
4176
|
-
externalComponents:
|
|
4176
|
+
externalComponents: bn(),
|
|
4177
4177
|
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : Kn(t.compiler),
|
|
4178
4178
|
sourceFile: e,
|
|
4179
4179
|
transformationContext: t.transformation,
|
|
@@ -4238,7 +4238,7 @@ function yc(e, t, i) {
|
|
|
4238
4238
|
Array.from(t.entries()).map(
|
|
4239
4239
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4240
4240
|
Ve(n) ? o.factory.createStringLiteral(n) : n,
|
|
4241
|
-
|
|
4241
|
+
gc(s, i)
|
|
4242
4242
|
)
|
|
4243
4243
|
)
|
|
4244
4244
|
)
|
|
@@ -4246,7 +4246,7 @@ function yc(e, t, i) {
|
|
|
4246
4246
|
...e
|
|
4247
4247
|
];
|
|
4248
4248
|
}
|
|
4249
|
-
function
|
|
4249
|
+
function gc(e, t) {
|
|
4250
4250
|
let i = 0, n = !0;
|
|
4251
4251
|
const s = [], r = [];
|
|
4252
4252
|
for (const l of e.properties)
|
|
@@ -4288,7 +4288,7 @@ function hc(e, t) {
|
|
|
4288
4288
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4289
4289
|
]);
|
|
4290
4290
|
}
|
|
4291
|
-
function
|
|
4291
|
+
function hc(e, t, i, n, s) {
|
|
4292
4292
|
let r = -1, a = -1, c = -1;
|
|
4293
4293
|
t.options?.properties.forEach((f, y) => {
|
|
4294
4294
|
if (o.isSpreadAssignment(f))
|
|
@@ -4296,8 +4296,8 @@ function gc(e, t, i, n, s) {
|
|
|
4296
4296
|
`Spread property assignment is not allowed in @property() as that is not statically analyzable. Found ${f.getText(n)}`
|
|
4297
4297
|
);
|
|
4298
4298
|
if (o.isIdentifier(f.name)) {
|
|
4299
|
-
const
|
|
4300
|
-
|
|
4299
|
+
const g = f.name.text;
|
|
4300
|
+
g === "type" ? r = y : g === "attribute" ? a = y : g === "readOnly" && (c = y);
|
|
4301
4301
|
}
|
|
4302
4302
|
});
|
|
4303
4303
|
const l = s.attribute === void 0 && a === -1, d = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = vc(e, t, i, s, r), m = [
|
|
@@ -4310,7 +4310,7 @@ function gc(e, t, i, n, s) {
|
|
|
4310
4310
|
function vc(e, t, i, n, s) {
|
|
4311
4311
|
if (n.attribute === void 0)
|
|
4312
4312
|
return;
|
|
4313
|
-
const r =
|
|
4313
|
+
const r = bc(e), a = i.compiler.viteCommand === "serve" || r !== "Other" ? r : Sc(n.type.values);
|
|
4314
4314
|
return a === "Other" || n.readonly && (a !== "Boolean" || !n.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4315
4315
|
o.factory.createIdentifier("type"),
|
|
4316
4316
|
o.factory.createIdentifier(a)
|
|
@@ -4328,7 +4328,7 @@ function Sc(e) {
|
|
|
4328
4328
|
}
|
|
4329
4329
|
return "Other";
|
|
4330
4330
|
}
|
|
4331
|
-
function
|
|
4331
|
+
function bc(e) {
|
|
4332
4332
|
const t = e.type ?? (o.isSetAccessor(e) ? e.parameters[0].type : void 0);
|
|
4333
4333
|
if (t === void 0) {
|
|
4334
4334
|
if ("initializer" in e && e.initializer !== void 0) {
|
|
@@ -4345,7 +4345,7 @@ function wc(e) {
|
|
|
4345
4345
|
}
|
|
4346
4346
|
return "Other";
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function wc(e, t, i, n, s) {
|
|
4349
4349
|
if (t.modifiers === void 0)
|
|
4350
4350
|
return t;
|
|
4351
4351
|
let r = -1, a = -1;
|
|
@@ -4355,7 +4355,7 @@ function bc(e, t, i, n, s) {
|
|
|
4355
4355
|
d === "property" && (r = l), d === "state" && (a = l);
|
|
4356
4356
|
}
|
|
4357
4357
|
}), r !== -1) {
|
|
4358
|
-
const c = Tc(e, t, i, n), l = Ti(t, r, n), d =
|
|
4358
|
+
const c = Tc(e, t, i, n), l = Ti(t, r, n), d = hc(t, l, e, n, c);
|
|
4359
4359
|
let p = !1;
|
|
4360
4360
|
return s.set(c.name, d ?? o.factory.createObjectLiteralExpression()), p = !0, l.options = d, Ei(t, l, r, p);
|
|
4361
4361
|
} else if (a !== -1) {
|
|
@@ -4385,7 +4385,7 @@ function Tc(e, t, i, n) {
|
|
|
4385
4385
|
throw Error(
|
|
4386
4386
|
`Failed to statically determine the property name: ${t.getText(n)} in ${i} in ${n.fileName}`
|
|
4387
4387
|
);
|
|
4388
|
-
r.name = a, r.attribute ??=
|
|
4388
|
+
r.name = a, r.attribute ??= wt(a);
|
|
4389
4389
|
}
|
|
4390
4390
|
return r;
|
|
4391
4391
|
}
|
|
@@ -4520,7 +4520,7 @@ function $c(e, t, i, n, s) {
|
|
|
4520
4520
|
);
|
|
4521
4521
|
}
|
|
4522
4522
|
}
|
|
4523
|
-
return o.isPropertyDeclaration(t) || o.isAccessor(t) ?
|
|
4523
|
+
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? wc(e, t, i, n, s) : t;
|
|
4524
4524
|
}
|
|
4525
4525
|
const Pc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", vt = "@arcgis/core", ct = R(), Qe = vt in (ct.dependencies ?? {}) || vt in (ct.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
4526
4526
|
ct.name === "@arcgis/lumina";
|
|
@@ -4574,9 +4574,12 @@ function kc(e, t) {
|
|
|
4574
4574
|
"}",
|
|
4575
4575
|
e.slice(n),
|
|
4576
4576
|
Qe ? `
|
|
4577
|
-
import {createObservable,trackAccess} from "${Ac}/applications/Components/reactiveUtils.js";
|
|
4577
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${Ac}/applications/Components/reactiveUtils.js";
|
|
4578
|
+
createObservable,
|
|
4578
4579
|
runtime.t = trackAccess;
|
|
4579
|
-
runtime.o = createObservable
|
|
4580
|
+
runtime.o = createObservable;
|
|
4581
|
+
runtime.c = createTrackingTarget;
|
|
4582
|
+
runtime.r = runTracked;` : ""
|
|
4580
4583
|
].join(""),
|
|
4581
4584
|
map: null
|
|
4582
4585
|
};
|
|
@@ -4661,7 +4664,7 @@ function Nc(e) {
|
|
|
4661
4664
|
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : fs(t ?? "tsconfig.json");
|
|
4662
4665
|
if (i === void 0)
|
|
4663
4666
|
throw Error(
|
|
4664
|
-
|
|
4667
|
+
w(
|
|
4665
4668
|
"@arcgis/lumina:loadTypeScriptConfig",
|
|
4666
4669
|
`Unable to find ${Y(String(t))}. Please make sure the file exists, or provide types.tsconfigPath option to useLumina()`,
|
|
4667
4670
|
process.cwd()
|
|
@@ -4688,7 +4691,7 @@ function Bn(e) {
|
|
|
4688
4691
|
const t = e.target;
|
|
4689
4692
|
if (t === void 0)
|
|
4690
4693
|
throw Error(
|
|
4691
|
-
|
|
4694
|
+
w(
|
|
4692
4695
|
"@arcgis/lumina:resolveTargetVersion",
|
|
4693
4696
|
'TypeScript config must have a "target" property specified (or any parent tsconfig.json file if this config is extending another tsconfig.json)'
|
|
4694
4697
|
)
|
|
@@ -4722,7 +4725,7 @@ function Dc(e, t) {
|
|
|
4722
4725
|
}
|
|
4723
4726
|
async function jc(e, t, i) {
|
|
4724
4727
|
const n = u.resolve(e.dir.root, t);
|
|
4725
|
-
await
|
|
4728
|
+
await U(n) && await $s(n, { recursive: !0, force: !0 }), await z(n, { recursive: !0 }), await Ps(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4726
4729
|
const s = [
|
|
4727
4730
|
"index.html",
|
|
4728
4731
|
...await Ms("**/*.html", {
|
|
@@ -4740,20 +4743,20 @@ async function jc(e, t, i) {
|
|
|
4740
4743
|
if (typeof p == "string")
|
|
4741
4744
|
return `<${d.tag} ${Object.entries(d.attrs ?? {}).map(([m, f]) => `${m}="${f}"`).join(" ")}>${p}</${d.tag}>`;
|
|
4742
4745
|
}
|
|
4743
|
-
throw Error(
|
|
4746
|
+
throw Error(w("@arcgis/lumina:buildWebApp", `Unsupported loader type: ${JSON.stringify(d)}`));
|
|
4744
4747
|
}).join(`
|
|
4745
4748
|
`);
|
|
4746
4749
|
await Promise.all(
|
|
4747
4750
|
s.map(async (d, p) => {
|
|
4748
|
-
const f = p === 0 ? d : u.join(r, d), y = u.join(e.dir.root, f),
|
|
4749
|
-
await
|
|
4750
|
-
const
|
|
4751
|
+
const f = p === 0 ? d : u.join(r, d), y = u.join(e.dir.root, f), g = u.join(n, f);
|
|
4752
|
+
await z(u.dirname(g), { recursive: !0 });
|
|
4753
|
+
const h = await J(y, "utf-8"), v = ee(u.dirname(f), `build/${i}`), S = `${l}<script type="module" src="${v}"><\/script>
|
|
4751
4754
|
`;
|
|
4752
|
-
let E =
|
|
4753
|
-
if (E === -1 && (E =
|
|
4754
|
-
throw Error(
|
|
4755
|
-
const $ =
|
|
4756
|
-
await F(
|
|
4755
|
+
let E = h.indexOf("<style>");
|
|
4756
|
+
if (E === -1 && (E = h.indexOf("</head>")), E === -1)
|
|
4757
|
+
throw Error(w("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${y}`));
|
|
4758
|
+
const $ = h.slice(0, E) + S + h.slice(E);
|
|
4759
|
+
await F(g, $, "utf-8");
|
|
4757
4760
|
})
|
|
4758
4761
|
);
|
|
4759
4762
|
}
|
|
@@ -4770,7 +4773,7 @@ const _n = /* @__PURE__ */ new Set([
|
|
|
4770
4773
|
"collection",
|
|
4771
4774
|
"extras",
|
|
4772
4775
|
"support"
|
|
4773
|
-
]),
|
|
4776
|
+
]), _ = "@arcgis/lumina:buildCdn", jt = "cdn", Hn = "index", we = "main";
|
|
4774
4777
|
function Rc(e) {
|
|
4775
4778
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4776
4779
|
if (r) {
|
|
@@ -4789,24 +4792,24 @@ function Rc(e) {
|
|
|
4789
4792
|
{
|
|
4790
4793
|
type: "dynamic",
|
|
4791
4794
|
source: () => _o(e),
|
|
4792
|
-
destination: r ?
|
|
4795
|
+
destination: `../${r ? a : we}.css`
|
|
4793
4796
|
}
|
|
4794
4797
|
]), !t)
|
|
4795
4798
|
return {
|
|
4796
|
-
name:
|
|
4799
|
+
name: _,
|
|
4797
4800
|
async writeBundle() {
|
|
4798
4801
|
if (e.isInStorybook)
|
|
4799
4802
|
return;
|
|
4800
|
-
const c = Qe && R().name !== "@arcgis/embeddable-components", l = Date.now(), d =
|
|
4801
|
-
await
|
|
4802
|
-
|
|
4803
|
+
const c = Qe && R().name !== "@arcgis/embeddable-components", l = Date.now(), d = Array.isArray(n.entryPoints) ? n.entryPoints.map((f) => typeof f == "string" ? { in: f, out: "" } : f) : typeof n.entryPoints == "object" ? Object.entries(n.entryPoints).map(([f, y]) => ({ in: y, out: f })) : [], p = await Mc(e, a, n, d, c);
|
|
4804
|
+
await Oc(
|
|
4805
|
+
p,
|
|
4803
4806
|
e.dir.distCdn,
|
|
4804
4807
|
r ? `${a}.esm` : a,
|
|
4805
|
-
|
|
4808
|
+
d,
|
|
4806
4809
|
c
|
|
4807
4810
|
);
|
|
4808
|
-
const
|
|
4809
|
-
C.info(
|
|
4811
|
+
const m = Date.now();
|
|
4812
|
+
C.info(_, `CDN was built in ${m - l}ms`), s && await jc(e, s, `${r ? `${a}.esm` : a}.js`);
|
|
4810
4813
|
}
|
|
4811
4814
|
};
|
|
4812
4815
|
}
|
|
@@ -4814,15 +4817,15 @@ async function Mc(e, t, i, n, s) {
|
|
|
4814
4817
|
const r = e.environment;
|
|
4815
4818
|
if (i.minify && s)
|
|
4816
4819
|
throw Error(
|
|
4817
|
-
|
|
4818
|
-
|
|
4820
|
+
w(
|
|
4821
|
+
_,
|
|
4819
4822
|
"Unminified CDN build is not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4820
4823
|
)
|
|
4821
4824
|
);
|
|
4822
4825
|
if (i.sourcemap && s)
|
|
4823
4826
|
throw Error(
|
|
4824
|
-
|
|
4825
|
-
|
|
4827
|
+
w(
|
|
4828
|
+
_,
|
|
4826
4829
|
"Source maps in the CDN build are not yet supported - open a feature request with Lumina maintainers if it is needed"
|
|
4827
4830
|
)
|
|
4828
4831
|
);
|
|
@@ -4881,7 +4884,7 @@ async function Mc(e, t, i, n, s) {
|
|
|
4881
4884
|
namespace: "@arcgis/lumina:accessorSupport"
|
|
4882
4885
|
} : void 0
|
|
4883
4886
|
), a.onLoad({ filter: /^/, namespace: "@arcgis/lumina:accessorSupport" }, () => ({
|
|
4884
|
-
contents: "export const createObservable=undefined, trackAccess=undefined;",
|
|
4887
|
+
contents: "export const createObservable=undefined, trackAccess=undefined, createTrackingTarget=undefined, runTracked = undefined;",
|
|
4885
4888
|
loader: "js"
|
|
4886
4889
|
}));
|
|
4887
4890
|
}
|
|
@@ -4944,11 +4947,11 @@ function Kc(e, t) {
|
|
|
4944
4947
|
const s = [];
|
|
4945
4948
|
for (const r of t) {
|
|
4946
4949
|
if (r.in.includes("*")) {
|
|
4947
|
-
C.warn(
|
|
4950
|
+
C.warn(_, `$arcgis.import does not support wildcard imports, so ${r.in} will be ignored.`);
|
|
4948
4951
|
continue;
|
|
4949
4952
|
}
|
|
4950
4953
|
if (r.out.startsWith(".") || r.out.startsWith("/"))
|
|
4951
|
-
throw Error(
|
|
4954
|
+
throw Error(w(_, `CDN entrypoint path must not start with '.' or '/'. Found: ${r.out}`));
|
|
4952
4955
|
s.push(r.out);
|
|
4953
4956
|
}
|
|
4954
4957
|
i += `i=(a.importMap??={}).imports??={};"${s.join(",")}".split(",").map(e=>i[p+e+j]=i[p+e]=import.meta.resolve("./"+e+j));`;
|
|
@@ -4961,7 +4964,7 @@ function Kc(e, t) {
|
|
|
4961
4964
|
// Start loading from reactiveUtils the modules we need to enable integration.
|
|
4962
4965
|
// Store the promise on the runtime object so that the lazy loader awaits
|
|
4963
4966
|
// this before beginning hydration.
|
|
4964
|
-
'r.p=a.t(m=>{r.t=m.trackAccess;r.o=m.createObservable},"applications/Components/reactiveUtils")}',
|
|
4967
|
+
'r.p=a.t(m=>{r.t=m.trackAccess;r.o=m.createObservable;r.c=m.createTrackingTarget;r.r=m.runTracked},"applications/Components/reactiveUtils")}',
|
|
4965
4968
|
// We use `a` variable as a shorter alias to `$arcgis` to save bytes.
|
|
4966
4969
|
// We pass runtime as an argument rather than access it directly inside the
|
|
4967
4970
|
// closure to avoid possible collisions (in case runtime variable was
|
|
@@ -4977,14 +4980,14 @@ function Un(e, t) {
|
|
|
4977
4980
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4978
4981
|
let c = 0;
|
|
4979
4982
|
const l = e.code.matchAll(Wc);
|
|
4980
|
-
for (const
|
|
4981
|
-
const [T, L, N, D, M] =
|
|
4982
|
-
if (c !== 0 && c !==
|
|
4983
|
-
const K = e.code.slice(c,
|
|
4983
|
+
for (const b of l) {
|
|
4984
|
+
const [T, L, N, D, M] = b, H = M.startsWith(We);
|
|
4985
|
+
if (c !== 0 && c !== b.index) {
|
|
4986
|
+
const K = e.code.slice(c, b.index);
|
|
4984
4987
|
s.push(K), a.push([c, K.length, 0, ""]);
|
|
4985
4988
|
}
|
|
4986
|
-
if (c =
|
|
4987
|
-
a.push([
|
|
4989
|
+
if (c = b.index + T.length, H)
|
|
4990
|
+
a.push([b.index, T.length, 0, ""]), n.push(`"${qn(M.slice(We.length))}"`), i.push(L?.replaceAll(" as ", ":") ?? N ?? D ?? "");
|
|
4988
4991
|
else {
|
|
4989
4992
|
const K = zn(M, t), G = K?.isAsync === !0;
|
|
4990
4993
|
if (L !== void 0) {
|
|
@@ -4995,15 +4998,15 @@ function Un(e, t) {
|
|
|
4995
4998
|
}
|
|
4996
4999
|
if (G) {
|
|
4997
5000
|
const Ye = K.oldSingleExportName === void 0 ? `{${Pe.join(",")}}` : Pe[0].split(":")[1];
|
|
4998
|
-
a.push([
|
|
5001
|
+
a.push([b.index + 6, 0, L.length, Ye]);
|
|
4999
5002
|
}
|
|
5000
5003
|
} else if (N === void 0 && D === void 0)
|
|
5001
|
-
G && a.push([
|
|
5004
|
+
G && a.push([b.index + 6, 0, 0, ""]);
|
|
5002
5005
|
else {
|
|
5003
5006
|
if (G)
|
|
5004
5007
|
throw Error(
|
|
5005
|
-
|
|
5006
|
-
|
|
5008
|
+
w(
|
|
5009
|
+
_,
|
|
5007
5010
|
`Expected local import specifiers to use only named or side-effect import syntax. Found ${T}`
|
|
5008
5011
|
)
|
|
5009
5012
|
);
|
|
@@ -5017,30 +5020,30 @@ function Un(e, t) {
|
|
|
5017
5020
|
}
|
|
5018
5021
|
const d = Hc(r);
|
|
5019
5022
|
let p = e.code.slice(0, c);
|
|
5020
|
-
for (let
|
|
5021
|
-
const [T, L, N, D] = a[
|
|
5022
|
-
let M = L,
|
|
5023
|
+
for (let b = a.length - 1; b >= 0; b--) {
|
|
5024
|
+
const [T, L, N, D] = a[b];
|
|
5025
|
+
let M = L, H = "";
|
|
5023
5026
|
if (L === 0) {
|
|
5024
5027
|
const G = d();
|
|
5025
|
-
n.push(G),
|
|
5028
|
+
n.push(G), H = ` ${G} from`, D !== "" ? (M = N + 4, i.push(D)) : i.push("");
|
|
5026
5029
|
}
|
|
5027
|
-
p = p.slice(0, T) +
|
|
5030
|
+
p = p.slice(0, T) + H + p.slice(T + M);
|
|
5028
5031
|
}
|
|
5029
5032
|
const m = Bc.exec(e.code), f = m?.index ?? e.code.length;
|
|
5030
5033
|
let y = "";
|
|
5031
5034
|
if (m !== null) {
|
|
5032
|
-
const
|
|
5033
|
-
if (
|
|
5034
|
-
y = `return{${
|
|
5035
|
+
const b = m[1].split(",");
|
|
5036
|
+
if (b.length > 1)
|
|
5037
|
+
y = `return{${b.map((T) => {
|
|
5035
5038
|
const [L, N = L] = T.split(" as ");
|
|
5036
5039
|
return `${N}:${L}`;
|
|
5037
5040
|
}).join(",")}}`;
|
|
5038
5041
|
else {
|
|
5039
|
-
const [T, L = T] =
|
|
5042
|
+
const [T, L = T] = b[0].split(" as ");
|
|
5040
5043
|
e.oldSingleExportName = L, y = `return ${T}`;
|
|
5041
5044
|
}
|
|
5042
5045
|
}
|
|
5043
|
-
const
|
|
5046
|
+
const g = i.findLastIndex((b) => b.length > 0), h = i.slice(0, g + 1).join(","), S = `export default $arcgis.t(${i.length === 0 ? "_" : `([${h}])`}=>{`, E = n.join(","), $ = `${y}},${E})`;
|
|
5044
5047
|
let I = e.code.slice(c, f);
|
|
5045
5048
|
I = `${s.join("")}${I}`, I = xi(I, t);
|
|
5046
5049
|
const P = `${p}${S}${I}${$}`;
|
|
@@ -5052,9 +5055,9 @@ function zn(e, t) {
|
|
|
5052
5055
|
return;
|
|
5053
5056
|
const i = e.slice(2), n = t.get(i);
|
|
5054
5057
|
if (n === void 0)
|
|
5055
|
-
throw Error(
|
|
5058
|
+
throw Error(w(_, `Failed to find the ${e} module`));
|
|
5056
5059
|
if (n.isAsync === void 0 && Un(n, t), n.isAsync === void 0)
|
|
5057
|
-
throw Error(
|
|
5060
|
+
throw Error(w(_, `Failed to infer whether the ${e} module has top-level await`));
|
|
5058
5061
|
return n;
|
|
5059
5062
|
}
|
|
5060
5063
|
function xi(e, t) {
|
|
@@ -5151,7 +5154,7 @@ async function Xn(e) {
|
|
|
5151
5154
|
).then((s) => s.find(j)) : await Ai(e, n);
|
|
5152
5155
|
}
|
|
5153
5156
|
async function Ai(e, t) {
|
|
5154
|
-
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), [s, r] = await Promise.all([
|
|
5157
|
+
const i = u.join(e, t, `${t}.css`), n = u.join(e, t, "assets"), [s, r] = await Promise.all([U(i), U(n)]);
|
|
5155
5158
|
return s || r ? {
|
|
5156
5159
|
hasCss: s,
|
|
5157
5160
|
cdnName: t
|
|
@@ -5160,12 +5163,12 @@ async function Ai(e, t) {
|
|
|
5160
5163
|
async function Xc(e, t, i, n) {
|
|
5161
5164
|
const s = t.packageName, r = await Be(s), a = await _e(r), c = await Xn(u.join(r, "dist"));
|
|
5162
5165
|
if (i === "cdn") {
|
|
5163
|
-
const y = a.exports?.[`./${
|
|
5166
|
+
const y = a.exports?.[`./${we}.css`] === void 0, g = y ? c.cdnName : Hn;
|
|
5164
5167
|
return {
|
|
5165
5168
|
tag: "script",
|
|
5166
5169
|
attrs: {
|
|
5167
5170
|
type: "module",
|
|
5168
|
-
src: `${t.cdnUrl ?? qe(a, !0)}${
|
|
5171
|
+
src: `${t.cdnUrl ?? qe(a, !0)}${g}${y ? ".esm" : ""}.js`
|
|
5169
5172
|
}
|
|
5170
5173
|
};
|
|
5171
5174
|
}
|
|
@@ -5194,8 +5197,8 @@ function Qc(e) {
|
|
|
5194
5197
|
throw new Error(
|
|
5195
5198
|
`Package "${e.name}" does not have an "exports" field. All Lumina packages must include an "exports" field.`
|
|
5196
5199
|
);
|
|
5197
|
-
const i = Object.entries(t).filter(([s]) => u.extname(s) === ".css"), n = i.find(([, s]) => s === `./${
|
|
5198
|
-
return n ? n[0] : i.length > 0 ? i[0][0] : `./${
|
|
5200
|
+
const i = Object.entries(t).filter(([s]) => u.extname(s) === ".css"), n = i.find(([, s]) => s === `./${we}.css`);
|
|
5201
|
+
return n ? n[0] : i.length > 0 ? i[0][0] : `./${we}.css`;
|
|
5199
5202
|
}
|
|
5200
5203
|
async function Te(e) {
|
|
5201
5204
|
return e._loadersCache ??= Zc(e), await e._loadersCache;
|
|
@@ -5232,10 +5235,10 @@ async function Qn(e) {
|
|
|
5232
5235
|
const t = e.options?.serve?.extraDependencies ?? [];
|
|
5233
5236
|
return t.length === 0 ? [] : (e._serveOnlyDependencies ??= Promise.all(
|
|
5234
5237
|
t.map(async (i) => {
|
|
5235
|
-
const n = typeof i == "string" ? i : i.name, s = await
|
|
5238
|
+
const n = typeof i == "string" ? i : i.name, s = await wn(n);
|
|
5236
5239
|
if (s === void 0)
|
|
5237
5240
|
throw Error(
|
|
5238
|
-
|
|
5241
|
+
w(
|
|
5239
5242
|
"@arcgis/lumina:computeServeOnlyDependencies",
|
|
5240
5243
|
`Unable to resolve extra dependency "${n}". Make sure it is a valid Stencil or Lumina package.`
|
|
5241
5244
|
)
|
|
@@ -5266,7 +5269,7 @@ async function Yc(e) {
|
|
|
5266
5269
|
].join(`
|
|
5267
5270
|
`);
|
|
5268
5271
|
throw Error(
|
|
5269
|
-
|
|
5272
|
+
w(
|
|
5270
5273
|
"@arcgis/lumina:buildTestSetupFile",
|
|
5271
5274
|
`Unexpected loader type for the browser test environment: ${JSON.stringify(n)}`
|
|
5272
5275
|
)
|
|
@@ -5289,10 +5292,10 @@ function il(e) {
|
|
|
5289
5292
|
configResolved() {
|
|
5290
5293
|
a = u.join(e.dir.root, "src", "loader.ts"), c = Y(a);
|
|
5291
5294
|
},
|
|
5292
|
-
resolveId: (
|
|
5293
|
-
async load(
|
|
5294
|
-
const
|
|
5295
|
-
if (!(!
|
|
5295
|
+
resolveId: (g) => g === a || g === c ? a : void 0,
|
|
5296
|
+
async load(g) {
|
|
5297
|
+
const h = g.startsWith(Zn);
|
|
5298
|
+
if (!(!g.endsWith(".tsx") && g !== a && !h)) {
|
|
5296
5299
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5297
5300
|
r === void 0 && clearTimeout(n), r ??= ta(e, t).catch((S) => {
|
|
5298
5301
|
throw i = !0, S;
|
|
@@ -5300,39 +5303,39 @@ function il(e) {
|
|
|
5300
5303
|
const v = await r;
|
|
5301
5304
|
s ??= v;
|
|
5302
5305
|
}
|
|
5303
|
-
return
|
|
5306
|
+
return g === a ? Ho(e) : h ? await Yc(e) : void 0;
|
|
5304
5307
|
}
|
|
5305
5308
|
},
|
|
5306
5309
|
async writeBundle() {
|
|
5307
5310
|
e.isInStorybook || await F(u.join(e.dir.dist, "loader.d.ts"), Uo);
|
|
5308
5311
|
},
|
|
5309
|
-
async handleHotUpdate({ file:
|
|
5310
|
-
const S = await p(
|
|
5311
|
-
return S === void 0 ? void 0 : S ?
|
|
5312
|
+
async handleHotUpdate({ file: g, modules: h, read: v }) {
|
|
5313
|
+
const S = await p(g, v);
|
|
5314
|
+
return S === void 0 ? void 0 : S ? h : (m(), []);
|
|
5312
5315
|
},
|
|
5313
5316
|
/**
|
|
5314
5317
|
* If a component was added, removed or renamed, regenerate the api.json and
|
|
5315
5318
|
* invalidate loader.js, forcing a page reload
|
|
5316
5319
|
*/
|
|
5317
|
-
configureServer(
|
|
5320
|
+
configureServer(g) {
|
|
5318
5321
|
if (e.isInPuppeteerTestBackEnd)
|
|
5319
5322
|
return;
|
|
5320
|
-
e.isInTest &&
|
|
5323
|
+
e.isInTest && g.watcher.on("change", (v) => {
|
|
5321
5324
|
p(v, async () => await J(v, "utf8")).catch(
|
|
5322
5325
|
(S) => C.warn(l, v, String(S))
|
|
5323
5326
|
);
|
|
5324
|
-
}),
|
|
5327
|
+
}), g.watcher.on("add", h), g.watcher.on("unlink", h), g.watcher.on(
|
|
5325
5328
|
"addDir",
|
|
5326
5329
|
(v) => v.startsWith(e.dir.srcComponents) ? void xt(e, e.dir.srcComponents, v).then(
|
|
5327
5330
|
(S) => S.length > 0 ? m() : void 0
|
|
5328
5331
|
) : void 0
|
|
5329
|
-
),
|
|
5332
|
+
), g.watcher.on("unlinkDir", (v) => {
|
|
5330
5333
|
e.componentFiles.some((E) => E.startsWith(v)) && m();
|
|
5331
5334
|
});
|
|
5332
|
-
function
|
|
5333
|
-
|
|
5335
|
+
function h(v) {
|
|
5336
|
+
he(v, e.dir.srcComponents) && m();
|
|
5334
5337
|
}
|
|
5335
|
-
|
|
5338
|
+
g.watcher.on("change", () => {
|
|
5336
5339
|
if (!i)
|
|
5337
5340
|
return;
|
|
5338
5341
|
i = !1, n = setTimeout(() => m(!0), 1e3);
|
|
@@ -5342,13 +5345,13 @@ function il(e) {
|
|
|
5342
5345
|
e.typeScriptWatchProgram?.close();
|
|
5343
5346
|
}
|
|
5344
5347
|
};
|
|
5345
|
-
async function p(
|
|
5348
|
+
async function p(g, h) {
|
|
5346
5349
|
if (s === void 0)
|
|
5347
5350
|
return !1;
|
|
5348
5351
|
let v;
|
|
5349
5352
|
if (e.isInStorybook) {
|
|
5350
|
-
v = await
|
|
5351
|
-
const $ = e.typeScriptProgram.getSourceFile(
|
|
5353
|
+
v = await h();
|
|
5354
|
+
const $ = e.typeScriptProgram.getSourceFile(g);
|
|
5352
5355
|
if ($ === void 0)
|
|
5353
5356
|
return;
|
|
5354
5357
|
if (!($.text === v)) {
|
|
@@ -5366,24 +5369,24 @@ function il(e) {
|
|
|
5366
5369
|
]), clearTimeout(T);
|
|
5367
5370
|
}
|
|
5368
5371
|
}
|
|
5369
|
-
if (!
|
|
5372
|
+
if (!he(g, e.dir.srcComponents))
|
|
5370
5373
|
return;
|
|
5371
|
-
v ??= await
|
|
5372
|
-
const E = ia(e,
|
|
5374
|
+
v ??= await h();
|
|
5375
|
+
const E = ia(e, g, v);
|
|
5373
5376
|
if (E === void 0)
|
|
5374
5377
|
return !1;
|
|
5375
5378
|
for (const $ of E) {
|
|
5376
|
-
const I =
|
|
5379
|
+
const I = gn($);
|
|
5377
5380
|
e.server.ws.send({ type: "custom", event: "component-meta-update", data: I });
|
|
5378
5381
|
}
|
|
5379
5382
|
return f(), !0;
|
|
5380
5383
|
}
|
|
5381
|
-
function m(
|
|
5382
|
-
!
|
|
5384
|
+
function m(g = !1) {
|
|
5385
|
+
!g && s === void 0 || (s = void 0, r = void 0, f(), y());
|
|
5383
5386
|
}
|
|
5384
5387
|
function f() {
|
|
5385
|
-
const
|
|
5386
|
-
|
|
5388
|
+
const g = e.server.moduleGraph.getModuleById(a);
|
|
5389
|
+
g === void 0 ? (C.warn(l, "Failed to find HMR module for src/loader.ts"), e.server.moduleGraph.invalidateAll()) : e.server.moduleGraph.invalidateModule(g);
|
|
5387
5390
|
}
|
|
5388
5391
|
const y = () => e.server.ws.send({
|
|
5389
5392
|
type: "full-reload",
|
|
@@ -5394,14 +5397,14 @@ function il(e) {
|
|
|
5394
5397
|
const St = "@arcgis/lumina:provideAssets";
|
|
5395
5398
|
function fe(e, t, i = Mt) {
|
|
5396
5399
|
if (e.viteCommand !== "serve")
|
|
5397
|
-
throw Error(
|
|
5400
|
+
throw Error(w(St, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5398
5401
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5399
5402
|
if (t.forEach((r) => {
|
|
5400
5403
|
const a = es(r), c = is(e.dir, ts(a)), l = sl(e.viteConfig.base, c, e.dir.distCdn);
|
|
5401
5404
|
e.server.middlewares.use(l, (d, p, m) => {
|
|
5402
|
-
const f = rl(d.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source,
|
|
5405
|
+
const f = rl(d.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, g = u.join(c, f), h = i.find((v) => v.match(g, e));
|
|
5403
5406
|
return (typeof y == "function" ? Promise.resolve(y()) : J(y)).then((v) => {
|
|
5404
|
-
const S = (typeof y == "function" ? void 0 :
|
|
5407
|
+
const S = (typeof y == "function" ? void 0 : h?.transform(v.toString("utf8"), g, e)) ?? v;
|
|
5405
5408
|
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Os.lookup(f) || "application/octet-stream"), p.write(S), p.end();
|
|
5406
5409
|
}).catch((v) => {
|
|
5407
5410
|
(a.type !== "directory" || process.env.DEBUG) && C.warn(
|
|
@@ -5430,9 +5433,9 @@ async function Yn(e, t, i = Mt) {
|
|
|
5430
5433
|
)
|
|
5431
5434
|
);
|
|
5432
5435
|
} else if (s.type === "file")
|
|
5433
|
-
await
|
|
5436
|
+
await z(u.dirname(r), { recursive: !0 }), await Ii(s.source, r, i, e);
|
|
5434
5437
|
else if (s.type === "dynamic") {
|
|
5435
|
-
await
|
|
5438
|
+
await z(u.dirname(r), { recursive: !0 });
|
|
5436
5439
|
const a = await Promise.resolve(s.source());
|
|
5437
5440
|
await F(r, a);
|
|
5438
5441
|
}
|
|
@@ -5462,7 +5465,7 @@ function ts(e) {
|
|
|
5462
5465
|
if (e.source.endsWith(u.sep)) {
|
|
5463
5466
|
if (e.type === "file")
|
|
5464
5467
|
throw Error(
|
|
5465
|
-
|
|
5468
|
+
w(
|
|
5466
5469
|
St,
|
|
5467
5470
|
`Unexpectedly tried to provide an asset with type "file", whose source looks like a directory: ${Y(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 \\`
|
|
5468
5471
|
)
|
|
@@ -5492,7 +5495,7 @@ function sl(e, t, i) {
|
|
|
5492
5495
|
const ns = (e) => e.replaceAll("../", ""), rl = (e = "") => e.split("?")[0].split("#")[0];
|
|
5493
5496
|
async function ss(e) {
|
|
5494
5497
|
const t = new Set(e.map(u.dirname));
|
|
5495
|
-
await Promise.all(Array.from(t, async (i) => await
|
|
5498
|
+
await Promise.all(Array.from(t, async (i) => await z(i, { recursive: !0 })));
|
|
5496
5499
|
}
|
|
5497
5500
|
const ol = {
|
|
5498
5501
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
@@ -5523,10 +5526,10 @@ function al(e) {
|
|
|
5523
5526
|
};
|
|
5524
5527
|
}
|
|
5525
5528
|
async function cl(e) {
|
|
5526
|
-
const t =
|
|
5529
|
+
const t = U("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5527
5530
|
i.map(async (s) => {
|
|
5528
5531
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
5529
|
-
return await
|
|
5532
|
+
return await U(a) ? rs(a, r) : void 0;
|
|
5530
5533
|
})
|
|
5531
5534
|
);
|
|
5532
5535
|
return await t && n.push(os), n.filter(j);
|
|
@@ -5545,11 +5548,11 @@ function ll(e) {
|
|
|
5545
5548
|
if (e.isInStorybook)
|
|
5546
5549
|
return;
|
|
5547
5550
|
const i = R()?.name ?? e.options.build?.cdn?.namespace ?? u.basename(e.dir.root), n = `${i}/hydrate`, s = u.resolve(e.dir.root, t.path ?? "hydrate"), r = "index.d.ts", a = "index.js", c = "index.mjs", l = u.join(s, "index.d.ts"), d = u.join(s, "index.js"), p = u.join(s, "index.mjs"), m = ee(s, e.dir.dist), y = `${Array.from(
|
|
5548
|
-
new Set(e.apiJsonComponents.map((
|
|
5551
|
+
new Set(e.apiJsonComponents.map((g) => `import "${m}/${g.importPath}";`))
|
|
5549
5552
|
).join(`
|
|
5550
5553
|
`)}
|
|
5551
5554
|
export * from "@arcgis/lumina/stencilSsrCompatibility";`;
|
|
5552
|
-
await
|
|
5555
|
+
await z(s, { recursive: !0 }), await Promise.all([
|
|
5553
5556
|
F(
|
|
5554
5557
|
u.join(s, "package.json"),
|
|
5555
5558
|
`${JSON.stringify(
|
|
@@ -5599,18 +5602,18 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5599
5602
|
}
|
|
5600
5603
|
const n = i.writeBundle;
|
|
5601
5604
|
if (typeof n != "function")
|
|
5602
|
-
throw Error(
|
|
5605
|
+
throw Error(w(dt, "Expected vite:reporter to declare a writeBundle() function"));
|
|
5603
5606
|
i.writeBundle = async function(r, a) {
|
|
5604
5607
|
let c = 0, l = 0, d = 0, p = 0;
|
|
5605
5608
|
const m = console.log;
|
|
5606
5609
|
console.log = function(...y) {
|
|
5607
5610
|
if (m.apply(console, y), y.length === 1 && typeof y[0] == "string") {
|
|
5608
|
-
const [
|
|
5609
|
-
if (!
|
|
5611
|
+
const [g, h] = y[0].match(ul) ?? [];
|
|
5612
|
+
if (!g)
|
|
5610
5613
|
return;
|
|
5611
|
-
p || (p = y[0].slice(0, y[0].indexOf(
|
|
5612
|
-
const v = Number.parseFloat(
|
|
5613
|
-
|
|
5614
|
+
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(ml, "").length);
|
|
5615
|
+
const v = Number.parseFloat(g.replace(" kB", "").replaceAll(",", ""));
|
|
5616
|
+
h ? (d += Number.parseFloat(h.replace(" kB", "").replaceAll(",", "")), l += v) : c += v;
|
|
5614
5617
|
}
|
|
5615
5618
|
};
|
|
5616
5619
|
try {
|
|
@@ -5619,15 +5622,15 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5619
5622
|
console.log = m;
|
|
5620
5623
|
}
|
|
5621
5624
|
if (l > 0) {
|
|
5622
|
-
const y = d > 0 ? l : c,
|
|
5625
|
+
const y = d > 0 ? l : c, g = Ni(y), h = e.dir.relativeDist;
|
|
5623
5626
|
console.log(
|
|
5624
5627
|
[
|
|
5625
5628
|
Fi,
|
|
5626
|
-
|
|
5629
|
+
h,
|
|
5627
5630
|
pl,
|
|
5628
5631
|
"*",
|
|
5629
|
-
" ".repeat(p - `${
|
|
5630
|
-
|
|
5632
|
+
" ".repeat(p - `${h}*`.length - g.length),
|
|
5633
|
+
g,
|
|
5631
5634
|
Li,
|
|
5632
5635
|
d > 0 ? ` ${Fi}│ gzip: ${Ni(d)}${Li}` : ""
|
|
5633
5636
|
].join("")
|
|
@@ -5656,7 +5659,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5656
5659
|
loader: "src/loader.ts",
|
|
5657
5660
|
// Entrypoint for bundling used components only:
|
|
5658
5661
|
...await Zr(e)
|
|
5659
|
-
}, { loader:
|
|
5662
|
+
}, { loader: g, ...h } = y, v = e.environment === "development" || e.isInTest ? {
|
|
5660
5663
|
"process.env.ESRI_INTERNAL": "true"
|
|
5661
5664
|
} : void 0, S = !import.meta.url.includes("node_modules"), E = {
|
|
5662
5665
|
/**
|
|
@@ -5670,7 +5673,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5670
5673
|
* Exclude src/loader.ts since it's a dynamically created file that
|
|
5671
5674
|
* is not visible to dep-optimizer's ESBuild instance.
|
|
5672
5675
|
*/
|
|
5673
|
-
entries: Object.values(
|
|
5676
|
+
entries: Object.values(h),
|
|
5674
5677
|
/**
|
|
5675
5678
|
* We dynamically insert imports during the JSX to lit-html transformation.
|
|
5676
5679
|
* In order to have dependency pre-bundling work correctly, we need to tell
|
|
@@ -5712,7 +5715,7 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5712
5715
|
if (typeof l.setupFiles == "string" ? l.setupFiles = [...lt, l.setupFiles] : Array.isArray(l.setupFiles) ? l.setupFiles = [...lt, ...l.setupFiles] : l.setupFiles = [...lt], e.isInPuppeteerTestBackEnd) {
|
|
5713
5716
|
if (p?.enabled === !0)
|
|
5714
5717
|
throw Error(
|
|
5715
|
-
|
|
5718
|
+
w(Di, "Can't enable both Vitest browser mode and Puppeteer testing at the same time")
|
|
5716
5719
|
);
|
|
5717
5720
|
return {
|
|
5718
5721
|
test: {
|
|
@@ -5780,14 +5783,14 @@ const dt = "@arcgis/lumina:printTotalBuildSize", dl = (e) => ({
|
|
|
5780
5783
|
}
|
|
5781
5784
|
};
|
|
5782
5785
|
}
|
|
5783
|
-
}),
|
|
5786
|
+
}), gl = (e) => ({
|
|
5784
5787
|
name: "@arcgis/lumina:setAssetPath",
|
|
5785
5788
|
apply: () => e.viteCommand === "build",
|
|
5786
5789
|
config: (t) => ({
|
|
5787
5790
|
base: t.base ?? e.options.assets?.defaultPath ?? qe()
|
|
5788
5791
|
})
|
|
5789
5792
|
});
|
|
5790
|
-
function
|
|
5793
|
+
function hl(e = R()) {
|
|
5791
5794
|
const t = e.version ?? "0.0.1";
|
|
5792
5795
|
return Es(t);
|
|
5793
5796
|
}
|
|
@@ -5795,7 +5798,7 @@ const vl = (e) => `/*! ${e} */`, A = (e) => (t, i) => {
|
|
|
5795
5798
|
Object.defineProperty(t, i, {
|
|
5796
5799
|
get() {
|
|
5797
5800
|
throw Error(
|
|
5798
|
-
|
|
5801
|
+
w(
|
|
5799
5802
|
"@arcgis/lumina:context",
|
|
5800
5803
|
`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}`
|
|
5801
5804
|
)
|
|
@@ -5816,7 +5819,7 @@ const vl = (e) => `/*! ${e} */`, A = (e) => (t, i) => {
|
|
|
5816
5819
|
function de(e) {
|
|
5817
5820
|
if (u.isAbsolute(e))
|
|
5818
5821
|
throw Error(
|
|
5819
|
-
|
|
5822
|
+
w(
|
|
5820
5823
|
"@arcgis/lumina:context",
|
|
5821
5824
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5822
5825
|
)
|
|
@@ -5831,13 +5834,13 @@ const pe = {
|
|
|
5831
5834
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5832
5835
|
};
|
|
5833
5836
|
async function as(e, t, i, n, s = R()) {
|
|
5834
|
-
const r = Sl(e, i, n, s), a = u.join(t, "lumina.ts"), l = await
|
|
5837
|
+
const r = Sl(e, i, n, s), a = u.join(t, "lumina.ts"), l = await U(a) ? await J(a, "utf8") : "";
|
|
5835
5838
|
if (l === r)
|
|
5836
5839
|
return !1;
|
|
5837
5840
|
if (process.env.CI) {
|
|
5838
5841
|
const d = (p) => Array.from(p, (m) => m.codePointAt(0).toString(16).padStart(4, "0")).join(",");
|
|
5839
5842
|
throw Error(
|
|
5840
|
-
|
|
5843
|
+
w(
|
|
5841
5844
|
"@arcgis/lumina:updateLuminaTs",
|
|
5842
5845
|
`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:
|
|
5843
5846
|
|
|
@@ -5868,11 +5871,11 @@ declare module "@arcgis/lumina" {
|
|
|
5868
5871
|
interface ImportStencilElements extends ${r.map((m, f) => `JSX$${f}.IntrinsicElements`).join(", ")} {}
|
|
5869
5872
|
}`, l = n.devDependencies ?? {}, d = i === "preview" ? "matchers" : i === "webdriverio" ? "webdriverio" : "playwright";
|
|
5870
5873
|
return [
|
|
5871
|
-
|
|
5874
|
+
bl,
|
|
5872
5875
|
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5873
5876
|
n.name === "@arcgis/lumina" ? "" : `
|
|
5874
5877
|
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5875
|
-
t ?
|
|
5878
|
+
t ? wl : "",
|
|
5876
5879
|
l.vitest ? `
|
|
5877
5880
|
/// <reference types="vitest/config" />` : "",
|
|
5878
5881
|
l["@vitest/browser"] ? `
|
|
@@ -5886,7 +5889,7 @@ declare module "@arcgis/lumina" {
|
|
|
5886
5889
|
`
|
|
5887
5890
|
].join("");
|
|
5888
5891
|
}
|
|
5889
|
-
const
|
|
5892
|
+
const bl = `/**
|
|
5890
5893
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5891
5894
|
* Manual edits will be overwritten.
|
|
5892
5895
|
*
|
|
@@ -5894,7 +5897,7 @@ const wl = `/**
|
|
|
5894
5897
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5895
5898
|
*
|
|
5896
5899
|
* If you need to provide additional typings, create a separate file.
|
|
5897
|
-
*/`,
|
|
5900
|
+
*/`, wl = `
|
|
5898
5901
|
/// <reference types="@arcgis/core/interfaces" />`, De = "@arcgis/lumina:dependencySupport", cs = (e, t) => e.viteCommand === "serve" && /**
|
|
5899
5902
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5900
5903
|
* However, it is a bit buggy (see
|
|
@@ -5949,7 +5952,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5949
5952
|
return n.optimizableImports;
|
|
5950
5953
|
if ("cssHref" in n)
|
|
5951
5954
|
return [];
|
|
5952
|
-
throw Error(
|
|
5955
|
+
throw Error(w(De, `Unexpected loader type: ${JSON.stringify(n)}`));
|
|
5953
5956
|
});
|
|
5954
5957
|
e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
|
|
5955
5958
|
},
|
|
@@ -5996,16 +5999,16 @@ async function $l(e, t) {
|
|
|
5996
5999
|
c === void 0 && (c = [], i.set(a, c));
|
|
5997
6000
|
const l = [];
|
|
5998
6001
|
for (const d of r.matchAll(xl)) {
|
|
5999
|
-
const p = d[1], m = Ll(p), f = r.indexOf("{", d.index), y = r.indexOf("}", f),
|
|
6000
|
-
let
|
|
6001
|
-
if (
|
|
6002
|
-
const E =
|
|
6003
|
-
|
|
6002
|
+
const p = d[1], m = Ll(p), f = r.indexOf("{", d.index), y = r.indexOf("}", f), g = r.slice(0, d.index).trimEnd();
|
|
6003
|
+
let h = "";
|
|
6004
|
+
if (g.endsWith("*/")) {
|
|
6005
|
+
const E = g.lastIndexOf("/**");
|
|
6006
|
+
h = g.slice(E + 3, -2).trim().replaceAll(kl, "");
|
|
6004
6007
|
}
|
|
6005
6008
|
const v = r.slice(f, y).match(Al)?.[1] || m, S = Il(m);
|
|
6006
6009
|
l.push({
|
|
6007
|
-
description: `${v}${
|
|
6008
|
-
${
|
|
6010
|
+
description: `${v}${h ? `
|
|
6011
|
+
${h}` : ""}`,
|
|
6009
6012
|
url: `${t}?path=/story/${a}--${S}&singleStory=true`
|
|
6010
6013
|
});
|
|
6011
6014
|
}
|
|
@@ -6059,7 +6062,7 @@ class x {
|
|
|
6059
6062
|
distCdnAssets: y
|
|
6060
6063
|
}, C.initialize(s.logger, a), s.root !== Ki())
|
|
6061
6064
|
throw Error(
|
|
6062
|
-
|
|
6065
|
+
w(
|
|
6063
6066
|
ie,
|
|
6064
6067
|
"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."
|
|
6065
6068
|
)
|
|
@@ -6071,9 +6074,9 @@ class x {
|
|
|
6071
6074
|
ie,
|
|
6072
6075
|
"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."
|
|
6073
6076
|
), this.isInStorybook = s.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(s.server?.hmr ?? !0);
|
|
6074
|
-
const
|
|
6075
|
-
this.isFullApiExtraction && typeof
|
|
6076
|
-
this.componentStories =
|
|
6077
|
+
const g = this.options.documentation?.publicStoryUrlPrefix;
|
|
6078
|
+
this.isFullApiExtraction && typeof g == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await $l(this.componentStoryFiles, g)).then((h) => {
|
|
6079
|
+
this.componentStories = h;
|
|
6077
6080
|
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0), Dc(this, s.build.sourcemap !== !1), cs(this) && Te(this);
|
|
6078
6081
|
}
|
|
6079
6082
|
},
|
|
@@ -6092,7 +6095,7 @@ class x {
|
|
|
6092
6095
|
vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? de(i.vsCode.htmlFileName) : pe.vsCodeHtml,
|
|
6093
6096
|
vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? de(i.vsCode.cssFileName) : pe.vsCodeCss
|
|
6094
6097
|
}, Sn(), this.componentFilesPromise = xt(this, u.resolve("src/components")), Nc(this);
|
|
6095
|
-
const n = t.build?.preamble ??
|
|
6098
|
+
const n = t.build?.preamble ?? hl();
|
|
6096
6099
|
this.banner = vl(n);
|
|
6097
6100
|
}
|
|
6098
6101
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
@@ -6115,7 +6118,7 @@ class x {
|
|
|
6115
6118
|
return n;
|
|
6116
6119
|
} else {
|
|
6117
6120
|
if (this.viteCommand === "build" || this.isInStorybook)
|
|
6118
|
-
throw Error(
|
|
6121
|
+
throw Error(w(ie, t, "Unable to find the TypeScript source file"));
|
|
6119
6122
|
{
|
|
6120
6123
|
const r = this._typeScriptSourceFiles.get(t);
|
|
6121
6124
|
r !== void 0 && r.text === i && (n = r);
|
|
@@ -6163,7 +6166,7 @@ class x {
|
|
|
6163
6166
|
n === "serve" && fe(this, t, i);
|
|
6164
6167
|
else
|
|
6165
6168
|
throw Error(
|
|
6166
|
-
|
|
6169
|
+
w(
|
|
6167
6170
|
ie,
|
|
6168
6171
|
"It is too late to call provideAssets() as Vite already wrote the bundle to disk. Please call provideAssets() before Vite's writeBundle()"
|
|
6169
6172
|
)
|
|
@@ -6256,7 +6259,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6256
6259
|
apply: () => e.viteCommand === "build",
|
|
6257
6260
|
generateBundle(t, i) {
|
|
6258
6261
|
Object.entries(i).forEach(([n, s]) => {
|
|
6259
|
-
const r =
|
|
6262
|
+
const r = ge(n, "components/", e);
|
|
6260
6263
|
if (r !== n && (s.fileName = r), s.type === "chunk") {
|
|
6261
6264
|
const a = u.dirname(u.join(e.dir.dist, n)), c = r === n ? a : u.dirname(u.join(e.dir.dist, r));
|
|
6262
6265
|
s.code = zi(s.code, e, c, a);
|
|
@@ -6267,7 +6270,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6267
6270
|
if (e.isInStorybook)
|
|
6268
6271
|
return;
|
|
6269
6272
|
const t = e._customElementDependencies, i = Object.entries(t), n = new Set(
|
|
6270
|
-
i.map(([r]) => r).filter((r) =>
|
|
6273
|
+
i.map(([r]) => r).filter((r) => he(r, e.dir.srcComponents))
|
|
6271
6274
|
);
|
|
6272
6275
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: l }]) => {
|
|
6273
6276
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
@@ -6278,7 +6281,7 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6278
6281
|
}), (a.length > 0 || c.length > 0) && d.length === 0) {
|
|
6279
6282
|
const p = Y(r);
|
|
6280
6283
|
throw Error(
|
|
6281
|
-
|
|
6284
|
+
w(
|
|
6282
6285
|
pt,
|
|
6283
6286
|
`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.`
|
|
6284
6287
|
)
|
|
@@ -6288,24 +6291,24 @@ const pt = "@arcgis/lumina:addNonLazyImports", Nl = (e) => ({
|
|
|
6288
6291
|
const s = i.flatMap(([r, { referencedTagNames: a, referencedDeferredTagNames: c }]) => {
|
|
6289
6292
|
if (!n.has(r))
|
|
6290
6293
|
return [];
|
|
6291
|
-
const l = u.dirname(r), d =
|
|
6292
|
-
function m(
|
|
6293
|
-
const T = pc(dc(e,
|
|
6294
|
+
const l = u.dirname(r), d = ge(l, e.dir.srcComponents, e), p = u.relative(e.dir.src, d);
|
|
6295
|
+
function m(b) {
|
|
6296
|
+
const T = pc(dc(e, b, r), p);
|
|
6294
6297
|
if (T !== `./${p}`)
|
|
6295
6298
|
return T.startsWith(".") ? `${T}/${ji}` : T;
|
|
6296
6299
|
}
|
|
6297
|
-
const f = new Set(a), y = new Set(c),
|
|
6298
|
-
`, v =
|
|
6299
|
-
const T = m(
|
|
6300
|
+
const f = new Set(a), y = new Set(c), g = Array.from(f, m).filter(j), h = (b) => `import "${b}";
|
|
6301
|
+
`, v = g.map(h).join(""), S = /* @__PURE__ */ new Set(), E = Array.from(y, (b) => {
|
|
6302
|
+
const T = m(b);
|
|
6300
6303
|
if (T !== void 0) {
|
|
6301
|
-
if (f.has(
|
|
6304
|
+
if (f.has(b)) {
|
|
6302
6305
|
C.warn(
|
|
6303
6306
|
pt,
|
|
6304
|
-
`"${
|
|
6307
|
+
`"${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.`
|
|
6305
6308
|
);
|
|
6306
6309
|
return;
|
|
6307
6310
|
}
|
|
6308
|
-
return S.add(
|
|
6311
|
+
return S.add(h(T)), `.set("${b}", () => import("${T}"))
|
|
6309
6312
|
`;
|
|
6310
6313
|
}
|
|
6311
6314
|
}).filter(j), $ = `${v}export * from "./${Tt}";`, I = Array.from(S).join("") + $, P = E.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
|
|
@@ -6337,12 +6340,12 @@ function Ri(e) {
|
|
|
6337
6340
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
6338
6341
|
}), t.length > 0 && i.push({ assets: t }), e.assetsToProvide = void 0, i;
|
|
6339
6342
|
}
|
|
6340
|
-
const
|
|
6341
|
-
name:
|
|
6343
|
+
const bt = "@arcgis/lumina:updatePackageJson", Rl = (e) => ({
|
|
6344
|
+
name: bt,
|
|
6342
6345
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
6343
6346
|
configResolved() {
|
|
6344
6347
|
Ml(e).catch(
|
|
6345
|
-
(t) => C.error(
|
|
6348
|
+
(t) => C.error(bt, `Failed to update package's package.json:${String(t)}`)
|
|
6346
6349
|
);
|
|
6347
6350
|
}
|
|
6348
6351
|
});
|
|
@@ -6354,7 +6357,7 @@ function Ol(e, t) {
|
|
|
6354
6357
|
const i = e?.devDependencies ?? {};
|
|
6355
6358
|
Object.keys(e?.peerDependencies ?? {}).forEach((d) => {
|
|
6356
6359
|
d in i || C.warn(
|
|
6357
|
-
|
|
6360
|
+
bt,
|
|
6358
6361
|
`Every peerDependency should also be a devDependency, or else some tools will get confused (like Turbo Build). Found "${d}" that is not a devDependency. Please edit your package.json`
|
|
6359
6362
|
);
|
|
6360
6363
|
});
|
|
@@ -6376,9 +6379,12 @@ function Ol(e, t) {
|
|
|
6376
6379
|
const d = s(r.webTypes);
|
|
6377
6380
|
e["web-types"] !== d && (n = !0, e["web-types"] = d);
|
|
6378
6381
|
}
|
|
6379
|
-
const a = `./${
|
|
6382
|
+
const a = `./${we}.css`, c = t.options.build?.cdn?.namespace !== void 0, l = ee(
|
|
6383
|
+
t.dir.root,
|
|
6384
|
+
u.join(t.dir.distCdn, a)
|
|
6385
|
+
);
|
|
6380
6386
|
if (!c) {
|
|
6381
|
-
e.exports?.[a]
|
|
6387
|
+
e.exports?.[a] !== l && (e.exports ??= {}, e.exports[a] = l, n = !0);
|
|
6382
6388
|
const d = e.name.split("/").length > 1 ? e.name.split("/")[1] : e.name;
|
|
6383
6389
|
for (const p of Object.keys(e.exports))
|
|
6384
6390
|
p.endsWith(`${d}.css`) && e.exports[p] !== l && (e.exports[p] = l, n = !0);
|
|
@@ -6604,7 +6610,7 @@ const Yl = (e) => e.map((t) => ({
|
|
|
6604
6610
|
properties: ed(t),
|
|
6605
6611
|
events: Mi(t)
|
|
6606
6612
|
}
|
|
6607
|
-
})), ed = (e) => e.members.filter(
|
|
6613
|
+
})), ed = (e) => e.members.filter(bs).map((t) => ({
|
|
6608
6614
|
name: t.name,
|
|
6609
6615
|
description: t.description,
|
|
6610
6616
|
type: t.type?.text
|
|
@@ -6810,9 +6816,9 @@ function yd({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
|
6810
6816
|
r
|
|
6811
6817
|
].join("");
|
|
6812
6818
|
}
|
|
6813
|
-
const
|
|
6819
|
+
const gd = (e, t, i) => [i, t, hd(e), vd(e)].join(`
|
|
6814
6820
|
|
|
6815
|
-
`),
|
|
6821
|
+
`), hd = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6816
6822
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6817
6823
|
detail: T;
|
|
6818
6824
|
target: HTML${t}Element;
|
|
@@ -6851,7 +6857,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6851
6857
|
}`
|
|
6852
6858
|
].join("");
|
|
6853
6859
|
}
|
|
6854
|
-
function
|
|
6860
|
+
function bd(e) {
|
|
6855
6861
|
let t;
|
|
6856
6862
|
return {
|
|
6857
6863
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6863,14 +6869,14 @@ function wd(e) {
|
|
|
6863
6869
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6864
6870
|
e._declarationTextTransformers.push((n) => {
|
|
6865
6871
|
const { filePath: s, content: r } = n;
|
|
6866
|
-
return s === i ? { filePath: s, content:
|
|
6872
|
+
return s === i ? { filePath: s, content: gd(e.apiJsonComponents, r, t) } : n;
|
|
6867
6873
|
});
|
|
6868
6874
|
},
|
|
6869
6875
|
async writeBundle() {
|
|
6870
6876
|
if (e.isInStorybook)
|
|
6871
6877
|
return;
|
|
6872
6878
|
const i = u.join(e.dir.dist, "types");
|
|
6873
|
-
await
|
|
6879
|
+
await z(i);
|
|
6874
6880
|
const n = `/// <reference types="../index.d.ts" />
|
|
6875
6881
|
${t.replaceAll("./", "../")}`, s = Object.entries({
|
|
6876
6882
|
react: ud(e.apiJsonComponents),
|
|
@@ -6885,7 +6891,7 @@ ${a}`)
|
|
|
6885
6891
|
}
|
|
6886
6892
|
};
|
|
6887
6893
|
}
|
|
6888
|
-
function
|
|
6894
|
+
function wd(e) {
|
|
6889
6895
|
return {
|
|
6890
6896
|
name: "@arcgis/lumina:buildWrappers",
|
|
6891
6897
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
@@ -6912,7 +6918,7 @@ async function Cd(e, t) {
|
|
|
6912
6918
|
for (const c of a.declarations)
|
|
6913
6919
|
"customElement" in c && n.push($d(c));
|
|
6914
6920
|
const s = [`/// <reference types="${i}" preserve="true" />`, Ed, ...n].join(""), r = u.resolve(t.proxiesFile);
|
|
6915
|
-
await
|
|
6921
|
+
await z(u.dirname(r), { recursive: !0 }), await F(r, s);
|
|
6916
6922
|
}
|
|
6917
6923
|
function $d(e) {
|
|
6918
6924
|
const t = e.events?.map(
|
|
@@ -6934,11 +6940,11 @@ function Kd(e = {}) {
|
|
|
6934
6940
|
const t = new x(e), i = [
|
|
6935
6941
|
t._plugin,
|
|
6936
6942
|
yl(t),
|
|
6937
|
-
|
|
6943
|
+
gl(t),
|
|
6938
6944
|
Rl(t),
|
|
6939
6945
|
Ir(t),
|
|
6940
6946
|
il(t),
|
|
6941
|
-
|
|
6947
|
+
bd(t),
|
|
6942
6948
|
ad(t),
|
|
6943
6949
|
Lc(t),
|
|
6944
6950
|
Io(t),
|
|
@@ -6951,7 +6957,7 @@ function Kd(e = {}) {
|
|
|
6951
6957
|
// Deprecated feature will be dropped in https://devtopia.esri.com/WebGIS/arcgis-web-components/issues/2765
|
|
6952
6958
|
// eslint-disable-next-line @typescript-eslint/no-deprecated
|
|
6953
6959
|
ll(t),
|
|
6954
|
-
|
|
6960
|
+
wd(t),
|
|
6955
6961
|
dl(t)
|
|
6956
6962
|
].filter(j);
|
|
6957
6963
|
return i.context = t, i;
|