@diagrammo/dgmo 0.5.3 → 0.5.4
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 +16 -16
- package/dist/cli.cjs +158 -158
- package/dist/index.cjs +766 -319
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -23
- package/dist/index.d.ts +37 -23
- package/dist/index.js +765 -319
- package/dist/index.js.map +1 -1
- package/docs/language-reference.md +20 -2
- package/package.json +1 -1
- package/src/d3.ts +241 -204
- package/src/index.ts +3 -0
- package/src/infra/compute.ts +88 -10
- package/src/infra/layout.ts +97 -12
- package/src/infra/parser.ts +47 -4
- package/src/infra/renderer.ts +216 -42
- package/src/infra/roles.ts +15 -0
- package/src/infra/types.ts +7 -0
- package/src/initiative-status/collapse.ts +76 -0
- package/src/initiative-status/layout.ts +193 -26
- package/src/initiative-status/renderer.ts +94 -46
- package/src/org/layout.ts +5 -2
- package/src/org/renderer.ts +65 -11
- package/src/org/resolver.ts +1 -1
- package/src/sharing.ts +12 -0
package/src/sharing.ts
CHANGED
|
@@ -10,6 +10,8 @@ export interface DiagramViewState {
|
|
|
10
10
|
activeTagGroup?: string;
|
|
11
11
|
collapsedGroups?: string[];
|
|
12
12
|
swimlaneTagGroup?: string;
|
|
13
|
+
palette?: string;
|
|
14
|
+
theme?: 'light' | 'dark';
|
|
13
15
|
}
|
|
14
16
|
|
|
15
17
|
export interface DecodedDiagramUrl {
|
|
@@ -57,6 +59,14 @@ export function encodeDiagramUrl(
|
|
|
57
59
|
hash += `&swim=${encodeURIComponent(options.viewState.swimlaneTagGroup)}`;
|
|
58
60
|
}
|
|
59
61
|
|
|
62
|
+
if (options?.viewState?.palette && options.viewState.palette !== 'nord') {
|
|
63
|
+
hash += `&pal=${encodeURIComponent(options.viewState.palette)}`;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (options?.viewState?.theme && options.viewState.theme !== 'dark') {
|
|
67
|
+
hash += `&th=${encodeURIComponent(options.viewState.theme)}`;
|
|
68
|
+
}
|
|
69
|
+
|
|
60
70
|
// Encode in both query param AND hash fragment — some share mechanisms
|
|
61
71
|
// strip one or the other (iOS share sheet strips #, AirDrop strips ?)
|
|
62
72
|
return { url: `${baseUrl}?${hash}#${hash}` };
|
|
@@ -105,6 +115,8 @@ export function decodeDiagramUrl(hash: string): DecodedDiagramUrl {
|
|
|
105
115
|
if (key === 'swim' && val) {
|
|
106
116
|
viewState.swimlaneTagGroup = val;
|
|
107
117
|
}
|
|
118
|
+
if (key === 'pal' && val) viewState.palette = val;
|
|
119
|
+
if (key === 'th' && (val === 'light' || val === 'dark')) viewState.theme = val;
|
|
108
120
|
}
|
|
109
121
|
|
|
110
122
|
// Strip 'dgmo=' prefix
|