@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.
- package/README.md +1 -1
- package/dist/advanced.d.ts +382 -396
- package/dist/advanced.js +135 -21
- package/dist/auto.js +143 -142
- package/dist/block.js +6 -5
- package/dist/{chart-meta-gUwAzi7N.d.ts → chart-meta-D98NbYDp.d.ts} +1 -1
- package/dist/chart-meta.d.ts +2 -2
- package/dist/chart-meta.js +1 -1
- package/dist/{charts-d3-MN6QCYKU.js → charts-d3-3WMDA5Z5.js} +3 -3
- package/dist/{chunk-OPBZYISB.js → chunk-37EHGTQ2.js} +2204 -2018
- package/dist/{chunk-ZDFIY6WX.js → chunk-3PVUGECM.js} +1 -2
- package/dist/{chunk-6CWNVQPW.js → chunk-4C3BTTOL.js} +2 -2
- package/dist/{chunk-4B5YISOR.js → chunk-536EBUPG.js} +16 -1
- package/dist/{chunk-VHO3YBTB.js → chunk-CVVICCSB.js} +24 -2
- package/dist/{chunk-BSJIPMPG.js → chunk-DHIBVN2D.js} +28 -17
- package/dist/{chunk-MOT3NXB5.js → chunk-FVYHDZ6Q.js} +2 -2
- package/dist/{chunk-S23HOUJS.js → chunk-JU2VMFYC.js} +2 -2
- package/dist/{chunk-5PWIV7ZF.js → chunk-LFAQ4BLZ.js} +2 -2
- package/dist/{chunk-DNSEG6P2.js → chunk-PJDX4IKR.js} +2 -2
- package/dist/{chunk-2WPLOS4Q.js → chunk-USHDV2AF.js} +2 -2
- package/dist/{registry-Ch0Umdi1.d.ts → dgmo-router-Dd5PTjxl.d.ts} +98 -98
- package/dist/{dgmo-router-UVYAJCAF.js → dgmo-router-Z5N6QLIC.js} +2 -2
- package/dist/{dimensions-QCPOPPKE.js → dimensions-ES6O2T4H.js} +4 -4
- package/dist/element.js +144 -143
- package/dist/index.d.ts +21 -10
- package/dist/index.js +10 -20
- package/dist/{renderer-IYMA5W7X.js → renderer-A5GFW2XH.js} +4 -4
- package/dist/{renderer-R6OKKSVR.js → renderer-Q2YHQQSN.js} +4 -4
- package/dist/{resolver-W3WKLWDP.js → resolver-ZLYSMILY.js} +3 -3
- package/dist/{themes-DC6u80yr.d.ts → themes-DiUAG4Bf.d.ts} +37 -2
- package/docs/ai-integration.md +5 -5
- package/package.json +2 -21
- package/.claude/commands/dgmo-codebase-report.md +0 -172
- package/.claude/commands/dgmo-diagram-this.md +0 -60
- package/.claude/commands/dgmo-document-project.md +0 -128
- package/.claude/commands/dgmo.md +0 -313
- package/.cursorrules +0 -587
- package/.github/copilot-instructions.md +0 -597
- package/.windsurfrules +0 -587
- package/SKILL.md +0 -573
- package/dist/auto.d.ts +0 -60
- package/dist/auto.mjs +0 -88466
- package/dist/chunk-6MTWIQVO.js +0 -121
- package/dist/cli.cjs +0 -489
- package/dist/element.d.ts +0 -68
- package/dist/element.mjs +0 -88332
- package/dist/load-data-EHDDZ5ZS.js +0 -8
|
@@ -2020,7 +2020,6 @@ export {
|
|
|
2020
2020
|
parseWordcloud,
|
|
2021
2021
|
parseVenn,
|
|
2022
2022
|
parseQuadrant,
|
|
2023
|
-
REGISTRY_BY_ID,
|
|
2024
2023
|
looksLikeGantt,
|
|
2025
2024
|
looksLikeC4,
|
|
2026
2025
|
parseDgmoChartType,
|
|
@@ -2032,4 +2031,4 @@ export {
|
|
|
2032
2031
|
knownChartTypeIds,
|
|
2033
2032
|
parseDgmo
|
|
2034
2033
|
};
|
|
2035
|
-
//# sourceMappingURL=chunk-
|
|
2034
|
+
//# sourceMappingURL=chunk-3PVUGECM.js.map
|
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
computeQuadrantPointLabels,
|
|
3
3
|
rectCircleOverlap,
|
|
4
4
|
rectsOverlap
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-CVVICCSB.js";
|
|
6
6
|
import {
|
|
7
7
|
EXPORT_HEIGHT,
|
|
8
8
|
EXPORT_WIDTH,
|
|
@@ -2061,4 +2061,4 @@ export {
|
|
|
2061
2061
|
supportsD3DataChart,
|
|
2062
2062
|
renderDataChartD3
|
|
2063
2063
|
};
|
|
2064
|
-
//# sourceMappingURL=chunk-
|
|
2064
|
+
//# sourceMappingURL=chunk-4C3BTTOL.js.map
|
|
@@ -150,6 +150,21 @@ var MAP_DX = {
|
|
|
150
150
|
message: (p) => `\`clock: ${p.name ?? ""}\` overrides this city's actual zone (${p.tz ?? ""}) \u2014 using your value. Use a bare \`clock\` to take the city's real zone.`,
|
|
151
151
|
hint: "A named city derives its own zone \u2014 use a bare `clock` unless you mean to override it.",
|
|
152
152
|
example: "map\npoi Denver clock"
|
|
153
|
+
},
|
|
154
|
+
DATA_NOT_SUPPLIED: {
|
|
155
|
+
// Runtime severity: 'error' (matches E_ prefix). Emitted by `exportMap()`
|
|
156
|
+
// in d3.ts, not the resolver — the resolve never happens, because there is
|
|
157
|
+
// no basemap to resolve against. `render()` performs no filesystem or
|
|
158
|
+
// network access of its own, so a host must supply the assets: bundled
|
|
159
|
+
// `MapData` (Obsidian, the web app) or the Node `loadMapData` loader from
|
|
160
|
+
// the `/advanced` subpath (CLI, SSR).
|
|
161
|
+
code: "E_MAP_DATA_NOT_SUPPLIED",
|
|
162
|
+
severity: "error",
|
|
163
|
+
chartType: "map",
|
|
164
|
+
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`.",
|
|
167
|
+
example: "map\nDenver heat: 2"
|
|
153
168
|
}
|
|
154
169
|
};
|
|
155
170
|
var MAP_DIAGNOSTICS = Object.values(MAP_DX);
|
|
@@ -158,4 +173,4 @@ export {
|
|
|
158
173
|
MAP_DX,
|
|
159
174
|
MAP_DIAGNOSTICS
|
|
160
175
|
};
|
|
161
|
-
//# sourceMappingURL=chunk-
|
|
176
|
+
//# sourceMappingURL=chunk-536EBUPG.js.map
|
|
@@ -54,6 +54,28 @@ function segmentsCross(ax, ay, bx, by, cx, cy, dx, dy) {
|
|
|
54
54
|
if (o4 === 0 && onSeg(cx, cy, dx, dy, bx, by)) return true;
|
|
55
55
|
return false;
|
|
56
56
|
}
|
|
57
|
+
function createLabelPlacement(init) {
|
|
58
|
+
const placed = [...init?.reserved ?? []];
|
|
59
|
+
const leaders = [];
|
|
60
|
+
const obstacles = init?.obstacles ?? [];
|
|
61
|
+
const markers = init?.markers ?? [];
|
|
62
|
+
return {
|
|
63
|
+
hitsPlaced: (rect) => placed.some((p) => rectsOverlap(rect, p)),
|
|
64
|
+
hitsObstacle: (rect) => obstacles.some((o) => rectsOverlap(rect, o)),
|
|
65
|
+
hitsMarker: (rect) => markers.some((m) => rectCircleOverlap(rect, m)),
|
|
66
|
+
leaderCrosses: ([x0, y0, x1, y1]) => leaders.some(
|
|
67
|
+
(l) => segmentsCross(x0, y0, x1, y1, l[0], l[1], l[2], l[3])
|
|
68
|
+
),
|
|
69
|
+
leaderHitsPlaced: ([x0, y0, x1, y1]) => placed.some((p) => segmentRectOverlap(x0, y0, x1, y1, p)),
|
|
70
|
+
commit: (rect, leader) => {
|
|
71
|
+
placed.push(rect);
|
|
72
|
+
if (leader) leaders.push(leader);
|
|
73
|
+
},
|
|
74
|
+
get placed() {
|
|
75
|
+
return placed;
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
57
79
|
function computeQuadrantPointLabels(points, chartBounds, obstacles, pointRadius, fontSize) {
|
|
58
80
|
const labelHeight = fontSize + 4;
|
|
59
81
|
const stepSize = labelHeight + 2;
|
|
@@ -218,7 +240,7 @@ export {
|
|
|
218
240
|
rectsOverlap,
|
|
219
241
|
rectCircleOverlap,
|
|
220
242
|
segmentRectOverlap,
|
|
221
|
-
|
|
243
|
+
createLabelPlacement,
|
|
222
244
|
computeQuadrantPointLabels
|
|
223
245
|
};
|
|
224
|
-
//# sourceMappingURL=chunk-
|
|
246
|
+
//# sourceMappingURL=chunk-CVVICCSB.js.map
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MAP_DX
|
|
3
|
+
} from "./chunk-536EBUPG.js";
|
|
1
4
|
import {
|
|
2
5
|
renderDataChartD3
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-4C3BTTOL.js";
|
|
4
7
|
import {
|
|
5
8
|
computeQuadrantPointLabels
|
|
6
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CVVICCSB.js";
|
|
7
10
|
import {
|
|
8
11
|
renderTimeline
|
|
9
12
|
} from "./chunk-3OLO2MZ6.js";
|
|
@@ -42,7 +45,7 @@ import {
|
|
|
42
45
|
parseVenn,
|
|
43
46
|
parseVisualization,
|
|
44
47
|
parseWordcloud
|
|
45
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-3PVUGECM.js";
|
|
46
49
|
import {
|
|
47
50
|
resolveActiveTagGroup,
|
|
48
51
|
tagAttrKey
|
|
@@ -56,6 +59,7 @@ import {
|
|
|
56
59
|
themeBaseBg
|
|
57
60
|
} from "./chunk-42IT4BG2.js";
|
|
58
61
|
import {
|
|
62
|
+
emit,
|
|
59
63
|
makeDgmoError
|
|
60
64
|
} from "./chunk-OLMWTJVU.js";
|
|
61
65
|
|
|
@@ -1867,6 +1871,15 @@ function renderQuadrant(container, parsed, palette, isDark, onClickItem, exportD
|
|
|
1867
1871
|
}
|
|
1868
1872
|
|
|
1869
1873
|
// src/d3.ts
|
|
1874
|
+
async function resolveMapDataSource(source) {
|
|
1875
|
+
if (source === void 0) return void 0;
|
|
1876
|
+
if (typeof source !== "function") return source;
|
|
1877
|
+
try {
|
|
1878
|
+
return await source();
|
|
1879
|
+
} catch {
|
|
1880
|
+
return void 0;
|
|
1881
|
+
}
|
|
1882
|
+
}
|
|
1870
1883
|
var DIAGRAM_EXPORT_HANDLERS = {
|
|
1871
1884
|
org: exportOrg,
|
|
1872
1885
|
sitemap: exportSitemap,
|
|
@@ -1929,13 +1942,13 @@ function resolveArcChordOverride(content, detectedType, palette) {
|
|
|
1929
1942
|
}
|
|
1930
1943
|
async function renderForExport(content, theme, palette, viewState, options) {
|
|
1931
1944
|
const exportMode = options?.exportMode ?? false;
|
|
1932
|
-
const { parseDgmoChartType } = await import("./dgmo-router-
|
|
1945
|
+
const { parseDgmoChartType } = await import("./dgmo-router-Z5N6QLIC.js");
|
|
1933
1946
|
const detectedTypeRaw = parseDgmoChartType(content);
|
|
1934
1947
|
const override = resolveArcChordOverride(content, detectedTypeRaw, palette);
|
|
1935
1948
|
const renderContent = override?.content ?? content;
|
|
1936
1949
|
const detectedType = override?.type ?? detectedTypeRaw;
|
|
1937
1950
|
if (detectedType !== null) {
|
|
1938
|
-
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-
|
|
1951
|
+
const { supportsD3DataChart, renderDataChartD3: renderDataChartD32 } = await import("./charts-d3-3WMDA5Z5.js");
|
|
1939
1952
|
if (supportsD3DataChart(detectedType)) {
|
|
1940
1953
|
return renderDataChartD32(renderContent, theme, palette);
|
|
1941
1954
|
}
|
|
@@ -2730,19 +2743,17 @@ async function exportCycle(ctx) {
|
|
|
2730
2743
|
async function exportMap(ctx) {
|
|
2731
2744
|
const { content, theme, palette, options } = ctx;
|
|
2732
2745
|
const { parseMap } = await import("./parser-UKQC7N6K.js");
|
|
2733
|
-
const { resolveMap } = await import("./resolver-
|
|
2734
|
-
const { renderMapForExport } = await import("./renderer-
|
|
2735
|
-
const { mapExportDimensions } = await import("./dimensions-
|
|
2746
|
+
const { resolveMap } = await import("./resolver-ZLYSMILY.js");
|
|
2747
|
+
const { renderMapForExport } = await import("./renderer-Q2YHQQSN.js");
|
|
2748
|
+
const { mapExportDimensions } = await import("./dimensions-ES6O2T4H.js");
|
|
2736
2749
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2737
2750
|
const mapParsed = parseMap(content, effectivePalette);
|
|
2738
|
-
|
|
2751
|
+
const mapData = await resolveMapDataSource(options?.mapData);
|
|
2739
2752
|
if (!mapData) {
|
|
2740
|
-
|
|
2741
|
-
|
|
2742
|
-
|
|
2743
|
-
|
|
2744
|
-
return "";
|
|
2745
|
-
}
|
|
2753
|
+
options?.onMapResolverDiagnostics?.([
|
|
2754
|
+
emit(MAP_DX.DATA_NOT_SUPPLIED, 1, {})
|
|
2755
|
+
]);
|
|
2756
|
+
return "";
|
|
2746
2757
|
}
|
|
2747
2758
|
const mapResolved = resolveMap(mapParsed, mapData);
|
|
2748
2759
|
options?.onMapResolverDiagnostics?.(mapResolved.diagnostics);
|
|
@@ -2826,7 +2837,7 @@ async function exportTreemap(ctx) {
|
|
|
2826
2837
|
async function exportLiveLink(ctx) {
|
|
2827
2838
|
const { content, theme, palette } = ctx;
|
|
2828
2839
|
const { parseLiveLink } = await import("./parser-KSIYWKYF.js");
|
|
2829
|
-
const { renderLiveLinkCard } = await import("./renderer-
|
|
2840
|
+
const { renderLiveLinkCard } = await import("./renderer-A5GFW2XH.js");
|
|
2830
2841
|
const effectivePalette = await resolveExportPalette(theme, palette);
|
|
2831
2842
|
return renderLiveLinkCard(parseLiveLink(content), effectivePalette, theme);
|
|
2832
2843
|
}
|
|
@@ -3700,4 +3711,4 @@ export {
|
|
|
3700
3711
|
renderForExport,
|
|
3701
3712
|
render
|
|
3702
3713
|
};
|
|
3703
|
-
//# sourceMappingURL=chunk-
|
|
3714
|
+
//# sourceMappingURL=chunk-DHIBVN2D.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
MONO_FAMILY
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LFAQ4BLZ.js";
|
|
4
4
|
import {
|
|
5
5
|
FONT_FAMILY
|
|
6
6
|
} from "./chunk-6KFWC4CO.js";
|
|
@@ -62,4 +62,4 @@ function escapeXml(s) {
|
|
|
62
62
|
export {
|
|
63
63
|
renderLiveLinkCard
|
|
64
64
|
};
|
|
65
|
-
//# sourceMappingURL=chunk-
|
|
65
|
+
//# sourceMappingURL=chunk-FVYHDZ6Q.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildMapProjection
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-37EHGTQ2.js";
|
|
4
4
|
import {
|
|
5
5
|
TITLE_FONT_SIZE,
|
|
6
6
|
TITLE_Y
|
|
@@ -51,4 +51,4 @@ export {
|
|
|
51
51
|
mapContentAspect,
|
|
52
52
|
mapExportDimensions
|
|
53
53
|
};
|
|
54
|
-
//# sourceMappingURL=chunk-
|
|
54
|
+
//# sourceMappingURL=chunk-JU2VMFYC.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-U7VO6JAA.js";
|
|
11
11
|
import {
|
|
12
12
|
parseDgmoChartType
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3PVUGECM.js";
|
|
14
14
|
import {
|
|
15
15
|
chartTypes
|
|
16
16
|
} from "./chunk-P2PUWV3Y.js";
|
|
@@ -204,4 +204,4 @@ export {
|
|
|
204
204
|
MONO_FAMILY,
|
|
205
205
|
renderErrorCard
|
|
206
206
|
};
|
|
207
|
-
//# sourceMappingURL=chunk-
|
|
207
|
+
//# sourceMappingURL=chunk-LFAQ4BLZ.js.map
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from "./chunk-4QV26TEG.js";
|
|
10
10
|
import {
|
|
11
11
|
MAP_DX
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-536EBUPG.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-
|
|
778
|
+
//# sourceMappingURL=chunk-PJDX4IKR.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
mapLegendConfig,
|
|
7
7
|
mapLegendGroups,
|
|
8
8
|
parsePathRings
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-37EHGTQ2.js";
|
|
10
10
|
import {
|
|
11
11
|
TITLE_FONT_SIZE,
|
|
12
12
|
TITLE_FONT_WEIGHT,
|
|
@@ -781,4 +781,4 @@ export {
|
|
|
781
781
|
renderMap,
|
|
782
782
|
renderMapForExport
|
|
783
783
|
};
|
|
784
|
-
//# sourceMappingURL=chunk-
|
|
784
|
+
//# sourceMappingURL=chunk-USHDV2AF.js.map
|
|
@@ -58,6 +58,86 @@ interface EmitOptions {
|
|
|
58
58
|
declare function emit(spec: DiagnosticSpec, line: number, params?: DiagnosticParams, opts?: EmitOptions): DgmoError;
|
|
59
59
|
declare function formatDgmoError(err: DgmoError): string;
|
|
60
60
|
|
|
61
|
+
/**
|
|
62
|
+
* Compact view state schema (ADR-6).
|
|
63
|
+
* All fields optional. Only non-default values are encoded.
|
|
64
|
+
* `tag: null` means "user chose none"; absent `tag` means "use DSL default" (ADR-5).
|
|
65
|
+
*/
|
|
66
|
+
interface CompactViewState {
|
|
67
|
+
tag?: string | null;
|
|
68
|
+
cs?: number[];
|
|
69
|
+
cg?: string[];
|
|
70
|
+
swim?: string | null;
|
|
71
|
+
cl?: string[];
|
|
72
|
+
cc?: string[];
|
|
73
|
+
rm?: string;
|
|
74
|
+
htv?: Record<string, string[]>;
|
|
75
|
+
ha?: string[];
|
|
76
|
+
sem?: boolean;
|
|
77
|
+
cm?: boolean;
|
|
78
|
+
c4l?: string;
|
|
79
|
+
c4s?: string;
|
|
80
|
+
c4c?: string;
|
|
81
|
+
rps?: number;
|
|
82
|
+
spd?: number;
|
|
83
|
+
io?: Record<string, number>;
|
|
84
|
+
hd?: boolean;
|
|
85
|
+
cbd?: boolean;
|
|
86
|
+
rq?: string;
|
|
87
|
+
an?: boolean;
|
|
88
|
+
fl?: boolean;
|
|
89
|
+
}
|
|
90
|
+
interface DecodedDiagramUrl {
|
|
91
|
+
dsl: string;
|
|
92
|
+
viewState: CompactViewState;
|
|
93
|
+
palette?: string;
|
|
94
|
+
theme?: 'light' | 'dark';
|
|
95
|
+
filename?: string;
|
|
96
|
+
}
|
|
97
|
+
interface EncodeDiagramUrlOptions {
|
|
98
|
+
baseUrl?: string;
|
|
99
|
+
viewState?: CompactViewState;
|
|
100
|
+
palette?: string;
|
|
101
|
+
theme?: 'light' | 'dark';
|
|
102
|
+
filename?: string;
|
|
103
|
+
}
|
|
104
|
+
type EncodeDiagramUrlResult = {
|
|
105
|
+
url: string;
|
|
106
|
+
error?: undefined;
|
|
107
|
+
} | {
|
|
108
|
+
url?: undefined;
|
|
109
|
+
error: 'too-large';
|
|
110
|
+
compressedSize: number;
|
|
111
|
+
limit: number;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Encode a CompactViewState to a compressed string for URL embedding.
|
|
115
|
+
* Returns empty string if state has no keys (ADR-4).
|
|
116
|
+
*/
|
|
117
|
+
declare function encodeViewState(state: CompactViewState): string;
|
|
118
|
+
/**
|
|
119
|
+
* Decode a compressed view state string back to CompactViewState.
|
|
120
|
+
* Returns empty object on failure (no crash).
|
|
121
|
+
*/
|
|
122
|
+
declare function decodeViewState(encoded: string): CompactViewState;
|
|
123
|
+
/**
|
|
124
|
+
* Compress a DGMO DSL string into a shareable URL.
|
|
125
|
+
* Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
|
|
126
|
+
* compressed payload exceeds the 8 KB limit.
|
|
127
|
+
*/
|
|
128
|
+
declare function encodeDiagramUrl(dsl: string, options?: EncodeDiagramUrlOptions): EncodeDiagramUrlResult;
|
|
129
|
+
/**
|
|
130
|
+
* Decode a DGMO DSL string and view state from a URL query string or hash.
|
|
131
|
+
* Accepts any of:
|
|
132
|
+
* - `?dgmo=<payload>&vs=<state>`
|
|
133
|
+
* - `#dgmo=<payload>&vs=<state>` (backwards compat)
|
|
134
|
+
* - `dgmo=<payload>`
|
|
135
|
+
* - `<bare payload>`
|
|
136
|
+
*
|
|
137
|
+
* Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
|
|
138
|
+
*/
|
|
139
|
+
declare function decodeDiagramUrl(hash: string): DecodedDiagramUrl;
|
|
140
|
+
|
|
61
141
|
/**
|
|
62
142
|
* Color definitions for a single mode (light or dark).
|
|
63
143
|
* 10 semantic UI colors + 9 named accent colors = 19 total.
|
|
@@ -180,85 +260,27 @@ declare function tagAttrKey(name: string): string;
|
|
|
180
260
|
*/
|
|
181
261
|
declare const autoTagColorCycle: readonly string[];
|
|
182
262
|
|
|
263
|
+
/** Validate that a hex string is well-formed (#RGB or #RRGGBB). */
|
|
264
|
+
declare function isValidHex(value: string): boolean;
|
|
183
265
|
/**
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*/
|
|
188
|
-
interface CompactViewState {
|
|
189
|
-
tag?: string | null;
|
|
190
|
-
cs?: number[];
|
|
191
|
-
cg?: string[];
|
|
192
|
-
swim?: string | null;
|
|
193
|
-
cl?: string[];
|
|
194
|
-
cc?: string[];
|
|
195
|
-
rm?: string;
|
|
196
|
-
htv?: Record<string, string[]>;
|
|
197
|
-
ha?: string[];
|
|
198
|
-
sem?: boolean;
|
|
199
|
-
cm?: boolean;
|
|
200
|
-
c4l?: string;
|
|
201
|
-
c4s?: string;
|
|
202
|
-
c4c?: string;
|
|
203
|
-
rps?: number;
|
|
204
|
-
spd?: number;
|
|
205
|
-
io?: Record<string, number>;
|
|
206
|
-
hd?: boolean;
|
|
207
|
-
cbd?: boolean;
|
|
208
|
-
rq?: string;
|
|
209
|
-
an?: boolean;
|
|
210
|
-
fl?: boolean;
|
|
211
|
-
}
|
|
212
|
-
interface DecodedDiagramUrl {
|
|
213
|
-
dsl: string;
|
|
214
|
-
viewState: CompactViewState;
|
|
215
|
-
palette?: string;
|
|
216
|
-
theme?: 'light' | 'dark';
|
|
217
|
-
filename?: string;
|
|
218
|
-
}
|
|
219
|
-
interface EncodeDiagramUrlOptions {
|
|
220
|
-
baseUrl?: string;
|
|
221
|
-
viewState?: CompactViewState;
|
|
222
|
-
palette?: string;
|
|
223
|
-
theme?: 'light' | 'dark';
|
|
224
|
-
filename?: string;
|
|
225
|
-
}
|
|
226
|
-
type EncodeDiagramUrlResult = {
|
|
227
|
-
url: string;
|
|
228
|
-
error?: undefined;
|
|
229
|
-
} | {
|
|
230
|
-
url?: undefined;
|
|
231
|
-
error: 'too-large';
|
|
232
|
-
compressedSize: number;
|
|
233
|
-
limit: number;
|
|
234
|
-
};
|
|
235
|
-
/**
|
|
236
|
-
* Encode a CompactViewState to a compressed string for URL embedding.
|
|
237
|
-
* Returns empty string if state has no keys (ADR-4).
|
|
238
|
-
*/
|
|
239
|
-
declare function encodeViewState(state: CompactViewState): string;
|
|
240
|
-
/**
|
|
241
|
-
* Decode a compressed view state string back to CompactViewState.
|
|
242
|
-
* Returns empty object on failure (no crash).
|
|
243
|
-
*/
|
|
244
|
-
declare function decodeViewState(encoded: string): CompactViewState;
|
|
245
|
-
/**
|
|
246
|
-
* Compress a DGMO DSL string into a shareable URL.
|
|
247
|
-
* Returns `{ url }` on success, or `{ error: 'too-large', compressedSize, limit }` if the
|
|
248
|
-
* compressed payload exceeds the 8 KB limit.
|
|
266
|
+
* Register a palette. Called at module initialization.
|
|
267
|
+
* Validates that all 19 color fields per mode are present and valid hex.
|
|
268
|
+
* Throws on malformed palettes to catch errors at startup, not at render time.
|
|
249
269
|
*/
|
|
250
|
-
declare function
|
|
270
|
+
declare function registerPalette(palette: PaletteConfig): void;
|
|
271
|
+
/** Get palette by id. Silently returns the default palette if id is unrecognized. */
|
|
272
|
+
declare function getPalette(id: string): PaletteConfig;
|
|
251
273
|
/**
|
|
252
|
-
*
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
*
|
|
258
|
-
*
|
|
259
|
-
* Returns `{ dsl, viewState }`. The DSL is empty string on invalid input.
|
|
274
|
+
* Resolve a palette by id, falling back to the default palette when the id is
|
|
275
|
+
* unregistered. If a `warn` callback is supplied, it is invoked once with a
|
|
276
|
+
* human-readable fallback message on a miss — the single place the "resolve,
|
|
277
|
+
* fall back, warn" policy lives, so each host can surface it its own way
|
|
278
|
+
* (console.warn, Obsidian Notice, MCP response). Silent when the id resolves or
|
|
279
|
+
* when no callback is passed.
|
|
260
280
|
*/
|
|
261
|
-
declare function
|
|
281
|
+
declare function resolvePaletteOrFallback(id: string, warn?: (message: string) => void): PaletteConfig;
|
|
282
|
+
/** List all registered palettes alphabetically (for the selector UI). */
|
|
283
|
+
declare function getAvailablePalettes(): PaletteConfig[];
|
|
262
284
|
|
|
263
285
|
interface ChartTypeMeta {
|
|
264
286
|
readonly id: string;
|
|
@@ -515,26 +537,4 @@ declare function parseDgmo(content: string): {
|
|
|
515
537
|
chartType: string | null;
|
|
516
538
|
};
|
|
517
539
|
|
|
518
|
-
|
|
519
|
-
declare function isValidHex(value: string): boolean;
|
|
520
|
-
/**
|
|
521
|
-
* Register a palette. Called at module initialization.
|
|
522
|
-
* Validates that all 19 color fields per mode are present and valid hex.
|
|
523
|
-
* Throws on malformed palettes to catch errors at startup, not at render time.
|
|
524
|
-
*/
|
|
525
|
-
declare function registerPalette(palette: PaletteConfig): void;
|
|
526
|
-
/** Get palette by id. Silently returns the default palette if id is unrecognized. */
|
|
527
|
-
declare function getPalette(id: string): PaletteConfig;
|
|
528
|
-
/**
|
|
529
|
-
* Resolve a palette by id, falling back to the default palette when the id is
|
|
530
|
-
* unregistered. If a `warn` callback is supplied, it is invoked once with a
|
|
531
|
-
* human-readable fallback message on a miss — the single place the "resolve,
|
|
532
|
-
* fall back, warn" policy lives, so each host can surface it its own way
|
|
533
|
-
* (console.warn, Obsidian Notice, MCP response). Silent when the id resolves or
|
|
534
|
-
* when no callback is passed.
|
|
535
|
-
*/
|
|
536
|
-
declare function resolvePaletteOrFallback(id: string, warn?: (message: string) => void): PaletteConfig;
|
|
537
|
-
/** List all registered palettes alphabetically (for the selector UI). */
|
|
538
|
-
declare function getAvailablePalettes(): PaletteConfig[];
|
|
539
|
-
|
|
540
|
-
export { isExtendedChartType as A, isValidHex as B, type CompactViewState as C, type DgmoError as D, type EmitOptions as E, knownChartTypeIds as F, makeDgmoError as G, parseDgmoChartType as H, registerPalette as I, tagAttrKey as J, type PaletteConfig as P, type RenderCategory as R, type TagGroup as T, type DiagnosticSpec as a, type ChartTypeId as b, type ChartTypeMeta as c, type DgmoSeverity as d, type DiagnosticParams as e, type PaletteColors as f, chartTypes as g, emit as h, formatDgmoError as i, getPalette as j, type TagEntry as k, CHART_TYPE_DESCRIPTIONS as l, type DecodedDiagramUrl as m, type EncodeDiagramUrlOptions as n, type EncodeDiagramUrlResult as o, parseDgmo as p, autoTagColorCycle as q, resolvePaletteOrFallback as r, chartTypeParsers as s, decodeDiagramUrl as t, decodeViewState as u, encodeDiagramUrl as v, encodeViewState as w, getAllChartTypes as x, getAvailablePalettes as y, getRenderCategory as z };
|
|
540
|
+
export { isExtendedChartType as A, isValidHex as B, type CompactViewState as C, type DiagnosticSpec as D, type EmitOptions as E, knownChartTypeIds as F, makeDgmoError as G, parseDgmoChartType as H, registerPalette as I, tagAttrKey as J, type PaletteConfig as P, type RenderCategory as R, type TagGroup as T, type DgmoError as a, type ChartTypeId as b, type ChartTypeMeta as c, type DgmoSeverity as d, type DiagnosticParams as e, type PaletteColors as f, chartTypes as g, emit as h, formatDgmoError as i, getPalette as j, type TagEntry as k, CHART_TYPE_DESCRIPTIONS as l, type DecodedDiagramUrl as m, type EncodeDiagramUrlOptions as n, type EncodeDiagramUrlResult as o, parseDgmo as p, autoTagColorCycle as q, resolvePaletteOrFallback as r, chartTypeParsers as s, decodeDiagramUrl as t, decodeViewState as u, encodeDiagramUrl as v, encodeViewState as w, getAllChartTypes as x, getAvailablePalettes as y, getRenderCategory as z };
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
looksLikeGantt,
|
|
10
10
|
parseDgmo,
|
|
11
11
|
parseDgmoChartType
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-3PVUGECM.js";
|
|
13
13
|
import "./chunk-2CMM36O7.js";
|
|
14
14
|
import "./chunk-A2RUBBVT.js";
|
|
15
15
|
import "./chunk-JWJBWNQL.js";
|
|
@@ -86,4 +86,4 @@ export {
|
|
|
86
86
|
parseDgmo,
|
|
87
87
|
parseDgmoChartType
|
|
88
88
|
};
|
|
89
|
-
//# sourceMappingURL=dgmo-router-
|
|
89
|
+
//# sourceMappingURL=dgmo-router-Z5N6QLIC.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mapContentAspect,
|
|
3
3
|
mapExportDimensions
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-JU2VMFYC.js";
|
|
5
|
+
import "./chunk-37EHGTQ2.js";
|
|
6
6
|
import "./chunk-4QV26TEG.js";
|
|
7
|
-
import "./chunk-
|
|
7
|
+
import "./chunk-CVVICCSB.js";
|
|
8
8
|
import "./chunk-A4GOY3PE.js";
|
|
9
9
|
import "./chunk-ES66QH6J.js";
|
|
10
10
|
import "./chunk-SCJ7CAJF.js";
|
|
@@ -19,4 +19,4 @@ export {
|
|
|
19
19
|
mapContentAspect,
|
|
20
20
|
mapExportDimensions
|
|
21
21
|
};
|
|
22
|
-
//# sourceMappingURL=dimensions-
|
|
22
|
+
//# sourceMappingURL=dimensions-ES6O2T4H.js.map
|