@diagrammo/dgmo 0.61.0 → 0.62.0

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/README.md +1 -1
  2. package/dist/advanced.d.ts +382 -396
  3. package/dist/advanced.js +135 -21
  4. package/dist/auto.js +143 -142
  5. package/dist/block.js +6 -5
  6. package/dist/{chart-meta-gUwAzi7N.d.ts → chart-meta-D98NbYDp.d.ts} +1 -1
  7. package/dist/chart-meta.d.ts +2 -2
  8. package/dist/chart-meta.js +1 -1
  9. package/dist/{charts-d3-MN6QCYKU.js → charts-d3-3WMDA5Z5.js} +3 -3
  10. package/dist/{chunk-OPBZYISB.js → chunk-37EHGTQ2.js} +2204 -2018
  11. package/dist/{chunk-ZDFIY6WX.js → chunk-3PVUGECM.js} +1 -2
  12. package/dist/{chunk-6CWNVQPW.js → chunk-4C3BTTOL.js} +2 -2
  13. package/dist/{chunk-4B5YISOR.js → chunk-536EBUPG.js} +16 -1
  14. package/dist/{chunk-VHO3YBTB.js → chunk-CVVICCSB.js} +24 -2
  15. package/dist/{chunk-BSJIPMPG.js → chunk-DHIBVN2D.js} +28 -17
  16. package/dist/{chunk-MOT3NXB5.js → chunk-FVYHDZ6Q.js} +2 -2
  17. package/dist/{chunk-S23HOUJS.js → chunk-JU2VMFYC.js} +2 -2
  18. package/dist/{chunk-5PWIV7ZF.js → chunk-LFAQ4BLZ.js} +2 -2
  19. package/dist/{chunk-DNSEG6P2.js → chunk-PJDX4IKR.js} +2 -2
  20. package/dist/{chunk-2WPLOS4Q.js → chunk-USHDV2AF.js} +2 -2
  21. package/dist/{registry-Ch0Umdi1.d.ts → dgmo-router-Dd5PTjxl.d.ts} +98 -98
  22. package/dist/{dgmo-router-UVYAJCAF.js → dgmo-router-Z5N6QLIC.js} +2 -2
  23. package/dist/{dimensions-QCPOPPKE.js → dimensions-ES6O2T4H.js} +4 -4
  24. package/dist/element.js +144 -143
  25. package/dist/index.d.ts +21 -10
  26. package/dist/index.js +10 -20
  27. package/dist/{renderer-IYMA5W7X.js → renderer-A5GFW2XH.js} +4 -4
  28. package/dist/{renderer-R6OKKSVR.js → renderer-Q2YHQQSN.js} +4 -4
  29. package/dist/{resolver-W3WKLWDP.js → resolver-ZLYSMILY.js} +3 -3
  30. package/dist/{themes-DC6u80yr.d.ts → themes-DiUAG4Bf.d.ts} +37 -2
  31. package/docs/ai-integration.md +5 -5
  32. package/package.json +2 -21
  33. package/.claude/commands/dgmo-codebase-report.md +0 -172
  34. package/.claude/commands/dgmo-diagram-this.md +0 -60
  35. package/.claude/commands/dgmo-document-project.md +0 -128
  36. package/.claude/commands/dgmo.md +0 -313
  37. package/.cursorrules +0 -587
  38. package/.github/copilot-instructions.md +0 -597
  39. package/.windsurfrules +0 -587
  40. package/SKILL.md +0 -573
  41. package/dist/auto.d.ts +0 -60
  42. package/dist/auto.mjs +0 -88466
  43. package/dist/chunk-6MTWIQVO.js +0 -121
  44. package/dist/cli.cjs +0 -489
  45. package/dist/element.d.ts +0 -68
  46. package/dist/element.mjs +0 -88332
  47. package/dist/load-data-EHDDZ5ZS.js +0 -8
