@diagrammo/dgmo 0.62.0 → 0.62.1

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 (47) hide show
  1. package/dist/advanced.js +22 -22
  2. package/dist/auto.js +99 -99
  3. package/dist/block.js +6 -6
  4. package/dist/{charts-d3-3WMDA5Z5.js → charts-d3-M76E4TZU.js} +4 -4
  5. package/dist/{chunk-4C3BTTOL.js → chunk-2LN5C6FH.js} +2 -2
  6. package/dist/{chunk-FXLGBUIQ.js → chunk-34HQALZ5.js} +2 -2
  7. package/dist/{chunk-XJZCXNWR.js → chunk-BGITRLTR.js} +2 -2
  8. package/dist/{chunk-3OLO2MZ6.js → chunk-BPINSP65.js} +2 -2
  9. package/dist/{chunk-DZZWR6GT.js → chunk-DUHKYKI7.js} +2 -2
  10. package/dist/{chunk-536EBUPG.js → chunk-EOYPX6SF.js} +11 -3
  11. package/dist/{chunk-7FTGNJQ2.js → chunk-GCVTU64J.js} +17 -5
  12. package/dist/{chunk-CQ7Y3O67.js → chunk-KHTKMVKT.js} +2 -2
  13. package/dist/{chunk-7BJQUII6.js → chunk-KK5LQIN7.js} +2 -2
  14. package/dist/{chunk-L43KTQTW.js → chunk-L26ZAPNJ.js} +2 -2
  15. package/dist/{chunk-LRKGF7RN.js → chunk-L4B4GRVS.js} +2 -2
  16. package/dist/{chunk-7QCYHZVO.js → chunk-NQH2Q2RR.js} +2 -2
  17. package/dist/{chunk-PFGJ7SCM.js → chunk-PUFWYDWP.js} +2 -2
  18. package/dist/{chunk-DHIBVN2D.js → chunk-QDPMTFB4.js} +29 -27
  19. package/dist/chunk-RU2HHHYA.js +23 -0
  20. package/dist/{chunk-SMHTYVMK.js → chunk-RZRMSNO7.js} +2 -2
  21. package/dist/{chunk-HJ6TMHQG.js → chunk-SV7F363F.js} +2 -2
  22. package/dist/{chunk-YJCILMEA.js → chunk-U22TKD3L.js} +2 -2
  23. package/dist/{chunk-PJDX4IKR.js → chunk-WMHHNK44.js} +2 -2
  24. package/dist/{chunk-4BEAHH6G.js → chunk-XXDEQSW4.js} +2 -2
  25. package/dist/{chunk-NEV5IW33.js → chunk-YVI3JL3S.js} +2 -2
  26. package/dist/element.js +100 -100
  27. package/dist/{flowchart-renderer-XFDCX7MZ.js → flowchart-renderer-BCVCIZHF.js} +3 -3
  28. package/dist/index.js +6 -6
  29. package/dist/{renderer-CXRSD26Q.js → renderer-4VDSMPYU.js} +4 -4
  30. package/dist/{renderer-62FFDWMY.js → renderer-5HYDLCMX.js} +3 -3
  31. package/dist/{renderer-XSHOMUJQ.js → renderer-726UVOKE.js} +3 -3
  32. package/dist/{renderer-VYMTBSF4.js → renderer-HPQJRSON.js} +3 -3
  33. package/dist/{renderer-GESKWINV.js → renderer-K3TH5PP7.js} +4 -4
  34. package/dist/{renderer-4RQ5PGHY.js → renderer-KHVAM4IY.js} +3 -3
  35. package/dist/{renderer-2PGIIOFN.js → renderer-KKNXTTFE.js} +5 -5
  36. package/dist/{renderer-IG5PQXEM.js → renderer-PKST5W6U.js} +4 -4
  37. package/dist/{renderer-6QW5OAJG.js → renderer-TTMBG2N6.js} +2 -2
  38. package/dist/{renderer-AS6LLDZM.js → renderer-XDL6PRLN.js} +3 -3
  39. package/dist/{renderer-63MLWS6L.js → renderer-XIJO7DYS.js} +3 -3
  40. package/dist/{resolver-ZLYSMILY.js → resolver-B3TXWNWF.js} +3 -3
  41. package/dist/{state-renderer-GBHDOEXR.js → state-renderer-MCWCZ76U.js} +3 -3
  42. package/fonts/Inter-Bold.ttf +0 -0
  43. package/fonts/Inter-Bold.woff2 +0 -0
  44. package/fonts/Inter-Regular.ttf +0 -0
  45. package/fonts/Inter-Regular.woff2 +0 -0
  46. package/package.json +7 -3
  47. package/dist/chunk-NZ5QVASG.js +0 -20
package/dist/block.js CHANGED
@@ -4,20 +4,20 @@ import {
4
4
  } from "./chunk-D3K4U3ZM.js";
