@diagrammo/dgmo 0.25.4 → 0.26.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/dist/advanced.cjs +62564 -0
- package/dist/advanced.d.cts +5702 -0
- package/dist/advanced.d.ts +5702 -0
- package/dist/advanced.js +62315 -0
- package/dist/auto.cjs +59851 -0
- package/dist/auto.css +214 -0
- package/dist/auto.d.cts +39 -0
- package/dist/auto.d.ts +39 -0
- package/dist/auto.js +437 -0
- package/dist/auto.mjs +59861 -0
- package/dist/cli.cjs +465 -0
- package/dist/editor.cjs +432 -0
- package/dist/editor.d.cts +26 -0
- package/dist/editor.d.ts +26 -0
- package/dist/editor.js +401 -0
- package/dist/highlight.cjs +720 -0
- package/dist/highlight.d.cts +32 -0
- package/dist/highlight.d.ts +32 -0
- package/dist/highlight.js +690 -0
- package/dist/index.cjs +59037 -0
- package/dist/index.d.cts +375 -0
- package/dist/index.d.ts +375 -0
- package/dist/index.js +59041 -0
- package/dist/internal.cjs +62566 -0
- package/dist/internal.d.cts +5702 -0
- package/dist/internal.d.ts +5702 -0
- package/dist/internal.js +62315 -0
- package/dist/map-data/PROVENANCE.json +1 -0
- package/dist/map-data/gazetteer.json +1 -0
- package/dist/map-data/lakes.json +1 -0
- package/dist/map-data/mountain-ranges.json +1 -0
- package/dist/map-data/na-lakes.json +1 -0
- package/dist/map-data/na-land.json +1 -0
- package/dist/map-data/region-names.json +1 -0
- package/dist/map-data/rivers.json +1 -0
- package/dist/map-data/us-states.json +1 -0
- package/dist/map-data/water-bodies.json +1 -0
- package/dist/map-data/world-coarse.json +1 -0
- package/dist/map-data/world-detail.json +1 -0
- package/dist/pert.cjs +325 -0
- package/dist/pert.d.cts +554 -0
- package/dist/pert.d.ts +554 -0
- package/dist/pert.js +294 -0
- package/package.json +1 -1
- package/src/advanced.ts +2 -0
- package/src/class/parser.ts +0 -1
- package/src/completion-types.ts +0 -1
- package/src/completion.ts +80 -39
- package/src/editor/dgmo.grammar.js +18 -0
- package/src/editor/dgmo.grammar.terms.js +35 -0
- package/src/er/parser.ts +0 -1
- package/src/graph/flowchart-parser.ts +1 -1
- package/src/graph/flowchart-renderer.ts +19 -5
- package/src/graph/state-renderer.ts +19 -5
- package/src/infra/parser.ts +1 -1
- package/src/pert/parser.ts +0 -14
- package/src/raci/renderer.ts +8 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone DGMO syntax highlighter — no CodeMirror dependency.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `highlightDgmo(source)` → `HighlightToken[]` (consumer-agnostic)
|
|
6
|
+
* - `NORD_ROLE_STYLES` — inline style objects keyed by role (for React/Astro)
|
|
7
|
+
* - `ROLE_TO_ANSI` — ANSI escape codes keyed by role (for CLI)
|
|
8
|
+
*
|
|
9
|
+
* Uses the raw Lezer parser directly — keyword specialization is wired into
|
|
10
|
+
* the grammar, so `parser.parse()` runs it automatically.
|
|
11
|
+
*
|
|
12
|
+
* @module @diagrammo/dgmo/highlight
|
|
13
|
+
*/
|
|
14
|
+
interface HighlightToken {
|
|
15
|
+
text: string;
|
|
16
|
+
role: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tokenize DGMO source into annotated highlight spans.
|
|
20
|
+
*
|
|
21
|
+
* Guarantees lossless round-trip:
|
|
22
|
+
* `highlightDgmo(src).map(t => t.text).join('') === src`
|
|
23
|
+
*/
|
|
24
|
+
declare function highlightDgmo(source: string): HighlightToken[];
|
|
25
|
+
declare const NORD_ROLE_STYLES: Record<string, Record<string, string>>;
|
|
26
|
+
declare const ROLE_TO_ANSI: Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Render highlighted tokens to an ANSI string for terminal display.
|
|
29
|
+
*/
|
|
30
|
+
declare function renderAnsi(tokens: HighlightToken[], useColor: boolean): string;
|
|
31
|
+
|
|
32
|
+
export { type HighlightToken, NORD_ROLE_STYLES, ROLE_TO_ANSI, highlightDgmo, renderAnsi };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Standalone DGMO syntax highlighter — no CodeMirror dependency.
|
|
3
|
+
*
|
|
4
|
+
* Exports:
|
|
5
|
+
* - `highlightDgmo(source)` → `HighlightToken[]` (consumer-agnostic)
|
|
6
|
+
* - `NORD_ROLE_STYLES` — inline style objects keyed by role (for React/Astro)
|
|
7
|
+
* - `ROLE_TO_ANSI` — ANSI escape codes keyed by role (for CLI)
|
|
8
|
+
*
|
|
9
|
+
* Uses the raw Lezer parser directly — keyword specialization is wired into
|
|
10
|
+
* the grammar, so `parser.parse()` runs it automatically.
|
|
11
|
+
*
|
|
12
|
+
* @module @diagrammo/dgmo/highlight
|
|
13
|
+
*/
|
|
14
|
+
interface HighlightToken {
|
|
15
|
+
text: string;
|
|
16
|
+
role: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Tokenize DGMO source into annotated highlight spans.
|
|
20
|
+
*
|
|
21
|
+
* Guarantees lossless round-trip:
|
|
22
|
+
* `highlightDgmo(src).map(t => t.text).join('') === src`
|
|
23
|
+
*/
|
|
24
|
+
declare function highlightDgmo(source: string): HighlightToken[];
|
|
25
|
+
declare const NORD_ROLE_STYLES: Record<string, Record<string, string>>;
|
|
26
|
+
declare const ROLE_TO_ANSI: Record<string, string>;
|
|
27
|
+
/**
|
|
28
|
+
* Render highlighted tokens to an ANSI string for terminal display.
|
|
29
|
+
*/
|
|
30
|
+
declare function renderAnsi(tokens: HighlightToken[], useColor: boolean): string;
|
|
31
|
+
|
|
32
|
+
export { type HighlightToken, NORD_ROLE_STYLES, ROLE_TO_ANSI, highlightDgmo, renderAnsi };
|