package/dist/advanced.js CHANGED
@@ -1,7 +1,3 @@
1
- import {
2
- renderClock,
3
- renderClockForExport
4
- } from "./chunk-MD2KWAXJ.js";
5
1
  import {
6
2
  layoutBracket,
7
3
  renderBracket,
@@ -21,10 +17,6 @@ import {
21
17
  groupMessagesBySection,
22
18
  renderSequenceDiagram
23
19
  } from "./chunk-OIK6Y2EJ.js";
24
- import {
25
- renderPyramid,
26
- renderPyramidForExport
27
- } from "./chunk-TJCHULP5.js";
28
20
  import {
29
21
  renderRing,
30
22
  renderRingForExport
@@ -41,7 +33,7 @@ import {
41
33
  } from "./chunk-3HYRJAXO.js";
42
34
  import {
43
35
  renderLiveLinkCard
44
- } from "./chunk-MOT3NXB5.js";
36
+ } from "./chunk-FVYHDZ6Q.js";
45
37
  import {
46
38
  authoredCollapsedIds,
47
39
  layoutBlock,
@@ -57,6 +49,10 @@ import {
57
49
  renderCountdown,
58
50
  renderCountdownForExport
59
51
  } from "./chunk-BIWMOFSE.js";
52
+ import {
53
+ renderClock,
54
+ renderClockForExport
55
+ } from "./chunk-MD2KWAXJ.js";
60
56
  import {
61
57
  computeRadarLayout,
62
58
  getRadarGeometry,
@@ -79,29 +75,30 @@ import {
79
75
  } from "./chunk-DY4VJYG7.js";
80
76
  import {
81
77
  resolveMap
82
- } from "./chunk-DNSEG6P2.js";
78
+ } from "./chunk-PJDX4IKR.js";
83
79
  import {
84
80
  renderMap,
85
81
  renderMapForExport
86
- } from "./chunk-2WPLOS4Q.js";
82
+ } from "./chunk-USHDV2AF.js";
87
83
  import "./chunk-FWVKPEG3.js";
88
84
  import {
89
85
  mapContentAspect,
90
86
  mapExportDimensions
91
- } from "./chunk-S23HOUJS.js";
87
+ } from "./chunk-JU2VMFYC.js";
92
88
  import {
93
89
  albersSkewFallback,
94
90
  layoutMap,
95
91
  mapBackgroundColor,
96
92
  mapNeutralLandColor
97
- } from "./chunk-OPBZYISB.js";
93
+ } from "./chunk-37EHGTQ2.js";
98
94
  import {
99
95
  decodeFeatures,
100
96
  regionAt
101
97
  } from "./chunk-4QV26TEG.js";
