@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,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Map Block Template
|
|
3
|
+
*
|
|
4
|
+
* Full-screen geographic map with optional title and caption overlays.
|
|
5
|
+
* Great for establishing geographic context at the start of a doc
|
|
6
|
+
* or when discussing location-specific content.
|
|
7
|
+
* Adapts font sizes and positioning for different viewports.
|
|
8
|
+
*
|
|
9
|
+
* Map tiles are fetched from free/open-source providers.
|
|
10
|
+
* See docs/MAP_TILES.md for available styles and attribution requirements.
|
|
11
|
+
*
|
|
12
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
13
|
+
*/
|
|
14
|
+
import { scaledFontSize } from '../../schemas/BlockTemplates.js';
|
|
15
|
+
import { mapAmbientMotion } from './accentImage.js';
|
|
16
|
+
export function mapBlock(input, context) {
|
|
17
|
+
const { center, zoom, mapStyle = 'terrain', title, caption, markers, ambientMotion, staticSrc, } = input;
|
|
18
|
+
const { theme, layout } = context;
|
|
19
|
+
// Scale font sizes for viewport
|
|
20
|
+
const titleFontSize = scaledFontSize(64, context, true);
|
|
21
|
+
const captionFontSize = scaledFontSize(32, context, false);
|
|
22
|
+
// Determine animation based on ambientMotion setting
|
|
23
|
+
const mapAnimation = mapAmbientMotion(ambientMotion);
|
|
24
|
+
const layers = [
|
|
25
|
+
// Map background
|
|
26
|
+
{
|
|
27
|
+
type: 'map',
|
|
28
|
+
id: 'map-bg',
|
|
29
|
+
content: {
|
|
30
|
+
center,
|
|
31
|
+
zoom,
|
|
32
|
+
style: mapStyle,
|
|
33
|
+
markers,
|
|
34
|
+
showAttribution: true,
|
|
35
|
+
staticSrc, // Use pre-rendered image if available
|
|
36
|
+
},
|
|
37
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
38
|
+
animation: mapAnimation,
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
// Add title overlay if provided
|
|
42
|
+
if (title) {
|
|
43
|
+
// Gradient overlay at top for title readability
|
|
44
|
+
layers.push({
|
|
45
|
+
type: 'shape',
|
|
46
|
+
id: 'title-overlay',
|
|
47
|
+
content: {
|
|
48
|
+
shape: 'rect',
|
|
49
|
+
fill: 'rgba(0,0,0,0.6)',
|
|
50
|
+
},
|
|
51
|
+
position: { x: 0, y: 0, width: '100%', height: '18%' },
|
|
52
|
+
});
|
|
53
|
+
// Title text - positioned at top of slide
|
|
54
|
+
layers.push({
|
|
55
|
+
type: 'text',
|
|
56
|
+
id: 'title',
|
|
57
|
+
content: {
|
|
58
|
+
text: title,
|
|
59
|
+
style: {
|
|
60
|
+
fontSize: titleFontSize,
|
|
61
|
+
fontWeight: 'bold',
|
|
62
|
+
color: theme.colors.text,
|
|
63
|
+
textAlign: 'center',
|
|
64
|
+
shadow: true,
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
position: {
|
|
68
|
+
x: '50%',
|
|
69
|
+
y: '9%',
|
|
70
|
+
anchor: 'center',
|
|
71
|
+
width: layout.maxTextWidth,
|
|
72
|
+
},
|
|
73
|
+
animation: { type: 'fadeIn', duration: 1, delay: 0.3 },
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
// Add caption if provided
|
|
77
|
+
if (caption) {
|
|
78
|
+
// Gradient overlay at bottom for caption readability
|
|
79
|
+
layers.push({
|
|
80
|
+
type: 'shape',
|
|
81
|
+
id: 'caption-overlay',
|
|
82
|
+
content: {
|
|
83
|
+
shape: 'rect',
|
|
84
|
+
fill: 'rgba(0,0,0,0.6)',
|
|
85
|
+
},
|
|
86
|
+
position: { x: 0, y: '82%', width: '100%', height: '18%' },
|
|
87
|
+
});
|
|
88
|
+
// Caption text
|
|
89
|
+
layers.push({
|
|
90
|
+
type: 'text',
|
|
91
|
+
id: 'caption',
|
|
92
|
+
content: {
|
|
93
|
+
text: caption,
|
|
94
|
+
style: {
|
|
95
|
+
fontSize: captionFontSize,
|
|
96
|
+
color: theme.colors.text,
|
|
97
|
+
textAlign: 'center',
|
|
98
|
+
shadow: true,
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
position: {
|
|
102
|
+
x: '50%',
|
|
103
|
+
y: layout.captionY,
|
|
104
|
+
anchor: 'center',
|
|
105
|
+
width: layout.maxTextWidth,
|
|
106
|
+
},
|
|
107
|
+
animation: { type: 'fadeIn', duration: 1, delay: 0.5 },
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
return layers;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=mapBlock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mapBlock.js","sourceRoot":"","sources":["../../../src/doc/templates/mapBlock.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAIH,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,MAAM,UAAU,QAAQ,CAAC,KAAoB,EAAE,OAAwB;IACrE,MAAM,EACJ,MAAM,EACN,IAAI,EACJ,QAAQ,GAAG,SAAS,EACpB,KAAK,EACL,OAAO,EACP,OAAO,EACP,aAAa,EACb,SAAS,GACV,GAAG,KAAK,CAAC;IACV,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC;IAElC,gCAAgC;IAChC,MAAM,aAAa,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACxD,MAAM,eAAe,GAAG,cAAc,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;IAE3D,qDAAqD;IACrD,MAAM,YAAY,GAAG,gBAAgB,CAAC,aAAa,CAAC,CAAC;IAErD,MAAM,MAAM,GAAY;QACtB,iBAAiB;QACjB;YACE,IAAI,EAAE,KAAK;YACX,EAAE,EAAE,QAAQ;YACZ,OAAO,EAAE;gBACP,MAAM;gBACN,IAAI;gBACJ,KAAK,EAAE,QAAQ;gBACf,OAAO;gBACP,eAAe,EAAE,IAAI;gBACrB,SAAS,EAAE,sCAAsC;aAClD;YACD,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM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AAC,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE;SAC3D,CAAC,CAAC;QAEH,eAAe;QACf,MAAM,CAAC,IAAI,CAAC;YACV,IAAI,EAAE,MAAM;YACZ,EAAE,EAAE,SAAS;YACb,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE;oBACL,QAAQ,EAAE,eAAe;oBACzB,KAAK,EAAE,KAAK,CAAC,MAAM,CAAC,IAAI;oBACxB,SAAS,EAAE,QAAQ;oBACnB,MAAM,EAAE,IAAI;iBACb;aACF;YACD,QAAQ,EAAE;gBACR,CAAC,EAAE,KAAK;gBACR,CAAC,EAAE,MAAM,CAAC,QAAQ;gBAClB,MAAM,EAAE,QAAQ;gBAChB,KAAK,EAAE,MAAM,CAAC,YAAY;aAC3B;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,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent Layers Expansion
|
|
3
|
+
*
|
|
4
|
+
* Expands persistent layer templates (solid backgrounds, gradients, overlays)
|
|
5
|
+
* into raw Layer arrays. These layers are injected into each block based on
|
|
6
|
+
* per-block flags (useBottomLayer, useTopLayer).
|
|
7
|
+
*
|
|
8
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
9
|
+
*
|
|
10
|
+
* Related Files:
|
|
11
|
+
* - schemas/BlockTemplates.ts - PersistentLayerConfig types
|
|
12
|
+
*/
|
|
13
|
+
import type { Layer } from '../../schemas/Doc.js';
|
|
14
|
+
import type { PersistentLayer, PersistentLayerConfig } from '../../schemas/BlockTemplates.js';
|
|
15
|
+
import type { Theme } from '../../schemas/Theme.js';
|
|
16
|
+
/**
|
|
17
|
+
* Expand a single persistent layer (template or raw) to raw Layer(s).
|
|
18
|
+
*/
|
|
19
|
+
export declare function expandPersistentLayer(layer: PersistentLayer): Layer[];
|
|
20
|
+
/**
|
|
21
|
+
* Expand all persistent layers in a config to raw Layer arrays.
|
|
22
|
+
*/
|
|
23
|
+
export declare function expandPersistentLayers(layers: PersistentLayer[] | undefined): Layer[];
|
|
24
|
+
/** Legacy style preset names. Prefer using `Theme.persistentLayers` directly. */
|
|
25
|
+
export type DocStylePreset = 'minimal' | 'documentary' | 'branded' | 'cinematic' | 'clean';
|
|
26
|
+
/**
|
|
27
|
+
* Get a PersistentLayerConfig from a style preset.
|
|
28
|
+
*
|
|
29
|
+
* @param preset - Style preset name
|
|
30
|
+
* @param articleTitle - Article title for title caption
|
|
31
|
+
* @param heroSrc - Optional hero image for cinematic style
|
|
32
|
+
*/
|
|
33
|
+
export declare function getDocStyleConfig(preset: DocStylePreset, articleTitle: string, heroSrc?: string, subtitle?: string): PersistentLayerConfig;
|
|
34
|
+
/**
|
|
35
|
+
* Get persistent layers from a Theme. Returns the theme's baked-in
|
|
36
|
+
* persistentLayers config, or an empty config when the theme has none.
|
|
37
|
+
*/
|
|
38
|
+
export declare function getPersistentLayersFromTheme(theme: Theme): PersistentLayerConfig;
|
|
39
|
+
//# sourceMappingURL=persistentLayers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistentLayers.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/persistentLayers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EACV,eAAe,EAEf,qBAAqB,EAQtB,MAAM,iCAAiC,CAAC;AACzC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAkUpD;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,eAAe,GAAG,KAAK,EAAE,CA4BrE;AAED;;GAEG;AACH,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,eAAe,EAAE,GAAG,SAAS,GAAG,KAAK,EAAE,CAOrF;AAMD,iFAAiF;AACjF,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,OAAO,CAAC;AAE3F;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,cAAc,EACtB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAChB,QAAQ,CAAC,EAAE,MAAM,GAChB,qBAAqB,CAqGvB;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,KAAK,GAAG,qBAAqB,CAEhF"}
|
|
@@ -0,0 +1,447 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent Layers Expansion
|
|
3
|
+
*
|
|
4
|
+
* Expands persistent layer templates (solid backgrounds, gradients, overlays)
|
|
5
|
+
* into raw Layer arrays. These layers are injected into each block based on
|
|
6
|
+
* per-block flags (useBottomLayer, useTopLayer).
|
|
7
|
+
*
|
|
8
|
+
* This is shared code used by both site and efb-app doc renderers.
|
|
9
|
+
*
|
|
10
|
+
* Related Files:
|
|
11
|
+
* - schemas/BlockTemplates.ts - PersistentLayerConfig types
|
|
12
|
+
*/
|
|
13
|
+
import { isPersistentLayerTemplate } from '../../schemas/BlockTemplates.js';
|
|
14
|
+
// ============================================
|
|
15
|
+
// Gradient Presets
|
|
16
|
+
// ============================================
|
|
17
|
+
const GRADIENT_PRESETS = {
|
|
18
|
+
'dark-vignette': 'radial-gradient(ellipse at center, rgba(26,32,44,0.8) 0%, rgba(0,0,0,0.95) 100%)',
|
|
19
|
+
'radial-dark': 'radial-gradient(ellipse at center, #1a202c 0%, #000000 100%)',
|
|
20
|
+
'warm-sunset': 'linear-gradient(135deg, rgba(124,58,48,0.9) 0%, rgba(26,32,44,0.95) 100%)',
|
|
21
|
+
'cool-blue': 'linear-gradient(135deg, rgba(26,54,93,0.9) 0%, rgba(26,32,44,0.95) 100%)',
|
|
22
|
+
'earth-tones': 'linear-gradient(135deg, rgba(68,51,34,0.9) 0%, rgba(26,32,44,0.95) 100%)',
|
|
23
|
+
};
|
|
24
|
+
// ============================================
|
|
25
|
+
// Background Layer Expansion
|
|
26
|
+
// ============================================
|
|
27
|
+
/**
|
|
28
|
+
* Expand a solid background config to a Layer.
|
|
29
|
+
*/
|
|
30
|
+
function expandSolidBackground(config) {
|
|
31
|
+
return {
|
|
32
|
+
type: 'shape',
|
|
33
|
+
id: 'persistent-bg-solid',
|
|
34
|
+
content: {
|
|
35
|
+
shape: 'rect',
|
|
36
|
+
fill: config.color,
|
|
37
|
+
},
|
|
38
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Expand a gradient background config to a Layer.
|
|
43
|
+
*/
|
|
44
|
+
function expandGradientBackground(config) {
|
|
45
|
+
const gradient = config.gradient ?? GRADIENT_PRESETS[config.preset ?? 'dark-vignette'];
|
|
46
|
+
return {
|
|
47
|
+
type: 'shape',
|
|
48
|
+
id: 'persistent-bg-gradient',
|
|
49
|
+
content: {
|
|
50
|
+
shape: 'rect',
|
|
51
|
+
fill: gradient,
|
|
52
|
+
},
|
|
53
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Expand an image background config to Layers.
|
|
58
|
+
* Returns multiple layers: base image + dark overlay for readability.
|
|
59
|
+
*/
|
|
60
|
+
function expandImageBackground(config) {
|
|
61
|
+
const layers = [];
|
|
62
|
+
const opacity = config.opacity ?? 0.4;
|
|
63
|
+
// Base image layer
|
|
64
|
+
const imageLayer = {
|
|
65
|
+
type: 'image',
|
|
66
|
+
id: 'persistent-bg-image',
|
|
67
|
+
content: {
|
|
68
|
+
src: config.src,
|
|
69
|
+
alt: 'Background',
|
|
70
|
+
fit: 'cover',
|
|
71
|
+
},
|
|
72
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
73
|
+
animation: config.ambientMotion
|
|
74
|
+
? {
|
|
75
|
+
type: config.ambientMotion,
|
|
76
|
+
duration: 30, // Long ambient motion
|
|
77
|
+
}
|
|
78
|
+
: undefined,
|
|
79
|
+
};
|
|
80
|
+
layers.push(imageLayer);
|
|
81
|
+
// Add dark overlay for text readability
|
|
82
|
+
layers.push({
|
|
83
|
+
type: 'shape',
|
|
84
|
+
id: 'persistent-bg-overlay',
|
|
85
|
+
content: {
|
|
86
|
+
shape: 'rect',
|
|
87
|
+
fill: `rgba(0,0,0,${0.5 + (1 - opacity) * 0.3})`,
|
|
88
|
+
},
|
|
89
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
90
|
+
});
|
|
91
|
+
return layers;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Expand a pattern background config to a Layer.
|
|
95
|
+
*/
|
|
96
|
+
function expandPatternBackground(config) {
|
|
97
|
+
const opacity = config.opacity ?? 0.1;
|
|
98
|
+
const color = config.color ?? `rgba(255,255,255,${opacity})`;
|
|
99
|
+
// Pattern as SVG data URI for rect patterns
|
|
100
|
+
// For simplicity, use a solid subtle color with reduced opacity
|
|
101
|
+
return {
|
|
102
|
+
type: 'shape',
|
|
103
|
+
id: 'persistent-bg-pattern',
|
|
104
|
+
content: {
|
|
105
|
+
shape: 'rect',
|
|
106
|
+
fill: color,
|
|
107
|
+
},
|
|
108
|
+
position: { x: 0, y: 0, width: '100%', height: '100%' },
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
// ============================================
|
|
112
|
+
// Overlay Layer Expansion
|
|
113
|
+
// ============================================
|
|
114
|
+
/**
|
|
115
|
+
* Expand a title caption config to Layers.
|
|
116
|
+
*/
|
|
117
|
+
function expandTitleCaption(config) {
|
|
118
|
+
const layers = [];
|
|
119
|
+
const fontSize = config.fontSize ?? 18;
|
|
120
|
+
const hasSubtitle = !!config.subtitle;
|
|
121
|
+
// Position calculations
|
|
122
|
+
const isBottom = config.position.includes('bottom');
|
|
123
|
+
const isLeft = config.position.includes('left');
|
|
124
|
+
// Even padding around the pill (3% from edges)
|
|
125
|
+
const pad = 3; // percent
|
|
126
|
+
// Pill dimensions — taller when subtitle present
|
|
127
|
+
const pillHeight = hasSubtitle ? '15%' : '7%';
|
|
128
|
+
// Position above player controls
|
|
129
|
+
const bgYPos = isBottom ? (hasSubtitle ? '78%' : '84%') : '2%';
|
|
130
|
+
const bgXPos = isLeft ? `${pad}%` : '68%';
|
|
131
|
+
// Thumbnail sizing — use different width/height to appear square in 16:9 viewport
|
|
132
|
+
// In 16:9, 6% of width ≈ 10.7% of height in pixels, so use ~6%w x 10%h for visual square
|
|
133
|
+
const thumbW = hasSubtitle ? '6%' : '5%';
|
|
134
|
+
const thumbH = hasSubtitle ? '10%' : '5%';
|
|
135
|
+
const thumbPad = 1.5; // padding inside pill around thumbnail (percent)
|
|
136
|
+
// Text X offset: after thumbnail + padding, or just pill padding
|
|
137
|
+
const textX = config.showThumbnail && isLeft
|
|
138
|
+
? `${pad + thumbPad + 6 + thumbPad}%` // pill edge + thumb padding + thumb width + gap
|
|
139
|
+
: `${pad + thumbPad}%`;
|
|
140
|
+
// Text area width: pill width minus thumbnail area minus padding
|
|
141
|
+
const textWidth = config.showThumbnail
|
|
142
|
+
? '19%' // narrower when thumbnail takes space
|
|
143
|
+
: '24%';
|
|
144
|
+
// Title Y: top of text area inside pill
|
|
145
|
+
const titleYPos = isBottom ? (hasSubtitle ? '80%' : '86%') : '4%';
|
|
146
|
+
// Background pill for readability
|
|
147
|
+
layers.push({
|
|
148
|
+
type: 'shape',
|
|
149
|
+
id: 'persistent-caption-bg',
|
|
150
|
+
content: {
|
|
151
|
+
shape: 'rect',
|
|
152
|
+
fill: 'rgba(0,0,0,0.6)',
|
|
153
|
+
borderRadius: 8,
|
|
154
|
+
},
|
|
155
|
+
position: {
|
|
156
|
+
x: bgXPos,
|
|
157
|
+
y: bgYPos,
|
|
158
|
+
width: config.showThumbnail ? '30%' : '28%',
|
|
159
|
+
height: pillHeight,
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
// Thumbnail if configured
|
|
163
|
+
if (config.showThumbnail && config.thumbnailSrc) {
|
|
164
|
+
const thumbX = isLeft ? `${pad + thumbPad}%` : '93%';
|
|
165
|
+
// Center thumbnail vertically in pill
|
|
166
|
+
const thumbY = isBottom ? (hasSubtitle ? `${78 + thumbPad}%` : '85%') : '3%';
|
|
167
|
+
layers.push({
|
|
168
|
+
type: 'image',
|
|
169
|
+
id: 'persistent-caption-thumb',
|
|
170
|
+
content: {
|
|
171
|
+
src: config.thumbnailSrc,
|
|
172
|
+
alt: 'Article thumbnail',
|
|
173
|
+
fit: 'cover',
|
|
174
|
+
},
|
|
175
|
+
position: {
|
|
176
|
+
x: thumbX,
|
|
177
|
+
y: thumbY,
|
|
178
|
+
width: thumbW,
|
|
179
|
+
height: thumbH,
|
|
180
|
+
},
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
// Title text — single line, cropped with ellipsis
|
|
184
|
+
layers.push({
|
|
185
|
+
type: 'text',
|
|
186
|
+
id: 'persistent-caption-title',
|
|
187
|
+
content: {
|
|
188
|
+
text: config.title,
|
|
189
|
+
style: {
|
|
190
|
+
fontSize,
|
|
191
|
+
fontWeight: 'bold',
|
|
192
|
+
color: 'rgba(255,255,255,0.9)',
|
|
193
|
+
textAlign: isLeft ? 'left' : 'right',
|
|
194
|
+
maxLines: 1,
|
|
195
|
+
},
|
|
196
|
+
},
|
|
197
|
+
position: {
|
|
198
|
+
x: textX,
|
|
199
|
+
y: titleYPos,
|
|
200
|
+
width: textWidth,
|
|
201
|
+
},
|
|
202
|
+
});
|
|
203
|
+
// Subtitle text (e.g., short URL)
|
|
204
|
+
if (hasSubtitle) {
|
|
205
|
+
const subtitleYPos = isBottom ? '85.5%' : '8%';
|
|
206
|
+
layers.push({
|
|
207
|
+
type: 'text',
|
|
208
|
+
id: 'persistent-caption-subtitle',
|
|
209
|
+
content: {
|
|
210
|
+
text: config.subtitle,
|
|
211
|
+
style: {
|
|
212
|
+
fontSize: 18,
|
|
213
|
+
fontWeight: 'normal',
|
|
214
|
+
color: 'rgba(255,255,255,0.55)',
|
|
215
|
+
textAlign: isLeft ? 'left' : 'right',
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
|
+
position: {
|
|
219
|
+
x: textX,
|
|
220
|
+
y: subtitleYPos,
|
|
221
|
+
width: textWidth,
|
|
222
|
+
},
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
return layers;
|
|
226
|
+
}
|
|
227
|
+
/**
|
|
228
|
+
* Expand a corner branding config to a Layer.
|
|
229
|
+
*/
|
|
230
|
+
function expandCornerBranding(config) {
|
|
231
|
+
const isBottom = config.position.includes('bottom');
|
|
232
|
+
const isLeft = config.position.includes('left');
|
|
233
|
+
const xPos = isLeft ? '3%' : '90%';
|
|
234
|
+
const yPos = isBottom ? '94%' : '3%';
|
|
235
|
+
if (config.isImage) {
|
|
236
|
+
return {
|
|
237
|
+
type: 'image',
|
|
238
|
+
id: 'persistent-branding',
|
|
239
|
+
content: {
|
|
240
|
+
src: config.content,
|
|
241
|
+
alt: 'Branding',
|
|
242
|
+
fit: 'contain',
|
|
243
|
+
},
|
|
244
|
+
position: {
|
|
245
|
+
x: xPos,
|
|
246
|
+
y: yPos,
|
|
247
|
+
width: '8%',
|
|
248
|
+
height: '4%',
|
|
249
|
+
},
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
type: 'text',
|
|
254
|
+
id: 'persistent-branding',
|
|
255
|
+
content: {
|
|
256
|
+
text: config.content,
|
|
257
|
+
style: {
|
|
258
|
+
fontSize: 14,
|
|
259
|
+
fontWeight: 'normal',
|
|
260
|
+
color: 'rgba(255,255,255,0.6)',
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
position: {
|
|
264
|
+
x: xPos,
|
|
265
|
+
y: yPos,
|
|
266
|
+
},
|
|
267
|
+
};
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Expand a progress indicator config to a Layer.
|
|
271
|
+
* Note: Progress requires block context, returns placeholder bar.
|
|
272
|
+
*/
|
|
273
|
+
function expandProgressIndicator(config) {
|
|
274
|
+
const color = config.color ?? 'rgba(255,255,255,0.3)';
|
|
275
|
+
const y = config.position === 'top' ? '1%' : '98%';
|
|
276
|
+
// Simple bar style - actual progress would need to be set per-block
|
|
277
|
+
return {
|
|
278
|
+
type: 'shape',
|
|
279
|
+
id: 'persistent-progress',
|
|
280
|
+
content: {
|
|
281
|
+
shape: 'rect',
|
|
282
|
+
fill: color,
|
|
283
|
+
borderRadius: 2,
|
|
284
|
+
},
|
|
285
|
+
position: {
|
|
286
|
+
x: '5%',
|
|
287
|
+
y,
|
|
288
|
+
width: '90%',
|
|
289
|
+
height: '0.5%',
|
|
290
|
+
},
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
// ============================================
|
|
294
|
+
// Main Expansion Function
|
|
295
|
+
// ============================================
|
|
296
|
+
/**
|
|
297
|
+
* Expand a single persistent layer (template or raw) to raw Layer(s).
|
|
298
|
+
*/
|
|
299
|
+
export function expandPersistentLayer(layer) {
|
|
300
|
+
// If already a raw Layer, return as-is
|
|
301
|
+
if (!isPersistentLayerTemplate(layer)) {
|
|
302
|
+
return [layer];
|
|
303
|
+
}
|
|
304
|
+
const template = layer;
|
|
305
|
+
const config = template.config;
|
|
306
|
+
switch (config.type) {
|
|
307
|
+
case 'solidBackground':
|
|
308
|
+
return [expandSolidBackground(config)];
|
|
309
|
+
case 'gradientBackground':
|
|
310
|
+
return [expandGradientBackground(config)];
|
|
311
|
+
case 'imageBackground':
|
|
312
|
+
return expandImageBackground(config);
|
|
313
|
+
case 'patternBackground':
|
|
314
|
+
return [expandPatternBackground(config)];
|
|
315
|
+
case 'titleCaption':
|
|
316
|
+
return expandTitleCaption(config);
|
|
317
|
+
case 'cornerBranding':
|
|
318
|
+
return [expandCornerBranding(config)];
|
|
319
|
+
case 'progressIndicator':
|
|
320
|
+
return [expandProgressIndicator(config)];
|
|
321
|
+
default:
|
|
322
|
+
console.warn('Unknown persistent layer template:', config.type);
|
|
323
|
+
return [];
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Expand all persistent layers in a config to raw Layer arrays.
|
|
328
|
+
*/
|
|
329
|
+
export function expandPersistentLayers(layers) {
|
|
330
|
+
if (!layers || layers.length === 0) {
|
|
331
|
+
return [];
|
|
332
|
+
}
|
|
333
|
+
// Use reduce+concat instead of flatMap for Coherent GT compatibility (ES2017)
|
|
334
|
+
return layers.reduce((acc, layer) => acc.concat(expandPersistentLayer(layer)), []);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Get a PersistentLayerConfig from a style preset.
|
|
338
|
+
*
|
|
339
|
+
* @param preset - Style preset name
|
|
340
|
+
* @param articleTitle - Article title for title caption
|
|
341
|
+
* @param heroSrc - Optional hero image for cinematic style
|
|
342
|
+
*/
|
|
343
|
+
export function getDocStyleConfig(preset, articleTitle, heroSrc, subtitle) {
|
|
344
|
+
switch (preset) {
|
|
345
|
+
case 'minimal':
|
|
346
|
+
return {};
|
|
347
|
+
case 'documentary':
|
|
348
|
+
return {
|
|
349
|
+
bottomLayers: [
|
|
350
|
+
{
|
|
351
|
+
template: 'gradientBackground',
|
|
352
|
+
config: { type: 'gradientBackground', preset: 'dark-vignette' },
|
|
353
|
+
},
|
|
354
|
+
],
|
|
355
|
+
topLayers: [
|
|
356
|
+
{
|
|
357
|
+
template: 'titleCaption',
|
|
358
|
+
config: {
|
|
359
|
+
type: 'titleCaption',
|
|
360
|
+
title: articleTitle,
|
|
361
|
+
subtitle,
|
|
362
|
+
position: 'bottom-left',
|
|
363
|
+
fontSize: 24,
|
|
364
|
+
showThumbnail: !!heroSrc,
|
|
365
|
+
thumbnailSrc: heroSrc,
|
|
366
|
+
},
|
|
367
|
+
},
|
|
368
|
+
],
|
|
369
|
+
};
|
|
370
|
+
case 'branded':
|
|
371
|
+
return {
|
|
372
|
+
bottomLayers: [
|
|
373
|
+
{
|
|
374
|
+
template: 'gradientBackground',
|
|
375
|
+
config: { type: 'gradientBackground', preset: 'cool-blue' },
|
|
376
|
+
},
|
|
377
|
+
],
|
|
378
|
+
topLayers: [
|
|
379
|
+
{
|
|
380
|
+
template: 'titleCaption',
|
|
381
|
+
config: {
|
|
382
|
+
type: 'titleCaption',
|
|
383
|
+
title: articleTitle,
|
|
384
|
+
subtitle,
|
|
385
|
+
position: 'bottom-left',
|
|
386
|
+
fontSize: 26,
|
|
387
|
+
showThumbnail: !!heroSrc,
|
|
388
|
+
thumbnailSrc: heroSrc,
|
|
389
|
+
},
|
|
390
|
+
},
|
|
391
|
+
],
|
|
392
|
+
};
|
|
393
|
+
case 'cinematic':
|
|
394
|
+
return {
|
|
395
|
+
bottomLayers: heroSrc
|
|
396
|
+
? [
|
|
397
|
+
{
|
|
398
|
+
template: 'imageBackground',
|
|
399
|
+
config: {
|
|
400
|
+
type: 'imageBackground',
|
|
401
|
+
src: heroSrc,
|
|
402
|
+
blur: 12,
|
|
403
|
+
opacity: 0.3,
|
|
404
|
+
ambientMotion: 'zoomIn',
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
]
|
|
408
|
+
: [
|
|
409
|
+
{
|
|
410
|
+
template: 'gradientBackground',
|
|
411
|
+
config: { type: 'gradientBackground', preset: 'radial-dark' },
|
|
412
|
+
},
|
|
413
|
+
],
|
|
414
|
+
topLayers: [
|
|
415
|
+
{
|
|
416
|
+
template: 'titleCaption',
|
|
417
|
+
config: {
|
|
418
|
+
type: 'titleCaption',
|
|
419
|
+
title: articleTitle,
|
|
420
|
+
subtitle,
|
|
421
|
+
position: 'bottom-right',
|
|
422
|
+
fontSize: 22,
|
|
423
|
+
},
|
|
424
|
+
},
|
|
425
|
+
],
|
|
426
|
+
};
|
|
427
|
+
case 'clean':
|
|
428
|
+
return {
|
|
429
|
+
bottomLayers: [
|
|
430
|
+
{
|
|
431
|
+
template: 'solidBackground',
|
|
432
|
+
config: { type: 'solidBackground', color: '#1a202c' },
|
|
433
|
+
},
|
|
434
|
+
],
|
|
435
|
+
};
|
|
436
|
+
default:
|
|
437
|
+
return {};
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
/**
|
|
441
|
+
* Get persistent layers from a Theme. Returns the theme's baked-in
|
|
442
|
+
* persistentLayers config, or an empty config when the theme has none.
|
|
443
|
+
*/
|
|
444
|
+
export function getPersistentLayersFromTheme(theme) {
|
|
445
|
+
return theme.persistentLayers ?? {};
|
|
446
|
+
}
|
|
447
|
+
//# sourceMappingURL=persistentLayers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistentLayers.js","sourceRoot":"","sources":["../../../src/doc/templates/persistentLayers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAgBH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAE5E,+CAA+C;AAC/C,mBAAmB;AACnB,+CAA+C;AAE/C,MAAM,gBAAgB,GAA2B;IAC/C,eAAe,EACb,kFAAkF;IACpF,aAAa,EAAE,8DAA8D;IAC7E,aAAa,EAAE,2EAA2E;IAC1F,WAAW,EAAE,0EAA0E;IACvF,aAAa,EAAE,0EAA0E;CAC1F,CAAC;AAEF,+CAA+C;AAC/C,6BAA6B;AAC7B,+CAA+C;AAE/C;;GAEG;AACH,SAAS,qBAAqB,CAAC,MAA6B;IAC1D,OAAO;QACL,IAAI,EAAE,OAAO;QACb,EAAE,EAAE,qBAAqB;QACzB,OAAO,EAAE;YACP,KAAK,EAAE,MAAM;YACb,IAAI,EAAE,MAAM,CAAC,KAAK;SACnB;QACD,QAAQ,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,M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,QAAQ,EAAE,iBAAiB;4BAC3B,MAAM,EAAE;gCACN,IAAI,EAAE,iBAAiB;gCACvB,GAAG,EAAE,OAAO;gCACZ,IAAI,EAAE,EAAE;gCACR,OAAO,EAAE,GAAG;gCACZ,aAAa,EAAE,QAAQ;6BACxB;yBACF;qBACF;oBACH,CAAC,CAAC;wBACE;4BACE,QAAQ,EAAE,oBAAoB;4BAC9B,MAAM,EAAE,EAAE,IAAI,EAAE,oBAAoB,EAAE,MAAM,EAAE,aAAa,EAAE;yBAC9D;qBACF;gBACL,SAAS,EAAE;oBACT;wBACE,QAAQ,EAAE,cAAc;wBACxB,MAAM,EAAE;4BACN,IAAI,EAAE,cAAc;4BACpB,KAAK,EAAE,YAAY;4BACnB,QAAQ;4BACR,QAAQ,EAAE,cAAc;4BACxB,QAAQ,EAAE,EAAE;yBACb;qBACF;iBACF;aACF,CAAC;QAEJ,KAAK,OAAO;YACV,OAAO;gBACL,YAAY,EAAE;oBACZ;wBACE,QAAQ,EAAE,iBAAiB;wBAC3B,MAAM,EAAE,EAAE,IAAI,EAAE,iBAAiB,EAAE,KAAK,EAAE,SAAS,EAAE;qBACtD;iBACF;aACF,CAAC;QAEJ;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,4BAA4B,CAAC,KAAY;IACvD,OAAO,KAAK,CAAC,gBAAgB,IAAI,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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 type { Layer } from '../../schemas/Doc.js';
|
|
18
|
+
import type { PhotoGridInput, TemplateContext } from '../../schemas/BlockTemplates.js';
|
|
19
|
+
export declare function photoGrid(input: PhotoGridInput, context: TemplateContext): Layer[];
|
|
20
|
+
//# sourceMappingURL=photoGrid.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"photoGrid.d.ts","sourceRoot":"","sources":["../../../src/doc/templates/photoGrid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAOvF,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,eAAe,GAAG,KAAK,EAAE,CAuHlF"}
|