@dfosco/storyboard 0.11.2 → 0.11.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dfosco/storyboard",
3
- "version": "0.11.2",
3
+ "version": "0.11.3",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Storyboard prototyping framework — core engine, React integration, and canvas",
@@ -57,7 +57,7 @@
57
57
  .text > :last-child { margin-bottom: 0; }
58
58
 
59
59
  .text p {
60
- margin: 0 0 0.5em;
60
+ margin: 0 0 0.4em;
61
61
  }
62
62
 
63
63
  .text h1,
@@ -76,13 +76,31 @@
76
76
 
77
77
  .text ul,
78
78
  .text ol {
79
- margin: 0 0 0.5em;
79
+ margin: 0 0 0.4em;
80
80
  padding-left: 1.25em;
81
81
  }
82
82
 
83
83
  .text ul { list-style: disc; }
84
84
  .text ol { list-style: decimal; }
85
- .text li { margin: 0 0 0.15em; }
85
+ .text li { margin: 0 0 0.1em; }
86
+
87
+ /* CommonMark loose-list compatibility: blank lines between list items
88
+ * cause remark to wrap each item's content in <p>. Without these resets
89
+ * the `.text p` margin pushes the bullet's text down and away from its
90
+ * marker, and adds extra vertical gap between items. Mirror of the
91
+ * shared markdownContent.module.css fix — duplicated here because the
92
+ * sticky's `.text p` rule competes with the shared `.contentSmall p`
93
+ * rule at the same specificity, so we need a local override too. */
94
+ .text li > p { margin: 0; }
95
+ .text li > p + p { margin-top: 0.25em; }
96
+
97
+ /* Em-relative <hr> margin so the rule scales with the sticky's
98
+ * autoScaleText (--sticky-text-scale). The shared
99
+ * markdownContent.module.css uses fixed `16px 0`, which produces
100
+ * visually huge gaps once the sticky scales its font-size up. */
101
+ .text hr {
102
+ margin: 0.6em 0;
103
+ }
86
104
 
87
105
  .text a {
88
106
  color: inherit;
@@ -29,4 +29,23 @@ describe('MarkdownView typography', () => {
29
29
  const cls = container.querySelector('div').className
30
30
  expect(cls).toMatch(/inert/)
31
31
  })
32
+
33
+ it('renders loose lists (blank lines between items) with <p>-wrapped items', () => {
34
+ // CommonMark turns a list with blank lines between items into a
35
+ // "loose list" — each <li> contains <p> rather than raw text. The
36
+ // shared markdownContent.module.css resets `li > p` margin so the
37
+ // bullet text stays aligned to its marker; without that the gap
38
+ // between items balloons. This test pins the HTML contract so the
39
+ // CSS reset has a stable shape to target.
40
+ const { container } = render(
41
+ <MarkdownView content={'- first\n\n- second\n\n- third'} />,
42
+ )
43
+ const items = container.querySelectorAll('li')
44
+ expect(items.length).toBe(3)
45
+ for (const li of items) {
46
+ const directParagraphs = Array.from(li.children).filter(c => c.tagName === 'P')
47
+ expect(directParagraphs.length).toBeGreaterThanOrEqual(1)
48
+ }
49
+ })
32
50
  })
51
+
@@ -71,6 +71,13 @@
71
71
  .contentSmall ul { margin: 0 0 8px; padding-left: 20px; list-style-type: disc; }
72
72
  .contentSmall ol { margin: 0 0 8px; padding-left: 20px; list-style-type: decimal; }
73
73
  .contentSmall li { margin: 0 0 2px; display: list-item; }
74
+ /* CommonMark loose-list compatibility: when items have blank lines between
75
+ * them, remark wraps each item's content in <p>. The global `.contentSmall p`
76
+ * margin (8px) would then blow up spacing inside the bullet and visually
77
+ * detach the text from its marker. Reset to zero inside <li>; restore a
78
+ * tighter rhythm only when an <li> contains multiple <p>s. */
79
+ .contentSmall li > p { margin: 0; }
80
+ .contentSmall li > p + p { margin-top: 4px; }
74
81
  .contentSmall input[type="checkbox"] {
75
82
  margin-right: 6px;
76
83
  accent-color: var(--sb--markdown-accent);
@@ -182,6 +189,9 @@
182
189
  .contentLarge ul { margin: 0 0 12px; padding-left: 24px; list-style: disc; }
183
190
  .contentLarge ol { margin: 0 0 12px; padding-left: 24px; list-style: decimal; }
184
191
  .contentLarge li { margin: 0 0 4px; display: list-item; }
192
+ /* CommonMark loose-list compatibility — see .contentSmall comment above. */
193
+ .contentLarge li > p { margin: 0; }
194
+ .contentLarge li > p + p { margin-top: 6px; }
185
195
  .contentLarge input[type="checkbox"] {
186
196
  margin-right: 6px;
187
197
  accent-color: var(--sb--markdown-accent);