create-zudo-doc 0.2.8 → 0.2.10
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/compose.d.ts +6 -0
- package/dist/compose.js +7 -0
- package/dist/features/design-token-panel.d.ts +8 -6
- package/dist/features/design-token-panel.js +81 -6
- package/dist/features/image-enlarge.d.ts +1 -1
- package/dist/features/image-enlarge.js +6 -4
- package/dist/scaffold.js +58 -12
- package/dist/settings-gen.js +10 -3
- package/package.json +1 -1
- package/templates/base/pages/lib/_body-end-islands.tsx +28 -68
- package/templates/base/src/components/mermaid-enlarge.tsx +490 -0
- package/templates/base/src/config/color-schemes.ts +6 -5
- package/templates/base/src/config/settings-types.ts +3 -1
- package/templates/base/src/styles/global.css +152 -425
- package/templates/base/src/components/design-token-panel-bootstrap.tsx +0 -15
- package/templates/base/src/utils/header-right-items.ts +0 -38
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
*
|
|
18
18
|
* The package ships a build-generated safelist at `dist/safelist.css`
|
|
19
19
|
* (zudolab/zudo-doc#1993). Importing it via the module resolver is
|
|
20
|
-
* reliable across all consumer environments — same
|
|
21
|
-
*
|
|
20
|
+
* reliable across all consumer environments — the same module-resolver
|
|
21
|
+
* code path used for any feature stylesheet injected at the
|
|
22
|
+
* `@slot:global-css:feature-styles` anchor below.
|
|
22
23
|
*
|
|
23
24
|
* Why not @source the package dist/ glob? The old approach
|
|
24
25
|
* (`@source "../../node_modules/@takazudo/zudo-doc/dist/**"`) was
|
|
@@ -34,6 +35,14 @@
|
|
|
34
35
|
|
|
35
36
|
@import "@takazudo/zudo-doc/safelist.css";
|
|
36
37
|
|
|
38
|
+
/* Content typography (`.zd-content` rules + admonitions + mermaid layout).
|
|
39
|
+
Shipped by @takazudo/zudo-doc as the single source of truth — do not inline
|
|
40
|
+
these rules here (they used to live here and drifted; see
|
|
41
|
+
zudolab/zudo-doc#2188). The @layer zd-flow order it relies on is declared
|
|
42
|
+
above (line 11); the safelist import above generates the component utilities
|
|
43
|
+
its headings/links/etc. depend on. */
|
|
44
|
+
@import "@takazudo/zudo-doc/content.css";
|
|
45
|
+
|
|
37
46
|
/* ========================================
|
|
38
47
|
* Tailwind v4 content sources
|
|
39
48
|
*
|
|
@@ -289,410 +298,6 @@ body {
|
|
|
289
298
|
}
|
|
290
299
|
}
|
|
291
300
|
|
|
292
|
-
/* ========================================
|
|
293
|
-
* Content typography (.zd-content)
|
|
294
|
-
*
|
|
295
|
-
* Direct element styling — no prose plugin.
|
|
296
|
-
* Uses :where() for zero specificity (easy to override).
|
|
297
|
-
* Font size pattern inspired by zpaper: paired size + line-height.
|
|
298
|
-
* ======================================== */
|
|
299
|
-
|
|
300
|
-
.zd-content {
|
|
301
|
-
color: var(--color-fg);
|
|
302
|
-
font-size: var(--text-body);
|
|
303
|
-
line-height: var(--leading-relaxed);
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
/* ── Flow spacing (vertical rhythm) ── */
|
|
307
|
-
|
|
308
|
-
/* In the `zd-flow` cascade layer (declared at the top of this file) so the
|
|
309
|
-
* unlayered `tailwindcss/utilities` import wins over it: unlayered declarations
|
|
310
|
-
* always beat layered ones regardless of specificity or source order. Both this
|
|
311
|
-
* rule and a `mt-*` utility have specificity (0,1,0); without the layer this
|
|
312
|
-
* rule comes later in source order and silently kills every `mt-*` on a
|
|
313
|
-
* `.zd-content` direct child. zd-flow sits ABOVE zd-preflight so this rule still
|
|
314
|
-
* beats preflight's `* { margin: 0 }` reset and the .zd-content rhythm is
|
|
315
|
-
* preserved for plain content blocks. The layer is scoped to ONLY this flow rule
|
|
316
|
-
* — every other `.zd-content` author rule (links, code, lists, headings, the
|
|
317
|
-
* `:first-child` reset, etc.) stays unlayered so utilities do NOT flip those.
|
|
318
|
-
* See zudolab/zudo-doc#2082 / #2109. */
|
|
319
|
-
@layer zd-flow {
|
|
320
|
-
.zd-content > :where(* + *) {
|
|
321
|
-
margin-top: var(--flow-space, var(--spacing-vsp-md));
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
|
|
325
|
-
/* ── Headings ── */
|
|
326
|
-
|
|
327
|
-
.zd-content :where(h2) {
|
|
328
|
-
font-size: var(--text-title);
|
|
329
|
-
font-weight: var(--font-weight-bold);
|
|
330
|
-
line-height: var(--leading-tight);
|
|
331
|
-
margin-top: var(--spacing-vsp-2xl);
|
|
332
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
333
|
-
padding-top: var(--spacing-vsp-sm);
|
|
334
|
-
border-top: 3px solid transparent;
|
|
335
|
-
border-image: linear-gradient(to right, var(--color-fg), transparent) 1;
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
.zd-content :where(h3) {
|
|
339
|
-
font-size: var(--text-body);
|
|
340
|
-
font-weight: var(--font-weight-bold);
|
|
341
|
-
line-height: var(--leading-snug);
|
|
342
|
-
margin-top: var(--spacing-vsp-xl);
|
|
343
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
344
|
-
padding-top: var(--spacing-vsp-xs);
|
|
345
|
-
border-top: 2px solid transparent;
|
|
346
|
-
border-image: linear-gradient(to right, var(--color-muted), transparent) 1;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
.zd-content :where(h4) {
|
|
350
|
-
font-size: var(--text-body);
|
|
351
|
-
font-weight: var(--font-weight-semibold);
|
|
352
|
-
line-height: var(--leading-snug);
|
|
353
|
-
margin-top: var(--spacing-vsp-lg);
|
|
354
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
355
|
-
padding-top: var(--spacing-vsp-xs);
|
|
356
|
-
border-top: 1px solid transparent;
|
|
357
|
-
border-image: linear-gradient(to right, var(--color-muted), transparent) 1;
|
|
358
|
-
}
|
|
359
|
-
|
|
360
|
-
.zd-content :where(h5, h6) {
|
|
361
|
-
font-size: var(--text-small);
|
|
362
|
-
font-weight: var(--font-weight-semibold);
|
|
363
|
-
line-height: var(--leading-snug);
|
|
364
|
-
margin-top: var(--spacing-vsp-md);
|
|
365
|
-
margin-bottom: var(--spacing-vsp-2xs);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
/* ── Heading auto-links ── */
|
|
369
|
-
|
|
370
|
-
.zd-content :where(h2, h3, h4, h5, h6) .hash-link {
|
|
371
|
-
text-decoration: none;
|
|
372
|
-
margin-left: var(--spacing-hsp-sm);
|
|
373
|
-
opacity: 0;
|
|
374
|
-
transition: opacity 0.15s;
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
.zd-content :where(h2, h3, h4, h5, h6) .hash-link::after {
|
|
378
|
-
content: "#";
|
|
379
|
-
color: var(--color-accent);
|
|
380
|
-
}
|
|
381
|
-
|
|
382
|
-
.zd-content :where(h2, h3, h4, h5, h6):hover .hash-link {
|
|
383
|
-
opacity: 1;
|
|
384
|
-
}
|
|
385
|
-
|
|
386
|
-
.zd-content :where(h2, h3, h4, h5, h6) .hash-link:focus-visible {
|
|
387
|
-
opacity: 1;
|
|
388
|
-
outline: 2px solid var(--color-accent);
|
|
389
|
-
outline-offset: 2px;
|
|
390
|
-
}
|
|
391
|
-
|
|
392
|
-
/* Tighten spacing after headings */
|
|
393
|
-
.zd-content :where(h2 + *, h3 + *, h4 + *, h5 + *, h6 + *) {
|
|
394
|
-
margin-top: 0;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/* ── Paragraphs ── */
|
|
398
|
-
|
|
399
|
-
.zd-content :where(p) {
|
|
400
|
-
margin-top: 0;
|
|
401
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
402
|
-
}
|
|
403
|
-
|
|
404
|
-
/* ── Links ── */
|
|
405
|
-
|
|
406
|
-
.zd-content :where(a:not(.block):not([data-site-nav] *)) {
|
|
407
|
-
color: var(--color-accent);
|
|
408
|
-
text-decoration: underline;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
.zd-content :where(a:not(.block):not([data-site-nav] *):hover) {
|
|
412
|
-
color: var(--color-accent-hover);
|
|
413
|
-
}
|
|
414
|
-
|
|
415
|
-
/* ── Bold / Strong ── */
|
|
416
|
-
|
|
417
|
-
.zd-content :where(strong) {
|
|
418
|
-
font-weight: var(--font-weight-bold);
|
|
419
|
-
color: var(--color-fg);
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
/* ── Lists ── */
|
|
423
|
-
|
|
424
|
-
.zd-content :where(ul) {
|
|
425
|
-
list-style-type: disc;
|
|
426
|
-
padding-left: var(--spacing-hsp-xl);
|
|
427
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
.zd-content :where(ol) {
|
|
431
|
-
list-style-type: decimal;
|
|
432
|
-
padding-left: var(--spacing-hsp-xl);
|
|
433
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
434
|
-
}
|
|
435
|
-
|
|
436
|
-
.zd-content :where(li) {
|
|
437
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
438
|
-
}
|
|
439
|
-
|
|
440
|
-
.zd-content :where(li::marker) {
|
|
441
|
-
color: var(--color-muted);
|
|
442
|
-
}
|
|
443
|
-
|
|
444
|
-
.zd-content :where(li > ul, li > ol) {
|
|
445
|
-
margin-top: var(--spacing-vsp-xs);
|
|
446
|
-
margin-bottom: 0;
|
|
447
|
-
}
|
|
448
|
-
|
|
449
|
-
/* ── Blockquotes ── */
|
|
450
|
-
|
|
451
|
-
.zd-content :where(blockquote) {
|
|
452
|
-
border-left: 3px solid var(--color-muted);
|
|
453
|
-
padding-left: var(--spacing-hsp-lg);
|
|
454
|
-
color: var(--color-muted);
|
|
455
|
-
font-style: italic;
|
|
456
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
457
|
-
}
|
|
458
|
-
|
|
459
|
-
.zd-content :where(blockquote p) {
|
|
460
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
461
|
-
}
|
|
462
|
-
|
|
463
|
-
/* ── Inline code ── */
|
|
464
|
-
|
|
465
|
-
.zd-content :where(code:not(pre code)) {
|
|
466
|
-
font-size: var(--text-small);
|
|
467
|
-
font-weight: var(--font-weight-medium);
|
|
468
|
-
font-family: var(--font-mono);
|
|
469
|
-
background-color: var(--color-code-bg);
|
|
470
|
-
color: var(--color-code-fg);
|
|
471
|
-
border-radius: var(--radius-DEFAULT);
|
|
472
|
-
padding: 2px var(--spacing-hsp-xs);
|
|
473
|
-
}
|
|
474
|
-
|
|
475
|
-
/* ── Code blocks (pre) ── */
|
|
476
|
-
|
|
477
|
-
.zd-content :where(pre) {
|
|
478
|
-
font-size: var(--text-small);
|
|
479
|
-
line-height: var(--leading-relaxed);
|
|
480
|
-
border: 1px solid var(--color-muted);
|
|
481
|
-
padding: var(--spacing-vsp-sm) var(--spacing-hsp-lg);
|
|
482
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
483
|
-
overflow-x: auto;
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
.zd-content :where(pre code) {
|
|
487
|
-
background: transparent;
|
|
488
|
-
padding: 0;
|
|
489
|
-
border: none;
|
|
490
|
-
color: inherit;
|
|
491
|
-
font-size: inherit;
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/* ── Tables ── */
|
|
495
|
-
|
|
496
|
-
.zd-content :where(table) {
|
|
497
|
-
width: 100%;
|
|
498
|
-
border-collapse: collapse;
|
|
499
|
-
font-size: var(--text-small);
|
|
500
|
-
margin-bottom: var(--spacing-vsp-md);
|
|
501
|
-
}
|
|
502
|
-
|
|
503
|
-
.zd-content :where(th),
|
|
504
|
-
.zd-content :where(td) {
|
|
505
|
-
padding: var(--spacing-vsp-xs) var(--spacing-hsp-md);
|
|
506
|
-
border-bottom: 1px solid var(--color-muted);
|
|
507
|
-
overflow-wrap: break-word;
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
.zd-content :where(th) {
|
|
511
|
-
font-weight: var(--font-weight-semibold);
|
|
512
|
-
text-align: left;
|
|
513
|
-
border-bottom-width: 2px;
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
/* ── Horizontal rules ── */
|
|
517
|
-
|
|
518
|
-
.zd-content :where(hr) {
|
|
519
|
-
border: none;
|
|
520
|
-
border-top: 1px solid var(--color-muted);
|
|
521
|
-
margin: var(--spacing-vsp-xl) 0;
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
/* ── Images ── */
|
|
525
|
-
|
|
526
|
-
.zd-content :where(img) {
|
|
527
|
-
max-width: 100%;
|
|
528
|
-
height: auto;
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
/* ── Definition lists ── */
|
|
532
|
-
|
|
533
|
-
.zd-content :where(dt) {
|
|
534
|
-
font-weight: var(--font-weight-semibold);
|
|
535
|
-
margin-top: var(--spacing-vsp-md);
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
.zd-content :where(dd) {
|
|
539
|
-
padding-left: var(--spacing-hsp-xl);
|
|
540
|
-
margin-bottom: var(--spacing-vsp-xs);
|
|
541
|
-
}
|
|
542
|
-
|
|
543
|
-
/* ========================================
|
|
544
|
-
* Admonitions ([data-admonition])
|
|
545
|
-
*
|
|
546
|
-
* Variant→color mapping: note→accent, tip→success, info→info,
|
|
547
|
-
* warning→warning, danger→danger. Background tint uses
|
|
548
|
-
* `color-mix(in srgb, var(--color-X) 12%, var(--color-bg))` for an opaque
|
|
549
|
-
* per-theme tinted backdrop. Class names are dynamic (admonition-${variant})
|
|
550
|
-
* so Tailwind cannot scan them; rules must live here explicitly.
|
|
551
|
-
* See zudolab/zudo-doc#1357 / #1444 / #1456.
|
|
552
|
-
* ======================================== */
|
|
553
|
-
|
|
554
|
-
[data-admonition] {
|
|
555
|
-
border-left: 4px solid var(--color-muted);
|
|
556
|
-
/* Asymmetric padding mirrors the Astro reference: generous top, snug bottom. */
|
|
557
|
-
padding: var(--spacing-vsp-md) var(--spacing-hsp-lg) var(--spacing-vsp-2xs);
|
|
558
|
-
background-color: color-mix(in srgb, var(--color-muted) 12%, var(--color-bg));
|
|
559
|
-
border-radius: 0 var(--radius-DEFAULT) var(--radius-DEFAULT) 0;
|
|
560
|
-
}
|
|
561
|
-
|
|
562
|
-
.admonition-title {
|
|
563
|
-
font-weight: var(--font-weight-semibold);
|
|
564
|
-
font-size: var(--text-small);
|
|
565
|
-
margin-bottom: var(--spacing-vsp-2xs);
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
/* Variant icon — emoji rendered via ::before so the stub markup stays
|
|
569
|
-
* variant-agnostic and the icon vocabulary lives next to its color rule. */
|
|
570
|
-
.admonition-title::before {
|
|
571
|
-
margin-right: var(--spacing-hsp-2xs);
|
|
572
|
-
}
|
|
573
|
-
|
|
574
|
-
.admonition-body > :first-child {
|
|
575
|
-
margin-top: 0;
|
|
576
|
-
}
|
|
577
|
-
|
|
578
|
-
.admonition-body > :last-child {
|
|
579
|
-
margin-bottom: 0;
|
|
580
|
-
}
|
|
581
|
-
|
|
582
|
-
[data-admonition="note"],
|
|
583
|
-
.admonition-note {
|
|
584
|
-
border-left-color: var(--color-accent);
|
|
585
|
-
background-color: color-mix(in srgb, var(--color-accent) 12%, var(--color-bg));
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
[data-admonition="note"] .admonition-title,
|
|
589
|
-
.admonition-note .admonition-title {
|
|
590
|
-
color: var(--color-accent);
|
|
591
|
-
}
|
|
592
|
-
|
|
593
|
-
[data-admonition="note"] .admonition-title::before,
|
|
594
|
-
.admonition-note .admonition-title::before {
|
|
595
|
-
content: "📝";
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
[data-admonition="tip"],
|
|
599
|
-
.admonition-tip {
|
|
600
|
-
border-left-color: var(--color-success);
|
|
601
|
-
background-color: color-mix(in srgb, var(--color-success) 12%, var(--color-bg));
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
[data-admonition="tip"] .admonition-title,
|
|
605
|
-
.admonition-tip .admonition-title {
|
|
606
|
-
color: var(--color-success);
|
|
607
|
-
}
|
|
608
|
-
|
|
609
|
-
[data-admonition="tip"] .admonition-title::before,
|
|
610
|
-
.admonition-tip .admonition-title::before {
|
|
611
|
-
content: "💡";
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
[data-admonition="info"],
|
|
615
|
-
.admonition-info {
|
|
616
|
-
border-left-color: var(--color-info);
|
|
617
|
-
background-color: color-mix(in srgb, var(--color-info) 12%, var(--color-bg));
|
|
618
|
-
}
|
|
619
|
-
|
|
620
|
-
[data-admonition="info"] .admonition-title,
|
|
621
|
-
.admonition-info .admonition-title {
|
|
622
|
-
color: var(--color-info);
|
|
623
|
-
}
|
|
624
|
-
|
|
625
|
-
[data-admonition="info"] .admonition-title::before,
|
|
626
|
-
.admonition-info .admonition-title::before {
|
|
627
|
-
content: "ℹ️";
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
[data-admonition="warning"],
|
|
631
|
-
.admonition-warning {
|
|
632
|
-
border-left-color: var(--color-warning);
|
|
633
|
-
background-color: color-mix(in srgb, var(--color-warning) 12%, var(--color-bg));
|
|
634
|
-
}
|
|
635
|
-
|
|
636
|
-
[data-admonition="warning"] .admonition-title,
|
|
637
|
-
.admonition-warning .admonition-title {
|
|
638
|
-
color: var(--color-warning);
|
|
639
|
-
}
|
|
640
|
-
|
|
641
|
-
[data-admonition="warning"] .admonition-title::before,
|
|
642
|
-
.admonition-warning .admonition-title::before {
|
|
643
|
-
content: "⚠️";
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
[data-admonition="danger"],
|
|
647
|
-
.admonition-danger {
|
|
648
|
-
border-left-color: var(--color-danger);
|
|
649
|
-
background-color: color-mix(in srgb, var(--color-danger) 12%, var(--color-bg));
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
[data-admonition="danger"] .admonition-title,
|
|
653
|
-
.admonition-danger .admonition-title {
|
|
654
|
-
color: var(--color-danger);
|
|
655
|
-
}
|
|
656
|
-
|
|
657
|
-
[data-admonition="danger"] .admonition-title::before,
|
|
658
|
-
.admonition-danger .admonition-title::before {
|
|
659
|
-
content: "🚨";
|
|
660
|
-
}
|
|
661
|
-
|
|
662
|
-
/* github-alerts [!IMPORTANT] → magenta/accent-adjacent (p5 = magenta palette slot) */
|
|
663
|
-
[data-admonition="important"],
|
|
664
|
-
.admonition-important {
|
|
665
|
-
border-left-color: var(--color-p5);
|
|
666
|
-
background-color: color-mix(in srgb, var(--color-p5) 12%, var(--color-bg));
|
|
667
|
-
}
|
|
668
|
-
|
|
669
|
-
[data-admonition="important"] .admonition-title,
|
|
670
|
-
.admonition-important .admonition-title {
|
|
671
|
-
color: var(--color-p5);
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
[data-admonition="important"] .admonition-title::before,
|
|
675
|
-
.admonition-important .admonition-title::before {
|
|
676
|
-
content: "❗";
|
|
677
|
-
}
|
|
678
|
-
|
|
679
|
-
/* github-alerts [!CAUTION] → danger-adjacent (high severity, distinct from danger/🚨) */
|
|
680
|
-
[data-admonition="caution"],
|
|
681
|
-
.admonition-caution {
|
|
682
|
-
border-left-color: var(--color-danger);
|
|
683
|
-
background-color: color-mix(in srgb, var(--color-danger) 12%, var(--color-bg));
|
|
684
|
-
}
|
|
685
|
-
|
|
686
|
-
[data-admonition="caution"] .admonition-title,
|
|
687
|
-
.admonition-caution .admonition-title {
|
|
688
|
-
color: var(--color-danger);
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
[data-admonition="caution"] .admonition-title::before,
|
|
692
|
-
.admonition-caution .admonition-title::before {
|
|
693
|
-
content: "⛔";
|
|
694
|
-
}
|
|
695
|
-
|
|
696
301
|
/* ========================================
|
|
697
302
|
* Code block buttons (copy + word wrap)
|
|
698
303
|
* ======================================== */
|
|
@@ -900,25 +505,6 @@ pre[class^="syntect-"] .line .highlighted-word {
|
|
|
900
505
|
margin: 0;
|
|
901
506
|
}
|
|
902
507
|
|
|
903
|
-
/* ========================================
|
|
904
|
-
* Mermaid diagrams
|
|
905
|
-
* ======================================== */
|
|
906
|
-
|
|
907
|
-
.zd-content .mermaid {
|
|
908
|
-
@apply my-vsp-lg flex justify-center;
|
|
909
|
-
}
|
|
910
|
-
|
|
911
|
-
.zd-content .mermaid svg {
|
|
912
|
-
max-width: 100%;
|
|
913
|
-
height: auto;
|
|
914
|
-
overflow: visible;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
/* Prevent mermaid edge labels from clipping text (foreignObject uses overflow:hidden) */
|
|
918
|
-
.zd-content .mermaid foreignObject {
|
|
919
|
-
overflow: visible;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
508
|
/* KaTeX math equations */
|
|
923
509
|
.katex {
|
|
924
510
|
font-size: 1.1em;
|
|
@@ -1270,4 +856,145 @@ dialog.zd-enlarge-dialog::backdrop {
|
|
|
1270
856
|
}
|
|
1271
857
|
}
|
|
1272
858
|
|
|
859
|
+
/* ========================================
|
|
860
|
+
* Mermaid enlarge (.zd-mermaid-enlargeable) — issue #2176 / #2178
|
|
861
|
+
*
|
|
862
|
+
* Unlike images (SSR-wrapped in figure.zd-enlargeable), mermaid diagrams render
|
|
863
|
+
* client-side, so the mermaid-enlarge island injects the `.zd-enlarge-btn` into
|
|
864
|
+
* each rendered `.mermaid` container and adds `.zd-mermaid-enlargeable` (which
|
|
865
|
+
* makes the container position:relative so the button anchors to it). The
|
|
866
|
+
* button + close-button visuals are SHARED with image-enlarge above
|
|
867
|
+
* (`.zd-enlarge-btn`, `.zd-enlarge-dialog-close`).
|
|
868
|
+
* ======================================== */
|
|
869
|
+
|
|
870
|
+
.zd-mermaid-enlargeable {
|
|
871
|
+
position: relative;
|
|
872
|
+
border: 1px solid transparent;
|
|
873
|
+
border-radius: var(--radius-DEFAULT);
|
|
874
|
+
transition: border-color var(--default-transition-duration);
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
/* The diagram is always enlargeable once the button is injected — show a subtle
|
|
878
|
+
* border affordance, accent on hover (mirrors the image-enlarge affordance). */
|
|
879
|
+
.zd-mermaid-enlargeable:has(.zd-enlarge-btn) {
|
|
880
|
+
cursor: pointer;
|
|
881
|
+
border-color: var(--color-muted);
|
|
882
|
+
}
|
|
883
|
+
|
|
884
|
+
.zd-mermaid-enlargeable:has(.zd-enlarge-btn):hover {
|
|
885
|
+
border-color: var(--color-accent);
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
/* Zoom/pan dialog. The `<dialog>` stays transform-free (see DIALOG_STYLE in
|
|
889
|
+
* mermaid-enlarge.tsx); the transform lives on .zd-mermaid-transform. */
|
|
890
|
+
dialog.zd-mermaid-dialog::backdrop {
|
|
891
|
+
background: color-mix(in oklch, var(--color-overlay) 80%, transparent);
|
|
892
|
+
}
|
|
893
|
+
|
|
894
|
+
/* Pan viewport — fills the dialog and clips the (possibly zoomed) diagram.
|
|
895
|
+
* touch-action:none so pointer-drag pans on touch without the browser
|
|
896
|
+
* intercepting the gesture for scrolling. */
|
|
897
|
+
.zd-mermaid-viewport {
|
|
898
|
+
width: 100%;
|
|
899
|
+
height: 100%;
|
|
900
|
+
overflow: hidden;
|
|
901
|
+
display: flex;
|
|
902
|
+
align-items: center;
|
|
903
|
+
justify-content: center;
|
|
904
|
+
touch-action: none;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
.zd-mermaid-viewport[data-pan-active] {
|
|
908
|
+
cursor: grab;
|
|
909
|
+
}
|
|
910
|
+
|
|
911
|
+
.zd-mermaid-viewport[data-pan-active]:active {
|
|
912
|
+
cursor: grabbing;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
.zd-mermaid-transform {
|
|
916
|
+
width: 100%;
|
|
917
|
+
height: 100%;
|
|
918
|
+
display: flex;
|
|
919
|
+
align-items: center;
|
|
920
|
+
justify-content: center;
|
|
921
|
+
will-change: transform;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/* SVG sizing — fit the cloned mermaid svg inside the dialog like
|
|
925
|
+
* object-fit:contain. The svg fills the viewport box (100% x 100%) and its
|
|
926
|
+
* viewBox content is letterboxed/centered by the default
|
|
927
|
+
* preserveAspectRatio="xMidYMid meet". A TALL diagram (e.g. a state diagram) no
|
|
928
|
+
* longer gets forced to full dialog width with `height:auto` driving the height
|
|
929
|
+
* far past the viewport via its aspect ratio — it now shrinks to fit the height
|
|
930
|
+
* instead. max-width/max-height !important neutralize the inline px sizing
|
|
931
|
+
* mermaid bakes onto the svg (without it the diagram renders tiny). Scoped to
|
|
932
|
+
* .zd-mermaid-transform (the cloned-diagram wrapper) so it does NOT hit the
|
|
933
|
+
* toolbar / close-button icon svgs that also live inside the dialog. */
|
|
934
|
+
.zd-mermaid-transform svg {
|
|
935
|
+
max-width: 100% !important;
|
|
936
|
+
max-height: 100% !important;
|
|
937
|
+
width: 100%;
|
|
938
|
+
height: 100%;
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
/* Edge labels (e.g. "Yes"/"No") render inside a tightly-sized <foreignObject>;
|
|
942
|
+
* when the cloned diagram is upscaled to fill the dialog, sub-pixel overflow
|
|
943
|
+
* makes the browser clip the last glyph at the foreignObject's right edge.
|
|
944
|
+
* Letting the foreignObject overflow render keeps the full label visible. */
|
|
945
|
+
.zd-mermaid-transform svg foreignObject {
|
|
946
|
+
overflow: visible;
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/* Toolbar — bottom-center pill of zoom/pan controls. */
|
|
950
|
+
.zd-mermaid-toolbar {
|
|
951
|
+
position: absolute;
|
|
952
|
+
bottom: var(--spacing-image-overlay-inset);
|
|
953
|
+
left: 50%;
|
|
954
|
+
transform: translateX(-50%);
|
|
955
|
+
display: flex;
|
|
956
|
+
gap: var(--spacing-hsp-2xs);
|
|
957
|
+
padding: var(--spacing-hsp-2xs);
|
|
958
|
+
border: 1px solid var(--color-muted);
|
|
959
|
+
border-radius: var(--radius-DEFAULT);
|
|
960
|
+
background: color-mix(in oklch, var(--color-surface) 92%, transparent);
|
|
961
|
+
z-index: var(--z-index-local-2);
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
.zd-mermaid-tool-btn {
|
|
965
|
+
display: flex;
|
|
966
|
+
align-items: center;
|
|
967
|
+
justify-content: center;
|
|
968
|
+
width: var(--spacing-icon-lg);
|
|
969
|
+
height: var(--spacing-icon-lg);
|
|
970
|
+
padding: var(--spacing-vsp-2xs);
|
|
971
|
+
border: none;
|
|
972
|
+
border-radius: var(--radius-DEFAULT);
|
|
973
|
+
background: transparent;
|
|
974
|
+
color: var(--color-fg);
|
|
975
|
+
cursor: pointer;
|
|
976
|
+
transition:
|
|
977
|
+
background-color var(--default-transition-duration),
|
|
978
|
+
opacity var(--default-transition-duration);
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
.zd-mermaid-tool-btn:hover:not([disabled]) {
|
|
982
|
+
background: color-mix(in oklch, var(--color-muted) 25%, transparent);
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
.zd-mermaid-tool-btn[aria-pressed="true"] {
|
|
986
|
+
background: color-mix(in oklch, var(--color-accent) 30%, transparent);
|
|
987
|
+
color: var(--color-accent);
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
.zd-mermaid-tool-btn[disabled] {
|
|
991
|
+
opacity: 0.4;
|
|
992
|
+
cursor: default;
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
.zd-mermaid-tool-btn > svg {
|
|
996
|
+
width: var(--spacing-icon-md);
|
|
997
|
+
height: var(--spacing-icon-md);
|
|
998
|
+
}
|
|
999
|
+
|
|
1273
1000
|
/* @slot:global-css:feature-styles */
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
// W6A stub — no-op default Preact wrapper.
|
|
2
|
-
//
|
|
3
|
-
// When the designTokenPanel feature is enabled, the feature template
|
|
4
|
-
// overwrites this file with the real wrapper that side-effect-imports
|
|
5
|
-
// `@/lib/design-token-panel-bootstrap` (which calls configurePanel and
|
|
6
|
-
// mounts zdtp). Generated projects without the feature ship the no-op
|
|
7
|
-
// so the unconditional `pages/lib/_body-end-islands` import resolves.
|
|
8
|
-
import type { JSX } from "preact";
|
|
9
|
-
|
|
10
|
-
function DesignTokenPanelBootstrap(): JSX.Element | null {
|
|
11
|
-
return null;
|
|
12
|
-
}
|
|
13
|
-
DesignTokenPanelBootstrap.displayName = "DesignTokenPanelBootstrap";
|
|
14
|
-
|
|
15
|
-
export default DesignTokenPanelBootstrap;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { settings } from "@/config/settings";
|
|
2
|
-
import type { HeaderRightItem } from "@/config/settings-types";
|
|
3
|
-
|
|
4
|
-
function isDesignTokenPanelEnabled(): boolean {
|
|
5
|
-
return Boolean(settings.designTokenPanel);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function filterHeaderRightItems(
|
|
9
|
-
items: HeaderRightItem[],
|
|
10
|
-
): HeaderRightItem[] {
|
|
11
|
-
return items.filter((item) => {
|
|
12
|
-
if (item.type === "trigger") {
|
|
13
|
-
if (item.trigger === "design-token-panel") {
|
|
14
|
-
return isDesignTokenPanelEnabled();
|
|
15
|
-
}
|
|
16
|
-
if (item.trigger === "ai-chat") {
|
|
17
|
-
return Boolean(settings.aiAssistant);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
if (item.type === "component") {
|
|
22
|
-
if (item.component === "theme-toggle") {
|
|
23
|
-
return Boolean(settings.colorMode);
|
|
24
|
-
}
|
|
25
|
-
if (item.component === "language-switcher") {
|
|
26
|
-
return Object.keys(settings.locales).length > 0;
|
|
27
|
-
}
|
|
28
|
-
if (item.component === "version-switcher") {
|
|
29
|
-
return Boolean(settings.versions);
|
|
30
|
-
}
|
|
31
|
-
if (item.component === "github-link") {
|
|
32
|
-
return Boolean(settings.githubUrl);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return true;
|
|
37
|
-
});
|
|
38
|
-
}
|