5
5
  import {
6
6
  render
7
- } from "./chunk-DHIBVN2D.js";
7
+ } from "./chunk-QDPMTFB4.js";
8
8
  import {
9
9
  docsLink,
10
10
  renderErrorCard
11
11
  } from "./chunk-LFAQ4BLZ.js";
12
- import "./chunk-536EBUPG.js";
13
- import "./chunk-4C3BTTOL.js";
12
+ import "./chunk-EOYPX6SF.js";
13
+ import "./chunk-2LN5C6FH.js";
14
14
  import "./chunk-CVVICCSB.js";
15
- import "./chunk-3OLO2MZ6.js";
15
+ import "./chunk-BPINSP65.js";
16
16
  import "./chunk-YRYKTYMQ.js";
17
17
  import "./chunk-YYVTBZZC.js";
18
- import "./chunk-CQ7Y3O67.js";
18
+ import "./chunk-KHTKMVKT.js";
19
19
  import "./chunk-6VJCURWU.js";
20
- import "./chunk-NZ5QVASG.js";
20
+ import "./chunk-RU2HHHYA.js";
21
21
  import "./chunk-A4GOY3PE.js";
22
22
  import "./chunk-UKZ7K5GS.js";
23
23
  import "./chunk-ES66QH6J.js";
@@ -2,11 +2,11 @@ import {
2
2
  D3_DATA_CHART_TYPES,
3
3
  renderDataChartD3,
4
4
  supportsD3DataChart
5
- } from "./chunk-4C3BTTOL.js";
5
+ } from "./chunk-2LN5C6FH.js";
6
6
  import "./chunk-CVVICCSB.js";
7
- import "./chunk-CQ7Y3O67.js";
7
+ import "./chunk-KHTKMVKT.js";
8
8
  import "./chunk-6VJCURWU.js";
9
- import "./chunk-NZ5QVASG.js";
9
+ import "./chunk-RU2HHHYA.js";
10
10
  import "./chunk-A4GOY3PE.js";
11
11
  import "./chunk-ES66QH6J.js";
12
12
  import "./chunk-6KFWC4CO.js";
@@ -26,4 +26,4 @@ export {
26
26
  renderDataChartD3,
27
27
  supportsD3DataChart
28
28
  };
29
- //# sourceMappingURL=charts-d3-3WMDA5Z5.js.map
29
+ //# sourceMappingURL=charts-d3-M76E4TZU.js.map
@@ -11,7 +11,7 @@ import {
11
11
  initD3Chart,
12
12
  renderChartTitle,
13
13
  resolveExportPalette
14
- } from "./chunk-CQ7Y3O67.js";
14
+ } from "./chunk-KHTKMVKT.js";
15
15
  import {
16
16
  layoutInlineHeader
17
17
  } from "./chunk-6VJCURWU.js";
@@ -2061,4 +2061,4 @@ export {
2061
2061
  supportsD3DataChart,
2062
2062
  renderDataChartD3
2063
2063
  };
2064
- //# sourceMappingURL=chunk-4C3BTTOL.js.map
2064
+ //# sourceMappingURL=chunk-2LN5C6FH.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-YYVTBZZC.js";
10
10
  import {
11
11
  serializeSvg
12
- } from "./chunk-NZ5QVASG.js";
12
+ } from "./chunk-RU2HHHYA.js";
13
13
  import {
14
14
  TITLE_FONT_SIZE,
15
15
  TITLE_FONT_WEIGHT
@@ -896,4 +896,4 @@ export {
896
896
  renderKanban,
897
897
  renderKanbanForExport
898
898
  };
899
- //# sourceMappingURL=chunk-FXLGBUIQ.js.map
899
+ //# sourceMappingURL=chunk-34HQALZ5.js.map
@@ -24,7 +24,7 @@ import {
24
24
  } from "./chunk-YYVTBZZC.js";
25
25
  import {
26
26
  serializeSvg
27
- } from "./chunk-NZ5QVASG.js";
27
+ } from "./chunk-RU2HHHYA.js";
28
28
  import {
29
29
  TITLE_FONT_SIZE,
30
30
  TITLE_FONT_WEIGHT,
@@ -585,4 +585,4 @@ export {
585
585
  renderFlowchart,
586
586
  renderFlowchartForExport
587
587
  };
588
- //# sourceMappingURL=chunk-XJZCXNWR.js.map
588
+ //# sourceMappingURL=chunk-BGITRLTR.js.map
@@ -10,7 +10,7 @@ import {
10
10
  hideTooltip,
11
11
  renderChartTitle,
12
12
  showTooltip
13
- } from "./chunk-CQ7Y3O67.js";
13
+ } from "./chunk-KHTKMVKT.js";
14
14
  import {
15
15
  renderIntegratedLegend
16
16
  } from "./chunk-UKZ7K5GS.js";
