@diagrammo/dgmo 0.2.23 → 0.2.25
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/dist/cli.cjs +73 -73
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/initiative-status/renderer.ts +4 -1
- package/src/sharing.ts +6 -5
package/package.json
CHANGED
|
@@ -186,7 +186,10 @@ function fitTextToNode(label: string, nodeWidth: number, nodeHeight: number): Fi
|
|
|
186
186
|
return { lines: camelLines, fontSize };
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
//
|
|
189
|
+
// If not at minimum font size yet, try shrinking before hard-breaking
|
|
190
|
+
if (fontSize > MIN_NODE_FONT_SIZE) continue;
|
|
191
|
+
|
|
192
|
+
// At minimum font size — hard-break as last resort
|
|
190
193
|
const hardLines: string[] = [];
|
|
191
194
|
for (const line of camelLines) {
|
|
192
195
|
if (line.length <= maxCharsPerLine) {
|
package/src/sharing.ts
CHANGED
|
@@ -47,13 +47,14 @@ export function encodeDiagramUrl(
|
|
|
47
47
|
hash += `&tag=${encodeURIComponent(options.viewState.activeTagGroup)}`;
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
return { url: `${baseUrl}
|
|
50
|
+
return { url: `${baseUrl}?${hash}` };
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
|
54
|
-
* Decode a DGMO DSL string and view state from a URL hash.
|
|
54
|
+
* Decode a DGMO DSL string and view state from a URL query string or hash.
|
|
55
55
|
* Accepts any of:
|
|
56
|
-
* -
|
|
56
|
+
* - `?dgmo=<payload>&tag=<name>`
|
|
57
|
+
* - `#dgmo=<payload>&tag=<name>` (backwards compat)
|
|
57
58
|
* - `dgmo=<payload>`
|
|
58
59
|
* - `<bare payload>`
|
|
59
60
|
*
|
|
@@ -65,8 +66,8 @@ export function decodeDiagramUrl(hash: string): DecodedDiagramUrl {
|
|
|
65
66
|
|
|
66
67
|
let raw = hash;
|
|
67
68
|
|
|
68
|
-
// Strip leading '#'
|
|
69
|
-
if (raw.startsWith('#')) {
|
|
69
|
+
// Strip leading '#' or '?'
|
|
70
|
+
if (raw.startsWith('#') || raw.startsWith('?')) {
|
|
70
71
|
raw = raw.slice(1);
|
|
71
72
|
}
|
|
72
73
|
|