@bendyline/squisq-react 2.11.15 → 2.11.17
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 +12 -0
- package/dist/{chunk-6PUMLLJH.js → chunk-2FZUFQO3.js} +2 -2
- package/dist/{chunk-P3FJ3YKS.js → chunk-2VSD55NT.js} +123 -415
- package/dist/chunk-5FJZDX7H.js +298 -0
- package/dist/{chunk-VUMNXXK4.js → chunk-622IA3KB.js} +12 -9
- package/dist/chunk-63G5OJWY.js +123 -0
- package/dist/{chunk-KDTKUE53.js → chunk-L4LIIOU2.js} +1 -1
- package/dist/{chunk-7T26IKW2.js → chunk-PSAO2CTF.js} +1 -1
- package/dist/{chunk-WHVSQ42V.js → chunk-PZCWGBRQ.js} +2 -2
- package/dist/{chunk-WLUZTUNZ.js → chunk-QXZXQPL3.js} +6 -50
- package/dist/{chunk-U2FIZWAL.js → chunk-SVVPYDV3.js} +160 -16
- package/dist/diagram-pictures/index.d.ts +61 -0
- package/dist/diagram-pictures/index.js +213 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +2 -2
- package/dist/index.js +24 -22
- package/dist/json-view/index.js +4 -4
- package/dist/layers/index.js +3 -3
- package/dist/markdown/index.js +3 -3
- package/dist/page/index.js +7 -6
- package/dist/player/index.js +10 -9
- package/dist/squisq-player.full.global.js +379 -378
- package/dist/squisq-player.global.js +71 -70
- package/dist/standalone-player-full.d.ts +1 -0
- package/dist/standalone-player-full.js +4 -0
- package/dist/standalone-source.js +1 -1
- package/package.json +10 -2
- package/dist/chunk-LR3AIGDD.js +0 -58
|
@@ -1,307 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ImageLayer,
|
|
3
|
-
MapLayer,
|
|
4
|
-
MermaidLayer,
|
|
5
|
-
PathLayer,
|
|
6
|
-
ShapeLayer,
|
|
7
|
-
TableLayer,
|
|
8
|
-
TextLayer,
|
|
9
|
-
TreeLayer,
|
|
10
|
-
VideoLayer,
|
|
11
|
-
getTransitionClass
|
|
12
|
-
} from "./chunk-WHVSQ42V.js";
|
|
13
1
|
import {
|
|
14
2
|
useAutoSurface
|
|
15
3
|
} from "./chunk-TT6ENR6T.js";
|
|
16
4
|
import {
|
|
17
5
|
InlineVideoPlayer,
|
|
18
6
|
MarkdownRenderer
|
|
19
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-2FZUFQO3.js";
|
|
8
|
+
import {
|
|
9
|
+
BlockRenderer
|
|
10
|
+
} from "./chunk-5FJZDX7H.js";
|
|
20
11
|
import {
|
|
21
12
|
useMediaUrl
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
|
|
24
|
-
// src/BlockRenderer.tsx
|
|
25
|
-
import { useId, useLayoutEffect, useRef, useState } from "react";
|
|
26
|
-
import { resolveTransitionDuration } from "@bendyline/squisq/schemas";
|
|
27
|
-
import { isGeometryBoundTemplate } from "@bendyline/squisq/doc";
|
|
28
|
-
|
|
29
|
-
// src/utils/textFit.ts
|
|
30
|
-
function largestFittingTextScale(fits, maximum = 2) {
|
|
31
|
-
if (maximum <= 1 || !fits(1)) return 1;
|
|
32
|
-
if (fits(maximum)) return maximum;
|
|
33
|
-
let low = 1;
|
|
34
|
-
let high = maximum;
|
|
35
|
-
for (let attempt = 0; attempt < 10; attempt += 1) {
|
|
36
|
-
const candidate = (low + high) / 2;
|
|
37
|
-
if (fits(candidate)) low = candidate;
|
|
38
|
-
else high = candidate;
|
|
39
|
-
}
|
|
40
|
-
return Math.max(1, Math.floor(low * 100) / 100);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
// src/BlockRenderer.tsx
|
|
44
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
45
|
-
var DEFAULT_VIEWPORT = {
|
|
46
|
-
width: 1920,
|
|
47
|
-
height: 1080
|
|
48
|
-
};
|
|
49
|
-
var FIT_TOLERANCE_PX = 1;
|
|
50
|
-
function applyTextScale(targets, scale) {
|
|
51
|
-
for (const target of targets) {
|
|
52
|
-
if (target.dataset.squisqTextFit === "html") {
|
|
53
|
-
const baseFontSize = Number(target.dataset.squisqBaseFontSize);
|
|
54
|
-
if (Number.isFinite(baseFontSize)) target.style.fontSize = `${baseFontSize * scale}px`;
|
|
55
|
-
} else {
|
|
56
|
-
target.style.transform = `scale(${scale})`;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
function cssPixels(value) {
|
|
61
|
-
const parsed = parseFloat(value);
|
|
62
|
-
return Number.isFinite(parsed) ? parsed : 0;
|
|
63
|
-
}
|
|
64
|
-
function htmlTargetFits(target) {
|
|
65
|
-
const content = target.querySelector('[data-squisq-text-content="true"]');
|
|
66
|
-
if (!content || content.scrollWidth <= 0 || content.scrollHeight <= 0) return false;
|
|
67
|
-
const view = target.ownerDocument.defaultView;
|
|
68
|
-
const computed = view?.getComputedStyle(target);
|
|
69
|
-
const horizontalInset = computed ? cssPixels(computed.paddingLeft) + cssPixels(computed.paddingRight) + cssPixels(computed.borderLeftWidth) + cssPixels(computed.borderRightWidth) : 0;
|
|
70
|
-
const verticalInset = computed ? cssPixels(computed.paddingTop) + cssPixels(computed.paddingBottom) + cssPixels(computed.borderTopWidth) + cssPixels(computed.borderBottomWidth) : 0;
|
|
71
|
-
const availableWidth = Math.max(0, target.clientWidth - horizontalInset);
|
|
72
|
-
const availableHeight = Math.max(0, target.clientHeight - verticalInset);
|
|
73
|
-
if (content.scrollWidth > availableWidth + FIT_TOLERANCE_PX || content.scrollHeight > availableHeight + FIT_TOLERANCE_PX) {
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
for (const scrollRegion of content.querySelectorAll("[data-squisq-table-scroll]")) {
|
|
77
|
-
if (scrollRegion.clientWidth > 0 && scrollRegion.scrollWidth > scrollRegion.clientWidth + FIT_TOLERANCE_PX || scrollRegion.clientHeight > 0 && scrollRegion.scrollHeight > scrollRegion.clientHeight + FIT_TOLERANCE_PX) {
|
|
78
|
-
return false;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
return true;
|
|
82
|
-
}
|
|
83
|
-
function svgTargetFits(target, scale) {
|
|
84
|
-
const content = target.querySelector('[data-squisq-text-content="true"]');
|
|
85
|
-
if (!content || typeof content.getBBox !== "function") return false;
|
|
86
|
-
try {
|
|
87
|
-
const box = content.getBBox();
|
|
88
|
-
const availableWidth = Number(target.dataset.squisqFitWidth);
|
|
89
|
-
const availableHeight = Number(target.dataset.squisqFitHeight);
|
|
90
|
-
return box.width > 0 && box.height > 0 && box.width * scale <= availableWidth + FIT_TOLERANCE_PX && box.height * scale <= availableHeight + FIT_TOLERANCE_PX;
|
|
91
|
-
} catch {
|
|
92
|
-
return false;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function renderedTextRects(targets) {
|
|
96
|
-
return targets.map(
|
|
97
|
-
(target) => target.querySelector('[data-squisq-text-content="true"]')?.getBoundingClientRect()
|
|
98
|
-
).filter((rect) => !!rect && rect.width > 0 && rect.height > 0);
|
|
99
|
-
}
|
|
100
|
-
function overlapPairs(rects) {
|
|
101
|
-
const pairs = /* @__PURE__ */ new Set();
|
|
102
|
-
for (let left = 0; left < rects.length; left += 1) {
|
|
103
|
-
for (let right = left + 1; right < rects.length; right += 1) {
|
|
104
|
-
const a = rects[left];
|
|
105
|
-
const b = rects[right];
|
|
106
|
-
if (a.left < b.right - FIT_TOLERANCE_PX && a.right > b.left + FIT_TOLERANCE_PX && a.top < b.bottom - FIT_TOLERANCE_PX && a.bottom > b.top + FIT_TOLERANCE_PX) {
|
|
107
|
-
pairs.add(`${left}:${right}`);
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
return pairs;
|
|
112
|
-
}
|
|
113
|
-
function BlockRenderer({
|
|
114
|
-
block,
|
|
115
|
-
blockTime,
|
|
116
|
-
basePath,
|
|
117
|
-
isEntering = false,
|
|
118
|
-
isExiting = false,
|
|
119
|
-
transition,
|
|
120
|
-
viewport = DEFAULT_VIEWPORT,
|
|
121
|
-
isPlaying,
|
|
122
|
-
muted = false,
|
|
123
|
-
animationsEnabled = true,
|
|
124
|
-
theme,
|
|
125
|
-
tableContentRenderer,
|
|
126
|
-
growTextToFit = false
|
|
127
|
-
}) {
|
|
128
|
-
let transitionClass = "";
|
|
129
|
-
const transitionStyle = {};
|
|
130
|
-
const activeTransition = animationsEnabled ? transition ?? block.transition : void 0;
|
|
131
|
-
if (activeTransition && isEntering) {
|
|
132
|
-
transitionClass = getTransitionClass(activeTransition.type, true, activeTransition.direction);
|
|
133
|
-
transitionStyle["--transition-duration"] = `${resolveTransitionDuration(activeTransition)}s`;
|
|
134
|
-
} else if (activeTransition && isExiting) {
|
|
135
|
-
transitionClass = getTransitionClass(activeTransition.type, false, activeTransition.direction);
|
|
136
|
-
transitionStyle["--transition-duration"] = `${resolveTransitionDuration(activeTransition)}s`;
|
|
137
|
-
}
|
|
138
|
-
const instanceId = useId().replace(/:/g, "");
|
|
139
|
-
const clipId = `vb-clip-${instanceId}-${block.id}`;
|
|
140
|
-
const svgRef = useRef(null);
|
|
141
|
-
const [textScale, setTextScale] = useState(1);
|
|
142
|
-
const growText = growTextToFit && !isGeometryBoundTemplate(block.template);
|
|
143
|
-
useLayoutEffect(() => {
|
|
144
|
-
const svg = svgRef.current;
|
|
145
|
-
let cancelled = false;
|
|
146
|
-
if (!svg) return;
|
|
147
|
-
const measure = () => {
|
|
148
|
-
if (cancelled) return;
|
|
149
|
-
const targets = Array.from(svg.querySelectorAll("[data-squisq-text-fit]"));
|
|
150
|
-
if (!growText || targets.length === 0) {
|
|
151
|
-
applyTextScale(targets, 1);
|
|
152
|
-
setTextScale(1);
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
applyTextScale(targets, 1);
|
|
156
|
-
const baselineOverlaps = overlapPairs(renderedTextRects(targets));
|
|
157
|
-
const fits = (scale) => {
|
|
158
|
-
applyTextScale(targets, scale);
|
|
159
|
-
if (targets.some(
|
|
160
|
-
(target) => target.dataset.squisqTextFit === "html" ? !htmlTargetFits(target) : !svgTargetFits(target, scale)
|
|
161
|
-
)) {
|
|
162
|
-
return false;
|
|
163
|
-
}
|
|
164
|
-
const candidateOverlaps = overlapPairs(renderedTextRects(targets));
|
|
165
|
-
for (const pair of candidateOverlaps) {
|
|
166
|
-
if (!baselineOverlaps.has(pair)) return false;
|
|
167
|
-
}
|
|
168
|
-
return true;
|
|
169
|
-
};
|
|
170
|
-
const nextScale = largestFittingTextScale(fits);
|
|
171
|
-
applyTextScale(targets, nextScale);
|
|
172
|
-
setTextScale((current) => current === nextScale ? current : nextScale);
|
|
173
|
-
};
|
|
174
|
-
measure();
|
|
175
|
-
const fonts = svg.ownerDocument?.fonts;
|
|
176
|
-
if (fonts && fonts.status !== "loaded") void fonts.ready.then(measure);
|
|
177
|
-
return () => {
|
|
178
|
-
cancelled = true;
|
|
179
|
-
};
|
|
180
|
-
}, [block.layers, growText, viewport.height, viewport.width]);
|
|
181
|
-
return /* @__PURE__ */ jsxs(
|
|
182
|
-
"svg",
|
|
183
|
-
{
|
|
184
|
-
ref: svgRef,
|
|
185
|
-
className: `block-svg ${transitionClass}`,
|
|
186
|
-
style: transitionStyle,
|
|
187
|
-
viewBox: `0 0 ${viewport.width} ${viewport.height}`,
|
|
188
|
-
preserveAspectRatio: "xMidYMid meet",
|
|
189
|
-
overflow: "hidden",
|
|
190
|
-
"data-block-id": block.id,
|
|
191
|
-
"data-squisq-text-scale": growText ? textScale : void 0,
|
|
192
|
-
children: [
|
|
193
|
-
/* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("clipPath", { id: clipId, children: /* @__PURE__ */ jsx("rect", { x: "0", y: "0", width: viewport.width, height: viewport.height }) }) }),
|
|
194
|
-
/* @__PURE__ */ jsx("g", { clipPath: `url(#${clipId})`, children: (block.layers ?? []).map((layer) => /* @__PURE__ */ jsx(
|
|
195
|
-
LayerRenderer,
|
|
196
|
-
{
|
|
197
|
-
block,
|
|
198
|
-
layer,
|
|
199
|
-
basePath,
|
|
200
|
-
viewport,
|
|
201
|
-
blockTime,
|
|
202
|
-
isPlaying,
|
|
203
|
-
muted,
|
|
204
|
-
animationsEnabled,
|
|
205
|
-
theme,
|
|
206
|
-
tableContentRenderer,
|
|
207
|
-
textScale
|
|
208
|
-
},
|
|
209
|
-
layer.id
|
|
210
|
-
)) })
|
|
211
|
-
]
|
|
212
|
-
}
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
function LayerRenderer({
|
|
216
|
-
block,
|
|
217
|
-
layer,
|
|
218
|
-
basePath,
|
|
219
|
-
viewport,
|
|
220
|
-
blockTime,
|
|
221
|
-
isPlaying,
|
|
222
|
-
muted,
|
|
223
|
-
animationsEnabled,
|
|
224
|
-
theme,
|
|
225
|
-
tableContentRenderer,
|
|
226
|
-
textScale
|
|
227
|
-
}) {
|
|
228
|
-
const renderedLayer = animationsEnabled || !layer.animation ? layer : { ...layer, animation: void 0 };
|
|
229
|
-
switch (renderedLayer.type) {
|
|
230
|
-
case "image":
|
|
231
|
-
return /* @__PURE__ */ jsx(
|
|
232
|
-
ImageLayer,
|
|
233
|
-
{
|
|
234
|
-
layer: renderedLayer,
|
|
235
|
-
basePath,
|
|
236
|
-
viewport,
|
|
237
|
-
blockTime,
|
|
238
|
-
animationsEnabled
|
|
239
|
-
}
|
|
240
|
-
);
|
|
241
|
-
case "text":
|
|
242
|
-
return /* @__PURE__ */ jsx(
|
|
243
|
-
TextLayer,
|
|
244
|
-
{
|
|
245
|
-
layer: renderedLayer,
|
|
246
|
-
viewport,
|
|
247
|
-
blockTime,
|
|
248
|
-
textScale
|
|
249
|
-
}
|
|
250
|
-
);
|
|
251
|
-
case "shape":
|
|
252
|
-
return /* @__PURE__ */ jsx(ShapeLayer, { layer: renderedLayer, viewport, blockTime });
|
|
253
|
-
case "path":
|
|
254
|
-
return /* @__PURE__ */ jsx(PathLayer, { layer: renderedLayer, viewport, blockTime });
|
|
255
|
-
case "map":
|
|
256
|
-
return /* @__PURE__ */ jsx(
|
|
257
|
-
MapLayer,
|
|
258
|
-
{
|
|
259
|
-
layer: renderedLayer,
|
|
260
|
-
basePath,
|
|
261
|
-
viewport,
|
|
262
|
-
blockTime
|
|
263
|
-
}
|
|
264
|
-
);
|
|
265
|
-
case "video":
|
|
266
|
-
return /* @__PURE__ */ jsx(
|
|
267
|
-
VideoLayer,
|
|
268
|
-
{
|
|
269
|
-
layer: renderedLayer,
|
|
270
|
-
basePath,
|
|
271
|
-
viewport,
|
|
272
|
-
blockTime,
|
|
273
|
-
isPlaying,
|
|
274
|
-
muted
|
|
275
|
-
}
|
|
276
|
-
);
|
|
277
|
-
case "table":
|
|
278
|
-
return /* @__PURE__ */ jsx(
|
|
279
|
-
TableLayer,
|
|
280
|
-
{
|
|
281
|
-
block,
|
|
282
|
-
layer: renderedLayer,
|
|
283
|
-
viewport,
|
|
284
|
-
blockTime,
|
|
285
|
-
contentRenderer: tableContentRenderer
|
|
286
|
-
}
|
|
287
|
-
);
|
|
288
|
-
case "tree":
|
|
289
|
-
return /* @__PURE__ */ jsx(TreeLayer, { layer: renderedLayer, viewport, blockTime });
|
|
290
|
-
case "mermaid":
|
|
291
|
-
return /* @__PURE__ */ jsx(
|
|
292
|
-
MermaidLayer,
|
|
293
|
-
{
|
|
294
|
-
layer: renderedLayer,
|
|
295
|
-
viewport,
|
|
296
|
-
blockTime,
|
|
297
|
-
theme
|
|
298
|
-
}
|
|
299
|
-
);
|
|
300
|
-
default:
|
|
301
|
-
console.warn(`Unknown layer type: ${renderedLayer.type}`);
|
|
302
|
-
return null;
|
|
303
|
-
}
|
|
304
|
-
}
|
|
13
|
+
} from "./chunk-63G5OJWY.js";
|
|
305
14
|
|
|
306
15
|
// src/page/PageViewContext.ts
|
|
307
16
|
import { createContext, useContext } from "react";
|
|
@@ -325,7 +34,7 @@ function usePageView() {
|
|
|
325
34
|
// src/page/CanvasSection.tsx
|
|
326
35
|
import { useMemo } from "react";
|
|
327
36
|
import { materializeBlockLayers } from "@bendyline/squisq/doc";
|
|
328
|
-
import { jsx
|
|
37
|
+
import { jsx } from "react/jsx-runtime";
|
|
329
38
|
function CanvasSection({ section }) {
|
|
330
39
|
const { renderContext, basePath, animationsEnabled, theme } = usePageView();
|
|
331
40
|
const media = section.slots.media;
|
|
@@ -342,7 +51,7 @@ function CanvasSection({ section }) {
|
|
|
342
51
|
const aspect = canvas.aspect;
|
|
343
52
|
const frame = section.hints?.frame;
|
|
344
53
|
const frameClass = frame === "terminal" ? " squisq-page-canvas--terminal squisq-page-canvas--framed" : " squisq-page-canvas--framed";
|
|
345
|
-
return /* @__PURE__ */
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
346
55
|
"div",
|
|
347
56
|
{
|
|
348
57
|
className: `squisq-page-canvas${frameClass}`,
|
|
@@ -353,7 +62,7 @@ function CanvasSection({ section }) {
|
|
|
353
62
|
maxHeight: "min(70vh, 720px)",
|
|
354
63
|
maxWidth: `calc(min(70vh, 720px) * ${(aspect.width / Math.max(1, aspect.height)).toFixed(4)})`
|
|
355
64
|
},
|
|
356
|
-
children: /* @__PURE__ */
|
|
65
|
+
children: /* @__PURE__ */ jsx(
|
|
357
66
|
BlockRenderer,
|
|
358
67
|
{
|
|
359
68
|
block: visualBlock,
|
|
@@ -370,7 +79,7 @@ function CanvasSection({ section }) {
|
|
|
370
79
|
|
|
371
80
|
// src/page/sections.tsx
|
|
372
81
|
import { sanitizeUrl } from "@bendyline/squisq/markdown";
|
|
373
|
-
import { Fragment, jsx as
|
|
82
|
+
import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
374
83
|
function PageImg({
|
|
375
84
|
media,
|
|
376
85
|
eager,
|
|
@@ -380,7 +89,7 @@ function PageImg({
|
|
|
380
89
|
const safeSrc = sanitizeUrl(media.src, "media");
|
|
381
90
|
const resolved = useMediaUrl(safeSrc ?? "", basePath);
|
|
382
91
|
if (!safeSrc) return null;
|
|
383
|
-
return /* @__PURE__ */
|
|
92
|
+
return /* @__PURE__ */ jsx2(
|
|
384
93
|
"img",
|
|
385
94
|
{
|
|
386
95
|
className,
|
|
@@ -400,7 +109,7 @@ function BackdropVideo({ media }) {
|
|
|
400
109
|
const safePoster = media.posterSrc ? sanitizeUrl(media.posterSrc, "media") : void 0;
|
|
401
110
|
const resolvedPoster = useMediaUrl(safePoster ?? "", basePath);
|
|
402
111
|
if (!safeSrc) return null;
|
|
403
|
-
return /* @__PURE__ */
|
|
112
|
+
return /* @__PURE__ */ jsx2(
|
|
404
113
|
"video",
|
|
405
114
|
{
|
|
406
115
|
src: resolvedSrc,
|
|
@@ -415,11 +124,11 @@ function BackdropVideo({ media }) {
|
|
|
415
124
|
}
|
|
416
125
|
function Eyebrow({ section }) {
|
|
417
126
|
if (!section.slots.eyebrow) return null;
|
|
418
|
-
return /* @__PURE__ */
|
|
127
|
+
return /* @__PURE__ */ jsx2("span", { className: "squisq-page-eyebrow", children: section.slots.eyebrow });
|
|
419
128
|
}
|
|
420
129
|
function MediaCredit({ media }) {
|
|
421
130
|
if (!media || media.type === "canvas" || !media.credit) return null;
|
|
422
|
-
return /* @__PURE__ */
|
|
131
|
+
return /* @__PURE__ */ jsxs("span", { className: "squisq-page-media-credit", children: [
|
|
423
132
|
media.credit,
|
|
424
133
|
media.license ? ` \xB7 ${media.license}` : ""
|
|
425
134
|
] });
|
|
@@ -429,33 +138,33 @@ function HeroSection({ section }) {
|
|
|
429
138
|
const media = section.slots.media;
|
|
430
139
|
const image = media?.type === "image" ? media : void 0;
|
|
431
140
|
const heroStyle = pageStyle.tokens.heroStyle;
|
|
432
|
-
const body = /* @__PURE__ */
|
|
433
|
-
/* @__PURE__ */
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
section.slots.subtitle && /* @__PURE__ */
|
|
141
|
+
const body = /* @__PURE__ */ jsxs("div", { className: "squisq-page-hero-body", children: [
|
|
142
|
+
/* @__PURE__ */ jsx2(Eyebrow, { section }),
|
|
143
|
+
/* @__PURE__ */ jsx2("h1", { className: "squisq-page-hero-title", children: section.slots.title }),
|
|
144
|
+
section.slots.subtitle && /* @__PURE__ */ jsx2("p", { className: "squisq-page-hero-subtitle", children: section.slots.subtitle })
|
|
436
145
|
] });
|
|
437
146
|
if (image && heroStyle === "split") {
|
|
438
|
-
return /* @__PURE__ */
|
|
147
|
+
return /* @__PURE__ */ jsxs("div", { className: "squisq-page-hero-grid", children: [
|
|
439
148
|
body,
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
/* @__PURE__ */
|
|
442
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ jsxs("div", { className: "squisq-page-hero-media squisq-page-media-frame", children: [
|
|
150
|
+
/* @__PURE__ */ jsx2(PageImg, { media: image, eager: true }),
|
|
151
|
+
/* @__PURE__ */ jsx2(MediaCredit, { media: image })
|
|
443
152
|
] })
|
|
444
153
|
] });
|
|
445
154
|
}
|
|
446
|
-
return /* @__PURE__ */
|
|
447
|
-
image && section.background === "media" && /* @__PURE__ */
|
|
155
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
156
|
+
image && section.background === "media" && /* @__PURE__ */ jsx2("div", { className: "squisq-page-hero-backdrop", children: /* @__PURE__ */ jsx2(PageImg, { media: image, eager: true }) }),
|
|
448
157
|
body
|
|
449
158
|
] });
|
|
450
159
|
}
|
|
451
160
|
function BannerSection({ section }) {
|
|
452
161
|
const media = section.slots.media;
|
|
453
162
|
const image = media?.type === "image" ? media : void 0;
|
|
454
|
-
return /* @__PURE__ */
|
|
455
|
-
image && section.background === "media" && /* @__PURE__ */
|
|
456
|
-
/* @__PURE__ */
|
|
457
|
-
/* @__PURE__ */
|
|
458
|
-
/* @__PURE__ */
|
|
163
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
164
|
+
image && section.background === "media" && /* @__PURE__ */ jsx2("div", { className: "squisq-page-hero-backdrop", children: /* @__PURE__ */ jsx2(PageImg, { media: image }) }),
|
|
165
|
+
/* @__PURE__ */ jsxs("div", { className: "squisq-page-banner-body", children: [
|
|
166
|
+
/* @__PURE__ */ jsx2(Eyebrow, { section }),
|
|
167
|
+
/* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title squisq-page-banner-title", children: section.slots.title })
|
|
459
168
|
] })
|
|
460
169
|
] });
|
|
461
170
|
}
|
|
@@ -466,31 +175,31 @@ function StatBandSection({ section }) {
|
|
|
466
175
|
(item) => typeof item.value === "number" ? item.value : Number.parseFloat(String(item.value ?? ""))
|
|
467
176
|
);
|
|
468
177
|
const maxValue = Math.max(1, ...numericValues.filter((value) => Number.isFinite(value)));
|
|
469
|
-
return /* @__PURE__ */
|
|
470
|
-
/* @__PURE__ */
|
|
471
|
-
/* @__PURE__ */
|
|
472
|
-
comparison && Number.isFinite(numericValues[i]) && /* @__PURE__ */
|
|
178
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
179
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-stats", children: items.map((item, i) => /* @__PURE__ */ jsxs("div", { className: `squisq-page-stat${comparison ? " squisq-page-stat--bars" : ""}`, children: [
|
|
180
|
+
/* @__PURE__ */ jsx2("span", { className: "squisq-page-stat-value", children: item.value }),
|
|
181
|
+
comparison && Number.isFinite(numericValues[i]) && /* @__PURE__ */ jsx2(
|
|
473
182
|
"div",
|
|
474
183
|
{
|
|
475
184
|
className: "squisq-page-stat-bar",
|
|
476
185
|
style: { width: `${Math.max(4, numericValues[i] / maxValue * 100)}%` }
|
|
477
186
|
}
|
|
478
187
|
),
|
|
479
|
-
item.title && /* @__PURE__ */
|
|
480
|
-
item.body && /* @__PURE__ */
|
|
188
|
+
item.title && /* @__PURE__ */ jsx2("span", { className: "squisq-page-stat-title", children: item.title }),
|
|
189
|
+
item.body && /* @__PURE__ */ jsx2("span", { className: "squisq-page-stat-body", children: item.body })
|
|
481
190
|
] }, i)) }),
|
|
482
|
-
section.slots.meta && /* @__PURE__ */
|
|
191
|
+
section.slots.meta && /* @__PURE__ */ jsx2("div", { className: "squisq-page-stat-meta", children: section.slots.meta })
|
|
483
192
|
] });
|
|
484
193
|
}
|
|
485
194
|
function QuoteBandSection({ section }) {
|
|
486
195
|
const media = section.slots.media;
|
|
487
196
|
const backdrop = section.background === "media" && media && media.type !== "canvas";
|
|
488
|
-
return /* @__PURE__ */
|
|
489
|
-
backdrop && /* @__PURE__ */
|
|
490
|
-
section.slots.title && /* @__PURE__ */
|
|
491
|
-
/* @__PURE__ */
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
section.slots.attribution && /* @__PURE__ */
|
|
197
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
198
|
+
backdrop && /* @__PURE__ */ jsx2("div", { className: "squisq-page-quote-backdrop", children: media.type === "image" ? /* @__PURE__ */ jsx2(PageImg, { media }) : /* @__PURE__ */ jsx2(BackdropVideo, { media }) }),
|
|
199
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title", children: section.slots.title }),
|
|
200
|
+
/* @__PURE__ */ jsxs("figure", { className: "squisq-page-quote-figure", style: { margin: 0 }, children: [
|
|
201
|
+
/* @__PURE__ */ jsx2("blockquote", { className: "squisq-page-quote", children: section.slots.body?.text }),
|
|
202
|
+
section.slots.attribution && /* @__PURE__ */ jsx2("figcaption", { className: "squisq-page-quote-attribution", children: section.slots.attribution })
|
|
494
203
|
] })
|
|
495
204
|
] });
|
|
496
205
|
}
|
|
@@ -501,15 +210,15 @@ function FeatureSplitSection({
|
|
|
501
210
|
const media = section.slots.media;
|
|
502
211
|
const image = media?.type === "image" ? media : void 0;
|
|
503
212
|
const mediaRight = flip ? section.variant !== "media-right" : section.variant === "media-right";
|
|
504
|
-
return /* @__PURE__ */
|
|
505
|
-
/* @__PURE__ */
|
|
506
|
-
image && /* @__PURE__ */
|
|
507
|
-
/* @__PURE__ */
|
|
213
|
+
return /* @__PURE__ */ jsxs("div", { className: `squisq-page-feature${mediaRight ? " squisq-page-feature--media-right" : ""}`, children: [
|
|
214
|
+
/* @__PURE__ */ jsxs("div", { className: "squisq-page-feature-media squisq-page-media-frame", children: [
|
|
215
|
+
image && /* @__PURE__ */ jsx2(PageImg, { media: image }),
|
|
216
|
+
/* @__PURE__ */ jsx2(MediaCredit, { media: image })
|
|
508
217
|
] }),
|
|
509
|
-
/* @__PURE__ */
|
|
510
|
-
/* @__PURE__ */
|
|
511
|
-
section.slots.title && /* @__PURE__ */
|
|
512
|
-
section.slots.body?.text && /* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ jsxs("div", { className: "squisq-page-feature-text", children: [
|
|
219
|
+
/* @__PURE__ */ jsx2(Eyebrow, { section }),
|
|
220
|
+
section.slots.title && /* @__PURE__ */ jsx2("h3", { className: "squisq-page-section-title squisq-page-feature-title", children: section.slots.title }),
|
|
221
|
+
section.slots.body?.text && /* @__PURE__ */ jsx2("p", { className: "squisq-page-feature-body", children: section.slots.body.text })
|
|
513
222
|
] })
|
|
514
223
|
] });
|
|
515
224
|
}
|
|
@@ -517,13 +226,13 @@ function MediaFigureSection({ section }) {
|
|
|
517
226
|
const { basePath } = usePageView();
|
|
518
227
|
const media = section.slots.media;
|
|
519
228
|
if (!media || media.type === "canvas") return null;
|
|
520
|
-
return /* @__PURE__ */
|
|
521
|
-
/* @__PURE__ */
|
|
522
|
-
(section.slots.caption || media.credit) && /* @__PURE__ */
|
|
229
|
+
return /* @__PURE__ */ jsxs("figure", { className: "squisq-page-figure", children: [
|
|
230
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-media-frame", children: media.type === "image" ? /* @__PURE__ */ jsx2(PageImg, { media }) : /* @__PURE__ */ jsx2(InlineVideoPlayer, { src: media.src, poster: media.posterSrc, basePath }) }),
|
|
231
|
+
(section.slots.caption || media.credit) && /* @__PURE__ */ jsxs("figcaption", { children: [
|
|
523
232
|
section.slots.caption,
|
|
524
|
-
media.credit && /* @__PURE__ */
|
|
233
|
+
media.credit && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
525
234
|
section.slots.caption ? " " : "",
|
|
526
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ jsx2(MediaCredit, { media })
|
|
527
236
|
] })
|
|
528
237
|
] })
|
|
529
238
|
] });
|
|
@@ -531,35 +240,35 @@ function MediaFigureSection({ section }) {
|
|
|
531
240
|
function GallerySection({ section }) {
|
|
532
241
|
const items = section.slots.items ?? [];
|
|
533
242
|
if (items.length === 0) {
|
|
534
|
-
return /* @__PURE__ */
|
|
535
|
-
section.slots.title && /* @__PURE__ */
|
|
536
|
-
section.slots.body?.text && /* @__PURE__ */
|
|
537
|
-
section.slots.caption && /* @__PURE__ */
|
|
243
|
+
return /* @__PURE__ */ jsxs("div", { className: "squisq-page-gallery-empty", children: [
|
|
244
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title", children: section.slots.title }),
|
|
245
|
+
section.slots.body?.text && /* @__PURE__ */ jsx2("p", { children: section.slots.body.text }),
|
|
246
|
+
section.slots.caption && /* @__PURE__ */ jsx2("div", { className: "squisq-page-gallery-caption", children: section.slots.caption })
|
|
538
247
|
] });
|
|
539
248
|
}
|
|
540
|
-
return /* @__PURE__ */
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
(item, i) => item.media?.type === "image" ? /* @__PURE__ */
|
|
249
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
250
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-gallery", children: items.map(
|
|
251
|
+
(item, i) => item.media?.type === "image" ? /* @__PURE__ */ jsx2("div", { className: "squisq-page-media-frame", children: /* @__PURE__ */ jsx2(PageImg, { media: item.media }) }, i) : null
|
|
543
252
|
) }),
|
|
544
|
-
section.slots.caption && /* @__PURE__ */
|
|
253
|
+
section.slots.caption && /* @__PURE__ */ jsx2("div", { className: "squisq-page-gallery-caption", children: section.slots.caption })
|
|
545
254
|
] });
|
|
546
255
|
}
|
|
547
256
|
function CalloutSection({ section }) {
|
|
548
257
|
const media = section.slots.media;
|
|
549
258
|
const image = media?.type === "image" ? media : void 0;
|
|
550
259
|
const framing = section.hints?.framing;
|
|
551
|
-
return /* @__PURE__ */
|
|
260
|
+
return /* @__PURE__ */ jsxs(
|
|
552
261
|
"div",
|
|
553
262
|
{
|
|
554
263
|
className: "squisq-page-callout",
|
|
555
264
|
"data-hint-framing": typeof framing === "string" ? framing : void 0,
|
|
556
265
|
children: [
|
|
557
|
-
image && /* @__PURE__ */
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
section.slots.title && /* @__PURE__ */
|
|
561
|
-
section.slots.body?.text && /* @__PURE__ */
|
|
562
|
-
section.slots.meta && /* @__PURE__ */
|
|
266
|
+
image && /* @__PURE__ */ jsx2("div", { className: "squisq-page-media-frame", children: /* @__PURE__ */ jsx2(PageImg, { media: image }) }),
|
|
267
|
+
/* @__PURE__ */ jsxs("div", { children: [
|
|
268
|
+
/* @__PURE__ */ jsx2(Eyebrow, { section }),
|
|
269
|
+
section.slots.title && /* @__PURE__ */ jsx2("h3", { className: "squisq-page-callout-title", children: section.slots.title }),
|
|
270
|
+
section.slots.body?.text && /* @__PURE__ */ jsx2("p", { className: "squisq-page-callout-body", children: section.slots.body.text }),
|
|
271
|
+
section.slots.meta && /* @__PURE__ */ jsx2("div", { className: "squisq-page-callout-meta", children: section.slots.meta })
|
|
563
272
|
] })
|
|
564
273
|
]
|
|
565
274
|
}
|
|
@@ -568,18 +277,18 @@ function CalloutSection({ section }) {
|
|
|
568
277
|
function CardGridSection({ section }) {
|
|
569
278
|
const { theme } = usePageView();
|
|
570
279
|
const items = section.slots.items ?? [];
|
|
571
|
-
return /* @__PURE__ */
|
|
572
|
-
section.slots.title && /* @__PURE__ */
|
|
573
|
-
/* @__PURE__ */
|
|
280
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
281
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title squisq-page-cards-title", children: section.slots.title }),
|
|
282
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-cards", children: items.map((item, i) => {
|
|
574
283
|
const scheme = item.accentScheme ? theme.colorSchemes?.[item.accentScheme] : void 0;
|
|
575
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ jsxs(
|
|
576
285
|
"div",
|
|
577
286
|
{
|
|
578
287
|
className: "squisq-page-card",
|
|
579
288
|
style: scheme ? { "--squisq-page-card-accent": scheme.accent } : void 0,
|
|
580
289
|
children: [
|
|
581
|
-
item.title && /* @__PURE__ */
|
|
582
|
-
item.body && /* @__PURE__ */
|
|
290
|
+
item.title && /* @__PURE__ */ jsx2("h3", { className: "squisq-page-card-title", children: item.title }),
|
|
291
|
+
item.body && /* @__PURE__ */ jsx2("p", { className: "squisq-page-card-body", children: item.body })
|
|
583
292
|
]
|
|
584
293
|
},
|
|
585
294
|
i
|
|
@@ -590,9 +299,9 @@ function CardGridSection({ section }) {
|
|
|
590
299
|
function ItemListSection({ section }) {
|
|
591
300
|
const { theme, showCodeCopyButton, onCopyCode, fenceRenderers, htmlPolicy, linkSchemes } = usePageView();
|
|
592
301
|
const items = section.slots.items ?? [];
|
|
593
|
-
return /* @__PURE__ */
|
|
594
|
-
section.slots.title && /* @__PURE__ */
|
|
595
|
-
/* @__PURE__ */
|
|
302
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
303
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title squisq-page-items-title", children: section.slots.title }),
|
|
304
|
+
/* @__PURE__ */ jsx2("ol", { className: "squisq-page-items", children: items.map((item, i) => /* @__PURE__ */ jsx2("li", { children: /* @__PURE__ */ jsx2("div", { className: "squisq-page-item-body", children: item.markdown ? /* @__PURE__ */ jsx2(
|
|
596
305
|
MarkdownRenderer,
|
|
597
306
|
{
|
|
598
307
|
nodes: item.markdown,
|
|
@@ -609,12 +318,12 @@ function ItemListSection({ section }) {
|
|
|
609
318
|
function TimelineRailSection({ section }) {
|
|
610
319
|
const milestone = section.slots.milestone;
|
|
611
320
|
if (!milestone) return null;
|
|
612
|
-
return /* @__PURE__ */
|
|
613
|
-
/* @__PURE__ */
|
|
614
|
-
/* @__PURE__ */
|
|
615
|
-
/* @__PURE__ */
|
|
321
|
+
return /* @__PURE__ */ jsxs("div", { className: "squisq-page-milestone", "data-mood": milestone.mood, children: [
|
|
322
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-milestone-date", children: milestone.date }),
|
|
323
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-milestone-rail", "aria-hidden": "true" }),
|
|
324
|
+
/* @__PURE__ */ jsxs("div", { className: "squisq-page-milestone-body", children: [
|
|
616
325
|
milestone.description,
|
|
617
|
-
milestone.footer && /* @__PURE__ */
|
|
326
|
+
milestone.footer && /* @__PURE__ */ jsx2("div", { className: "squisq-page-milestone-footer", children: milestone.footer })
|
|
618
327
|
] })
|
|
619
328
|
] });
|
|
620
329
|
}
|
|
@@ -622,17 +331,17 @@ function TableSection({ section }) {
|
|
|
622
331
|
const table = section.slots.table;
|
|
623
332
|
if (!table) return null;
|
|
624
333
|
const alignFor = (i) => table.align?.[i] ?? void 0;
|
|
625
|
-
return /* @__PURE__ */
|
|
626
|
-
section.slots.title && /* @__PURE__ */
|
|
627
|
-
/* @__PURE__ */
|
|
628
|
-
/* @__PURE__ */
|
|
629
|
-
/* @__PURE__ */
|
|
334
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
335
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title squisq-page-table-title", children: section.slots.title }),
|
|
336
|
+
/* @__PURE__ */ jsx2("div", { className: "squisq-page-table-scroll", children: /* @__PURE__ */ jsxs("table", { className: "squisq-page-table", children: [
|
|
337
|
+
/* @__PURE__ */ jsx2("thead", { children: /* @__PURE__ */ jsx2("tr", { children: table.headers.map((header, i) => /* @__PURE__ */ jsx2("th", { style: { textAlign: alignFor(i) }, children: header }, i)) }) }),
|
|
338
|
+
/* @__PURE__ */ jsx2("tbody", { children: table.rows.map((row, r) => /* @__PURE__ */ jsx2("tr", { children: row.map((cell, c) => /* @__PURE__ */ jsx2("td", { style: { textAlign: alignFor(c) }, children: cell }, c)) }, r)) })
|
|
630
339
|
] }) })
|
|
631
340
|
] });
|
|
632
341
|
}
|
|
633
342
|
function ProseSection({ section, block }) {
|
|
634
343
|
const { theme, showCodeCopyButton, onCopyCode, fenceRenderers, htmlPolicy, linkSchemes } = usePageView();
|
|
635
|
-
const heading = section.slots.title !== void 0 && block?.sourceHeading ? /* @__PURE__ */
|
|
344
|
+
const heading = section.slots.title !== void 0 && block?.sourceHeading ? /* @__PURE__ */ jsx2(
|
|
636
345
|
MarkdownRenderer,
|
|
637
346
|
{
|
|
638
347
|
nodes: [block.sourceHeading],
|
|
@@ -644,9 +353,9 @@ function ProseSection({ section, block }) {
|
|
|
644
353
|
}
|
|
645
354
|
) : null;
|
|
646
355
|
const bodyNodes = section.slots.body?.markdown ?? block?.contents;
|
|
647
|
-
return /* @__PURE__ */
|
|
356
|
+
return /* @__PURE__ */ jsxs("div", { className: "squisq-page-prose", children: [
|
|
648
357
|
heading,
|
|
649
|
-
bodyNodes && bodyNodes.length > 0 && /* @__PURE__ */
|
|
358
|
+
bodyNodes && bodyNodes.length > 0 && /* @__PURE__ */ jsx2(
|
|
650
359
|
MarkdownRenderer,
|
|
651
360
|
{
|
|
652
361
|
nodes: bodyNodes,
|
|
@@ -661,15 +370,15 @@ function ProseSection({ section, block }) {
|
|
|
661
370
|
] });
|
|
662
371
|
}
|
|
663
372
|
function FooterSection({ section }) {
|
|
664
|
-
return /* @__PURE__ */
|
|
665
|
-
/* @__PURE__ */
|
|
666
|
-
section.slots.title && /* @__PURE__ */
|
|
667
|
-
section.slots.body?.text && /* @__PURE__ */
|
|
373
|
+
return /* @__PURE__ */ jsxs("div", { children: [
|
|
374
|
+
/* @__PURE__ */ jsx2(Eyebrow, { section }),
|
|
375
|
+
section.slots.title && /* @__PURE__ */ jsx2("h2", { className: "squisq-page-section-title", children: section.slots.title }),
|
|
376
|
+
section.slots.body?.text && /* @__PURE__ */ jsx2("p", { children: section.slots.body.text })
|
|
668
377
|
] });
|
|
669
378
|
}
|
|
670
379
|
|
|
671
380
|
// src/page/PageSectionView.tsx
|
|
672
|
-
import { jsx as
|
|
381
|
+
import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
673
382
|
function heroHasBackdrop(section, heroStyle) {
|
|
674
383
|
return section.kind === "hero" && section.background === "media" && section.slots.media?.type === "image" && heroStyle !== "split";
|
|
675
384
|
}
|
|
@@ -686,36 +395,36 @@ function sectionBody(entry, featureFlip) {
|
|
|
686
395
|
const { section, block } = entry;
|
|
687
396
|
switch (section.kind) {
|
|
688
397
|
case "hero":
|
|
689
|
-
return /* @__PURE__ */
|
|
398
|
+
return /* @__PURE__ */ jsx3(HeroSection, { section, block });
|
|
690
399
|
case "banner":
|
|
691
|
-
return /* @__PURE__ */
|
|
400
|
+
return /* @__PURE__ */ jsx3(BannerSection, { section, block });
|
|
692
401
|
case "stat-band":
|
|
693
|
-
return /* @__PURE__ */
|
|
402
|
+
return /* @__PURE__ */ jsx3(StatBandSection, { section, block });
|
|
694
403
|
case "quote-band":
|
|
695
|
-
return /* @__PURE__ */
|
|
404
|
+
return /* @__PURE__ */ jsx3(QuoteBandSection, { section, block });
|
|
696
405
|
case "feature-split":
|
|
697
|
-
return /* @__PURE__ */
|
|
406
|
+
return /* @__PURE__ */ jsx3(FeatureSplitSection, { section, block, flip: featureFlip });
|
|
698
407
|
case "media-figure":
|
|
699
|
-
return /* @__PURE__ */
|
|
408
|
+
return /* @__PURE__ */ jsx3(MediaFigureSection, { section, block });
|
|
700
409
|
case "gallery":
|
|
701
|
-
return /* @__PURE__ */
|
|
410
|
+
return /* @__PURE__ */ jsx3(GallerySection, { section, block });
|
|
702
411
|
case "callout":
|
|
703
|
-
return /* @__PURE__ */
|
|
412
|
+
return /* @__PURE__ */ jsx3(CalloutSection, { section, block });
|
|
704
413
|
case "card-grid":
|
|
705
|
-
return /* @__PURE__ */
|
|
414
|
+
return /* @__PURE__ */ jsx3(CardGridSection, { section, block });
|
|
706
415
|
case "item-list":
|
|
707
|
-
return /* @__PURE__ */
|
|
416
|
+
return /* @__PURE__ */ jsx3(ItemListSection, { section, block });
|
|
708
417
|
case "timeline-rail":
|
|
709
|
-
return /* @__PURE__ */
|
|
418
|
+
return /* @__PURE__ */ jsx3(TimelineRailSection, { section, block });
|
|
710
419
|
case "table-section":
|
|
711
|
-
return /* @__PURE__ */
|
|
420
|
+
return /* @__PURE__ */ jsx3(TableSection, { section, block });
|
|
712
421
|
case "canvas-embed":
|
|
713
|
-
return /* @__PURE__ */
|
|
422
|
+
return /* @__PURE__ */ jsx3(CanvasSection, { section });
|
|
714
423
|
case "footer":
|
|
715
|
-
return /* @__PURE__ */
|
|
424
|
+
return /* @__PURE__ */ jsx3(FooterSection, { section, block });
|
|
716
425
|
case "prose":
|
|
717
426
|
default:
|
|
718
|
-
return /* @__PURE__ */
|
|
427
|
+
return /* @__PURE__ */ jsx3(ProseSection, { section, block });
|
|
719
428
|
}
|
|
720
429
|
}
|
|
721
430
|
function PageSectionView({ entry, featureFlip, isLeadProse }) {
|
|
@@ -746,7 +455,7 @@ function PageSectionView({ entry, featureFlip, isLeadProse }) {
|
|
|
746
455
|
if (section.hints?.dropCap && isLeadProse) hintAttrs["data-hint-drop-cap"] = "";
|
|
747
456
|
const headingLevel = section.kind !== "hero" && section.slots.title !== void 0 ? section.slots.headingLevel ?? entry.block?.sourceHeading?.depth : void 0;
|
|
748
457
|
if (headingLevel !== void 0) hintAttrs["data-heading-level"] = String(headingLevel);
|
|
749
|
-
return /* @__PURE__ */
|
|
458
|
+
return /* @__PURE__ */ jsx3(
|
|
750
459
|
"section",
|
|
751
460
|
{
|
|
752
461
|
className: classes.join(" "),
|
|
@@ -756,9 +465,9 @@ function PageSectionView({ entry, featureFlip, isLeadProse }) {
|
|
|
756
465
|
"data-template": section.template,
|
|
757
466
|
style: accentVars(section),
|
|
758
467
|
...hintAttrs,
|
|
759
|
-
children: /* @__PURE__ */
|
|
468
|
+
children: /* @__PURE__ */ jsxs2("div", { className: "squisq-page-section-inner", children: [
|
|
760
469
|
sectionBody(entry, featureFlip),
|
|
761
|
-
richContent && richContent.length > 0 && /* @__PURE__ */
|
|
470
|
+
richContent && richContent.length > 0 && /* @__PURE__ */ jsx3("div", { className: "squisq-page-rich-content", children: /* @__PURE__ */ jsx3(
|
|
762
471
|
MarkdownRenderer,
|
|
763
472
|
{
|
|
764
473
|
nodes: richContent,
|
|
@@ -776,7 +485,7 @@ function PageSectionView({ entry, featureFlip, isLeadProse }) {
|
|
|
776
485
|
}
|
|
777
486
|
|
|
778
487
|
// src/LinearDocView.tsx
|
|
779
|
-
import { useEffect, useMemo as useMemo2, useRef
|
|
488
|
+
import { useEffect, useMemo as useMemo2, useRef } from "react";
|
|
780
489
|
import {
|
|
781
490
|
applySurface,
|
|
782
491
|
resolveFontFamily
|
|
@@ -793,7 +502,7 @@ import {
|
|
|
793
502
|
} from "@bendyline/squisq/doc";
|
|
794
503
|
import { parseMarkdown } from "@bendyline/squisq/markdown";
|
|
795
504
|
import { fenceRendererLangs } from "@bendyline/squisq/fence";
|
|
796
|
-
import { jsx as
|
|
505
|
+
import { jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
797
506
|
function LinearDocView({
|
|
798
507
|
doc,
|
|
799
508
|
markdown,
|
|
@@ -815,7 +524,7 @@ function LinearDocView({
|
|
|
815
524
|
htmlPolicy,
|
|
816
525
|
linkSchemes
|
|
817
526
|
}) {
|
|
818
|
-
const scrollRef =
|
|
527
|
+
const scrollRef = useRef(null);
|
|
819
528
|
const activeViewport = viewport ?? VIEWPORT_PRESETS2.landscape;
|
|
820
529
|
const markdownDoc = useMemo2(
|
|
821
530
|
() => !doc && markdown !== void 0 ? markdownToDoc(parseMarkdown(markdown)) : void 0,
|
|
@@ -932,7 +641,7 @@ function LinearDocView({
|
|
|
932
641
|
return () => document.removeEventListener("keydown", handleKeyDown);
|
|
933
642
|
}, [globalKeyboardShortcuts]);
|
|
934
643
|
if (!resolvedDoc) {
|
|
935
|
-
return /* @__PURE__ */
|
|
644
|
+
return /* @__PURE__ */ jsx4("div", { ref: scrollRef, className: `squisq-linear squisq-linear--empty ${className || ""}` });
|
|
936
645
|
}
|
|
937
646
|
const bgColor = activeTheme.colors.background;
|
|
938
647
|
const textColor = activeTheme.colors.text;
|
|
@@ -949,7 +658,7 @@ function LinearDocView({
|
|
|
949
658
|
variant === "document" ? "squisq-linear-content--document squisq-page--document" : "",
|
|
950
659
|
imageDisplayMode === "thumbnail" ? "squisq-linear-content--thumbnail-images squisq-page--thumbnail-images" : ""
|
|
951
660
|
].filter(Boolean).join(" ");
|
|
952
|
-
return /* @__PURE__ */
|
|
661
|
+
return /* @__PURE__ */ jsx4(
|
|
953
662
|
"div",
|
|
954
663
|
{
|
|
955
664
|
ref: scrollRef,
|
|
@@ -974,7 +683,7 @@ function LinearDocView({
|
|
|
974
683
|
containerType: "inline-size",
|
|
975
684
|
containerName: "squisq-page"
|
|
976
685
|
},
|
|
977
|
-
children: /* @__PURE__ */
|
|
686
|
+
children: /* @__PURE__ */ jsxs3(
|
|
978
687
|
"div",
|
|
979
688
|
{
|
|
980
689
|
className: contentClasses,
|
|
@@ -995,11 +704,11 @@ function LinearDocView({
|
|
|
995
704
|
"--squisq-linear-bg": bgColor
|
|
996
705
|
},
|
|
997
706
|
children: [
|
|
998
|
-
/* @__PURE__ */
|
|
999
|
-
/* @__PURE__ */
|
|
707
|
+
/* @__PURE__ */ jsx4("style", { "data-squisq-page": "", children: PAGE_BASE_CSS }),
|
|
708
|
+
/* @__PURE__ */ jsx4(PageViewContext.Provider, { value: pageContext, children: sections.map((entry) => {
|
|
1000
709
|
const ordinal = featureOrdinals.get(entry.section.index) ?? 0;
|
|
1001
710
|
const flip = !!entry.section.hints?.alternate && ordinal % 2 === 1;
|
|
1002
|
-
return /* @__PURE__ */
|
|
711
|
+
return /* @__PURE__ */ jsx4(
|
|
1003
712
|
PageSectionView,
|
|
1004
713
|
{
|
|
1005
714
|
entry,
|
|
@@ -1017,7 +726,6 @@ function LinearDocView({
|
|
|
1017
726
|
}
|
|
1018
727
|
|
|
1019
728
|
export {
|
|
1020
|
-
BlockRenderer,
|
|
1021
729
|
PageViewContext,
|
|
1022
730
|
usePageView,
|
|
1023
731
|
CanvasSection,
|