@@ -1670,4 +1670,4 @@ export {
1670
1670
  formatDateLabel,
1671
1671
  renderTimeline
1672
1672
  };
1673
- //# sourceMappingURL=chunk-3OLO2MZ6.js.map
1673
+ //# sourceMappingURL=chunk-BPINSP65.js.map
@@ -5,7 +5,7 @@ import {
5
5
  import {
6
6
  extractExportSvg,
7
7
  runInExportContainer
8
- } from "./chunk-L43KTQTW.js";
8
+ } from "./chunk-L26ZAPNJ.js";
9
9
  import {
10
10
  renderInlineText
11
11
  } from "./chunk-WGC42WJU.js";
@@ -426,4 +426,4 @@ export {
426
426
  renderMindmap,
427
427
  renderMindmapForExport
428
428
  };
429
- //# sourceMappingURL=chunk-DZZWR6GT.js.map
429
+ //# sourceMappingURL=chunk-DUHKYKI7.js.map
@@ -158,12 +158,20 @@ var MAP_DX = {
158
158
  // network access of its own, so a host must supply the assets: bundled
159
159
  // `MapData` (Obsidian, the web app) or the Node `loadMapData` loader from
160
160
  // the `/advanced` subpath (CLI, SSR).
161
+ //
162
+ // 🔴 Two different failures land here and they need different sentences.
163
+ // No `reason` means the host passed nothing — a wiring mistake in the
164
+ // embedding code, and the diagram is fine. A `reason` means the host DID
165
+ // pass a loader and the loader threw: the wiring is right and the install
166
+ // is broken, which is what happened when `@diagrammo/dgmo-cli` 0.62.0
167
+ // shipped without its map data (#121). Telling someone to "pass `mapData`"
168
+ // when they already did sends them to the wrong file.
161
169
  code: "E_MAP_DATA_NOT_SUPPLIED",
162
170
  severity: "error",
163
171
  chartType: "map",
164
172
  title: "No map data supplied",
165
- message: "This map has no basemap data. `render()` reads nothing from disk or the network on its own \u2014 pass `mapData`, either the bundled assets or a loader that returns them.",
166
- hint: "In Node: `render(src, { mapData: loadMapData })` with `loadMapData` from `@diagrammo/dgmo/advanced`. In a browser or Worker: pass your bundled `MapData`.",
173
+ message: (p) => p.reason ? `This map's basemap data could not be loaded, so nothing was drawn. The loader reported: ${p.reason}` : "This map has no basemap data. `render()` reads nothing from disk or the network on its own \u2014 pass `mapData`, either the bundled assets or a loader that returns them.",
174
+ hint: "In Node: `render(src, { mapData: loadMapData })` with `loadMapData` from `@diagrammo/dgmo/advanced`. In a browser or Worker: pass your bundled `MapData`. If you already do, the assets are missing from the installed package rather than from your code.",
167
175
  example: "map\nDenver heat: 2"
168
176
  }
169
177
  };
@@ -173,4 +181,4 @@ export {
173
181
  MAP_DX,
174
182
  MAP_DIAGNOSTICS
175
183
  };
