@bendyline/squisq 0.1.2 → 1.1.0
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/MediaProvider-wpSe21B3.d.ts +66 -0
- 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__/contentContainer.test.d.ts +2 -0
- package/dist/__tests__/contentContainer.test.d.ts.map +1 -0
- package/dist/__tests__/contentContainer.test.js +234 -0
- package/dist/__tests__/contentContainer.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-4CRBS35L.js +292 -0
- package/dist/chunk-4CRBS35L.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/ContentContainer.d.ts +87 -0
- package/dist/storage/ContentContainer.d.ts.map +1 -0
- package/dist/storage/ContentContainer.js +122 -0
- package/dist/storage/ContentContainer.js.map +1 -0
- 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/MediaProviderFromContainer.d.ts +21 -0
- package/dist/storage/MediaProviderFromContainer.d.ts.map +1 -0
- package/dist/storage/MediaProviderFromContainer.js +79 -0
- package/dist/storage/MediaProviderFromContainer.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 +9 -91
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +5 -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__/contentContainer.test.ts +282 -0
- 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/storage/ContentContainer.ts +200 -0
- package/src/storage/MediaProviderFromContainer.ts +92 -0
- package/src/storage/index.ts +3 -0
- package/src/timing/index.ts +17 -0
- package/src/timing/narrationTiming.ts +220 -0
- package/src/timing/readingTime.ts +94 -0
- package/dist/chunk-VJN7UB2Z.js +0 -145
- package/dist/chunk-VJN7UB2Z.js.map +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
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 { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
13
|
+
import { resolveColorScheme } from '../utils/themeUtils.js';
|
|
14
|
+
import { createAccentLayers, getAccentLayout, adjustY, DEFAULT_LAYOUT } from './accentImage.js';
|
|
15
|
+
import { createBackgroundLayer } from './captionUtils.js';
|
|
16
|
+
export function statHighlight(input, context) {
|
|
17
|
+
const { stat, description, detail, colorScheme = 'blue', accentImage } = input;
|
|
18
|
+
const { theme } = context;
|
|
19
|
+
const colors = resolveColorScheme(context, colorScheme);
|
|
20
|
+
// Get layout adjustments if accent image is present
|
|
21
|
+
const accentLayout = accentImage ? getAccentLayout(accentImage.position) : DEFAULT_LAYOUT;
|
|
22
|
+
// Scale font sizes — stat is dramatically large, description is understated
|
|
23
|
+
const statFontSize = scaledFontSize(148, context, true);
|
|
24
|
+
const descFontSize = scaledFontSize(32, context, false);
|
|
25
|
+
const detailFontSize = scaledFontSize(26, context, false);
|
|
26
|
+
const layers = [
|
|
27
|
+
createBackgroundLayer('bg', `linear-gradient(180deg, ${theme.colors.background} 0%, #0f1520 100%)`),
|
|
28
|
+
];
|
|
29
|
+
// Add accent image layers (behind text, after background)
|
|
30
|
+
if (accentImage) {
|
|
31
|
+
layers.push(...createAccentLayers(accentImage, input.id));
|
|
32
|
+
}
|
|
33
|
+
// Big stat — hero element, dominates the slide
|
|
34
|
+
layers.push({
|
|
35
|
+
type: 'text',
|
|
36
|
+
id: 'stat',
|
|
37
|
+
content: {
|
|
38
|
+
text: stat,
|
|
39
|
+
style: {
|
|
40
|
+
fontSize: statFontSize,
|
|
41
|
+
fontWeight: 'bold',
|
|
42
|
+
color: colors.text,
|
|
43
|
+
shadow: !!accentImage,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
position: {
|
|
47
|
+
x: accentLayout.textCenterX,
|
|
48
|
+
y: adjustY('32%', accentLayout),
|
|
49
|
+
anchor: 'center',
|
|
50
|
+
},
|
|
51
|
+
animation: { type: 'zoomIn', duration: 0.6 },
|
|
52
|
+
});
|
|
53
|
+
// Description — smaller and understated beneath the stat
|
|
54
|
+
layers.push({
|
|
55
|
+
type: 'text',
|
|
56
|
+
id: 'description',
|
|
57
|
+
content: {
|
|
58
|
+
text: description,
|
|
59
|
+
style: {
|
|
60
|
+
fontSize: descFontSize,
|
|
61
|
+
color: theme.colors.textMuted,
|
|
62
|
+
textAlign: 'center',
|
|
63
|
+
lineHeight: 1.6,
|
|
64
|
+
shadow: !!accentImage,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
position: {
|
|
68
|
+
x: accentLayout.textCenterX,
|
|
69
|
+
y: adjustY('58%', accentLayout),
|
|
70
|
+
width: accentLayout.textWidth,
|
|
71
|
+
anchor: 'center',
|
|
72
|
+
},
|
|
73
|
+
animation: { type: 'fadeIn', duration: 1, delay: 0.3 },
|
|
74
|
+
});
|
|
75
|
+
// Add detail if provided
|
|
76
|
+
if (detail) {
|
|
77
|
+
layers.push({
|
|
78
|
+
type: 'text',
|
|
79
|
+
id: 'detail',
|
|
80
|
+
content: {
|
|
81
|
+
text: detail,
|
|
82
|
+
style: {
|
|
83
|
+
fontSize: detailFontSize,
|
|
84
|
+
color: colors.accent,
|
|
85
|
+
textAlign: 'center',
|
|
86
|
+
shadow: !!accentImage,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
position: {
|
|
90
|
+
x: accentLayout.textCenterX,
|
|
91
|
+
y: adjustY('75%', accentLayout),
|
|
92
|
+
anchor: 'center',
|
|
93
|
+
},
|
|
94
|
+
animation: { type: 'fadeIn', duration: 1, delay: 1 },
|
|
95
|
+
});
|
|
96
|
+
}
|
|
97
|
+
return layers;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=statHighlight.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"statHighlight.js","sourceRoot":"","sources":["../../../src/doc/templates/statHighlight.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,MAAM,UAAU,aAAa,CAAC,KAAyB,EAAE,OAAwB;IAC/E,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,WAAW,EAAE,GAAG,KAAK,CAAC;IAC/E,MAAM,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAC1B,MAAM,MAAM,GAAG,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC;IAExD,oDAAoD;IACpD,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,eAAe,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC;IAE1F,4EAA4E;IAC5E,MAAM,YAAY,GAAG,cAAc,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,YAAY,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,cAAc,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAE1D,MAAM,MAAM,GAAY;QACtB,qBAAqB,CACnB,IAAI,EACJ,2BAA2B,KAAK,CAAC,MAAM,CAAC,UAAU,oBAAoB,CACvE;KACF,CAAC;IAEF,0DAA0D;IAC1D,IAAI,WAA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GAAG,EAAE;KACvD,CAAC,CAAC;IAEH,yBAAyB;IACzB,IAAI,MAAM,EAAE,CAAC;QACX,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,QAAQ;YACZ,OAAO,EAAE;gBACP,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE;oBACL,QAAQ,EAAE,cAAc;oBACxB,KAAK,EAAE,MAAM,CAAC,MAAM;oBACpB,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,KAAK,EAAE,YAAY,CAAC;gBAC/B,MAAM,EAAE,QAAQ;aACjB;YACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE;SACrD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Title Block Template
|
|
3
|
+
*
|
|
4
|
+
* Large title with optional subtitle for doc intros.
|
|
5
|
+
* Centered text with fade-in animations.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
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 { TitleBlockInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
12
|
+
export declare function titleBlock(input: TitleBlockInput, context: TemplateContext): Layer[];
|
|
13
|
+
//# sourceMappingURL=titleBlock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"titleBlock.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/titleBlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAGxF,wBAAgB,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CAqFpF"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Title Block Template
|
|
3
|
+
*
|
|
4
|
+
* Large title with optional subtitle for doc intros.
|
|
5
|
+
* Centered text with fade-in animations.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
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 titleBlock(input, context) {
|
|
12
|
+
const { title, subtitle, backgroundColor } = input;
|
|
13
|
+
const { theme, layout } = context;
|
|
14
|
+
// Scale font sizes for viewport
|
|
15
|
+
const titleFontSize = scaledFontSize(96, context, true);
|
|
16
|
+
const subtitleFontSize = scaledFontSize(36, context, false);
|
|
17
|
+
const baseBg = backgroundColor || theme.colors.primary;
|
|
18
|
+
const layers = [
|
|
19
|
+
// Background — radial gradient for depth instead of flat color
|
|
20
|
+
{
|
|
21
|
+
type: 'shape',
|
|
22
|
+
id: 'bg',
|
|
23
|
+
content: {
|
|
24
|
+
shape: 'rect',
|
|
25
|
+
fill: `radial-gradient(ellipse at 50% 40%, ${baseBg} 0%, ${theme.colors.background} 100%)`,
|
|
26
|
+
},
|
|
27
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
28
|
+
},
|
|
29
|
+
// Subtle decorative line above title
|
|
30
|
+
{
|
|
31
|
+
type: 'shape',
|
|
32
|
+
id: 'accent-line',
|
|
33
|
+
content: {
|
|
34
|
+
shape: 'rect',
|
|
35
|
+
fill: 'rgba(255, 255, 255, 0.2)',
|
|
36
|
+
},
|
|
37
|
+
position: {
|
|
38
|
+
x: '40%',
|
|
39
|
+
y: subtitle ? '28%' : '38%',
|
|
40
|
+
width: '20%',
|
|
41
|
+
height: '2px',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
// Title
|
|
45
|
+
{
|
|
46
|
+
type: 'text',
|
|
47
|
+
id: 'title',
|
|
48
|
+
content: {
|
|
49
|
+
text: title,
|
|
50
|
+
style: {
|
|
51
|
+
fontSize: titleFontSize,
|
|
52
|
+
fontWeight: 'bold',
|
|
53
|
+
color: theme.colors.text,
|
|
54
|
+
textAlign: 'center',
|
|
55
|
+
shadow: true,
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
position: {
|
|
59
|
+
x: '50%',
|
|
60
|
+
y: subtitle ? layout.primaryY : '50%',
|
|
61
|
+
anchor: 'center',
|
|
62
|
+
width: layout.maxTextWidth,
|
|
63
|
+
},
|
|
64
|
+
animation: { type: 'fadeIn', duration: 2 },
|
|
65
|
+
},
|
|
66
|
+
];
|
|
67
|
+
// Add subtitle if provided
|
|
68
|
+
if (subtitle) {
|
|
69
|
+
layers.push({
|
|
70
|
+
type: 'text',
|
|
71
|
+
id: 'subtitle',
|
|
72
|
+
content: {
|
|
73
|
+
text: subtitle,
|
|
74
|
+
style: {
|
|
75
|
+
fontSize: subtitleFontSize,
|
|
76
|
+
color: theme.colors.textMuted,
|
|
77
|
+
textAlign: 'center',
|
|
78
|
+
lineHeight: 1.5,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
position: {
|
|
82
|
+
x: '50%',
|
|
83
|
+
y: layout.secondaryY,
|
|
84
|
+
anchor: 'center',
|
|
85
|
+
width: layout.maxTextWidth,
|
|
86
|
+
},
|
|
87
|
+
animation: { type: 'fadeIn', duration: 1.5, delay: 1 },
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
return layers;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=titleBlock.js.map
|
|
@@ -0,0 +1 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CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two Column Template
|
|
3
|
+
*
|
|
4
|
+
* Side-by-side comparison of two items.
|
|
5
|
+
* Each column has a label and optional sublabel.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
7
|
+
*
|
|
8
|
+
* Portrait mode: Stacks columns vertically (top/bottom) instead of side-by-side.
|
|
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 { TwoColumnInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
14
|
+
export declare function twoColumn(input: TwoColumnInput, context: TemplateContext): Layer[];
|
|
15
|
+
//# sourceMappingURL=twoColumn.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twoColumn.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/twoColumn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAKvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CA4NlF"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Two Column Template
|
|
3
|
+
*
|
|
4
|
+
* Side-by-side comparison of two items.
|
|
5
|
+
* Each column has a label and optional sublabel.
|
|
6
|
+
* Adapts font sizes and positioning for different viewports.
|
|
7
|
+
*
|
|
8
|
+
* Portrait mode: Stacks columns vertically (top/bottom) instead of side-by-side.
|
|
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 { resolveColorScheme } from '../utils/themeUtils.js';
|
|
14
|
+
import { getTwoColumnPositions } from '../../schemas/LayoutStrategy.js';
|
|
15
|
+
export function twoColumn(input, context) {
|
|
16
|
+
const { left, right, header, leftColor = 'green', rightColor = 'blue' } = input;
|
|
17
|
+
// Guard: required fields may be absent when generated from sparse markdown
|
|
18
|
+
if (!left?.label || !right?.label)
|
|
19
|
+
return [];
|
|
20
|
+
const { theme, layout, orientation } = context;
|
|
21
|
+
const leftColors = resolveColorScheme(context, leftColor);
|
|
22
|
+
const rightColors = resolveColorScheme(context, rightColor);
|
|
23
|
+
// Get column positions based on orientation
|
|
24
|
+
const positions = getTwoColumnPositions(orientation);
|
|
25
|
+
const isStacked = layout.stackColumns;
|
|
26
|
+
// Column width ~42% for side-by-side, ~85% for stacked
|
|
27
|
+
const columnWidth = isStacked ? '85%' : '42%';
|
|
28
|
+
// Calculate font sizes based on viewport
|
|
29
|
+
const headerFontSize = scaledFontSize(32, context, false);
|
|
30
|
+
const labelFontSize = scaledFontSize(44, context, true);
|
|
31
|
+
const sublabelFontSize = scaledFontSize(22, context, false);
|
|
32
|
+
const layers = [
|
|
33
|
+
// Background — subtle gradient to add depth
|
|
34
|
+
{
|
|
35
|
+
type: 'shape',
|
|
36
|
+
id: 'bg',
|
|
37
|
+
content: {
|
|
38
|
+
shape: 'rect',
|
|
39
|
+
fill: `linear-gradient(135deg, ${theme.colors.background} 0%, #16202e 100%)`,
|
|
40
|
+
},
|
|
41
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
42
|
+
},
|
|
43
|
+
];
|
|
44
|
+
if (!isStacked) {
|
|
45
|
+
// Left column background panel
|
|
46
|
+
layers.push({
|
|
47
|
+
type: 'shape',
|
|
48
|
+
id: 'left-panel',
|
|
49
|
+
content: {
|
|
50
|
+
shape: 'rect',
|
|
51
|
+
fill: 'rgba(255, 255, 255, 0.04)',
|
|
52
|
+
},
|
|
53
|
+
position: { x: '3%', y: '15%', width: '44%', height: '70%' },
|
|
54
|
+
});
|
|
55
|
+
// Right column background panel
|
|
56
|
+
layers.push({
|
|
57
|
+
type: 'shape',
|
|
58
|
+
id: 'right-panel',
|
|
59
|
+
content: {
|
|
60
|
+
shape: 'rect',
|
|
61
|
+
fill: 'rgba(255, 255, 255, 0.04)',
|
|
62
|
+
},
|
|
63
|
+
position: { x: '53%', y: '15%', width: '44%', height: '70%' },
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
// Header position adjusts based on layout
|
|
67
|
+
const headerY = isStacked ? '12%' : '22%';
|
|
68
|
+
// Add header if provided
|
|
69
|
+
if (header) {
|
|
70
|
+
layers.push({
|
|
71
|
+
type: 'text',
|
|
72
|
+
id: 'header',
|
|
73
|
+
content: {
|
|
74
|
+
text: header,
|
|
75
|
+
style: {
|
|
76
|
+
fontSize: headerFontSize,
|
|
77
|
+
color: theme.colors.textMuted,
|
|
78
|
+
textAlign: 'center',
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
position: { x: '50%', y: headerY, anchor: 'center' },
|
|
82
|
+
animation: { type: 'fadeIn', duration: 0.8 },
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
// Calculate Y positions based on layout mode and header presence
|
|
86
|
+
let leftY;
|
|
87
|
+
let leftSublabelY;
|
|
88
|
+
let rightY;
|
|
89
|
+
let rightSublabelY;
|
|
90
|
+
if (isStacked) {
|
|
91
|
+
// Portrait: stacked vertically
|
|
92
|
+
leftY = header ? '30%' : '25%';
|
|
93
|
+
leftSublabelY = header ? '40%' : '35%';
|
|
94
|
+
rightY = header ? '60%' : '55%';
|
|
95
|
+
rightSublabelY = header ? '70%' : '65%';
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
// Landscape/square: side by side — vertically centered in panels (15%-85%)
|
|
99
|
+
const baseY = header ? '47%' : '45%';
|
|
100
|
+
const sublabelOffset = header ? '58%' : '56%';
|
|
101
|
+
leftY = baseY;
|
|
102
|
+
leftSublabelY = sublabelOffset;
|
|
103
|
+
rightY = baseY;
|
|
104
|
+
rightSublabelY = sublabelOffset;
|
|
105
|
+
}
|
|
106
|
+
// Left column (or top in portrait)
|
|
107
|
+
layers.push({
|
|
108
|
+
type: 'text',
|
|
109
|
+
id: 'left-label',
|
|
110
|
+
content: {
|
|
111
|
+
text: left.label,
|
|
112
|
+
style: {
|
|
113
|
+
fontSize: labelFontSize,
|
|
114
|
+
fontWeight: 'bold',
|
|
115
|
+
color: leftColors.text,
|
|
116
|
+
textAlign: 'center',
|
|
117
|
+
lineHeight: 1.3,
|
|
118
|
+
},
|
|
119
|
+
},
|
|
120
|
+
position: {
|
|
121
|
+
x: positions.left.x,
|
|
122
|
+
y: leftY,
|
|
123
|
+
anchor: 'center',
|
|
124
|
+
width: columnWidth,
|
|
125
|
+
},
|
|
126
|
+
animation: { type: 'fadeIn', duration: 1 },
|
|
127
|
+
});
|
|
128
|
+
if (left.sublabel) {
|
|
129
|
+
layers.push({
|
|
130
|
+
type: 'text',
|
|
131
|
+
id: 'left-sublabel',
|
|
132
|
+
content: {
|
|
133
|
+
text: left.sublabel,
|
|
134
|
+
style: {
|
|
135
|
+
fontSize: sublabelFontSize,
|
|
136
|
+
color: theme.colors.textMuted,
|
|
137
|
+
textAlign: 'center',
|
|
138
|
+
lineHeight: 1.4,
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
position: {
|
|
142
|
+
x: positions.left.x,
|
|
143
|
+
y: leftSublabelY,
|
|
144
|
+
anchor: 'center',
|
|
145
|
+
width: columnWidth,
|
|
146
|
+
},
|
|
147
|
+
animation: { type: 'fadeIn', duration: 0.8, delay: 0.3 },
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// Visual connector between columns (bold arrow)
|
|
151
|
+
const connectorFontSize = scaledFontSize(120, context, true);
|
|
152
|
+
const connectorY = isStacked ? '48%' : '50%'; // Centered in viewport
|
|
153
|
+
const connectorSymbol = isStacked ? '\u2193' : '\u2192'; // ↓ for stacked, → for side-by-side
|
|
154
|
+
layers.push({
|
|
155
|
+
type: 'text',
|
|
156
|
+
id: 'connector',
|
|
157
|
+
content: {
|
|
158
|
+
text: connectorSymbol,
|
|
159
|
+
style: {
|
|
160
|
+
fontSize: connectorFontSize,
|
|
161
|
+
fontWeight: 'bold',
|
|
162
|
+
color: 'rgba(255, 255, 255, 0.6)',
|
|
163
|
+
textAlign: 'center',
|
|
164
|
+
},
|
|
165
|
+
},
|
|
166
|
+
position: {
|
|
167
|
+
x: '50%',
|
|
168
|
+
y: connectorY,
|
|
169
|
+
anchor: 'center',
|
|
170
|
+
},
|
|
171
|
+
animation: { type: 'fadeIn', duration: 0.6, delay: 0.4 },
|
|
172
|
+
});
|
|
173
|
+
// Right column (or bottom in portrait)
|
|
174
|
+
layers.push({
|
|
175
|
+
type: 'text',
|
|
176
|
+
id: 'right-label',
|
|
177
|
+
content: {
|
|
178
|
+
text: right.label,
|
|
179
|
+
style: {
|
|
180
|
+
fontSize: labelFontSize,
|
|
181
|
+
fontWeight: 'bold',
|
|
182
|
+
color: rightColors.text,
|
|
183
|
+
textAlign: 'center',
|
|
184
|
+
lineHeight: 1.3,
|
|
185
|
+
},
|
|
186
|
+
},
|
|
187
|
+
position: {
|
|
188
|
+
x: positions.right.x,
|
|
189
|
+
y: rightY,
|
|
190
|
+
anchor: 'center',
|
|
191
|
+
width: columnWidth,
|
|
192
|
+
},
|
|
193
|
+
animation: { type: 'fadeIn', duration: 1, delay: 0.5 },
|
|
194
|
+
});
|
|
195
|
+
if (right.sublabel) {
|
|
196
|
+
layers.push({
|
|
197
|
+
type: 'text',
|
|
198
|
+
id: 'right-sublabel',
|
|
199
|
+
content: {
|
|
200
|
+
text: right.sublabel,
|
|
201
|
+
style: {
|
|
202
|
+
fontSize: sublabelFontSize,
|
|
203
|
+
color: theme.colors.textMuted,
|
|
204
|
+
textAlign: 'center',
|
|
205
|
+
lineHeight: 1.4,
|
|
206
|
+
},
|
|
207
|
+
},
|
|
208
|
+
position: {
|
|
209
|
+
x: positions.right.x,
|
|
210
|
+
y: rightSublabelY,
|
|
211
|
+
anchor: 'center',
|
|
212
|
+
width: columnWidth,
|
|
213
|
+
},
|
|
214
|
+
animation: { type: 'fadeIn', duration: 0.8, delay: 0.8 },
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
return layers;
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=twoColumn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"twoColumn.js","sourceRoot":"","sources":["../../../src/doc/templates/twoColumn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AAExE,MAAM,UAAU,SAAS,CAAC,KAAqB,EAAE,OAAwB;IACvE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,EAAE,UAAU,GAAG,MAAM,EAAE,GAAG,KAAK,CAAC;IAEhF,2EAA2E;IAC3E,IAAI,CAAC,IAAI,EAAE,KAAK,IAAI,CAAC,KAAK,EAAE,KAAK;QAAE,OAAO,EAAE,CAAC;IAE7C,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,OAAO,CAAC;IAC/C,MAAM,UAAU,GAAG,kBAAkB,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;IAC1D,MAAM,WAAW,GAAG,kBAAkB,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;IAE5D,4CAA4C;IAC5C,MAAM,SAAS,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;IACrD,MAAM,SAAS,GAAG,MAAM,CAAC,YAAY,CAAC;IAEtC,uDAAuD;IACvD,MAAM,WAAW,GAAG,SAAS,CAAC,CAAC,CAAC,KAAK,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QACD,QAAQ,EAAE;YACR,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;YACpB,CAAC,EAAE,MAAM;YACT,MAAM,EAAE,QAAQ;YAChB,KAAK,EAAE,WAAW;SACnB;QACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE;KACvD,CAAC,CAAC;IAEH,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QACnB,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,gBAAgB;YACpB,OAAO,EAAE;gBACP,IAAI,EAAE,KAAK,CAAC,QAAQ;gBACpB,KAAK,EAAE;oBACL,QAAQ,EAAE,gBAAgB;oBAC1B,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,SAAS;oBAC7B,SAAS,EAAE,QAAQ;oBACnB,UAAU,EAAE,GAAG;iBAChB;aACF;YACD,QAAQ,EAAE;gBACR,CAAC,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;gBACpB,CAAC,EAAE,cAAc;gBACjB,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,WAAW;aACnB;YACD,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,EAAE,GAAG,EAAE;SACzD,CAAC,CAAC;IACL,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Pull Quote Template
|
|
3
|
+
*
|
|
4
|
+
* Quote text over a video clip background with dark overlay.
|
|
5
|
+
* Cinematic alternative to pullQuote when a video clip is available.
|
|
6
|
+
* Combines the visual dynamism of live video with the text focus of quoteBlock.
|
|
7
|
+
*
|
|
8
|
+
* The video plays muted — narration audio is the only sound track.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*
|
|
12
|
+
* Related Files:
|
|
13
|
+
* - shared/story/templates/pullQuote.ts — image-based equivalent
|
|
14
|
+
* - schemas/StoryScript.ts — VideoLayer type
|
|
15
|
+
* - site/src/components/story/layers/VideoLayer.tsx — rendering component
|
|
16
|
+
*/
|
|
17
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
18
|
+
import type { VideoPullQuoteInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
19
|
+
export declare function videoPullQuote(input: VideoPullQuoteInput, context: TemplateContext): Layer[];
|
|
20
|
+
//# sourceMappingURL=videoPullQuote.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoPullQuote.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/videoPullQuote.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAG5F,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CA0G5F"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Pull Quote Template
|
|
3
|
+
*
|
|
4
|
+
* Quote text over a video clip background with dark overlay.
|
|
5
|
+
* Cinematic alternative to pullQuote when a video clip is available.
|
|
6
|
+
* Combines the visual dynamism of live video with the text focus of quoteBlock.
|
|
7
|
+
*
|
|
8
|
+
* The video plays muted — narration audio is the only sound track.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*
|
|
12
|
+
* Related Files:
|
|
13
|
+
* - shared/story/templates/pullQuote.ts — image-based equivalent
|
|
14
|
+
* - schemas/StoryScript.ts — VideoLayer type
|
|
15
|
+
* - site/src/components/story/layers/VideoLayer.tsx — rendering component
|
|
16
|
+
*/
|
|
17
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
18
|
+
export function videoPullQuote(input, context) {
|
|
19
|
+
const { text, attribution, backgroundVideo } = input;
|
|
20
|
+
// Guard: backgroundVideo is required
|
|
21
|
+
if (!backgroundVideo?.src)
|
|
22
|
+
return [];
|
|
23
|
+
const quoteFontSize = scaledFontSize(52, context, true);
|
|
24
|
+
const attrFontSize = scaledFontSize(24, context, false);
|
|
25
|
+
const decoFontSize = scaledFontSize(200, context, true);
|
|
26
|
+
const layers = [
|
|
27
|
+
// Full-bleed background video clip
|
|
28
|
+
{
|
|
29
|
+
type: 'video',
|
|
30
|
+
id: 'bg-video',
|
|
31
|
+
content: {
|
|
32
|
+
src: backgroundVideo.src,
|
|
33
|
+
posterSrc: backgroundVideo.posterSrc,
|
|
34
|
+
alt: backgroundVideo.alt,
|
|
35
|
+
fit: 'cover',
|
|
36
|
+
clipStart: backgroundVideo.clipStart,
|
|
37
|
+
clipEnd: backgroundVideo.clipEnd,
|
|
38
|
+
credit: backgroundVideo.credit,
|
|
39
|
+
license: backgroundVideo.license,
|
|
40
|
+
},
|
|
41
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
42
|
+
},
|
|
43
|
+
// Dark overlay for text readability
|
|
44
|
+
{
|
|
45
|
+
type: 'shape',
|
|
46
|
+
id: 'overlay',
|
|
47
|
+
content: {
|
|
48
|
+
shape: 'rect',
|
|
49
|
+
fill: 'rgba(0, 0, 0, 0.55)',
|
|
50
|
+
},
|
|
51
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
52
|
+
},
|
|
53
|
+
// Decorative quotation mark
|
|
54
|
+
{
|
|
55
|
+
type: 'text',
|
|
56
|
+
id: 'deco-quote',
|
|
57
|
+
content: {
|
|
58
|
+
text: '\u201C',
|
|
59
|
+
style: {
|
|
60
|
+
fontSize: decoFontSize,
|
|
61
|
+
color: 'rgba(255, 255, 255, 0.08)',
|
|
62
|
+
textAlign: 'center',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
position: {
|
|
66
|
+
x: '50%',
|
|
67
|
+
y: '20%',
|
|
68
|
+
anchor: 'center',
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
// Quote text
|
|
72
|
+
{
|
|
73
|
+
type: 'text',
|
|
74
|
+
id: 'quote-text',
|
|
75
|
+
content: {
|
|
76
|
+
text,
|
|
77
|
+
style: {
|
|
78
|
+
fontSize: quoteFontSize,
|
|
79
|
+
color: '#ffffff',
|
|
80
|
+
textAlign: 'center',
|
|
81
|
+
lineHeight: 1.5,
|
|
82
|
+
shadow: true,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
position: {
|
|
86
|
+
x: '50%',
|
|
87
|
+
y: attribution ? '45%' : '50%',
|
|
88
|
+
anchor: 'center',
|
|
89
|
+
width: '80%',
|
|
90
|
+
},
|
|
91
|
+
animation: { type: 'fadeIn', duration: 2 },
|
|
92
|
+
},
|
|
93
|
+
];
|
|
94
|
+
// Attribution
|
|
95
|
+
if (attribution) {
|
|
96
|
+
layers.push({
|
|
97
|
+
type: 'text',
|
|
98
|
+
id: 'attribution',
|
|
99
|
+
content: {
|
|
100
|
+
text: `\u2014 ${attribution}`,
|
|
101
|
+
style: {
|
|
102
|
+
fontSize: attrFontSize,
|
|
103
|
+
color: 'rgba(255, 255, 255, 0.7)',
|
|
104
|
+
textAlign: 'center',
|
|
105
|
+
shadow: true,
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
position: {
|
|
109
|
+
x: '50%',
|
|
110
|
+
y: '72%',
|
|
111
|
+
anchor: 'center',
|
|
112
|
+
},
|
|
113
|
+
animation: { type: 'fadeIn', duration: 1, delay: 1.5 },
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return layers;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=videoPullQuote.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoPullQuote.js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AQ;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,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video With Caption Template
|
|
3
|
+
*
|
|
4
|
+
* Full-screen background video clip with text overlay. Mirrors the structure of
|
|
5
|
+
* imageWithCaption but uses a VideoLayer instead of an ImageLayer. The video
|
|
6
|
+
* plays muted — narration audio is the only sound track.
|
|
7
|
+
*
|
|
8
|
+
* Adapts caption positioning and font sizes for different viewports.
|
|
9
|
+
*
|
|
10
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
11
|
+
*
|
|
12
|
+
* Related Files:
|
|
13
|
+
* - shared/story/templates/imageWithCaption.ts — image equivalent
|
|
14
|
+
* - schemas/StoryScript.ts — VideoLayer type
|
|
15
|
+
* - site/src/components/story/layers/VideoLayer.tsx — rendering component
|
|
16
|
+
*/
|
|
17
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
18
|
+
import type { VideoWithCaptionInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
19
|
+
export declare function videoWithCaption(input: VideoWithCaptionInput, context: TemplateContext): Layer[];
|
|
20
|
+
//# sourceMappingURL=videoWithCaption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"videoWithCaption.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/videoWithCaption.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAI9F,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CAuGhG"}
|