102
98
  import {
103
- loadMapData
104
- } from "./chunk-6MTWIQVO.js";
99
+ renderPyramid,
100
+ renderPyramidForExport
101
+ } from "./chunk-TJCHULP5.js";
105
102
  import {
106
103
  collectDiagramRoles,
107
104
  computeInfraLegendGroups,
@@ -307,7 +304,6 @@ import {
307
304
  searchMapLocations,
308
305
  themes
309
306
  } from "./chunk-SQAG3UXH.js";
310
- import "./chunk-4B5YISOR.js";
311
307
  import {
312
308
  orderArcNodes,
313
309
  render,
@@ -317,13 +313,14 @@ import {
317
313
  renderSlopeChart,
318
314
  renderVenn,
319
315
  renderWordCloud
320
- } from "./chunk-BSJIPMPG.js";
321
- import "./chunk-5PWIV7ZF.js";
316
+ } from "./chunk-DHIBVN2D.js";
317
+ import "./chunk-LFAQ4BLZ.js";
318
+ import "./chunk-536EBUPG.js";
322
319
  import {
323
320
  renderLegendSvg,
324
321
  renderLegendSvgFromConfig
325
- } from "./chunk-6CWNVQPW.js";
326
- import "./chunk-VHO3YBTB.js";
322
+ } from "./chunk-4C3BTTOL.js";
323
+ import "./chunk-CVVICCSB.js";
327
324
  import {
328
325
  formatDateLabel,
329
326
  renderTimeline
@@ -372,7 +369,7 @@ import {
372
369
  parseDgmo,
373
370
  parseDgmoChartType,
374
371
  parseVisualization
375
- } from "./chunk-ZDFIY6WX.js";
372
+ } from "./chunk-3PVUGECM.js";
376
373
  import {
377
374
  normalizePlace,
378
375
  parseClock,
@@ -1309,6 +1306,123 @@ function startClocks(root = document) {
1309
1306
  window.setInterval(() => tickClocks(document), 1e3);
1310
1307
  }
1311
1308
 
1309
+ // src/map/load-data.ts
1310
+ async function loadNodeBuiltins() {
1311
+ const [{ readFile }, { fileURLToPath }, { dirname, resolve }] = await Promise.all([
1312
+ import("fs/promises"),
1313
+ import("url"),
1314
+ import("path")
1315
+ ]);
1316
+ return { readFile, fileURLToPath, dirname, resolve };
1317
+ }
1318
+ var FILES = {
1319
+ worldCoarse: "world-coarse.json",
1320
+ worldDetail: "world-detail.json",
1321
+ usStates: "us-states.json",
1322
+ lakes: "lakes.json",
1323
+ rivers: "rivers.json",
1324
+ mountainRanges: "mountain-ranges.json",
1325
+ naLand: "na-land.json",
1326
+ naLakes: "na-lakes.json",
1327
+ waterBodies: "water-bodies.json",
1328
+ airports: "airports.json",
1329
+ gazetteer: "gazetteer.json"
1330
+ };
1331
+ var CANDIDATE_DIRS = [
1332
+ "./data",
1333
+ "./map-data",
1334
+ "../map-data",
1335
+ "../src/map/data"
1336
+ ];
1337
+ var cache;
1338
+ async function readJson(nb, dir, name) {
1339
+ return JSON.parse(await nb.readFile(nb.resolve(dir, name), "utf8"));
1340
+ }
1341
+ async function firstExistingDir(nb, baseDir) {
1342
+ for (const rel of CANDIDATE_DIRS) {
1343
+ const dir = nb.resolve(baseDir, rel);
1344
+ try {
1345
+ await nb.readFile(nb.resolve(dir, FILES.gazetteer), "utf8");
1346
+ return dir;
1347
+ } catch {
1348
+ }
1349
+ }
1350
+ throw new Error(
1351
+ `map data assets not found near ${baseDir} (looked in ${CANDIDATE_DIRS.join(", ")}). Run \`pnpm build:map-data\` and \`pnpm build\`.`
1352
+ );
1353
+ }
1354
+ function validate(data) {
1355
+ const topoOk = (t) => !!t && t.type === "Topology" && !!t.objects;
1356
+ if (!topoOk(data.worldCoarse) || !topoOk(data.worldDetail) || !topoOk(data.usStates) || !data.gazetteer || !Array.isArray(data.gazetteer.cities) || !data.gazetteer.byName) {
1357
+ throw new Error("map data assets are malformed (failed shape validation)");
1358
+ }
1359
+ return data;
1360
+ }
1361
+ function moduleBaseDir(nb) {
1362
+ try {
1363
+ const url = import.meta.url;
1364
+ if (url) return nb.dirname(nb.fileURLToPath(url));
1365
+ } catch {
1366
+ }
1367
+ if (typeof __dirname !== "undefined") return __dirname;
1368
+ return process.cwd();
1369
+ }
1370
+ function loadMapData() {
1371
+ cache ??= (async () => {
1372
+ const nb = await loadNodeBuiltins();
1373
+ const dir = await firstExistingDir(nb, moduleBaseDir(nb));
1374
+ const [
1375
+ worldCoarse,
1376
+ worldDetail,
1377
+ usStates,
1378
+ lakes,
1379
+ rivers,
1380
+ mountainRanges,
1381
+ naLand,
1382
+ naLakes,
1383
+ waterBodies,
1384
+ airports,
1385
+ gazetteer
1386
+ ] = await Promise.all([
1387
+ // worldCoarse (110m) is LOAD-BEARING but NOT a render source: the world
1388
+ // basemap renders from worldDetail (50m) at all scales (resolver pins
1389
+ // basemaps.world = 'detail'). Coarse stays as the authoritative region
1390
+ // name index + dominant-landmass bbox source in resolver.ts. Do not drop it.
1391
+ readJson(nb, dir, FILES.worldCoarse),
1392
+ readJson(nb, dir, FILES.worldDetail),
1393
+ readJson(nb, dir, FILES.usStates),
1394
+ // Lakes/rivers/mountain/NA/water assets are optional — older bundles may predate them.
1395
+ readJson(nb, dir, FILES.lakes).catch(() => void 0),
1396
+ readJson(nb, dir, FILES.rivers).catch(() => void 0),
1397
+ readJson(nb, dir, FILES.mountainRanges).catch(
1398
+ () => void 0
1399
+ ),
1400
+ readJson(nb, dir, FILES.naLand).catch(() => void 0),
1401
+ readJson(nb, dir, FILES.naLakes).catch(() => void 0),
1402
+ readJson(nb, dir, FILES.waterBodies).catch(() => void 0),
1403
+ readJson(nb, dir, FILES.airports).catch(() => void 0),
1404
+ readJson(nb, dir, FILES.gazetteer)
1405
+ ]);
1406
+ return validate({
1407
+ worldCoarse,
1408
+ worldDetail,
1409
+ usStates,
1410
+ gazetteer,
1411
+ ...lakes && { lakes },
1412
+ ...rivers && { rivers },
1413
+ ...mountainRanges && { mountainRanges },
1414
+ ...naLand && { naLand },
1415
+ ...naLakes && { naLakes },
1416
+ ...waterBodies && { waterBodies },
1417
+ ...airports && { airports }
1418
+ });
1419
+ })().catch((e) => {
1420
+ cache = void 0;
1421
+ throw e;
1422
+ });
1423
+ return cache;
1424
+ }
1425
+
1312
1426
  // src/map/invert.ts
1313
1427
  function inInsetFrame(inset, px, py) {
1314
1428
  return px >= inset.x && px <= inset.x + inset.w && py >= inset.y && py <= inset.y + inset.h;