176
- //# sourceMappingURL=chunk-536EBUPG.js.map
184
+ //# sourceMappingURL=chunk-EOYPX6SF.js.map
@@ -58,9 +58,13 @@ function renderFigureBody(fig, view, parts, partColor, emphKey, form, palette, i
58
58
  const seam = palette.bg;
59
59
  const outlineStroke = palette.textMuted;
60
60
  const gid = `body-skin-${vx}-${vy}`;
61
- defs.push(
62
- `<linearGradient id="${gid}" x1="0" y1="0" x2="0" y2="1"><stop offset="0" stop-color="${mix(palette.surface, palette.bg, 0.4)}"/><stop offset="1" stop-color="${mix(palette.border, palette.bg, 0.3)}"/></linearGradient>`
63
- );
61
+ defs.push({
62
+ id: gid,
63
+ stops: [
64
+ { offset: "0", color: mix(palette.surface, palette.bg, 0.4) },
65
+ { offset: "1", color: mix(palette.border, palette.bg, 0.3) }
66
+ ]
67
+ });
64
68
  let out = "";
65
69
  if (form === "skin") {
66
70
  out += `<path d="${fig.outline}" fill="url(#${gid})"/>`;
@@ -292,7 +296,15 @@ function renderBody(container, parsed, palette, _isDark, _onClickItem, exportDim
292
296
  "viewBox",
293
297
  `${-PAGE_MARGIN} ${-PAGE_MARGIN} ${(totalW + 2 * PAGE_MARGIN).toFixed(0)} ${(totalH + 2 * PAGE_MARGIN).toFixed(0)}`
294
298
  ).attr("preserveAspectRatio", "xMidYMin meet").attr("xmlns", "http://www.w3.org/2000/svg").style("font-family", FONT_FAMILY);
295
- if (defs.length) svg.append("defs").html(defs.join(""));
299
+ if (defs.length) {
300
+ const defsSel = svg.append("defs");
301
+ for (const def of defs) {
302
+ const grad = defsSel.append("linearGradient").attr("id", def.id).attr("x1", "0").attr("y1", "0").attr("x2", "0").attr("y2", "1");
303
+ for (const stop of def.stops) {
304
+ grad.append("stop").attr("offset", stop.offset).attr("stop-color", stop.color);
305
+ }
306
+ }
307
+ }
296
308
  svg.append("g").html(body);
297
309
  if (parsed.title && !parsed.options.noTitle) {
298
310
  svg.append("text").attr("x", totalW / 2).attr("y", 40).attr("text-anchor", "middle").attr("font-size", 34).attr("font-weight", 700).attr("fill", palette.text).text(parsed.title);
@@ -334,4 +346,4 @@ export {
334
346
  renderBody,
335
347
  renderBodyForExport
336
348
  };
337
- //# sourceMappingURL=chunk-7FTGNJQ2.js.map
349
+ //# sourceMappingURL=chunk-GCVTU64J.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serializeSvg
3
- } from "./chunk-NZ5QVASG.js";
3
+ } from "./chunk-RU2HHHYA.js";
4
4
  import {
5
5
  TITLE_FONT_SIZE,
6
6
  TITLE_FONT_WEIGHT,
@@ -130,4 +130,4 @@ export {
130
130
  createExportContainer,
131
131
  finalizeSvgExport
132
132
  };
133
- //# sourceMappingURL=chunk-CQ7Y3O67.js.map
133
+ //# sourceMappingURL=chunk-KHTKMVKT.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  extractExportSvg,
3
3
  runInExportContainer
4
- } from "./chunk-L43KTQTW.js";
4
+ } from "./chunk-L26ZAPNJ.js";
5
5
  import {
6
6
  layoutOrg
7
7
  } from "./chunk-RKTIIU7Z.js";
@@ -485,4 +485,4 @@ export {
485
485
  renderOrg,
486
486
  renderOrgForExport
487
487
  };
488
- //# sourceMappingURL=chunk-7BJQUII6.js.map
488
+ //# sourceMappingURL=chunk-KK5LQIN7.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  serializeSvg
3
- } from "./chunk-NZ5QVASG.js";
3
+ } from "./chunk-RU2HHHYA.js";
4
4
  import {
5
5
  FONT_FAMILY
6
6
  } from "./chunk-6KFWC4CO.js";
@@ -37,4 +37,4 @@ export {
37
37
  runInExportContainer,
38
38
  extractExportSvg
39
39
  };
40
- //# sourceMappingURL=chunk-L43KTQTW.js.map
40
+ //# sourceMappingURL=chunk-L26ZAPNJ.js.map
@@ -28,7 +28,7 @@ import {
28
28
  } from "./chunk-6VJCURWU.js";
29
29
  import {
30
30
  serializeSvg
31
- } from "./chunk-NZ5QVASG.js";
31
+ } from "./chunk-RU2HHHYA.js";
32
32
  import {
33
33
  TITLE_FONT_SIZE,
34
34
  TITLE_FONT_WEIGHT
@@ -500,4 +500,4 @@ export {
500
500
  renderSitemap,
501
501
  renderSitemapForExport
502
502
  };
503
- //# sourceMappingURL=chunk-LRKGF7RN.js.map
503
+ //# sourceMappingURL=chunk-L4B4GRVS.js.map
@@ -27,7 +27,7 @@ import {
27
27
  } from "./chunk-6VJCURWU.js";
28
28
  import {
29
29
  serializeSvg
30
- } from "./chunk-NZ5QVASG.js";
30
+ } from "./chunk-RU2HHHYA.js";
31
31
  import {
32
32
  TITLE_FONT_SIZE,
33
33
  TITLE_FONT_WEIGHT,
@@ -481,4 +481,4 @@ export {
481
481
  renderState,
482
482
  renderStateForExport
483
483
  };
484
- //# sourceMappingURL=chunk-7QCYHZVO.js.map
484
+ //# sourceMappingURL=chunk-NQH2Q2RR.js.map
@@ -21,7 +21,7 @@ import {
21
21
  } from "./chunk-YYVTBZZC.js";
22
22
  import {
23
23
  serializeSvg
24
- } from "./chunk-NZ5QVASG.js";
24
+ } from "./chunk-RU2HHHYA.js";
25
25
  import {
26
26
  renderIntegratedLegend
27
27
  } from "./chunk-UKZ7K5GS.js";
@@ -871,4 +871,4 @@ export {
871
871
  renderJourneyMap,
872
872
  renderJourneyMapForExport
873
873
  };
