@diagrammo/dgmo 0.21.1 → 0.23.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 +16 -6
- package/dist/advanced.cjs +2230 -503
- package/dist/advanced.d.cts +5731 -0
- package/dist/advanced.d.ts +5731 -0
- package/dist/advanced.js +2226 -503
- package/dist/auto.cjs +2272 -479
- package/dist/auto.d.cts +39 -0
- package/dist/auto.d.ts +39 -0
- package/dist/auto.js +124 -124
- package/dist/auto.mjs +2274 -480
- package/dist/cli.cjs +170 -170
- package/dist/editor.cjs +16 -16
- package/dist/editor.js +16 -16
- package/dist/highlight.cjs +18 -13
- package/dist/highlight.js +18 -13
- package/dist/index.cjs +2253 -465
- package/dist/index.d.cts +339 -0
- package/dist/index.d.ts +339 -0
- package/dist/index.js +2255 -466
- package/dist/internal.cjs +2230 -503
- package/dist/internal.d.cts +5731 -0
- package/dist/internal.d.ts +5731 -0
- package/dist/internal.js +2226 -503
- package/dist/map-data/PROVENANCE.json +1 -1
- package/dist/map-data/gazetteer.json +1 -1
- package/dist/map-data/mountain-ranges.json +1 -1
- package/dist/map-data/water-bodies.json +1 -0
- package/dist/map-data/world-coarse.json +1 -1
- package/dist/map-data/world-detail.json +1 -1
- package/docs/language-reference.md +55 -9
- package/gallery/fixtures/boxes-and-lines.dgmo +6 -4
- package/gallery/fixtures/map-categorical-world.dgmo +16 -0
- package/gallery/fixtures/map-categorical.dgmo +0 -1
- package/gallery/fixtures/map-choropleth.dgmo +0 -1
- package/gallery/fixtures/map-coastline.dgmo +7 -0
- package/gallery/fixtures/map-colorize.dgmo +11 -0
- package/gallery/fixtures/map-direct-color.dgmo +0 -1
- package/gallery/fixtures/map-reference-world.dgmo +11 -0
- package/gallery/fixtures/map-region-scope.dgmo +0 -3
- package/gallery/fixtures/map-route.dgmo +0 -1
- package/package.json +1 -1
- package/src/advanced.ts +12 -1
- package/src/boxes-and-lines/parser.ts +39 -0
- package/src/boxes-and-lines/renderer.ts +205 -20
- package/src/boxes-and-lines/types.ts +9 -0
- package/src/cli.ts +1 -1
- package/src/completion.ts +36 -30
- package/src/cycle/renderer.ts +14 -1
- package/src/d3.ts +20 -6
- package/src/editor/highlight-api.ts +4 -0
- package/src/editor/keywords.ts +16 -16
- package/src/infra/renderer.ts +35 -7
- package/src/map/colorize.ts +54 -0
- package/src/map/context-labels.ts +429 -0
- package/src/map/data/PROVENANCE.json +1 -1
- package/src/map/data/README.md +6 -0
- package/src/map/data/gazetteer.json +1 -1
- package/src/map/data/mountain-ranges.json +1 -1
- package/src/map/data/types.ts +34 -0
- package/src/map/data/water-bodies.json +1 -0
- package/src/map/data/world-coarse.json +1 -1
- package/src/map/data/world-detail.json +1 -1
- package/src/map/dimensions.ts +117 -0
- package/src/map/geo-query.ts +21 -3
- package/src/map/geo.ts +47 -1
- package/src/map/layout.ts +1408 -266
- package/src/map/load-data.ts +10 -2
- package/src/map/parser.ts +42 -116
- package/src/map/renderer.ts +604 -14
- package/src/map/resolved-types.ts +16 -2
- package/src/map/resolver.ts +208 -59
- package/src/map/types.ts +30 -32
- package/src/mindmap/renderer.ts +10 -1
- package/src/palettes/atlas.ts +77 -0
- package/src/palettes/blueprint.ts +73 -0
- package/src/palettes/color-utils.ts +58 -1
- package/src/palettes/index.ts +12 -3
- package/src/palettes/slate.ts +73 -0
- package/src/palettes/tidewater.ts +73 -0
- package/src/render.ts +8 -1
- package/src/tech-radar/renderer.ts +3 -0
- package/src/tech-radar/types.ts +3 -0
- package/src/utils/d3-types.ts +5 -0
- package/src/utils/legend-layout.ts +21 -4
- package/src/utils/legend-types.ts +7 -0
- package/src/utils/reserved-key-registry.ts +8 -3
- package/src/palettes/bold.ts +0 -67
package/dist/auto.d.cts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@diagrammo/dgmo/auto` — IIFE-distributed auto-renderer for static HTML.
|
|
3
|
+
*
|
|
4
|
+
* Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
|
|
5
|
+
* this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
|
|
6
|
+
* replaces each match with `<div class="dgmo-rendered">` containing the
|
|
7
|
+
* SVG plus an optional collapsible source panel with Copy and
|
|
8
|
+
* "Open in editor" actions.
|
|
9
|
+
*
|
|
10
|
+
* Public API: frozen `window.dgmo` and alias `window.diagrammo` with
|
|
11
|
+
* `{ initialize, run, version }`. Configuration is read from the
|
|
12
|
+
* bundle's own `<script data-config='{…}'>` (JSON with strict
|
|
13
|
+
* allowlist) or via `dgmo.initialize(opts)` for `data-auto="false"`
|
|
14
|
+
* embedders.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface AutoConfig {
|
|
18
|
+
theme?: 'auto' | 'light' | 'dark' | 'transparent';
|
|
19
|
+
palette?: string;
|
|
20
|
+
showSource?: boolean;
|
|
21
|
+
showEditorLink?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface RunOptions {
|
|
24
|
+
nodes?: Element[] | NodeListOf<Element>;
|
|
25
|
+
}
|
|
26
|
+
declare const VERSION: string;
|
|
27
|
+
declare function findScriptTag(): HTMLScriptElement | null;
|
|
28
|
+
declare function parseConfig(raw: string | null | undefined): Partial<AutoConfig>;
|
|
29
|
+
declare function selectTargets(root?: ParentNode): Element[];
|
|
30
|
+
declare function resolveTheme(theme: AutoConfig['theme']): 'light' | 'dark' | 'transparent';
|
|
31
|
+
declare function initialize(opts?: AutoConfig): void;
|
|
32
|
+
declare function run(opts?: RunOptions): Promise<void>;
|
|
33
|
+
declare const api: Readonly<{
|
|
34
|
+
initialize: typeof initialize;
|
|
35
|
+
run: typeof run;
|
|
36
|
+
version: string;
|
|
37
|
+
}>;
|
|
38
|
+
|
|
39
|
+
export { type AutoConfig, type RunOptions, VERSION, api as default, findScriptTag, initialize, parseConfig, resolveTheme, run, selectTargets };
|
package/dist/auto.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@diagrammo/dgmo/auto` — IIFE-distributed auto-renderer for static HTML.
|
|
3
|
+
*
|
|
4
|
+
* Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
|
|
5
|
+
* this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
|
|
6
|
+
* replaces each match with `<div class="dgmo-rendered">` containing the
|
|
7
|
+
* SVG plus an optional collapsible source panel with Copy and
|
|
8
|
+
* "Open in editor" actions.
|
|
9
|
+
*
|
|
10
|
+
* Public API: frozen `window.dgmo` and alias `window.diagrammo` with
|
|
11
|
+
* `{ initialize, run, version }`. Configuration is read from the
|
|
12
|
+
* bundle's own `<script data-config='{…}'>` (JSON with strict
|
|
13
|
+
* allowlist) or via `dgmo.initialize(opts)` for `data-auto="false"`
|
|
14
|
+
* embedders.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
interface AutoConfig {
|
|
18
|
+
theme?: 'auto' | 'light' | 'dark' | 'transparent';
|
|
19
|
+
palette?: string;
|
|
20
|
+
showSource?: boolean;
|
|
21
|
+
showEditorLink?: boolean;
|
|
22
|
+
}
|
|
23
|
+
interface RunOptions {
|
|
24
|
+
nodes?: Element[] | NodeListOf<Element>;
|
|
25
|
+
}
|
|
26
|
+
declare const VERSION: string;
|
|
27
|
+
declare function findScriptTag(): HTMLScriptElement | null;
|
|
28
|
+
declare function parseConfig(raw: string | null | undefined): Partial<AutoConfig>;
|
|
29
|
+
declare function selectTargets(root?: ParentNode): Element[];
|
|
30
|
+
declare function resolveTheme(theme: AutoConfig['theme']): 'light' | 'dark' | 'transparent';
|
|
31
|
+
declare function initialize(opts?: AutoConfig): void;
|
|
32
|
+
declare function run(opts?: RunOptions): Promise<void>;
|
|
33
|
+
declare const api: Readonly<{
|
|
34
|
+
initialize: typeof initialize;
|
|
35
|
+
run: typeof run;
|
|
36
|
+
version: string;
|
|
37
|
+
}>;
|
|
38
|
+
|
|
39
|
+
export { type AutoConfig, type RunOptions, VERSION, api as default, findScriptTag, initialize, parseConfig, resolveTheme, run, selectTargets };
|