@arcgis/lumina-compiler 4.34.0-next.100 → 4.34.0-next.102
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/LICENSE.md +1 -1
- package/README.md +2 -14
- package/dist/index.js +494 -494
- package/dist/jsxToLitHtml/types.d.ts +2 -0
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { externalizeDependencies as cs, path as u, toSystemPathSeparators as te, retrievePackageJson as R, fetchPackageLocation as Fi, asyncRetrievePackageJson as Ni, existsAsync as _, findPath as ls, toPosixPathSeparators as
|
|
1
|
+
import { externalizeDependencies as cs, path as u, toSystemPathSeparators as te, retrievePackageJson as R, fetchPackageLocation as Fi, asyncRetrievePackageJson as Ni, existsAsync as _, findPath as ls, toPosixPathSeparators as je, isPosix as Di, getCwd as ji } from "@arcgis/components-build-utils";
|
|
2
2
|
import ds from "vite-plugin-dts";
|
|
3
3
|
import o from "typescript";
|
|
4
4
|
import { f as T, l as E } from "./logger-KpGU2b3R.js";
|
|
@@ -484,7 +484,7 @@ function zt(e, t, i) {
|
|
|
484
484
|
const yr = /(?<=this.)[\w$]+/gu;
|
|
485
485
|
function hr(e) {
|
|
486
486
|
if (o.setEmitFlags(e, o.EmitFlags.NoComments), o.isPropertyDeclaration(e)) {
|
|
487
|
-
const t =
|
|
487
|
+
const t = Le(e.modifiers);
|
|
488
488
|
if (t !== e.modifiers)
|
|
489
489
|
return o.factory.updatePropertyDeclaration(
|
|
490
490
|
e,
|
|
@@ -495,7 +495,7 @@ function hr(e) {
|
|
|
495
495
|
e.initializer
|
|
496
496
|
);
|
|
497
497
|
} else if (o.isGetAccessor(e)) {
|
|
498
|
-
const t =
|
|
498
|
+
const t = Le(e.modifiers);
|
|
499
499
|
if (t !== e.modifiers)
|
|
500
500
|
return o.factory.updateGetAccessorDeclaration(
|
|
501
501
|
e,
|
|
@@ -506,11 +506,11 @@ function hr(e) {
|
|
|
506
506
|
e.body
|
|
507
507
|
);
|
|
508
508
|
} else if (o.isSetAccessor(e)) {
|
|
509
|
-
const t =
|
|
509
|
+
const t = Le(e.modifiers);
|
|
510
510
|
if (t !== e.modifiers)
|
|
511
511
|
return o.factory.updateSetAccessorDeclaration(e, t, e.name, e.parameters, e.body);
|
|
512
512
|
} else if (o.isMethodDeclaration(e)) {
|
|
513
|
-
const t =
|
|
513
|
+
const t = Le(e.modifiers);
|
|
514
514
|
if (t !== e.modifiers)
|
|
515
515
|
return o.factory.updateMethodDeclaration(
|
|
516
516
|
e,
|
|
@@ -529,7 +529,7 @@ function hr(e) {
|
|
|
529
529
|
function qt(e) {
|
|
530
530
|
return e?.some((i) => i.kind === o.SyntaxKind.ReadonlyKeyword) ? e : [o.factory.createModifier(o.SyntaxKind.ReadonlyKeyword), ...e ?? []];
|
|
531
531
|
}
|
|
532
|
-
function
|
|
532
|
+
function Le(e) {
|
|
533
533
|
return e?.some((i) => i.kind === o.SyntaxKind.PrivateKeyword) ? e : [
|
|
534
534
|
o.factory.createModifier(o.SyntaxKind.PrivateKeyword),
|
|
535
535
|
...(e ?? []).filter(
|
|
@@ -674,7 +674,7 @@ function $r(e) {
|
|
|
674
674
|
}
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
|
-
const Pr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag",
|
|
677
|
+
const Pr = "Fragment", tt = "DynamicHtmlTag", it = "DynamicSvgTag", Je = Symbol("dynamic html tag name"), ft = Symbol("dynamic svg tag name"), qi = /* @__PURE__ */ new Set([
|
|
678
678
|
/**
|
|
679
679
|
* There is a "className" property. However, in JSX typings we use "class"
|
|
680
680
|
* instead to keep name shorter and to match Stencil's name. Thus, it should
|
|
@@ -1798,7 +1798,7 @@ function Mr(e) {
|
|
|
1798
1798
|
}
|
|
1799
1799
|
return t.length === 0 ? void 0 : t;
|
|
1800
1800
|
}
|
|
1801
|
-
const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\*? ?/gu, Kr = ["keyed", "ref", "repeat", "live"], le = "staticHtml", Z = "staticSvg", de = "html", oe = "svg", Zi = Symbol("maybe HTML namespace or maybe SVG"), Yi = "css", en = "mathml", tn = [Yi, de, en, le, Z, oe], Br = new Set(tn), Wr = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], _r = "nothing", Ur = [...Kr, ...tn, ...Wr, _r],
|
|
1801
|
+
const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\*? ?/gu, Kr = ["keyed", "ref", "repeat", "live"], le = "staticHtml", Z = "staticSvg", de = "html", oe = "svg", Zi = Symbol("maybe HTML namespace or maybe SVG"), Yi = "css", en = "mathml", tn = [Yi, de, en, le, Z, oe], Br = new Set(tn), Wr = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], _r = "nothing", Ur = [...Kr, ...tn, ...Wr, _r], Hr = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => Se(t)), Se = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), ae = {
|
|
1802
1802
|
[de]: ["lit", "lit/html.js", "lit-html"],
|
|
1803
1803
|
/**
|
|
1804
1804
|
* Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
|
|
@@ -1820,7 +1820,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
|
|
|
1820
1820
|
repeat: ["lit/directives/repeat.js", "lit-html/directives/repeat.js"],
|
|
1821
1821
|
ref: ["lit/directives/ref.js", "lit-html/directives/ref.js"],
|
|
1822
1822
|
nothing: ["lit", "@arcgis/lumina", "lit/html.js", "lit-html", "lit-element/lit-element.js"]
|
|
1823
|
-
}, nn = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, pe = "@arcgis/lumina:loadLitCss", Ke = "?litCss", Y = "?layeredLitCss", yt = "?globalFileLitCss",
|
|
1823
|
+
}, nn = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, pe = "@arcgis/lumina:loadLitCss", Ke = "?litCss", Y = "?layeredLitCss", yt = "?globalFileLitCss", zr = (e) => ({
|
|
1824
1824
|
name: pe,
|
|
1825
1825
|
enforce: "pre",
|
|
1826
1826
|
configResolved(t) {
|
|
@@ -1860,7 +1860,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
|
|
|
1860
1860
|
if (l && (a = a.slice(0, -yt.length)), !c && !d && !l)
|
|
1861
1861
|
return await n.handler.call(this, r, a);
|
|
1862
1862
|
const p = `${a}?inline`, m = await n.handler.call(this, r, p), { code: f, ...y } = typeof m == "string" ? { code: m } : m ?? {};
|
|
1863
|
-
if (typeof f != "string" || !f.startsWith(sn) || !f.endsWith(
|
|
1863
|
+
if (typeof f != "string" || !f.startsWith(sn) || !f.endsWith(qr))
|
|
1864
1864
|
return E.warn(
|
|
1865
1865
|
pe,
|
|
1866
1866
|
`Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
|
|
@@ -1890,7 +1890,7 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
|
|
|
1890
1890
|
}
|
|
1891
1891
|
return {
|
|
1892
1892
|
...y,
|
|
1893
|
-
code:
|
|
1893
|
+
code: Qr(f, e.hmrEnabled, e.shouldMinify, d),
|
|
1894
1894
|
/**
|
|
1895
1895
|
* Vite's original transform does not generate source maps for inlined
|
|
1896
1896
|
* css, thus we can't either
|
|
@@ -1901,8 +1901,8 @@ const Or = /@prop\s+(?<name>--[\w-]+)\s*:(?<description>[^@/]+)/gu, Jr = /\n\s+\
|
|
|
1901
1901
|
}
|
|
1902
1902
|
};
|
|
1903
1903
|
}
|
|
1904
|
-
}), sn = 'export default "',
|
|
1905
|
-
export const styles = css\``,
|
|
1904
|
+
}), sn = 'export default "', qr = '"', Gr = `import { css } from '${ae.css[0]}';
|
|
1905
|
+
export const styles = css\``, Vr = "`;\nexport default styles;", Xr = `
|
|
1906
1906
|
|
|
1907
1907
|
if(import.meta.hot) {
|
|
1908
1908
|
import.meta.hot.data.styles ??= styles;
|
|
@@ -1914,23 +1914,23 @@ if(import.meta.hot) {
|
|
|
1914
1914
|
import.meta.hot.data.styles.styleSheet.replaceSync(nextExports.styles.cssText);
|
|
1915
1915
|
});
|
|
1916
1916
|
}`, rn = (e) => e.slice(sn.length - 1);
|
|
1917
|
-
function
|
|
1917
|
+
function Qr(e, t, i, n) {
|
|
1918
1918
|
const s = rn(e), r = JSON.parse(s), a = Lr(r), c = n ? `@layer{${i ? "" : `
|
|
1919
1919
|
`}${a}${i ? "" : `
|
|
1920
1920
|
`}}` : a;
|
|
1921
|
-
return `${
|
|
1921
|
+
return `${Gr}${c}${Vr}${t ? Xr : ""}`;
|
|
1922
1922
|
}
|
|
1923
|
-
function
|
|
1924
|
-
return `import("${
|
|
1925
|
-
setCustomElementsManifest(${
|
|
1923
|
+
function Zr(e) {
|
|
1924
|
+
return `import("${Yr}").then(({ setCustomElementsManifest }) => {
|
|
1925
|
+
setCustomElementsManifest(${eo(e)});
|
|
1926
1926
|
});`;
|
|
1927
1927
|
}
|
|
1928
|
-
const
|
|
1929
|
-
function
|
|
1928
|
+
const Yr = "@storybook/web-components", eo = (e) => `JSON.parse(\`${to(JSON.stringify(JSON.stringify(e)).slice(1, -1))}\`)`;
|
|
1929
|
+
function to(e) {
|
|
1930
1930
|
return e.replaceAll('\\"', '"').replaceAll("`", "\\`").replaceAll("${", "\\${");
|
|
1931
1931
|
}
|
|
1932
|
-
function
|
|
1933
|
-
|
|
1932
|
+
function io(e) {
|
|
1933
|
+
no(e);
|
|
1934
1934
|
const t = e.options.css?.globalStylesPath;
|
|
1935
1935
|
if (t === void 0)
|
|
1936
1936
|
return "";
|
|
@@ -1943,7 +1943,7 @@ function to(e) {
|
|
|
1943
1943
|
`) : `import "${i}${yt}";`;
|
|
1944
1944
|
}
|
|
1945
1945
|
const on = "hydrated";
|
|
1946
|
-
function
|
|
1946
|
+
function no(e) {
|
|
1947
1947
|
e._globalHydratedCssString = [
|
|
1948
1948
|
":not([",
|
|
1949
1949
|
e.options.css?.hydratedAttribute ?? on,
|
|
@@ -1960,42 +1960,42 @@ function an(e, t) {
|
|
|
1960
1960
|
].join(`
|
|
1961
1961
|
`);
|
|
1962
1962
|
}
|
|
1963
|
-
const
|
|
1963
|
+
const so = (e) => `@layer{${e.shouldMinify ? "" : `
|
|
1964
1964
|
`}${e._globalHydratedCssString}${e.shouldMinify ? "" : `
|
|
1965
1965
|
|
|
1966
1966
|
`}${e._globalCssString ? JSON.parse(e._globalCssString) : ""}${e.shouldMinify ? "" : `
|
|
1967
1967
|
`}}`;
|
|
1968
|
-
function
|
|
1968
|
+
function ro(e) {
|
|
1969
1969
|
const t = [], i = [];
|
|
1970
1970
|
for (const n of e.privateApiJson.modules) {
|
|
1971
1971
|
t.push(n.path);
|
|
1972
1972
|
for (const s of n.declarations)
|
|
1973
|
-
"customElement" in s && i.push(
|
|
1973
|
+
"customElement" in s && i.push(ao(s, e, n.path));
|
|
1974
1974
|
}
|
|
1975
1975
|
return [
|
|
1976
1976
|
'import { runtime } from "./runtime";',
|
|
1977
1977
|
'import { makeDefineCustomElements } from "@arcgis/lumina";',
|
|
1978
|
-
|
|
1979
|
-
e.hmrEnabled ?
|
|
1978
|
+
io(e),
|
|
1979
|
+
e.hmrEnabled ? lo : "",
|
|
1980
1980
|
"",
|
|
1981
|
-
e.isInStorybook ?
|
|
1981
|
+
e.isInStorybook ? Zr(e.apiJson) : "",
|
|
1982
1982
|
"",
|
|
1983
1983
|
"export const defineCustomElements = makeDefineCustomElements(runtime, {",
|
|
1984
1984
|
i.join(`,
|
|
1985
1985
|
`),
|
|
1986
1986
|
"});",
|
|
1987
|
-
e.hmrEnabled ?
|
|
1987
|
+
e.hmrEnabled ? po(t) : ""
|
|
1988
1988
|
].join(`
|
|
1989
1989
|
`);
|
|
1990
1990
|
}
|
|
1991
|
-
const
|
|
1992
|
-
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`,
|
|
1991
|
+
const oo = `import "./index";
|
|
1992
|
+
export declare const defineCustomElements: import("@arcgis/lumina").DefineCustomElements;`, ao = (e, t, i) => [
|
|
1993
1993
|
` "${e.tagName}": [`,
|
|
1994
1994
|
`()=>import("${u.join(t.dir.root, i)}"),`,
|
|
1995
|
-
|
|
1995
|
+
co(e),
|
|
1996
1996
|
"]"
|
|
1997
1997
|
].join("");
|
|
1998
|
-
function
|
|
1998
|
+
function co(e) {
|
|
1999
1999
|
const { properties: t, asyncMethods: i, syncMethods: n } = cn(e), s = t.map((p) => p.join(bs)).join(et), r = i.join(et), a = n.join(et), c = [s, r, a], d = c.findLastIndex((p) => p.length > 0), l = c.slice(0, d + 1);
|
|
2000
2000
|
return l.length > 0 ? `"${l.join(Ss)}"` : "";
|
|
2001
2001
|
}
|
|
@@ -2012,15 +2012,15 @@ function cn(e) {
|
|
|
2012
2012
|
), n = i.filter((r) => r.async === !0).map((r) => r.name), s = i.filter((r) => r.async !== !0).map((r) => r.name);
|
|
2013
2013
|
return { tagName: e.tagName, properties: t, asyncMethods: n, syncMethods: s };
|
|
2014
2014
|
}
|
|
2015
|
-
const
|
|
2016
|
-
`,
|
|
2015
|
+
const lo = `import { handleHmrUpdate, handleComponentMetaUpdate } from "@arcgis/lumina/hmrSupport";
|
|
2016
|
+
`, po = (e) => `
|
|
2017
2017
|
if(import.meta.hot) {
|
|
2018
2018
|
import.meta.hot.on("component-meta-update", handleComponentMetaUpdate);
|
|
2019
2019
|
import.meta.hot.accept([
|
|
2020
2020
|
${e.map((t) => ` "/${t}",`).join(`
|
|
2021
2021
|
`)}
|
|
2022
2022
|
], handleHmrUpdate);
|
|
2023
|
-
}`,
|
|
2023
|
+
}`, uo = async (e) => Object.fromEntries(
|
|
2024
2024
|
(await e.componentFilesPromise).map((t) => [ln(t), t])
|
|
2025
2025
|
), ln = (e, t = u.resolve("src")) => u.relative(t, u.join(e, "..", Tt.slice(0, -3))), xt = async (e, t, i = t) => await ze(i, { recursive: !0 }).catch((n) => {
|
|
2026
2026
|
if (String(n).includes("ENOENT"))
|
|
@@ -2031,24 +2031,24 @@ ${e.map((t) => ` "/${t}",`).join(`
|
|
|
2031
2031
|
if (!a.endsWith(".tsx"))
|
|
2032
2032
|
return;
|
|
2033
2033
|
const c = u.join(i, a);
|
|
2034
|
-
if (
|
|
2034
|
+
if (we(c, t))
|
|
2035
2035
|
return c;
|
|
2036
2036
|
a.endsWith(".stories.tsx") && c.startsWith(t) && s.push(c);
|
|
2037
2037
|
}).filter(j);
|
|
2038
2038
|
return e.componentFiles = r, e.componentStoryFiles = s, r;
|
|
2039
2039
|
});
|
|
2040
|
-
function
|
|
2040
|
+
function we(e, t) {
|
|
2041
2041
|
if (!e.startsWith(t) || !e.endsWith(".tsx"))
|
|
2042
2042
|
return !1;
|
|
2043
|
-
const [i, n] = e.slice(0, -4).split(u.sep).slice(
|
|
2043
|
+
const [i, n] = e.slice(0, -4).split(u.sep).slice(mo);
|
|
2044
2044
|
return i === n;
|
|
2045
2045
|
}
|
|
2046
|
-
const
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2046
|
+
const mo = -2, Xt = 5, Qt = 1, Zt = 1, Yt = 3, ei = 4, qe = o;
|
|
2047
|
+
fo(qe.createSourceMapGenerator);
|
|
2048
|
+
go(qe.createTextWriter);
|
|
2049
|
+
yo(qe.getNewLineCharacter);
|
|
2050
2050
|
const ye = qe;
|
|
2051
|
-
function
|
|
2051
|
+
function fo(e) {
|
|
2052
2052
|
if (typeof e != "function")
|
|
2053
2053
|
throw new Error(
|
|
2054
2054
|
"Failed to find ts.createSourceMapGenerator() function. Lumina needs to be updated to support the new TypeScript version"
|
|
@@ -2058,7 +2058,7 @@ function mo(e) {
|
|
|
2058
2058
|
`ts.createSourceMapGenerator() signature changed. Expected ${Xt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
2059
2059
|
);
|
|
2060
2060
|
}
|
|
2061
|
-
function
|
|
2061
|
+
function go(e) {
|
|
2062
2062
|
if (typeof e != "function")
|
|
2063
2063
|
throw new Error(
|
|
2064
2064
|
"Failed to find ts.createTextWriter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
@@ -2068,7 +2068,7 @@ function fo(e) {
|
|
|
2068
2068
|
`ts.createTextWriter() signature changed. Expected ${Qt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
2069
2069
|
);
|
|
2070
2070
|
}
|
|
2071
|
-
function
|
|
2071
|
+
function yo(e) {
|
|
2072
2072
|
if (typeof e != "function")
|
|
2073
2073
|
throw new Error(
|
|
2074
2074
|
"Failed to find ts.getNewLineCharacter() function. Lumina needs to be updated to support the new TypeScript version"
|
|
@@ -2078,7 +2078,7 @@ function go(e) {
|
|
|
2078
2078
|
`ts.getNewLineCharacter() signature changed. Expected ${Zt} argument. Lumina needs to be updated to support the new TypeScript version`
|
|
2079
2079
|
);
|
|
2080
2080
|
}
|
|
2081
|
-
function
|
|
2081
|
+
function ho(e) {
|
|
2082
2082
|
if (typeof e != "function")
|
|
2083
2083
|
throw new Error(
|
|
2084
2084
|
"Failed to find ts.Printer.writeFile() function. Lumina needs to be updated to support the new TypeScript version"
|
|
@@ -2088,7 +2088,7 @@ function yo(e) {
|
|
|
2088
2088
|
`ts.Printer.writeFile() signature changed. Expected ${Yt} arguments. Lumina needs to be updated to support the new TypeScript version`
|
|
2089
2089
|
);
|
|
2090
2090
|
}
|
|
2091
|
-
function
|
|
2091
|
+
function vo(e) {
|
|
2092
2092
|
if (typeof e != "function")
|
|
2093
2093
|
throw new Error(
|
|
2094
2094
|
"Failed to find ts.Printer.writeNode() function. Lumina needs to be updated to support the new TypeScript version"
|
|
@@ -2100,23 +2100,23 @@ function ho(e) {
|
|
|
2100
2100
|
}
|
|
2101
2101
|
function dn(e) {
|
|
2102
2102
|
const t = ye.createPrinter(e);
|
|
2103
|
-
return
|
|
2103
|
+
return ho(t.writeFile), vo(t.writeNode), t;
|
|
2104
2104
|
}
|
|
2105
2105
|
function ti(e) {
|
|
2106
2106
|
const t = o.isUnionTypeNode(e) ? e.types.map(ii) : [ii(e)], i = new Set(t), n = i.delete("true"), s = i.delete("false");
|
|
2107
2107
|
(n || s) && i.add("boolean");
|
|
2108
2108
|
let r = Array.from(i).sort();
|
|
2109
|
-
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length >
|
|
2110
|
-
return r.map(
|
|
2109
|
+
if (r.length > 1 && (r = r.map((a) => a.includes("=>") ? `(${a})` : a)), !(r.length > bo))
|
|
2110
|
+
return r.map(To);
|
|
2111
2111
|
}
|
|
2112
|
-
const
|
|
2112
|
+
const bo = 40, So = (e) => e?.some(
|
|
2113
2113
|
(t) => t.type === "number" || t.type === "boolean" || t.type === "string" || /**
|
|
2114
2114
|
* Treat "any" as possibly literal, but not "unknown". Matches Stencil
|
|
2115
2115
|
* behavior.
|
|
2116
2116
|
*/
|
|
2117
2117
|
t.type === "any"
|
|
2118
|
-
) ?? !1,
|
|
2119
|
-
function
|
|
2118
|
+
) ?? !1, wo = (e) => e.length === 1 && e[0].type !== "string" && e[0].type !== "number" && e[0].type !== "boolean" && e[0].type !== "any" ? void 0 : e, pn = (e) => e.map(un).join(" | "), un = (e) => e.type === "string" && e.value !== void 0 ? `"${e.value}"` : e.value ?? e.type;
|
|
2119
|
+
function To(e) {
|
|
2120
2120
|
return e === "boolean" ? { type: "boolean" } : Number.isNaN(Number.parseFloat(e)) ? e.startsWith('"') || e.startsWith("'") ? {
|
|
2121
2121
|
value: e.slice(1, -1),
|
|
2122
2122
|
type: "string"
|
|
@@ -2127,25 +2127,25 @@ function wo(e) {
|
|
|
2127
2127
|
type: "number"
|
|
2128
2128
|
};
|
|
2129
2129
|
}
|
|
2130
|
-
const
|
|
2130
|
+
const Eo = (e, t, i, n) => {
|
|
2131
2131
|
const s = e.typeScriptTypeChecker, r = o.isSetAccessor(t) ? t.parameters[0] : t, a = s.getTypeAtLocation(r), c = !i;
|
|
2132
2132
|
return Be(s, a, n, e.dir, c);
|
|
2133
2133
|
};
|
|
2134
|
-
function
|
|
2134
|
+
function Co(e, t) {
|
|
2135
2135
|
if (e.length === 0)
|
|
2136
2136
|
return;
|
|
2137
|
-
const i = t.matchAll(
|
|
2137
|
+
const i = t.matchAll($o), n = [];
|
|
2138
2138
|
for (const s of i) {
|
|
2139
2139
|
const r = e.find((a) => a.name === s[0]);
|
|
2140
2140
|
r !== void 0 && n.push({ ...r, start: s.index, end: s.index + r.name.length });
|
|
2141
2141
|
}
|
|
2142
2142
|
return n.length === 0 ? void 0 : n;
|
|
2143
2143
|
}
|
|
2144
|
-
const
|
|
2144
|
+
const $o = /"[^"]+"|'[^"]+'|\w+/gu;
|
|
2145
2145
|
function Be(e, t, i, n, s = !1) {
|
|
2146
2146
|
let { typeNode: r, references: a } = si(e, t, i, n), c = ti(r);
|
|
2147
2147
|
c === void 0 && ({ typeNode: r, references: a } = si(e, t, i, n, !1), c = ti(r) ?? []);
|
|
2148
|
-
const d = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, l = pn(d), p =
|
|
2148
|
+
const d = s ? c.filter((f) => f.type !== "null" && f.type !== "undefined") : c, l = pn(d), p = wo(d), m = Co(a, l);
|
|
2149
2149
|
return {
|
|
2150
2150
|
text: l,
|
|
2151
2151
|
references: m,
|
|
@@ -2153,21 +2153,21 @@ function Be(e, t, i, n, s = !1) {
|
|
|
2153
2153
|
};
|
|
2154
2154
|
}
|
|
2155
2155
|
function ii(e) {
|
|
2156
|
-
|
|
2156
|
+
Po.writeNode(o.EmitHint.Unspecified, e, void 0, nt);
|
|
2157
2157
|
const t = nt.getText();
|
|
2158
2158
|
return nt.clear(), t;
|
|
2159
2159
|
}
|
|
2160
|
-
const
|
|
2161
|
-
`), mn = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals,
|
|
2162
|
-
function
|
|
2160
|
+
const Po = dn({ removeComments: !0 }), nt = ye.createTextWriter(`
|
|
2161
|
+
`), mn = o.TypeFormatFlags.NoTruncation | o.TypeFormatFlags.WriteArrayAsGenericType | o.TypeFormatFlags.SuppressAnyReturnType | o.TypeFormatFlags.MultilineObjectLiterals, xo = mn & o.TypeFormatFlags.NodeBuilderFlagsMask, ko = xo | o.NodeBuilderFlags.IgnoreErrors | o.NodeBuilderFlags.NoTruncation;
|
|
2162
|
+
function Io(e, t, i, n = !0) {
|
|
2163
2163
|
const s = /* @__PURE__ */ new Map();
|
|
2164
2164
|
se(t, s, i, n);
|
|
2165
2165
|
const r = t.flags & o.TypeFlags.Union ? t.types.every(ni) : ni(t), a = e.typeToTypeNode(
|
|
2166
2166
|
t,
|
|
2167
2167
|
void 0,
|
|
2168
|
-
|
|
2168
|
+
ko & (r ? ~o.TypeFormatFlags.MultilineObjectLiterals : -1)
|
|
2169
2169
|
);
|
|
2170
|
-
return s.forEach(
|
|
2170
|
+
return s.forEach(Ao), a === void 0 ? (E.warn("@arcgis/lumina", "Unexpected case: Failed to convert type to type node."), o.factory.createTypeReferenceNode(o.factory.createIdentifier("unknown"), void 0)) : a;
|
|
2171
2171
|
}
|
|
2172
2172
|
const ni = (e) => e.flags & o.TypeFlags.Object ? e.getProperties().length === 1 : !!(e.flags & o.TypeFlags.PossiblyFalsy);
|
|
2173
2173
|
function si(e, t, i, n, s = !0) {
|
|
@@ -2199,10 +2199,10 @@ function si(e, t, i, n, s = !0) {
|
|
|
2199
2199
|
name: f,
|
|
2200
2200
|
package: void 0,
|
|
2201
2201
|
module: "index.js"
|
|
2202
|
-
} :
|
|
2202
|
+
} : Lo(m, f, i, n);
|
|
2203
2203
|
r.push(y), a.add(f);
|
|
2204
2204
|
}
|
|
2205
|
-
return { typeNode:
|
|
2205
|
+
return { typeNode: Io(e, t, c, s), references: r };
|
|
2206
2206
|
}
|
|
2207
2207
|
function se(e, t, i, n = !0) {
|
|
2208
2208
|
if (typeof e != "object" || e === null || !("checker" in e))
|
|
@@ -2232,10 +2232,10 @@ function se(e, t, i, n = !0) {
|
|
|
2232
2232
|
c !== "resolvedBaseConstructorType" && c !== "resolvedBaseTypes" && c !== "typeParameters" && c !== "typeParameter" && (Array.isArray(d) ? d.forEach((l) => se(l, t, i, n)) : se(d, t, i, n));
|
|
2233
2233
|
});
|
|
2234
2234
|
}
|
|
2235
|
-
function
|
|
2235
|
+
function Ao(e, t) {
|
|
2236
2236
|
e.origin !== void 0 && (t.origin = e.origin), e.aliasSymbol !== void 0 && (t.aliasSymbol = e.aliasSymbol), e.aliasTypeArguments !== void 0 && (t.aliasTypeArguments = e.aliasTypeArguments);
|
|
2237
2237
|
}
|
|
2238
|
-
function
|
|
2238
|
+
function Lo(e, t, i, n) {
|
|
2239
2239
|
const s = e?.declarations?.map((c) => c.getSourceFile()) ?? [];
|
|
2240
2240
|
if (s.length === 0) {
|
|
2241
2241
|
if (t === "Array")
|
|
@@ -2256,7 +2256,7 @@ function Ao(e, t, i, n) {
|
|
|
2256
2256
|
package: Ri,
|
|
2257
2257
|
module: void 0
|
|
2258
2258
|
};
|
|
2259
|
-
const { packageName: r, moduleName: a } =
|
|
2259
|
+
const { packageName: r, moduleName: a } = Fo(s[0].fileName, n);
|
|
2260
2260
|
return r ? {
|
|
2261
2261
|
name: t,
|
|
2262
2262
|
package: r,
|
|
@@ -2268,7 +2268,7 @@ function Ao(e, t, i, n) {
|
|
|
2268
2268
|
module: a
|
|
2269
2269
|
};
|
|
2270
2270
|
}
|
|
2271
|
-
function
|
|
2271
|
+
function Fo(e, t) {
|
|
2272
2272
|
const i = e.split("/node_modules/");
|
|
2273
2273
|
if (i.length > 1) {
|
|
2274
2274
|
const a = i.at(-1);
|
|
@@ -2281,18 +2281,18 @@ function Lo(e, t) {
|
|
|
2281
2281
|
}
|
|
2282
2282
|
return {
|
|
2283
2283
|
packageName: void 0,
|
|
2284
|
-
moduleName: u.relative(t.root, No(
|
|
2284
|
+
moduleName: u.relative(t.root, Do(No(e, t)))
|
|
2285
2285
|
};
|
|
2286
2286
|
}
|
|
2287
|
-
function
|
|
2288
|
-
return
|
|
2287
|
+
function No(e, t) {
|
|
2288
|
+
return we(e, t.srcComponents) ? u.join(t.dist, ln(e, t.src)) : e.startsWith(t.src) ? u.join(t.dist, e.slice(t.src.length)) : e;
|
|
2289
2289
|
}
|
|
2290
|
-
const
|
|
2290
|
+
const Do = (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`;
|
|
2291
2291
|
function fn(e) {
|
|
2292
2292
|
const t = e.split("/"), n = e[0].startsWith("@") ? 2 : 1, s = t.slice(0, n).join("/"), r = t.slice(n).join("/");
|
|
2293
2293
|
return { packageName: s, moduleName: r };
|
|
2294
2294
|
}
|
|
2295
|
-
const
|
|
2295
|
+
const jo = (e) => e.includes("/node_modules/") || e.includes("/dist/");
|
|
2296
2296
|
function ri(e, t, i) {
|
|
2297
2297
|
const n = e.declarations;
|
|
2298
2298
|
if (n !== void 0)
|
|
@@ -2306,7 +2306,7 @@ function ri(e, t, i) {
|
|
|
2306
2306
|
for (const c of a) {
|
|
2307
2307
|
const d = oi(c, t, i);
|
|
2308
2308
|
if (d !== void 0)
|
|
2309
|
-
return
|
|
2309
|
+
return Ro(d);
|
|
2310
2310
|
}
|
|
2311
2311
|
}
|
|
2312
2312
|
}
|
|
@@ -2330,15 +2330,15 @@ function oi(e, t, i) {
|
|
|
2330
2330
|
});
|
|
2331
2331
|
});
|
|
2332
2332
|
}
|
|
2333
|
-
const
|
|
2334
|
-
function
|
|
2333
|
+
const Ro = (e) => e.split("#")[0], Mo = "@arcgis/lumina:addMethodMetadata";
|
|
2334
|
+
function Oo(e, t, i, n, s) {
|
|
2335
2335
|
const r = i.getSignatureFromDeclaration(e);
|
|
2336
2336
|
if (r === void 0)
|
|
2337
2337
|
return;
|
|
2338
2338
|
for (const l of e.parameters) {
|
|
2339
2339
|
if (!o.isIdentifier(l.name)) {
|
|
2340
2340
|
E.warn(
|
|
2341
|
-
|
|
2341
|
+
Mo,
|
|
2342
2342
|
`Object binding patterns are not yet supported in the docs. Found ${l.name?.getText(n)} in ${e.name.getText(n)}`,
|
|
2343
2343
|
n.fileName
|
|
2344
2344
|
);
|
|
@@ -2359,8 +2359,8 @@ function Mo(e, t, i, n, s) {
|
|
|
2359
2359
|
type: c
|
|
2360
2360
|
}, t.signature = d.replace(" =>", ":");
|
|
2361
2361
|
}
|
|
2362
|
-
const
|
|
2363
|
-
function
|
|
2362
|
+
const Jo = (e) => e.modifiers?.some?.((t) => t.kind === o.SyntaxKind.AsyncKeyword) ?? !1;
|
|
2363
|
+
function Ko(e, t, i, n) {
|
|
2364
2364
|
const s = i.typeScriptTypeChecker, a = s.getTypeAtLocation(e).getProperty("emit");
|
|
2365
2365
|
if (a?.valueDeclaration === void 0)
|
|
2366
2366
|
return;
|
|
@@ -2385,15 +2385,15 @@ function Jo(e, t, i, n) {
|
|
|
2385
2385
|
composed: void 0,
|
|
2386
2386
|
privacy: void 0
|
|
2387
2387
|
};
|
|
2388
|
-
return ge(e.name, s, y),
|
|
2388
|
+
return ge(e.name, s, y), Bo(e, y, n), y.privacy === void 0 ? y : void 0;
|
|
2389
2389
|
}
|
|
2390
2390
|
}
|
|
2391
|
-
const
|
|
2392
|
-
function
|
|
2391
|
+
const Fe = "createEvent";
|
|
2392
|
+
function Bo(e, t, i) {
|
|
2393
2393
|
if (!e.initializer || !o.isCallExpression(e.initializer))
|
|
2394
2394
|
return;
|
|
2395
2395
|
const n = e.initializer;
|
|
2396
|
-
if (!o.isIdentifier(n.expression) || n.expression.text !==
|
|
2396
|
+
if (!o.isIdentifier(n.expression) || n.expression.text !== Fe)
|
|
2397
2397
|
return;
|
|
2398
2398
|
const s = n.arguments[0];
|
|
2399
2399
|
if (s !== void 0) {
|
|
@@ -2401,14 +2401,14 @@ function Ko(e, t, i) {
|
|
|
2401
2401
|
throw Error(
|
|
2402
2402
|
T(
|
|
2403
2403
|
"@arcgis/lumina:extractEventMeta",
|
|
2404
|
-
`Expected object literal expression as first argument of ${
|
|
2404
|
+
`Expected object literal expression as first argument of ${Fe}(). Found ${t.name} = createEvent(${s.getText(i)})`
|
|
2405
2405
|
)
|
|
2406
2406
|
);
|
|
2407
2407
|
if (s.properties.some((r) => o.isSpreadAssignment(r)))
|
|
2408
2408
|
throw Error(
|
|
2409
2409
|
T(
|
|
2410
2410
|
"@arcgis/lumina:extractEventMeta",
|
|
2411
|
-
`Unexpected spread syntax in ${
|
|
2411
|
+
`Unexpected spread syntax in ${Fe}() argument. ${Fe}() arguments must be statically parsable at compile time`
|
|
2412
2412
|
)
|
|
2413
2413
|
);
|
|
2414
2414
|
for (const r of s.properties)
|
|
@@ -2440,7 +2440,7 @@ class We extends ps {
|
|
|
2440
2440
|
const i = super.extractModules(t);
|
|
2441
2441
|
for (const n of i)
|
|
2442
2442
|
for (const s of n.declarations)
|
|
2443
|
-
"customElement" in s && (this.context.isFullApiExtraction &&
|
|
2443
|
+
"customElement" in s && (this.context.isFullApiExtraction && Uo(s, this.context, this.indexedComponents), this.inheritMembers(s, i), this.context.isFullApiExtraction && (s.members.sort(st), s.attributes?.sort(st), s.events?.sort(st)));
|
|
2444
2444
|
return i;
|
|
2445
2445
|
}
|
|
2446
2446
|
extractDeclarations(t) {
|
|
@@ -2623,13 +2623,13 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2623
2623
|
inheritedFrom: void 0,
|
|
2624
2624
|
privacy: void 0
|
|
2625
2625
|
};
|
|
2626
|
-
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, d), (r === void 0 && (d.type.values === void 0 || !
|
|
2626
|
+
return this.context.isFullApiExtraction && (this.extractComponentFieldDetails(t, d), (r === void 0 && (d.type.values === void 0 || !So(d.type.values)) || d.readonly && !d.reflects) && (d.attribute = void 0)), d;
|
|
2627
2627
|
}
|
|
2628
2628
|
/**
|
|
2629
2629
|
* Based on a `non-@property()` property, extract a public event if it is one.
|
|
2630
2630
|
*/
|
|
2631
2631
|
extractComponentEvent(t, i) {
|
|
2632
|
-
const n =
|
|
2632
|
+
const n = Ko(t, i, this.context, this.file);
|
|
2633
2633
|
return n !== void 0 && this.copyDoc(this.copyDocDefinitions?.events?.[i], n, this.apiComponent), n;
|
|
2634
2634
|
}
|
|
2635
2635
|
/**
|
|
@@ -2646,7 +2646,7 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2646
2646
|
// in the documentation. The full type is still present in the .d.ts files.
|
|
2647
2647
|
i.name === "messageOverrides" ? {
|
|
2648
2648
|
text: "Record<string, unknown>"
|
|
2649
|
-
} :
|
|
2649
|
+
} : Eo(this.context, l, f, this.file);
|
|
2650
2650
|
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);
|
|
2651
2651
|
if ("initializer" in t && t.initializer !== void 0 && (!i.default || !i.description) || y) {
|
|
2652
2652
|
const v = t.initializer, h = s.getSymbolAtLocation(v), b = h !== void 0 && ((h.flags ?? 0) & o.SymbolFlags.Alias) !== 0 ? s.getAliasedSymbol(h) : h, S = b?.getDeclarations() ?? [];
|
|
@@ -2703,12 +2703,12 @@ console.log("${s.tagName} is ready to go!");
|
|
|
2703
2703
|
inheritedFrom: void 0,
|
|
2704
2704
|
docsTags: void 0,
|
|
2705
2705
|
signature: "",
|
|
2706
|
-
async:
|
|
2706
|
+
async: Jo(t) ? !0 : void 0,
|
|
2707
2707
|
privacy: void 0
|
|
2708
2708
|
};
|
|
2709
2709
|
if (this.context.isFullApiExtraction) {
|
|
2710
2710
|
const s = this.context.typeScriptTypeChecker;
|
|
2711
|
-
|
|
2711
|
+
Oo(t, n, s, this.file, this.context.dir), this.copyDoc(this.copyDocDefinitions?.methods?.[i], n, this.apiComponent);
|
|
2712
2712
|
}
|
|
2713
2713
|
return n;
|
|
2714
2714
|
}
|
|
@@ -2803,16 +2803,16 @@ const ue = {
|
|
|
2803
2803
|
name: "LitElement",
|
|
2804
2804
|
package: "@arcgis/lumina"
|
|
2805
2805
|
}, st = (e, t) => e.name.localeCompare(t.name);
|
|
2806
|
-
async function
|
|
2806
|
+
async function Wo(e, t) {
|
|
2807
2807
|
t || (e.componentFilesPromise = xt(e, e.dir.srcComponents));
|
|
2808
|
-
const i = await e.componentFilesPromise, n = await
|
|
2808
|
+
const i = await e.componentFilesPromise, n = await Zo(e, i);
|
|
2809
2809
|
await e.componentStoriesPromise, e._componentPathMapping = {}, e._localDefinedComponents = void 0;
|
|
2810
2810
|
const s = gn(n, e, !1);
|
|
2811
2811
|
e.privateApiJson = s;
|
|
2812
2812
|
const [r, a] = yn(s);
|
|
2813
2813
|
return e.apiJsonComponents = a, e.apiJson = r, s;
|
|
2814
2814
|
}
|
|
2815
|
-
function
|
|
2815
|
+
function _o(e, t, i) {
|
|
2816
2816
|
const n = e.getSourceFile(t, i), s = gn([n], e, !0), r = s.modules[0];
|
|
2817
2817
|
{
|
|
2818
2818
|
const f = yn(s)[0].modules[0], y = e.apiJson.modules.findIndex((h) => h.path === f.path), g = e.apiJson.modules[y], v = Array.from(e.apiJson.modules);
|
|
@@ -2857,23 +2857,23 @@ function yn(e) {
|
|
|
2857
2857
|
}
|
|
2858
2858
|
return [t, i];
|
|
2859
2859
|
}
|
|
2860
|
-
function
|
|
2861
|
-
const n =
|
|
2860
|
+
function Uo(e, t, i) {
|
|
2861
|
+
const n = Ho(i, e);
|
|
2862
2862
|
O(e, n, t);
|
|
2863
2863
|
for (const s of e.members) {
|
|
2864
2864
|
if (s.kind === "field")
|
|
2865
|
-
|
|
2865
|
+
Ne(s.type, i, t);
|
|
2866
2866
|
else {
|
|
2867
|
-
if (
|
|
2867
|
+
if (Ne(s.return?.type, i, t), s.parameters !== void 0)
|
|
2868
2868
|
for (const r of s.parameters)
|
|
2869
|
-
|
|
2869
|
+
Ne(r.type, i, t), O(r, n, t);
|
|
2870
2870
|
s.return !== void 0 && O(s.return, n, t);
|
|
2871
2871
|
}
|
|
2872
2872
|
O(s, n, t);
|
|
2873
2873
|
}
|
|
2874
2874
|
if (e.events !== void 0)
|
|
2875
2875
|
for (const s of e.events)
|
|
2876
|
-
|
|
2876
|
+
Ne(s.type, i, t), O(s, n, t);
|
|
2877
2877
|
if (e.attributes !== void 0)
|
|
2878
2878
|
for (const s of e.attributes)
|
|
2879
2879
|
O(s, n, t);
|
|
@@ -2893,14 +2893,14 @@ function _o(e, t, i) {
|
|
|
2893
2893
|
for (const s of e.demos)
|
|
2894
2894
|
O(s, n, t);
|
|
2895
2895
|
}
|
|
2896
|
-
function
|
|
2896
|
+
function Ne(e, t, i) {
|
|
2897
2897
|
e !== void 0 && (e.references?.reduce(
|
|
2898
|
-
(n, s) =>
|
|
2898
|
+
(n, s) => zo(s, t, i, n),
|
|
2899
2899
|
0
|
|
2900
2900
|
), e.text = e.text.replaceAll(
|
|
2901
|
-
|
|
2901
|
+
Qo,
|
|
2902
2902
|
(n, s) => It(t.get(s)) ?? n
|
|
2903
|
-
), e.values?.forEach(
|
|
2903
|
+
), e.values?.forEach(qo, t));
|
|
2904
2904
|
}
|
|
2905
2905
|
function O(e, t, i) {
|
|
2906
2906
|
if (e.description && (e.description = e.description.replaceAll(rt, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl)), e.docsTags)
|
|
@@ -2908,7 +2908,7 @@ function O(e, t, i) {
|
|
|
2908
2908
|
n.text && (n.text = n.text.replaceAll(rt, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2909
2909
|
typeof e.deprecated == "string" && (e.deprecated = e.deprecated.replaceAll(rt, t).replaceAll(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl));
|
|
2910
2910
|
}
|
|
2911
|
-
const rt = /\{@link ([^}]+)\}/gu,
|
|
2911
|
+
const rt = /\{@link ([^}]+)\}/gu, Ho = (e, t) => (i, n) => {
|
|
2912
2912
|
let s = n.indexOf(" ");
|
|
2913
2913
|
s === -1 && (s = n.length);
|
|
2914
2914
|
const r = n.slice(0, s), a = n.slice(s + 1);
|
|
@@ -2932,7 +2932,7 @@ const rt = /\{@link ([^}]+)\}/gu, Uo = (e, t) => (i, n) => {
|
|
|
2932
2932
|
);
|
|
2933
2933
|
return `[${a || (l === t ? d : `${l.tagName}.${d}`)}](${p}#${d})`;
|
|
2934
2934
|
};
|
|
2935
|
-
function
|
|
2935
|
+
function zo(e, t, i, n) {
|
|
2936
2936
|
if (e.viewUrl !== void 0 && (e.viewUrl = e.viewUrl.replace(
|
|
2937
2937
|
i.alternativeDocumentationUrl,
|
|
2938
2938
|
i.normalizedDocumentationUrl
|
|
@@ -2946,16 +2946,16 @@ function Ho(e, t, i, n) {
|
|
|
2946
2946
|
const r = e.name.length;
|
|
2947
2947
|
e.name = It(s);
|
|
2948
2948
|
const a = e.name.length - r - ai;
|
|
2949
|
-
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start - ai, e.end = e.end + a, n += a -
|
|
2949
|
+
e.viewUrl = s.demos?.at(0)?.url.replace(i.alternativeDocumentationUrl, i.normalizedDocumentationUrl), e.start = e.start - ai, e.end = e.end + a, n += a - Xo;
|
|
2950
2950
|
}
|
|
2951
2951
|
}
|
|
2952
2952
|
return n;
|
|
2953
2953
|
}
|
|
2954
|
-
function
|
|
2954
|
+
function qo(e) {
|
|
2955
2955
|
e.type.startsWith("ToElement<") && (e.type = It(this.get(e.type.slice(10, -1))) ?? e.type);
|
|
2956
2956
|
}
|
|
2957
|
-
const It = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0,
|
|
2958
|
-
async function
|
|
2957
|
+
const It = (e) => e ? `HTML${e.pascalCaseName}Element` : void 0, Go = "ToElement<", ai = Go.length, Vo = ">", Xo = Vo.length, Qo = /ToElement<(\w+)>/gu;
|
|
2958
|
+
async function Zo(e, t) {
|
|
2959
2959
|
if (e.viteCommand === "serve" && (Object.hasOwn(e, "typeScriptHost") || (e.typeScriptHost = o.createCompilerHost(e.typeScriptConfig, !1))), e.typeScriptProgram !== void 0) {
|
|
2960
2960
|
const i = e.typeScriptProgram.getSourceFiles(), n = new Set(t);
|
|
2961
2961
|
return i.filter((s) => n.has(s.fileName));
|
|
@@ -2968,9 +2968,9 @@ async function Qo(e, t) {
|
|
|
2968
2968
|
);
|
|
2969
2969
|
}
|
|
2970
2970
|
async function hn(e, t) {
|
|
2971
|
-
return
|
|
2971
|
+
return Te ??= ea(e, t), await Te;
|
|
2972
2972
|
}
|
|
2973
|
-
function
|
|
2973
|
+
function Yo() {
|
|
2974
2974
|
if (_e === void 0)
|
|
2975
2975
|
throw Error(
|
|
2976
2976
|
T(
|
|
@@ -2990,9 +2990,9 @@ function vn() {
|
|
|
2990
2990
|
);
|
|
2991
2991
|
return ht;
|
|
2992
2992
|
}
|
|
2993
|
-
async function
|
|
2993
|
+
async function ea(e, t) {
|
|
2994
2994
|
const i = R(e), n = i.dependencies ?? {}, s = i.peerDependencies ?? {}, a = (await Promise.all(
|
|
2995
|
-
[...Object.keys(n), ...Object.keys(s)].filter((l) => !
|
|
2995
|
+
[...Object.keys(n), ...Object.keys(s)].filter((l) => !ta.has(l)).flatMap(async (l) => await bn(l, e))
|
|
2996
2996
|
)).filter(j);
|
|
2997
2997
|
_e ??= a, ht = Object.fromEntries(a.flatMap((l) => Object.entries(l.components)));
|
|
2998
2998
|
const c = t?.serve?.extraDependencies?.map(
|
|
@@ -3000,7 +3000,7 @@ async function Yo(e, t) {
|
|
|
3000
3000
|
), d = c === void 0 ? a : a.filter((l) => !c.includes(l.packageName));
|
|
3001
3001
|
return _e ??= d, d;
|
|
3002
3002
|
}
|
|
3003
|
-
const
|
|
3003
|
+
const ta = /* @__PURE__ */ new Set([
|
|
3004
3004
|
"@arcgis/arcade-languageservice",
|
|
3005
3005
|
"@arcgis/components-build-utils",
|
|
3006
3006
|
"@arcgis/components-utils",
|
|
@@ -3036,13 +3036,13 @@ const ea = /* @__PURE__ */ new Set([
|
|
|
3036
3036
|
"vscode-languageserver-textdocument",
|
|
3037
3037
|
"vscode-languageserver-types"
|
|
3038
3038
|
]);
|
|
3039
|
-
let _e, ht,
|
|
3039
|
+
let _e, ht, Te;
|
|
3040
3040
|
async function bn(e, t) {
|
|
3041
|
-
const i = await Fi(e, t), n = await Ni(i), s = "exports" in n, r =
|
|
3041
|
+
const i = await Fi(e, t), n = await Ni(i), s = "exports" in n, r = aa.bind(void 0, s), a = "@stencil/core" in (n.dependencies ?? {}) || "@stencil/core" in (n.devDependencies ?? {}), c = u.join(i, "dist/esm/loader.js");
|
|
3042
3042
|
if (a ? await _(c) : !1) {
|
|
3043
|
-
const y = await J(c, "utf8"), g =
|
|
3043
|
+
const y = await J(c, "utf8"), g = ia(y, "bootstrapLazy("), v = y.indexOf(", options", g), h = y.slice(g, v), b = h.startsWith('JSON.parse("') ? h.slice(12, -2).replaceAll('\\"', '"') : h;
|
|
3044
3044
|
try {
|
|
3045
|
-
const S = JSON.parse(b), $ =
|
|
3045
|
+
const S = JSON.parse(b), $ = ra(S, { packageName: e, getImportPath: r });
|
|
3046
3046
|
return { packageName: e, type: "stencil", components: $, packageLocation: i, packageJson: n };
|
|
3047
3047
|
} catch (S) {
|
|
3048
3048
|
E.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
|
|
@@ -3051,7 +3051,7 @@ Error: ${String(S)}`);
|
|
|
3051
3051
|
}
|
|
3052
3052
|
const l = ci(n.customElements);
|
|
3053
3053
|
if (l != null) {
|
|
3054
|
-
const y = u.join(i, l), g = JSON.parse(await J(y, "utf-8")), v =
|
|
3054
|
+
const y = u.join(i, l), g = JSON.parse(await J(y, "utf-8")), v = na(g), h = Sn(g, {
|
|
3055
3055
|
packageName: e,
|
|
3056
3056
|
getImportPath: r
|
|
3057
3057
|
});
|
|
@@ -3059,7 +3059,7 @@ Error: ${String(S)}`);
|
|
|
3059
3059
|
}
|
|
3060
3060
|
const p = ci(n["web-types"]);
|
|
3061
3061
|
if (p != null) {
|
|
3062
|
-
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), v =
|
|
3062
|
+
const y = u.join(i, p), g = JSON.parse(await J(y, "utf-8")), v = sa(g, {
|
|
3063
3063
|
packageName: e,
|
|
3064
3064
|
getImportPath: r,
|
|
3065
3065
|
packageRoot: i
|
|
@@ -3068,7 +3068,7 @@ Error: ${String(S)}`);
|
|
|
3068
3068
|
}
|
|
3069
3069
|
const m = u.join(i, "dist/components");
|
|
3070
3070
|
if (await _(m)) {
|
|
3071
|
-
const y = await
|
|
3071
|
+
const y = await oa(m, {
|
|
3072
3072
|
packageName: e,
|
|
3073
3073
|
getImportPath: r
|
|
3074
3074
|
});
|
|
@@ -3076,7 +3076,7 @@ Error: ${String(S)}`);
|
|
|
3076
3076
|
}
|
|
3077
3077
|
}
|
|
3078
3078
|
const ci = (e) => Array.isArray(e) ? e[0] : e;
|
|
3079
|
-
function
|
|
3079
|
+
function ia(e, t) {
|
|
3080
3080
|
const i = e.indexOf(t);
|
|
3081
3081
|
return i === -1 ? -1 : i + t.length;
|
|
3082
3082
|
}
|
|
@@ -3098,7 +3098,7 @@ function Sn(e, t) {
|
|
|
3098
3098
|
}
|
|
3099
3099
|
return i;
|
|
3100
3100
|
}
|
|
3101
|
-
const
|
|
3101
|
+
const na = (e) => e.compiler?.name === kt, sa = (e, t) => Object.fromEntries(
|
|
3102
3102
|
(e.contributions?.html?.elements ?? e.contributions?.html?.tags)?.map(
|
|
3103
3103
|
(i) => [
|
|
3104
3104
|
i.name,
|
|
@@ -3109,7 +3109,7 @@ const ia = (e) => e.compiler?.name === kt, na = (e, t) => Object.fromEntries(
|
|
|
3109
3109
|
}
|
|
3110
3110
|
]
|
|
3111
3111
|
) ?? []
|
|
3112
|
-
),
|
|
3112
|
+
), ra = (e, t) => Object.fromEntries(
|
|
3113
3113
|
e.flatMap(
|
|
3114
3114
|
([i, n]) => n.map(
|
|
3115
3115
|
([s, r, a]) => [
|
|
@@ -3127,7 +3127,7 @@ const ia = (e) => e.compiler?.name === kt, na = (e, t) => Object.fromEntries(
|
|
|
3127
3127
|
]
|
|
3128
3128
|
)
|
|
3129
3129
|
)
|
|
3130
|
-
),
|
|
3130
|
+
), oa = async (e, t) => Object.fromEntries(
|
|
3131
3131
|
(await ze(e)).filter((i) => i.endsWith(".d.ts")).map((i) => {
|
|
3132
3132
|
const n = i.slice(0, -5);
|
|
3133
3133
|
return [
|
|
@@ -3139,16 +3139,16 @@ const ia = (e) => e.compiler?.name === kt, na = (e, t) => Object.fromEntries(
|
|
|
3139
3139
|
}
|
|
3140
3140
|
];
|
|
3141
3141
|
})
|
|
3142
|
-
),
|
|
3142
|
+
), aa = (e, t) => e ? `components/${t}` : `dist/components/${t}.js`, ca = (e) => e.startsWith("/") ? e : `/${e}`, At = (e, t) => `${e}@fs${ca(t)}`;
|
|
3143
3143
|
function Ge(e = R(), t = !1, i = e.name === "@esri/calcite-components") {
|
|
3144
3144
|
const n = e.version.includes("next"), s = e.name === "@esri/calcite-components";
|
|
3145
3145
|
if (s && n)
|
|
3146
3146
|
return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/calcite/`;
|
|
3147
|
-
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a =
|
|
3147
|
+
const r = t || n ? "jsdev.arcgis.com" : "js.arcgis.com", a = la(e.name), c = da(e.version, i);
|
|
3148
3148
|
return a.length === 0 ? `https://${r}/${c}/` : s ? `https://${r}/${a}/${c}/` : `https://${r}/${c}/${a}/`;
|
|
3149
3149
|
}
|
|
3150
|
-
const
|
|
3151
|
-
function
|
|
3150
|
+
const la = (e) => e.split("/").pop() ?? e;
|
|
3151
|
+
function da(e, t) {
|
|
3152
3152
|
if (/\d+\.\d+\.\d+-(?:.*)$/u.test(e))
|
|
3153
3153
|
return "next";
|
|
3154
3154
|
const n = /^(?<major>\d+)\.(?<minor>\d+)\.(?<patch>\d+)/u, s = e.match(n);
|
|
@@ -3177,14 +3177,14 @@ function ne(e) {
|
|
|
3177
3177
|
return (
|
|
3178
3178
|
// Inlined string literal
|
|
3179
3179
|
typeof e == "string" || // Syntax kinds that are never undefined
|
|
3180
|
-
|
|
3180
|
+
pa.has(e.kind) || // Ternary with both branches never undefined
|
|
3181
3181
|
o.isConditionalExpression(e) && ne(e.whenTrue) && ne(e.whenFalse) || // Binary expression with operator that never results in undefined Or both sides are definitely not undefined
|
|
3182
|
-
o.isBinaryExpression(e) && (
|
|
3182
|
+
o.isBinaryExpression(e) && (ua.has(e.operatorToken.kind) || ne(e.left) && ne(e.right)) || // `as`, `satisfies`, `()` with definitely not undefined expression
|
|
3183
3183
|
(o.isParenthesizedExpression(e) || o.isSatisfiesExpression(e) || o.isAsExpression(e)) && ne(e.expression) || // JSX that got converted to html`<p>Something</p>`
|
|
3184
3184
|
o.isTaggedTemplateExpression(e) && o.isIdentifier(e.tag) && Br.has(e.tag.text)
|
|
3185
3185
|
);
|
|
3186
3186
|
}
|
|
3187
|
-
const
|
|
3187
|
+
const pa = /* @__PURE__ */ new Set([
|
|
3188
3188
|
o.SyntaxKind.NumericLiteral,
|
|
3189
3189
|
o.SyntaxKind.BigIntLiteral,
|
|
3190
3190
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3203,7 +3203,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3203
3203
|
o.SyntaxKind.ClassExpression,
|
|
3204
3204
|
// Trust? Trust.
|
|
3205
3205
|
o.SyntaxKind.NonNullExpression
|
|
3206
|
-
]),
|
|
3206
|
+
]), ua = /* @__PURE__ */ new Set([
|
|
3207
3207
|
o.SyntaxKind.PlusEqualsToken,
|
|
3208
3208
|
o.SyntaxKind.MinusEqualsToken,
|
|
3209
3209
|
o.SyntaxKind.AsteriskAsteriskEqualsToken,
|
|
@@ -3238,9 +3238,9 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3238
3238
|
o.SyntaxKind.SlashToken,
|
|
3239
3239
|
o.SyntaxKind.PercentToken,
|
|
3240
3240
|
o.SyntaxKind.AsteriskAsteriskToken
|
|
3241
|
-
]),
|
|
3241
|
+
]), ma = {
|
|
3242
3242
|
property(e, t, i, n) {
|
|
3243
|
-
const s =
|
|
3243
|
+
const s = fa(n, i, e), r = s?.type === "stringifiedReflected", a = s?.type === "reflected" || r;
|
|
3244
3244
|
if (a) {
|
|
3245
3245
|
const f = at(t);
|
|
3246
3246
|
if (f === !0)
|
|
@@ -3248,7 +3248,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3248
3248
|
if (f === !1)
|
|
3249
3249
|
return [];
|
|
3250
3250
|
}
|
|
3251
|
-
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] :
|
|
3251
|
+
const c = t === void 0 ? ["=", o.factory.createToken(o.SyntaxKind.TrueKeyword)] : Re(e, t, a), d = c[0] !== "=";
|
|
3252
3252
|
if (a && d)
|
|
3253
3253
|
return [s.name, ...c];
|
|
3254
3254
|
const [l, p] = c, m = s?.type === "stringifiedNonReflected";
|
|
@@ -3257,7 +3257,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3257
3257
|
p,
|
|
3258
3258
|
e,
|
|
3259
3259
|
m ? "" : void 0
|
|
3260
|
-
), g = i === "value" && (n === "input" || n === "textarea" || n ===
|
|
3260
|
+
), g = i === "value" && (n === "input" || n === "textarea" || n === Je) ? ya(f, e) : f;
|
|
3261
3261
|
if (g !== p)
|
|
3262
3262
|
return [m ? `.${i}` : s.name, l, g];
|
|
3263
3263
|
}
|
|
@@ -3269,12 +3269,12 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3269
3269
|
return [i];
|
|
3270
3270
|
if (n === !1)
|
|
3271
3271
|
return [];
|
|
3272
|
-
const s =
|
|
3272
|
+
const s = Re(e, t, !0), a = s[0] !== "=" ? s : [s[0], li(s[1], e)];
|
|
3273
3273
|
return [i, ...a];
|
|
3274
3274
|
},
|
|
3275
3275
|
booleanAttribute(e, t, i) {
|
|
3276
3276
|
const n = t === void 0 || at(t);
|
|
3277
|
-
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...
|
|
3277
|
+
return n === !0 ? [i] : n === !1 ? [] : [`?${i}`, ...Re(e, t, !1)];
|
|
3278
3278
|
},
|
|
3279
3279
|
event(e, t, i) {
|
|
3280
3280
|
if (t === void 0 || !o.isJsxExpression(t) || t.expression === void 0)
|
|
@@ -3330,7 +3330,7 @@ const da = /* @__PURE__ */ new Set([
|
|
|
3330
3330
|
return [o.factory.createIdentifier(s)];
|
|
3331
3331
|
}
|
|
3332
3332
|
};
|
|
3333
|
-
function
|
|
3333
|
+
function fa(e, t, i) {
|
|
3334
3334
|
if (typeof e == "string") {
|
|
3335
3335
|
const r = (i.externalComponents[e] ?? i.localComponents[e])?.propToAttribute?.[t];
|
|
3336
3336
|
if (r !== void 0)
|
|
@@ -3379,8 +3379,8 @@ function at(e) {
|
|
|
3379
3379
|
return !1;
|
|
3380
3380
|
}
|
|
3381
3381
|
}
|
|
3382
|
-
function
|
|
3383
|
-
if (
|
|
3382
|
+
function Re(e, t, i = !1) {
|
|
3383
|
+
if (Se(t))
|
|
3384
3384
|
throw new Error(
|
|
3385
3385
|
`Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
|
|
3386
3386
|
);
|
|
@@ -3424,7 +3424,7 @@ function pi(e, t, i) {
|
|
|
3424
3424
|
`${i} prop value must be an expression. Found ${String(t?.getText(e.sourceFile))}`
|
|
3425
3425
|
);
|
|
3426
3426
|
const n = t.expression;
|
|
3427
|
-
if (
|
|
3427
|
+
if (ga(n)) {
|
|
3428
3428
|
const r = i === "class" ? "safeClassMap" : "safeStyleMap";
|
|
3429
3429
|
e.neededImports.add(r);
|
|
3430
3430
|
const a = e.importRenames[r], c = o.factory.createCallExpression(o.factory.createIdentifier(a), void 0, [
|
|
@@ -3432,17 +3432,17 @@ function pi(e, t, i) {
|
|
|
3432
3432
|
]);
|
|
3433
3433
|
return [`${i}=`, c];
|
|
3434
3434
|
} else
|
|
3435
|
-
return [i, ...
|
|
3435
|
+
return [i, ...Re(e, t, !0)];
|
|
3436
3436
|
}
|
|
3437
|
-
const
|
|
3438
|
-
function
|
|
3437
|
+
const ga = (e) => o.isObjectLiteralExpression(e) || o.isPropertyAccessExpression(e) || o.isIdentifier(e) || o.isCallExpression(e) || o.isBinaryExpression(e) || o.isConditionalExpression(e);
|
|
3438
|
+
function ya(e, t) {
|
|
3439
3439
|
t.neededImports.add("live");
|
|
3440
3440
|
const i = t.importRenames.live;
|
|
3441
3441
|
return o.factory.createCallExpression(o.factory.createIdentifier(i), void 0, [
|
|
3442
3442
|
typeof e == "string" ? o.factory.createStringLiteral(e) : e
|
|
3443
3443
|
]);
|
|
3444
3444
|
}
|
|
3445
|
-
function
|
|
3445
|
+
function ha(e) {
|
|
3446
3446
|
if (e && o.isJsxExpression(e) && e.expression && o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text in ui && e.expression.arguments.length <= 1)
|
|
3447
3447
|
return {
|
|
3448
3448
|
propType: ui[e.expression.expression.text],
|
|
@@ -3460,15 +3460,15 @@ const ui = {
|
|
|
3460
3460
|
bindBooleanAttribute: "booleanAttribute",
|
|
3461
3461
|
bindEvent: "event"
|
|
3462
3462
|
};
|
|
3463
|
-
function
|
|
3464
|
-
return
|
|
3463
|
+
function va(e, t, i) {
|
|
3464
|
+
return Sa.has(e) ? e : e.startsWith("on") && t !== void 0 && o.isJsxExpression(t) && t.expression !== void 0 ? "event" : qi.has(e) || e.includes("-") ? "attribute" : !Pt(i) && (Gi.has(e) || (i === ft ? !1 : i === Je ? (
|
|
3465
3465
|
// When tag name is dynamic, we can't help but check if the prop name matches an "always attribute" in any html element
|
|
3466
3466
|
Object.values(gt).some((r) => r.has(e))
|
|
3467
|
-
) : gt[i]?.has(e) === !0)) ? Vt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === ft || i !==
|
|
3467
|
+
) : gt[i]?.has(e) === !0)) ? Vt.has(e) ? "booleanAttribute" : "attribute" : i === "svg" || i === "math" || i === ft || i !== Je && (Ct.has(i) || $t.has(i)) ? e in U.common.reflected || e in U.common.stringifiedReflected || e in U.common.stringifiedNonReflected ? "property" : Vt.has(e) ? "booleanAttribute" : "attribute" : "property";
|
|
3468
3468
|
}
|
|
3469
|
-
const
|
|
3469
|
+
const ba = ["class", "style", "ref", "directives", "key", "deferLoad"], Sa = new Set(ba), wa = (e) => typeof e != "string" || e.trim().length > 0;
|
|
3470
3470
|
function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
3471
|
-
const s =
|
|
3471
|
+
const s = Ta(t);
|
|
3472
3472
|
if (s.length % 2 === 0)
|
|
3473
3473
|
throw new Error("Normalized template parts array length must be odd");
|
|
3474
3474
|
const [r, ...a] = s;
|
|
@@ -3489,11 +3489,11 @@ function Ve({ key: e, parts: t, litTag: i }, n) {
|
|
|
3489
3489
|
const d = n.importRenames[c], l = o.factory.createTaggedTemplateExpression(
|
|
3490
3490
|
o.factory.createIdentifier(d),
|
|
3491
3491
|
void 0,
|
|
3492
|
-
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r),
|
|
3492
|
+
a.length === 0 ? o.factory.createNoSubstitutionTemplateLiteral(r) : o.factory.createTemplateExpression(o.factory.createTemplateHead(r), Ea(a))
|
|
3493
3493
|
);
|
|
3494
3494
|
return ct(n, e, l);
|
|
3495
3495
|
}
|
|
3496
|
-
const
|
|
3496
|
+
const Ta = (e) => e.reduce(
|
|
3497
3497
|
(t, i, n) => {
|
|
3498
3498
|
const s = t.at(-1), r = typeof s == "string", a = typeof i == "string";
|
|
3499
3499
|
if (r && a)
|
|
@@ -3503,7 +3503,7 @@ const wa = (e) => e.reduce(
|
|
|
3503
3503
|
},
|
|
3504
3504
|
[""]
|
|
3505
3505
|
);
|
|
3506
|
-
function
|
|
3506
|
+
function Ea(e) {
|
|
3507
3507
|
if (!(e.length % 2 === 0))
|
|
3508
3508
|
throw new Error("templatePartsToSpans should be called with normalized parts array without the first item");
|
|
3509
3509
|
const i = e.length / 2;
|
|
@@ -3542,13 +3542,13 @@ function Tn(e, t) {
|
|
|
3542
3542
|
);
|
|
3543
3543
|
}
|
|
3544
3544
|
const Ft = (e) => e.trim().length === 0 ? [] : o.getLeadingCommentRanges(e, 0) ?? [];
|
|
3545
|
-
function
|
|
3545
|
+
function Ca(e) {
|
|
3546
3546
|
const t = Ft(e);
|
|
3547
3547
|
if (t.length === 0)
|
|
3548
3548
|
return [e || " "];
|
|
3549
3549
|
const i = t.reduceRight(
|
|
3550
3550
|
([s, ...r], a) => {
|
|
3551
|
-
const c =
|
|
3551
|
+
const c = $a(s), d = En(c.slice(a.pos, a.end));
|
|
3552
3552
|
return [
|
|
3553
3553
|
c.slice(0, a.pos),
|
|
3554
3554
|
/**
|
|
@@ -3567,12 +3567,12 @@ function Ea(e) {
|
|
|
3567
3567
|
return (typeof n != "string" || n.trim() !== "") && i.push(" "), i;
|
|
3568
3568
|
}
|
|
3569
3569
|
const En = (e) => e.startsWith("//") ? e.slice(2) : e.slice(2, -2);
|
|
3570
|
-
function
|
|
3570
|
+
function $a(e) {
|
|
3571
3571
|
if (typeof e == "string")
|
|
3572
3572
|
return e;
|
|
3573
3573
|
throw new Error(`Expected string, got ${typeof e}: ${String(e)}`);
|
|
3574
3574
|
}
|
|
3575
|
-
function
|
|
3575
|
+
function Pa(e, t) {
|
|
3576
3576
|
if (!(o.isPropertyAccessExpression(t.expression) && t.expression.name.text === "map"))
|
|
3577
3577
|
return t;
|
|
3578
3578
|
const n = t.arguments[0];
|
|
@@ -3582,7 +3582,7 @@ function $a(e, t) {
|
|
|
3582
3582
|
if (!(typeof r == "object" && // If .map() callback has 3rd argument, it's not supported
|
|
3583
3583
|
n.parameters.length <= 2))
|
|
3584
3584
|
return t;
|
|
3585
|
-
const c =
|
|
3585
|
+
const c = Ee(n.body);
|
|
3586
3586
|
let d = !0, l;
|
|
3587
3587
|
if (mi(c))
|
|
3588
3588
|
l = c;
|
|
@@ -3592,7 +3592,7 @@ function $a(e, t) {
|
|
|
3592
3592
|
const h = c.statements.at(-1);
|
|
3593
3593
|
if (!(h && o.isReturnStatement(h) && h.expression))
|
|
3594
3594
|
return t;
|
|
3595
|
-
const S =
|
|
3595
|
+
const S = Ee(h.expression);
|
|
3596
3596
|
if (!mi(S))
|
|
3597
3597
|
return t;
|
|
3598
3598
|
const $ = c.statements.slice(0, -1);
|
|
@@ -3606,7 +3606,7 @@ function $a(e, t) {
|
|
|
3606
3606
|
const f = p.attributes.properties[m];
|
|
3607
3607
|
if (f === void 0 || !o.isJsxAttribute(f))
|
|
3608
3608
|
return t;
|
|
3609
|
-
const y = Lt(f.initializer, e.sourceFile), g =
|
|
3609
|
+
const y = Lt(f.initializer, e.sourceFile), g = xa(r, n, y, d, e);
|
|
3610
3610
|
if (g === void 0)
|
|
3611
3611
|
return t;
|
|
3612
3612
|
e.liftedKeys.add(f.name), e.neededImports.add("repeat");
|
|
@@ -3639,7 +3639,7 @@ function Cn(e) {
|
|
|
3639
3639
|
void 0
|
|
3640
3640
|
), t;
|
|
3641
3641
|
}
|
|
3642
|
-
function
|
|
3642
|
+
function xa(e, t, i, n, s) {
|
|
3643
3643
|
const r = W(i);
|
|
3644
3644
|
if (r === void 0)
|
|
3645
3645
|
return;
|
|
@@ -3655,7 +3655,7 @@ function Pa(e, t, i, n, s) {
|
|
|
3655
3655
|
return;
|
|
3656
3656
|
}
|
|
3657
3657
|
if (!n) {
|
|
3658
|
-
const d =
|
|
3658
|
+
const d = Ia(r, a, t);
|
|
3659
3659
|
if (d === void 0)
|
|
3660
3660
|
return;
|
|
3661
3661
|
a = d;
|
|
@@ -3685,15 +3685,15 @@ function W(e) {
|
|
|
3685
3685
|
const t = W(e.left), i = W(e.right);
|
|
3686
3686
|
return t === void 0 || i === void 0 ? void 0 : [...t, ...i];
|
|
3687
3687
|
} else {
|
|
3688
|
-
if (
|
|
3688
|
+
if (ka.has(e.kind))
|
|
3689
3689
|
return [];
|
|
3690
3690
|
{
|
|
3691
|
-
const t =
|
|
3691
|
+
const t = Ee(e);
|
|
3692
3692
|
return t !== e ? W(t) : void 0;
|
|
3693
3693
|
}
|
|
3694
3694
|
}
|
|
3695
3695
|
}
|
|
3696
|
-
const
|
|
3696
|
+
const ka = /* @__PURE__ */ new Set([
|
|
3697
3697
|
o.SyntaxKind.NumericLiteral,
|
|
3698
3698
|
o.SyntaxKind.BigIntLiteral,
|
|
3699
3699
|
o.SyntaxKind.StringLiteral,
|
|
@@ -3702,12 +3702,12 @@ const xa = /* @__PURE__ */ new Set([
|
|
|
3702
3702
|
o.SyntaxKind.FalseKeyword,
|
|
3703
3703
|
o.SyntaxKind.NullKeyword,
|
|
3704
3704
|
o.SyntaxKind.TrueKeyword
|
|
3705
|
-
]),
|
|
3706
|
-
function
|
|
3705
|
+
]), Ee = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? Ee(e.expression) : e, $n = (e, t) => o.isObjectBindingPattern(e) ? Fa(e, t) : e;
|
|
3706
|
+
function Ia(e, t, i) {
|
|
3707
3707
|
if (e.every(Ue, t))
|
|
3708
3708
|
return t;
|
|
3709
3709
|
if (o.isIdentifier(t)) {
|
|
3710
|
-
const n = o.isBlock(i.body) ? ve(i.body.statements, (r) =>
|
|
3710
|
+
const n = o.isBlock(i.body) ? ve(i.body.statements, (r) => Aa(r, t)) : void 0;
|
|
3711
3711
|
if (n === void 0)
|
|
3712
3712
|
return;
|
|
3713
3713
|
const s = $n(n, e);
|
|
@@ -3715,7 +3715,7 @@ function ka(e, t, i) {
|
|
|
3715
3715
|
return s;
|
|
3716
3716
|
}
|
|
3717
3717
|
}
|
|
3718
|
-
function
|
|
3718
|
+
function Aa(e, t) {
|
|
3719
3719
|
if (!o.isVariableStatement(e) || !(e.declarationList.flags & o.NodeFlags.Const))
|
|
3720
3720
|
return;
|
|
3721
3721
|
const i = e.declarationList.declarations[0];
|
|
@@ -3723,19 +3723,19 @@ function Ia(e, t) {
|
|
|
3723
3723
|
}
|
|
3724
3724
|
function Ue(e) {
|
|
3725
3725
|
const t = this;
|
|
3726
|
-
return o.isIdentifier(t) ? t.text === e : t.elements.some(
|
|
3726
|
+
return o.isIdentifier(t) ? t.text === e : t.elements.some(La, e);
|
|
3727
3727
|
}
|
|
3728
|
-
function
|
|
3728
|
+
function La(e) {
|
|
3729
3729
|
const t = this;
|
|
3730
3730
|
return o.isOmittedExpression(e) ? !1 : Ue.call(e.name, t);
|
|
3731
3731
|
}
|
|
3732
|
-
function
|
|
3732
|
+
function Fa(e, t) {
|
|
3733
3733
|
let i = !1;
|
|
3734
3734
|
const n = e.elements.filter((s) => o.isIdentifier(s.name) ? t.includes(s.name.text) : (i = !0, !0));
|
|
3735
3735
|
return i || n.length === 0 ? e : o.factory.updateObjectBindingPattern(e, n);
|
|
3736
3736
|
}
|
|
3737
|
-
const Pn = (e, t) => t.liftedKeys.has(e),
|
|
3738
|
-
`),
|
|
3737
|
+
const Pn = (e, t) => t.liftedKeys.has(e), Na = (e) => e.apiJsonComponents.map(({ name: t, importPath: i }) => `import type { ${t} } from "./${i}";`).join(`
|
|
3738
|
+
`), Da = /^[a-zA-Z_$][a-zA-Z\d_$]*$/u, Xe = (e) => !Da.test(e), $e = (e) => Xe(e) ? `"${e}"` : e;
|
|
3739
3739
|
function Qe(e, t) {
|
|
3740
3740
|
const i = [], n = [];
|
|
3741
3741
|
let s = !1;
|
|
@@ -3759,15 +3759,15 @@ type ${e}SetterTypes = ${e}["${zi}"]` : "", l = c.filter(Boolean).join(", ");
|
|
|
3759
3759
|
}
|
|
3760
3760
|
const fi = (e) => e.map((t) => `'${t}'`).join(" | ");
|
|
3761
3761
|
function q(e, t, i) {
|
|
3762
|
-
if (
|
|
3762
|
+
if (Se(i))
|
|
3763
3763
|
return xn(e, i);
|
|
3764
|
-
const n = o.isCallExpression(i) ?
|
|
3764
|
+
const n = o.isCallExpression(i) ? Pa(e, i) : i, s = o.visitEachChild(
|
|
3765
3765
|
n,
|
|
3766
3766
|
// Do not add "" if parent is binary expression to not turn {(a && <b />) || c} into {(a && <b />) || "" || c}
|
|
3767
3767
|
q.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
|
|
3768
3768
|
e.transformationContext
|
|
3769
3769
|
);
|
|
3770
|
-
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) ||
|
|
3770
|
+
return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || Se(Ee(i.right)) || Hr(i.right)) ? Ma(s) : s;
|
|
3771
3771
|
}
|
|
3772
3772
|
function xn(e, t) {
|
|
3773
3773
|
const i = kn(e, t);
|
|
@@ -3776,24 +3776,24 @@ function xn(e, t) {
|
|
|
3776
3776
|
function kn(e, t) {
|
|
3777
3777
|
const i = "children" in t ? t.children : [];
|
|
3778
3778
|
if (o.isJsxFragment(t))
|
|
3779
|
-
return { key: void 0, ...
|
|
3779
|
+
return { key: void 0, ...Me(i, e) };
|
|
3780
3780
|
const s = o.isJsxElement(t) ? t.openingElement : t, r = s.tagName;
|
|
3781
3781
|
if (o.isJsxNamespacedName(r))
|
|
3782
3782
|
throw Error(`JSX namespaced elements are not supported. Found ${r.getText(e.sourceFile)} `);
|
|
3783
3783
|
if (!o.isIdentifier(r) || !r.text.startsWith(r.text[0].toLowerCase()) && r.text !== tt && r.text !== it) {
|
|
3784
|
-
const P = o.isIdentifier(r) && r.text === Pr ?
|
|
3784
|
+
const P = o.isIdentifier(r) && r.text === Pr ? Me(i, e) : {
|
|
3785
3785
|
// No need to wrap the function call in a lit-html tag
|
|
3786
3786
|
litTag: void 0,
|
|
3787
|
-
parts: [
|
|
3787
|
+
parts: [Ra(e, t, r, i)]
|
|
3788
3788
|
};
|
|
3789
3789
|
return {
|
|
3790
|
-
key:
|
|
3790
|
+
key: ja(s, e),
|
|
3791
3791
|
...P
|
|
3792
3792
|
};
|
|
3793
3793
|
}
|
|
3794
|
-
const c = r.text === tt ?
|
|
3794
|
+
const c = r.text === tt ? Je : r.text === it ? ft : r.text, d = r.text === tt ? le : r.text === it ? Z : kr.has(c) ? Zi : Ct.has(c) ? oe : de, l = Pt(c);
|
|
3795
3795
|
let p;
|
|
3796
|
-
l && e.compiler.viteCommand === "build" && (p =
|
|
3796
|
+
l && e.compiler.viteCommand === "build" && (p = Oa(e, c));
|
|
3797
3797
|
let m;
|
|
3798
3798
|
const f = [];
|
|
3799
3799
|
let y = !1;
|
|
@@ -3806,13 +3806,13 @@ Found ${A.getText(e.sourceFile)}`
|
|
|
3806
3806
|
const { name: P, initializer: w } = A;
|
|
3807
3807
|
if (o.isJsxNamespacedName(P))
|
|
3808
3808
|
throw Error(`JSX namespaced attributes are not supported. Found ${P.getText(e.sourceFile)}`);
|
|
3809
|
-
const C = P.text, L =
|
|
3809
|
+
const C = P.text, L = ha(w), F = L?.propType ?? va(C, w, c);
|
|
3810
3810
|
p?.delete(C);
|
|
3811
|
-
const N =
|
|
3811
|
+
const N = ma[F](e, L?.initializer ?? w, C, c);
|
|
3812
3812
|
if (N.length === 0)
|
|
3813
3813
|
return [];
|
|
3814
|
-
const M = e.compiler.shouldMinifyJsx ? [" "] :
|
|
3815
|
-
return F === "key" ? (m = typeof N[0] == "object" && !Pn(P, e) ? N[0] : void 0, M.some(
|
|
3814
|
+
const M = e.compiler.shouldMinifyJsx ? [" "] : Ca(wn(P, e));
|
|
3815
|
+
return F === "key" ? (m = typeof N[0] == "object" && !Pn(P, e) ? N[0] : void 0, M.some(wa) ? M : []) : F === "directives" || F === "ref" || C === "deferLoad" ? (y ||= F === "deferLoad", f.push(
|
|
3816
3816
|
...M,
|
|
3817
3817
|
...N.flatMap(
|
|
3818
3818
|
(z, K) => typeof z == "string" || K === 0 || typeof N[K - 1] == "string" ? z : [" ", z]
|
|
@@ -3828,7 +3828,7 @@ Found ${A.getText(e.sourceFile)}`
|
|
|
3828
3828
|
`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`
|
|
3829
3829
|
);
|
|
3830
3830
|
l && (y ? e.customElementsToImportDeferred.add(c) : e.customElementsToImport.add(c));
|
|
3831
|
-
const v = typeof c == "string" && xr.has(c), h =
|
|
3831
|
+
const v = typeof c == "string" && xr.has(c), h = Me(i, e);
|
|
3832
3832
|
if (v && h.parts.length > 0)
|
|
3833
3833
|
throw Error(
|
|
3834
3834
|
`Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
|
|
@@ -3852,12 +3852,12 @@ Found ${A.getText(e.sourceFile)}`
|
|
|
3852
3852
|
];
|
|
3853
3853
|
return { key: m, parts: $, litTag: d };
|
|
3854
3854
|
}
|
|
3855
|
-
function
|
|
3855
|
+
function ja(e, t) {
|
|
3856
3856
|
const i = e.attributes.properties[In(e)];
|
|
3857
3857
|
return i && o.isJsxAttribute(i) && !Pn(i.name, t) ? Lt(i.initializer, t.sourceFile) : void 0;
|
|
3858
3858
|
}
|
|
3859
3859
|
const In = (e) => e.attributes.properties.findIndex(({ name: t }) => t && o.isIdentifier(t) && t.text === "key");
|
|
3860
|
-
function
|
|
3860
|
+
function Ra(e, t, i, n) {
|
|
3861
3861
|
const r = (o.isJsxElement(t) ? t.openingElement : t).attributes.properties.map((d) => {
|
|
3862
3862
|
if (o.isJsxSpreadAttribute(d))
|
|
3863
3863
|
return Tn(wn(d, e), o.factory.createSpreadAssignment(d.expression));
|
|
@@ -3866,9 +3866,9 @@ function ja(e, t, i, n) {
|
|
|
3866
3866
|
throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
|
|
3867
3867
|
if (l.text === "key")
|
|
3868
3868
|
return;
|
|
3869
|
-
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p :
|
|
3869
|
+
const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : Se(p) ? xn(e, p) : q(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Xe(l.text) ? o.factory.createStringLiteral(l.text) : l;
|
|
3870
3870
|
return o.factory.createPropertyAssignment(f, m);
|
|
3871
|
-
}), { parts: a, litTag: c } =
|
|
3871
|
+
}), { parts: a, litTag: c } = Me(n, e);
|
|
3872
3872
|
return a.length > 0 && r.push(
|
|
3873
3873
|
o.factory.createPropertyAssignment(
|
|
3874
3874
|
o.factory.createIdentifier("children"),
|
|
@@ -3878,7 +3878,7 @@ function ja(e, t, i, n) {
|
|
|
3878
3878
|
o.factory.createObjectLiteralExpression(r.filter(j))
|
|
3879
3879
|
]);
|
|
3880
3880
|
}
|
|
3881
|
-
function
|
|
3881
|
+
function Me(e, t) {
|
|
3882
3882
|
let i;
|
|
3883
3883
|
const n = e.flatMap((s) => {
|
|
3884
3884
|
if (o.isJsxText(s))
|
|
@@ -3901,7 +3901,7 @@ function Re(e, t) {
|
|
|
3901
3901
|
});
|
|
3902
3902
|
return { litTag: i, parts: n };
|
|
3903
3903
|
}
|
|
3904
|
-
function
|
|
3904
|
+
function Ma(e) {
|
|
3905
3905
|
return e.operatorToken.kind === o.SyntaxKind.AmpersandAmpersandToken ? o.factory.createBinaryExpression(
|
|
3906
3906
|
e,
|
|
3907
3907
|
o.factory.createToken(o.SyntaxKind.BarBarToken),
|
|
@@ -3952,7 +3952,7 @@ function Nt(e, t, i) {
|
|
|
3952
3952
|
] : [q(e, i, t.expression)]
|
|
3953
3953
|
);
|
|
3954
3954
|
}
|
|
3955
|
-
function
|
|
3955
|
+
function Oa(e, t) {
|
|
3956
3956
|
if (t in e.localComponents)
|
|
3957
3957
|
for (const n of e.compiler.privateApiJson.modules)
|
|
3958
3958
|
for (const s of n.declarations) {
|
|
@@ -3969,17 +3969,17 @@ const An = (e) => e.reduce((t, [i, n]) => (t[i] ??= [], t[i].push(n), t), {}), L
|
|
|
3969
3969
|
([e, t]) => t.map((i) => [i, e])
|
|
3970
3970
|
)
|
|
3971
3971
|
), Fn = new Set(Object.keys(Ln));
|
|
3972
|
-
function
|
|
3972
|
+
function Ja(e, t) {
|
|
3973
3973
|
const i = t.importClause, n = i === void 0, s = t.moduleSpecifier;
|
|
3974
3974
|
if (!o.isStringLiteral(s))
|
|
3975
3975
|
return t;
|
|
3976
|
-
const r =
|
|
3976
|
+
const r = Ka(e.sourceFile.fileName, s.text, ""), a = !i?.isTypeOnly;
|
|
3977
3977
|
if (a && e.existingImportedModules.add(r), nn.test(s.text) && // If id already includes ?, bypass our custom behavior
|
|
3978
3978
|
!s.text.includes("?")) {
|
|
3979
3979
|
if (n) {
|
|
3980
3980
|
if (e.compiler.viteCommand !== "build" || e.compiler.isInStorybook || e.compiler.isInTest)
|
|
3981
3981
|
return t;
|
|
3982
|
-
const l = e.sourceFile.fileName, p =
|
|
3982
|
+
const l = e.sourceFile.fileName, p = jo(l), m = `import "${s.text}"`;
|
|
3983
3983
|
throw Error(
|
|
3984
3984
|
p ? `Unexpected case: during build, all node_modules runtime dependencies should be externalized (unless explicitly configured otherwise). ${l} is not externalized, and it contains a side-effect CSS import \`${m}\`. How should such CSS import be handled? Options:
|
|
3985
3985
|
1. (suggested) Externalize ${l}, which will make end-user's bundler treat this CSS import as global CSS.
|
|
@@ -4020,11 +4020,11 @@ function Oa(e, t) {
|
|
|
4020
4020
|
a && !l.isTypeOnly && f && y && e.importedFunctionComponentsFromModules.add(r);
|
|
4021
4021
|
}), t;
|
|
4022
4022
|
}
|
|
4023
|
-
const Nn = (e, t) => e === de && ae.staticHtml.includes(t) ? le : e === oe && ae.staticSvg.includes(t) ? Z : e,
|
|
4024
|
-
function
|
|
4025
|
-
return o.isImportDeclaration(e) ?
|
|
4023
|
+
const Nn = (e, t) => e === de && ae.staticHtml.includes(t) ? le : e === oe && ae.staticSvg.includes(t) ? Z : e, Ka = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
|
|
4024
|
+
function Ba(e) {
|
|
4025
|
+
return o.isImportDeclaration(e) ? Wa(this, e) : e;
|
|
4026
4026
|
}
|
|
4027
|
-
function
|
|
4027
|
+
function Wa(e, t) {
|
|
4028
4028
|
const i = t.importClause, n = i?.namedBindings, s = t.moduleSpecifier;
|
|
4029
4029
|
if (!o.isStringLiteral(s) || !n || !o.isNamedImports(n) || !Fn.has(s.text))
|
|
4030
4030
|
return t;
|
|
@@ -4049,7 +4049,7 @@ function Ba(e, t) {
|
|
|
4049
4049
|
t.attributes
|
|
4050
4050
|
) : t;
|
|
4051
4051
|
}
|
|
4052
|
-
function
|
|
4052
|
+
function _a(e) {
|
|
4053
4053
|
const t = An(
|
|
4054
4054
|
Array.from(e.neededImports, (i) => [ae[i][0], i])
|
|
4055
4055
|
);
|
|
@@ -4075,8 +4075,8 @@ function Dn(e, t) {
|
|
|
4075
4075
|
o.factory.createIdentifier(n)
|
|
4076
4076
|
);
|
|
4077
4077
|
}
|
|
4078
|
-
function
|
|
4079
|
-
const t =
|
|
4078
|
+
function Ua(e) {
|
|
4079
|
+
const t = Yo().map(({ packageName: i }) => i);
|
|
4080
4080
|
return e.existingImportedModules.forEach((i) => {
|
|
4081
4081
|
if (u.isAbsolute(i))
|
|
4082
4082
|
return;
|
|
@@ -4089,7 +4089,7 @@ function _a(e) {
|
|
|
4089
4089
|
}
|
|
4090
4090
|
}), [];
|
|
4091
4091
|
}
|
|
4092
|
-
function
|
|
4092
|
+
function Ha(e) {
|
|
4093
4093
|
if (e.compiler.viteCommand === "serve")
|
|
4094
4094
|
return e.customElementsToImport.clear(), e.customElementsToImportDeferred.clear(), [];
|
|
4095
4095
|
const t = e.compiler._customElementDependencies;
|
|
@@ -4104,7 +4104,7 @@ function Ua(e) {
|
|
|
4104
4104
|
t[n] ??= { referencedBy: [], referencedTagNames: [], referencedDeferredTagNames: [] }, t[n].referencedBy.push(e.sourceFile.fileName);
|
|
4105
4105
|
}), [];
|
|
4106
4106
|
}
|
|
4107
|
-
function
|
|
4107
|
+
function za(e, t, i) {
|
|
4108
4108
|
const n = vn()[t] ?? jn(e)[t];
|
|
4109
4109
|
if (n === void 0) {
|
|
4110
4110
|
if (e.options?.build?.dependencies?.silenceUnknownJsxElementUsage?.(t, i, e) === !0)
|
|
@@ -4119,7 +4119,7 @@ function Ha(e, t, i) {
|
|
|
4119
4119
|
}
|
|
4120
4120
|
return n;
|
|
4121
4121
|
}
|
|
4122
|
-
function
|
|
4122
|
+
function qa(e, t) {
|
|
4123
4123
|
return e.packageName === void 0 ? ce(t, e.moduleName) : u.join(e.packageName, e.moduleName);
|
|
4124
4124
|
}
|
|
4125
4125
|
function jn(e) {
|
|
@@ -4130,7 +4130,7 @@ function jn(e) {
|
|
|
4130
4130
|
}
|
|
4131
4131
|
}), e._localDefinedComponents;
|
|
4132
4132
|
}
|
|
4133
|
-
const
|
|
4133
|
+
const Ga = (e, t) => {
|
|
4134
4134
|
const i = e.pragmas;
|
|
4135
4135
|
if (i?.has("jsx") === !0 || i?.has("jsxImportSource") === !0)
|
|
4136
4136
|
return e.statements;
|
|
@@ -4140,7 +4140,7 @@ const qa = (e, t) => {
|
|
|
4140
4140
|
localComponents: t.compiler.isInPuppeteerTestBackEnd ? {} : jn(t.compiler),
|
|
4141
4141
|
sourceFile: e,
|
|
4142
4142
|
transformationContext: t.transformation,
|
|
4143
|
-
importRenames:
|
|
4143
|
+
importRenames: Va(e),
|
|
4144
4144
|
existingImportedModules: /* @__PURE__ */ new Set(),
|
|
4145
4145
|
importedFunctionComponentsFromModules: /* @__PURE__ */ new Set(),
|
|
4146
4146
|
existingLitImports: /* @__PURE__ */ new Set(),
|
|
@@ -4156,18 +4156,18 @@ const qa = (e, t) => {
|
|
|
4156
4156
|
let s = [];
|
|
4157
4157
|
if (e.statements.every((a) => {
|
|
4158
4158
|
if (o.isImportDeclaration(a)) {
|
|
4159
|
-
if (s.push(
|
|
4159
|
+
if (s.push(Ja(n, a)), n.hasNonLuminaJsxImport)
|
|
4160
4160
|
return !1;
|
|
4161
4161
|
} else
|
|
4162
4162
|
s.push(q(n, void 0, a));
|
|
4163
4163
|
return !0;
|
|
4164
4164
|
}), n.hasNonLuminaJsxImport)
|
|
4165
4165
|
return e.statements;
|
|
4166
|
-
if (n.neededImports.size > 0 && (s = s.map(
|
|
4166
|
+
if (n.neededImports.size > 0 && (s = s.map(Ba, n), n.existingLitImports.size > 0))
|
|
4167
4167
|
throw new Error(
|
|
4168
4168
|
`Expected context.existingLitImports to be empty by now. Found: ${Array.from(n.existingLitImports).join(", ")}`
|
|
4169
4169
|
);
|
|
4170
|
-
const r = [
|
|
4170
|
+
const r = [_a, Ua, Ha].flatMap(
|
|
4171
4171
|
(a) => a(n)
|
|
4172
4172
|
);
|
|
4173
4173
|
if (n.neededImports.size > 0)
|
|
@@ -4176,18 +4176,18 @@ const qa = (e, t) => {
|
|
|
4176
4176
|
);
|
|
4177
4177
|
return [...r, ...s];
|
|
4178
4178
|
};
|
|
4179
|
-
function
|
|
4180
|
-
return
|
|
4179
|
+
function Va(e) {
|
|
4180
|
+
return Xa(e), Object.fromEntries(
|
|
4181
4181
|
Ur.map((t) => [t, e.identifiers.has(t) ? `${t}$jsx` : t])
|
|
4182
4182
|
);
|
|
4183
4183
|
}
|
|
4184
|
-
function
|
|
4184
|
+
function Xa(e) {
|
|
4185
4185
|
if (!("identifiers" in e))
|
|
4186
4186
|
throw new Error(
|
|
4187
4187
|
"Expected sourceFile to have an undocumented identifiers property that is a Map<string,string>. If this error is thrown, it may mean Lumina Compiler needs to be updated to support the version of TypeScript being used."
|
|
4188
4188
|
);
|
|
4189
4189
|
}
|
|
4190
|
-
function
|
|
4190
|
+
function Qa(e, t, i) {
|
|
4191
4191
|
return t.size === 0 ? e : [
|
|
4192
4192
|
o.factory.createPropertyDeclaration(
|
|
4193
4193
|
[
|
|
@@ -4201,7 +4201,7 @@ function Xa(e, t, i) {
|
|
|
4201
4201
|
Array.from(t.entries()).map(
|
|
4202
4202
|
([n, s]) => o.factory.createPropertyAssignment(
|
|
4203
4203
|
Xe(n) ? o.factory.createStringLiteral(n) : n,
|
|
4204
|
-
|
|
4204
|
+
Za(s, i)
|
|
4205
4205
|
)
|
|
4206
4206
|
)
|
|
4207
4207
|
)
|
|
@@ -4209,7 +4209,7 @@ function Xa(e, t, i) {
|
|
|
4209
4209
|
...e
|
|
4210
4210
|
];
|
|
4211
4211
|
}
|
|
4212
|
-
function
|
|
4212
|
+
function Za(e, t) {
|
|
4213
4213
|
let i = 0, n = !0;
|
|
4214
4214
|
const s = [], r = [];
|
|
4215
4215
|
for (const d of e.properties)
|
|
@@ -4251,7 +4251,7 @@ function Qa(e, t) {
|
|
|
4251
4251
|
...t ? [] : [o.factory.createObjectLiteralExpression(r)]
|
|
4252
4252
|
]);
|
|
4253
4253
|
}
|
|
4254
|
-
function
|
|
4254
|
+
function Ya(e, t, i, n, s) {
|
|
4255
4255
|
let r = -1, a = -1, c = -1;
|
|
4256
4256
|
t.options?.properties.forEach((f, y) => {
|
|
4257
4257
|
if (o.isSpreadAssignment(f))
|
|
@@ -4263,23 +4263,23 @@ function Za(e, t, i, n, s) {
|
|
|
4263
4263
|
g === "type" ? r = y : g === "attribute" ? a = y : g === "readOnly" && (c = y);
|
|
4264
4264
|
}
|
|
4265
4265
|
});
|
|
4266
|
-
const d = s.attribute === void 0 && a === -1, l = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p =
|
|
4266
|
+
const d = s.attribute === void 0 && a === -1, l = s.readonly === !0 && s.docsOnlyReadonly !== !0 && c === -1, p = ec(e, t, i, s, r), m = [
|
|
4267
4267
|
...d ? [o.factory.createPropertyAssignment("attribute", o.factory.createFalse())] : [],
|
|
4268
4268
|
...l ? [o.factory.createPropertyAssignment("readOnly", o.factory.createTrue())] : [],
|
|
4269
4269
|
...p !== void 0 ? [p] : []
|
|
4270
4270
|
];
|
|
4271
4271
|
return m.length > 0 ? t.options === void 0 ? o.factory.createObjectLiteralExpression(m, !1) : o.factory.updateObjectLiteralExpression(t.options, [...t.options.properties, ...m]) : t.options;
|
|
4272
4272
|
}
|
|
4273
|
-
function
|
|
4273
|
+
function ec(e, t, i, n, s) {
|
|
4274
4274
|
if (n.attribute === void 0)
|
|
4275
4275
|
return;
|
|
4276
|
-
const r =
|
|
4276
|
+
const r = ic(e), a = i.compiler.viteCommand === "serve" || r !== "Other" ? r : tc(n.type.values);
|
|
4277
4277
|
return a === "Other" || n.readonly && (a !== "Boolean" || !n.reflects) || t.options?.properties[s] !== void 0 ? void 0 : o.factory.createPropertyAssignment(
|
|
4278
4278
|
o.factory.createIdentifier("type"),
|
|
4279
4279
|
o.factory.createIdentifier(a)
|
|
4280
4280
|
);
|
|
4281
4281
|
}
|
|
4282
|
-
function
|
|
4282
|
+
function tc(e) {
|
|
4283
4283
|
let t = !1, i = !1, n = !1;
|
|
4284
4284
|
if (e?.forEach((s) => {
|
|
4285
4285
|
t ||= s.type === "number", i ||= s.type === "boolean", n ||= s.type === "string" || s.type === "any" || s.type === "unknown";
|
|
@@ -4291,7 +4291,7 @@ function ec(e) {
|
|
|
4291
4291
|
}
|
|
4292
4292
|
return "Other";
|
|
4293
4293
|
}
|
|
4294
|
-
function
|
|
4294
|
+
function ic(e) {
|
|
4295
4295
|
const t = e.type ?? (o.isSetAccessor(e) ? e.parameters[0].type : void 0);
|
|
4296
4296
|
if (t === void 0) {
|
|
4297
4297
|
if ("initializer" in e && e.initializer !== void 0) {
|
|
@@ -4308,7 +4308,7 @@ function tc(e) {
|
|
|
4308
4308
|
}
|
|
4309
4309
|
return "Other";
|
|
4310
4310
|
}
|
|
4311
|
-
function
|
|
4311
|
+
function nc(e, t, i, n, s) {
|
|
4312
4312
|
if (t.modifiers === void 0)
|
|
4313
4313
|
return t;
|
|
4314
4314
|
let r = -1, a = -1;
|
|
@@ -4318,7 +4318,7 @@ function ic(e, t, i, n, s) {
|
|
|
4318
4318
|
l === "property" && (r = d), l === "state" && (a = d);
|
|
4319
4319
|
}
|
|
4320
4320
|
}), r !== -1) {
|
|
4321
|
-
const c =
|
|
4321
|
+
const c = sc(e, t, i, n), d = gi(t, r, n), l = Ya(t, d, e, n, c);
|
|
4322
4322
|
let p = !1;
|
|
4323
4323
|
return s.set(c.name, l ?? o.factory.createObjectLiteralExpression()), p = !0, d.options = l, yi(t, d, r, p);
|
|
4324
4324
|
} else if (a !== -1) {
|
|
@@ -4329,7 +4329,7 @@ function ic(e, t, i, n, s) {
|
|
|
4329
4329
|
} else
|
|
4330
4330
|
return t;
|
|
4331
4331
|
}
|
|
4332
|
-
function
|
|
4332
|
+
function sc(e, t, i, n) {
|
|
4333
4333
|
const s = e.apiModule?.declarations.find(
|
|
4334
4334
|
(a) => a.name === i
|
|
4335
4335
|
) ?? (e.compiler.isInTest ? {
|
|
@@ -4396,16 +4396,16 @@ function yi(e, t, i, n) {
|
|
|
4396
4396
|
e.initializer
|
|
4397
4397
|
);
|
|
4398
4398
|
}
|
|
4399
|
-
const
|
|
4399
|
+
const rc = (e, t) => {
|
|
4400
4400
|
if (t.apiModule === void 0 && !t.compiler.isInTest)
|
|
4401
4401
|
return e.statements;
|
|
4402
4402
|
let i;
|
|
4403
4403
|
function n() {
|
|
4404
4404
|
i = /* @__PURE__ */ new Map();
|
|
4405
4405
|
}
|
|
4406
|
-
const s = (c) =>
|
|
4406
|
+
const s = (c) => Qa(c, i, t.compiler.shouldMinify);
|
|
4407
4407
|
function r(c, d) {
|
|
4408
|
-
const l =
|
|
4408
|
+
const l = ac(t, c, d, e, i);
|
|
4409
4409
|
return t.compiler.viteCommand === "build" && o.setEmitFlags(l, o.EmitFlags.NoComments), l;
|
|
4410
4410
|
}
|
|
4411
4411
|
return e.statements.map(
|
|
@@ -4439,11 +4439,11 @@ function Rn(e, t, i, n, s = Mi) {
|
|
|
4439
4439
|
i.transformation
|
|
4440
4440
|
) : t;
|
|
4441
4441
|
}
|
|
4442
|
-
const
|
|
4443
|
-
function
|
|
4442
|
+
const oc = /* @__PURE__ */ new Set(["connectedCallback", "disconnectedCallback"]);
|
|
4443
|
+
function ac(e, t, i, n, s) {
|
|
4444
4444
|
if (o.isMethodDeclaration(t)) {
|
|
4445
4445
|
const r = t.modifiers?.filter(
|
|
4446
|
-
(a) => !o.isDecorator(a) || !
|
|
4446
|
+
(a) => !o.isDecorator(a) || !cc(a)
|
|
4447
4447
|
);
|
|
4448
4448
|
if (r?.length !== t.modifiers?.length)
|
|
4449
4449
|
return o.factory.updateMethodDeclaration(
|
|
@@ -4457,7 +4457,7 @@ function oc(e, t, i, n, s) {
|
|
|
4457
4457
|
t.type,
|
|
4458
4458
|
t.body
|
|
4459
4459
|
);
|
|
4460
|
-
if ("text" in t.name &&
|
|
4460
|
+
if ("text" in t.name && oc.has(t.name.text) && t.body) {
|
|
4461
4461
|
const a = t.name.text;
|
|
4462
4462
|
return t.body.statements.some(
|
|
4463
4463
|
(d) => o.isExpressionStatement(d) && o.isCallExpression(d.expression) && o.isPropertyAccessExpression(d.expression.expression) && d.expression.expression.expression.kind === o.SyntaxKind.SuperKeyword && d.expression.expression.name.text === a
|
|
@@ -4483,12 +4483,12 @@ function oc(e, t, i, n, s) {
|
|
|
4483
4483
|
);
|
|
4484
4484
|
}
|
|
4485
4485
|
}
|
|
4486
|
-
return o.isPropertyDeclaration(t) || o.isAccessor(t) ?
|
|
4486
|
+
return o.isPropertyDeclaration(t) || o.isAccessor(t) ? nc(e, t, i, n, s) : t;
|
|
4487
4487
|
}
|
|
4488
|
-
const
|
|
4488
|
+
const cc = (e) => o.isCallExpression(e.expression) && o.isIdentifier(e.expression.expression) && e.expression.expression.text === "method", vt = "@arcgis/core", lt = R(), Pe = vt in (lt.dependencies ?? {}) || vt in (lt.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
|
|
4489
4489
|
lt.name === "@arcgis/lumina";
|
|
4490
|
-
async function
|
|
4491
|
-
if (
|
|
4490
|
+
async function lc(e, t) {
|
|
4491
|
+
if (!Pe)
|
|
4492
4492
|
return [];
|
|
4493
4493
|
const i = await Fi(vt);
|
|
4494
4494
|
if (t === "cdn") {
|
|
@@ -4518,8 +4518,8 @@ const hi = (e) => ({
|
|
|
4518
4518
|
cssHref: `${e}esri/themes/light/main.css`,
|
|
4519
4519
|
// This is used be the theme switcher in `@arcgis/storybook-utils`
|
|
4520
4520
|
id: "arcgisCoreStylesheet"
|
|
4521
|
-
}), vi = "makeRuntime(",
|
|
4522
|
-
function
|
|
4521
|
+
}), vi = "makeRuntime(", dc = "@arcgis/core";
|
|
4522
|
+
function pc(e, t) {
|
|
4523
4523
|
const i = e.indexOf(vi);
|
|
4524
4524
|
if (i === -1)
|
|
4525
4525
|
throw new Error("Failed to find makeRuntime() function call in src/runtime.ts");
|
|
@@ -4536,8 +4536,8 @@ function dc(e, t) {
|
|
|
4536
4536
|
s === void 0 ? "" : "commonStyles",
|
|
4537
4537
|
"}",
|
|
4538
4538
|
e.slice(n),
|
|
4539
|
-
|
|
4540
|
-
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${
|
|
4539
|
+
Pe ? `
|
|
4540
|
+
import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${dc}/applications/Components/reactiveUtils.js";
|
|
4541
4541
|
createObservable,
|
|
4542
4542
|
runtime.t = trackAccess;
|
|
4543
4543
|
runtime.o = createObservable;
|
|
@@ -4547,15 +4547,15 @@ runtime.r = runTracked;` : ""
|
|
|
4547
4547
|
map: null
|
|
4548
4548
|
};
|
|
4549
4549
|
}
|
|
4550
|
-
function
|
|
4551
|
-
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${
|
|
4550
|
+
function uc(e) {
|
|
4551
|
+
return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${xe}/${ee}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
|
|
4552
4552
|
`;
|
|
4553
4553
|
}
|
|
4554
|
-
const
|
|
4555
|
-
|
|
4554
|
+
const mc = [
|
|
4555
|
+
Ga,
|
|
4556
4556
|
Hs,
|
|
4557
|
-
|
|
4558
|
-
], bi = "@arcgis/lumina:transformComponents",
|
|
4557
|
+
rc
|
|
4558
|
+
], bi = "@arcgis/lumina:transformComponents", fc = (e) => ({
|
|
4559
4559
|
name: bi,
|
|
4560
4560
|
transform: {
|
|
4561
4561
|
// Transform JSX to lit-html first so that vite:esbuild doesn't transform JSX to h().
|
|
@@ -4569,15 +4569,15 @@ const uc = [
|
|
|
4569
4569
|
i
|
|
4570
4570
|
);
|
|
4571
4571
|
else if (i === `${e.dir.src}runtime.ts`)
|
|
4572
|
-
return
|
|
4572
|
+
return pc(t, e);
|
|
4573
4573
|
return;
|
|
4574
4574
|
}
|
|
4575
4575
|
const n = e.getSourceFile(i, t);
|
|
4576
|
-
await
|
|
4576
|
+
await Te;
|
|
4577
4577
|
const r = o.transform(n, [
|
|
4578
4578
|
(f) => () => Ui(e, f, n, [
|
|
4579
4579
|
...e.options.types?.sourceFileTransformers ?? [],
|
|
4580
|
-
...
|
|
4580
|
+
...mc
|
|
4581
4581
|
])
|
|
4582
4582
|
]).transformed[0], a = e._compilerOptionsForPrinter, c = e._typeScriptPrinter, d = a.sourceMap ? ye.createSourceMapGenerator(
|
|
4583
4583
|
e.typeScriptHost,
|
|
@@ -4595,7 +4595,7 @@ const uc = [
|
|
|
4595
4595
|
}
|
|
4596
4596
|
}
|
|
4597
4597
|
});
|
|
4598
|
-
function
|
|
4598
|
+
function gc(e) {
|
|
4599
4599
|
const t = e.typeScriptConfig;
|
|
4600
4600
|
return {
|
|
4601
4601
|
...t,
|
|
@@ -4627,7 +4627,7 @@ function fc(e) {
|
|
|
4627
4627
|
skipLibCheck: !0
|
|
4628
4628
|
};
|
|
4629
4629
|
}
|
|
4630
|
-
function
|
|
4630
|
+
function yc(e) {
|
|
4631
4631
|
const t = e.options.types?.tsconfigPath, i = t && u.isAbsolute(t) ? t : ls(t ?? "tsconfig.json");
|
|
4632
4632
|
if (i === void 0)
|
|
4633
4633
|
throw Error(
|
|
@@ -4666,7 +4666,7 @@ function Mn(e) {
|
|
|
4666
4666
|
const i = o.ScriptTarget[t].toLowerCase();
|
|
4667
4667
|
return i === "latest" ? "esnext" : i;
|
|
4668
4668
|
}
|
|
4669
|
-
function
|
|
4669
|
+
function hc(e, t) {
|
|
4670
4670
|
if (e.isInStorybook && e.viteCommand === "serve") {
|
|
4671
4671
|
const i = (a, c, d, ...l) => {
|
|
4672
4672
|
const p = a.filter(
|
|
@@ -4688,9 +4688,9 @@ function yc(e, t) {
|
|
|
4688
4688
|
e.typeScriptProgram = a.getProgram(), e.typeScriptTypeChecker = e.typeScriptProgram.getTypeChecker(), e._typeScriptReload?.resolve(), e._typeScriptReload = new Ls();
|
|
4689
4689
|
}, e.typeScriptWatchProgram = o.createWatchProgram(n), e.typeScriptConfig = e.typeScriptProgram.getCompilerOptions();
|
|
4690
4690
|
}
|
|
4691
|
-
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter =
|
|
4691
|
+
e.typeScriptConfig.sourceMap = t, e._compilerOptionsForPrinter = gc(e), e._typeScriptPrinter = dn(e._compilerOptionsForPrinter);
|
|
4692
4692
|
}
|
|
4693
|
-
async function
|
|
4693
|
+
async function vc(e, t, i) {
|
|
4694
4694
|
const n = u.resolve(e.dir.root, t);
|
|
4695
4695
|
await _(n) && await xs(n, { recursive: !0, force: !0 }), await Q(n, { recursive: !0 }), await ks(e.dir.distCdn, u.join(n, "build"), { recursive: !0 });
|
|
4696
4696
|
const s = [
|
|
@@ -4700,7 +4700,7 @@ async function hc(e, t, i) {
|
|
|
4700
4700
|
nodir: !0,
|
|
4701
4701
|
posix: !0
|
|
4702
4702
|
})
|
|
4703
|
-
], r = u.relative(e.dir.root, e.dir.src), a = await
|
|
4703
|
+
], r = u.relative(e.dir.root, e.dir.src), a = await Ce(e), c = u.join(e.dir.src, "loader.ts"), d = a.map((l) => {
|
|
4704
4704
|
if ("cssHref" in l)
|
|
4705
4705
|
return `<link rel="stylesheet" href="${l.cssHref}">`;
|
|
4706
4706
|
if ("javascriptCode" in l && l.javascriptCode.at(0)?.includes(c) === !0)
|
|
@@ -4740,8 +4740,8 @@ const On = /* @__PURE__ */ new Set([
|
|
|
4740
4740
|
"collection",
|
|
4741
4741
|
"extras",
|
|
4742
4742
|
"support"
|
|
4743
|
-
]), H = "@arcgis/lumina:buildCdn",
|
|
4744
|
-
function
|
|
4743
|
+
]), H = "@arcgis/lumina:buildCdn", xe = "cdn", Jn = "index", ee = "main";
|
|
4744
|
+
function bc(e) {
|
|
4745
4745
|
const { skip: t = !1, namespace: i, esbuildOptions: n = {} } = e.options.build?.cdn ?? {}, s = e.options.build?.webApp?.destination, r = i !== void 0;
|
|
4746
4746
|
if (r) {
|
|
4747
4747
|
if (i.toLowerCase() !== i)
|
|
@@ -4758,7 +4758,7 @@ function vc(e) {
|
|
|
4758
4758
|
if (e.provideAssets([
|
|
4759
4759
|
{
|
|
4760
4760
|
type: "dynamic",
|
|
4761
|
-
source: () =>
|
|
4761
|
+
source: () => so(e),
|
|
4762
4762
|
destination: `../${r ? a : ee}.css`
|
|
4763
4763
|
}
|
|
4764
4764
|
]), !t)
|
|
@@ -4767,8 +4767,8 @@ function vc(e) {
|
|
|
4767
4767
|
async writeBundle() {
|
|
4768
4768
|
if (e.isInStorybook)
|
|
4769
4769
|
return;
|
|
4770
|
-
const c =
|
|
4771
|
-
await
|
|
4770
|
+
const c = Pe && R().name !== "@arcgis/embeddable-components", d = Date.now(), l = 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 Sc(e, a, n, l, c);
|
|
4771
|
+
await wc(
|
|
4772
4772
|
p,
|
|
4773
4773
|
e,
|
|
4774
4774
|
r ? `${a}.esm` : a,
|
|
@@ -4776,11 +4776,11 @@ function vc(e) {
|
|
|
4776
4776
|
c
|
|
4777
4777
|
);
|
|
4778
4778
|
const m = Date.now();
|
|
4779
|
-
E.info(H, `CDN was built in ${m - d}ms`), s && await
|
|
4779
|
+
E.info(H, `CDN was built in ${m - d}ms`), s && await vc(e, s, `${r ? `${a}.esm` : a}.js`);
|
|
4780
4780
|
}
|
|
4781
4781
|
};
|
|
4782
4782
|
}
|
|
4783
|
-
async function
|
|
4783
|
+
async function Sc(e, t, i, n, s) {
|
|
4784
4784
|
const r = e.environment;
|
|
4785
4785
|
if (i.minify && s)
|
|
4786
4786
|
throw Error(
|
|
@@ -4848,7 +4848,7 @@ async function bc(e, t, i, n, s) {
|
|
|
4848
4848
|
setup(a) {
|
|
4849
4849
|
const c = e.options.build?.cdn?.namespace === void 0 ? (
|
|
4850
4850
|
// eslint-disable-next-line require-unicode-regexp
|
|
4851
|
-
new RegExp(`\\/${
|
|
4851
|
+
new RegExp(`\\/${xe}\\/${ee}\\.css$`)
|
|
4852
4852
|
) : (
|
|
4853
4853
|
// eslint-disable-next-line require-unicode-regexp
|
|
4854
4854
|
new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
|
|
@@ -4887,7 +4887,7 @@ ${an(e._globalCssString, e)}`,
|
|
|
4887
4887
|
}
|
|
4888
4888
|
});
|
|
4889
4889
|
}
|
|
4890
|
-
async function
|
|
4890
|
+
async function wc(e, t, i, n, s) {
|
|
4891
4891
|
const r = t.dir.distCdn, a = `${i}.js`, c = new Map(
|
|
4892
4892
|
e.outputFiles.map((d) => {
|
|
4893
4893
|
const l = {
|
|
@@ -4897,13 +4897,13 @@ async function Sc(e, t, i, n, s) {
|
|
|
4897
4897
|
}, p = d.path.slice(r.length);
|
|
4898
4898
|
if (p === "stdin.js") {
|
|
4899
4899
|
if (s) {
|
|
4900
|
-
const f = d.text.match(
|
|
4900
|
+
const f = d.text.match(Tc)?.[0];
|
|
4901
4901
|
if (f === void 0)
|
|
4902
4902
|
throw Error(
|
|
4903
4903
|
`Failed to find the runtime variable name in the CDN entrypoint file. This likely indicates a bug in Lumina. stdin.js contents:
|
|
4904
4904
|
${d.text}`
|
|
4905
4905
|
);
|
|
4906
|
-
l.code = `${l.code.trimEnd()}${
|
|
4906
|
+
l.code = `${l.code.trimEnd()}${Ec(f, n)}`, l.isAsync = !1;
|
|
4907
4907
|
}
|
|
4908
4908
|
return [a, l];
|
|
4909
4909
|
}
|
|
@@ -4914,8 +4914,8 @@ ${d.text}`
|
|
|
4914
4914
|
d.isAsync === void 0 && (l.endsWith(".js") ? Kn(d, c) : d.isAsync = !1);
|
|
4915
4915
|
}), t.options.build?.cdn?.transformer?.(c, t), await Promise.all(Array.from(c.entries(), async ([d, { code: l }]) => await D(r + d, l)));
|
|
4916
4916
|
}
|
|
4917
|
-
const
|
|
4918
|
-
function
|
|
4917
|
+
const Tc = /(?<=;var [a-zA-Z$_]=[a-zA-Z$_]\()[a-zA-Z$_](?=,\{")/u;
|
|
4918
|
+
function Ec(e, t) {
|
|
4919
4919
|
let i = [
|
|
4920
4920
|
"window.$arcgis",
|
|
4921
4921
|
"||",
|
|
@@ -4959,7 +4959,7 @@ function Tc(e, t) {
|
|
|
4959
4959
|
function Kn(e, t) {
|
|
4960
4960
|
const i = [], n = [], s = [], r = /* @__PURE__ */ new Set(), a = [];
|
|
4961
4961
|
let c = 0;
|
|
4962
|
-
const d = e.code.matchAll(
|
|
4962
|
+
const d = e.code.matchAll(Cc);
|
|
4963
4963
|
for (const w of d) {
|
|
4964
4964
|
const [C, L, F, N, M] = w, z = M.startsWith(He);
|
|
4965
4965
|
if (c !== 0 && c !== w.index) {
|
|
@@ -4971,13 +4971,13 @@ function Kn(e, t) {
|
|
|
4971
4971
|
else {
|
|
4972
4972
|
const K = Bn(M, t), G = K?.isAsync === !0;
|
|
4973
4973
|
if (L !== void 0) {
|
|
4974
|
-
const
|
|
4974
|
+
const Ae = [];
|
|
4975
4975
|
for (const Ye of L.slice(1, -1).split(",")) {
|
|
4976
4976
|
const [Mt, Ot = Mt] = Ye.split(" as ");
|
|
4977
|
-
G || r.add(Ot),
|
|
4977
|
+
G || r.add(Ot), Ae.push(`${Mt}:${Ot}`);
|
|
4978
4978
|
}
|
|
4979
4979
|
if (G) {
|
|
4980
|
-
const Ye = K.oldSingleExportName === void 0 ? `{${
|
|
4980
|
+
const Ye = K.oldSingleExportName === void 0 ? `{${Ae.join(",")}}` : Ae[0].split(":")[1];
|
|
4981
4981
|
a.push([w.index + 6, 0, L.length, Ye]);
|
|
4982
4982
|
}
|
|
4983
4983
|
} else if (F === void 0 && N === void 0)
|
|
@@ -4999,7 +4999,7 @@ ${K.code}`
|
|
|
4999
4999
|
e.code = Si(e.code, t);
|
|
5000
5000
|
return;
|
|
5001
5001
|
}
|
|
5002
|
-
const l =
|
|
5002
|
+
const l = xc(r);
|
|
5003
5003
|
let p = e.code.slice(0, c);
|
|
5004
5004
|
for (let w = a.length - 1; w >= 0; w--) {
|
|
5005
5005
|
const [C, L, F, N] = a[w];
|
|
@@ -5010,7 +5010,7 @@ ${K.code}`
|
|
|
5010
5010
|
}
|
|
5011
5011
|
p = p.slice(0, C) + z + p.slice(C + M);
|
|
5012
5012
|
}
|
|
5013
|
-
const m =
|
|
5013
|
+
const m = $c.exec(e.code), f = m?.index ?? e.code.length;
|
|
5014
5014
|
let y = "";
|
|
5015
5015
|
if (m !== null) {
|
|
5016
5016
|
const w = m[1].split(",");
|
|
@@ -5030,7 +5030,7 @@ ${K.code}`
|
|
|
5030
5030
|
const P = `${p}${b}${A}${$}`;
|
|
5031
5031
|
e.code = P;
|
|
5032
5032
|
}
|
|
5033
|
-
const
|
|
5033
|
+
const Cc = /import(?:(\{[^}]+\})from|\*as ([\w$]+) from| ([\w$]+) from)?"([^"]+)";/gu, $c = /export\{([^}]+)\};\n$/u, He = "@arcgis/core/";
|
|
5034
5034
|
function Bn(e, t) {
|
|
5035
5035
|
if (!e.startsWith("./"))
|
|
5036
5036
|
return;
|
|
@@ -5042,7 +5042,7 @@ function Bn(e, t) {
|
|
|
5042
5042
|
return n;
|
|
5043
5043
|
}
|
|
5044
5044
|
function Si(e, t) {
|
|
5045
|
-
return e.replaceAll(
|
|
5045
|
+
return e.replaceAll(Pc, (i, n) => {
|
|
5046
5046
|
if (n.startsWith(He))
|
|
5047
5047
|
return `$arcgis.t(m=>m[0],"${Wn(n.slice(He.length))}")`;
|
|
5048
5048
|
if (n.startsWith("./")) {
|
|
@@ -5053,28 +5053,28 @@ function Si(e, t) {
|
|
|
5053
5053
|
return i;
|
|
5054
5054
|
});
|
|
5055
5055
|
}
|
|
5056
|
-
const
|
|
5057
|
-
function
|
|
5056
|
+
const Pc = /(?<![.\w\d])import\("([^"]+)"\)/gu, Wn = (e) => e.endsWith(".js") ? e.slice(0, -3) : e;
|
|
5057
|
+
function xc(e) {
|
|
5058
5058
|
const t = [_n];
|
|
5059
5059
|
return () => {
|
|
5060
5060
|
for (; ; ) {
|
|
5061
|
-
const i =
|
|
5062
|
-
if (
|
|
5061
|
+
const i = Ac(t);
|
|
5062
|
+
if (Lc(t), !e.has(i))
|
|
5063
5063
|
return e.add(i), i;
|
|
5064
5064
|
}
|
|
5065
5065
|
};
|
|
5066
5066
|
}
|
|
5067
|
-
const _n = 0, Dt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Un = `${Dt}0123456789`,
|
|
5068
|
-
function
|
|
5067
|
+
const _n = 0, Dt = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_", Un = `${Dt}0123456789`, kc = Dt.length, Ic = Un.length;
|
|
5068
|
+
function Ac(e) {
|
|
5069
5069
|
let t = Dt[e[0]];
|
|
5070
5070
|
for (let i = 1; i < e.length; i++)
|
|
5071
5071
|
t += Un[e[i]];
|
|
5072
5072
|
return t;
|
|
5073
5073
|
}
|
|
5074
|
-
function
|
|
5074
|
+
function Lc(e) {
|
|
5075
5075
|
let t = e.length - 1;
|
|
5076
5076
|
for (; t >= 0; ) {
|
|
5077
|
-
const i = t === 0 ?
|
|
5077
|
+
const i = t === 0 ? kc : Ic;
|
|
5078
5078
|
if (e[t] += 1, e[t] >= i)
|
|
5079
5079
|
e[t] = 0, t--;
|
|
5080
5080
|
else
|
|
@@ -5082,7 +5082,7 @@ function Ac(e) {
|
|
|
5082
5082
|
}
|
|
5083
5083
|
e = new Array(e.length + 1).fill(_n);
|
|
5084
5084
|
}
|
|
5085
|
-
async function
|
|
5085
|
+
async function Fc(e, t, i, n) {
|
|
5086
5086
|
const s = t.packageName, { hasCss: r, cdnName: a } = await Hn(t.packageLocation) ?? {};
|
|
5087
5087
|
if (i === "cdn") {
|
|
5088
5088
|
const p = t.cdnUrl ?? Ge(t.packageJson, !0);
|
|
@@ -5148,8 +5148,8 @@ async function wi(e, t) {
|
|
|
5148
5148
|
cdnName: t
|
|
5149
5149
|
} : void 0;
|
|
5150
5150
|
}
|
|
5151
|
-
async function
|
|
5152
|
-
const r = t.packageJson.exports?.[`./${ee}.css`] === void 0 ? await Hn(t.packageLocation) : void 0, a = r?.cdnName ??
|
|
5151
|
+
async function Nc(e, t, i, n) {
|
|
5152
|
+
const r = t.packageJson.exports?.[`./${ee}.css`] === void 0 ? await Hn(t.packageLocation) : void 0, a = r?.cdnName ?? xe, c = r === void 0 ? `${Jn}.js` : `${r.cdnName}.esm.js`;
|
|
5153
5153
|
if (i === "cdn")
|
|
5154
5154
|
return {
|
|
5155
5155
|
tag: "script",
|
|
@@ -5158,7 +5158,7 @@ async function Fc(e, t, i, n) {
|
|
|
5158
5158
|
src: `${t.cdnUrl ?? Ge(t.packageJson, !0)}${c}`
|
|
5159
5159
|
}
|
|
5160
5160
|
};
|
|
5161
|
-
const d =
|
|
5161
|
+
const d = Dc(t.packageJson), l = `${t.packageName}/${u.normalize(d)}${Y}`, p = [
|
|
5162
5162
|
`import styles$${n} from "${l}";`,
|
|
5163
5163
|
`document.adoptedStyleSheets = [...document.adoptedStyleSheets, styles$${n}.styleSheet];`
|
|
5164
5164
|
], m = `${t.packageName}/loader`;
|
|
@@ -5177,7 +5177,7 @@ async function Fc(e, t, i, n) {
|
|
|
5177
5177
|
]
|
|
5178
5178
|
};
|
|
5179
5179
|
}
|
|
5180
|
-
function
|
|
5180
|
+
function Dc(e) {
|
|
5181
5181
|
const { exports: t } = e;
|
|
5182
5182
|
if (t === void 0)
|
|
5183
5183
|
throw new Error(
|
|
@@ -5186,21 +5186,21 @@ function Nc(e) {
|
|
|
5186
5186
|
const i = Object.entries(t).filter(([s]) => u.extname(s) === ".css"), n = i.find(([, s]) => s === `./${ee}.css`);
|
|
5187
5187
|
return n ? n[0] : i.length > 0 ? i[0][0] : `./${ee}.css`;
|
|
5188
5188
|
}
|
|
5189
|
-
async function
|
|
5190
|
-
return e._loadersCache ??=
|
|
5189
|
+
async function Ce(e) {
|
|
5190
|
+
return e._loadersCache ??= jc(e), await e._loadersCache;
|
|
5191
5191
|
}
|
|
5192
|
-
async function
|
|
5192
|
+
async function jc(e) {
|
|
5193
5193
|
const t = e.viteCommand === "build" ? "cdn" : "lazyNpm", i = e.viteConfig.base;
|
|
5194
5194
|
let n = 0;
|
|
5195
5195
|
const s = async (d) => (await Promise.all(
|
|
5196
5196
|
d.map(async (l) => {
|
|
5197
5197
|
const p = n++;
|
|
5198
|
-
return l.type === "stencil" ? await
|
|
5198
|
+
return l.type === "stencil" ? await Fc(i, l, t, p) : l.type === "@arcgis/lumina" ? await Nc(i, l, t, p) : void 0;
|
|
5199
5199
|
})
|
|
5200
5200
|
)).filter(j).flat(), r = await Promise.all([
|
|
5201
5201
|
// This may contain an import map so must be first
|
|
5202
|
-
|
|
5203
|
-
|
|
5202
|
+
lc(i, t),
|
|
5203
|
+
Te.then(s),
|
|
5204
5204
|
zn(e).then(s)
|
|
5205
5205
|
]), a = u.join(e.dir.src, "loader.ts");
|
|
5206
5206
|
return [
|
|
@@ -5215,7 +5215,7 @@ async function Dc(e) {
|
|
|
5215
5215
|
javascriptCode: [
|
|
5216
5216
|
`import { defineCustomElements } from "${a}";`,
|
|
5217
5217
|
"globalThis.devOnly$ownTagNames = new Set();",
|
|
5218
|
-
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ??
|
|
5218
|
+
`defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? xe}/"}` : ""});`
|
|
5219
5219
|
]
|
|
5220
5220
|
}
|
|
5221
5221
|
];
|
|
@@ -5240,10 +5240,10 @@ async function zn(e) {
|
|
|
5240
5240
|
).then((i) => i.filter(j)), await e._serveOnlyDependencies);
|
|
5241
5241
|
}
|
|
5242
5242
|
const qn = "/@arcgis/lumina-compiler/testSetupFile", dt = [qn];
|
|
5243
|
-
async function
|
|
5243
|
+
async function Rc(e) {
|
|
5244
5244
|
if (!e.viteConfig.test?.browser?.enabled)
|
|
5245
5245
|
return Ti(e);
|
|
5246
|
-
const i = (await
|
|
5246
|
+
const i = (await Ce(e)).map((n, s) => {
|
|
5247
5247
|
if ("javascriptCode" in n)
|
|
5248
5248
|
return n.javascriptCode.join(`
|
|
5249
5249
|
`);
|
|
@@ -5268,12 +5268,12 @@ async function jc(e) {
|
|
|
5268
5268
|
`);
|
|
5269
5269
|
return [Ti(e), i].join("");
|
|
5270
5270
|
}
|
|
5271
|
-
const Ti = (e) => [e.isInPuppeteerTestBackEnd ?
|
|
5271
|
+
const Ti = (e) => [e.isInPuppeteerTestBackEnd ? Mc : "", Oc].join(""), Mc = `import { setupPuppeteerTest } from "@arcgis/lumina-compiler/puppeteerTesting";
|
|
5272
5272
|
setupPuppeteerTest();
|
|
5273
|
-
`,
|
|
5273
|
+
`, Oc = `import { setupLuminaTest } from "@arcgis/lumina-compiler/testing";
|
|
5274
5274
|
setupLuminaTest();
|
|
5275
5275
|
`;
|
|
5276
|
-
function
|
|
5276
|
+
function Jc(e) {
|
|
5277
5277
|
let t = !0, i = !1, n, s, r, a, c;
|
|
5278
5278
|
const d = "@arcgis/lumina:generateVirtualFiles", l = {
|
|
5279
5279
|
name: d,
|
|
@@ -5286,17 +5286,17 @@ function Oc(e) {
|
|
|
5286
5286
|
const v = g.startsWith(qn);
|
|
5287
5287
|
if (!(!g.endsWith(".tsx") && g !== a && !v)) {
|
|
5288
5288
|
if (s === void 0 && !e.isInPuppeteerTestBackEnd) {
|
|
5289
|
-
r === void 0 && clearTimeout(n), r ??=
|
|
5289
|
+
r === void 0 && clearTimeout(n), r ??= Wo(e, t).catch((b) => {
|
|
5290
5290
|
throw i = !0, b;
|
|
5291
5291
|
}), t = !1;
|
|
5292
5292
|
const h = await r;
|
|
5293
5293
|
s ??= h;
|
|
5294
5294
|
}
|
|
5295
|
-
return g === a ?
|
|
5295
|
+
return g === a ? ro(e) : v ? await Rc(e) : void 0;
|
|
5296
5296
|
}
|
|
5297
5297
|
},
|
|
5298
5298
|
async writeBundle() {
|
|
5299
|
-
e.isInStorybook || await D(u.join(e.dir.dist, "loader.d.ts"),
|
|
5299
|
+
e.isInStorybook || await D(u.join(e.dir.dist, "loader.d.ts"), oo);
|
|
5300
5300
|
},
|
|
5301
5301
|
async handleHotUpdate({ file: g, modules: v, read: h }) {
|
|
5302
5302
|
const b = await p(g, h);
|
|
@@ -5322,7 +5322,7 @@ function Oc(e) {
|
|
|
5322
5322
|
e.componentFiles.some((S) => S.startsWith(h)) && m();
|
|
5323
5323
|
});
|
|
5324
5324
|
function v(h) {
|
|
5325
|
-
|
|
5325
|
+
we(h, e.dir.srcComponents) && m();
|
|
5326
5326
|
}
|
|
5327
5327
|
g.watcher.on("change", () => {
|
|
5328
5328
|
if (!i)
|
|
@@ -5358,10 +5358,10 @@ function Oc(e) {
|
|
|
5358
5358
|
]), clearTimeout(C);
|
|
5359
5359
|
}
|
|
5360
5360
|
}
|
|
5361
|
-
if (!
|
|
5361
|
+
if (!we(g, e.dir.srcComponents))
|
|
5362
5362
|
return;
|
|
5363
5363
|
h ??= await v();
|
|
5364
|
-
const S =
|
|
5364
|
+
const S = _o(e, g, h);
|
|
5365
5365
|
if (S === void 0)
|
|
5366
5366
|
return !1;
|
|
5367
5367
|
for (const $ of S) {
|
|
@@ -5389,9 +5389,9 @@ function he(e, t, i = jt) {
|
|
|
5389
5389
|
throw Error(T(bt, "serveAssets() is only available when Vite is running in serve mode"));
|
|
5390
5390
|
const n = e._serverConfigured, s = e.server.middlewares.stack.length;
|
|
5391
5391
|
if (t.forEach((r) => {
|
|
5392
|
-
const a = Vn(r), c = Qn(e.dir, Xn(a)), d =
|
|
5392
|
+
const a = Vn(r), c = Qn(e.dir, Xn(a)), d = Bc(e.viteConfig.base, c, e.dir.distCdn);
|
|
5393
5393
|
e.server.middlewares.use(d, (l, p, m) => {
|
|
5394
|
-
const f =
|
|
5394
|
+
const f = Wc(l.url), y = a.type === "directory" ? u.resolve(a.source, f.slice(1)) : a.source, g = u.join(c, f), v = i.find((h) => h.match(g, e));
|
|
5395
5395
|
return (typeof y == "function" ? Promise.resolve(y()) : J(y)).then((h) => {
|
|
5396
5396
|
const b = (typeof y == "function" ? void 0 : v?.transform(h.toString("utf8"), g, e)) ?? h;
|
|
5397
5397
|
p.setHeader("Cache-Control", "max-age=31536000, immutable"), p.setHeader("Content-Type", Ns.lookup(f) || "application/octet-stream"), p.write(b), p.end();
|
|
@@ -5433,11 +5433,11 @@ async function Gn(e, t, i = jt) {
|
|
|
5433
5433
|
}
|
|
5434
5434
|
const Vn = Di ? (e) => e : (e) => e.type === "dynamic" ? {
|
|
5435
5435
|
...e,
|
|
5436
|
-
destination:
|
|
5436
|
+
destination: je(e.destination)
|
|
5437
5437
|
} : {
|
|
5438
5438
|
...e,
|
|
5439
|
-
source:
|
|
5440
|
-
destination:
|
|
5439
|
+
source: je(e.source),
|
|
5440
|
+
destination: je(e.destination)
|
|
5441
5441
|
};
|
|
5442
5442
|
async function Ei(e, t, i, n) {
|
|
5443
5443
|
const s = i.find((r) => r.match(t, n));
|
|
@@ -5464,33 +5464,33 @@ function Xn(e) {
|
|
|
5464
5464
|
return e.destination === "" ? u.basename(e.source) : e.destination.endsWith(u.sep) ? e.type === "directory" && e.destination === u.sep ? e.destination : u.join(e.destination, u.basename(e.source)) : e.destination;
|
|
5465
5465
|
}
|
|
5466
5466
|
function Qn({ dist: e, distCdnAssets: t }, i) {
|
|
5467
|
-
const n =
|
|
5467
|
+
const n = Kc(i), s = u.join(
|
|
5468
5468
|
t,
|
|
5469
5469
|
n ? u.relative(t, i) : i
|
|
5470
5470
|
), r = u.relative(e, s), a = Zn(r);
|
|
5471
5471
|
return u.join(e, a);
|
|
5472
5472
|
}
|
|
5473
|
-
function
|
|
5473
|
+
function Kc(e) {
|
|
5474
5474
|
if (e.startsWith(u.sep)) {
|
|
5475
5475
|
const t = ji(), i = t.startsWith(u.sep) ? t.split(u.sep)[1] ?? "" : "";
|
|
5476
5476
|
return e.startsWith(`/${i}/`) || e.startsWith("/Users/");
|
|
5477
5477
|
} else
|
|
5478
5478
|
return !!(!Di && u.isAbsolute(e));
|
|
5479
5479
|
}
|
|
5480
|
-
function
|
|
5480
|
+
function Bc(e, t, i) {
|
|
5481
5481
|
const n = Zn(u.relative(i, t)), s = n.startsWith("/") ? n.slice(1) : n;
|
|
5482
5482
|
return `${e}${s}`;
|
|
5483
5483
|
}
|
|
5484
|
-
const Zn = (e) => e.replaceAll("../", ""),
|
|
5484
|
+
const Zn = (e) => e.replaceAll("../", ""), Wc = (e = "") => e.split("?")[0].split("#")[0];
|
|
5485
5485
|
async function Yn(e) {
|
|
5486
5486
|
const t = new Set(e.map(u.dirname));
|
|
5487
5487
|
await Promise.all(Array.from(t, async (i) => await Q(i, { recursive: !0 })));
|
|
5488
5488
|
}
|
|
5489
|
-
const
|
|
5489
|
+
const _c = {
|
|
5490
5490
|
match: (e, t) => t.environment === "production" && e.endsWith(".json"),
|
|
5491
5491
|
transform: (e) => JSON.stringify(JSON.parse(e))
|
|
5492
|
-
}, jt = [
|
|
5493
|
-
function
|
|
5492
|
+
}, jt = [_c];
|
|
5493
|
+
function Uc(e) {
|
|
5494
5494
|
let t;
|
|
5495
5495
|
const i = () => [
|
|
5496
5496
|
...e.options.assets?.transformers ?? [],
|
|
@@ -5499,7 +5499,7 @@ function _c(e) {
|
|
|
5499
5499
|
return {
|
|
5500
5500
|
name: "@arcgis/lumina:handleStaticAssets",
|
|
5501
5501
|
configResolved() {
|
|
5502
|
-
t =
|
|
5502
|
+
t = Hc(e);
|
|
5503
5503
|
},
|
|
5504
5504
|
async configureServer(n) {
|
|
5505
5505
|
e.server = n, !e.isInPuppeteerTestBackEnd && (he(e, await t, i()), n.watcher.on("addDir", (s) => {
|
|
@@ -5514,7 +5514,7 @@ function _c(e) {
|
|
|
5514
5514
|
}
|
|
5515
5515
|
};
|
|
5516
5516
|
}
|
|
5517
|
-
async function
|
|
5517
|
+
async function Hc(e) {
|
|
5518
5518
|
const t = _("assets"), i = await e.componentFilesPromise, n = await Promise.all(
|
|
5519
5519
|
i.map(async (s) => {
|
|
5520
5520
|
const r = u.dirname(s), a = u.join(r, "assets");
|
|
@@ -5527,7 +5527,7 @@ const es = (e, t) => ({
|
|
|
5527
5527
|
type: "directory",
|
|
5528
5528
|
source: e,
|
|
5529
5529
|
destination: u.basename(t)
|
|
5530
|
-
}), ts = { type: "directory", source: "assets/", destination: "" }, pt = "@arcgis/lumina:printTotalBuildSize",
|
|
5530
|
+
}), ts = { type: "directory", source: "assets/", destination: "" }, pt = "@arcgis/lumina:printTotalBuildSize", zc = (e) => ({
|
|
5531
5531
|
name: pt,
|
|
5532
5532
|
apply: () => e.viteCommand === "build",
|
|
5533
5533
|
configResolved(t) {
|
|
@@ -5544,10 +5544,10 @@ const es = (e, t) => ({
|
|
|
5544
5544
|
const m = console.log;
|
|
5545
5545
|
console.log = function(...y) {
|
|
5546
5546
|
if (m.apply(console, y), y.length === 1 && typeof y[0] == "string") {
|
|
5547
|
-
const [g, v] = y[0].match(
|
|
5547
|
+
const [g, v] = y[0].match(Gc) ?? [];
|
|
5548
5548
|
if (!g)
|
|
5549
5549
|
return;
|
|
5550
|
-
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(
|
|
5550
|
+
p || (p = y[0].slice(0, y[0].indexOf(g) + g.length).replaceAll(Vc, "").length);
|
|
5551
5551
|
const h = Number.parseFloat(g.replace(" kB", "").replaceAll(",", ""));
|
|
5552
5552
|
v ? (l += Number.parseFloat(v.replace(" kB", "").replaceAll(",", "")), d += h) : c += h;
|
|
5553
5553
|
}
|
|
@@ -5563,7 +5563,7 @@ const es = (e, t) => ({
|
|
|
5563
5563
|
[
|
|
5564
5564
|
$i,
|
|
5565
5565
|
v,
|
|
5566
|
-
|
|
5566
|
+
qc,
|
|
5567
5567
|
"*",
|
|
5568
5568
|
" ".repeat(p - `${v}*`.length - g.length),
|
|
5569
5569
|
g,
|
|
@@ -5574,10 +5574,10 @@ const es = (e, t) => ({
|
|
|
5574
5574
|
}
|
|
5575
5575
|
};
|
|
5576
5576
|
}
|
|
5577
|
-
}), Ci = "\x1B[22m\x1B[1m\x1B[22m", $i = "\x1B[2m",
|
|
5577
|
+
}), Ci = "\x1B[22m\x1B[1m\x1B[22m", $i = "\x1B[2m", qc = "\x1B[22m\x1B[36m", Gc = /\d+(?:,\d+)?\.\d{2} kB/gu, Vc = /\x1B\[\d+m/gu, Xc = new Intl.NumberFormat("en", {
|
|
5578
5578
|
maximumFractionDigits: 2,
|
|
5579
5579
|
minimumFractionDigits: 2
|
|
5580
|
-
}), Pi = (e) => `${
|
|
5580
|
+
}), Pi = (e) => `${Xc.format(e)} kB`, xi = "@arcgis/lumina:configureVite", Qc = (e) => ({
|
|
5581
5581
|
name: xi,
|
|
5582
5582
|
async config({
|
|
5583
5583
|
server: t,
|
|
@@ -5594,7 +5594,7 @@ const es = (e, t) => ({
|
|
|
5594
5594
|
*/
|
|
5595
5595
|
loader: "src/loader.ts",
|
|
5596
5596
|
// Entrypoint for bundling used components only:
|
|
5597
|
-
...await
|
|
5597
|
+
...await uo(e)
|
|
5598
5598
|
}, { loader: g, ...v } = y, h = e.environment === "development" || e.isInTest ? {
|
|
5599
5599
|
"process.env.ESRI_INTERNAL": "true"
|
|
5600
5600
|
} : void 0, b = !import.meta.url.includes("node_modules"), S = {
|
|
@@ -5635,7 +5635,7 @@ const es = (e, t) => ({
|
|
|
5635
5635
|
...e.isInTest ? ["vitest-fail-on-console", "js-beautify"] : [],
|
|
5636
5636
|
// Used by controllers. Need to add manually because @arcgis/lumina is
|
|
5637
5637
|
// excluded per comment below, so Vite will discover these usages too late.
|
|
5638
|
-
|
|
5638
|
+
...Pe ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
|
|
5639
5639
|
],
|
|
5640
5640
|
/**
|
|
5641
5641
|
* Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
|
|
@@ -5752,18 +5752,18 @@ const es = (e, t) => ({
|
|
|
5752
5752
|
}
|
|
5753
5753
|
};
|
|
5754
5754
|
}
|
|
5755
|
-
}),
|
|
5755
|
+
}), Zc = (e) => ({
|
|
5756
5756
|
name: "@arcgis/lumina:setAssetPath",
|
|
5757
5757
|
apply: () => e.viteCommand === "build",
|
|
5758
5758
|
config: (t) => ({
|
|
5759
5759
|
base: t.base ?? e.options.assets?.defaultPath ?? Ge()
|
|
5760
5760
|
})
|
|
5761
5761
|
});
|
|
5762
|
-
function
|
|
5762
|
+
function Yc(e = R()) {
|
|
5763
5763
|
const t = e.version ?? "0.0.1";
|
|
5764
5764
|
return hs(t);
|
|
5765
5765
|
}
|
|
5766
|
-
const
|
|
5766
|
+
const el = (e) => `/*! ${e} */`, k = (e) => (t, i) => {
|
|
5767
5767
|
Object.defineProperty(t, i, {
|
|
5768
5768
|
get() {
|
|
5769
5769
|
throw Error(
|
|
@@ -5793,7 +5793,7 @@ function me(e) {
|
|
|
5793
5793
|
`Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
|
|
5794
5794
|
)
|
|
5795
5795
|
);
|
|
5796
|
-
return
|
|
5796
|
+
return je(e);
|
|
5797
5797
|
}
|
|
5798
5798
|
const fe = {
|
|
5799
5799
|
vsCodeHtml: "docs/vscode.html-custom-data.json",
|
|
@@ -5803,7 +5803,7 @@ const fe = {
|
|
|
5803
5803
|
stencilLikeDocsJson: "docs/docs.json"
|
|
5804
5804
|
};
|
|
5805
5805
|
async function is(e, t, i, n, s = R()) {
|
|
5806
|
-
const r =
|
|
5806
|
+
const r = tl(e, i, n, s), a = u.join(t, "lumina.ts"), d = await _(a) ? await J(a, "utf8") : "";
|
|
5807
5807
|
if (d.trim().replaceAll(`\r
|
|
5808
5808
|
`, `
|
|
5809
5809
|
`) === r.trim())
|
|
@@ -5823,7 +5823,7 @@ ${d}`
|
|
|
5823
5823
|
);
|
|
5824
5824
|
return Oi(a, r), !0;
|
|
5825
5825
|
}
|
|
5826
|
-
function
|
|
5826
|
+
function tl(e, t, i, n = R()) {
|
|
5827
5827
|
"@arcgis/components-controllers" in (n.dependencies ?? {}) && E.warn(
|
|
5828
5828
|
"@arcgis/components-controllers",
|
|
5829
5829
|
"Deprecation warning: the @arcgis/components-controllers package was merged into @arcgis/lumina. Please remove it from your package.json and rewrite code to import from @arcgis/lumina/controllers and @arcgis/lumina/controllers/accessor instead."
|
|
@@ -5838,11 +5838,11 @@ declare module "@arcgis/lumina" {
|
|
|
5838
5838
|
interface ImportStencilElements extends ${r.map((m, f) => `JSX$${f}.IntrinsicElements`).join(", ")} {}
|
|
5839
5839
|
}`, d = n.devDependencies ?? {}, l = i === "preview" ? "matchers" : i === "webdriverio" ? "webdriverio" : "playwright";
|
|
5840
5840
|
return [
|
|
5841
|
-
|
|
5841
|
+
il,
|
|
5842
5842
|
// Avoid cyclic references for tests in @arcgis/lumina
|
|
5843
5843
|
n.name === "@arcgis/lumina" ? "" : `
|
|
5844
5844
|
/// <reference types="@arcgis/lumina/typings" />`,
|
|
5845
|
-
t ?
|
|
5845
|
+
t ? nl : "",
|
|
5846
5846
|
d.vitest ? `
|
|
5847
5847
|
/// <reference types="vitest/config" />` : "",
|
|
5848
5848
|
d["@vitest/browser"] ? `
|
|
@@ -5856,7 +5856,7 @@ declare module "@arcgis/lumina" {
|
|
|
5856
5856
|
`
|
|
5857
5857
|
].join("");
|
|
5858
5858
|
}
|
|
5859
|
-
const
|
|
5859
|
+
const il = `/**
|
|
5860
5860
|
* This file is autogenerated by \`@arcgis/lumina-compiler\` - do not edit it manually.
|
|
5861
5861
|
* Manual edits will be overwritten.
|
|
5862
5862
|
*
|
|
@@ -5864,8 +5864,8 @@ const tl = `/**
|
|
|
5864
5864
|
* as well as @arcgis/core typings if you use @arcgis/core.
|
|
5865
5865
|
*
|
|
5866
5866
|
* If you need to provide additional typings, create a separate file.
|
|
5867
|
-
*/`,
|
|
5868
|
-
/// <reference types="@arcgis/core/interfaces" />`,
|
|
5867
|
+
*/`, nl = `
|
|
5868
|
+
/// <reference types="@arcgis/core/interfaces" />`, Oe = "@arcgis/lumina:dependencySupport", ns = (e, t) => e.viteCommand === "serve" && /**
|
|
5869
5869
|
* Vitest started calling transformIndexHtml in browser mode versions ^2.1.4
|
|
5870
5870
|
* However, it is a bit buggy (see
|
|
5871
5871
|
* https://github.com/vitejs/vite/issues/19213). Instead, we are using test
|
|
@@ -5876,18 +5876,18 @@ const tl = `/**
|
|
|
5876
5876
|
* is doing:
|
|
5877
5877
|
* https://github.com/storybookjs/storybook/blob/a5c2cf1712f70b4e3ecf38d3c98e7db8e8d67849/code/builders/builder-vite/src/plugins/code-generator-plugin.ts#L110
|
|
5878
5878
|
*/
|
|
5879
|
-
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0,
|
|
5880
|
-
name:
|
|
5879
|
+
e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, sl = (e) => ({
|
|
5880
|
+
name: Oe,
|
|
5881
5881
|
configResolved() {
|
|
5882
|
-
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise =
|
|
5883
|
-
(t) => E.error(
|
|
5882
|
+
!e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = rl(e).catch(
|
|
5883
|
+
(t) => E.error(Oe, `Failed to update package's src/lumina.ts: ${String(t)}`)
|
|
5884
5884
|
));
|
|
5885
5885
|
},
|
|
5886
5886
|
transformIndexHtml: {
|
|
5887
5887
|
// Add imports to index.html before Vite starts resolving imports
|
|
5888
5888
|
order: "pre",
|
|
5889
5889
|
async handler(t, i) {
|
|
5890
|
-
return ns(e, i) ? (await
|
|
5890
|
+
return ns(e, i) ? (await Ce(e)).map(
|
|
5891
5891
|
(s) => "javascriptCode" in s ? {
|
|
5892
5892
|
tag: "script",
|
|
5893
5893
|
attrs: {
|
|
@@ -5914,12 +5914,12 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5914
5914
|
async buildStart() {
|
|
5915
5915
|
if (e.viteCommand !== "serve")
|
|
5916
5916
|
return;
|
|
5917
|
-
const i = (await
|
|
5917
|
+
const i = (await Ce(e)).flatMap((n) => {
|
|
5918
5918
|
if ("javascriptCode" in n)
|
|
5919
5919
|
return n.optimizableImports;
|
|
5920
5920
|
if ("cssHref" in n)
|
|
5921
5921
|
return [];
|
|
5922
|
-
throw Error(T(
|
|
5922
|
+
throw Error(T(Oe, `Unexpected loader type: ${JSON.stringify(n)}`));
|
|
5923
5923
|
});
|
|
5924
5924
|
e.viteConfig.optimizeDeps.include ??= [], e.viteConfig.optimizeDeps.include.push(...i);
|
|
5925
5925
|
},
|
|
@@ -5927,33 +5927,33 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
|
|
|
5927
5927
|
await e._updateLuminaTsPromise;
|
|
5928
5928
|
}
|
|
5929
5929
|
});
|
|
5930
|
-
async function
|
|
5931
|
-
const i = (await Promise.all([
|
|
5930
|
+
async function rl(e) {
|
|
5931
|
+
const i = (await Promise.all([Te, zn(e)])).flat();
|
|
5932
5932
|
if (!await is(
|
|
5933
5933
|
i,
|
|
5934
5934
|
e.dir.src,
|
|
5935
|
-
|
|
5935
|
+
Pe,
|
|
5936
5936
|
e.viteConfig.test?.browser?.provider
|
|
5937
5937
|
))
|
|
5938
5938
|
return;
|
|
5939
5939
|
let s = !1;
|
|
5940
5940
|
function r() {
|
|
5941
|
-
s || E.warn(
|
|
5941
|
+
s || E.warn(Oe, ol), s = !0;
|
|
5942
5942
|
}
|
|
5943
5943
|
process.on("exit", () => {
|
|
5944
5944
|
r(), clearTimeout(c);
|
|
5945
5945
|
});
|
|
5946
5946
|
const c = setTimeout(r, 2e3);
|
|
5947
5947
|
}
|
|
5948
|
-
const
|
|
5948
|
+
const ol = Ds.greenBright(
|
|
5949
5949
|
`lumina.ts has been updated (potentially because your dependencies changed). Please commit the updated file.
|
|
5950
5950
|
If build failed with TypeScript errors, try running the build again to check whether new lumina.ts resolves the errors.`
|
|
5951
5951
|
);
|
|
5952
|
-
async function
|
|
5952
|
+
async function al(e, t) {
|
|
5953
5953
|
const i = /* @__PURE__ */ new Map();
|
|
5954
5954
|
await Promise.all(
|
|
5955
5955
|
e.map(async (s) => {
|
|
5956
|
-
const r = await J(s, "utf-8"), a = r.match(
|
|
5956
|
+
const r = await J(s, "utf-8"), a = r.match(cl)?.[1];
|
|
5957
5957
|
if (a === void 0) {
|
|
5958
5958
|
E.warn(
|
|
5959
5959
|
"@arcgis/lumina:parseStoryFiles",
|
|
@@ -5965,14 +5965,14 @@ async function ol(e, t) {
|
|
|
5965
5965
|
let c = i.get(a);
|
|
5966
5966
|
c === void 0 && (c = [], i.set(a, c));
|
|
5967
5967
|
const d = [];
|
|
5968
|
-
for (const l of r.matchAll(
|
|
5969
|
-
const p = l[1], m =
|
|
5968
|
+
for (const l of r.matchAll(ll)) {
|
|
5969
|
+
const p = l[1], m = ml(p), f = r.indexOf("{", l.index), y = r.indexOf("}", f), g = r.slice(0, l.index).trimEnd();
|
|
5970
5970
|
let v = "";
|
|
5971
5971
|
if (g.endsWith("*/")) {
|
|
5972
5972
|
const S = g.lastIndexOf("/**");
|
|
5973
|
-
v = g.slice(S + 3, -2).trim().replaceAll(
|
|
5973
|
+
v = g.slice(S + 3, -2).trim().replaceAll(pl, "");
|
|
5974
5974
|
}
|
|
5975
|
-
const h = r.slice(f, y).match(
|
|
5975
|
+
const h = r.slice(f, y).match(dl)?.[1] || m, b = ul(m);
|
|
5976
5976
|
d.push({
|
|
5977
5977
|
description: `${h}${v ? `
|
|
5978
5978
|
${v}` : ""}`,
|
|
@@ -5997,11 +5997,11 @@ ${v}` : ""}`,
|
|
|
5997
5997
|
}
|
|
5998
5998
|
return n;
|
|
5999
5999
|
}
|
|
6000
|
-
const
|
|
6001
|
-
var
|
|
6000
|
+
const cl = /component: ["']([^"']+)["']/u, ll = /export const (\w+)/gu, dl = /name: ["']([^"']+)["']/u, pl = /^\s*\*\s?/gmu, ul = (e) => e.toLowerCase().replace(/[ ’–—―′¿'`~!@#$%^&*()_|+\-=?;:'",.<>{}[\]\\/]/giu, "-").replace(/-+/gu, "-").replace(/^-+/u, "").replace(/-+$/u, ""), ml = (e) => e.replace(/_/gu, " ").replace(/-/gu, " ").replace(/\./gu, " ").replace(/([^\n])([A-Z])([a-z])/gu, (t, i, n, s) => `${i} ${n}${s}`).replace(/([a-z])([A-Z])/gu, (t, i, n) => `${i} ${n}`).replace(/([a-z])([0-9])/giu, (t, i, n) => `${i} ${n}`).replace(/([0-9])([a-z])/giu, (t, i, n) => `${i} ${n}`).replace(/(\s|^)(\w)/gu, (t, i, n) => `${i}${n.toUpperCase()}`).replace(/ +/gu, " ").trim(), ie = { node: "^22" };
|
|
6001
|
+
var fl = Object.defineProperty, I = (e, t, i, n) => {
|
|
6002
6002
|
for (var s = void 0, r = e.length - 1, a; r >= 0; r--)
|
|
6003
6003
|
(a = e[r]) && (s = a(t, i, s) || s);
|
|
6004
|
-
return s &&
|
|
6004
|
+
return s && fl(t, i, s), s;
|
|
6005
6005
|
};
|
|
6006
6006
|
const B = "@arcgis/lumina:context";
|
|
6007
6007
|
class x {
|
|
@@ -6017,7 +6017,7 @@ class x {
|
|
|
6017
6017
|
this.viteConfig = a;
|
|
6018
6018
|
const c = a.build.minify !== !1;
|
|
6019
6019
|
this.shouldMinify = c && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
|
|
6020
|
-
const d = u.join(a.root, u.sep), l = u.join(d, "src", u.sep), p = u.join(l, "components", u.sep), m = u.join(u.resolve(d, a.build.outDir), u.sep), f = u.join(u.relative(d, m), u.sep), y = u.join(m, "components", u.sep), g = u.join(m, this.options.build?.cdn?.namespace ??
|
|
6020
|
+
const d = u.join(a.root, u.sep), l = u.join(d, "src", u.sep), p = u.join(l, "components", u.sep), m = u.join(u.resolve(d, a.build.outDir), u.sep), f = u.join(u.relative(d, m), u.sep), y = u.join(m, "components", u.sep), g = u.join(m, this.options.build?.cdn?.namespace ?? xe, u.sep), v = u.join(g, "assets", u.sep);
|
|
6021
6021
|
if (this.dir = {
|
|
6022
6022
|
root: d,
|
|
6023
6023
|
src: l,
|
|
@@ -6042,9 +6042,9 @@ class x {
|
|
|
6042
6042
|
"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."
|
|
6043
6043
|
), this.isInStorybook = a.resolve.conditions.includes("storybook"), this.isFullApiExtraction = this.viteCommand === "build" || this.isInStorybook, this.hmrEnabled = this.viteCommand === "serve" && !this.isInTest && !!(a.server?.hmr ?? !0);
|
|
6044
6044
|
const h = this.options.documentation?.publicStoryUrlPrefix;
|
|
6045
|
-
this.isFullApiExtraction && typeof h == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await
|
|
6045
|
+
this.isFullApiExtraction && typeof h == "string" ? this.componentStoriesPromise = this.componentFilesPromise.then(async () => await al(this.componentStoryFiles, h)).then((b) => {
|
|
6046
6046
|
this.componentStories = b;
|
|
6047
|
-
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0),
|
|
6047
|
+
}) : (this.componentStoriesPromise = void 0, this.componentStories = void 0), hc(this, a.build.sourcemap !== !1), ns(this) && Ce(this);
|
|
6048
6048
|
}
|
|
6049
6049
|
},
|
|
6050
6050
|
configureServer: {
|
|
@@ -6083,9 +6083,9 @@ class x {
|
|
|
6083
6083
|
webTypes: s.jetBrains === !1 ? void 0 : s.jetBrains?.webTypesFileName ? me(s.jetBrains.webTypesFileName) : fe.webTypes,
|
|
6084
6084
|
vsCodeHtml: s.vsCode === !1 ? void 0 : s.vsCode?.htmlFileName ? me(s.vsCode.htmlFileName) : fe.vsCodeHtml,
|
|
6085
6085
|
vsCodeCss: s.vsCode === !1 ? void 0 : s.vsCode?.cssFileName ? me(s.vsCode.cssFileName) : fe.vsCodeCss
|
|
6086
|
-
}, hn(void 0, t), this.componentFilesPromise = xt(this, u.resolve("src/components")),
|
|
6087
|
-
const r = t.build?.preamble ??
|
|
6088
|
-
this.banner =
|
|
6086
|
+
}, hn(void 0, t), this.componentFilesPromise = xt(this, u.resolve("src/components")), yc(this);
|
|
6087
|
+
const r = t.build?.preamble ?? Yc();
|
|
6088
|
+
this.banner = el(r);
|
|
6089
6089
|
}
|
|
6090
6090
|
_inferBuildSetup({ command: t, mode: i }, n) {
|
|
6091
6091
|
this.isInTest = process.env.NODE_ENV === "test", i === "production" || i === "development" ? this.environment = i : i === "test" || i === "benchmark" ? (this.environment = "development", this.isInTest = !0) : (E.warn(kt, `Vite is running in unknown mode "${i}". Assuming development`), this.environment = "development"), this.viteCommand = t;
|
|
@@ -6243,8 +6243,8 @@ I([
|
|
|
6243
6243
|
I([
|
|
6244
6244
|
k("configResolved()")
|
|
6245
6245
|
], x.prototype, "_typeScriptPrinter");
|
|
6246
|
-
const
|
|
6247
|
-
name:
|
|
6246
|
+
const De = "@arcgis/lumina:addNonLazyImports", gl = (e) => ({
|
|
6247
|
+
name: De,
|
|
6248
6248
|
apply: () => e.viteCommand === "build",
|
|
6249
6249
|
generateBundle(t, i) {
|
|
6250
6250
|
let n = !1;
|
|
@@ -6253,16 +6253,16 @@ const Ne = "@arcgis/lumina:addNonLazyImports", fl = (e) => ({
|
|
|
6253
6253
|
if (a !== s && (r.fileName = a), r.type === "chunk") {
|
|
6254
6254
|
const c = u.dirname(u.join(e.dir.dist, s)), d = a === s ? c : u.dirname(u.join(e.dir.dist, a));
|
|
6255
6255
|
let l = r.code;
|
|
6256
|
-
l = Bi(l, e, d, c), !e.isInStorybook && a === "chunks/runtime.js" && (n = !0, l =
|
|
6256
|
+
l = Bi(l, e, d, c), !e.isInStorybook && a === "chunks/runtime.js" && (n = !0, l = uc(e) + l), r.code = l;
|
|
6257
6257
|
}
|
|
6258
6258
|
}), !n && !e.isInStorybook)
|
|
6259
|
-
throw Error(T(
|
|
6259
|
+
throw Error(T(De, "Expected to find a chunks/runtime.js file in the Vite's build output."));
|
|
6260
6260
|
},
|
|
6261
6261
|
async writeBundle() {
|
|
6262
6262
|
if (e.isInStorybook)
|
|
6263
6263
|
return;
|
|
6264
6264
|
const t = e._customElementDependencies, i = Object.entries(t), n = new Set(
|
|
6265
|
-
i.map(([r]) => r).filter((r) =>
|
|
6265
|
+
i.map(([r]) => r).filter((r) => we(r, e.dir.srcComponents))
|
|
6266
6266
|
);
|
|
6267
6267
|
i.forEach(([r, { referencedTagNames: a, referencedDeferredTagNames: c, referencedBy: d }]) => {
|
|
6268
6268
|
if (n.has(r) || a.length === 0 && c.length === 0)
|
|
@@ -6274,7 +6274,7 @@ const Ne = "@arcgis/lumina:addNonLazyImports", fl = (e) => ({
|
|
|
6274
6274
|
const p = te(r);
|
|
6275
6275
|
throw Error(
|
|
6276
6276
|
T(
|
|
6277
|
-
|
|
6277
|
+
De,
|
|
6278
6278
|
`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.
|
|
6279
6279
|
|
|
6280
6280
|
Possible causes:
|
|
@@ -6290,10 +6290,10 @@ Possible causes:
|
|
|
6290
6290
|
return [];
|
|
6291
6291
|
const d = u.dirname(r), l = be(d, e.dir.srcComponents, e), p = u.relative(e.dir.src, l);
|
|
6292
6292
|
function m(w) {
|
|
6293
|
-
const C =
|
|
6293
|
+
const C = za(e, w, r);
|
|
6294
6294
|
if (C === void 0)
|
|
6295
6295
|
return;
|
|
6296
|
-
const L =
|
|
6296
|
+
const L = qa(C, p);
|
|
6297
6297
|
if (L !== `./${p}`)
|
|
6298
6298
|
return L.startsWith(".") ? `${L}/${ki}` : L;
|
|
6299
6299
|
}
|
|
@@ -6303,7 +6303,7 @@ Possible causes:
|
|
|
6303
6303
|
if (C !== void 0) {
|
|
6304
6304
|
if (f.has(w)) {
|
|
6305
6305
|
E.warn(
|
|
6306
|
-
|
|
6306
|
+
De,
|
|
6307
6307
|
`"${w}" 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.`
|
|
6308
6308
|
);
|
|
6309
6309
|
return;
|
|
@@ -6316,12 +6316,12 @@ ${$}
|
|
|
6316
6316
|
deferredLoaders${S.join("")};` : $;
|
|
6317
6317
|
return [
|
|
6318
6318
|
D(u.join(e.dir.dist, p, ki), P),
|
|
6319
|
-
D(u.join(e.dir.dist, p,
|
|
6319
|
+
D(u.join(e.dir.dist, p, yl), A)
|
|
6320
6320
|
];
|
|
6321
6321
|
});
|
|
6322
6322
|
await Promise.all(s);
|
|
6323
6323
|
}
|
|
6324
|
-
}), ki = "index.js",
|
|
6324
|
+
}), ki = "index.js", yl = "index.d.ts", ss = (e, t, i, n = /* @__PURE__ */ new Set()) => t.flatMap((s) => i.has(s) ? [s] : n.has(s) ? [] : (n.add(s), ss(e, e[s].referencedBy, i, n))), hl = (e) => ({
|
|
6325
6325
|
name: "@arcgis/lumina:handleDynamicAssets",
|
|
6326
6326
|
configureServer(t) {
|
|
6327
6327
|
e.server = t, !e.isInPuppeteerTestBackEnd && Ii(e).forEach(({ assets: i, transformers: n }) => he(e, i, n));
|
|
@@ -6340,20 +6340,20 @@ function Ii(e) {
|
|
|
6340
6340
|
"type" in n ? t.push(n) : "assets" in n && t.push(...n.assets);
|
|
6341
6341
|
}), t.length > 0 && i.push({ assets: t }), e.assetsToProvide = void 0, i;
|
|
6342
6342
|
}
|
|
6343
|
-
const St = "@arcgis/lumina:updatePackageJson",
|
|
6343
|
+
const St = "@arcgis/lumina:updatePackageJson", vl = (e) => ({
|
|
6344
6344
|
name: St,
|
|
6345
6345
|
apply: () => e.viteCommand === "serve" && e.environment === "development" && !e.isInTest && !e.isInCi,
|
|
6346
6346
|
configResolved() {
|
|
6347
|
-
|
|
6347
|
+
bl(e).catch(
|
|
6348
6348
|
(t) => E.error(St, `Failed to update package's package.json:${String(t)}`)
|
|
6349
6349
|
);
|
|
6350
6350
|
}
|
|
6351
6351
|
});
|
|
6352
|
-
async function
|
|
6353
|
-
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n =
|
|
6352
|
+
async function bl(e) {
|
|
6353
|
+
const t = u.join(e.dir.root, "package.json"), i = JSON.parse(await J(t, "utf-8")), n = Sl(i, e);
|
|
6354
6354
|
n && Oi(t, JSON.stringify(n, null, 2));
|
|
6355
6355
|
}
|
|
6356
|
-
function
|
|
6356
|
+
function Sl(e, t) {
|
|
6357
6357
|
const i = e?.devDependencies ?? {};
|
|
6358
6358
|
Object.keys(e?.peerDependencies ?? {}).forEach((l) => {
|
|
6359
6359
|
l in i || E.warn(
|
|
@@ -6392,20 +6392,20 @@ function bl(e, t) {
|
|
|
6392
6392
|
if (n)
|
|
6393
6393
|
return e;
|
|
6394
6394
|
}
|
|
6395
|
-
const
|
|
6395
|
+
const wl = (e) => ({
|
|
6396
6396
|
timestamp: e.apiJson.timestamp,
|
|
6397
6397
|
compiler: e.apiJson.compiler,
|
|
6398
|
-
components:
|
|
6398
|
+
components: Tl(e),
|
|
6399
6399
|
typeLibrary: {}
|
|
6400
6400
|
});
|
|
6401
|
-
function
|
|
6401
|
+
function Tl(e) {
|
|
6402
6402
|
const t = [];
|
|
6403
6403
|
for (const i of e.apiJson.modules)
|
|
6404
6404
|
for (const n of i.declarations)
|
|
6405
|
-
"customElement" in n && t.push(
|
|
6405
|
+
"customElement" in n && t.push(El(n, i.path));
|
|
6406
6406
|
return t;
|
|
6407
6407
|
}
|
|
6408
|
-
function
|
|
6408
|
+
function El(e, t) {
|
|
6409
6409
|
const i = e.superclass ? [{ name: "superclass", text: JSON.stringify(e.superclass) }] : [];
|
|
6410
6410
|
return {
|
|
6411
6411
|
filePath: t,
|
|
@@ -6420,9 +6420,9 @@ function Tl(e, t) {
|
|
|
6420
6420
|
dependencies: [],
|
|
6421
6421
|
dependencyGraph: {},
|
|
6422
6422
|
deprecation: typeof e.deprecated == "boolean" ? e.deprecated ? "" : void 0 : e.deprecated,
|
|
6423
|
-
props: e.members.map(
|
|
6424
|
-
methods: e.members.map(
|
|
6425
|
-
events: e.events?.map(
|
|
6423
|
+
props: e.members.map(Cl).filter(j),
|
|
6424
|
+
methods: e.members.map($l).filter(j),
|
|
6425
|
+
events: e.events?.map(Pl) ?? [],
|
|
6426
6426
|
styles: e.cssProperties?.map((n) => ({
|
|
6427
6427
|
name: n.name,
|
|
6428
6428
|
annotation: "prop",
|
|
@@ -6434,7 +6434,7 @@ function Tl(e, t) {
|
|
|
6434
6434
|
listeners: []
|
|
6435
6435
|
};
|
|
6436
6436
|
}
|
|
6437
|
-
function
|
|
6437
|
+
function Cl(e) {
|
|
6438
6438
|
if (e.kind !== "field")
|
|
6439
6439
|
return;
|
|
6440
6440
|
const t = e, i = t.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(t.inheritedFrom) }] : [], n = t.readonly ? [{ name: "readonly", text: "" }] : [], s = t.docsTags?.some((r) => r.name === "required") ?? !1;
|
|
@@ -6475,7 +6475,7 @@ const Rt = (e) => Object.fromEntries(
|
|
|
6475
6475
|
]
|
|
6476
6476
|
) ?? []
|
|
6477
6477
|
);
|
|
6478
|
-
function
|
|
6478
|
+
function $l(e) {
|
|
6479
6479
|
if (e.kind !== "method")
|
|
6480
6480
|
return;
|
|
6481
6481
|
const t = e, i = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [], n = t.parameters?.map(({ name: s, type: r, description: a }) => ({
|
|
@@ -6506,7 +6506,7 @@ function Cl(e) {
|
|
|
6506
6506
|
deprecation: typeof t.deprecated == "boolean" ? t.deprecated ? "" : void 0 : t.deprecated
|
|
6507
6507
|
};
|
|
6508
6508
|
}
|
|
6509
|
-
function
|
|
6509
|
+
function Pl(e) {
|
|
6510
6510
|
const t = e.inheritedFrom ? [{ name: "inheritedFrom", text: JSON.stringify(e.inheritedFrom) }] : [];
|
|
6511
6511
|
return {
|
|
6512
6512
|
event: e.name,
|
|
@@ -6534,14 +6534,14 @@ const rs = (e) => e.flatMap(
|
|
|
6534
6534
|
name: `::part(${i.name})`,
|
|
6535
6535
|
description: i.description || void 0
|
|
6536
6536
|
})) ?? []
|
|
6537
|
-
),
|
|
6537
|
+
), xl = (e) => e.attributes?.map((t) => ({
|
|
6538
6538
|
name: t.name ?? "",
|
|
6539
6539
|
description: Ze(t.description, t.deprecated) || void 0,
|
|
6540
6540
|
default: t.default,
|
|
6541
6541
|
value: {
|
|
6542
|
-
type:
|
|
6542
|
+
type: kl(t.type.values?.map(un))
|
|
6543
6543
|
}
|
|
6544
|
-
})) ?? [],
|
|
6544
|
+
})) ?? [], kl = (e) => e?.length === 1 ? e[0] : e, Ze = (e = "", t = !1) => t === !1 ? e : `**Deprecated**${typeof t == "string" ? `: ${t}` : ""}. ${e}`, ke = {
|
|
6545
6545
|
slots: "Slots",
|
|
6546
6546
|
events: "Events",
|
|
6547
6547
|
cssProperties: "CSS Properties",
|
|
@@ -6549,36 +6549,36 @@ const rs = (e) => e.flatMap(
|
|
|
6549
6549
|
methods: "Methods"
|
|
6550
6550
|
};
|
|
6551
6551
|
function as(e) {
|
|
6552
|
-
const t =
|
|
6552
|
+
const t = Il(e.slots), i = Al(e.events), n = Ll(e.cssProperties), s = Fl(e.cssParts), r = Nl(e.members), a = Ze(e.description, e.deprecated).trim();
|
|
6553
6553
|
return [...a ? [`${a}
|
|
6554
6554
|
--`] : [], i, r, t, n, s].filter(Boolean).join(`
|
|
6555
6555
|
|
|
6556
6556
|
`);
|
|
6557
6557
|
}
|
|
6558
|
-
const
|
|
6558
|
+
const Ie = (e, t) => t === void 0 || t.length === 0 ? "" : `### ${e}
|
|
6559
6559
|
${t.join(`
|
|
6560
|
-
`)}`,
|
|
6561
|
-
|
|
6560
|
+
`)}`, Il = (e) => Ie(
|
|
6561
|
+
ke.slots,
|
|
6562
6562
|
e?.map((t) => `- ${t.name ? `**${t.name}**` : "_default_"} - ${t.description}`)
|
|
6563
|
-
),
|
|
6564
|
-
|
|
6563
|
+
), Al = (e) => Ie(
|
|
6564
|
+
ke.events,
|
|
6565
6565
|
e?.filter((t) => t.name !== null && t.name !== void 0).map((t) => `- **${t.name}**${t.description ? ` - ${t.description}` : ""}`)
|
|
6566
|
-
),
|
|
6567
|
-
|
|
6566
|
+
), Ll = (e = []) => Ie(
|
|
6567
|
+
ke.cssProperties,
|
|
6568
6568
|
e?.map(
|
|
6569
6569
|
(t) => `- **${t.name}** - ${t.description} ${t.default ? `_(default: ${t.default})_}` : ""}`
|
|
6570
6570
|
)
|
|
6571
|
-
),
|
|
6572
|
-
|
|
6571
|
+
), Fl = (e) => Ie(
|
|
6572
|
+
ke.cssParts,
|
|
6573
6573
|
e?.map((t) => `- **${t.name}** - ${t.description}`)
|
|
6574
|
-
),
|
|
6575
|
-
|
|
6574
|
+
), Nl = (e) => Ie(
|
|
6575
|
+
ke.methods,
|
|
6576
6576
|
e.filter(fs).map(
|
|
6577
6577
|
(t) => [`- \`${t.name}${t.signature}\``, Ze(t.description, t.deprecated)].filter(Boolean).join(" - ")
|
|
6578
6578
|
)
|
|
6579
6579
|
);
|
|
6580
|
-
function
|
|
6581
|
-
const i =
|
|
6580
|
+
function Dl(e, t) {
|
|
6581
|
+
const i = jl(e), n = rs(e), s = os(e), r = R();
|
|
6582
6582
|
return {
|
|
6583
6583
|
$schema: "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
|
|
6584
6584
|
name: r.name,
|
|
@@ -6596,21 +6596,21 @@ function Nl(e, t) {
|
|
|
6596
6596
|
}
|
|
6597
6597
|
};
|
|
6598
6598
|
}
|
|
6599
|
-
const
|
|
6599
|
+
const jl = (e) => e.map((t) => ({
|
|
6600
6600
|
name: t.tagName,
|
|
6601
6601
|
description: as(t),
|
|
6602
6602
|
"doc-url": t.demos?.[0]?.url,
|
|
6603
|
-
attributes:
|
|
6603
|
+
attributes: xl(t),
|
|
6604
6604
|
slots: t.slots?.map((i) => ({
|
|
6605
6605
|
name: i.name,
|
|
6606
6606
|
description: i.description
|
|
6607
6607
|
})),
|
|
6608
6608
|
events: Ai(t),
|
|
6609
6609
|
js: {
|
|
6610
|
-
properties:
|
|
6610
|
+
properties: Rl(t),
|
|
6611
6611
|
events: Ai(t)
|
|
6612
6612
|
}
|
|
6613
|
-
})),
|
|
6613
|
+
})), Rl = (e) => e.members.filter(gs).map((t) => ({
|
|
6614
6614
|
name: t.name,
|
|
6615
6615
|
description: t.description,
|
|
6616
6616
|
type: t.type?.text
|
|
@@ -6618,30 +6618,30 @@ const Dl = (e) => e.map((t) => ({
|
|
|
6618
6618
|
name: t.name,
|
|
6619
6619
|
type: t.type?.text,
|
|
6620
6620
|
description: t.description
|
|
6621
|
-
})) ?? [],
|
|
6621
|
+
})) ?? [], Ml = (e) => e.map((t) => ({
|
|
6622
6622
|
name: t.tagName,
|
|
6623
6623
|
description: as(t),
|
|
6624
|
-
attributes:
|
|
6624
|
+
attributes: Ol(t),
|
|
6625
6625
|
references: t.demos?.map((i) => ({ name: i.description, url: i.url })) ?? []
|
|
6626
|
-
})),
|
|
6626
|
+
})), Ol = (e) => e.attributes?.map((t) => ({
|
|
6627
6627
|
name: t.name,
|
|
6628
6628
|
description: Ze(t.description, t.deprecated) || void 0,
|
|
6629
|
-
values:
|
|
6630
|
-
})) ?? [],
|
|
6629
|
+
values: Jl(t)
|
|
6630
|
+
})) ?? [], Jl = (e) => e.type.values?.map((t) => t.value ?? "").filter(Boolean).map((t) => ({ name: t })) ?? [], Kl = (e) => ({
|
|
6631
6631
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-html-languageservice/main/docs/customData.schema.json",
|
|
6632
6632
|
version: 1.1,
|
|
6633
|
-
tags:
|
|
6634
|
-
}),
|
|
6633
|
+
tags: Ml(e)
|
|
6634
|
+
}), Bl = (e) => ({
|
|
6635
6635
|
$schema: "https://raw.githubusercontent.com/microsoft/vscode-css-languageservice/main/docs/customData.schema.json",
|
|
6636
6636
|
version: 1.1,
|
|
6637
6637
|
properties: rs(e),
|
|
6638
6638
|
pseudoElements: os(e)
|
|
6639
|
-
}),
|
|
6640
|
-
function
|
|
6639
|
+
}), Wl = "@arcgis/lumina:generateDocs";
|
|
6640
|
+
function _l(e) {
|
|
6641
6641
|
return e._documentationFileNames.stencilLikeDocsJson !== void 0 && e.provideAssets([
|
|
6642
6642
|
{
|
|
6643
6643
|
type: "dynamic",
|
|
6644
|
-
source: () => JSON.stringify(
|
|
6644
|
+
source: () => JSON.stringify(wl(e), null, 2),
|
|
6645
6645
|
destination: u.join("../..", e._documentationFileNames.stencilLikeDocsJson)
|
|
6646
6646
|
}
|
|
6647
6647
|
]), e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
|
|
@@ -6651,7 +6651,7 @@ function Wl(e) {
|
|
|
6651
6651
|
destination: u.join("../..", e._documentationFileNames.apiJson)
|
|
6652
6652
|
}
|
|
6653
6653
|
]), {
|
|
6654
|
-
name:
|
|
6654
|
+
name: Wl,
|
|
6655
6655
|
async writeBundle() {
|
|
6656
6656
|
if (e.isInStorybook)
|
|
6657
6657
|
return;
|
|
@@ -6661,24 +6661,24 @@ function Wl(e) {
|
|
|
6661
6661
|
await Yn(a);
|
|
6662
6662
|
const c = [];
|
|
6663
6663
|
if (n !== void 0) {
|
|
6664
|
-
const d = JSON.stringify(
|
|
6664
|
+
const d = JSON.stringify(Kl(e.apiJsonComponents), null, 2);
|
|
6665
6665
|
c.push(D(n, d));
|
|
6666
6666
|
}
|
|
6667
6667
|
if (s !== void 0) {
|
|
6668
|
-
const d = JSON.stringify(
|
|
6668
|
+
const d = JSON.stringify(Bl(e.apiJsonComponents), null, 2);
|
|
6669
6669
|
c.push(D(s, d));
|
|
6670
6670
|
}
|
|
6671
6671
|
if (r !== void 0) {
|
|
6672
|
-
const d =
|
|
6672
|
+
const d = Dl(e.apiJsonComponents, typeof t == "object" ? t : {});
|
|
6673
6673
|
c.push(D(r, JSON.stringify(d, null, 2)));
|
|
6674
6674
|
}
|
|
6675
6675
|
await Promise.all(c);
|
|
6676
6676
|
}
|
|
6677
6677
|
};
|
|
6678
6678
|
}
|
|
6679
|
-
const
|
|
6679
|
+
const Ul = (e) => `import type { h, EventHandler } from "@arcgis/lumina";
|
|
6680
6680
|
|
|
6681
|
-
${e.map(
|
|
6681
|
+
${e.map(Hl).join(`
|
|
6682
6682
|
|
|
6683
6683
|
`)}
|
|
6684
6684
|
|
|
@@ -6690,20 +6690,20 @@ ${e.map(({ tagName: t, pascalCaseName: i }) => ` "${t}": Lumina${i};`).join
|
|
|
6690
6690
|
}
|
|
6691
6691
|
}
|
|
6692
6692
|
}`;
|
|
6693
|
-
function
|
|
6693
|
+
function Hl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6694
6694
|
const [s, r] = Qe(e, i);
|
|
6695
6695
|
return [
|
|
6696
6696
|
`interface Lumina${t} extends ${s}h.JSX.HTMLAttributes<HTML${t}Element> {
|
|
6697
6697
|
`,
|
|
6698
6698
|
n.map(
|
|
6699
|
-
(a) => ` ${
|
|
6699
|
+
(a) => ` ${$e(`on${a.name}`)}?: EventHandler<HTML${t}Element["${a.name}"]>;
|
|
6700
6700
|
`
|
|
6701
6701
|
).join(""),
|
|
6702
6702
|
"}",
|
|
6703
6703
|
r
|
|
6704
6704
|
].join("");
|
|
6705
6705
|
}
|
|
6706
|
-
function
|
|
6706
|
+
function zl(e) {
|
|
6707
6707
|
const t = ` interface IntrinsicElements extends PreactJsx.IntrinsicElements {
|
|
6708
6708
|
${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join(`
|
|
6709
6709
|
`)}
|
|
@@ -6711,7 +6711,7 @@ ${e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": Preact${i};`).join
|
|
|
6711
6711
|
return `import { JSX as PreactJsx } from "preact";
|
|
6712
6712
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6713
6713
|
|
|
6714
|
-
${e.map(
|
|
6714
|
+
${e.map(ql).join(`
|
|
6715
6715
|
|
|
6716
6716
|
`)}
|
|
6717
6717
|
|
|
@@ -6724,26 +6724,26 @@ ${t}
|
|
|
6724
6724
|
}
|
|
6725
6725
|
}`;
|
|
6726
6726
|
}
|
|
6727
|
-
function
|
|
6727
|
+
function ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6728
6728
|
const [s, r] = Qe(e, i);
|
|
6729
6729
|
return [
|
|
6730
6730
|
`interface Preact${t} extends ${s}PreactJsx.HTMLAttributes<HTML${t}Element> {
|
|
6731
6731
|
`,
|
|
6732
6732
|
n.map(
|
|
6733
|
-
(a) => ` ${
|
|
6733
|
+
(a) => ` ${$e(`on${a.name}`)}?: EventHandler<HTML${t}Element["${a.name}"]>;
|
|
6734
6734
|
`
|
|
6735
6735
|
).join(""),
|
|
6736
6736
|
"}",
|
|
6737
6737
|
r
|
|
6738
6738
|
].join("");
|
|
6739
6739
|
}
|
|
6740
|
-
function
|
|
6740
|
+
function Gl(e) {
|
|
6741
6741
|
const t = e.map(({ pascalCaseName: i, tagName: n }) => ` "${n}": React${i};`).join(`
|
|
6742
6742
|
`);
|
|
6743
6743
|
return `import type { HTMLProps } from 'react';
|
|
6744
6744
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6745
6745
|
|
|
6746
|
-
${e.map(
|
|
6746
|
+
${e.map(Vl).join(`
|
|
6747
6747
|
|
|
6748
6748
|
`)}
|
|
6749
6749
|
|
|
@@ -6769,23 +6769,23 @@ ${t}
|
|
|
6769
6769
|
}
|
|
6770
6770
|
}`;
|
|
6771
6771
|
}
|
|
6772
|
-
function
|
|
6772
|
+
function Vl({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6773
6773
|
const [s, r] = Qe(e, i);
|
|
6774
6774
|
return [
|
|
6775
6775
|
`interface React${t} extends ${s}HTMLProps<HTML${t}Element> {
|
|
6776
6776
|
`,
|
|
6777
6777
|
n.map(
|
|
6778
|
-
(a) => ` ${
|
|
6778
|
+
(a) => ` ${$e(`on${a.name}`)}?: EventHandler<HTML${t}Element["${a.name}"]>;
|
|
6779
6779
|
`
|
|
6780
6780
|
).join(""),
|
|
6781
6781
|
"}",
|
|
6782
6782
|
r
|
|
6783
6783
|
].join("");
|
|
6784
6784
|
}
|
|
6785
|
-
const
|
|
6785
|
+
const Xl = (e) => `import { JSXBase as StencilJsx } from "@stencil/core/internal";
|
|
6786
6786
|
import type { EventHandler } from "@arcgis/lumina";
|
|
6787
6787
|
|
|
6788
|
-
${e.map(
|
|
6788
|
+
${e.map(Ql).join(`
|
|
6789
6789
|
|
|
6790
6790
|
`)}
|
|
6791
6791
|
|
|
@@ -6803,29 +6803,29 @@ declare module "@stencil/core/internal/stencil-public-runtime" {
|
|
|
6803
6803
|
interface IntrinsicElements extends ExposedElements {}
|
|
6804
6804
|
}
|
|
6805
6805
|
}`;
|
|
6806
|
-
function
|
|
6806
|
+
function Ql({ name: e, pascalCaseName: t, members: i, events: n = [] }) {
|
|
6807
6807
|
const [s, r] = Qe(e, i);
|
|
6808
6808
|
return [
|
|
6809
6809
|
`interface Stencil${t} extends ${s}StencilJsx.HTMLAttributes<HTML${t}Element> {
|
|
6810
6810
|
`,
|
|
6811
6811
|
n.map(
|
|
6812
|
-
(a) => ` ${
|
|
6812
|
+
(a) => ` ${$e(`on${a.name[0].toUpperCase()}${a.name.slice(1)}`)}?: EventHandler<HTML${t}Element["${a.name}"]>;
|
|
6813
6813
|
`
|
|
6814
6814
|
).join(""),
|
|
6815
6815
|
"}",
|
|
6816
6816
|
r
|
|
6817
6817
|
].join("");
|
|
6818
6818
|
}
|
|
6819
|
-
const
|
|
6819
|
+
const Zl = (e, t, i) => [i, t, Yl(e), ed(e)].join(`
|
|
6820
6820
|
|
|
6821
|
-
`),
|
|
6821
|
+
`), Yl = (e) => e.filter((t) => (t.events?.length ?? 0) > 0).map(
|
|
6822
6822
|
({ pascalCaseName: t }) => `export interface ${t}CustomEvent<T> extends CustomEvent<T> {
|
|
6823
6823
|
detail: T;
|
|
6824
6824
|
target: HTML${t}Element;
|
|
6825
6825
|
currentTarget: HTML${t}Element;
|
|
6826
6826
|
}`
|
|
6827
6827
|
).join(`
|
|
6828
|
-
`),
|
|
6828
|
+
`), ed = (e) => `export { ToEvents, TargetedEvent } from "@arcgis/lumina";
|
|
6829
6829
|
|
|
6830
6830
|
declare global {
|
|
6831
6831
|
interface HTMLElementTagNameMap {
|
|
@@ -6833,12 +6833,12 @@ ${e.map(({ pascalCaseName: t, tagName: i }) => ` "${i}": HTML${t}Element;`).j
|
|
|
6833
6833
|
`)}
|
|
6834
6834
|
}
|
|
6835
6835
|
|
|
6836
|
-
${e.map(
|
|
6836
|
+
${e.map(td).join(`
|
|
6837
6837
|
`).split(`
|
|
6838
6838
|
`).map((t) => t.length > 0 ? ` ${t}` : t).join(`
|
|
6839
6839
|
`)}
|
|
6840
6840
|
}`;
|
|
6841
|
-
function
|
|
6841
|
+
function td({ name: e, pascalCaseName: t, events: i = [] }) {
|
|
6842
6842
|
const n = i.length > 0, s = `${t}CustomEvent`, r = `HTML${t}Element`;
|
|
6843
6843
|
return [
|
|
6844
6844
|
n ? `interface ${r}EventMap {
|
|
@@ -6857,7 +6857,7 @@ ${n ? ` addEventListener<K extends keyof ${r}EventMap>(type: K, listener: (this
|
|
|
6857
6857
|
}`
|
|
6858
6858
|
].join("");
|
|
6859
6859
|
}
|
|
6860
|
-
function
|
|
6860
|
+
function id(e) {
|
|
6861
6861
|
let t;
|
|
6862
6862
|
return {
|
|
6863
6863
|
name: "@arcgis/lumina:generateFrameworkTypes",
|
|
@@ -6865,11 +6865,11 @@ function td(e) {
|
|
|
6865
6865
|
generateBundle() {
|
|
6866
6866
|
if (e.isInStorybook)
|
|
6867
6867
|
return;
|
|
6868
|
-
t =
|
|
6868
|
+
t = Na(e);
|
|
6869
6869
|
const i = u.join(e.dir.dist, "index.d.ts");
|
|
6870
6870
|
e._declarationTextTransformers.push((n) => {
|
|
6871
6871
|
const { filePath: s, content: r } = n;
|
|
6872
|
-
return s === i ? { filePath: s, content:
|
|
6872
|
+
return s === i ? { filePath: s, content: Zl(e.apiJsonComponents, r, t) } : n;
|
|
6873
6873
|
});
|
|
6874
6874
|
},
|
|
6875
6875
|
async writeBundle() {
|
|
@@ -6879,10 +6879,10 @@ function td(e) {
|
|
|
6879
6879
|
await Q(i);
|
|
6880
6880
|
const n = `/// <reference types="../index.d.ts" />
|
|
6881
6881
|
${t.replaceAll("./", "../")}`, s = Object.entries({
|
|
6882
|
-
react:
|
|
6883
|
-
preact:
|
|
6884
|
-
stencil:
|
|
6885
|
-
lumina:
|
|
6882
|
+
react: Gl(e.apiJsonComponents),
|
|
6883
|
+
preact: zl(e.apiJsonComponents),
|
|
6884
|
+
stencil: Xl(e.apiJsonComponents),
|
|
6885
|
+
lumina: Ul(e.apiJsonComponents)
|
|
6886
6886
|
}).map(
|
|
6887
6887
|
async ([r, a]) => await D(u.join(i, `${r}.d.ts`), `${n}
|
|
6888
6888
|
${a}`)
|
|
@@ -6891,38 +6891,38 @@ ${a}`)
|
|
|
6891
6891
|
}
|
|
6892
6892
|
};
|
|
6893
6893
|
}
|
|
6894
|
-
function
|
|
6894
|
+
function nd(e) {
|
|
6895
6895
|
return {
|
|
6896
6896
|
name: "@arcgis/lumina:buildWrappers",
|
|
6897
6897
|
apply: () => e.viteCommand === "build" && !!e.options.build?.wrappers?.length,
|
|
6898
6898
|
async writeBundle() {
|
|
6899
6899
|
e.isInStorybook || await Promise.all(
|
|
6900
6900
|
e.options.build?.wrappers?.map(async (t) => {
|
|
6901
|
-
t.type === "react18" && await
|
|
6901
|
+
t.type === "react18" && await od(e, t);
|
|
6902
6902
|
}) ?? []
|
|
6903
6903
|
);
|
|
6904
6904
|
}
|
|
6905
6905
|
};
|
|
6906
6906
|
}
|
|
6907
|
-
const
|
|
6908
|
-
import React from "${
|
|
6907
|
+
const sd = "react", Li = "@lit/react", rd = `
|
|
6908
|
+
import React from "${sd}";
|
|
6909
6909
|
import { createComponent } from "${Li}";
|
|
6910
6910
|
import type { EventName } from "${Li}";
|
|
6911
6911
|
import { makeReactWrapperFactory, getReactWrapperOptions } from "@arcgis/lumina";
|
|
6912
6912
|
|
|
6913
6913
|
const createWrapper = /*@__PURE__*/ makeReactWrapperFactory(React, createComponent) as typeof createComponent;
|
|
6914
6914
|
`;
|
|
6915
|
-
async function
|
|
6915
|
+
async function od(e, t) {
|
|
6916
6916
|
const { name: i } = R(), n = [];
|
|
6917
6917
|
for (const a of e.apiJson.modules)
|
|
6918
6918
|
for (const c of a.declarations)
|
|
6919
|
-
"customElement" in c && n.push(
|
|
6920
|
-
const s = [`/// <reference types="${i}" preserve="true" />`,
|
|
6919
|
+
"customElement" in c && n.push(ad(c));
|
|
6920
|
+
const s = [`/// <reference types="${i}" preserve="true" />`, rd, ...n].join(""), r = u.resolve(t.proxiesFile);
|
|
6921
6921
|
await Q(u.dirname(r), { recursive: !0 }), await D(r, s);
|
|
6922
6922
|
}
|
|
6923
|
-
function
|
|
6923
|
+
function ad(e) {
|
|
6924
6924
|
const t = e.events?.map(
|
|
6925
|
-
(i) => ` ${
|
|
6925
|
+
(i) => ` ${$e(`on${vs(i.name)}`)}: "${i.name}" as EventName<HTML${e.pascalCaseName}Element["${i.name}"]>,`
|
|
6926
6926
|
).join(`
|
|
6927
6927
|
`);
|
|
6928
6928
|
return `
|
|
@@ -6936,30 +6936,30 @@ ${t}
|
|
|
6936
6936
|
);
|
|
6937
6937
|
`;
|
|
6938
6938
|
}
|
|
6939
|
-
function
|
|
6939
|
+
function $d(e = {}) {
|
|
6940
6940
|
const t = new x(e), n = [
|
|
6941
6941
|
t._plugin,
|
|
6942
|
-
Xc(t),
|
|
6943
6942
|
Qc(t),
|
|
6944
|
-
|
|
6943
|
+
Zc(t),
|
|
6944
|
+
vl(t),
|
|
6945
6945
|
$r(t),
|
|
6946
|
-
|
|
6947
|
-
td(t),
|
|
6948
|
-
Wl(t),
|
|
6949
|
-
mc(t),
|
|
6950
|
-
Hr(t),
|
|
6951
|
-
_c(t),
|
|
6952
|
-
yl(t),
|
|
6953
|
-
fl(t),
|
|
6954
|
-
nl(t),
|
|
6955
|
-
js(t),
|
|
6956
|
-
vc(t),
|
|
6946
|
+
Jc(t),
|
|
6957
6947
|
id(t),
|
|
6958
|
-
|
|
6948
|
+
_l(t),
|
|
6949
|
+
fc(t),
|
|
6950
|
+
zr(t),
|
|
6951
|
+
Uc(t),
|
|
6952
|
+
hl(t),
|
|
6953
|
+
gl(t),
|
|
6954
|
+
sl(t),
|
|
6955
|
+
js(t),
|
|
6956
|
+
bc(t),
|
|
6957
|
+
nd(t),
|
|
6958
|
+
zc(t)
|
|
6959
6959
|
].filter(j);
|
|
6960
6960
|
return n.context = t, n;
|
|
6961
6961
|
}
|
|
6962
|
-
const
|
|
6962
|
+
const Pd = {
|
|
6963
6963
|
initializeComponentDependencies: hn,
|
|
6964
6964
|
updateLuminaTs: is,
|
|
6965
6965
|
propertyToAttributeMappings: U,
|
|
@@ -6974,7 +6974,7 @@ const $d = {
|
|
|
6974
6974
|
};
|
|
6975
6975
|
export {
|
|
6976
6976
|
We as LuminaApiExtractor,
|
|
6977
|
-
|
|
6977
|
+
Pd as exportsForCodemod,
|
|
6978
6978
|
Ge as inferCdnUrl,
|
|
6979
|
-
|
|
6979
|
+
$d as useLumina
|
|
6980
6980
|
};
|