@arcgis/lumina-compiler 5.2.0-next.79 → 5.2.0-next.84

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.
Files changed (2) hide show
  1. package/dist/index.js +107 -87
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -4,7 +4,7 @@ import { f as b, l as $ } from "./logger-edpIalAo.js";
4
4
  import o from "typescript";
5
5
  import { camelToKebab as Vt, getPreamble as ds, uncapitalize as gt, capitalize as ps } from "@arcgis/toolkit/string";
6
6
  import { lazyMetaSubItemJoiner as ms, lazyMetaItemJoiner as De, lazyMetaGroupJoiner as us, propertyFlagAttribute as ht, propertyFlagReflect as fs, propertyFlagBoolean as gs, propertyFlagNumber as hs, propertyFlagState as ys, propertyFlagReadOnly as vs, propertyFlagNoAccessor as bs, propertyFlagUseDefault as ws } from "@arcgis/lumina/config";
7
- import { path as u, isPosix as Gt, toPosixPathSeparators as ce, toSystemPathSeparators as Ae, getCwd as Xt } from "@arcgis/node-toolkit/path";
7
+ import { path as u, isPosix as Gt, toPosixPathSeparators as de, toSystemPathSeparators as Ae, getCwd as Xt } from "@arcgis/node-toolkit/path";
8
8
  import { isApiMethodAsync as Ss, globalPackageIdentifier as Cs, isApiMethod as Es, isApiProperty as Ts } from "@arcgis/api-extractor/utils/apiHelpers";
9
9
  import { existsAsync as K } from "@arcgis/node-toolkit/file";
10
10
  import { readFile as z, readdir as et, mkdir as V, writeFile as _, copyFile as $s, rm as Ps, cp as Is } from "node:fs/promises";
@@ -1158,15 +1158,15 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1158
1158
  "&": "&",
1159
1159
  "<": "&lt;",
1160
1160
  ">": "&gt;"
