@brett_lamy/docstream 0.6.0 → 0.6.2

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/README.md CHANGED
@@ -32,6 +32,10 @@ Import the package CSS once near your app entrypoint:
32
32
  import "@brett_lamy/docstream/styles.css"
33
33
  ```
34
34
 
35
+ The stylesheet provides heading hierarchy and consistent spacing for the
36
+ `DocsRenderer`, `MarkdownContent`, and streaming render paths. Host CSS can
37
+ override those defaults through the normal cascade.
38
+
35
39
  If your TypeScript app checks CSS side-effect imports, include Vite's standard environment declaration or an equivalent CSS module declaration:
36
40
 
37
41
  ```ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brett_lamy/docstream",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "GitBook-aware readonly markdown and AI stream renderer.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -376,7 +376,11 @@ function isReactLanguage(language: string | null): boolean {
376
376
 
377
377
  function Blocks({ blocks, inline, liveRenderer, sourceRenderer }: { blocks: Block[]; inline?: boolean } & Renderers) {
378
378
  return (
379
- <div className={inline ? "docs-blocks-inline" : undefined} style={inline ? { display: "inline" } : undefined}>
379
+ <div
380
+ data-docstream-blocks=""
381
+ className={inline ? "docs-blocks-inline" : undefined}
382
+ style={inline ? { display: "inline" } : undefined}
383
+ >
380
384
  {blocks.map((b, i) => (
381
385
  <BlockView key={i} block={b} liveRenderer={liveRenderer} sourceRenderer={sourceRenderer} />
382
386
  ))}
package/src/styles.css CHANGED
@@ -68,44 +68,92 @@
68
68
  white-space: pre-wrap;
69
69
  }
70
70
 
71
+ :is([data-docstream], .docs-article) {
72
+ color: var(--foreground, #18181b);
73
+ line-height: 1.65;
74
+ font-size: 15.5px;
75
+ }
76
+
71
77
  .docs-article {
72
78
  max-width: 760px;
73
79
  margin: 0 auto;
74
80
  padding: 48px 32px 120px;
75
- line-height: 1.65;
76
- font-size: 15.5px;
77
81
  }
78
82
 
79
- .docs-article > div > * + * {
80
- margin-top: 0.85em;
83
+ :is([data-docstream], .docs-article) [data-docstream-blocks] > * {
84
+ margin-block: 0;
85
+ }
86
+
87
+ :is([data-docstream], .docs-article) [data-docstream-blocks] > * + * {
88
+ margin-block-start: 0.9em;
89
+ }
90
+
91
+ :is([data-docstream], .docs-article) [data-docstream-blocks] > :is(.docs-table, .docs-cards) {
92
+ margin-block-start: 0;
93
+ margin-block-end: 0;
94
+ }
95
+
96
+ :is([data-docstream], .docs-article) :is(h1, h2, h3, h4, h5, h6) {
97
+ color: inherit;
98
+ display: block;
99
+ font-family: inherit;
100
+ font-weight: 650;
101
+ line-height: 1.25;
102
+ margin-block: 1.6em 0.45em;
103
+ text-wrap: pretty;
104
+ }
105
+
106
+ :is([data-docstream], .docs-article) [data-docstream-blocks] > :is(h1, h2, h3, h4, h5, h6) {
107
+ margin-block-start: 1.6em;
108
+ }
109
+
110
+ :is([data-docstream], .docs-article) [data-docstream-blocks] > :first-child:is(h1, h2, h3, h4, h5, h6) {
111
+ margin-block-start: 0;
81
112
  }
82
113
 
83
- .docs-article h1 {
114
+ :is([data-docstream], .docs-article) h1 {
84
115
  font-size: 2.2em;
85
116
  font-weight: 700;
86
- margin-top: 0.6em;
87
117
  }
88
118
 
89
- .docs-article h2 {
119
+ :is([data-docstream], .docs-article) h2 {
90
120
  font-size: 1.5em;
91
- font-weight: 650;
92
- margin-top: 1.4em;
121
+ font-weight: 675;
93
122
  padding-bottom: 0.2em;
94
123
  border-bottom: 1px solid var(--border, #e4e4e7);
95
124
  }
96
125
 
97
- .docs-article h3 {
126
+ :is([data-docstream], .docs-article) h3 {
98
127
  font-size: 1.2em;
99
128
  font-weight: 600;
100
- margin-top: 1.1em;
101
129
  }
102
130
 
103
- .docs-article a {
131
+ :is([data-docstream], .docs-article) h4 {
132
+ font-size: 1.08em;
133
+ font-weight: 600;
134
+ }
135
+
136
+ :is([data-docstream], .docs-article) h5 {
137
+ font-size: 1em;
138
+ font-weight: 600;
139
+ }
140
+
141
+ :is([data-docstream], .docs-article) h6 {
142
+ font-size: 0.92em;
143
+ font-weight: 600;
144
+ letter-spacing: 0.02em;
145
+ }
146
+
147
+ :is([data-docstream], .docs-article) p {
148
+ margin-block: 0;
149
+ }
150
+
151
+ :is([data-docstream], .docs-article) a {
104
152
  color: var(--gb-primary);
105
153
  text-decoration: underline;
106
154
  }
107
155
 
108
- .docs-article code {
156
+ :is([data-docstream], .docs-article) code {
109
157
  background: var(--gb-muted);
110
158
  border-radius: 4px;
111
159
  padding: 0.15em 0.35em;
@@ -113,12 +161,12 @@
113
161
  font-family: ui-monospace, Menlo, monospace;
114
162
  }
115
163
 
116
- .docs-article ul {
164
+ :is([data-docstream], .docs-article) ul {
117
165
  list-style: disc;
118
166
  padding-left: 1.5em;
119
167
  }
120
168
 
121
- .docs-article ol {
169
+ :is([data-docstream], .docs-article) ol {
122
170
  list-style: decimal;
123
171
  padding-left: 1.5em;
124
172
  }
@@ -148,24 +196,24 @@
148
196
  margin: 0;
149
197
  }
150
198
 
151
- .docs-article blockquote {
199
+ :is([data-docstream], .docs-article) blockquote {
152
200
  border-left: 3px solid var(--gb-border);
153
201
  padding-left: 1em;
154
202
  color: var(--gb-muted-foreground);
155
203
  }
156
204
 
157
- .docs-article hr {
205
+ :is([data-docstream], .docs-article) hr {
158
206
  border: none;
159
207
  border-top: 1px solid var(--gb-border);
160
208
  margin: 2em 0;
161
209
  }
162
210
 
163
- .docs-article figure img {
211
+ :is([data-docstream], .docs-article) figure img {
164
212
  border-radius: 12px;
165
213
  max-width: 100%;
166
214
  }
167
215
 
168
- .docs-article figcaption {
216
+ :is([data-docstream], .docs-article) figcaption {
169
217
  text-align: center;
170
218
  font-size: 13px;
171
219
  color: var(--gb-muted-foreground);