domotion-svg 0.11.0 → 0.12.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/capture/script/index.js +9 -0
- package/dist/capture/script/walker/form-controls.js +15 -4
- package/dist/capture/script.generated.js +1 -1
- package/dist/capture/types.d.ts +9 -0
- package/dist/render/element-tree-to-svg.d.ts +7 -0
- package/dist/render/element-tree-to-svg.js +104 -7
- package/dist/render/text-to-path.js +56 -1
- package/dist/render/text.d.ts +1 -0
- package/dist/render/text.js +45 -2
- package/dist/render/vertical-text.js +36 -2
- package/package.json +1 -1
|
@@ -575,6 +575,15 @@ export const captureScript = (args) => {
|
|
|
575
575
|
// the OpenType smcp feature; renderer applies synthesized small-caps
|
|
576
576
|
// when the active font lacks smcp (Helvetica, Times, etc.). DM-361.
|
|
577
577
|
fontVariantCaps: cs.fontVariantCaps,
|
|
578
|
+
// CSS font-variant-east-asian / -numeric / -ligatures. Each maps to a
|
|
579
|
+
// set of OpenType feature tags (e.g. `traditional` → `trad`, `jis78` →
|
|
580
|
+
// `jp78`, `oldstyle-nums` → `onum`) that the path renderer forwards to
|
|
581
|
+
// fontkit shaping. Without these, e.g. `font-variant-east-asian:
|
|
582
|
+
// traditional` paints the simplified/JP default glyph (国) instead of
|
|
583
|
+
// the traditional form (國). DM-1117.
|
|
584
|
+
fontVariantEastAsian: cs.fontVariantEastAsian,
|
|
585
|
+
fontVariantNumeric: cs.fontVariantNumeric,
|
|
586
|
+
fontVariantLigatures: cs.fontVariantLigatures,
|
|
578
587
|
direction: cs.direction,
|
|
579
588
|
// Computed BCP-47 language tag from el.lang or nearest ancestor
|
|
580
589
|
// [lang], falling back to document.documentElement.lang. Used by the
|
|
@@ -52,14 +52,25 @@ export const createFormControlsHandler = ({ normColor, resolvePseudo }) => {
|
|
|
52
52
|
meterHigh: tag === 'meter' ? (el.high != null ? +el.high : undefined) : undefined,
|
|
53
53
|
meterOptimum: tag === 'meter' ? (el.optimum != null ? +el.optimum : undefined) : undefined,
|
|
54
54
|
detailsOpen: tag === 'details' ? !!el.open : undefined,
|
|
55
|
-
// Detect if author CSS hid the summary's UA disclosure marker
|
|
56
|
-
//
|
|
57
|
-
//
|
|
58
|
-
//
|
|
55
|
+
// Detect if author CSS hid the summary's UA disclosure marker. If so,
|
|
56
|
+
// skip painting our own triangle — the author's custom marker (typically
|
|
57
|
+
// a ::before / ::after pseudo) is the only one that should show.
|
|
58
|
+
// - `list-style: none` / `list-style-type: none` removes the disclosure
|
|
59
|
+
// marker entirely (the marker IS a list-item ::marker with
|
|
60
|
+
// list-style-type `disclosure-closed`/`disclosure-open`; setting it to
|
|
61
|
+
// `none` drops it, exactly as for a styled <li>). This is the common
|
|
62
|
+
// idiom — `summary { list-style: none }` plus a custom ::after caret.
|
|
63
|
+
// DM-1115. Note `display: flex` on the summary does NOT itself suppress
|
|
64
|
+
// the marker — Chrome still paints it when list-style-type is a
|
|
65
|
+
// disclosure value, so we key off list-style-type, not display.
|
|
66
|
+
// - `::marker { color: transparent }` is the other author technique for
|
|
67
|
+
// hiding the UA triangle without changing the box model. DM-448.
|
|
59
68
|
summaryMarkerSuppressed: tag === 'details' ? (() => {
|
|
60
69
|
const sum = el.querySelector(':scope > summary');
|
|
61
70
|
if (sum == null)
|
|
62
71
|
return false;
|
|
72
|
+
if (window.getComputedStyle(sum).listStyleType === 'none')
|
|
73
|
+
return true;
|
|
63
74
|
const mc = window.getComputedStyle(sum, '::marker').color;
|
|
64
75
|
// 'transparent' or 'rgba(R, G, B, 0)' → alpha=0. 'rgb(R, G, B)' (no
|
|
65
76
|
// alpha component) is opaque and must NOT trigger suppression.
|