@diagrammo/dgmo 0.50.1 → 0.50.2
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.d.ts +6578 -0
- package/dist/advanced.js +6 -6
- package/dist/auto.d.ts +54 -0
- package/dist/auto.js +103 -103
- package/dist/auto.mjs +99 -8
- package/dist/block.d.ts +130 -0
- package/dist/block.js +13 -7
- package/dist/{charts-d3-LR6D3D7A.js → charts-d3-MUW3LTML.js} +3 -3
- package/dist/{chunk-7PQYTZMA.js → chunk-5WFIYXQ6.js} +5 -5
- package/dist/{chunk-YIA4LEX4.js → chunk-DN66GPY5.js} +74 -3
- package/dist/{chunk-VVZRV54S.js → chunk-KQ57MHRO.js} +2 -2
- package/dist/{chunk-4S52SK6G.js → chunk-QJJZSROI.js} +10 -3
- package/dist/{chunk-ZAD4HV2G.js → chunk-SVTI362O.js} +9 -9
- package/dist/{chunk-Y4RNXEAO.js → chunk-T5SHNNGP.js} +81 -1
- package/dist/{chunk-XDXNDSKO.js → chunk-XEGTMVYY.js} +4 -1
- package/dist/cli.cjs +124 -124
- package/dist/{dgmo-router-YTU3ENAX.js → dgmo-router-CE2G67FV.js} +3 -3
- package/dist/element.d.ts +62 -0
- package/dist/element.js +100 -100
- package/dist/element.mjs +99 -8
- package/dist/index.d.ts +185 -0
- package/dist/index.js +7 -5
- package/dist/{renderer-72LGR2YF.js → renderer-5KVCNMOJ.js} +2 -2
- package/dist/{renderer-PJM35LJN.js → renderer-P5ROYQGU.js} +2 -2
- package/dist/themes-PdPR1-hC.d.ts +916 -0
- package/docs/language-reference.md +5 -0
- package/gallery/fixtures/countdown-far.dgmo +2 -0
- package/package.json +1 -1
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
looksLikeGantt,
|
|
10
10
|
parseDgmo,
|
|
11
11
|
parseDgmoChartType
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-KQ57MHRO.js";
|
|
13
13
|
import "./chunk-Q4V4XQWV.js";
|
|
14
14
|
import "./chunk-BTUTZMPT.js";
|
|
15
15
|
import "./chunk-YNRDWYZP.js";
|
|
@@ -18,7 +18,7 @@ import "./chunk-QXKWYZNR.js";
|
|
|
18
18
|
import "./chunk-PGEGPSCZ.js";
|
|
19
19
|
import "./chunk-3UIKSPFB.js";
|
|
20
20
|
import "./chunk-BDXC7MDK.js";
|
|
21
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-XEGTMVYY.js";
|
|
22
22
|
import "./chunk-I2WKW7C7.js";
|
|
23
23
|
import "./chunk-TSA237IM.js";
|
|
24
24
|
import "./chunk-6IAA2QQ2.js";
|
|
@@ -81,4 +81,4 @@ export {
|
|
|
81
81
|
parseDgmo,
|
|
82
82
|
parseDgmoChartType
|
|
83
83
|
};
|
|
84
|
-
//# sourceMappingURL=dgmo-router-
|
|
84
|
+
//# sourceMappingURL=dgmo-router-CE2G67FV.js.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@diagrammo/dgmo/element` — the universal `<dgmo-diagram>` custom element.
|
|
3
|
+
*
|
|
4
|
+
* A mermaid-style, framework-agnostic client-side web component. Drop the
|
|
5
|
+
* IIFE script (`dist/element.js`) on ANY page — Hugo, Jekyll, MkDocs,
|
|
6
|
+
* VitePress, plain HTML — and author diagrams as:
|
|
7
|
+
*
|
|
8
|
+
* ```html
|
|
9
|
+
* <script src="https://unpkg.com/@diagrammo/dgmo/dist/element.js"></script>
|
|
10
|
+
* <dgmo-diagram palette="nord">
|
|
11
|
+
* flowchart
|
|
12
|
+
* [Start] -> [Done]
|
|
13
|
+
* </dgmo-diagram>
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* The element reads its DGMO source (a nested `<script type="text/dgmo">`,
|
|
17
|
+
* a `<pre>`, or its own text content — de-indented), calls the isomorphic
|
|
18
|
+
* `render()`, sanitizes the SVG, and injects it. Attributes: `palette`,
|
|
19
|
+
* `theme`/`color-mode`, `mode` (diagram|showcase), `editor-base`,
|
|
20
|
+
* `map-data-base`.
|
|
21
|
+
*
|
|
22
|
+
* DOM strategy — **light DOM** (not shadow DOM). Rationale: the rendered
|
|
23
|
+
* SVG, source panel, and syntax-highlight token classes are all styled by
|
|
24
|
+
* the shared `auto.css` (injected once via `ensureStyles()`). Cloning that
|
|
25
|
+
* whole stylesheet into every shadow root would be heavy and would break
|
|
26
|
+
* the `.dgmo-tok-*` highlight hooks; the CSS is already namespaced under
|
|
27
|
+
* `.dgmo-*` so collision risk is low. See the CLAUDE.md embed notes.
|
|
28
|
+
*
|
|
29
|
+
* Map-data seam — the base bundle never statically imports the ~380 KB geo
|
|
30
|
+
* JSON. Only when a diagram's first token is `map` does the element
|
|
31
|
+
* lazy-`fetch()` the map assets from `map-data-base` (default: the pinned
|
|
32
|
+
* unpkg `dist/map-data/` path) and inject them as `render({ mapData })`.
|
|
33
|
+
* Fetched data is cached across every element on the page. Non-map diagrams
|
|
34
|
+
* trigger ZERO extra network requests.
|
|
35
|
+
*/
|
|
36
|
+
|
|
37
|
+
declare class DgmoDiagram extends HTMLElement {
|
|
38
|
+
static get observedAttributes(): readonly string[];
|
|
39
|
+
/** DGMO source, captured from the original children ONCE before the first
|
|
40
|
+
* render replaces them. */
|
|
41
|
+
private source;
|
|
42
|
+
/** Monotonic render token — a late-resolving render/fetch whose token is
|
|
43
|
+
* stale (superseded by a newer attribute-driven render) is discarded. */
|
|
44
|
+
private renderToken;
|
|
45
|
+
private container;
|
|
46
|
+
connectedCallback(): void;
|
|
47
|
+
attributeChangedCallback(_name: string, oldValue: string | null, newValue: string | null): void;
|
|
48
|
+
private readSource;
|
|
49
|
+
private themePreference;
|
|
50
|
+
private palette;
|
|
51
|
+
private editorBase;
|
|
52
|
+
private mapDataBase;
|
|
53
|
+
private isShowcase;
|
|
54
|
+
private mount;
|
|
55
|
+
private showError;
|
|
56
|
+
private rerender;
|
|
57
|
+
}
|
|
58
|
+
/** Idempotently define `<dgmo-diagram>`. Safe to call multiple times and in
|
|
59
|
+
* SSR/no-DOM contexts (no-ops when `customElements` is unavailable). */
|
|
60
|
+
declare function defineDgmoDiagram(): void;
|
|
61
|
+
|
|
62
|
+
export { DgmoDiagram, DgmoDiagram as default, defineDgmoDiagram };
|