@bendyline/squisq-react 1.3.1 → 1.3.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.
Files changed (187) hide show
  1. package/dist/index.d.ts +710 -35
  2. package/dist/index.js +4288 -33
  3. package/dist/index.js.map +1 -1
  4. package/dist/squisq-player.global.js +1 -1
  5. package/dist/standalone-source.js +1 -1
  6. package/package.json +2 -2
  7. package/dist/BlockRenderer.d.ts +0 -37
  8. package/dist/BlockRenderer.d.ts.map +0 -1
  9. package/dist/BlockRenderer.js +0 -54
  10. package/dist/BlockRenderer.js.map +0 -1
  11. package/dist/CaptionOverlay.d.ts +0 -33
  12. package/dist/CaptionOverlay.d.ts.map +0 -1
  13. package/dist/CaptionOverlay.js +0 -44
  14. package/dist/CaptionOverlay.js.map +0 -1
  15. package/dist/DocControlsBottom.d.ts +0 -28
  16. package/dist/DocControlsBottom.d.ts.map +0 -1
  17. package/dist/DocControlsBottom.js +0 -27
  18. package/dist/DocControlsBottom.js.map +0 -1
  19. package/dist/DocControlsOverlay.d.ts +0 -28
  20. package/dist/DocControlsOverlay.d.ts.map +0 -1
  21. package/dist/DocControlsOverlay.js +0 -80
  22. package/dist/DocControlsOverlay.js.map +0 -1
  23. package/dist/DocControlsSidebar.d.ts +0 -27
  24. package/dist/DocControlsSidebar.d.ts.map +0 -1
  25. package/dist/DocControlsSidebar.js +0 -10
  26. package/dist/DocControlsSidebar.js.map +0 -1
  27. package/dist/DocControlsSlideshow.d.ts +0 -20
  28. package/dist/DocControlsSlideshow.d.ts.map +0 -1
  29. package/dist/DocControlsSlideshow.js +0 -69
  30. package/dist/DocControlsSlideshow.js.map +0 -1
  31. package/dist/DocPlayer.d.ts +0 -97
  32. package/dist/DocPlayer.d.ts.map +0 -1
  33. package/dist/DocPlayer.js +0 -657
  34. package/dist/DocPlayer.js.map +0 -1
  35. package/dist/DocPlayerWithSidebar.d.ts +0 -41
  36. package/dist/DocPlayerWithSidebar.d.ts.map +0 -1
  37. package/dist/DocPlayerWithSidebar.js +0 -69
  38. package/dist/DocPlayerWithSidebar.js.map +0 -1
  39. package/dist/DocProgressBar.d.ts +0 -31
  40. package/dist/DocProgressBar.d.ts.map +0 -1
  41. package/dist/DocProgressBar.js +0 -122
  42. package/dist/DocProgressBar.js.map +0 -1
  43. package/dist/InlineAudioPlayer.d.ts +0 -15
  44. package/dist/InlineAudioPlayer.d.ts.map +0 -1
  45. package/dist/InlineAudioPlayer.js +0 -22
  46. package/dist/InlineAudioPlayer.js.map +0 -1
  47. package/dist/InlineVideoPlayer.d.ts +0 -21
  48. package/dist/InlineVideoPlayer.d.ts.map +0 -1
  49. package/dist/InlineVideoPlayer.js +0 -29
  50. package/dist/InlineVideoPlayer.js.map +0 -1
  51. package/dist/LinearDocView.d.ts +0 -73
  52. package/dist/LinearDocView.d.ts.map +0 -1
  53. package/dist/LinearDocView.js +0 -451
  54. package/dist/LinearDocView.js.map +0 -1
  55. package/dist/MarkdownRenderer.d.ts +0 -32
  56. package/dist/MarkdownRenderer.d.ts.map +0 -1
  57. package/dist/MarkdownRenderer.js +0 -259
  58. package/dist/MarkdownRenderer.js.map +0 -1
  59. package/dist/SocialCaptionOverlay.d.ts +0 -27
  60. package/dist/SocialCaptionOverlay.d.ts.map +0 -1
  61. package/dist/SocialCaptionOverlay.js +0 -185
  62. package/dist/SocialCaptionOverlay.js.map +0 -1
  63. package/dist/__tests__/BlockRenderer.test.d.ts +0 -2
  64. package/dist/__tests__/BlockRenderer.test.d.ts.map +0 -1
  65. package/dist/__tests__/BlockRenderer.test.js +0 -82
  66. package/dist/__tests__/BlockRenderer.test.js.map +0 -1
  67. package/dist/__tests__/DocControlsSlideshow.test.d.ts +0 -2
  68. package/dist/__tests__/DocControlsSlideshow.test.d.ts.map +0 -1
  69. package/dist/__tests__/DocControlsSlideshow.test.js +0 -89
  70. package/dist/__tests__/DocControlsSlideshow.test.js.map +0 -1
  71. package/dist/__tests__/JsonView.test.d.ts +0 -2
  72. package/dist/__tests__/JsonView.test.d.ts.map +0 -1
  73. package/dist/__tests__/JsonView.test.js +0 -93
  74. package/dist/__tests__/JsonView.test.js.map +0 -1
  75. package/dist/__tests__/LinearDocView.test.d.ts +0 -2
  76. package/dist/__tests__/LinearDocView.test.d.ts.map +0 -1
  77. package/dist/__tests__/LinearDocView.test.js +0 -250
  78. package/dist/__tests__/LinearDocView.test.js.map +0 -1
  79. package/dist/__tests__/MarkdownRenderer.test.d.ts +0 -2
  80. package/dist/__tests__/MarkdownRenderer.test.d.ts.map +0 -1
  81. package/dist/__tests__/MarkdownRenderer.test.js +0 -208
  82. package/dist/__tests__/MarkdownRenderer.test.js.map +0 -1
  83. package/dist/__tests__/TableLayer.test.d.ts +0 -2
  84. package/dist/__tests__/TableLayer.test.d.ts.map +0 -1
  85. package/dist/__tests__/TableLayer.test.js +0 -121
  86. package/dist/__tests__/TableLayer.test.js.map +0 -1
  87. package/dist/__tests__/exports.test.d.ts +0 -2
  88. package/dist/__tests__/exports.test.d.ts.map +0 -1
  89. package/dist/__tests__/exports.test.js +0 -48
  90. package/dist/__tests__/exports.test.js.map +0 -1
  91. package/dist/hooks/AudioProvider.d.ts +0 -71
  92. package/dist/hooks/AudioProvider.d.ts.map +0 -1
  93. package/dist/hooks/AudioProvider.js +0 -52
  94. package/dist/hooks/AudioProvider.js.map +0 -1
  95. package/dist/hooks/MediaContext.d.ts +0 -35
  96. package/dist/hooks/MediaContext.d.ts.map +0 -1
  97. package/dist/hooks/MediaContext.js +0 -72
  98. package/dist/hooks/MediaContext.js.map +0 -1
  99. package/dist/hooks/index.d.ts +0 -6
  100. package/dist/hooks/index.d.ts.map +0 -1
  101. package/dist/hooks/index.js +0 -5
  102. package/dist/hooks/index.js.map +0 -1
  103. package/dist/hooks/useAudioSync.d.ts +0 -18
  104. package/dist/hooks/useAudioSync.d.ts.map +0 -1
  105. package/dist/hooks/useAudioSync.js +0 -340
  106. package/dist/hooks/useAudioSync.js.map +0 -1
  107. package/dist/hooks/useAutoSurface.d.ts +0 -11
  108. package/dist/hooks/useAutoSurface.d.ts.map +0 -1
  109. package/dist/hooks/useAutoSurface.js +0 -24
  110. package/dist/hooks/useAutoSurface.js.map +0 -1
  111. package/dist/hooks/useDocPlayback.d.ts +0 -47
  112. package/dist/hooks/useDocPlayback.d.ts.map +0 -1
  113. package/dist/hooks/useDocPlayback.js +0 -179
  114. package/dist/hooks/useDocPlayback.js.map +0 -1
  115. package/dist/hooks/useViewportOrientation.d.ts +0 -31
  116. package/dist/hooks/useViewportOrientation.d.ts.map +0 -1
  117. package/dist/hooks/useViewportOrientation.js +0 -92
  118. package/dist/hooks/useViewportOrientation.js.map +0 -1
  119. package/dist/index.d.ts.map +0 -1
  120. package/dist/jsonView/JsonView.d.ts +0 -26
  121. package/dist/jsonView/JsonView.d.ts.map +0 -1
  122. package/dist/jsonView/JsonView.js +0 -12
  123. package/dist/jsonView/JsonView.js.map +0 -1
  124. package/dist/jsonView/RenderNode.d.ts +0 -22
  125. package/dist/jsonView/RenderNode.d.ts.map +0 -1
  126. package/dist/jsonView/RenderNode.js +0 -30
  127. package/dist/jsonView/RenderNode.js.map +0 -1
  128. package/dist/jsonView/index.d.ts +0 -3
  129. package/dist/jsonView/index.d.ts.map +0 -1
  130. package/dist/jsonView/index.js +0 -2
  131. package/dist/jsonView/index.js.map +0 -1
  132. package/dist/jsonView/useJsonViewTokens.d.ts +0 -14
  133. package/dist/jsonView/useJsonViewTokens.d.ts.map +0 -1
  134. package/dist/jsonView/useJsonViewTokens.js +0 -34
  135. package/dist/jsonView/useJsonViewTokens.js.map +0 -1
  136. package/dist/jsonView/viewers.d.ts +0 -30
  137. package/dist/jsonView/viewers.d.ts.map +0 -1
  138. package/dist/jsonView/viewers.js +0 -226
  139. package/dist/jsonView/viewers.js.map +0 -1
  140. package/dist/layers/ImageLayer.d.ts +0 -23
  141. package/dist/layers/ImageLayer.d.ts.map +0 -1
  142. package/dist/layers/ImageLayer.js +0 -104
  143. package/dist/layers/ImageLayer.js.map +0 -1
  144. package/dist/layers/MapLayer.d.ts +0 -29
  145. package/dist/layers/MapLayer.d.ts.map +0 -1
  146. package/dist/layers/MapLayer.js +0 -97
  147. package/dist/layers/MapLayer.js.map +0 -1
  148. package/dist/layers/ShapeLayer.d.ts +0 -20
  149. package/dist/layers/ShapeLayer.d.ts.map +0 -1
  150. package/dist/layers/ShapeLayer.js +0 -39
  151. package/dist/layers/ShapeLayer.js.map +0 -1
  152. package/dist/layers/TableLayer.d.ts +0 -23
  153. package/dist/layers/TableLayer.d.ts.map +0 -1
  154. package/dist/layers/TableLayer.js +0 -58
  155. package/dist/layers/TableLayer.js.map +0 -1
  156. package/dist/layers/TextLayer.d.ts +0 -23
  157. package/dist/layers/TextLayer.d.ts.map +0 -1
  158. package/dist/layers/TextLayer.js +0 -126
  159. package/dist/layers/TextLayer.js.map +0 -1
  160. package/dist/layers/VideoLayer.d.ts +0 -40
  161. package/dist/layers/VideoLayer.d.ts.map +0 -1
  162. package/dist/layers/VideoLayer.js +0 -105
  163. package/dist/layers/VideoLayer.js.map +0 -1
  164. package/dist/layers/index.d.ts +0 -6
  165. package/dist/layers/index.d.ts.map +0 -1
  166. package/dist/layers/index.js +0 -6
  167. package/dist/layers/index.js.map +0 -1
  168. package/dist/standalone-entry.d.ts +0 -69
  169. package/dist/standalone-entry.d.ts.map +0 -1
  170. package/dist/standalone-entry.js +0 -185
  171. package/dist/standalone-entry.js.map +0 -1
  172. package/dist/types.d.ts +0 -154
  173. package/dist/types.d.ts.map +0 -1
  174. package/dist/types.js +0 -21
  175. package/dist/types.js.map +0 -1
  176. package/dist/utils/animationUtils.d.ts +0 -8
  177. package/dist/utils/animationUtils.d.ts.map +0 -1
  178. package/dist/utils/animationUtils.js +0 -8
  179. package/dist/utils/animationUtils.js.map +0 -1
  180. package/dist/utils/layerUtils.d.ts +0 -17
  181. package/dist/utils/layerUtils.d.ts.map +0 -1
  182. package/dist/utils/layerUtils.js +0 -37
  183. package/dist/utils/layerUtils.js.map +0 -1
  184. package/dist/utils/mapTileUtils.d.ts +0 -105
  185. package/dist/utils/mapTileUtils.d.ts.map +0 -1
  186. package/dist/utils/mapTileUtils.js +0 -268
  187. package/dist/utils/mapTileUtils.js.map +0 -1