874
- //# sourceMappingURL=chunk-PFGJ7SCM.js.map
874
+ //# sourceMappingURL=chunk-PUFWYDWP.js.map
@@ -1,15 +1,15 @@
1
1
  import {
2
2
  MAP_DX
3
- } from "./chunk-536EBUPG.js";
3
+ } from "./chunk-EOYPX6SF.js";
4
4
  import {
5
5
  renderDataChartD3
6
- } from "./chunk-4C3BTTOL.js";
6
+ } from "./chunk-2LN5C6FH.js";
7
7
  import {
8
8
  computeQuadrantPointLabels
9
9
  } from "./chunk-CVVICCSB.js";
10
10
  import {
11
11
  renderTimeline
12
- } from "./chunk-3OLO2MZ6.js";
12
+ } from "./chunk-BPINSP65.js";
13
13
  import {
14
14
  ScaleContext
15
15
  } from "./chunk-YYVTBZZC.js";
@@ -24,7 +24,7 @@ import {
24
24
  renderChartTitle,
25
25
  resolveExportPalette,
26
26
  showTooltip
27
- } from "./chunk-CQ7Y3O67.js";
27
+ } from "./chunk-KHTKMVKT.js";
28
28
  import {
29
29
  legendInlineSupported
30
30
  } from "./chunk-6VJCURWU.js";