1161
- }, oi = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], se = "staticHtml", G = "staticSvg", re = "html", ee = "svg", ai = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), li = "css", ci = "mathml", di = [li, re, ci, se, G, ee], Qs = new Set(di), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...di, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => de(t)), de = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1162
- [re]: ["lit", "lit/html.js", "lit-html"],
1161
+ }, oi = (e) => e.replace(Gs, (t) => Xs[t]), rt = (e) => typeof e == "string" && e.includes("-") && !Us.has(e), Ys = ["keyed", "ref", "repeat", "live"], re = "staticHtml", G = "staticSvg", ne = "html", ee = "svg", ai = /* @__PURE__ */ Symbol("maybe HTML namespace or maybe SVG"), li = "css", ci = "mathml", di = [li, ne, ci, re, G, ee], Qs = new Set(di), Zs = ["safeClassMap", "safeStyleMap", "deferLoad", "stabilizedRef"], er = "nothing", tr = [...Ys, ...di, ...Zs, er], ir = (e) => o.isArrayLiteralExpression(e) && e.elements.every((t) => pe(t)), pe = (e) => o.isJsxElement(e) || o.isJsxSelfClosingElement(e) || o.isJsxFragment(e), te = {
1162
+ [ne]: ["lit", "lit/html.js", "lit-html"],
1163
1163
  /**
1164
1164
  * Sadly, Lit called these "html" and "svg", rather than "staticHtml" and
1165
1165
  * "staticSvg", leading to collision. We have to import them "as", as well as
1166
1166
  * check for existing "html" and "svg" imports from these locations to prevent
1167
1167
  * collisions.
1168
1168
  */
1169
- [se]: ["lit/static-html.js", "lit-html/static.js"],
1169
+ [re]: ["lit/static-html.js", "lit-html/static.js"],
1170
1170
  [ee]: ["lit", "lit-html", "lit/html.js"],
1171
1171
  [G]: ["lit/static-html.js", "lit-html/static.js"],
1172
1172
  [ci]: ["lit", "lit-html", "lit/html.js"],
@@ -1190,15 +1190,15 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1190
1190
  "bindProperty",
1191
1191
  "bindEvent",
1192
1192
  "bindAttribute"
1193
- ]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, oe = "@arcgis/lumina:loadLitCss", Te = "?litCss", X = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
1194
- name: oe,
1193
+ ]), rr = /\.(?:css|s[ac]ss|less|styl(?:us)?|postcss|pcss|sss)(\\?|$)/u, ae = "@arcgis/lumina:loadLitCss", Te = "?litCss", X = "?layeredLitCss", Ve = "?globalFileLitCss", nr = (e) => ({
1194
+ name: ae,
1195
1195
  enforce: "pre",
1196
1196
  configResolved(t) {
1197
1197
  const i = t.plugins.find(({ name: r }) => r === "vite:css-post");
1198
1198
  if (i === void 0)
1199
1199
  throw Error(
1200
1200
  b(
1201
- oe,
1201
+ ae,
1202
1202
  "Unable to find the vite's built-in vite:css-post plugin. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
1203
1203
  )
1204
1204
  );
@@ -1206,7 +1206,7 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1206
1206
  if (typeof s != "object" || typeof s.handler != "function")
1207
1207
  throw Error(
1208
1208
  b(
1209
- oe,
1209
+ ae,
1210
1210
  "Expected vite:css-post to declare a transform:{handler()} property. This may indicate you are trying to use Vite 6 with Lumina version that is designed for Vite 7. Use `[p]npm list vite`/`yarn why vite` to check the Vite version you are using."
1211
1211
  )
1212
1212
  );
@@ -1214,7 +1214,7 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1214
1214
  if (n.length !== 1)
1215
1215
  throw Error(
1216
1216
  b(
1217
- oe,
1217
+ ae,
1218
1218
  `Expected vite:css-post's transform handler to have only a single property: handler. Found: ${n.join(",")}. This may indicate you are trying to use Lumina with a different Vite version than it was designed for. Use \`[p]npm list vite\`/\`yarn why vite\` to check the Vite version you are using.`
1219
1219
  )
1220
1220
  );
@@ -1231,7 +1231,7 @@ const zs = (e) => e.replaceAll("\\", "\\\\").replace(Hs, "\\${").replaceAll("`",
1231
1231
  return await s.handler.call(this, r, a);
1232
1232
  const p = `${a}?inline`, m = await s.handler.call(this, r, p), { code: f, ...g } = typeof m == "string" ? { code: m } : m ?? {};
1233
1233
  return typeof f != "string" || !f.startsWith(pi) || !f.endsWith(or) ? ($.warn(
1234
- oe,
1234
+ ae,
1235
1235
  `Expected vite:css-post to return a JS module with a string literal. Received: ${JSON.stringify(
1236
1236
  f
1237
1237
  )}`
@@ -1445,8 +1445,8 @@ async function bi(e, t) {
1445
1445
  if (a ? await K(c) : !1) {
1446
1446
  const g = await z(c, "utf8"), h = Ir(g, "bootstrapLazy("), v = g.indexOf(", options", h), y = g.slice(h, v), S = y.startsWith('JSON.parse("') ? y.slice(12, -2).replaceAll('\\"', '"') : y;
1447
1447
  try {
1448
- const C = JSON.parse(S), E = Dr(C, { packageName: e, getImportPath: r });
1449
- return { packageName: e, type: "stencil", components: E, packageLocation: i, packageJson: s };
1448
+ const C = JSON.parse(S), T = Dr(C, { packageName: e, getImportPath: r });
1449
+ return { packageName: e, type: "stencil", components: T, packageLocation: i, packageJson: s };
1450
1450
  } catch (C) {
1451
1451
  $.warn("@arcgis/lumina", `Failed to parse dist/esm/loader.js for ${e}.
1452
1452
  Error: ${String(C)}`);
@@ -1616,11 +1616,11 @@ async function Ci(e, t, i = ot) {
1616
1616
  }
1617
1617
  const Ei = Gt ? (e) => e : (e) => e.type === "dynamic" ? {
1618
1618
  ...e,
1619
- destination: ce(e.destination)
1619
+ destination: de(e.destination)
1620
1620
  } : {
1621
1621
  ...e,
1622
- source: ce(e.source),
1623
- destination: ce(e.destination)
1622
+ source: de(e.source),
1623
+ destination: de(e.destination)
1624
1624
  };
1625
1625
  async function St(e, t, i, s) {
1626
1626
  const n = i.find((r) => r.match(t, s));
@@ -1672,10 +1672,10 @@ async function Ii(e) {
1672
1672
  const _r = {
1673
1673
  match: (e, t) => t.environment === "production" && e.endsWith(".json"),
1674
1674
  transform: (e) => JSON.stringify(JSON.parse(e))
1675
- }, ot = [_r], Pe = "@arcgis/core", ki = "@arcgis/core/assets", Me = R(), ue = Pe in (Me.dependencies ?? {}) || Pe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1675
+ }, ot = [_r], Pe = "@arcgis/core", ki = "@arcgis/core/assets", Me = R(), se = Pe in (Me.dependencies ?? {}) || Pe in (Me.peerDependencies ?? {}) || // Does not depend on `@arcgis/core` to avoid cycle, but uses core in Lumina tests
1676
1676
  Me.name === "@arcgis/lumina";
1677
1677
  async function Ur(e, t, i) {
1678
- if (!ue)
1678
+ if (!se)
1679
1679
  return [];
1680
1680
  const s = await tt(Pe);
1681
1681
  if (t === "cdn") {
@@ -1769,7 +1769,7 @@ async function Yr(e, t, i) {
1769
1769
  // Not applicable for our glob pattern
1770
1770
  expandDirectories: !1
1771
1771
  })
1772
- ], r = u.relative(e.dir.root, e.dir.src), a = await pe(e), c = u.join(e.dir.src, "loader.ts"), d = a.map((l) => {
1772
+ ], r = u.relative(e.dir.root, e.dir.src), a = await me(e), c = u.join(e.dir.src, "loader.ts"), d = a.map((l) => {
1773
1773
  if ("cssHref" in l)
1774
1774
  return `<link rel="stylesheet" href="${l.cssHref}">`;
1775
1775
  if ("javascriptCode" in l && l.javascriptCode.at(0)?.includes(c) === !0)
@@ -1794,8 +1794,8 @@ async function Yr(e, t, i) {
1794
1794
  );
1795
1795
  if (C === Number.POSITIVE_INFINITY)
1796
1796
  throw Error(b("@arcgis/lumina:buildWebApp", `Failed to find <head> or <style> tag in ${g}`));
1797
- const E = v.slice(0, C) + S + v.slice(C), T = e.options?.build?.webApp?.transformFile?.(E, h, e) ?? E;
1798
- await _(h, T, "utf-8");
1797
+ const T = v.slice(0, C) + S + v.slice(C), E = e.options?.build?.webApp?.transformFile?.(T, h, e) ?? T;
1798
+ await _(h, E, "utf-8");
1799
1799
  })
1800
1800
  ), await e.options.build?.webApp?.afterBuildEnd?.(e);
1801
1801
  }
@@ -1812,7 +1812,7 @@ const Ai = /* @__PURE__ */ new Set([
1812
1812
  "collection",
1813
1813
  "extras",
1814
1814
  "support"
1815
- ]), D = "@arcgis/lumina:buildCdn", ne = "cdn", Li = "index", Y = "main";
1815
+ ]), D = "@arcgis/lumina:buildCdn", oe = "cdn", Li = "index", Y = "main";
1816
1816
  function Qr(e) {
1817
1817
  const { skip: t = !1, namespace: i, esbuildOptions: s = {}, entrypointTransformer: n } = e.options.build?.cdn ?? {}, r = e.options.build?.webApp?.destination, a = i !== void 0;
1818
1818
  if (a) {
@@ -1846,7 +1846,7 @@ function Qr(e) {
1846
1846
  );
1847
1847
  return;
1848
1848
  }
1849
- const d = ue && R().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await Zr(
1849
+ const d = se && R().name !== "@arcgis/embeddable-components", l = Date.now(), p = Array.isArray(s.entryPoints) ? s.entryPoints.map((g) => typeof g == "string" ? { in: g, out: "" } : g) : typeof s.entryPoints == "object" ? Object.entries(s.entryPoints).map(([g, h]) => ({ in: h, out: g })) : [], m = await Zr(
1850
1850
  e,
1851
1851
  c,
1852
1852
  s,
@@ -1942,7 +1942,7 @@ ${fi(e._globalCssString, e)}`, d = n?.(c, e) ?? c;
1942
1942
  setup(l) {
1943
1943
  const p = e.options.build?.cdn?.namespace === void 0 ? (
1944
1944
  // eslint-disable-next-line require-unicode-regexp
1945
- new RegExp(`\\/${ne}\\/${Y}\\.css$`)
1945
+ new RegExp(`\\/${oe}\\/${Y}\\.css$`)
1946
1946
  ) : (
1947
1947
  // eslint-disable-next-line require-unicode-regexp
1948
1948
  new RegExp(`\\/${e.options.build.cdn.namespace}\\/${e.options.build.cdn.namespace}\\.css$`)
@@ -1986,7 +1986,7 @@ async function en(e, t, i, s, n) {
1986
1986
  isProcessing: !1,
1987
1987
  isAsync: void 0,
1988
1988
  oldSingleExportName: void 0
1989
- }, f = ce(p.path.slice(r.length));
1989
+ }, f = de(p.path.slice(r.length));
1990
1990
  if (f === Ct) {
1991
1991
  if (n) {
1992
1992
  const h = p.text.match(tn)?.[0];
@@ -2128,10 +2128,10 @@ ${F.code}`
2128
2128
  }
2129
2129
  m = m.slice(0, O) + B + m.slice(O + A);
2130
2130
  }
2131
- const [f, g] = Et(e), h = i.findLastIndex((w) => w.length > 0), v = i.slice(0, h + 1).join(","), y = i.length === 0 ? "_" : `([${v}])`, S = `${ji}${y}=>{`, C = s.join(","), E = `${g}},${C})`;
2132
- let T = e.code.slice(c, f);
2133
- T = `${n.join("")}${T}`, T = Tt(T, t);
2134
- const x = `${m}${S}${T}${E}`;
2131
+ const [f, g] = Et(e), h = i.findLastIndex((w) => w.length > 0), v = i.slice(0, h + 1).join(","), y = i.length === 0 ? "_" : `([${v}])`, S = `${ji}${y}=>{`, C = s.join(","), T = `${g}},${C})`;
2132
+ let E = e.code.slice(c, f);
2133
+ E = `${n.join("")}${E}`, E = Tt(E, t);
2134
+ const x = `${m}${S}${E}${T}`;
2135
2135
  e.code = x;
2136
2136
  }
2137
2137
  const ji = "export default $arcgis.t(";
@@ -2207,7 +2207,7 @@ function pn(e) {
2207
2207
  function Le(e = R(), t = !1) {
2208
2208
  const i = e.version.includes("next"), s = e.name === "@esri/calcite-components";
2209
2209
  if (s && i)
2210
- return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${ne}/`;
2210
+ return `https://cdn.jsdelivr.net/npm/@esri/calcite-components@${e.version}/dist/${oe}/`;
2211
2211
  const n = t || i ? "jsdev.arcgis.com" : "js.arcgis.com", r = mn(e.name), a = un(e.version);
2212
2212
  if (a === void 0)
2213
2213
  throw Error(
@@ -2293,7 +2293,7 @@ async function $t(e, t) {
2293
2293
  } : void 0;
2294
2294
  }
2295
2295
  async function gn(e, t, i, s, n) {
2296
- const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await Oi(t.packageLocation) : void 0, c = a?.cdnName ?? ne, d = a === void 0 ? `${Li}.js` : `${a.cdnName}.esm.js`;
2296
+ const a = t.packageJson.exports?.[`./${Y}.css`] === void 0 ? await Oi(t.packageLocation) : void 0, c = a?.cdnName ?? oe, d = a === void 0 ? `${Li}.js` : `${a.cdnName}.esm.js`;
2297
2297
  if (i === "cdn")
2298
2298
  return {
2299
2299
  tag: "script",
@@ -2330,7 +2330,7 @@ function hn(e) {
2330
2330
  const i = Object.entries(t).filter(([n]) => u.extname(n) === ".css"), s = i.find(([, n]) => n === `./${Y}.css`);
2331
2331
  return s ? s[0] : i.length > 0 ? i[0][0] : `./${Y}.css`;
2332
2332
  }
2333
- async function pe(e) {
2333
+ async function me(e) {
2334
2334
  return e._loadersCache ??= yn(e), await e._loadersCache;
2335
2335
  }
2336
2336
  async function yn(e) {
@@ -2359,7 +2359,7 @@ async function yn(e) {
2359
2359
  javascriptCode: [
2360
2360
  `import { defineCustomElements } from "${c}";`,
2361
2361
  "globalThis.devOnly$ownTagNames = new Set();",
2362
- `defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? ne}/"}` : ""});`
2362
+ `defineCustomElements(${t === "cdn" ? `{resourcesUrl:"./${e.options.build?.cdn?.namespace ?? oe}/"}` : ""});`
2363
2363
  ]
2364
2364
  }
2365
2365
  ];
@@ -2397,7 +2397,7 @@ async function wn(e) {
2397
2397
  !e.apiJsonEnabled
2398
2398
  )
2399
2399
  return Pt(e);
2400
- const i = (await pe(e)).map((s, n) => {
2400
+ const i = (await me(e)).map((s, n) => {
2401
2401
  if ("javascriptCode" in s)
2402
2402
  return s.javascriptCode.join(`
2403
2403
  `);
@@ -2594,9 +2594,9 @@ const Ji = (e, t) => ({
2594
2594
  * the CDN build
2595
2595
  */
2596
2596
  loader: "src/loader.ts"
2597
- }, { loader: S, ...C } = y, E = e.environment === "development" || e.isInTest ? {
2597
+ }, { loader: S, ...C } = y, T = e.environment === "development" || e.isInTest ? {
2598
2598
  "process.env.ESRI_INTERNAL": "true"
2599
- } : void 0, T = !import.meta.url.includes("node_modules"), x = {
2599
+ } : void 0, E = !import.meta.url.includes("node_modules"), x = {
2600
2600
  /**
2601
2601
  * Dependency pre-bundling by default scouts all index.html files to find
2602
2602
  * what dependencies are used. Since Lumina adds imports to index.html
@@ -2640,7 +2640,22 @@ const Ji = (e, t) => ({
2640
2640
  include: [
2641
2641
  // Used by controllers. Need to add manually because @arcgis/lumina is
2642
2642
  // excluded per comment below, so Vite will discover these usages too late.
2643
- ...ue ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : []
2643
+ ...se && !E ? ["@arcgis/core/applications/Components/reactiveUtils.js", "@arcgis/core/core/reactiveUtils.js"] : [],
2644
+ // Used by core. Because we exclude core from scanning, these are discovered late, causing errors
2645
+ ...se && E ? [
2646
+ "tslib",
2647
+ "@arcgis/core > luxon",
2648
+ "@arcgis/core > @esri/arcgis-html-sanitizer",
2649
+ "@esri/calcite-components/dist/components",
2650
+ "@esri/calcite-components/dist/components/**",
2651
+ // Core's production FeatureTable imports these at runtime. Since Core is excluded from dependency
2652
+ // scanning in the monorepo, Vitest would otherwise discover them mid-run and reload all browser tests.
2653
+ "@arcgis/core > marked",
2654
+ "@arcgis/core > @vaadin/grid/vaadin-grid.js",
2655
+ "@arcgis/core > @vaadin/grid/vaadin-grid-column-group.js",
2656
+ "@arcgis/core > @vaadin/grid/vaadin-grid-selection-column.js",
2657
+ "@arcgis/core > @vaadin/grid/vaadin-grid-sorter.js"
2658
+ ] : []
2644
2659
  ],
2645
2660
  /**
2646
2661
  * Workaround for https://github.com/vitejs/vite/issues/18947. Affects all
@@ -2649,8 +2664,9 @@ const Ji = (e, t) => ({
2649
2664
  * inside the package, and by Calcite outside the package).
2650
2665
  */
2651
2666
  exclude: [
2652
- ...T ? [
2667
+ ...E ? [
2653
2668
  "@arcgis/lumina",
2669
+ "@arcgis/core",
2654
2670
  "@arcgis/toolkit",
2655
2671
  "@arcgis/ai-components/loader",
2656
2672
  "@arcgis/ai-playground/loader",
@@ -2661,7 +2677,11 @@ const Ji = (e, t) => ({
2661
2677
  "@arcgis/map-config-components/loader",
2662
2678
  "@arcgis/embeddable-components/loader",
2663
2679
  "@arcgis/map-components/loader",
2664
- "@arcgis/portal-components/loader"
2680
+ "@arcgis/portal-components/loader",
2681
+ // This exact import is also supplied through optimizableImports in `dependencies/arcgisCore.ts`
2682
+ // Optimizing it in the monorepo creates a separate core config instance, so the app does not receive the
2683
+ // configured assetsPath.
2684
+ "@arcgis/core/config.js"
2665
2685
  ] : [],
2666
2686
  // By excluding Lumina above, we also disable discovery of packages
2667
2687
  // used by it (Lit), which are then discovered at runtime and cause
@@ -2713,7 +2733,7 @@ const Ji = (e, t) => ({
2713
2733
  forceRerunTriggers: v === void 0 ? ["**/*.{ts,tsx}"] : void 0
2714
2734
  },
2715
2735
  optimizeDeps: x,
2716
- define: E
2736
+ define: T
2717
2737
  };
2718
2738
  }
2719
2739
  return {
@@ -2757,7 +2777,7 @@ const Ji = (e, t) => ({
2757
2777
  emptyOutDir: l ?? !m
2758
2778
  },
2759
2779
  optimizeDeps: x,
2760
- define: E,
2780
+ define: T,
2761
2781
  test: {
2762
2782
  /*
2763
2783
  * If in browser, run all test files that include *.e2e.* in the name.
@@ -2826,7 +2846,7 @@ const Dn = (e) => `/* ${e} */`, I = (e) => (t, i) => {
2826
2846
  enumerable: !0
2827
2847
  });
2828
2848
  };
2829
- function ae(e) {
2849
+ function le(e) {
2830
2850
  if (u.isAbsolute(e))
2831
2851
  throw Error(
2832
2852
  b(
@@ -2834,9 +2854,9 @@ function ae(e) {
2834
2854
  `Documentation file name was expected to be a relative path (relative to dist). Instead, received an absolute path: ${e}`
2835
2855
  )
2836
2856
  );
2837
- return ce(e);
2857
+ return de(e);
2838
2858
  }
2839
- const le = {
2859
+ const ce = {
2840
2860
  vsCodeHtml: "docs/vscode.html-custom-data.json",
2841
2861
  vsCodeCss: "docs/vscode.css-custom-data.json",
2842
2862
  webTypes: "docs/web-types.json",
@@ -2908,7 +2928,7 @@ const On = `/**
2908
2928
  e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand === "build" && !e.options.build?.cdn?.skip && e.options.build?.webApp?.destination !== void 0, Mn = (e) => ({
2909
2929
  name: be,
2910
2930
  async configureServer(t) {
2911
- ue && (e.server = t, await zr(e));
2931
+ se && (e.server = t, await zr(e));
2912
2932
  },
2913
2933
  configResolved() {
2914
2934
  !e.isInTest && !e.isInStorybook && (e._updateLuminaTsPromise = Jn(e).catch(
@@ -2919,7 +2939,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2919
2939
  // Add imports to index.html before Vite starts resolving imports
2920
2940
  order: "pre",
2921
2941
  async handler(t, i) {
2922
- return _i(e, i) ? (await pe(e)).map(
2942
+ return _i(e, i) ? (await me(e)).map(
2923
2943
  (n) => "javascriptCode" in n ? {
2924
2944
  tag: "script",
2925
2945
  attrs: {
@@ -2946,7 +2966,7 @@ e.isInStorybook && (t === void 0 || t.path === "/iframe.html") || e.viteCommand
2946
2966
  async buildStart() {
2947
2967
  if (e.viteCommand !== "serve")
2948
2968
  return;
2949
- const i = (await pe(e)).flatMap((s) => {
2969
+ const i = (await me(e)).flatMap((s) => {
2950
2970
  if ("javascriptCode" in s)
2951
2971
  return s.optimizableImports;
2952
2972
  if ("cssHref" in s)
@@ -2981,7 +3001,7 @@ If build failed with TypeScript errors, try running the build again to check whe
2981
3001
  );
2982
3002
  async function Kn(e) {
2983
3003
  const t = e.options.apiExtractor?.configFilePath === "" ? void 0 : await Ds(process.cwd()), i = e.apiExtractorPluginConfig.unsafeConfigOverride === void 0 || t === void 0 ? t ?? e.apiExtractorPluginConfig.unsafeConfigOverride : vt(t, e.apiExtractorPluginConfig.unsafeConfigOverride);
2984
- e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? ae(e.options.documentation.apiJsonFileName) : le.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
3004
+ e._documentationFileNames.apiJson = i?.context?.apiJsonEmitPath === void 0 ? e.options.documentation?.apiJsonFileName === !1 ? void 0 : e.options.documentation?.apiJsonFileName ? le(e.options.documentation.apiJsonFileName) : ce.apiJson : i.context.apiJsonEmitPath || void 0, e._documentationFileNames.apiJson !== void 0 && e.provideAssets([
2985
3005
  {
2986
3006
  type: "dynamic",
2987
3007
  source: () => JSON.stringify(e.apiJson, null, Qe(e)),
@@ -3113,7 +3133,7 @@ class P {
3113
3133
  this.viteConfig = r;
3114
3134
  const a = r.build.minify !== !1;
3115
3135
  this.shouldMinify = a && this.viteCommand !== "serve", Object.hasOwn(this, "shouldMinifyJsx") || (this.shouldMinifyJsx = this.viteCommand !== "serve" || this.isInTest);
3116
- const c = u.join(r.root, u.sep), d = u.join(c, "src", u.sep), l = u.join(d, "components", u.sep), p = u.join(u.resolve(c, r.build.outDir), u.sep), m = u.join(u.relative(c, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? ne, u.sep), h = u.join(g, "assets", u.sep);
3136
+ const c = u.join(r.root, u.sep), d = u.join(c, "src", u.sep), l = u.join(d, "components", u.sep), p = u.join(u.resolve(c, r.build.outDir), u.sep), m = u.join(u.relative(c, p), u.sep), f = u.join(p, "components", u.sep), g = u.join(p, this.options.build?.cdn?.namespace ?? oe, u.sep), h = u.join(g, "assets", u.sep);
3117
3137
  if (this.dir = {
3118
3138
  root: c,
3119
3139
  src: d,
@@ -3141,12 +3161,12 @@ class P {
3141
3161
  this.apiJsonEnabled = !v && !this.isInPuppeteerTestBackEnd && !y && !S, this.apiJsonEnabled ? (this.apiExtractorPluginConfig.serve = {
3142
3162
  extract: !0
3143
3163
  }, (this.viteCommand === "build" ? r.build.watch : r.server.watch) === null && (this.apiJsonDeferred = Promise.withResolvers())) : (this._localDefinedComponents = {}, this.options.build ??= {}, this.options.build.dependencies ??= {}, this.apiExtractorPluginConfig.serve = void 0, this.options.build.dependencies.silenceUnknownJsxElementUsage = () => !0);
3144
- const C = this.viteCommand === "serve" && !this.isInStorybook, E = this.apiExtractorPluginConfig.unsafeConfigOverride;
3145
- C && (E.context.isLuminaMinimalExtraction = !0, E.types.typeCheckedExtraction = !1, E.types.fullTypeCheck = !1), this.isInStorybook && (E.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
3164
+ const C = this.viteCommand === "serve" && !this.isInStorybook, T = this.apiExtractorPluginConfig.unsafeConfigOverride;
3165
+ C && (T.context.isLuminaMinimalExtraction = !0, T.types.typeCheckedExtraction = !1, T.types.fullTypeCheck = !1), this.isInStorybook && (T.context.dtsEmitPath = ""), this._typeScriptPrinter = Fs({
3146
3166
  // Do not downlevel. ESBuild will do that if needed.
3147
3167
  target: o.ScriptTarget.ESNext,
3148
3168
  sourceMap: r.build.sourcemap !== !1
3149
- }), _i(this) && pe(this);
3169
+ }), _i(this) && me(this);
3150
3170
  }
3151
3171
  },
3152
3172
  configureServer: {
@@ -3170,10 +3190,10 @@ class P {
3170
3190
  this._documentationFileNames = {
3171
3191
  // Will be set once api-extractor.config.ts is loaded
3172
3192
  apiJson: void 0,
3173
- stencilLikeDocsJson: i.stencilLikeDocsJsonFileName === !1 ? void 0 : i.stencilLikeDocsJsonFileName ? ae(i.stencilLikeDocsJsonFileName) : le.stencilLikeDocsJson,
3174
- webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? ae(i.jetBrains.webTypesFileName) : le.webTypes,
3175
- vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? ae(i.vsCode.htmlFileName) : le.vsCodeHtml,
3176
- vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? ae(i.vsCode.cssFileName) : le.vsCodeCss
3193
+ stencilLikeDocsJson: i.stencilLikeDocsJsonFileName === !1 ? void 0 : i.stencilLikeDocsJsonFileName ? le(i.stencilLikeDocsJsonFileName) : ce.stencilLikeDocsJson,
3194
+ webTypes: i.jetBrains === !1 ? void 0 : i.jetBrains?.webTypesFileName ? le(i.jetBrains.webTypesFileName) : ce.webTypes,
3195
+ vsCodeHtml: i.vsCode === !1 ? void 0 : i.vsCode?.htmlFileName ? le(i.vsCode.htmlFileName) : ce.vsCodeHtml,
3196
+ vsCodeCss: i.vsCode === !1 ? void 0 : i.vsCode?.cssFileName ? le(i.vsCode.cssFileName) : ce.vsCodeCss
3177
3197
  }, this.apiExtractorPluginConfig = this.options.apiExtractor ?? {}, this.configsPromise = Kn(this);
3178
3198
  const s = process.cwd().length + 1;
3179
3199
  this.componentFilesPromise = this.configsPromise.then(() => {
@@ -3393,7 +3413,7 @@ const Dt = "makeRuntime(", zn = "@arcgis/core", Hn = "@arcgis/lumina:injectRunti
3393
3413
  t.slice(n),
3394
3414
  // Dependency injection. Lumina cannot directly import these to avoid
3395
3415
  // a cyclical dependency.
3396
- ue ? `
3416
+ se ? `
3397
3417
  import {createObservable,trackAccess,createTrackingTarget,runTracked} from "${zn}/applications/Components/reactiveUtils.js";
3398
3418
  createObservable,
3399
3419
  runtime.t = trackAccess;
@@ -3407,7 +3427,7 @@ runtime.r = runTracked;` : ""
3407
3427
  }
3408
3428
  });
3409
3429
  function Vn(e) {
3410
- return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${ne}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3430
+ return `import "../${e.options.build?.cdn?.namespace === void 0 ? `${oe}/${Y}.css` : `${e.options.build.cdn.namespace}/${e.options.build.cdn.namespace}.css`}";
3411
3431
  `;
3412
3432
  }
3413
3433
  const ve = "@arcgis/lumina:addNonLazyImports", Gn = (e) => ({
@@ -3458,32 +3478,32 @@ Possible causes:
3458
3478
  if (!s.has(r))
3459
3479
  return [];
3460
3480
  const d = u.dirname(r), l = e.dir.src + We(d.slice(e.dir.src.length), e.apiExtractor), p = u.relative(e.dir.src, l);
3461
- function m(T) {
3462
- const x = Un(e, T, r);
3481
+ function m(E) {
3482
+ const x = Un(e, E, r);
3463
3483
  if (x === void 0)
3464
3484
  return;
3465
3485
  const w = Wn(x, p);
3466
3486
  if (w !== `./${p}`)
3467
3487
  return w.startsWith(".") ? `${w}/${Rt}` : w;
3468
3488
  }
3469
- const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(j), v = (T) => `import "${T}";
3470
- `, y = h.map(v).join(""), S = Array.from(g, (T) => {
3471
- const x = m(T);
3489
+ const f = new Set(a), g = new Set(c), h = Array.from(f, m).filter(j), v = (E) => `import "${E}";
3490
+ `, y = h.map(v).join(""), S = Array.from(g, (E) => {
3491
+ const x = m(E);
3472
3492
  if (x !== void 0) {
3473
- if (f.has(T)) {
3493
+ if (f.has(E)) {
3474
3494
  $.warn(
3475
3495
  ve,
3476
- `"${T}" 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.`
3496
+ `"${E}" 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.`
3477
3497
  );
3478
3498
  return;
3479
3499
  }
3480
- return `.set("${T}", () => import("${x}"))
3500
+ return `.set("${E}", () => import("${x}"))
3481
3501
  `;
3482
3502
  }
3483
- }).filter(j), C = `${y}export * from "./${at}";`, E = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3503
+ }).filter(j), C = `${y}export * from "./${at}";`, T = S.length > 0 ? `import { deferredLoaders } from "@arcgis/lumina";
3484
3504
  ${C}
3485
3505
  deferredLoaders${S.join("")};` : C;
3486
- return await _(u.join(e.dir.dist, p, Rt), E);
3506
+ return await _(u.join(e.dir.dist, p, Rt), T);
3487
3507
  });
3488
3508
  await Promise.all(n);
3489
3509
  }
@@ -3710,7 +3730,7 @@ function _e(e) {
3710
3730
  }
3711
3731
  }
3712
3732
  function we(e, t, i = !1) {
3713
- if (de(t))
3733
+ if (pe(t))
3714
3734
  throw new Error(
3715
3735
  `Invalid JSX syntax detected or there is a bug in Lumina. Found ${t.getText(e.sourceFile)}. Expected JSX attribute value to be wrapped in { }`
3716
3736
  );
@@ -3814,7 +3834,7 @@ function Ne({ key: e, parts: t, litTag: i }, s) {
3814
3834
  typeof a[0] == "string" ? o.factory.createStringLiteral(r) : a[0]
3815
3835
  );
3816
3836
  }
3817
- const c = typeof i == "string" ? i : re;
3837
+ const c = typeof i == "string" ? i : ne;
3818
3838
  s.neededImports.add(c);
3819
3839
  const d = s.importRenames[c], l = o.factory.createTaggedTemplateExpression(
3820
3840
  o.factory.createIdentifier(d),
@@ -3912,7 +3932,7 @@ function mo(e, t) {
3912
3932
  if (!(typeof r == "object" && // If .map() callback has 3rd argument, it's not supported
3913
3933
  s.parameters.length <= 2))
3914
3934
  return t;
3915
- const c = me(s.body);
3935
+ const c = ue(s.body);
3916
3936
  let d = !0, l;
3917
3937
  if (Kt(c))
3918
3938
  l = c;
@@ -3922,13 +3942,13 @@ function mo(e, t) {
3922
3942
  const y = c.statements.at(-1);
3923
3943
  if (!(y && o.isReturnStatement(y) && y.expression))
3924
3944
  return t;
3925
- const C = me(y.expression);
3945
+ const C = ue(y.expression);
3926
3946
  if (!Kt(C))
3927
3947
  return t;
3928
- const E = c.statements.slice(0, -1);
3929
- if (E.some(Vi))
3948
+ const T = c.statements.slice(0, -1);
3949
+ if (T.some(Vi))
3930
3950
  return t;
3931
- d = E.length === 0, l = C;
3951
+ d = T.length === 0, l = C;
3932
3952
  }
3933
3953
  const p = o.isJsxElement(l) ? l.openingElement : l, m = Zi(p);
3934
3954
  if (m === -1)
@@ -4027,7 +4047,7 @@ function J(e) {
4027
4047
  if (fo.has(e.kind))
4028
4048
  return [];
4029
4049
  {
4030
- const t = me(e);
4050
+ const t = ue(e);
4031
4051
  return t !== e ? J(t) : void 0;
4032
4052
  }
4033
4053
  }
@@ -4041,7 +4061,7 @@ const fo = /* @__PURE__ */ new Set([
4041
4061
  o.SyntaxKind.FalseKeyword,
4042
4062
  o.SyntaxKind.NullKeyword,
4043
4063
  o.SyntaxKind.TrueKeyword
4044
- ]), me = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? me(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? vo(e, t) : e;
4064
+ ]), ue = (e) => o.isAsExpression(e) || o.isNonNullExpression(e) || o.isSatisfiesExpression(e) || o.isParenthesizedExpression(e) ? ue(e.expression) : e, Gi = (e, t) => o.isObjectBindingPattern(e) ? vo(e, t) : e;
4045
4065
  function go(e, t, i) {
4046
4066
  if (e.every(xe, t))
4047
4067
  return t;
@@ -4075,7 +4095,7 @@ function vo(e, t) {
4075
4095
  }
4076
4096
  const Xi = (e, t) => t.liftedKeys.has(e);
4077
4097
  function H(e, t, i) {
4078
- if (de(i))
4098
+ if (pe(i))
4079
4099
  return Yi(e, i);
4080
4100
  const s = o.isCallExpression(i) ? mo(e, i) : i, n = o.visitEachChild(
4081
4101
  s,
@@ -4083,7 +4103,7 @@ function H(e, t, i) {
4083
4103
  H.bind(null, e, t !== void 0 && o.isBinaryExpression(t) ? void 0 : i),
4084
4104
  e.transformationContext
4085
4105
  );
4086
- return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || de(me(i.right)) || ir(i.right)) ? So(n) : n;
4106
+ return t !== void 0 && o.isBinaryExpression(i) && (o.isJsxExpression(t) || pe(ue(i.right)) || ir(i.right)) ? So(n) : n;
4087
4107
  }
4088
4108
  function Yi(e, t) {
4089
4109
  const i = Qi(e, t);
@@ -4107,7 +4127,7 @@ function Qi(e, t) {
4107
4127
  ...w
4108
4128
  };
4109
4129
  }
4110
- const c = r.text === Re ? Ee : r.text === Oe ? He : r.text, d = r.text === Re ? se : r.text === Oe ? G : _s.has(c) ? ai : it.has(c) ? ee : re, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
4130
+ const c = r.text === Re ? Ee : r.text === Oe ? He : r.text, d = r.text === Re ? re : r.text === Oe ? G : _s.has(c) ? ai : it.has(c) ? ee : ne, l = rt(c), p = l ? e.localComponents[c]?.requiredProperties : void 0, m = p === void 0 ? void 0 : new Set(p);
4111
4131
  let f;
4112
4132
  const g = [];
4113
4133
  let h = !1;
@@ -4147,13 +4167,13 @@ Found ${x.getText(e.sourceFile)}`
4147
4167
  throw Error(
4148
4168
  `Void HTML elements like <${c}> cannot have children. Found ${t.getText(e.sourceFile)}`
4149
4169
  );
4150
- const C = (d === ee || d === G) && S.parts.length === 0, E = [
4170
+ const C = (d === ee || d === G) && S.parts.length === 0, T = [
4151
4171
  "<",
4152
4172
  typeof c == "string" ? c : r,
4153
4173
  ...v,
4154
4174
  C ? `${v.length === 0 ? "" : " "}/>` : ">"
4155
- ], T = y || C ? E : [
4156
- ...E,
4175
+ ], E = y || C ? T : [
4176
+ ...T,
4157
4177
  /**
4158
4178
  * If parent was an HTML element (e.g. `<svg>`), but children are SVG
4159
4179
  * fragments (e.g. `<circle />`, then wrap the children in their own
@@ -4164,7 +4184,7 @@ Found ${x.getText(e.sourceFile)}`
4164
4184
  typeof c == "string" ? c : r,
4165
4185
  ">"
4166
4186
  ];
4167
- return { key: f, parts: T, litTag: d };
4187
+ return { key: f, parts: E, litTag: d };
4168
4188
  }
4169
4189
  function bo(e, t) {
4170
4190
  const i = e.attributes.properties[Zi(e)];
@@ -4180,7 +4200,7 @@ function wo(e, t, i, s) {
4180
4200
  throw Error(`JSX namespaced attributes are not supported. Found ${l.getText(e.sourceFile)}`);
4181
4201
  if (l.text === "key")
4182
4202
  return;
4183
- const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : de(p) ? Yi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Zt(l.text) ? o.factory.createStringLiteral(l.text) : l;
4203
+ const m = p === void 0 ? o.factory.createTrue() : o.isStringLiteral(p) ? p : pe(p) ? Yi(e, p) : H(e, void 0, p.expression ?? o.factory.createIdentifier("undefined")), f = Zt(l.text) ? o.factory.createStringLiteral(l.text) : l;
4184
4204
  return o.factory.createPropertyAssignment(f, m);
4185
4205
  }), { parts: a, litTag: c } = Se(s, e);
4186
4206
  return a.length > 0 && r.push(
@@ -4201,7 +4221,7 @@ function Se(e, t) {
4201
4221
  return pt(t, n, n);
4202
4222
  {
4203
4223
  const r = Qi(t, n);
4204
- if (r.key === void 0 && r.litTag !== se && r.litTag !== G) {
4224
+ if (r.key === void 0 && r.litTag !== re && r.litTag !== G) {
4205
4225
  if (r.litTag === ai)
4206
4226
  return r.parts;
4207
4227
  if (i !== void 0 && r.litTag !== void 0 && i !== r.litTag)
@@ -4353,7 +4373,7 @@ function Co(e, t) {
4353
4373
  }
4354
4374
  return t;
4355
4375
  }
4356
- const ss = (e, t) => e === re && te.staticHtml.includes(t) ? se : e === ee && te.staticSvg.includes(t) ? G : e, Eo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4376
+ const ss = (e, t) => e === ne && te.staticHtml.includes(t) ? re : e === ee && te.staticSvg.includes(t) ? G : e, Eo = (e, t, i) => t.startsWith(".") ? u.resolve(e, "..", `${t}${i}`) : t;
4357
4377
  function To(e) {
4358
4378
  return o.isImportDeclaration(e) ? $o(this, e) : e;
4359
4379
  }
@@ -4401,7 +4421,7 @@ function Po(e) {
4401
4421
  );
4402
4422
  }
4403
4423
  function rs(e, t) {
4404
- const i = e === se ? re : e === G ? ee : e, s = t.importRenames[e];
4424
+ const i = e === re ? ne : e === G ? ee : e, s = t.importRenames[e];
4405
4425
  return s === i ? o.factory.createImportSpecifier(!1, void 0, o.factory.createIdentifier(i)) : o.factory.createImportSpecifier(
4406
4426
  !1,
4407
4427
  o.factory.createIdentifier(i),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arcgis/lumina-compiler",
3
- "version": "5.2.0-next.79",
3
+ "version": "5.2.0-next.84",
4
4
  "description": "Compiler for WebGIS web components",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -30,9 +30,9 @@
30
30
  "mime-types": "^3.0.1",
31
31
  "tinyglobby": "~0.2.17",
32
32
  "tslib": "^2.8.1",
33
- "@arcgis/api-extractor": "5.2.0-next.79",
34
- "@arcgis/toolkit": "~5.2.0-next.79",
35
- "@arcgis/node-toolkit": "5.2.0-next.79"
33
+ "@arcgis/api-extractor": "5.2.0-next.84",
34
+ "@arcgis/node-toolkit": "5.2.0-next.84",
35
+ "@arcgis/toolkit": "~5.2.0-next.84"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "lit": "^3.3.0",
@@ -40,7 +40,7 @@
40
40
  "typescript": "~6.0.3",
41
41
  "vite": "^7.3.2",
42
42
  "vitest": "^4.1.10",
43
- "@arcgis/lumina": "~5.2.0-next.79"
43
+ "@arcgis/lumina": "~5.2.0-next.84"
44
44
  },
45
45
  "peerDependenciesMeta": {
46
46
  "puppeteer": {