@bendyline/squisq 0.1.2 → 1.0.1
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/{themeLibrary-DySHPcgj.d.ts → Doc-1hmT1LZl.d.ts} +1 -42
- package/dist/__tests__/animationUtils.test.d.ts +2 -0
- package/dist/__tests__/animationUtils.test.d.ts.map +1 -0
- package/dist/__tests__/animationUtils.test.js +60 -0
- package/dist/__tests__/animationUtils.test.js.map +1 -0
- package/dist/__tests__/contentExtractor.test.d.ts +2 -0
- package/dist/__tests__/contentExtractor.test.d.ts.map +1 -0
- package/dist/__tests__/contentExtractor.test.js +151 -0
- package/dist/__tests__/contentExtractor.test.js.map +1 -0
- package/dist/__tests__/geohash.test.d.ts +2 -0
- package/dist/__tests__/geohash.test.d.ts.map +1 -0
- package/dist/__tests__/geohash.test.js +87 -0
- package/dist/__tests__/geohash.test.js.map +1 -0
- package/dist/__tests__/getLayers.test.d.ts +2 -0
- package/dist/__tests__/getLayers.test.d.ts.map +1 -0
- package/dist/__tests__/getLayers.test.js +167 -0
- package/dist/__tests__/getLayers.test.js.map +1 -0
- package/dist/__tests__/haversine.test.d.ts +2 -0
- package/dist/__tests__/haversine.test.d.ts.map +1 -0
- package/dist/__tests__/haversine.test.js +56 -0
- package/dist/__tests__/haversine.test.js.map +1 -0
- package/dist/__tests__/localForageAdapter.test.d.ts +8 -0
- package/dist/__tests__/localForageAdapter.test.d.ts.map +1 -0
- package/dist/__tests__/localForageAdapter.test.js +130 -0
- package/dist/__tests__/localForageAdapter.test.js.map +1 -0
- package/dist/__tests__/markdown.test.d.ts +2 -0
- package/dist/__tests__/markdown.test.d.ts.map +1 -0
- package/dist/__tests__/markdown.test.js +654 -0
- package/dist/__tests__/markdown.test.js.map +1 -0
- package/dist/__tests__/markdownToDoc.test.d.ts +2 -0
- package/dist/__tests__/markdownToDoc.test.d.ts.map +1 -0
- package/dist/__tests__/markdownToDoc.test.js +313 -0
- package/dist/__tests__/markdownToDoc.test.js.map +1 -0
- package/dist/__tests__/seededRandom.test.d.ts +2 -0
- package/dist/__tests__/seededRandom.test.d.ts.map +1 -0
- package/dist/__tests__/seededRandom.test.js +125 -0
- package/dist/__tests__/seededRandom.test.js.map +1 -0
- package/dist/__tests__/slideshowGenerator.test.d.ts +2 -0
- package/dist/__tests__/slideshowGenerator.test.d.ts.map +1 -0
- package/dist/__tests__/slideshowGenerator.test.js +114 -0
- package/dist/__tests__/slideshowGenerator.test.js.map +1 -0
- package/dist/__tests__/storage.test.d.ts +2 -0
- package/dist/__tests__/storage.test.d.ts.map +1 -0
- package/dist/__tests__/storage.test.js +51 -0
- package/dist/__tests__/storage.test.js.map +1 -0
- package/dist/__tests__/templates.test.d.ts +2 -0
- package/dist/__tests__/templates.test.d.ts.map +1 -0
- package/dist/__tests__/templates.test.js +217 -0
- package/dist/__tests__/templates.test.js.map +1 -0
- package/dist/__tests__/timing.test.d.ts +2 -0
- package/dist/__tests__/timing.test.d.ts.map +1 -0
- package/dist/__tests__/timing.test.js +131 -0
- package/dist/__tests__/timing.test.js.map +1 -0
- package/dist/chunk-3E5F2XMR.js +129 -0
- package/dist/chunk-3E5F2XMR.js.map +1 -0
- package/dist/chunk-6YJPI6VI.js +35 -0
- package/dist/chunk-6YJPI6VI.js.map +1 -0
- package/dist/chunk-FVTQSNR7.js +100 -0
- package/dist/chunk-FVTQSNR7.js.map +1 -0
- package/dist/chunk-V543AI2F.js +1 -0
- package/dist/chunk-V543AI2F.js.map +1 -0
- package/dist/chunk-VP5SZTZ2.js +792 -0
- package/dist/chunk-VP5SZTZ2.js.map +1 -0
- package/dist/doc/docToMarkdown.d.ts +41 -0
- package/dist/doc/docToMarkdown.d.ts.map +1 -0
- package/dist/doc/docToMarkdown.js +88 -0
- package/dist/doc/docToMarkdown.js.map +1 -0
- package/dist/doc/getLayers.d.ts +65 -0
- package/dist/doc/getLayers.d.ts.map +1 -0
- package/dist/doc/getLayers.js +103 -0
- package/dist/doc/getLayers.js.map +1 -0
- package/dist/doc/index.d.ts +9 -3
- package/dist/doc/index.d.ts.map +1 -0
- package/dist/doc/index.js +6 -125
- package/dist/doc/index.js.map +1 -1
- package/dist/doc/markdownToDoc.d.ts +68 -0
- package/dist/doc/markdownToDoc.d.ts.map +1 -0
- package/dist/doc/markdownToDoc.js +225 -0
- package/dist/doc/markdownToDoc.js.map +1 -0
- package/dist/doc/templates/accentImage.d.ts +59 -0
- package/dist/doc/templates/accentImage.d.ts.map +1 -0
- package/dist/doc/templates/accentImage.js +275 -0
- package/dist/doc/templates/accentImage.js.map +1 -0
- package/dist/doc/templates/captionUtils.d.ts +20 -0
- package/dist/doc/templates/captionUtils.d.ts.map +1 -0
- package/dist/doc/templates/captionUtils.js +29 -0
- package/dist/doc/templates/captionUtils.js.map +1 -0
- package/dist/doc/templates/comparisonBar.d.ts +13 -0
- package/dist/doc/templates/comparisonBar.d.ts.map +1 -0
- package/dist/doc/templates/comparisonBar.js +127 -0
- package/dist/doc/templates/comparisonBar.js.map +1 -0
- package/dist/doc/templates/coverBlock.d.ts +51 -0
- package/dist/doc/templates/coverBlock.d.ts.map +1 -0
- package/dist/doc/templates/coverBlock.js +125 -0
- package/dist/doc/templates/coverBlock.js.map +1 -0
- package/dist/doc/templates/dateEvent.d.ts +15 -0
- package/dist/doc/templates/dateEvent.d.ts.map +1 -0
- package/dist/doc/templates/dateEvent.js +110 -0
- package/dist/doc/templates/dateEvent.js.map +1 -0
- package/dist/doc/templates/definitionCard.d.ts +13 -0
- package/dist/doc/templates/definitionCard.d.ts.map +1 -0
- package/dist/doc/templates/definitionCard.js +114 -0
- package/dist/doc/templates/definitionCard.js.map +1 -0
- package/dist/doc/templates/factCard.d.ts +15 -0
- package/dist/doc/templates/factCard.d.ts.map +1 -0
- package/dist/doc/templates/factCard.js +100 -0
- package/dist/doc/templates/factCard.js.map +1 -0
- package/dist/doc/templates/fullBleedQuote.d.ts +13 -0
- package/dist/doc/templates/fullBleedQuote.d.ts.map +1 -0
- package/dist/doc/templates/fullBleedQuote.js +54 -0
- package/dist/doc/templates/fullBleedQuote.js.map +1 -0
- package/dist/doc/templates/imageWithCaption.d.ts +13 -0
- package/dist/doc/templates/imageWithCaption.d.ts.map +1 -0
- package/dist/doc/templates/imageWithCaption.js +142 -0
- package/dist/doc/templates/imageWithCaption.js.map +1 -0
- package/dist/doc/templates/index.d.ts +104 -0
- package/dist/doc/templates/index.d.ts.map +1 -0
- package/dist/doc/templates/index.js +442 -0
- package/dist/doc/templates/index.js.map +1 -0
- package/dist/doc/templates/listBlock.d.ts +13 -0
- package/dist/doc/templates/listBlock.d.ts.map +1 -0
- package/dist/doc/templates/listBlock.js +89 -0
- package/dist/doc/templates/listBlock.js.map +1 -0
- package/dist/doc/templates/mapBlock.d.ts +17 -0
- package/dist/doc/templates/mapBlock.d.ts.map +1 -0
- package/dist/doc/templates/mapBlock.js +112 -0
- package/dist/doc/templates/mapBlock.js.map +1 -0
- package/dist/doc/templates/persistentLayers.d.ts +39 -0
- package/dist/doc/templates/persistentLayers.d.ts.map +1 -0
- package/dist/doc/templates/persistentLayers.js +447 -0
- package/dist/doc/templates/persistentLayers.js.map +1 -0
- package/dist/doc/templates/photoGrid.d.ts +20 -0
- package/dist/doc/templates/photoGrid.d.ts.map +1 -0
- package/dist/doc/templates/photoGrid.js +172 -0
- package/dist/doc/templates/photoGrid.js.map +1 -0
- package/dist/doc/templates/pullQuote.d.ts +13 -0
- package/dist/doc/templates/pullQuote.d.ts.map +1 -0
- package/dist/doc/templates/pullQuote.js +109 -0
- package/dist/doc/templates/pullQuote.js.map +1 -0
- package/dist/doc/templates/quoteBlock.d.ts +15 -0
- package/dist/doc/templates/quoteBlock.d.ts.map +1 -0
- package/dist/doc/templates/quoteBlock.js +97 -0
- package/dist/doc/templates/quoteBlock.js.map +1 -0
- package/dist/doc/templates/sectionHeader.d.ts +14 -0
- package/dist/doc/templates/sectionHeader.d.ts.map +1 -0
- package/dist/doc/templates/sectionHeader.js +96 -0
- package/dist/doc/templates/sectionHeader.js.map +1 -0
- package/dist/doc/templates/statHighlight.d.ts +15 -0
- package/dist/doc/templates/statHighlight.d.ts.map +1 -0
- package/dist/doc/templates/statHighlight.js +99 -0
- package/dist/doc/templates/statHighlight.js.map +1 -0
- package/dist/doc/templates/titleBlock.d.ts +13 -0
- package/dist/doc/templates/titleBlock.d.ts.map +1 -0
- package/dist/doc/templates/titleBlock.js +92 -0
- package/dist/doc/templates/titleBlock.js.map +1 -0
- package/dist/doc/templates/twoColumn.d.ts +15 -0
- package/dist/doc/templates/twoColumn.d.ts.map +1 -0
- package/dist/doc/templates/twoColumn.js +219 -0
- package/dist/doc/templates/twoColumn.js.map +1 -0
- package/dist/doc/templates/videoPullQuote.d.ts +20 -0
- package/dist/doc/templates/videoPullQuote.d.ts.map +1 -0
- package/dist/doc/templates/videoPullQuote.js +118 -0
- package/dist/doc/templates/videoPullQuote.js.map +1 -0
- package/dist/doc/templates/videoWithCaption.d.ts +20 -0
- package/dist/doc/templates/videoWithCaption.d.ts.map +1 -0
- package/dist/doc/templates/videoWithCaption.js +104 -0
- package/dist/doc/templates/videoWithCaption.js.map +1 -0
- package/dist/doc/utils/animationUtils.d.ts +34 -0
- package/dist/doc/utils/animationUtils.d.ts.map +1 -0
- package/dist/doc/utils/animationUtils.js +110 -0
- package/dist/doc/utils/animationUtils.js.map +1 -0
- package/dist/doc/utils/themeUtils.d.ts +55 -0
- package/dist/doc/utils/themeUtils.d.ts.map +1 -0
- package/dist/doc/utils/themeUtils.js +109 -0
- package/dist/doc/utils/themeUtils.js.map +1 -0
- package/dist/generate/contentExtractor.d.ts +112 -0
- package/dist/generate/contentExtractor.d.ts.map +1 -0
- package/dist/generate/contentExtractor.js +638 -0
- package/dist/generate/contentExtractor.js.map +1 -0
- package/dist/generate/index.d.ts +7 -0
- package/dist/generate/index.d.ts.map +1 -0
- package/dist/generate/index.js +4 -0
- package/dist/generate/index.js.map +1 -0
- package/dist/generate/slideshowGenerator.d.ts +72 -0
- package/dist/generate/slideshowGenerator.d.ts.map +1 -0
- package/dist/generate/slideshowGenerator.js +159 -0
- package/dist/generate/slideshowGenerator.js.map +1 -0
- package/dist/generate/templateMapper.d.ts +23 -0
- package/dist/generate/templateMapper.d.ts.map +1 -0
- package/dist/generate/templateMapper.js +114 -0
- package/dist/generate/templateMapper.js.map +1 -0
- package/dist/index.d.ts +9 -8
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -216
- package/dist/index.js.map +1 -1
- package/dist/markdown/convert.d.ts +71 -0
- package/dist/markdown/convert.d.ts.map +1 -0
- package/dist/markdown/convert.js +746 -0
- package/dist/markdown/convert.js.map +1 -0
- package/dist/markdown/htmlParse.d.ts +26 -0
- package/dist/markdown/htmlParse.d.ts.map +1 -0
- package/dist/markdown/htmlParse.js +195 -0
- package/dist/markdown/htmlParse.js.map +1 -0
- package/dist/markdown/index.d.ts +19 -225
- package/dist/markdown/index.d.ts.map +1 -0
- package/dist/markdown/index.js +33 -32
- package/dist/markdown/index.js.map +1 -1
- package/dist/markdown/parse.d.ts +27 -0
- package/dist/markdown/parse.d.ts.map +1 -0
- package/dist/markdown/parse.js +90 -0
- package/dist/markdown/parse.js.map +1 -0
- package/dist/markdown/stringify.d.ts +32 -0
- package/dist/markdown/stringify.d.ts.map +1 -0
- package/dist/markdown/stringify.js +108 -0
- package/dist/markdown/stringify.js.map +1 -0
- package/dist/markdown/types.d.ts +496 -0
- package/dist/markdown/types.d.ts.map +1 -0
- package/dist/markdown/types.js +17 -0
- package/dist/markdown/types.js.map +1 -0
- package/dist/markdown/utils.d.ts +78 -0
- package/dist/markdown/utils.d.ts.map +1 -0
- package/dist/markdown/utils.js +149 -0
- package/dist/markdown/utils.js.map +1 -0
- package/dist/random/SeededRandom.d.ts +50 -0
- package/dist/random/SeededRandom.d.ts.map +1 -0
- package/dist/random/SeededRandom.js +115 -0
- package/dist/random/SeededRandom.js.map +1 -0
- package/dist/random/index.d.ts +2 -0
- package/dist/random/index.d.ts.map +1 -0
- package/dist/random/index.js +2 -0
- package/dist/random/index.js.map +1 -0
- package/dist/schemas/BlockTemplates.d.ts +583 -0
- package/dist/schemas/BlockTemplates.d.ts.map +1 -0
- package/dist/schemas/BlockTemplates.js +72 -0
- package/dist/schemas/BlockTemplates.js.map +1 -0
- package/dist/schemas/Doc.d.ts +411 -0
- package/dist/schemas/Doc.d.ts.map +1 -0
- package/dist/schemas/Doc.js +90 -0
- package/dist/schemas/Doc.js.map +1 -0
- package/dist/schemas/LayoutStrategy.d.ts +84 -0
- package/dist/schemas/LayoutStrategy.d.ts.map +1 -0
- package/dist/schemas/LayoutStrategy.js +123 -0
- package/dist/schemas/LayoutStrategy.js.map +1 -0
- package/dist/schemas/MediaProvider.d.ts +65 -0
- package/dist/schemas/MediaProvider.d.ts.map +1 -0
- package/dist/schemas/MediaProvider.js +13 -0
- package/dist/schemas/MediaProvider.js.map +1 -0
- package/dist/schemas/Theme.d.ts +163 -0
- package/dist/schemas/Theme.d.ts.map +1 -0
- package/dist/schemas/Theme.js +62 -0
- package/dist/schemas/Theme.js.map +1 -0
- package/dist/schemas/Types.d.ts +14 -0
- package/dist/schemas/Types.d.ts.map +1 -0
- package/dist/schemas/Types.js +5 -0
- package/dist/schemas/Types.js.map +1 -0
- package/dist/schemas/Viewport.d.ts +74 -0
- package/dist/schemas/Viewport.d.ts.map +1 -0
- package/dist/schemas/Viewport.js +63 -0
- package/dist/schemas/Viewport.js.map +1 -0
- package/dist/schemas/index.d.ts +10 -70
- package/dist/schemas/index.d.ts.map +1 -0
- package/dist/schemas/index.js +7 -60
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/themeLibrary.d.ts +41 -0
- package/dist/schemas/themeLibrary.d.ts.map +1 -0
- package/dist/schemas/themeLibrary.js +466 -0
- package/dist/schemas/themeLibrary.js.map +1 -0
- package/dist/spatial/Geohash.d.ts +85 -0
- package/dist/spatial/Geohash.d.ts.map +1 -0
- package/dist/spatial/Geohash.js +142 -0
- package/dist/spatial/Geohash.js.map +1 -0
- package/dist/spatial/Haversine.d.ts +24 -0
- package/dist/spatial/Haversine.d.ts.map +1 -0
- package/dist/spatial/Haversine.js +48 -0
- package/dist/spatial/Haversine.js.map +1 -0
- package/dist/spatial/index.d.ts +3 -111
- package/dist/spatial/index.d.ts.map +1 -0
- package/dist/spatial/index.js +2 -24
- package/dist/spatial/index.js.map +1 -1
- package/dist/storage/LocalForageAdapter.d.ts +36 -0
- package/dist/storage/LocalForageAdapter.d.ts.map +1 -0
- package/dist/storage/LocalForageAdapter.js +82 -0
- package/dist/storage/LocalForageAdapter.js.map +1 -0
- package/dist/storage/LocalStorageAdapter.d.ts +16 -0
- package/dist/storage/LocalStorageAdapter.d.ts.map +1 -0
- package/dist/storage/LocalStorageAdapter.js +50 -0
- package/dist/storage/LocalStorageAdapter.js.map +1 -0
- package/dist/storage/MemoryStorageAdapter.d.ts +15 -0
- package/dist/storage/MemoryStorageAdapter.d.ts.map +1 -0
- package/dist/storage/MemoryStorageAdapter.js +34 -0
- package/dist/storage/MemoryStorageAdapter.js.map +1 -0
- package/dist/storage/Storage.d.ts +23 -0
- package/dist/storage/Storage.d.ts.map +1 -0
- package/dist/storage/Storage.js +9 -0
- package/dist/storage/Storage.js.map +1 -0
- package/dist/storage/index.d.ts +6 -91
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +3 -10
- package/dist/storage/index.js.map +1 -1
- package/dist/story/index.d.ts +3 -2
- package/dist/themeLibrary-DR1VRo-8.d.ts +44 -0
- package/dist/timing/index.d.ts +4 -0
- package/dist/timing/index.d.ts.map +1 -0
- package/dist/timing/index.js +3 -0
- package/dist/timing/index.js.map +1 -0
- package/dist/timing/narrationTiming.d.ts +54 -0
- package/dist/timing/narrationTiming.d.ts.map +1 -0
- package/dist/timing/narrationTiming.js +190 -0
- package/dist/timing/narrationTiming.js.map +1 -0
- package/dist/timing/readingTime.d.ts +54 -0
- package/dist/timing/readingTime.d.ts.map +1 -0
- package/dist/timing/readingTime.js +49 -0
- package/dist/timing/readingTime.js.map +1 -0
- package/package.json +17 -3
- package/src/__tests__/contentExtractor.test.ts +183 -0
- package/src/__tests__/seededRandom.test.ts +142 -0
- package/src/__tests__/slideshowGenerator.test.ts +128 -0
- package/src/__tests__/timing.test.ts +167 -0
- package/src/generate/contentExtractor.ts +808 -0
- package/src/generate/index.ts +21 -0
- package/src/generate/slideshowGenerator.ts +273 -0
- package/src/generate/templateMapper.ts +170 -0
- package/src/index.ts +3 -0
- package/src/random/SeededRandom.ts +127 -0
- package/src/random/index.ts +1 -0
- package/src/timing/index.ts +17 -0
- package/src/timing/narrationTiming.ts +220 -0
- package/src/timing/readingTime.ts +94 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Photo Grid Template
|
|
3
|
+
*
|
|
4
|
+
* Displays 2-4 images in a tiled layout for visual variety.
|
|
5
|
+
* Layout adapts based on image count and viewport orientation:
|
|
6
|
+
*
|
|
7
|
+
* Landscape:
|
|
8
|
+
* - 2 images: side-by-side 50/50
|
|
9
|
+
* - 3 images: one large left (60%) + two stacked right
|
|
10
|
+
* - 4 images: 2x2 grid
|
|
11
|
+
*
|
|
12
|
+
* Portrait (9:16): images stack horizontally (top/bottom) instead of
|
|
13
|
+
* side-by-side, giving each image full width on narrow screens.
|
|
14
|
+
*
|
|
15
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
16
|
+
*/
|
|
17
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
18
|
+
import { cleanCaption } from './captionUtils.js';
|
|
19
|
+
/** Gap between images as percentage */
|
|
20
|
+
const GAP = 0.5;
|
|
21
|
+
export function photoGrid(input, context) {
|
|
22
|
+
const { images, caption: rawCaption, ambientMotion } = input;
|
|
23
|
+
// Guard: images array is required
|
|
24
|
+
if (!images || images.length === 0)
|
|
25
|
+
return [];
|
|
26
|
+
const caption = rawCaption ? cleanCaption(rawCaption) : rawCaption;
|
|
27
|
+
const { theme, layout } = context;
|
|
28
|
+
const layers = [
|
|
29
|
+
// Black background (visible in gaps between images)
|
|
30
|
+
{
|
|
31
|
+
type: 'shape',
|
|
32
|
+
id: 'bg',
|
|
33
|
+
content: { shape: 'rect', fill: '#000000' },
|
|
34
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
35
|
+
},
|
|
36
|
+
];
|
|
37
|
+
// Reserve bottom space for caption — more room in landscape for larger text
|
|
38
|
+
const captionHeight = caption ? (layout.stackColumns ? 18 : 22) : 0;
|
|
39
|
+
const gridHeight = 100 - captionHeight;
|
|
40
|
+
// Generate image positions based on count; stack vertically in portrait
|
|
41
|
+
const positions = getGridPositions(images.length, gridHeight, layout.stackColumns);
|
|
42
|
+
const altFontSize = scaledFontSize(24, context, false);
|
|
43
|
+
for (let i = 0; i < Math.min(images.length, 4); i++) {
|
|
44
|
+
const img = images[i];
|
|
45
|
+
const pos = positions[i];
|
|
46
|
+
// Placeholder behind image (visible if image fails to load)
|
|
47
|
+
layers.push({
|
|
48
|
+
type: 'shape',
|
|
49
|
+
id: `grid-placeholder-${i}`,
|
|
50
|
+
content: { shape: 'rect', fill: theme.colors.background },
|
|
51
|
+
position: { x: `${pos.x}%`, y: `${pos.y}%`, width: `${pos.w}%`, height: `${pos.h}%` },
|
|
52
|
+
});
|
|
53
|
+
// Alt-text label on placeholder
|
|
54
|
+
if (img.alt) {
|
|
55
|
+
layers.push({
|
|
56
|
+
type: 'text',
|
|
57
|
+
id: `grid-alt-${i}`,
|
|
58
|
+
content: {
|
|
59
|
+
text: img.alt,
|
|
60
|
+
style: {
|
|
61
|
+
fontSize: altFontSize,
|
|
62
|
+
color: theme.colors.textMuted,
|
|
63
|
+
textAlign: 'center',
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
position: { x: `${pos.x + pos.w / 2}%`, y: `${pos.y + pos.h / 2}%`, anchor: 'center' },
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
// Image layer (covers placeholder when loaded)
|
|
70
|
+
layers.push({
|
|
71
|
+
type: 'image',
|
|
72
|
+
id: `grid-img-${i}`,
|
|
73
|
+
content: {
|
|
74
|
+
src: img.src,
|
|
75
|
+
alt: img.alt,
|
|
76
|
+
fit: 'cover',
|
|
77
|
+
credit: img.credit,
|
|
78
|
+
license: img.license,
|
|
79
|
+
},
|
|
80
|
+
position: {
|
|
81
|
+
x: `${pos.x}%`,
|
|
82
|
+
y: `${pos.y}%`,
|
|
83
|
+
width: `${pos.w}%`,
|
|
84
|
+
height: `${pos.h}%`,
|
|
85
|
+
},
|
|
86
|
+
// Apply ambient motion to the first (largest) image only
|
|
87
|
+
animation: i === 0 && ambientMotion
|
|
88
|
+
? { type: ambientMotion, duration: 15 }
|
|
89
|
+
: { type: 'fadeIn', duration: 1, delay: 0.2 * i },
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
// Caption with gradient overlay
|
|
93
|
+
if (caption) {
|
|
94
|
+
const captionFontSize = scaledFontSize(layout.stackColumns ? 28 : 40, context, false);
|
|
95
|
+
layers.push({
|
|
96
|
+
type: 'shape',
|
|
97
|
+
id: 'caption-bg',
|
|
98
|
+
content: {
|
|
99
|
+
shape: 'rect',
|
|
100
|
+
fill: 'linear-gradient(transparent, rgba(0,0,0,0.8))',
|
|
101
|
+
},
|
|
102
|
+
position: { x: 0, y: `${gridHeight - 4}%`, width: '100%', height: `${captionHeight + 4}%` },
|
|
103
|
+
});
|
|
104
|
+
layers.push({
|
|
105
|
+
type: 'text',
|
|
106
|
+
id: 'caption',
|
|
107
|
+
content: {
|
|
108
|
+
text: caption,
|
|
109
|
+
style: {
|
|
110
|
+
fontSize: captionFontSize,
|
|
111
|
+
color: theme.colors.text,
|
|
112
|
+
textAlign: 'center',
|
|
113
|
+
shadow: true,
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
position: {
|
|
117
|
+
x: '50%',
|
|
118
|
+
y: `${gridHeight + (layout.stackColumns ? captionHeight / 2 : captionHeight * 0.3)}%`,
|
|
119
|
+
anchor: 'center',
|
|
120
|
+
width: '90%',
|
|
121
|
+
},
|
|
122
|
+
animation: { type: 'fadeIn', duration: 1, delay: 0.5 },
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
return layers;
|
|
126
|
+
}
|
|
127
|
+
function getGridPositions(count, gridHeight, stacked) {
|
|
128
|
+
const halfW = 50 - GAP / 2;
|
|
129
|
+
const halfH = gridHeight / 2 - GAP / 2;
|
|
130
|
+
switch (count) {
|
|
131
|
+
case 2:
|
|
132
|
+
if (stacked) {
|
|
133
|
+
// Portrait: stack top/bottom
|
|
134
|
+
return [
|
|
135
|
+
{ x: 0, y: 0, w: 100, h: halfH },
|
|
136
|
+
{ x: 0, y: gridHeight / 2 + GAP / 2, w: 100, h: halfH },
|
|
137
|
+
];
|
|
138
|
+
}
|
|
139
|
+
return [
|
|
140
|
+
{ x: 0, y: 0, w: halfW, h: gridHeight },
|
|
141
|
+
{ x: 50 + GAP / 2, y: 0, w: halfW, h: gridHeight },
|
|
142
|
+
];
|
|
143
|
+
case 3: {
|
|
144
|
+
if (stacked) {
|
|
145
|
+
// Portrait: stack all three vertically
|
|
146
|
+
const thirdH = gridHeight / 3 - (GAP * 2) / 3;
|
|
147
|
+
return [
|
|
148
|
+
{ x: 0, y: 0, w: 100, h: thirdH },
|
|
149
|
+
{ x: 0, y: gridHeight / 3 + GAP / 3, w: 100, h: thirdH },
|
|
150
|
+
{ x: 0, y: (gridHeight * 2) / 3 + (GAP * 2) / 3, w: 100, h: thirdH },
|
|
151
|
+
];
|
|
152
|
+
}
|
|
153
|
+
const leftW = 60 - GAP / 2;
|
|
154
|
+
const rightW = 40 - GAP / 2;
|
|
155
|
+
return [
|
|
156
|
+
{ x: 0, y: 0, w: leftW, h: gridHeight },
|
|
157
|
+
{ x: 60 + GAP / 2, y: 0, w: rightW, h: halfH },
|
|
158
|
+
{ x: 60 + GAP / 2, y: gridHeight / 2 + GAP / 2, w: rightW, h: halfH },
|
|
159
|
+
];
|
|
160
|
+
}
|
|
161
|
+
case 4:
|
|
162
|
+
default:
|
|
163
|
+
// 2x2 grid works well in both orientations
|
|
164
|
+
return [
|
|
165
|
+
{ x: 0, y: 0, w: halfW, h: halfH },
|
|
166
|
+
{ x: 50 + GAP / 2, y: 0, w: halfW, h: halfH },
|
|
167
|
+
{ x: 0, y: gridHeight / 2 + GAP / 2, w: halfW, h: halfH },
|
|
168
|
+
{ x: 50 + GAP / 2, y: gridHeight / 2 + GAP / 2, w: halfW, h: halfH },
|
|
169
|
+
];
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
//# sourceMappingURL=photoGrid.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photoGrid.js","sourceRoot":"","sources":["../../../src/doc/templates/photoGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,uCAAuC;AACvC,MAAM,GAAG,GAAG,GAAG,CAAC;AAEhB,MAAM,UAAU,SAAS,CAAC,KAAqB,EAAE,OAAwB;IACvE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAE7D,kCAAkC;IAClC,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE9C,MAAM,OAAO,GAAG,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC;IACnE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAElC,MAAM,MAAM,GAAY;QACtB,oDAAoD;QACpD;YACE,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,IAAI;YACR,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,SAA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C,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;gBAC7C,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;gBACzD,EAAE,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,UAAU,GAAG,CAAC,GAAG,GAAG,GAAG,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE;aACrE,CAAC;IACN,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull Quote Template
|
|
3
|
+
*
|
|
4
|
+
* Quote text over a full-bleed background image with dark overlay.
|
|
5
|
+
* Cinematic alternative to quoteBlock when a high-quality image is available.
|
|
6
|
+
* Combines the visual impact of imageWithCaption with the text focus of quoteBlock.
|
|
7
|
+
*
|
|
8
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
9
|
+
*/
|
|
10
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
11
|
+
import type { PullQuoteInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
12
|
+
export declare function pullQuote(input: PullQuoteInput, context: TemplateContext): Layer[];
|
|
13
|
+
//# sourceMappingURL=pullQuote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pullQuote.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/pullQuote.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CAwGlF"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pull Quote Template
|
|
3
|
+
*
|
|
4
|
+
* Quote text over a full-bleed background image with dark overlay.
|
|
5
|
+
* Cinematic alternative to quoteBlock when a high-quality image is available.
|
|
6
|
+
* Combines the visual impact of imageWithCaption with the text focus of quoteBlock.
|
|
7
|
+
*
|
|
8
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
9
|
+
*/
|
|
10
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
11
|
+
export function pullQuote(input, context) {
|
|
12
|
+
const { text, attribution, backgroundImage, ambientMotion } = input;
|
|
13
|
+
// Guard: backgroundImage is required
|
|
14
|
+
if (!backgroundImage?.src)
|
|
15
|
+
return [];
|
|
16
|
+
const quoteFontSize = scaledFontSize(52, context, true);
|
|
17
|
+
const attrFontSize = scaledFontSize(24, context, false);
|
|
18
|
+
const decoFontSize = scaledFontSize(200, context, true);
|
|
19
|
+
const layers = [
|
|
20
|
+
// Full-bleed background image
|
|
21
|
+
{
|
|
22
|
+
type: 'image',
|
|
23
|
+
id: 'bg-image',
|
|
24
|
+
content: {
|
|
25
|
+
src: backgroundImage.src,
|
|
26
|
+
alt: backgroundImage.alt,
|
|
27
|
+
fit: 'cover',
|
|
28
|
+
credit: backgroundImage.credit,
|
|
29
|
+
license: backgroundImage.license,
|
|
30
|
+
},
|
|
31
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
32
|
+
animation: ambientMotion ? { type: ambientMotion, duration: 15 } : undefined,
|
|
33
|
+
},
|
|
34
|
+
// Dark overlay for text readability
|
|
35
|
+
{
|
|
36
|
+
type: 'shape',
|
|
37
|
+
id: 'overlay',
|
|
38
|
+
content: {
|
|
39
|
+
shape: 'rect',
|
|
40
|
+
fill: 'rgba(0, 0, 0, 0.55)',
|
|
41
|
+
},
|
|
42
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
43
|
+
},
|
|
44
|
+
// Decorative quotation mark
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
id: 'deco-quote',
|
|
48
|
+
content: {
|
|
49
|
+
text: '\u201C',
|
|
50
|
+
style: {
|
|
51
|
+
fontSize: decoFontSize,
|
|
52
|
+
color: 'rgba(255, 255, 255, 0.08)',
|
|
53
|
+
textAlign: 'center',
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
position: {
|
|
57
|
+
x: '50%',
|
|
58
|
+
y: '20%',
|
|
59
|
+
anchor: 'center',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
// Quote text
|
|
63
|
+
{
|
|
64
|
+
type: 'text',
|
|
65
|
+
id: 'quote-text',
|
|
66
|
+
content: {
|
|
67
|
+
text,
|
|
68
|
+
style: {
|
|
69
|
+
fontSize: quoteFontSize,
|
|
70
|
+
color: '#ffffff',
|
|
71
|
+
textAlign: 'center',
|
|
72
|
+
lineHeight: 1.5,
|
|
73
|
+
shadow: true,
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
position: {
|
|
77
|
+
x: '50%',
|
|
78
|
+
y: attribution ? '45%' : '50%',
|
|
79
|
+
anchor: 'center',
|
|
80
|
+
width: '80%',
|
|
81
|
+
},
|
|
82
|
+
animation: { type: 'fadeIn', duration: 2 },
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
// Attribution
|
|
86
|
+
if (attribution) {
|
|
87
|
+
layers.push({
|
|
88
|
+
type: 'text',
|
|
89
|
+
id: 'attribution',
|
|
90
|
+
content: {
|
|
91
|
+
text: `\u2014 ${attribution}`,
|
|
92
|
+
style: {
|
|
93
|
+
fontSize: attrFontSize,
|
|
94
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
95
|
+
textAlign: 'center',
|
|
96
|
+
shadow: true,
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
position: {
|
|
100
|
+
x: '50%',
|
|
101
|
+
y: '72%',
|
|
102
|
+
anchor: 'center',
|
|
103
|
+
},
|
|
104
|
+
animation: { type: 'fadeIn', duration: 1, delay: 1.5 },
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
return layers;
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=pullQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pullQuote.js","sourceRoot":"","sources":["../../../src/doc/templates/pullQuote.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEjE,MAAM,UAAU,SAAS,CAAC,KAAqB,EAAE,OAAwB;IACvE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IAEpE,qCAAqC;IACrC,IAAI,CAAC,eAAe,EAAE,GAAG;QAAE,OAAO,EAAE,CAAC;IAErC,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAExD,MAAM,MAAM,GAAY;QACtB,8BAA8B;QAC9B;YACE,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,UAAU;YACd,OAAO,EAAE;gBACP,GAAG,EAAE,eAAe,CAAC,GAAG;gBACxB,GAAG,EAAE,eAAe,CAAC,GAAG;gBACxB,GAAG,EAAE,OAAO;gBACZ,MAAM,EAAE,eAAe,CAAC,MAAM;gBAC9B,OAAO,EAAE,eAAe,CAAC,OAAO;aACjC;YACD,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;YACvD,SAAS,EAAE,aAAa,CAAC,CAA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AAC;QAChB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,UAAU,WAAW,EAAE;gBAC7B,KAAK,EAAE;oBACL,QAAQ,EAAE,YAAY;oBACtB,KAAK,EAAE,0BAA0B;oBACjC,SAAS,EAAE,QAAQ;oBACnB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,QAAQ,EAAE;gBACR,CAAC,EAAE,KAAK;gBACR,CAAC,EAAE,KAAK;gBACR,MAAM,EAAE,QAAQ;aACjB;YACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;SACvD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quote Block Template
|
|
3
|
+
*
|
|
4
|
+
* Large centered quote with optional attribution.
|
|
5
|
+
* Good for impactful statements or descriptions.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
7
|
+
*
|
|
8
|
+
* Supports optional accent images that appear as tasteful side/bottom strips.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*/
|
|
12
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
13
|
+
import type { QuoteBlockInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
14
|
+
export declare function quoteBlock(input: QuoteBlockInput, context: TemplateContext): Layer[];
|
|
15
|
+
//# sourceMappingURL=quoteBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quoteBlock.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/quoteBlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKxF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CA6FpF"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Quote Block Template
|
|
3
|
+
*
|
|
4
|
+
* Large centered quote with optional attribution.
|
|
5
|
+
* Good for impactful statements or descriptions.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
7
|
+
*
|
|
8
|
+
* Supports optional accent images that appear as tasteful side/bottom strips.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*/
|
|
12
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
13
|
+
import { createAccentLayers, getAccentLayout, adjustY, DEFAULT_LAYOUT } from './accentImage.js';
|
|
14
|
+
import { createBackgroundLayer } from './captionUtils.js';
|
|
15
|
+
export function quoteBlock(input, context) {
|
|
16
|
+
const { quote, attribution, accentImage } = input;
|
|
17
|
+
const { theme, layout } = context;
|
|
18
|
+
// Get layout adjustments if accent image is present
|
|
19
|
+
const accentLayout = accentImage ? getAccentLayout(accentImage.position) : DEFAULT_LAYOUT;
|
|
20
|
+
// Scale font sizes for viewport
|
|
21
|
+
const quoteFontSize = scaledFontSize(48, context, true);
|
|
22
|
+
const attrFontSize = scaledFontSize(24, context, false);
|
|
23
|
+
// Decorative quotation mark font size
|
|
24
|
+
const decorativeQuoteFontSize = scaledFontSize(280, context, true);
|
|
25
|
+
const layers = [
|
|
26
|
+
createBackgroundLayer('bg', `linear-gradient(160deg, ${theme.colors.backgroundLight} 0%, #1e2636 100%)`),
|
|
27
|
+
];
|
|
28
|
+
// Add accent image layers (behind text, after background)
|
|
29
|
+
if (accentImage) {
|
|
30
|
+
layers.push(...createAccentLayers(accentImage, input.id));
|
|
31
|
+
}
|
|
32
|
+
// Decorative opening quotation mark — oversized, low-opacity behind quote
|
|
33
|
+
layers.push({
|
|
34
|
+
type: 'text',
|
|
35
|
+
id: 'deco-quote',
|
|
36
|
+
content: {
|
|
37
|
+
text: '\u201C',
|
|
38
|
+
style: {
|
|
39
|
+
fontSize: decorativeQuoteFontSize,
|
|
40
|
+
color: 'rgba(255, 255, 255, 0.06)',
|
|
41
|
+
textAlign: 'center',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
position: {
|
|
45
|
+
x: accentLayout.textCenterX,
|
|
46
|
+
y: adjustY('18%', accentLayout),
|
|
47
|
+
anchor: 'center',
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
// Quote text - positioned based on accent layout
|
|
51
|
+
const quoteY = attribution ? layout.primaryY : '50%';
|
|
52
|
+
layers.push({
|
|
53
|
+
type: 'text',
|
|
54
|
+
id: 'quote',
|
|
55
|
+
content: {
|
|
56
|
+
text: quote,
|
|
57
|
+
style: {
|
|
58
|
+
fontSize: quoteFontSize,
|
|
59
|
+
color: theme.colors.text,
|
|
60
|
+
textAlign: 'center',
|
|
61
|
+
lineHeight: 1.6,
|
|
62
|
+
shadow: true,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
position: {
|
|
66
|
+
x: accentLayout.textCenterX,
|
|
67
|
+
y: adjustY(quoteY, accentLayout),
|
|
68
|
+
anchor: 'center',
|
|
69
|
+
width: accentLayout.textWidth,
|
|
70
|
+
},
|
|
71
|
+
animation: { type: 'fadeIn', duration: 2 },
|
|
72
|
+
});
|
|
73
|
+
// Add attribution if provided
|
|
74
|
+
if (attribution) {
|
|
75
|
+
layers.push({
|
|
76
|
+
type: 'text',
|
|
77
|
+
id: 'attribution',
|
|
78
|
+
content: {
|
|
79
|
+
text: `— ${attribution}`,
|
|
80
|
+
style: {
|
|
81
|
+
fontSize: attrFontSize,
|
|
82
|
+
color: theme.colors.textMuted,
|
|
83
|
+
textAlign: 'center',
|
|
84
|
+
shadow: !!accentImage,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
position: {
|
|
88
|
+
x: accentLayout.textCenterX,
|
|
89
|
+
y: adjustY(layout.captionY, accentLayout),
|
|
90
|
+
anchor: 'center',
|
|
91
|
+
},
|
|
92
|
+
animation: { type: 'fadeIn', duration: 1, delay: 1.5 },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
return layers;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=quoteBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"quoteBlock.js","sourceRoot":"","sources":["../../../src/doc/templates/quoteBlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,UAAU,UAAU,CAAC,KAAsB,EAAE,OAAwB;IACzE,MAAM,EAAE,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAClD,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAElC,oDAAoD;IACpD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;IAE1F,gCAAgC;IAChC,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAExD,sCAAsC;IACtC,MAAM,uBAAuB,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAEnE,MAAM,MAAM,GAAY;Q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C9B;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE;KAC3C,CAAC,CAAC;IAEH,8BAA8B;IAC9B,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,WAAW,EAAE;gBACxB,KAAK,EAAE;oBACL,QAAQ,EAAE,YAAY;oBACtB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;oBAC7B,SAAS,EAAE,QAAQ;oBACnB,MAAM,EAAE,CAAC,CAAC,WAAW;iBACtB;aACF;YACD,QAAQ,EAAE;gBACR,CAAC,EAAE,YAAY,CAAC,WAAW;gBAC3B,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,YAAY,CAAC;gBACzC,MAAM,EAAE,QAAQ;aACjB;YACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;SACvD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Header Template
|
|
3
|
+
*
|
|
4
|
+
* Section title card with optional background image.
|
|
5
|
+
* Used to introduce new sections of a story.
|
|
6
|
+
* When an image is provided, displays like a title slide with the image as background.
|
|
7
|
+
* Without an image, falls back to a colored background.
|
|
8
|
+
*
|
|
9
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
10
|
+
*/
|
|
11
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
12
|
+
import type { SectionHeaderInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
13
|
+
export declare function sectionHeader(input: SectionHeaderInput, context: TemplateContext): Layer[];
|
|
14
|
+
//# sourceMappingURL=sectionHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionHeader.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/sectionHeader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAiB,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAI3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CAwF1F"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Section Header Template
|
|
3
|
+
*
|
|
4
|
+
* Section title card with optional background image.
|
|
5
|
+
* Used to introduce new sections of a story.
|
|
6
|
+
* When an image is provided, displays like a title slide with the image as background.
|
|
7
|
+
* Without an image, falls back to a colored background.
|
|
8
|
+
*
|
|
9
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
10
|
+
*/
|
|
11
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
12
|
+
import { resolveColorScheme } from '../utils/themeUtils.js';
|
|
13
|
+
export function sectionHeader(input, context) {
|
|
14
|
+
const { title, colorScheme = 'blue', imageSrc, imageAlt, ambientMotion } = input;
|
|
15
|
+
const { layout } = context;
|
|
16
|
+
const colors = resolveColorScheme(context, colorScheme);
|
|
17
|
+
// Scale font sizes for viewport
|
|
18
|
+
const titleFontSize = scaledFontSize(72, context, true);
|
|
19
|
+
const layers = [];
|
|
20
|
+
// Background - either image or solid color
|
|
21
|
+
if (imageSrc) {
|
|
22
|
+
// Image background with Ken Burns effect
|
|
23
|
+
layers.push({
|
|
24
|
+
type: 'image',
|
|
25
|
+
id: 'bg-image',
|
|
26
|
+
content: {
|
|
27
|
+
src: imageSrc,
|
|
28
|
+
alt: imageAlt || title,
|
|
29
|
+
fit: 'cover',
|
|
30
|
+
},
|
|
31
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
32
|
+
animation: ambientMotion
|
|
33
|
+
? { type: ambientMotion, duration: 8 }
|
|
34
|
+
: { type: 'slowZoom', duration: 8, direction: 'in' },
|
|
35
|
+
});
|
|
36
|
+
// Dark overlay for text readability
|
|
37
|
+
layers.push({
|
|
38
|
+
type: 'shape',
|
|
39
|
+
id: 'overlay',
|
|
40
|
+
content: {
|
|
41
|
+
shape: 'rect',
|
|
42
|
+
fill: 'rgba(0, 0, 0, 0.5)',
|
|
43
|
+
},
|
|
44
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
// Solid color background
|
|
49
|
+
layers.push({
|
|
50
|
+
type: 'shape',
|
|
51
|
+
id: 'bg',
|
|
52
|
+
content: {
|
|
53
|
+
shape: 'rect',
|
|
54
|
+
fill: colors.bg,
|
|
55
|
+
},
|
|
56
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
57
|
+
});
|
|
58
|
+
// Decorative lines above and below title
|
|
59
|
+
layers.push({
|
|
60
|
+
type: 'shape',
|
|
61
|
+
id: 'line-top',
|
|
62
|
+
content: { shape: 'rect', fill: `${colors.text}33` },
|
|
63
|
+
position: { x: '50%', y: '40%', width: '20%', height: '2px', anchor: 'center' },
|
|
64
|
+
});
|
|
65
|
+
layers.push({
|
|
66
|
+
type: 'shape',
|
|
67
|
+
id: 'line-bottom',
|
|
68
|
+
content: { shape: 'rect', fill: `${colors.text}33` },
|
|
69
|
+
position: { x: '50%', y: '60%', width: '20%', height: '2px', anchor: 'center' },
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
// Section title - white text with shadow for readability over images
|
|
73
|
+
layers.push({
|
|
74
|
+
type: 'text',
|
|
75
|
+
id: 'title',
|
|
76
|
+
content: {
|
|
77
|
+
text: title,
|
|
78
|
+
style: {
|
|
79
|
+
fontSize: titleFontSize,
|
|
80
|
+
fontWeight: 'bold',
|
|
81
|
+
color: imageSrc ? '#ffffff' : colors.text,
|
|
82
|
+
textAlign: 'center',
|
|
83
|
+
shadow: true,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
position: {
|
|
87
|
+
x: '50%',
|
|
88
|
+
y: '50%',
|
|
89
|
+
anchor: 'center',
|
|
90
|
+
width: layout.maxTextWidth,
|
|
91
|
+
},
|
|
92
|
+
animation: { type: 'fadeIn', duration: 1.5 },
|
|
93
|
+
});
|
|
94
|
+
return layers;
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=sectionHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sectionHeader.js","sourceRoot":"","sources":["../../../src/doc/templates/sectionHeader.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,MAAM,UAAU,aAAa,CAAC,KAAyB,EAAE,OAAwB;IAC/E,MAAM,EAAE,KAAK,EAAE,WAAW,GAAG,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,GAAG,KAAK,CAAC;IACjF,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAC3B,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAExD,gCAAgC;IAChC,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IAExD,MAAM,MAAM,GAAY,EAAE,CAAC;IAE3B,2CAA2C;IAC3C,IAAI,QAAQ,EAAE,CAAC;QACb,yCAAyC;QACzC,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,UAAU;YACd,OAAO,EAAE;gBACP,GAAG,EAAE,QAAQ;gBACb,GAAG,EAAE,QAAQ,IAAI,KAA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K,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;SAChF,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,aAAa;YACjB,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,IAAI,EAAE;YACpD,QAAQ,EAAE,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE;SAChF,CAAC,CAAC;IACL,CAAC;IAED,qEAAqE;IACrE,MAAM,CAAC,IAAI,CAAC;QACV,IAAI,EAAE,MAAM;QACZ,EAAE,EAAE,OAAO;QACX,OAAO,EAAE;YACP,IAAI,EAAE,KAAK;YACX,KAAK,EAAE;gBACL,QAAQ,EAAE,aAAa;gBACvB,UAAU,EAAE,MAAM;gBAClB,KAAK,EAAE,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI;gBACzC,SAAS,EAAE,QAAQ;gBACnB,MAAM,EAAE,IAAI;aACb;SACF;QACD,QAAQ,EAAE;YACR,CAAC,EAAE,KAAK;YACR,CAAC,EAAE,KAAK;YACR,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,MAAM,CAAC,YAAY;SAC3B;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE;KAC7C,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stat Highlight Template
|
|
3
|
+
*
|
|
4
|
+
* Large statistic/number with description and optional detail.
|
|
5
|
+
* Great for emphasizing key data points.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
7
|
+
*
|
|
8
|
+
* Supports optional accent images that appear as tasteful side/bottom strips.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*/
|
|
12
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
13
|
+
import type { StatHighlightInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
14
|
+
export declare function statHighlight(input: StatHighlightInput, context: TemplateContext): Layer[];
|
|
15
|
+
//# sourceMappingURL=statHighlight.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statHighlight.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/statHighlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAM3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CA6F1F"}
|