@diagrammo/dgmo 0.45.0 → 0.46.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 +31 -25
- package/dist/advanced.js +31 -25
- package/dist/auto.cjs +500 -341
- package/dist/auto.css +342 -159
- package/dist/auto.d.cts +10 -8
- package/dist/auto.d.ts +10 -8
- package/dist/auto.js +373 -265
- package/dist/auto.mjs +500 -341
- package/dist/block.cjs +31 -25
- package/dist/block.js +31 -25
- package/dist/cli.cjs +112 -112
- package/dist/element.cjs +492 -325
- package/dist/element.js +367 -259
- package/dist/element.mjs +492 -325
- package/dist/index.cjs +31 -25
- package/dist/index.js +31 -25
- package/package.json +1 -1
- package/src/auto/index.ts +55 -57
- package/src/auto/shared.ts +142 -142
- package/src/auto/styles.ts +44 -199
- package/src/c4/renderer.ts +2 -2
- package/src/element/index.ts +29 -21
- package/src/infra/renderer.ts +1 -1
- package/src/render.ts +34 -14
- package/src/sitemap/renderer.ts +1 -1
- package/src/timeline/renderer.ts +1 -1
- package/src/utils/hover-styles.ts +6 -1
- package/src/utils/legend-d3.ts +1 -4
- package/src/utils/legend-svg.ts +1 -1
package/dist/auto.css
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/* anti-flash: hide source elements until either render swaps them out
|
|
2
|
-
or the error path
|
|
2
|
+
or the error path replaces them with the standard error card */
|
|
3
3
|
pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
4
|
-
.dgmo:not(svg *):not(.dgmo-rendered):not(.dgmo-rendered *) {
|
|
4
|
+
.dgmo:not(svg *):not(.dgmo-rendered):not(.dgmo-rendered *):not(.dgmo--error):not(.dgmo--error *) {
|
|
5
5
|
visibility: hidden;
|
|
6
6
|
}
|
|
7
7
|
.dgmo-rendered, .dgmo-rendered *,
|
|
8
|
-
.dgmo
|
|
8
|
+
.dgmo--error, .dgmo--error * {
|
|
9
9
|
visibility: visible !important;
|
|
10
10
|
}
|
|
11
11
|
|
|
@@ -19,196 +19,379 @@ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
|
|
|
19
19
|
line-height: 1.4;
|
|
20
20
|
color-scheme: light dark;
|
|
21
21
|
}
|
|
22
|
-
|
|
22
|
+
|
|
23
|
+
.dgmo--loading {
|
|
24
|
+
opacity: 0.6;
|
|
25
|
+
font-size: 12px;
|
|
26
|
+
font-family: ui-monospace, monospace;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/* @diagrammo/dgmo block — standard embed chrome.
|
|
30
|
+
* Override the [data-theme="dark"] selectors if your site uses .dark or
|
|
31
|
+
* another color-mode convention. */
|
|
32
|
+
|
|
33
|
+
/* === Color-mode visibility (dual-render) === */
|
|
34
|
+
.dgmo-dark {
|
|
35
|
+
display: none;
|
|
36
|
+
}
|
|
37
|
+
[data-theme="dark"] .dgmo-light {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
[data-theme="dark"] .dgmo-dark {
|
|
23
41
|
display: block;
|
|
24
|
-
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* === Diagram sizing ===
|
|
45
|
+
* SVGs are emitted with viewBox only (no fixed width/height). Force them to
|
|
46
|
+
* fill their wrapper so light and dark variants render at identical sizes. */
|
|
47
|
+
.dgmo-light > svg,
|
|
48
|
+
.dgmo-dark > svg,
|
|
49
|
+
.dgmo-svg > svg {
|
|
50
|
+
display: block;
|
|
51
|
+
width: 100%;
|
|
25
52
|
height: auto;
|
|
53
|
+
max-width: 100%;
|
|
26
54
|
}
|
|
27
55
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
56
|
+
/* === Toolbar ===
|
|
57
|
+
* The diagram is the star: the toolbar is a slim reserved row below the SVG
|
|
58
|
+
* (height always in flow — no layout shift) that stays fully transparent
|
|
59
|
+
* until the block is hovered or focused, or the source panel is open. It is
|
|
60
|
+
* the <summary> of the source <details>, so toggling works without any JS.
|
|
61
|
+
* No text labels, no disclosure triangle — three wordless icon buttons. */
|
|
62
|
+
.dgmo-source-wrap {
|
|
63
|
+
margin: 0;
|
|
64
|
+
}
|
|
65
|
+
.dgmo-toolbar {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
justify-content: flex-end;
|
|
69
|
+
gap: 0.25em;
|
|
70
|
+
min-height: 1.9em;
|
|
71
|
+
padding: 0.15em 0;
|
|
72
|
+
opacity: 0;
|
|
73
|
+
transition: opacity 0.15s ease;
|
|
74
|
+
cursor: pointer;
|
|
75
|
+
list-style: none;
|
|
76
|
+
user-select: none;
|
|
77
|
+
color: rgba(127, 127, 127, 0.9);
|
|
78
|
+
}
|
|
79
|
+
.dgmo-toolbar::-webkit-details-marker {
|
|
80
|
+
display: none;
|
|
81
|
+
}
|
|
82
|
+
/* Reveal is keyed to the diagram IMAGE (the svg wrappers), not the whole
|
|
83
|
+
* figure — hovering the open code panel keeps the page quiet. The toolbar's
|
|
84
|
+
* own :hover keeps it alive while the pointer travels down from the image
|
|
85
|
+
* (they're adjacent, so there's no dead gap). focus-within covers keyboard
|
|
86
|
+
* and touch-tap. */
|
|
87
|
+
.dgmo-light:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
|
|
88
|
+
.dgmo-dark:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
|
|
89
|
+
.dgmo-svg:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
|
|
90
|
+
.dgmo-toolbar:hover,
|
|
91
|
+
.dgmo:focus-within .dgmo-toolbar {
|
|
92
|
+
opacity: 1;
|
|
93
|
+
}
|
|
94
|
+
/* Touch devices have no hover: keep the icons faintly visible so the
|
|
95
|
+
* affordance is discoverable at all. */
|
|
96
|
+
@media (hover: none) {
|
|
97
|
+
.dgmo-toolbar {
|
|
98
|
+
opacity: 0.5;
|
|
99
|
+
}
|
|
31
100
|
}
|
|
32
101
|
|
|
33
|
-
.dgmo-
|
|
102
|
+
.dgmo-toggle,
|
|
103
|
+
.dgmo-toolbar-btn {
|
|
34
104
|
display: inline-flex;
|
|
35
105
|
align-items: center;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
padding: 4px 6px;
|
|
42
|
-
background: transparent;
|
|
106
|
+
justify-content: center;
|
|
107
|
+
width: 1.9em;
|
|
108
|
+
height: 1.9em;
|
|
109
|
+
border-radius: 0.35em;
|
|
110
|
+
background: none;
|
|
43
111
|
border: 0;
|
|
44
|
-
|
|
45
|
-
font-size: 11px;
|
|
46
|
-
font-weight: 500;
|
|
47
|
-
letter-spacing: 0.02em;
|
|
48
|
-
text-align: left;
|
|
49
|
-
cursor: pointer;
|
|
112
|
+
padding: 0;
|
|
50
113
|
color: inherit;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
transition:
|
|
114
|
+
cursor: pointer;
|
|
115
|
+
opacity: 0.75;
|
|
116
|
+
transition:
|
|
117
|
+
opacity 0.15s ease,
|
|
118
|
+
background-color 0.15s ease;
|
|
119
|
+
}
|
|
120
|
+
.dgmo-toggle:hover,
|
|
121
|
+
.dgmo-toolbar-btn:hover {
|
|
122
|
+
opacity: 1;
|
|
123
|
+
background: rgba(127, 127, 127, 0.12);
|
|
54
124
|
}
|
|
55
|
-
.dgmo-
|
|
56
|
-
|
|
57
|
-
|
|
125
|
+
.dgmo-toggle svg,
|
|
126
|
+
.dgmo-toolbar-btn svg {
|
|
127
|
+
width: 1em;
|
|
128
|
+
height: 1em;
|
|
58
129
|
}
|
|
59
|
-
|
|
130
|
+
/* Active state while the source panel is open. */
|
|
131
|
+
.dgmo-source-wrap[open] > .dgmo-toolbar .dgmo-toggle {
|
|
132
|
+
opacity: 1;
|
|
133
|
+
background: rgba(127, 127, 127, 0.15);
|
|
134
|
+
}
|
|
135
|
+
.dgmo-copy--success {
|
|
136
|
+
color: #5cba7a;
|
|
60
137
|
opacity: 1;
|
|
61
|
-
outline: 2px solid currentColor;
|
|
62
|
-
outline-offset: 1px;
|
|
63
|
-
}
|
|
64
|
-
.dgmo-source-toggle[aria-expanded="true"] {
|
|
65
|
-
opacity: 0.7;
|
|
66
|
-
}
|
|
67
|
-
.dgmo-source-toggle .dgmo-chevron {
|
|
68
|
-
display: inline-block;
|
|
69
|
-
width: 8px;
|
|
70
|
-
height: 8px;
|
|
71
|
-
font-size: 8px;
|
|
72
|
-
line-height: 1;
|
|
73
|
-
transition: transform 150ms ease-out;
|
|
74
|
-
}
|
|
75
|
-
.dgmo-source-toggle[aria-expanded="true"] .dgmo-chevron {
|
|
76
|
-
transform: rotate(90deg);
|
|
77
|
-
}
|
|
78
|
-
@media (pointer: coarse) {
|
|
79
|
-
/* Larger hit area on touch devices without making the visible
|
|
80
|
-
toggle bigger on the desktop. */
|
|
81
|
-
.dgmo-source-toggle {
|
|
82
|
-
min-height: 44px;
|
|
83
|
-
padding: 12px 10px;
|
|
84
|
-
}
|
|
85
138
|
}
|
|
86
139
|
|
|
87
|
-
|
|
140
|
+
/* === Open state: frame the whole block ===
|
|
141
|
+
* When the source panel is open, diagram + toolbar + code get one shared
|
|
142
|
+
* border so the code visibly belongs to the chart above it, not to the
|
|
143
|
+
* surrounding prose. Closed blocks stay frameless. */
|
|
144
|
+
.dgmo:has(> .dgmo-source-wrap[open]) {
|
|
145
|
+
border: 1px solid rgba(127, 127, 127, 0.3);
|
|
146
|
+
border-radius: 0.6em;
|
|
147
|
+
padding: 0.75em 0.75em 0.5em;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* === Source panel (hidden until toggled) === */
|
|
151
|
+
.dgmo-source-inner {
|
|
152
|
+
border-top: 1px solid rgba(127, 127, 127, 0.25);
|
|
153
|
+
background: rgba(127, 127, 127, 0.06);
|
|
88
154
|
overflow: hidden;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
position: relative;
|
|
155
|
+
margin: 0 -0.75em -0.5em;
|
|
156
|
+
border-radius: 0 0 0.6em 0.6em;
|
|
92
157
|
}
|
|
93
|
-
.dgmo-
|
|
94
|
-
|
|
95
|
-
overflow: auto;
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
158
|
+
.dgmo-pre {
|
|
159
|
+
white-space: pre;
|
|
160
|
+
overflow-x: auto;
|
|
161
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
162
|
+
font-size: 0.85em;
|
|
163
|
+
line-height: 1.5;
|
|
164
|
+
margin: 0;
|
|
165
|
+
padding: 1em;
|
|
99
166
|
}
|
|
100
|
-
.dgmo-
|
|
101
|
-
|
|
167
|
+
.dgmo-code {
|
|
168
|
+
display: block;
|
|
102
169
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
170
|
+
|
|
171
|
+
/* === Error card === */
|
|
172
|
+
.dgmo--error {
|
|
173
|
+
border: 1px solid rgba(220, 80, 80, 0.5);
|
|
174
|
+
border-radius: 0.5em;
|
|
175
|
+
padding: 0.75em 1em;
|
|
176
|
+
}
|
|
177
|
+
.dgmo--error pre {
|
|
110
178
|
white-space: pre;
|
|
111
|
-
overflow: auto;
|
|
112
|
-
|
|
113
|
-
|
|
179
|
+
overflow-x: auto;
|
|
180
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
181
|
+
font-size: 0.85em;
|
|
182
|
+
margin: 0.5em 0 0;
|
|
114
183
|
}
|
|
115
184
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
/* Inherit visibility:hidden when collapsed; pointer-events:none keeps
|
|
123
|
-
them off the tab order until the panel opens. */
|
|
124
|
-
pointer-events: none;
|
|
185
|
+
/* === Source highlight roles ===
|
|
186
|
+
* Light values mirror LIGHT_ROLE_STYLES; dark overrides mirror
|
|
187
|
+
* NORD_ROLE_STYLES. Guarded by the parity test in tests/block.test.ts. */
|
|
188
|
+
.dgmo-tok-keyword {
|
|
189
|
+
color: #3b6ea5;
|
|
190
|
+
font-weight: bold;
|
|
125
191
|
}
|
|
126
|
-
.dgmo-
|
|
127
|
-
|
|
192
|
+
.dgmo-tok-controlKeyword {
|
|
193
|
+
color: #7d5ba6;
|
|
194
|
+
font-weight: bold;
|
|
128
195
|
}
|
|
129
|
-
.dgmo-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
justify-content: center;
|
|
133
|
-
width: 26px;
|
|
134
|
-
height: 26px;
|
|
135
|
-
padding: 0;
|
|
136
|
-
background: transparent;
|
|
137
|
-
color: inherit;
|
|
138
|
-
border: 0;
|
|
139
|
-
border-radius: 3px;
|
|
140
|
-
cursor: pointer;
|
|
141
|
-
text-decoration: none;
|
|
142
|
-
opacity: 0.4;
|
|
143
|
-
transition: opacity 120ms ease, background 120ms ease, color 120ms ease;
|
|
196
|
+
.dgmo-tok-definitionKeyword {
|
|
197
|
+
color: #2f5a86;
|
|
198
|
+
font-weight: bold;
|
|
144
199
|
}
|
|
145
|
-
.dgmo-
|
|
146
|
-
|
|
147
|
-
background: rgba(127, 127, 127, 0.15);
|
|
200
|
+
.dgmo-tok-modifier {
|
|
201
|
+
color: #7d5ba6;
|
|
148
202
|
}
|
|
149
|
-
.dgmo-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
outline-offset: 1px;
|
|
203
|
+
.dgmo-tok-chartType {
|
|
204
|
+
color: #b8691f;
|
|
205
|
+
font-weight: bold;
|
|
153
206
|
}
|
|
154
|
-
.dgmo-
|
|
155
|
-
|
|
156
|
-
|
|
207
|
+
.dgmo-tok-operator {
|
|
208
|
+
color: #c0504d;
|
|
209
|
+
font-weight: bold;
|
|
157
210
|
}
|
|
158
|
-
.dgmo-
|
|
159
|
-
|
|
211
|
+
.dgmo-tok-number {
|
|
212
|
+
color: #7d5ba6;
|
|
160
213
|
}
|
|
161
|
-
.dgmo-
|
|
162
|
-
|
|
163
|
-
|
|
214
|
+
.dgmo-tok-comment {
|
|
215
|
+
color: #677483;
|
|
216
|
+
font-style: italic;
|
|
164
217
|
}
|
|
165
|
-
.dgmo-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
218
|
+
.dgmo-tok-heading {
|
|
219
|
+
color: #b8691f;
|
|
220
|
+
font-weight: bold;
|
|
221
|
+
}
|
|
222
|
+
.dgmo-tok-bracket {
|
|
223
|
+
color: #5b6672;
|
|
224
|
+
}
|
|
225
|
+
.dgmo-tok-separator {
|
|
226
|
+
color: #2d7268;
|
|
227
|
+
}
|
|
228
|
+
.dgmo-tok-deprecatedSyntax {
|
|
229
|
+
color: #c0504d;
|
|
230
|
+
text-decoration: line-through;
|
|
231
|
+
}
|
|
232
|
+
.dgmo-tok-url {
|
|
233
|
+
color: #3b6ea5;
|
|
234
|
+
text-decoration: underline;
|
|
235
|
+
}
|
|
236
|
+
.dgmo-tok-colorAnnotation {
|
|
237
|
+
color: #b8691f;
|
|
238
|
+
font-style: italic;
|
|
239
|
+
}
|
|
240
|
+
.dgmo-tok-punctuation {
|
|
241
|
+
color: #677483;
|
|
242
|
+
}
|
|
243
|
+
.dgmo-tok-propertyName {
|
|
244
|
+
color: #2d7268;
|
|
245
|
+
}
|
|
246
|
+
.dgmo-tok-string {
|
|
247
|
+
color: #3f7a3b;
|
|
248
|
+
}
|
|
249
|
+
.dgmo-tok-noteContent {
|
|
250
|
+
color: #677483;
|
|
251
|
+
font-style: italic;
|
|
169
252
|
}
|
|
170
253
|
|
|
171
|
-
.dgmo-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
padding: 10px 14px;
|
|
175
|
-
border-left: 4px solid #c44;
|
|
176
|
-
background: rgba(204, 68, 68, 0.08);
|
|
177
|
-
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
|
178
|
-
font-size: 13px;
|
|
179
|
-
line-height: 1.4;
|
|
180
|
-
color: inherit;
|
|
181
|
-
border-radius: 0 4px 4px 0;
|
|
254
|
+
[data-theme="dark"] .dgmo-tok-keyword {
|
|
255
|
+
color: #81a1c1;
|
|
256
|
+
font-weight: bold;
|
|
182
257
|
}
|
|
183
|
-
.dgmo-
|
|
184
|
-
|
|
185
|
-
|
|
258
|
+
[data-theme="dark"] .dgmo-tok-controlKeyword {
|
|
259
|
+
color: #b48ead;
|
|
260
|
+
font-weight: bold;
|
|
186
261
|
}
|
|
187
|
-
.dgmo-
|
|
188
|
-
|
|
189
|
-
font-
|
|
190
|
-
|
|
262
|
+
[data-theme="dark"] .dgmo-tok-definitionKeyword {
|
|
263
|
+
color: #5e81ac;
|
|
264
|
+
font-weight: bold;
|
|
265
|
+
}
|
|
266
|
+
[data-theme="dark"] .dgmo-tok-modifier {
|
|
267
|
+
color: #b48ead;
|
|
268
|
+
}
|
|
269
|
+
[data-theme="dark"] .dgmo-tok-chartType {
|
|
270
|
+
color: #d08770;
|
|
271
|
+
font-weight: bold;
|
|
272
|
+
}
|
|
273
|
+
[data-theme="dark"] .dgmo-tok-operator {
|
|
274
|
+
color: #bf616a;
|
|
275
|
+
font-weight: bold;
|
|
276
|
+
}
|
|
277
|
+
[data-theme="dark"] .dgmo-tok-number {
|
|
278
|
+
color: #b48ead;
|
|
279
|
+
}
|
|
280
|
+
[data-theme="dark"] .dgmo-tok-comment {
|
|
281
|
+
color: #616e88;
|
|
282
|
+
font-style: italic;
|
|
283
|
+
}
|
|
284
|
+
[data-theme="dark"] .dgmo-tok-heading {
|
|
285
|
+
color: #d08770;
|
|
286
|
+
font-weight: bold;
|
|
287
|
+
}
|
|
288
|
+
[data-theme="dark"] .dgmo-tok-bracket {
|
|
289
|
+
color: #5e81ac;
|
|
290
|
+
}
|
|
291
|
+
[data-theme="dark"] .dgmo-tok-separator {
|
|
292
|
+
color: #88c0d0;
|
|
293
|
+
}
|
|
294
|
+
[data-theme="dark"] .dgmo-tok-deprecatedSyntax {
|
|
295
|
+
color: #bf616a;
|
|
296
|
+
text-decoration: line-through;
|
|
297
|
+
}
|
|
298
|
+
[data-theme="dark"] .dgmo-tok-url {
|
|
299
|
+
color: #88c0d0;
|
|
300
|
+
text-decoration: underline;
|
|
301
|
+
}
|
|
302
|
+
[data-theme="dark"] .dgmo-tok-colorAnnotation {
|
|
303
|
+
color: #d08770;
|
|
304
|
+
font-style: italic;
|
|
305
|
+
}
|
|
306
|
+
[data-theme="dark"] .dgmo-tok-punctuation {
|
|
307
|
+
color: #616e88;
|
|
308
|
+
}
|
|
309
|
+
[data-theme="dark"] .dgmo-tok-propertyName {
|
|
310
|
+
color: #88c0d0;
|
|
311
|
+
}
|
|
312
|
+
[data-theme="dark"] .dgmo-tok-string {
|
|
313
|
+
color: #a3be8c;
|
|
314
|
+
}
|
|
315
|
+
[data-theme="dark"] .dgmo-tok-noteContent {
|
|
316
|
+
color: #616e88;
|
|
317
|
+
font-style: italic;
|
|
191
318
|
}
|
|
192
319
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
.dgmo-source-pre .dgmo-tok-controlKeyword { color: #b48ead; font-weight: 600; }
|
|
196
|
-
.dgmo-source-pre .dgmo-tok-definitionKeyword { color: #5e81ac; font-weight: 600; }
|
|
197
|
-
.dgmo-source-pre .dgmo-tok-modifier { color: #b48ead; }
|
|
198
|
-
.dgmo-source-pre .dgmo-tok-chartType { color: #d08770; font-weight: 600; }
|
|
199
|
-
.dgmo-source-pre .dgmo-tok-operator { color: #bf616a; font-weight: 600; }
|
|
200
|
-
.dgmo-source-pre .dgmo-tok-number { color: #b48ead; }
|
|
201
|
-
.dgmo-source-pre .dgmo-tok-comment { color: #6c7a96; font-style: italic; }
|
|
202
|
-
.dgmo-source-pre .dgmo-tok-heading { color: #d08770; font-weight: 600; }
|
|
203
|
-
.dgmo-source-pre .dgmo-tok-bracket { color: #5e81ac; }
|
|
204
|
-
.dgmo-source-pre .dgmo-tok-separator { color: #88c0d0; }
|
|
205
|
-
.dgmo-source-pre .dgmo-tok-url { color: #88c0d0; text-decoration: underline; }
|
|
206
|
-
.dgmo-source-pre .dgmo-tok-colorAnnotation { color: #d08770; font-style: italic; }
|
|
207
|
-
.dgmo-source-pre .dgmo-tok-punctuation { color: #6c7a96; }
|
|
208
|
-
.dgmo-source-pre .dgmo-tok-noteContent { color: #6c7a96; font-style: italic; }
|
|
320
|
+
.dgmo-theme-dark selectors if your site uses .dark or
|
|
321
|
+
* another color-mode convention. */
|
|
209
322
|
|
|
210
|
-
|
|
211
|
-
.dgmo-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
.dgmo-
|
|
323
|
+
/* === Color-mode visibility (dual-render) === */
|
|
324
|
+
.dgmo-dark {
|
|
325
|
+
display: none;
|
|
326
|
+
}
|
|
327
|
+
.dgmo-theme-dark .dgmo-light {
|
|
328
|
+
display: none;
|
|
329
|
+
}
|
|
330
|
+
.dgmo-theme-dark .dgmo-dark {
|
|
331
|
+
display: block;
|
|
332
|
+
}
|
|
333
|
+
.dgmo-theme-dark .dgmo-tok-keyword {
|
|
334
|
+
color: #81a1c1;
|
|
335
|
+
font-weight: bold;
|
|
336
|
+
}
|
|
337
|
+
.dgmo-theme-dark .dgmo-tok-controlKeyword {
|
|
338
|
+
color: #b48ead;
|
|
339
|
+
font-weight: bold;
|
|
340
|
+
}
|
|
341
|
+
.dgmo-theme-dark .dgmo-tok-definitionKeyword {
|
|
342
|
+
color: #5e81ac;
|
|
343
|
+
font-weight: bold;
|
|
344
|
+
}
|
|
345
|
+
.dgmo-theme-dark .dgmo-tok-modifier {
|
|
346
|
+
color: #b48ead;
|
|
347
|
+
}
|
|
348
|
+
.dgmo-theme-dark .dgmo-tok-chartType {
|
|
349
|
+
color: #d08770;
|
|
350
|
+
font-weight: bold;
|
|
351
|
+
}
|
|
352
|
+
.dgmo-theme-dark .dgmo-tok-operator {
|
|
353
|
+
color: #bf616a;
|
|
354
|
+
font-weight: bold;
|
|
355
|
+
}
|
|
356
|
+
.dgmo-theme-dark .dgmo-tok-number {
|
|
357
|
+
color: #b48ead;
|
|
358
|
+
}
|
|
359
|
+
.dgmo-theme-dark .dgmo-tok-comment {
|
|
360
|
+
color: #616e88;
|
|
361
|
+
font-style: italic;
|
|
362
|
+
}
|
|
363
|
+
.dgmo-theme-dark .dgmo-tok-heading {
|
|
364
|
+
color: #d08770;
|
|
365
|
+
font-weight: bold;
|
|
366
|
+
}
|
|
367
|
+
.dgmo-theme-dark .dgmo-tok-bracket {
|
|
368
|
+
color: #5e81ac;
|
|
369
|
+
}
|
|
370
|
+
.dgmo-theme-dark .dgmo-tok-separator {
|
|
371
|
+
color: #88c0d0;
|
|
372
|
+
}
|
|
373
|
+
.dgmo-theme-dark .dgmo-tok-deprecatedSyntax {
|
|
374
|
+
color: #bf616a;
|
|
375
|
+
text-decoration: line-through;
|
|
376
|
+
}
|
|
377
|
+
.dgmo-theme-dark .dgmo-tok-url {
|
|
378
|
+
color: #88c0d0;
|
|
379
|
+
text-decoration: underline;
|
|
380
|
+
}
|
|
381
|
+
.dgmo-theme-dark .dgmo-tok-colorAnnotation {
|
|
382
|
+
color: #d08770;
|
|
383
|
+
font-style: italic;
|
|
384
|
+
}
|
|
385
|
+
.dgmo-theme-dark .dgmo-tok-punctuation {
|
|
386
|
+
color: #616e88;
|
|
387
|
+
}
|
|
388
|
+
.dgmo-theme-dark .dgmo-tok-propertyName {
|
|
389
|
+
color: #88c0d0;
|
|
390
|
+
}
|
|
391
|
+
.dgmo-theme-dark .dgmo-tok-string {
|
|
392
|
+
color: #a3be8c;
|
|
393
|
+
}
|
|
394
|
+
.dgmo-theme-dark .dgmo-tok-noteContent {
|
|
395
|
+
color: #616e88;
|
|
396
|
+
font-style: italic;
|
|
397
|
+
}
|
package/dist/auto.d.cts
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* Shared browser-embed helpers for the `@diagrammo/dgmo` client-side
|
|
3
3
|
* drop-ins (`./auto` script-tag renderer and `./element` custom element).
|
|
4
4
|
*
|
|
5
|
-
* These are the SVG sanitizer, theme resolver,
|
|
6
|
-
*
|
|
7
|
-
* and share-URL builder — factored
|
|
8
|
-
*
|
|
9
|
-
* public `window.dgmo` surface is
|
|
5
|
+
* These are the SVG sanitizer, theme resolver, the standard-block DOM
|
|
6
|
+
* assembler (canonical chrome from `src/embed` — BL-114), the error card,
|
|
7
|
+
* aria-label derivation, style injection, and share-URL builder — factored
|
|
8
|
+
* out of `auto/index.ts` so the two entries share one implementation rather
|
|
9
|
+
* than diverging copies. The `auto` entry's public `window.dgmo` surface is
|
|
10
|
+
* unaffected; it imports from here.
|
|
10
11
|
*/
|
|
11
12
|
declare const VERSION: string;
|
|
13
|
+
|
|
12
14
|
type ThemePreference = 'auto' | 'light' | 'dark' | 'transparent';
|
|
13
15
|
declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'dark' | 'transparent';
|
|
14
16
|
|
|
@@ -17,9 +19,9 @@ declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'da
|
|
|
17
19
|
*
|
|
18
20
|
* Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
|
|
19
21
|
* this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
|
|
20
|
-
* replaces each match with
|
|
21
|
-
*
|
|
22
|
-
* "Open in editor" actions.
|
|
22
|
+
* replaces each match with the standard DGMO embed block (BL-114,
|
|
23
|
+
* `figure.dgmo.dgmo-rendered`) — the diagram plus a hover-reveal icon
|
|
24
|
+
* toolbar with view-source, Copy, and "Open in editor" actions.
|
|
23
25
|
*
|
|
24
26
|
* Public API: frozen `window.dgmo` and alias `window.diagrammo` with
|
|
25
27
|
* `{ initialize, run, version }`. Configuration is read from the
|
package/dist/auto.d.ts
CHANGED
|
@@ -2,13 +2,15 @@
|
|
|
2
2
|
* Shared browser-embed helpers for the `@diagrammo/dgmo` client-side
|
|
3
3
|
* drop-ins (`./auto` script-tag renderer and `./element` custom element).
|
|
4
4
|
*
|
|
5
|
-
* These are the SVG sanitizer, theme resolver,
|
|
6
|
-
*
|
|
7
|
-
* and share-URL builder — factored
|
|
8
|
-
*
|
|
9
|
-
* public `window.dgmo` surface is
|
|
5
|
+
* These are the SVG sanitizer, theme resolver, the standard-block DOM
|
|
6
|
+
* assembler (canonical chrome from `src/embed` — BL-114), the error card,
|
|
7
|
+
* aria-label derivation, style injection, and share-URL builder — factored
|
|
8
|
+
* out of `auto/index.ts` so the two entries share one implementation rather
|
|
9
|
+
* than diverging copies. The `auto` entry's public `window.dgmo` surface is
|
|
10
|
+
* unaffected; it imports from here.
|
|
10
11
|
*/
|
|
11
12
|
declare const VERSION: string;
|
|
13
|
+
|
|
12
14
|
type ThemePreference = 'auto' | 'light' | 'dark' | 'transparent';
|
|
13
15
|
declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'dark' | 'transparent';
|
|
14
16
|
|
|
@@ -17,9 +19,9 @@ declare function resolveTheme(theme: ThemePreference | undefined): 'light' | 'da
|
|
|
17
19
|
*
|
|
18
20
|
* Drop a `<script src="…/auto.js">` on any page; on `DOMContentLoaded`
|
|
19
21
|
* this module scans for `.dgmo, .language-dgmo`, runs `render()`, and
|
|
20
|
-
* replaces each match with
|
|
21
|
-
*
|
|
22
|
-
* "Open in editor" actions.
|
|
22
|
+
* replaces each match with the standard DGMO embed block (BL-114,
|
|
23
|
+
* `figure.dgmo.dgmo-rendered`) — the diagram plus a hover-reveal icon
|
|
24
|
+
* toolbar with view-source, Copy, and "Open in editor" actions.
|
|
23
25
|
*
|
|
24
26
|
* Public API: frozen `window.dgmo` and alias `window.diagrammo` with
|
|
25
27
|
* `{ initialize, run, version }`. Configuration is read from the
|