@diagrammo/dgmo-standalone 0.64.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/auto.css ADDED
@@ -0,0 +1,557 @@
1
+ /* anti-flash: hide source elements until either render swaps them out
2
+ or the error path replaces them with the standard error card */
3
+ pre.dgmo, code.language-dgmo, pre > code.language-dgmo,
4
+ .dgmo:not(svg *):not(.dgmo-rendered):not(.dgmo-rendered *):not(.dgmo--error):not(.dgmo--error *) {
5
+ visibility: hidden;
6
+ }
7
+ .dgmo-rendered, .dgmo-rendered *,
8
+ .dgmo--error, .dgmo--error * {
9
+ visibility: visible !important;
10
+ }
11
+
12
+ .dgmo-rendered {
13
+ display: block;
14
+ position: relative;
15
+ margin: 1em 0;
16
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
17
+ Oxygen, Ubuntu, Cantarell, sans-serif;
18
+ font-size: 14px;
19
+ line-height: 1.4;
20
+ color-scheme: light dark;
21
+ }
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 {
41
+ display: block;
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%;
52
+ height: auto;
53
+ max-width: 100%;
54
+ }
55
+
56
+ /* === Toolbar ===
57
+ * The diagram is the star: the toolbar is an overlay pinned to the diagram's
58
+ * bottom-right corner (position:absolute — it reserves no layout space, so the
59
+ * block is exactly as tall as the chart). Bottom-right (not top-right) so it
60
+ * never collides with a host's own top-right chart chrome — e.g. Obsidian's
61
+ * code-block copy button. It stays fully transparent until the block is
62
+ * hovered or focused, or the source panel is open. It is the <summary> of the
63
+ * source <details>, so toggling works without any JS. No text labels, no
64
+ * disclosure triangle — three wordless icon buttons.
65
+ *
66
+ * Anchored to .dgmo-source-wrap (position:relative below), whose top edge is
67
+ * always the diagram's bottom edge — bottom:calc(100% + gap) therefore keeps
68
+ * the toolbar at the diagram's bottom-right whether the source panel is open or
69
+ * closed (a figure-anchored bottom would drift down below the open code). */
70
+ .dgmo-source-wrap {
71
+ margin: 0;
72
+ position: relative;
73
+ }
74
+ .dgmo-toolbar {
75
+ position: absolute;
76
+ bottom: calc(100% + 0.4em);
77
+ right: 0.4em;
78
+ z-index: 2;
79
+ display: flex;
80
+ align-items: center;
81
+ justify-content: flex-end;
82
+ gap: 0.25em;
83
+ padding: 0.15em;
84
+ opacity: 0;
85
+ transition: opacity 0.15s ease;
86
+ cursor: pointer;
87
+ list-style: none;
88
+ user-select: none;
89
+ color: rgba(127, 127, 127, 0.9);
90
+ }
91
+ .dgmo-toolbar::-webkit-details-marker {
92
+ display: none;
93
+ }
94
+ /* Reveal is keyed to the diagram IMAGE (the svg wrappers), not the whole
95
+ * figure — hovering the open code panel keeps the page quiet. The toolbar's
96
+ * own :hover keeps it alive while the pointer travels down from the image
97
+ * (they're adjacent, so there's no dead gap). focus-within covers keyboard
98
+ * and touch-tap. */
99
+ .dgmo-light:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
100
+ .dgmo-dark:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
101
+ .dgmo-svg:hover ~ .dgmo-source-wrap > .dgmo-toolbar,
102
+ .dgmo-toolbar:hover,
103
+ .dgmo:focus-within .dgmo-toolbar {
104
+ opacity: 1;
105
+ }
106
+ /* Touch devices have no hover: keep the icons faintly visible so the
107
+ * affordance is discoverable at all. */
108
+ @media (hover: none) {
109
+ .dgmo-toolbar {
110
+ opacity: 0.5;
111
+ }
112
+ }
113
+
114
+ .dgmo-toggle,
115
+ .dgmo-toolbar-btn {
116
+ display: inline-flex;
117
+ align-items: center;
118
+ justify-content: center;
119
+ width: 1.9em;
120
+ height: 1.9em;
121
+ border-radius: 0.35em;
122
+ background: none;
123
+ border: 0;
124
+ padding: 0;
125
+ color: inherit;
126
+ cursor: pointer;
127
+ opacity: 0.75;
128
+ transition:
129
+ opacity 0.15s ease,
130
+ background-color 0.15s ease;
131
+ }
132
+ .dgmo-toggle:hover,
133
+ .dgmo-toolbar-btn:hover {
134
+ opacity: 1;
135
+ background: rgba(127, 127, 127, 0.12);
136
+ }
137
+ .dgmo-toggle svg,
138
+ .dgmo-toolbar-btn svg {
139
+ width: 1em;
140
+ height: 1em;
141
+ }
142
+ /* Active state while the source panel is open. */
143
+ .dgmo-source-wrap[open] > .dgmo-toolbar .dgmo-toggle {
144
+ opacity: 1;
145
+ background: rgba(127, 127, 127, 0.15);
146
+ }
147
+ .dgmo-copy--success {
148
+ color: #5cba7a;
149
+ opacity: 1;
150
+ }
151
+
152
+ /* === Full-screen lightbox ===
153
+ * The expand button clones the visible diagram into a native <dialog> that
154
+ * the client shows with showModal(): top-layer, so it escapes any transformed
155
+ * or overflow-clipped ancestor (docs sidebars) and fills the whole viewport.
156
+ * Escape / backdrop-click / the close button dismiss it. The <dialog> itself
157
+ * fills the viewport with a transparent background (so a click landing on it
158
+ * — outside the centered card — reads as a backdrop dismiss); the dim comes
159
+ * from ::backdrop. */
160
+ .dgmo-lightbox {
161
+ width: 100vw;
162
+ height: 100vh;
163
+ max-width: 100vw;
164
+ max-height: 100vh;
165
+ margin: 0;
166
+ padding: 0;
167
+ border: 0;
168
+ background: transparent;
169
+ overflow: hidden;
170
+ }
171
+ .dgmo-lightbox[open] {
172
+ display: flex;
173
+ align-items: center;
174
+ justify-content: center;
175
+ }
176
+ .dgmo-lightbox::backdrop {
177
+ background: rgba(0, 0, 0, 0.72);
178
+ }
179
+ .dgmo-lightbox-svg {
180
+ width: 95vw;
181
+ max-width: 95vw;
182
+ max-height: 95vh;
183
+ overflow: auto;
184
+ border-radius: 0.5em;
185
+ box-shadow: 0 12px 48px rgba(0, 0, 0, 0.45);
186
+ /* Opaque surface behind the enlarged diagram so a transparent embed doesn't
187
+ * show the page through it. The client overrides this inline with the block's
188
+ * own palette bg (data-dgmo-bg); this is the fallback for blocks that predate
189
+ * that attribute. */
190
+ background: #fff;
191
+ }
192
+ [data-theme="dark"] .dgmo-lightbox-svg {
193
+ background: #1e1e1e;
194
+ }
195
+ .dgmo-lightbox-svg > svg {
196
+ display: block;
197
+ width: 100%;
198
+ height: auto;
199
+ max-width: 100%;
200
+ }
201
+ .dgmo-lightbox-close {
202
+ position: fixed;
203
+ top: max(1rem, env(safe-area-inset-top));
204
+ right: max(1rem, env(safe-area-inset-right));
205
+ display: inline-flex;
206
+ align-items: center;
207
+ justify-content: center;
208
+ width: 2.4em;
209
+ height: 2.4em;
210
+ border: 0;
211
+ border-radius: 50%;
212
+ background: rgba(0, 0, 0, 0.5);
213
+ color: #fff;
214
+ font-size: 1.25rem;
215
+ line-height: 1;
216
+ cursor: pointer;
217
+ transition: background-color 0.15s ease;
218
+ }
219
+ .dgmo-lightbox-close:hover {
220
+ background: rgba(0, 0, 0, 0.75);
221
+ }
222
+
223
+ /* === Frame the whole block ===
224
+ * When the source panel is open, diagram + toolbar + code get one shared
225
+ * border so the code visibly belongs to the chart above it. The frame box
226
+ * (border + padding) is RESERVED at all times — with the border transparent
227
+ * while closed — so opening the panel only paints the border in. It never
228
+ * reflows the diagram. position:relative anchors the overlay toolbar to
229
+ * this box. */
230
+ .dgmo:has(> .dgmo-source-wrap) {
231
+ position: relative;
232
+ border: 1px solid transparent;
233
+ border-radius: 0.6em;
234
+ padding: 0.75em 0.75em 0.5em;
235
+ }
236
+ .dgmo:has(> .dgmo-source-wrap[open]) {
237
+ border-color: rgba(127, 127, 127, 0.3);
238
+ }
239
+
240
+ /* === Source panel (hidden until toggled) === */
241
+ .dgmo-source-inner {
242
+ border-top: 1px solid rgba(127, 127, 127, 0.25);
243
+ background: rgba(127, 127, 127, 0.06);
244
+ overflow: hidden;
245
+ margin: 0 -0.75em -0.5em;
246
+ border-radius: 0 0 0.6em 0.6em;
247
+ }
248
+ .dgmo-pre {
249
+ white-space: pre;
250
+ overflow-x: auto;
251
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
252
+ font-size: 0.85em;
253
+ line-height: 1.5;
254
+ margin: 0;
255
+ padding: 1em;
256
+ }
257
+ .dgmo-code {
258
+ display: block;
259
+ }
260
+
261
+ /* === Error card === */
262
+ .dgmo--error {
263
+ border: 1px solid rgba(220, 80, 80, 0.5);
264
+ border-radius: 0.5em;
265
+ padding: 0.75em 1em;
266
+ }
267
+ .dgmo--error pre {
268
+ white-space: pre;
269
+ overflow-x: auto;
270
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
271
+ font-size: 0.85em;
272
+ margin: 0.5em 0 0;
273
+ }
274
+ .dgmo-error-docs {
275
+ display: inline-block;
276
+ margin-top: 0.6em;
277
+ font-size: 0.9em;
278
+ font-weight: 600;
279
+ color: inherit;
280
+ }
281
+
282
+ /* === Source highlight roles ===
283
+ * Light values mirror LIGHT_ROLE_STYLES; dark overrides mirror
284
+ * NORD_ROLE_STYLES. Guarded by the parity test in tests/block.test.ts. */
285
+ .dgmo-tok-keyword {
286
+ color: #3b6ea5;
287
+ font-weight: bold;
288
+ }
289
+ .dgmo-tok-controlKeyword {
290
+ color: #7d5ba6;
291
+ font-weight: bold;
292
+ }
293
+ .dgmo-tok-definitionKeyword {
294
+ color: #2f5a86;
295
+ font-weight: bold;
296
+ }
297
+ .dgmo-tok-modifier {
298
+ color: #7d5ba6;
299
+ }
300
+ .dgmo-tok-chartType {
301
+ color: #b8691f;
302
+ font-weight: bold;
303
+ }
304
+ .dgmo-tok-operator {
305
+ color: #c0504d;
306
+ font-weight: bold;
307
+ }
308
+ .dgmo-tok-number {
309
+ color: #7d5ba6;
310
+ }
311
+ .dgmo-tok-comment {
312
+ color: #677483;
313
+ font-style: italic;
314
+ }
315
+ .dgmo-tok-heading {
316
+ color: #b8691f;
317
+ font-weight: bold;
318
+ }
319
+ .dgmo-tok-bracket {
320
+ color: #5b6672;
321
+ }
322
+ .dgmo-tok-separator {
323
+ color: #2d7268;
324
+ }
325
+ .dgmo-tok-deprecatedSyntax {
326
+ color: #c0504d;
327
+ text-decoration: line-through;
328
+ }
329
+ .dgmo-tok-url {
330
+ color: #3b6ea5;
331
+ text-decoration: underline;
332
+ }
333
+ .dgmo-tok-colorAnnotation {
334
+ color: #b8691f;
335
+ font-style: italic;
336
+ }
337
+ .dgmo-tok-punctuation {
338
+ color: #677483;
339
+ }
340
+ .dgmo-tok-propertyName {
341
+ color: #2d7268;
342
+ }
343
+ .dgmo-tok-string {
344
+ color: #3f7a3b;
345
+ }
346
+ .dgmo-tok-noteContent {
347
+ color: #677483;
348
+ font-style: italic;
349
+ }
350
+
351
+ [data-theme="dark"] .dgmo-tok-keyword {
352
+ color: #81a1c1;
353
+ font-weight: bold;
354
+ }
355
+ [data-theme="dark"] .dgmo-tok-controlKeyword {
356
+ color: #b48ead;
357
+ font-weight: bold;
358
+ }
359
+ [data-theme="dark"] .dgmo-tok-definitionKeyword {
360
+ color: #5e81ac;
361
+ font-weight: bold;
362
+ }
363
+ [data-theme="dark"] .dgmo-tok-modifier {
364
+ color: #b48ead;
365
+ }
366
+ [data-theme="dark"] .dgmo-tok-chartType {
367
+ color: #d08770;
368
+ font-weight: bold;
369
+ }
370
+ [data-theme="dark"] .dgmo-tok-operator {
371
+ color: #bf616a;
372
+ font-weight: bold;
373
+ }
374
+ [data-theme="dark"] .dgmo-tok-number {
375
+ color: #b48ead;
376
+ }
377
+ [data-theme="dark"] .dgmo-tok-comment {
378
+ color: #616e88;
379
+ font-style: italic;
380
+ }
381
+ [data-theme="dark"] .dgmo-tok-heading {
382
+ color: #d08770;
383
+ font-weight: bold;
384
+ }
385
+ [data-theme="dark"] .dgmo-tok-bracket {
386
+ color: #5e81ac;
387
+ }
388
+ [data-theme="dark"] .dgmo-tok-separator {
389
+ color: #88c0d0;
390
+ }
391
+ [data-theme="dark"] .dgmo-tok-deprecatedSyntax {
392
+ color: #bf616a;
393
+ text-decoration: line-through;
394
+ }
395
+ [data-theme="dark"] .dgmo-tok-url {
396
+ color: #88c0d0;
397
+ text-decoration: underline;
398
+ }
399
+ [data-theme="dark"] .dgmo-tok-colorAnnotation {
400
+ color: #d08770;
401
+ font-style: italic;
402
+ }
403
+ [data-theme="dark"] .dgmo-tok-punctuation {
404
+ color: #616e88;
405
+ }
406
+ [data-theme="dark"] .dgmo-tok-propertyName {
407
+ color: #88c0d0;
408
+ }
409
+ [data-theme="dark"] .dgmo-tok-string {
410
+ color: #a3be8c;
411
+ }
412
+ [data-theme="dark"] .dgmo-tok-noteContent {
413
+ color: #616e88;
414
+ font-style: italic;
415
+ }
416
+
417
+ /* === Live links ===
418
+ * A withdrawn pointer's placeholder, and the "this moved" affordance a host's
419
+ * client script falls back to when it can see a diagram has changed but cannot
420
+ * safely swap it in. Both are deliberately quiet: a page peppered with badges
421
+ * is worse than one that is a few days behind. */
422
+ .dgmo--tombstone {
423
+ border: 1px dashed currentColor;
424
+ border-radius: 6px;
425
+ opacity: 0.6;
426
+ padding: 1.5rem;
427
+ text-align: center;
428
+ }
429
+ .dgmo-tombstone-text {
430
+ font-size: 0.9em;
431
+ margin: 0;
432
+ }
433
+ .dgmo-updated {
434
+ display: block;
435
+ font-size: 0.8em;
436
+ margin-top: 0.4rem;
437
+ opacity: 0.7;
438
+ text-align: right;
439
+ }
440
+ /* The card a docs site shows when live links are switched OFF, plus its
441
+ * hover-revealed way to turn them on. Hover-only on purpose: a READER never
442
+ * meets it, and anyone mousing over a diagram-shaped thing on their own docs
443
+ * site is almost certainly its author — which makes this the fix for a build
444
+ * warning nobody reads. The markup is the WRAPPER's (only it knows the feature
445
+ * is off); the styling is here because there is one stylesheet. */
446
+ .dgmo-live-link-off {
447
+ position: relative;
448
+ }
449
+ .dgmo-live-link-view {
450
+ display: block;
451
+ text-decoration: none;
452
+ }
453
+ /* pointer-events: none alongside the fade, or an invisible link sits over the
454
+ * card's bottom-right corner and navigates a reader who clicks near it. Focus
455
+ * still reveals it (:focus-within on the wrapper), so a keyboard user is not
456
+ * shut out of something a mouse user can reach. */
457
+ .dgmo-live-link-enable {
458
+ bottom: 0.5rem;
459
+ font-size: 0.8em;
460
+ opacity: 0;
461
+ pointer-events: none;
462
+ position: absolute;
463
+ right: 0.5rem;
464
+ transition: opacity 0.15s ease-in-out;
465
+ }
466
+ .dgmo-live-link-off:hover .dgmo-live-link-enable,
467
+ .dgmo-live-link-off:focus-within .dgmo-live-link-enable {
468
+ opacity: 1;
469
+ pointer-events: auto;
470
+ }
471
+ @media (prefers-reduced-motion: reduce) {
472
+ .dgmo-live-link-enable {
473
+ transition: none;
474
+ }
475
+ }
476
+
477
+ .dgmo-theme-dark selectors if your site uses .dark or
478
+ * another color-mode convention. */
479
+
480
+ /* === Color-mode visibility (dual-render) === */
481
+ .dgmo-dark {
482
+ display: none;
483
+ }
484
+ .dgmo-theme-dark .dgmo-light {
485
+ display: none;
486
+ }
487
+ .dgmo-theme-dark .dgmo-dark {
488
+ display: block;
489
+ }
490
+ .dgmo-theme-dark .dgmo-lightbox-svg {
491
+ background: #1e1e1e;
492
+ }
493
+ .dgmo-theme-dark .dgmo-tok-keyword {
494
+ color: #81a1c1;
495
+ font-weight: bold;
496
+ }
497
+ .dgmo-theme-dark .dgmo-tok-controlKeyword {
498
+ color: #b48ead;
499
+ font-weight: bold;
500
+ }
501
+ .dgmo-theme-dark .dgmo-tok-definitionKeyword {
502
+ color: #5e81ac;
503
+ font-weight: bold;
504
+ }
505
+ .dgmo-theme-dark .dgmo-tok-modifier {
506
+ color: #b48ead;
507
+ }
508
+ .dgmo-theme-dark .dgmo-tok-chartType {
509
+ color: #d08770;
510
+ font-weight: bold;
511
+ }
512
+ .dgmo-theme-dark .dgmo-tok-operator {
513
+ color: #bf616a;
514
+ font-weight: bold;
515
+ }
516
+ .dgmo-theme-dark .dgmo-tok-number {
517
+ color: #b48ead;
518
+ }
519
+ .dgmo-theme-dark .dgmo-tok-comment {
520
+ color: #616e88;
521
+ font-style: italic;
522
+ }
523
+ .dgmo-theme-dark .dgmo-tok-heading {
524
+ color: #d08770;
525
+ font-weight: bold;
526
+ }
527
+ .dgmo-theme-dark .dgmo-tok-bracket {
528
+ color: #5e81ac;
529
+ }
530
+ .dgmo-theme-dark .dgmo-tok-separator {
531
+ color: #88c0d0;
532
+ }
533
+ .dgmo-theme-dark .dgmo-tok-deprecatedSyntax {
534
+ color: #bf616a;
535
+ text-decoration: line-through;
536
+ }
537
+ .dgmo-theme-dark .dgmo-tok-url {
538
+ color: #88c0d0;
539
+ text-decoration: underline;
540
+ }
541
+ .dgmo-theme-dark .dgmo-tok-colorAnnotation {
542
+ color: #d08770;
543
+ font-style: italic;
544
+ }
545
+ .dgmo-theme-dark .dgmo-tok-punctuation {
546
+ color: #616e88;
547
+ }
548
+ .dgmo-theme-dark .dgmo-tok-propertyName {
549
+ color: #88c0d0;
550
+ }
551
+ .dgmo-theme-dark .dgmo-tok-string {
552
+ color: #a3be8c;
553
+ }
554
+ .dgmo-theme-dark .dgmo-tok-noteContent {
555
+ color: #616e88;
556
+ font-style: italic;
557
+ }