@@ -1872,12 +1872,12 @@ function renderQuadrant(container, parsed, palette, isDark, onClickItem, exportD
1872
1872
 
1873
1873
  // src/d3.ts
1874
1874
  async function resolveMapDataSource(source) {
1875
- if (source === void 0) return void 0;
1876
- if (typeof source !== "function") return source;
1875
+ if (source === void 0) return {};
1876
+ if (typeof source !== "function") return { data: source };
1877
1877
  try {
1878
- return await source();
1879
- } catch {
1880
- return void 0;
1878
+ return { data: await source() };
1879
+ } catch (e) {
1880
+ return { reason: e instanceof Error ? e.message : String(e) };
1881
1881
  }
1882
1882
  }
1883
1883
  var DIAGRAM_EXPORT_HANDLERS = {
@@ -1948,7 +1948,7 @@ async function renderForExport(content, theme, palette, viewState, options) {
1948
1948
  const renderContent = override?.content ?? content;
1949
1949
  const detectedType = override?.type ?? detectedTypeRaw;
1950
1950
  if (detectedType !== null) {
1951
- const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-3WMDA5Z5.js");
1951
+ const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-M76E4TZU.js");
1952
1952
  if (supportsD3DataChart(detectedType)) {
1953
1953
  return renderDataChartD32(renderContent, theme, palette);
1954
1954
  }
@@ -1973,7 +1973,7 @@ function ctxTagOverride(ctx) {
1973
1973
  async function exportEventLine(ctx) {
1974
1974
  const { content, theme, palette } = ctx;
1975
1975
  const { parseEventLine } = await import("./parser-OEBFJHT4.js");
1976
- const { renderEventLineForExport } = await import("./renderer-2PGIIOFN.js");
1976
+ const { renderEventLineForExport } = await import("./renderer-KKNXTTFE.js");
1977
1977
  const effectivePalette = await resolveExportPalette(theme, palette);
1978
1978
  const parsed = parseEventLine(content, effectivePalette);
1979
1979
  if (parsed.error || parsed.events.length === 0) return "";
@@ -1992,7 +1992,7 @@ async function exportEventLine(ctx) {
1992
1992
  async function exportBody(ctx) {
1993
1993
  const { content, theme, palette } = ctx;
1994
1994
  const { parseBody } = await import("./parser-JZPSIWRC.js");
1995
- const { renderBodyForExport } = await import("./renderer-6QW5OAJG.js");
1995
+ const { renderBodyForExport } = await import("./renderer-TTMBG2N6.js");
1996
1996
  const effectivePalette = await resolveExportPalette(theme, palette);
1997
1997
  const parsed = parseBody(content, effectivePalette);
1998
1998
  if (parsed.error) return "";
@@ -2037,7 +2037,7 @@ async function exportOrg(ctx) {
2037
2037
  const { parseOrg } = await import("./parser-AZZHRVJF.js");
2038
2038
  const { layoutOrg } = await import("./layout-OH4VQ3OI.js");
2039
2039
  const { collapseOrgTree } = await import("./collapse-CLPJD2RL.js");
2040
- const { renderOrg } = await import("./renderer-IG5PQXEM.js");
2040
+ const { renderOrg } = await import("./renderer-PKST5W6U.js");
2041
2041
  const isDark = ctx.isDark;
2042
2042
  const effectivePalette = await resolveExportPalette(theme, palette);
2043
2043
  const orgParsed = parseOrg(content, effectivePalette);
@@ -2086,7 +2086,7 @@ async function exportSitemap(ctx) {
2086
2086
  const { parseSitemap } = await import("./parser-3KFNCRLD.js");
2087
2087
  const { layoutSitemap } = await import("./layout-SKQMIXTG.js");
2088
2088
  const { collapseSitemapTree } = await import("./collapse-ZWUFFCK2.js");
2089
- const { renderSitemap } = await import("./renderer-AS6LLDZM.js");
2089
+ const { renderSitemap } = await import("./renderer-XDL6PRLN.js");
2090
2090
  const isDark = ctx.isDark;
2091
2091
  const effectivePalette = await resolveExportPalette(theme, palette);
2092
2092
  const sitemapParsed = parseSitemap(content, effectivePalette);
@@ -2136,7 +2136,7 @@ async function exportSitemap(ctx) {
2136
2136
  async function exportKanban(ctx) {
2137
2137
  const { content, theme, palette, viewState, exportMode } = ctx;
2138
2138
  const { parseKanban } = await import("./parser-6VNVZO5F.js");
2139
- const { renderKanban } = await import("./renderer-62FFDWMY.js");
2139
+ const { renderKanban } = await import("./renderer-5HYDLCMX.js");
2140
2140
  const effectivePalette = await resolveExportPalette(theme, palette);
2141
2141
  const kanbanParsed = parseKanban(content, effectivePalette);
2142
2142
  if (kanbanParsed.error || kanbanParsed.columns.length === 0) return "";
@@ -2169,7 +2169,7 @@ async function exportClass(ctx) {
2169
2169
  const { content, theme, palette, exportMode } = ctx;
2170
2170
  const { parseClassDiagram } = await import("./parser-5ZUEF4WE.js");
2171
2171
  const { layoutClassDiagram } = await import("./layout-W3ZBJOIK.js");
2172
- const { renderClassDiagram } = await import("./renderer-GESKWINV.js");
2172
+ const { renderClassDiagram } = await import("./renderer-K3TH5PP7.js");
2173
2173
  const effectivePalette = await resolveExportPalette(theme, palette);
2174
2174
  const classParsed = parseClassDiagram(content, effectivePalette);
2175
2175
  if (classParsed.error || classParsed.classes.length === 0) return "";
@@ -2196,7 +2196,7 @@ async function exportEr(ctx) {
2196
2196
  const { content, theme, palette, viewState, exportMode } = ctx;
2197
2197
  const { parseERDiagram } = await import("./parser-2BGDJJ2L.js");
2198
2198
  const { layoutERDiagram } = await import("./layout-54P3DAXY.js");
2199
- const { renderERDiagram } = await import("./renderer-VYMTBSF4.js");
2199
+ const { renderERDiagram } = await import("./renderer-HPQJRSON.js");
2200
2200
  const effectivePalette = await resolveExportPalette(theme, palette);
2201
2201
  const erParsed = parseERDiagram(content, effectivePalette);
2202
2202
  if (erParsed.error || erParsed.tables.length === 0) return "";
@@ -2370,7 +2370,7 @@ async function exportMindmap(ctx) {
2370
2370
  const { parseMindmap } = await import("./parser-YO2JBE52.js");
2371
2371
  const { layoutMindmap } = await import("./layout-UU4VJTOP.js");
2372
2372
  const { collapseMindmapTree } = await import("./collapse-SLINJQW6.js");
2373
- const { renderMindmap } = await import("./renderer-CXRSD26Q.js");
2373
+ const { renderMindmap } = await import("./renderer-4VDSMPYU.js");
2374
2374
  const isDark = ctx.isDark;
2375
2375
  const effectivePalette = await resolveExportPalette(theme, palette);
2376
2376
  const mmParsed = parseMindmap(content, effectivePalette);
@@ -2452,7 +2452,7 @@ async function exportC4(ctx) {
2452
2452
  layoutC4Components,
2453
2453
  layoutC4Deployment
2454
2454
  } = await import("./layout-WCOEZPOI.js");
2455
- const { renderC4Context, renderC4Containers } = await import("./renderer-XSHOMUJQ.js");
2455
+ const { renderC4Context, renderC4Containers } = await import("./renderer-726UVOKE.js");
2456
2456
  const effectivePalette = await resolveExportPalette(theme, palette);
2457
2457
  const c4Parsed = parseC4(content, effectivePalette);
2458
2458
  if (c4Parsed.error || c4Parsed.elements.length === 0) return "";
@@ -2488,7 +2488,7 @@ async function exportFlowchart(ctx) {
2488
2488
  const { content, theme, palette } = ctx;
2489
2489
  const { parseFlowchart } = await import("./flowchart-parser-T4XZRSA7.js");
2490
2490
  const { layoutGraph } = await import("./layout-QTZO6CW5.js");
2491
- const { renderFlowchart } = await import("./flowchart-renderer-XFDCX7MZ.js");
2491
+ const { renderFlowchart } = await import("./flowchart-renderer-BCVCIZHF.js");
2492
2492
  const effectivePalette = await resolveExportPalette(theme, palette);
2493
2493
  const fcParsed = parseFlowchart(content, effectivePalette);
2494
2494
  if (fcParsed.error || fcParsed.nodes.length === 0) return "";
@@ -2560,7 +2560,7 @@ async function exportPert(ctx) {
2560
2560
  const { parsePert } = await import("./parser-FTC7FZ6Z.js");
2561
2561
  const { analyzePert } = await import("./analyzer-HQUXKZ5J.js");
2562
2562
  const { layoutPert } = await import("./layout-5E2NQZNM.js");
2563
- const { renderPert, measurePertAnalysisBlock } = await import("./renderer-4RQ5PGHY.js");
2563
+ const { renderPert, measurePertAnalysisBlock } = await import("./renderer-KHVAM4IY.js");
2564
2564
  const effectivePalette = await resolveExportPalette(theme, palette);
2565
2565
  const pertParsed = parsePert(content, { palette: effectivePalette });
2566
2566
  if (pertParsed.error || pertParsed.activities.length === 0) return "";
@@ -2643,7 +2643,7 @@ async function exportState(ctx) {
2643
2643
  const { content, theme, palette, viewState } = ctx;
2644
2644
  const { parseState } = await import("./state-parser-3U4232LJ.js");
2645
2645
  const { layoutGraph } = await import("./layout-QTZO6CW5.js");
2646
- const { renderState } = await import("./state-renderer-GBHDOEXR.js");
2646
+ const { renderState } = await import("./state-renderer-MCWCZ76U.js");
2647
2647
  const { collapseStateGroups } = await import("./state-collapse-HCGD6IVJ.js");
2648
2648
  const effectivePalette = await resolveExportPalette(theme, palette);
2649
2649
  const stateParsed = parseState(content, effectivePalette);
@@ -2702,7 +2702,7 @@ async function exportTechRadar(ctx) {
2702
2702
  async function exportJourneyMap(ctx) {
2703
2703
  const { content, theme, palette, exportMode } = ctx;
2704
2704
  const { parseJourneyMap } = await import("./parser-56746U6W.js");
2705
- const { renderJourneyMap } = await import("./renderer-63MLWS6L.js");
2705
+ const { renderJourneyMap } = await import("./renderer-XIJO7DYS.js");
2706
2706
  const { layoutJourneyMap } = await import("./layout-H4H4OFE4.js");
2707
2707
  const effectivePalette = await resolveExportPalette(theme, palette);
2708
2708
  const jmParsed = parseJourneyMap(content, effectivePalette);
@@ -2743,15 +2743,17 @@ async function exportCycle(ctx) {
2743
2743
  async function exportMap(ctx) {
2744
2744
  const { content, theme, palette, options } = ctx;
2745
2745
  const { parseMap } = await import("./parser-UKQC7N6K.js");
2746
- const { resolveMap } = await import("./resolver-ZLYSMILY.js");
2746
+ const { resolveMap } = await import("./resolver-B3TXWNWF.js");
2747
2747
  const { renderMapForExport } = await import("./renderer-Q2YHQQSN.js");
2748
2748
  const { mapExportDimensions } = await import("./dimensions-ES6O2T4H.js");
2749
2749
  const effectivePalette = await resolveExportPalette(theme, palette);
2750
2750
  const mapParsed = parseMap(content, effectivePalette);
2751
- const mapData = await resolveMapDataSource(options?.mapData);
2751
+ const { data: mapData, reason } = await resolveMapDataSource(
2752
+ options?.mapData
2753
+ );
2752
2754
  if (!mapData) {
2753
2755
  options?.onMapResolverDiagnostics?.([
2754
- emit(MAP_DX.DATA_NOT_SUPPLIED, 1, {})
2756
+ emit(MAP_DX.DATA_NOT_SUPPLIED, 1, reason !== void 0 ? { reason } : {})
2755
2757
  ]);
2756
2758
  return "";
2757
2759
  }
@@ -3711,4 +3713,4 @@ export {
3711
3713
  renderForExport,
3712
3714
  render
3713
3715
  };
3714
- //# sourceMappingURL=chunk-DHIBVN2D.js.map
3716
+ //# sourceMappingURL=chunk-QDPMTFB4.js.map
@@ -0,0 +1,23 @@
1
+ // src/utils/svg-serialize.ts
2
+ var BARE_AMPERSAND = /&(?![a-zA-Z][a-zA-Z0-9]*;|#\d+;|#[xX][0-9a-fA-F]+;)/g;
3
+ function escapeAttributeMarkupChars(svg) {
4
+ return svg.replace(
5
+ // ` name="value"` / ` xlink:href="value"` — attribute names in SVG may carry
6
+ // a namespace prefix, a dot, or a dash.
7
+ /(\s[\w:.-]+=")([^"]*)"/g,
8
+ (match, prefix, value) => {
9
+ if (!value.includes("<") && !value.includes(">") && !value.includes("&")) {
10
+ return match;
11
+ }
12
+ return `${prefix}${value.replace(BARE_AMPERSAND, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;")}"`;
13
+ }
14
+ );
15
+ }
16
+ function serializeSvg(svgEl) {
17
+ return escapeAttributeMarkupChars(svgEl.outerHTML);
18
+ }
19
+
20
+ export {
21
+ serializeSvg
22
+ };
23
+ //# sourceMappingURL=chunk-RU2HHHYA.js.map
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-3CIOJ5YJ.js";
18
18
  import {
19
19
  serializeSvg
20
- } from "./chunk-NZ5QVASG.js";
20
+ } from "./chunk-RU2HHHYA.js";
21
21
  import {
22
22
  TITLE_FONT_SIZE,
23
23
  TITLE_FONT_WEIGHT
@@ -1039,4 +1039,4 @@ export {
1039
1039
  renderC4Deployment,
1040
1040
  renderC4DeploymentForExport
1041
1041
  };
1042
- //# sourceMappingURL=chunk-SMHTYVMK.js.map
1042
+ //# sourceMappingURL=chunk-RZRMSNO7.js.map
@@ -22,7 +22,7 @@ import {
22
22
  } from "./chunk-6VJCURWU.js";
23
23
  import {
24
24
  serializeSvg
25
- } from "./chunk-NZ5QVASG.js";
25
+ } from "./chunk-RU2HHHYA.js";
26
26
  import {
27
27
  CAPTION_BOX_PADDING_X,
28
28
  CAPTION_BOX_PADDING_Y,
@@ -1868,4 +1868,4 @@ export {
1868
1868
  measurePertAnalysisBlock,
1869
1869
  renderPertAnalysisBlock
1870
1870
  };
1871
- //# sourceMappingURL=chunk-HJ6TMHQG.js.map
1871
+ //# sourceMappingURL=chunk-SV7F363F.js.map
@@ -11,7 +11,7 @@ import {
11
11
  import {
12
12
  extractExportSvg,
13
13
  runInExportContainer
14
- } from "./chunk-L43KTQTW.js";
14
+ } from "./chunk-L26ZAPNJ.js";
15
15
  import {
16
16
  EDGE_STROKE_WIDTH,
17
17
  NODE_STROKE_WIDTH
@@ -448,4 +448,4 @@ export {
448
448
  renderClassDiagram,
449
449
  renderClassDiagramForExport
450
450
  };
451
- //# sourceMappingURL=chunk-YJCILMEA.js.map
451
+ //# sourceMappingURL=chunk-U22TKD3L.js.map
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-4QV26TEG.js";
10
10
  import {
11
11
  MAP_DX
12
- } from "./chunk-536EBUPG.js";
12
+ } from "./chunk-EOYPX6SF.js";
13
13
  import {
14
14
  formatOffsetLabel,
15
15
  isValidZone,
@@ -775,4 +775,4 @@ export {
775
775
  isSubNationalUsExtent,
776
776
  resolveMap
777
777
  };
778
- //# sourceMappingURL=chunk-PJDX4IKR.js.map
778
+ //# sourceMappingURL=chunk-WMHHNK44.js.map
@@ -20,7 +20,7 @@ import {
20
20
  } from "./chunk-6VJCURWU.js";
21
21
  import {
22
22
  serializeSvg
23
- } from "./chunk-NZ5QVASG.js";
23
+ } from "./chunk-RU2HHHYA.js";
24
24
  import {
25
25
  TITLE_FONT_SIZE,
26
26
  TITLE_FONT_WEIGHT,
@@ -603,4 +603,4 @@ export {
603
603
  renderERDiagram,
604
604
  renderERDiagramForExport
605
605
  };
606
- //# sourceMappingURL=chunk-4BEAHH6G.js.map
606
+ //# sourceMappingURL=chunk-XXDEQSW4.js.map
@@ -16,7 +16,7 @@ import {
16
16
  } from "./chunk-3CIOJ5YJ.js";
17
17
  import {
18
18
  formatDateLabel
19
- } from "./chunk-3OLO2MZ6.js";
19
+ } from "./chunk-BPINSP65.js";
20
20
  import {
21
21
  layoutInlineHeader
22
22
  } from "./chunk-6VJCURWU.js";
@@ -1157,4 +1157,4 @@ export {
1157
1157
  focusEventLine,
1158
1158
  renderEventLineForExport
1159
1159
  };
1160
- //# sourceMappingURL=chunk-NEV5IW33.js.map
1160
+ //# sourceMappingURL=chunk-YVI3JL3S.js.map