@@ -1,451 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- /**
3
- * LinearDocView Component
4
- *
5
- * Renders a Doc as a long-scrolling document view. Each block is displayed
6
- * as a readable section: non-annotated blocks render their markdown content
7
- * as HTML, while template-annotated blocks render as inline SVG visual cards
8
- * via BlockRenderer.
9
- *
10
- * This is the view used when `displayMode === 'linear'` in DocPlayer.
11
- *
12
- * Layout:
13
- * - Scrollable container with max-width for readability
14
- * - Headings from the block hierarchy rendered as HTML headings
15
- * - Body content rendered via MarkdownRenderer
16
- * - Template-annotated sections show an SVG card (BlockRenderer)
17
- * using `getLayers()` for on-demand layer computation
18
- * - Blocks are rendered recursively to preserve the heading hierarchy
19
- */
20
- import { useMemo } from 'react';
21
- import { useAutoSurface } from './hooks/useAutoSurface';
22
- import { applySurface, resolveFontFamily, } from '@bendyline/squisq/schemas';
23
- import { VIEWPORT_PRESETS } from '@bendyline/squisq/schemas';
24
- import { getLayers, hasTemplate, DEFAULT_THEME } from '@bendyline/squisq/doc';
25
- import { extractPlainText } from '@bendyline/squisq/markdown';
26
- import { BlockRenderer } from './BlockRenderer';
27
- import { MarkdownRenderer } from './MarkdownRenderer';
28
- // ── Helpers ────────────────────────────────────────────────────────
29
- /**
30
- * Determine whether a block has a template annotation that should be
31
- * rendered as a visual SVG card. A block is "annotated" when:
32
- * 1. Its sourceHeading has a templateAnnotation, AND
33
- * 2. The annotated template exists in the registry
34
- */
35
- function isAnnotatedBlock(block) {
36
- const annotation = block.sourceHeading?.templateAnnotation;
37
- if (!annotation)
38
- return false;
39
- return !!annotation.template && hasTemplate(annotation.template);
40
- }
41
- /**
42
- * Count total blocks in a hierarchy (for RenderContext.totalBlocks).
43
- */
44
- function countAll(blocks) {
45
- let count = 0;
46
- for (const b of blocks) {
47
- count++;
48
- if (b.children)
49
- count += countAll(b.children);
50
- }
51
- return count;
52
- }
53
- /**
54
- * Render a single block section: heading + body content or SVG card.
55
- * Recurses into children to render the full heading tree.
56
- */
57
- function BlockSection({ block, basePath, viewport, renderContext, blockIndex }) {
58
- const isAnnotated = isAnnotatedBlock(block);
59
- // For annotated blocks, compute layers and build a Block with them
60
- const visualBlock = useMemo(() => {
61
- if (!isAnnotated)
62
- return null;
63
- const annotation = block.sourceHeading.templateAnnotation;
64
- const headingText = extractPlainText(block.sourceHeading);
65
- const bodyText = extractBodyPlainText(block.contents);
66
- // Build a TemplateBlock-compatible object
67
- const templateBlock = {
68
- id: block.id,
69
- template: annotation.template,
70
- startTime: 0,
71
- duration: 1,
72
- audioSegment: 0,
73
- title: headingText,
74
- ...getTemplateDefaults(annotation.template ?? 'sectionHeader', headingText, bodyText, block.contents),
75
- ...annotation.params,
76
- ...block.templateOverrides,
77
- };
78
- // Compute layers via getLayers
79
- const ctx = {
80
- ...renderContext,
81
- blockIndex,
82
- };
83
- const layers = getLayers(templateBlock, ctx);
84
- return {
85
- ...block,
86
- layers,
87
- template: annotation.template,
88
- };
89
- }, [block, isAnnotated, renderContext, blockIndex]);
90
- return (_jsxs("div", { className: "squisq-linear-section", "data-block-id": block.id, "data-template": isAnnotated ? block.sourceHeading?.templateAnnotation?.template : undefined, children: [block.sourceHeading && !isAnnotated && _jsx(MarkdownRenderer, { nodes: [block.sourceHeading] }), isAnnotated && visualBlock && (_jsx("div", { className: "squisq-linear-card", children: _jsx("div", { className: "squisq-linear-card-svg", style: {
91
- width: '100%',
92
- aspectRatio: `${viewport.width} / ${viewport.height}`,
93
- overflow: 'hidden',
94
- marginBottom: '1em',
95
- }, children: _jsx(BlockRenderer, { block: visualBlock, blockTime: 0, basePath: basePath, viewport: viewport }) }) })), !isAnnotated && block.contents && block.contents.length > 0 && (_jsx(MarkdownRenderer, { nodes: block.contents })), block.children && block.children.length > 0 && (_jsx("div", { className: "squisq-linear-children", children: block.children.map((child, i) => (_jsx(BlockSection, { block: child, basePath: basePath, viewport: viewport, renderContext: renderContext, blockIndex: blockIndex + i + 1 }, child.id))) }))] }));
96
- }
97
- // ── Template Defaults (mirrored from PreviewPanel) ─────────────────
98
- /** Extract plain text from block contents. */
99
- function extractBodyPlainText(contents) {
100
- if (!contents || contents.length === 0)
101
- return '';
102
- return contents
103
- .map((n) => extractPlainText(n))
104
- .join('\n')
105
- .trim();
106
- }
107
- /** Extract list items as plain text. */
108
- function extractListItems(contents) {
109
- if (!contents)
110
- return [];
111
- const items = [];
112
- for (const node of contents) {
113
- if (node.type === 'list') {
114
- for (const item of node.children) {
115
- const text = extractPlainText(item).trim();
116
- if (text)
117
- items.push(text);
118
- }
119
- }
120
- }
121
- return items;
122
- }
123
- /**
124
- * Find the first image referenced anywhere in block contents — both
125
- * markdown shorthand `![alt](url)` (type `image`) and raw HTML `<img>`
126
- * tags (type `htmlBlock`/`htmlInline`). The WYSIWYG editor emits the
127
- * HTML form whenever a user resizes an image (markdown shorthand has no
128
- * width syntax), so missing that path silently breaks every resized
129
- * image in the linear view.
130
- */
131
- function extractFirstImage(contents) {
132
- if (!contents || contents.length === 0)
133
- return null;
134
- function fromHtml(nodes) {
135
- for (const node of nodes) {
136
- if (!node || typeof node !== 'object')
137
- continue;
138
- const n = node;
139
- if (n.type === 'htmlElement' && n.tagName === 'img') {
140
- const attrs = n.attributes;
141
- if (attrs && typeof attrs.src === 'string' && attrs.src) {
142
- return {
143
- src: attrs.src,
144
- alt: typeof attrs.alt === 'string' ? attrs.alt : '',
145
- width: parseDim(attrs.width),
146
- height: parseDim(attrs.height),
147
- };
148
- }
149
- }
150
- if (Array.isArray(n.children)) {
151
- const found = fromHtml(n.children);
152
- if (found)
153
- return found;
154
- }
155
- }
156
- return null;
157
- }
158
- function walk(node) {
159
- if (!node || typeof node !== 'object')
160
- return null;
161
- const n = node;
162
- if (n.type === 'image' && typeof n.url === 'string' && n.url) {
163
- return { src: n.url, alt: typeof n.alt === 'string' ? n.alt : '' };
164
- }
165
- if ((n.type === 'htmlBlock' || n.type === 'htmlInline') && Array.isArray(n.htmlChildren)) {
166
- const found = fromHtml(n.htmlChildren);
167
- if (found)
168
- return found;
169
- }
170
- if (Array.isArray(n.children)) {
171
- for (const child of n.children) {
172
- const found = walk(child);
173
- if (found)
174
- return found;
175
- }
176
- }
177
- return null;
178
- }
179
- for (const node of contents) {
180
- const found = walk(node);
181
- if (found)
182
- return found;
183
- }
184
- return null;
185
- }
186
- /** Parse a `width`/`height` HTML attribute to a positive number. */
187
- function parseDim(raw) {
188
- if (raw === undefined)
189
- return undefined;
190
- const n = parseFloat(raw);
191
- return Number.isFinite(n) && n > 0 ? n : undefined;
192
- }
193
- /** Extract table data (headers, rows, alignment) from block contents. */
194
- function extractTableData(contents) {
195
- if (!contents)
196
- return null;
197
- for (const node of contents) {
198
- if (node.type === 'table') {
199
- const table = node;
200
- const [headerRow, ...bodyRows] = table.children;
201
- if (!headerRow)
202
- return null;
203
- const headers = headerRow.children.map((cell) => extractPlainText(cell).trim());
204
- const rows = bodyRows.map((row) => row.children.map((cell) => extractPlainText(cell).trim()));
205
- return { headers, rows, align: table.align };
206
- }
207
- }
208
- return null;
209
- }
210
- /**
211
- * Provide sensible default fields for templates that require more than
212
- * just a `title`. Prevents crashes from undefined required fields.
213
- */
214
- function getTemplateDefaults(templateName, headingText, bodyText, contents) {
215
- switch (templateName) {
216
- case 'statHighlight':
217
- return { stat: headingText, description: bodyText || headingText };
218
- case 'quote':
219
- case 'fullBleedQuote':
220
- case 'pullQuote':
221
- return { quote: bodyText || headingText };
222
- case 'factCard':
223
- return { fact: headingText, explanation: bodyText || headingText };
224
- case 'comparisonBar':
225
- return { leftLabel: 'A', leftValue: 60, rightLabel: 'B', rightValue: 40 };
226
- case 'list': {
227
- const items = extractListItems(contents);
228
- return { items: items.length > 0 ? items : ['Item 1', 'Item 2', 'Item 3'] };
229
- }
230
- case 'definitionCard':
231
- return { term: headingText, definition: bodyText || headingText };
232
- case 'dateEvent':
233
- return { date: headingText, description: bodyText || headingText };
234
- case 'dataTable': {
235
- const tableData = extractTableData(contents);
236
- return tableData ?? { headers: ['Column'], rows: [['Data']] };
237
- }
238
- case 'imageWithCaption': {
239
- // The template requires `imageSrc` — without it the image layer
240
- // renders a broken `<img src=undefined>`. Pull the first image
241
- // out of the block's body (markdown shorthand or HTML <img>) and
242
- // use the heading as a caption fallback so a bare `# Title
243
- // [Image with Caption]` block renders something sensible.
244
- const img = extractFirstImage(contents);
245
- if (!img)
246
- return { caption: headingText };
247
- return {
248
- imageSrc: img.src,
249
- imageAlt: img.alt || headingText,
250
- caption: headingText,
251
- };
252
- }
253
- case 'leftFeature':
254
- case 'rightFeature': {
255
- // Feature blocks pair an image with the heading + the first
256
- // paragraph of body text. Both inputs come from the section's
257
- // contents — the image via the same scan used by imageWithCaption,
258
- // the body text via the plain-text extractor that's already in
259
- // scope here.
260
- const img = extractFirstImage(contents);
261
- return {
262
- imageSrc: img?.src ?? '',
263
- imageAlt: img?.alt || headingText,
264
- imageWidth: img?.width,
265
- imageHeight: img?.height,
266
- title: headingText,
267
- body: bodyText,
268
- };
269
- }
270
- default:
271
- return {};
272
- }
273
- }
274
- // ── Main Component ─────────────────────────────────────────────────
275
- /**
276
- * Renders a Doc as a long-scrolling, readable document.
277
- *
278
- * Non-annotated blocks are rendered as HTML text (headings, paragraphs,
279
- * lists, etc.) via MarkdownRenderer. Template-annotated blocks are
280
- * rendered as inline SVG visual cards via BlockRenderer.
281
- *
282
- * @example
283
- * ```tsx
284
- * <LinearDocView doc={doc} basePath="/media/" />
285
- * ```
286
- */
287
- export function LinearDocView({ doc, basePath = '/', viewport, className, theme, surface, thinMargins = false, imageDisplayMode = 'inline', }) {
288
- const activeViewport = viewport ?? VIEWPORT_PRESETS.landscape;
289
- const totalBlocks = useMemo(() => countAll(doc.blocks), [doc.blocks]);
290
- const autoSurface = useAutoSurface(surface === 'auto');
291
- const resolvedSurface = surface === 'auto' ? autoSurface : surface;
292
- const renderContext = useMemo(() => {
293
- const baseTheme = theme ?? DEFAULT_THEME;
294
- return {
295
- theme: resolvedSurface ? applySurface(baseTheme, resolvedSurface) : baseTheme,
296
- viewport: activeViewport,
297
- totalBlocks,
298
- };
299
- }, [activeViewport, totalBlocks, theme, resolvedSurface]);
300
- const activeTheme = renderContext.theme;
301
- const bgColor = activeTheme.colors.background;
302
- const textColor = activeTheme.colors.text;
303
- const mutedColor = activeTheme.colors.textMuted;
304
- const primaryColor = activeTheme.colors.primary;
305
- const bodyFont = resolveFontFamily(activeTheme.typography.bodyFont, 'system-ui, sans-serif');
306
- const titleFont = resolveFontFamily(activeTheme.typography.titleFont, 'Georgia, serif');
307
- const lineHt = activeTheme.typography.lineHeight ?? 1.7;
308
- return (_jsx("div", { className: `squisq-linear ${className || ''}`, style: {
309
- width: '100%',
310
- // Thin-margins mode is the "embedded in someone else's container"
311
- // signal (chat bubble, sidebar preview). Fit to content there so
312
- // the host's bubble doesn't render a tall empty box when the doc
313
- // is short. Standalone mode keeps height:100% for full-viewport
314
- // scrolling.
315
- height: thinMargins ? 'auto' : '100%',
316
- overflowY: thinMargins ? 'visible' : 'auto',
317
- overflowX: 'hidden',
318
- background: bgColor,
319
- }, children: _jsxs("div", { className: `squisq-linear-content squisq-md${thinMargins ? ' squisq-linear-content--thin' : ''}${imageDisplayMode === 'thumbnail' ? ' squisq-linear-content--thumbnail-images' : ''}`, style: {
320
- // Thin-margins mode drops the 720px reading column + generous
321
- // page padding (right for standalone docs) in favor of a tight
322
- // layout that hugs its container (right for chat bubbles and
323
- // sidebar previews).
324
- maxWidth: thinMargins ? 'none' : '720px',
325
- margin: thinMargins ? '0' : '0 auto',
326
- padding: thinMargins ? '0' : '24px 16px',
327
- lineHeight: lineHt,
328
- fontSize: '16px',
329
- fontFamily: bodyFont,
330
- color: textColor,
331
- // CSS custom properties for MarkdownRenderer / nested elements
332
- '--squisq-linear-title-font': titleFont,
333
- '--squisq-linear-body-font': bodyFont,
334
- '--squisq-linear-text': textColor,
335
- '--squisq-linear-muted': mutedColor,
336
- '--squisq-linear-primary': primaryColor,
337
- '--squisq-linear-bg': bgColor,
338
- }, children: [_jsx("style", { children: `
339
- .squisq-linear-content h1,
340
- .squisq-linear-content h2,
341
- .squisq-linear-content h3,
342
- .squisq-linear-content h4,
343
- .squisq-linear-content h5,
344
- .squisq-linear-content h6 {
345
- font-family: var(--squisq-linear-title-font);
346
- color: var(--squisq-linear-text);
347
- margin-top: 1.2em;
348
- margin-bottom: 0.4em;
349
- }
350
- .squisq-linear-content h1 { font-size: 2em; }
351
- .squisq-linear-content h2 { font-size: 1.5em; }
352
- .squisq-linear-content h3 { font-size: 1.25em; }
353
- .squisq-linear-content p {
354
- margin-bottom: 0.75em;
355
- }
356
- .squisq-linear-content ul,
357
- .squisq-linear-content ol {
358
- padding-left: 2em;
359
- margin-bottom: 0.75em;
360
- }
361
- .squisq-linear-content li {
362
- margin-bottom: 0.3em;
363
- }
364
- .squisq-linear-content a {
365
- /* Blend the theme's primary toward the body text color so
366
- links stay theme-flavored but always have enough contrast
367
- against the background. Some themes (e.g. Gezellig) pick a
368
- mid-tone primary that's nearly invisible on a dark page
369
- without this lift. */
370
- color: color-mix(in srgb, var(--squisq-linear-primary) 65%, var(--squisq-linear-text));
371
- text-decoration: underline;
372
- text-decoration-thickness: 1px;
373
- text-underline-offset: 2px;
374
- }
375
- .squisq-linear-content a:hover {
376
- color: var(--squisq-linear-primary);
377
- }
378
- .squisq-linear-content code {
379
- color: var(--squisq-linear-primary);
380
- font-size: 0.9em;
381
- padding: 0.15em 0.3em;
382
- border-radius: 3px;
383
- background: rgba(128, 128, 128, 0.15);
384
- }
385
- .squisq-linear-content pre {
386
- padding: 1em;
387
- border-radius: 6px;
388
- background: rgba(0, 0, 0, 0.2);
389
- overflow-x: auto;
390
- margin-bottom: 0.75em;
391
- }
392
- .squisq-linear-content pre code {
393
- padding: 0;
394
- background: none;
395
- }
396
- .squisq-linear-content blockquote {
397
- border-left: 3px solid var(--squisq-linear-muted);
398
- color: var(--squisq-linear-muted);
399
- padding-left: 1em;
400
- margin-left: 0;
401
- margin-bottom: 0.75em;
402
- }
403
- .squisq-linear-content hr {
404
- border: none;
405
- border-top: 1px solid var(--squisq-linear-muted);
406
- margin: 1.5em 0;
407
- }
408
- .squisq-linear-content img {
409
- max-width: 100%;
410
- height: auto;
411
- border-radius: 6px;
412
- margin: 0.5em 0;
413
- }
414
- .squisq-linear-content--thumbnail-images img {
415
- max-width: 100px;
416
- max-height: 100px;
417
- width: auto;
418
- height: auto;
419
- object-fit: contain;
420
- display: block;
421
- }
422
- .squisq-linear-content strong {
423
- font-weight: 700;
424
- }
425
- .squisq-linear-content em {
426
- font-style: italic;
427
- }
428
- .squisq-linear-content table {
429
- width: 100%;
430
- border-collapse: collapse;
431
- margin: 1em 0;
432
- font-size: 0.95em;
433
- }
434
- .squisq-linear-content thead th {
435
- background: var(--squisq-linear-primary);
436
- color: var(--squisq-linear-bg);
437
- font-family: var(--squisq-linear-title-font);
438
- font-weight: 600;
439
- padding: 10px 14px;
440
- text-align: left;
441
- }
442
- .squisq-linear-content tbody td {
443
- padding: 8px 14px;
444
- border-bottom: 1px solid color-mix(in srgb, var(--squisq-linear-muted) 30%, transparent);
445
- }
446
- .squisq-linear-content tbody tr:hover {
447
- background: color-mix(in srgb, var(--squisq-linear-primary) 8%, transparent);
448
- }
449
- ` }), doc.blocks.map((block, i) => (_jsx(BlockSection, { block: block, basePath: basePath, viewport: activeViewport, renderContext: renderContext, blockIndex: i }, block.id)))] }) }));
450
- }
451
- //# sourceMappingURL=LinearDocView.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LinearDocView.js","sourceRoot":"","sources":["../src/LinearDocView.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,cAAc,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AAC,CAAC,CAAC,WAAW;gBACxC,UAAU,EAAE,MAAM;gBAClB,QAAQ,EAAE,MAAM;gBAChB,UAAU,EAAE,QAAQ;gBACpB,KAAK,EAAE,SAAS;gBAChB,+DAA+D;gBAC/D,4BAA4B,EAAE,SAAS;gBACvC,2BAA2B,EAAE,QAAQ;gBACrC,sBAAsB,EAAE,SAAS;gBACjC,uBAAuB,EAAE,UAAU;gBACnC,yBAAyB,EAAE,YAAY;gBACvC,oBAAoB,EAAE,OAAO;aACP,aAI1B,0BAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SA+GP,GAAS,EACT,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5B,KAAC,YAAY,IAEX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,cAAc,EACxB,aAAa,EAAE,aAAa,EAC5B,UAAU,EAAE,CAAC,IALR,KAAK,CAAC,EAAE,CAMb,CACH,CAAC,IACE,GACF,CACP,CAAC;AACJ,CAAC"}
@@ -1,32 +0,0 @@
1
- /**
2
- * MarkdownRenderer Component
3
- *
4
- * Converts a MarkdownBlockNode[] AST into React elements for rendering
5
- * markdown content as readable HTML. Used by LinearDocView to display
6
- * non-annotated document sections as flowing text.
7
- *
8
- * Supports all block and inline node types from the markdown DOM:
9
- * - Block: paragraph, heading, blockquote, list, code, table,
10
- * thematicBreak, math, htmlBlock, definitionList, directives
11
- * - Inline: text, emphasis, strong, delete, inlineCode, link,
12
- * image, break, inlineMath, htmlInline, footnoteReference
13
- *
14
- * All elements use the `squisq-md-*` CSS class prefix for styling.
15
- */
16
- import type { MarkdownBlockNode } from '@bendyline/squisq/markdown';
17
- export interface MarkdownRendererProps {
18
- /** Block-level AST nodes to render */
19
- nodes: MarkdownBlockNode[];
20
- /** Optional CSS class for the wrapper element */
21
- className?: string;
22
- }
23
- /**
24
- * Renders MarkdownBlockNode[] AST as React HTML elements.
25
- *
26
- * @example
27
- * ```tsx
28
- * <MarkdownRenderer nodes={block.contents} />
29
- * ```
30
- */
31
- export declare function MarkdownRenderer({ nodes, className }: MarkdownRendererProps): import("react/jsx-runtime").JSX.Element | null;
32
- //# sourceMappingURL=MarkdownRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"MarkdownRenderer.d.ts","sourceRoot":"","sources":["../src/MarkdownRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EACV,iBAAiB,EAOlB,MAAM,4BAA4B,CAAC;AAOpC,MAAM,WAAW,qBAAqB;IACpC,sCAAsC;IACtC,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,iDAAiD;IACjD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AA0eD;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,qBAAqB,kDAI3E"}