@bendyline/squisq 1.1.0 → 1.1.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/ContentContainer-DNx460y8.d.ts +88 -0
- package/dist/{Doc-1hmT1LZl.d.ts → Doc-Cvt2lyzn.d.ts} +56 -4
- package/dist/__tests__/markdownToDoc.test.js +75 -0
- package/dist/__tests__/markdownToDoc.test.js.map +1 -1
- package/dist/{chunk-PJ7AODIM.js → chunk-3WBJAZZ5.js} +394 -52
- package/dist/chunk-3WBJAZZ5.js.map +1 -0
- package/dist/{chunk-6YJPI6VI.js → chunk-4X3JQXNM.js} +1 -1
- package/dist/{chunk-S4F2RY37.js → chunk-CORGFIFU.js} +1 -1
- package/dist/chunk-CORGFIFU.js.map +1 -0
- package/dist/chunk-DNJKBAI7.js +1 -0
- package/dist/chunk-DNJKBAI7.js.map +1 -0
- package/dist/{chunk-VP5SZTZ2.js → chunk-MIBRIRGJ.js} +2 -139
- package/dist/chunk-MIBRIRGJ.js.map +1 -0
- package/dist/{chunk-URU6QMLY.js → chunk-NJLL5XYC.js} +15 -8
- package/dist/chunk-NJLL5XYC.js.map +1 -0
- package/dist/chunk-OFU53HI7.js +165 -0
- package/dist/chunk-OFU53HI7.js.map +1 -0
- package/dist/chunk-TSG2OSE6.js +145 -0
- package/dist/chunk-TSG2OSE6.js.map +1 -0
- package/dist/{chunk-O5HCIUAD.js → chunk-TVPKD76V.js} +81 -187
- package/dist/chunk-TVPKD76V.js.map +1 -0
- package/dist/contentExtractor-BNfVJV2U.d.ts +113 -0
- package/dist/doc/audioMapping.d.ts +36 -0
- package/dist/doc/audioMapping.d.ts.map +1 -0
- package/dist/doc/audioMapping.js +279 -0
- package/dist/doc/audioMapping.js.map +1 -0
- package/dist/doc/index.d.ts +1 -0
- package/dist/doc/index.d.ts.map +1 -1
- package/dist/doc/index.js +1 -0
- package/dist/doc/index.js.map +1 -1
- package/dist/doc/markdownToDoc.d.ts.map +1 -1
- package/dist/doc/markdownToDoc.js +126 -1
- package/dist/doc/markdownToDoc.js.map +1 -1
- package/dist/doc/templates/comparisonBar.d.ts.map +1 -1
- package/dist/doc/templates/comparisonBar.js +23 -5
- package/dist/doc/templates/comparisonBar.js.map +1 -1
- package/dist/doc/templates/coverBlock.d.ts.map +1 -1
- package/dist/doc/templates/coverBlock.js +3 -0
- package/dist/doc/templates/coverBlock.js.map +1 -1
- package/dist/doc/templates/dateEvent.d.ts.map +1 -1
- package/dist/doc/templates/dateEvent.js +4 -0
- package/dist/doc/templates/dateEvent.js.map +1 -1
- package/dist/doc/templates/definitionCard.d.ts.map +1 -1
- package/dist/doc/templates/definitionCard.js +4 -1
- package/dist/doc/templates/definitionCard.js.map +1 -1
- package/dist/doc/templates/factCard.d.ts.map +1 -1
- package/dist/doc/templates/factCard.js +4 -0
- package/dist/doc/templates/factCard.js.map +1 -1
- package/dist/doc/templates/fullBleedQuote.d.ts.map +1 -1
- package/dist/doc/templates/fullBleedQuote.js +2 -1
- package/dist/doc/templates/fullBleedQuote.js.map +1 -1
- package/dist/doc/templates/imageWithCaption.d.ts.map +1 -1
- package/dist/doc/templates/imageWithCaption.js +4 -0
- package/dist/doc/templates/imageWithCaption.js.map +1 -1
- package/dist/doc/templates/listBlock.d.ts.map +1 -1
- package/dist/doc/templates/listBlock.js +3 -0
- package/dist/doc/templates/listBlock.js.map +1 -1
- package/dist/doc/templates/mapBlock.d.ts.map +1 -1
- package/dist/doc/templates/mapBlock.js +3 -0
- package/dist/doc/templates/mapBlock.js.map +1 -1
- package/dist/doc/templates/photoGrid.d.ts.map +1 -1
- package/dist/doc/templates/photoGrid.js +3 -0
- package/dist/doc/templates/photoGrid.js.map +1 -1
- package/dist/doc/templates/pullQuote.d.ts.map +1 -1
- package/dist/doc/templates/pullQuote.js +4 -0
- package/dist/doc/templates/pullQuote.js.map +1 -1
- package/dist/doc/templates/quoteBlock.d.ts.map +1 -1
- package/dist/doc/templates/quoteBlock.js +4 -0
- package/dist/doc/templates/quoteBlock.js.map +1 -1
- package/dist/doc/templates/sectionHeader.d.ts.map +1 -1
- package/dist/doc/templates/sectionHeader.js +3 -2
- package/dist/doc/templates/sectionHeader.js.map +1 -1
- package/dist/doc/templates/statHighlight.d.ts.map +1 -1
- package/dist/doc/templates/statHighlight.js +4 -1
- package/dist/doc/templates/statHighlight.js.map +1 -1
- package/dist/doc/templates/titleBlock.d.ts.map +1 -1
- package/dist/doc/templates/titleBlock.js +3 -0
- package/dist/doc/templates/titleBlock.js.map +1 -1
- package/dist/doc/templates/twoColumn.d.ts.map +1 -1
- package/dist/doc/templates/twoColumn.js +7 -1
- package/dist/doc/templates/twoColumn.js.map +1 -1
- package/dist/doc/templates/videoPullQuote.d.ts.map +1 -1
- package/dist/doc/templates/videoPullQuote.js +4 -0
- package/dist/doc/templates/videoPullQuote.js.map +1 -1
- package/dist/doc/templates/videoWithCaption.d.ts.map +1 -1
- package/dist/doc/templates/videoWithCaption.js +3 -0
- package/dist/doc/templates/videoWithCaption.js.map +1 -1
- package/dist/doc/utils/themeUtils.d.ts +9 -0
- package/dist/doc/utils/themeUtils.d.ts.map +1 -1
- package/dist/doc/utils/themeUtils.js +26 -0
- package/dist/doc/utils/themeUtils.js.map +1 -1
- package/dist/markdown/convert.d.ts.map +1 -1
- package/dist/markdown/convert.js +16 -7
- package/dist/markdown/convert.js.map +1 -1
- package/dist/markdown/types.d.ts +4 -2
- package/dist/markdown/types.d.ts.map +1 -1
- package/dist/schemas/BlockTemplates.d.ts +2 -2
- package/dist/schemas/BlockTemplates.d.ts.map +1 -1
- package/dist/schemas/BlockTemplates.js +2 -2
- package/dist/schemas/BlockTemplates.js.map +1 -1
- package/dist/schemas/Doc.d.ts +52 -0
- package/dist/schemas/Doc.d.ts.map +1 -1
- package/dist/schemas/Doc.js.map +1 -1
- package/dist/schemas/themeLibrary.d.ts +2 -2
- package/dist/schemas/themeLibrary.d.ts.map +1 -1
- package/dist/schemas/themeLibrary.js +91 -26
- package/dist/schemas/themeLibrary.js.map +1 -1
- package/dist/story/index.d.ts +50 -5
- package/dist/story/index.js +15 -5
- package/dist/{themeLibrary-DR1VRo-8.d.ts → themeLibrary-VOHfPzRB.d.ts} +3 -3
- package/dist/transform/applyTransform.d.ts +22 -0
- package/dist/transform/applyTransform.d.ts.map +1 -0
- package/dist/transform/applyTransform.js +68 -0
- package/dist/transform/applyTransform.js.map +1 -0
- package/dist/transform/blockAnalyzer.d.ts +48 -0
- package/dist/transform/blockAnalyzer.d.ts.map +1 -0
- package/dist/transform/blockAnalyzer.js +135 -0
- package/dist/transform/blockAnalyzer.js.map +1 -0
- package/dist/transform/index.d.ts +6 -0
- package/dist/transform/index.d.ts.map +1 -0
- package/dist/transform/index.js +4 -0
- package/dist/transform/index.js.map +1 -0
- package/dist/transform/registry.d.ts +19 -0
- package/dist/transform/registry.d.ts.map +1 -0
- package/dist/transform/registry.js +41 -0
- package/dist/transform/registry.js.map +1 -0
- package/dist/transform/styles/dataDriven.d.ts +4 -0
- package/dist/transform/styles/dataDriven.d.ts.map +1 -0
- package/dist/transform/styles/dataDriven.js +15 -0
- package/dist/transform/styles/dataDriven.js.map +1 -0
- package/dist/transform/styles/documentary.d.ts +4 -0
- package/dist/transform/styles/documentary.d.ts.map +1 -0
- package/dist/transform/styles/documentary.js +15 -0
- package/dist/transform/styles/documentary.js.map +1 -0
- package/dist/transform/styles/index.d.ts +6 -0
- package/dist/transform/styles/index.d.ts.map +1 -0
- package/dist/transform/styles/index.js +6 -0
- package/dist/transform/styles/index.js.map +1 -0
- package/dist/transform/styles/magazine.d.ts +4 -0
- package/dist/transform/styles/magazine.d.ts.map +1 -0
- package/dist/transform/styles/magazine.js +15 -0
- package/dist/transform/styles/magazine.js.map +1 -0
- package/dist/transform/styles/minimal.d.ts +4 -0
- package/dist/transform/styles/minimal.d.ts.map +1 -0
- package/dist/transform/styles/minimal.js +15 -0
- package/dist/transform/styles/minimal.js.map +1 -0
- package/dist/transform/styles/narrative.d.ts +4 -0
- package/dist/transform/styles/narrative.d.ts.map +1 -0
- package/dist/transform/styles/narrative.js +15 -0
- package/dist/transform/styles/narrative.js.map +1 -0
- package/dist/transform/templateSelector.d.ts +30 -0
- package/dist/transform/templateSelector.d.ts.map +1 -0
- package/dist/transform/templateSelector.js +218 -0
- package/dist/transform/templateSelector.js.map +1 -0
- package/dist/transform/timingAllocator.d.ts +21 -0
- package/dist/transform/timingAllocator.d.ts.map +1 -0
- package/dist/transform/timingAllocator.js +111 -0
- package/dist/transform/timingAllocator.js.map +1 -0
- package/dist/transform/types.d.ts +86 -0
- package/dist/transform/types.d.ts.map +1 -0
- package/dist/transform/types.js +9 -0
- package/dist/transform/types.js.map +1 -0
- package/dist/{types-DHiv_Pnm.d.ts → types-DYAzisMG.d.ts} +4 -2
- package/package.json +6 -1
- package/src/__tests__/markdownToDoc.test.ts +96 -0
- package/src/doc/audioMapping.ts +346 -0
- package/src/doc/index.ts +1 -0
- package/src/doc/markdownToDoc.ts +136 -2
- package/src/doc/templates/comparisonBar.ts +23 -5
- package/src/doc/templates/coverBlock.ts +3 -0
- package/src/doc/templates/dateEvent.ts +4 -0
- package/src/doc/templates/definitionCard.ts +4 -1
- package/src/doc/templates/factCard.ts +4 -0
- package/src/doc/templates/fullBleedQuote.ts +2 -1
- package/src/doc/templates/imageWithCaption.ts +4 -0
- package/src/doc/templates/listBlock.ts +3 -0
- package/src/doc/templates/mapBlock.ts +3 -0
- package/src/doc/templates/photoGrid.ts +3 -0
- package/src/doc/templates/pullQuote.ts +4 -0
- package/src/doc/templates/quoteBlock.ts +4 -0
- package/src/doc/templates/sectionHeader.ts +3 -2
- package/src/doc/templates/statHighlight.ts +4 -1
- package/src/doc/templates/titleBlock.ts +3 -0
- package/src/doc/templates/twoColumn.ts +7 -1
- package/src/doc/templates/videoPullQuote.ts +4 -0
- package/src/doc/templates/videoWithCaption.ts +3 -0
- package/src/doc/utils/themeUtils.ts +29 -0
- package/src/markdown/convert.ts +17 -7
- package/src/markdown/types.ts +4 -2
- package/src/schemas/BlockTemplates.ts +2 -2
- package/src/schemas/Doc.ts +60 -0
- package/src/schemas/themeLibrary.ts +95 -26
- package/src/transform/applyTransform.ts +83 -0
- package/src/transform/blockAnalyzer.ts +181 -0
- package/src/transform/index.ts +20 -0
- package/src/transform/registry.ts +47 -0
- package/src/transform/styles/dataDriven.ts +16 -0
- package/src/transform/styles/documentary.ts +16 -0
- package/src/transform/styles/index.ts +5 -0
- package/src/transform/styles/magazine.ts +16 -0
- package/src/transform/styles/minimal.ts +16 -0
- package/src/transform/styles/narrative.ts +16 -0
- package/src/transform/templateSelector.ts +294 -0
- package/src/transform/timingAllocator.ts +126 -0
- package/src/transform/types.ts +105 -0
- package/dist/chunk-O5HCIUAD.js.map +0 -1
- package/dist/chunk-PJ7AODIM.js.map +0 -1
- package/dist/chunk-S4F2RY37.js.map +0 -1
- package/dist/chunk-URU6QMLY.js.map +0 -1
- package/dist/chunk-VP5SZTZ2.js.map +0 -1
- /package/dist/{chunk-6YJPI6VI.js.map → chunk-4X3JQXNM.js.map} +0 -0
|
@@ -1,156 +1,22 @@
|
|
|
1
|
-
// src/schemas/Viewport.ts
|
|
2
|
-
var VIEWPORT_PRESETS = {
|
|
3
|
-
/** 16:9 landscape (default, 1080p) */
|
|
4
|
-
landscape: { width: 1920, height: 1080, name: "16:9 Landscape" },
|
|
5
|
-
/** 9:16 portrait (vertical video, stories) */
|
|
6
|
-
portrait: { width: 1080, height: 1920, name: "9:16 Portrait" },
|
|
7
|
-
/** 1:1 square (social media) */
|
|
8
|
-
square: { width: 1080, height: 1080, name: "1:1 Square" },
|
|
9
|
-
/** 4:3 standard (legacy) */
|
|
10
|
-
standard: { width: 1440, height: 1080, name: "4:3 Standard" }
|
|
11
|
-
};
|
|
12
|
-
function getViewport(viewport) {
|
|
13
|
-
if (typeof viewport === "string") {
|
|
14
|
-
return VIEWPORT_PRESETS[viewport];
|
|
15
|
-
}
|
|
16
|
-
return viewport;
|
|
17
|
-
}
|
|
18
|
-
var REFERENCE_DIAGONAL = Math.sqrt(1920 * 1920 + 1080 * 1080);
|
|
19
|
-
function calculateFontScale(viewport) {
|
|
20
|
-
const currentDiagonal = Math.sqrt(
|
|
21
|
-
viewport.width * viewport.width + viewport.height * viewport.height
|
|
22
|
-
);
|
|
23
|
-
return currentDiagonal / REFERENCE_DIAGONAL;
|
|
24
|
-
}
|
|
25
|
-
function getViewportOrientation(viewport) {
|
|
26
|
-
const ratio = viewport.width / viewport.height;
|
|
27
|
-
if (Math.abs(ratio - 1) < 0.05) return "square";
|
|
28
|
-
return ratio > 1 ? "landscape" : "portrait";
|
|
29
|
-
}
|
|
30
|
-
function getAspectRatioString(viewport) {
|
|
31
|
-
const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
|
|
32
|
-
const divisor = gcd(viewport.width, viewport.height);
|
|
33
|
-
return `${viewport.width / divisor}:${viewport.height / divisor}`;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// src/schemas/LayoutStrategy.ts
|
|
37
|
-
var LAYOUT_CONFIGS = {
|
|
38
|
-
landscape: {
|
|
39
|
-
primaryY: "35%",
|
|
40
|
-
secondaryY: "55%",
|
|
41
|
-
tertiaryY: "75%",
|
|
42
|
-
titleScale: 1,
|
|
43
|
-
bodyScale: 1,
|
|
44
|
-
columnLeftX: "25%",
|
|
45
|
-
columnRightX: "75%",
|
|
46
|
-
columnTopY: "35%",
|
|
47
|
-
columnBottomY: "65%",
|
|
48
|
-
stackColumns: false,
|
|
49
|
-
maxTextWidth: "80%",
|
|
50
|
-
horizontalPadding: "10%",
|
|
51
|
-
captionY: "85%",
|
|
52
|
-
captionScale: 1
|
|
53
|
-
},
|
|
54
|
-
portrait: {
|
|
55
|
-
// Content positioned higher for thumb-reach zone on mobile
|
|
56
|
-
primaryY: "25%",
|
|
57
|
-
secondaryY: "42%",
|
|
58
|
-
tertiaryY: "58%",
|
|
59
|
-
// Titles scale down for narrower width; body text scales up to fill vertical space
|
|
60
|
-
titleScale: 0.7,
|
|
61
|
-
bodyScale: 1.5,
|
|
62
|
-
// Stacked columns instead of side-by-side
|
|
63
|
-
columnLeftX: "50%",
|
|
64
|
-
columnRightX: "50%",
|
|
65
|
-
columnTopY: "30%",
|
|
66
|
-
columnBottomY: "55%",
|
|
67
|
-
stackColumns: true,
|
|
68
|
-
// Wider relative to viewport to use available space
|
|
69
|
-
maxTextWidth: "90%",
|
|
70
|
-
horizontalPadding: "5%",
|
|
71
|
-
captionY: "75%",
|
|
72
|
-
captionScale: 0.85
|
|
73
|
-
},
|
|
74
|
-
square: {
|
|
75
|
-
primaryY: "30%",
|
|
76
|
-
secondaryY: "50%",
|
|
77
|
-
tertiaryY: "70%",
|
|
78
|
-
titleScale: 0.85,
|
|
79
|
-
bodyScale: 0.9,
|
|
80
|
-
columnLeftX: "25%",
|
|
81
|
-
columnRightX: "75%",
|
|
82
|
-
columnTopY: "35%",
|
|
83
|
-
columnBottomY: "65%",
|
|
84
|
-
stackColumns: false,
|
|
85
|
-
maxTextWidth: "85%",
|
|
86
|
-
horizontalPadding: "7.5%",
|
|
87
|
-
captionY: "82%",
|
|
88
|
-
captionScale: 0.9
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
function getLayoutHints(orientation) {
|
|
92
|
-
return LAYOUT_CONFIGS[orientation];
|
|
93
|
-
}
|
|
94
|
-
function scaledFontSize(basePx, viewport, orientation, isTitle = false) {
|
|
95
|
-
const fontScale = calculateFontScale(viewport);
|
|
96
|
-
const layout = getLayoutHints(orientation);
|
|
97
|
-
const typeScale = isTitle ? layout.titleScale : layout.bodyScale;
|
|
98
|
-
return Math.round(basePx * fontScale * typeScale);
|
|
99
|
-
}
|
|
100
|
-
function getTwoColumnPositions(orientation) {
|
|
101
|
-
const layout = getLayoutHints(orientation);
|
|
102
|
-
if (layout.stackColumns) {
|
|
103
|
-
return {
|
|
104
|
-
left: { x: "50%", y: layout.columnTopY },
|
|
105
|
-
right: { x: "50%", y: layout.columnBottomY }
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
return {
|
|
109
|
-
left: { x: layout.columnLeftX, y: "50%" },
|
|
110
|
-
right: { x: layout.columnRightX, y: "50%" }
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
function getSafeTextBounds(orientation) {
|
|
114
|
-
const layout = getLayoutHints(orientation);
|
|
115
|
-
return {
|
|
116
|
-
left: layout.horizontalPadding,
|
|
117
|
-
right: layout.horizontalPadding,
|
|
118
|
-
top: "10%",
|
|
119
|
-
bottom: "10%"
|
|
120
|
-
};
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
// src/schemas/BlockTemplates.ts
|
|
124
|
-
var DEFAULT_DOC_FONT = '"PT Serif", Georgia, "Times New Roman", serif';
|
|
125
|
-
var DEFAULT_TITLE_FONT = '"PT Serif", Georgia, "Times New Roman", serif';
|
|
126
|
-
function isTemplateBlock(block) {
|
|
127
|
-
return "template" in block && typeof block.template === "string";
|
|
128
|
-
}
|
|
129
|
-
function createTemplateContext(theme, blockIndex, totalBlocks, viewport = VIEWPORT_PRESETS.landscape) {
|
|
130
|
-
const orientation = getViewportOrientation(viewport);
|
|
131
|
-
return {
|
|
132
|
-
theme,
|
|
133
|
-
blockIndex,
|
|
134
|
-
totalBlocks,
|
|
135
|
-
viewport,
|
|
136
|
-
fontScale: calculateFontScale(viewport),
|
|
137
|
-
orientation,
|
|
138
|
-
layout: getLayoutHints(orientation)
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
function scaledFontSize2(basePx, context, isTitle = false) {
|
|
142
|
-
return scaledFontSize(basePx, context.viewport, context.orientation, isTitle);
|
|
143
|
-
}
|
|
144
|
-
function isPersistentLayerTemplate(layer) {
|
|
145
|
-
return "template" in layer && typeof layer.template === "string";
|
|
146
|
-
}
|
|
147
|
-
|
|
148
1
|
// src/schemas/themeLibrary.ts
|
|
149
|
-
var
|
|
150
|
-
var
|
|
151
|
-
var
|
|
152
|
-
var
|
|
153
|
-
var
|
|
2
|
+
var SYSTEM_SANS = 'system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';
|
|
3
|
+
var SYSTEM_SERIF = 'Georgia, "Times New Roman", serif';
|
|
4
|
+
var SYSTEM_MONO = 'Consolas, "Courier New", monospace';
|
|
5
|
+
var PLAYFAIR = '"Playfair Display", Georgia, serif';
|
|
6
|
+
var SOURCE_SERIF = '"Source Serif 4", "PT Serif", Georgia, serif';
|
|
7
|
+
var INTER = '"Inter", "Segoe UI", Roboto, sans-serif';
|
|
8
|
+
var OSWALD = '"Oswald", Impact, "Arial Black", sans-serif';
|
|
9
|
+
var ROBOTO = '"Roboto", "Segoe UI", Arial, sans-serif';
|
|
10
|
+
var MERRIWEATHER = '"Merriweather", Georgia, serif';
|
|
11
|
+
var LORA = '"Lora", "Merriweather", Georgia, serif';
|
|
12
|
+
var JETBRAINS_MONO = '"JetBrains Mono", "Fira Code", Consolas, monospace';
|
|
13
|
+
var IBM_PLEX_SANS = '"IBM Plex Sans", "Segoe UI", Roboto, sans-serif';
|
|
14
|
+
var DM_SERIF = '"DM Serif Display", Georgia, serif';
|
|
15
|
+
var DM_SANS = '"DM Sans", "Segoe UI", Roboto, sans-serif';
|
|
16
|
+
var CORMORANT = '"Cormorant Garamond", Garamond, Georgia, serif';
|
|
17
|
+
var CRIMSON = '"Crimson Text", Georgia, serif';
|
|
18
|
+
var PT_SERIF = '"PT Serif", Georgia, serif';
|
|
19
|
+
var HANKEN_GROTESK = '"Hanken Grotesk", system-ui, sans-serif';
|
|
154
20
|
var CLASSIC_COLOR_SCHEMES = {
|
|
155
21
|
blue: { bg: "#1a365d", text: "#63b3ed", accent: "#90cdf4" },
|
|
156
22
|
green: { bg: "#22543d", text: "#9ae6b4", accent: "#68d391" },
|
|
@@ -159,10 +25,52 @@ var CLASSIC_COLOR_SCHEMES = {
|
|
|
159
25
|
orange: { bg: "#744210", text: "#fbd38d", accent: "#f6ad55" },
|
|
160
26
|
teal: { bg: "#234e52", text: "#81e6d9", accent: "#4fd1c5" }
|
|
161
27
|
};
|
|
28
|
+
var standard = {
|
|
29
|
+
id: "standard",
|
|
30
|
+
name: "Standard",
|
|
31
|
+
description: "Clean and safe. System fonts only \u2014 no external font dependencies.",
|
|
32
|
+
colors: {
|
|
33
|
+
primary: "#3182ce",
|
|
34
|
+
secondary: "#4a5568",
|
|
35
|
+
background: "#1a202c",
|
|
36
|
+
backgroundLight: "#2d3748",
|
|
37
|
+
text: "#f7fafc",
|
|
38
|
+
textMuted: "#a0aec0",
|
|
39
|
+
highlight: "#4299e1",
|
|
40
|
+
warning: "#fc8181"
|
|
41
|
+
},
|
|
42
|
+
typography: {
|
|
43
|
+
bodyFontFamily: SYSTEM_SANS,
|
|
44
|
+
titleFontFamily: SYSTEM_SERIF,
|
|
45
|
+
monoFontFamily: SYSTEM_MONO,
|
|
46
|
+
titleWeight: "bold"
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
textShadow: true,
|
|
50
|
+
overlayOpacity: 0.45,
|
|
51
|
+
animationSpeed: 1
|
|
52
|
+
},
|
|
53
|
+
renderStyle: {
|
|
54
|
+
name: "standard",
|
|
55
|
+
defaultTextAnimation: "fadeIn",
|
|
56
|
+
defaultImageAnimation: "slowZoom",
|
|
57
|
+
ambientMotion: true,
|
|
58
|
+
defaultTransition: { type: "fade", duration: 0.7 }
|
|
59
|
+
},
|
|
60
|
+
colorSchemes: CLASSIC_COLOR_SCHEMES,
|
|
61
|
+
persistentLayers: {
|
|
62
|
+
bottomLayers: [
|
|
63
|
+
{
|
|
64
|
+
template: "gradientBackground",
|
|
65
|
+
config: { type: "gradientBackground", preset: "dark-vignette" }
|
|
66
|
+
}
|
|
67
|
+
]
|
|
68
|
+
}
|
|
69
|
+
};
|
|
162
70
|
var documentary = {
|
|
163
71
|
id: "documentary",
|
|
164
72
|
name: "Documentary",
|
|
165
|
-
description: "Classic dark cinematic look with serif typography.
|
|
73
|
+
description: "Classic dark cinematic look with elegant serif typography.",
|
|
166
74
|
colors: {
|
|
167
75
|
primary: "#3d5a80",
|
|
168
76
|
secondary: "#63b3ed",
|
|
@@ -174,8 +82,8 @@ var documentary = {
|
|
|
174
82
|
warning: "#fc8181"
|
|
175
83
|
},
|
|
176
84
|
typography: {
|
|
177
|
-
bodyFontFamily:
|
|
178
|
-
titleFontFamily:
|
|
85
|
+
bodyFontFamily: SOURCE_SERIF,
|
|
86
|
+
titleFontFamily: PLAYFAIR,
|
|
179
87
|
titleWeight: "bold"
|
|
180
88
|
},
|
|
181
89
|
style: {
|
|
@@ -215,8 +123,8 @@ var minimalist = {
|
|
|
215
123
|
warning: "#e53e3e"
|
|
216
124
|
},
|
|
217
125
|
typography: {
|
|
218
|
-
bodyFontFamily:
|
|
219
|
-
titleFontFamily:
|
|
126
|
+
bodyFontFamily: INTER,
|
|
127
|
+
titleFontFamily: INTER,
|
|
220
128
|
titleWeight: "bold",
|
|
221
129
|
lineHeight: 1.6
|
|
222
130
|
},
|
|
@@ -259,8 +167,8 @@ var bold = {
|
|
|
259
167
|
warning: "#fc8181"
|
|
260
168
|
},
|
|
261
169
|
typography: {
|
|
262
|
-
bodyFontFamily:
|
|
263
|
-
titleFontFamily:
|
|
170
|
+
bodyFontFamily: ROBOTO,
|
|
171
|
+
titleFontFamily: OSWALD,
|
|
264
172
|
titleWeight: "bold",
|
|
265
173
|
titleScale: 1.15,
|
|
266
174
|
bodyScale: 1,
|
|
@@ -306,7 +214,7 @@ var morningLight = {
|
|
|
306
214
|
warning: "#c53030"
|
|
307
215
|
},
|
|
308
216
|
typography: {
|
|
309
|
-
bodyFontFamily:
|
|
217
|
+
bodyFontFamily: LORA,
|
|
310
218
|
titleFontFamily: MERRIWEATHER,
|
|
311
219
|
titleWeight: "bold",
|
|
312
220
|
lineHeight: 1.7
|
|
@@ -347,9 +255,9 @@ var techDark = {
|
|
|
347
255
|
warning: "#ff5252"
|
|
348
256
|
},
|
|
349
257
|
typography: {
|
|
350
|
-
bodyFontFamily:
|
|
351
|
-
titleFontFamily:
|
|
352
|
-
monoFontFamily:
|
|
258
|
+
bodyFontFamily: IBM_PLEX_SANS,
|
|
259
|
+
titleFontFamily: JETBRAINS_MONO,
|
|
260
|
+
monoFontFamily: JETBRAINS_MONO,
|
|
353
261
|
titleWeight: "bold",
|
|
354
262
|
titleScale: 0.9,
|
|
355
263
|
lineHeight: 1.5
|
|
@@ -394,8 +302,8 @@ var magazine = {
|
|
|
394
302
|
warning: "#fc8181"
|
|
395
303
|
},
|
|
396
304
|
typography: {
|
|
397
|
-
bodyFontFamily:
|
|
398
|
-
titleFontFamily:
|
|
305
|
+
bodyFontFamily: DM_SANS,
|
|
306
|
+
titleFontFamily: DM_SERIF,
|
|
399
307
|
titleWeight: "bold",
|
|
400
308
|
titleScale: 1.05,
|
|
401
309
|
lineHeight: 1.5
|
|
@@ -437,8 +345,8 @@ var cinematic = {
|
|
|
437
345
|
warning: "#fc8181"
|
|
438
346
|
},
|
|
439
347
|
typography: {
|
|
440
|
-
bodyFontFamily:
|
|
441
|
-
titleFontFamily:
|
|
348
|
+
bodyFontFamily: CRIMSON,
|
|
349
|
+
titleFontFamily: CORMORANT,
|
|
442
350
|
titleWeight: "bold",
|
|
443
351
|
lineHeight: 1.5,
|
|
444
352
|
titleLineHeight: 1.2
|
|
@@ -490,8 +398,8 @@ var warmEarth = {
|
|
|
490
398
|
warning: "#e53e3e"
|
|
491
399
|
},
|
|
492
400
|
typography: {
|
|
493
|
-
bodyFontFamily:
|
|
494
|
-
titleFontFamily:
|
|
401
|
+
bodyFontFamily: HANKEN_GROTESK,
|
|
402
|
+
titleFontFamily: PT_SERIF,
|
|
495
403
|
titleWeight: "bold",
|
|
496
404
|
lineHeight: 1.6
|
|
497
405
|
},
|
|
@@ -525,6 +433,7 @@ var warmEarth = {
|
|
|
525
433
|
}
|
|
526
434
|
};
|
|
527
435
|
var THEMES = {
|
|
436
|
+
standard,
|
|
528
437
|
documentary,
|
|
529
438
|
minimalist,
|
|
530
439
|
bold,
|
|
@@ -534,8 +443,8 @@ var THEMES = {
|
|
|
534
443
|
cinematic,
|
|
535
444
|
"warm-earth": warmEarth
|
|
536
445
|
};
|
|
537
|
-
var DEFAULT_THEME_ID = "
|
|
538
|
-
var DEFAULT_THEME =
|
|
446
|
+
var DEFAULT_THEME_ID = "standard";
|
|
447
|
+
var DEFAULT_THEME = standard;
|
|
539
448
|
function resolveTheme(id) {
|
|
540
449
|
if (id && id in THEMES) return THEMES[id];
|
|
541
450
|
return DEFAULT_THEME;
|
|
@@ -552,21 +461,6 @@ function getThemeSummaries() {
|
|
|
552
461
|
}
|
|
553
462
|
|
|
554
463
|
export {
|
|
555
|
-
VIEWPORT_PRESETS,
|
|
556
|
-
getViewport,
|
|
557
|
-
calculateFontScale,
|
|
558
|
-
getViewportOrientation,
|
|
559
|
-
getAspectRatioString,
|
|
560
|
-
getLayoutHints,
|
|
561
|
-
scaledFontSize,
|
|
562
|
-
getTwoColumnPositions,
|
|
563
|
-
getSafeTextBounds,
|
|
564
|
-
DEFAULT_DOC_FONT,
|
|
565
|
-
DEFAULT_TITLE_FONT,
|
|
566
|
-
isTemplateBlock,
|
|
567
|
-
createTemplateContext,
|
|
568
|
-
scaledFontSize2,
|
|
569
|
-
isPersistentLayerTemplate,
|
|
570
464
|
THEMES,
|
|
571
465
|
DEFAULT_THEME_ID,
|
|
572
466
|
DEFAULT_THEME,
|
|
@@ -574,4 +468,4 @@ export {
|
|
|
574
468
|
getAvailableThemes,
|
|
575
469
|
getThemeSummaries
|
|
576
470
|
};
|
|
577
|
-
//# sourceMappingURL=chunk-
|
|
471
|
+
//# sourceMappingURL=chunk-TVPKD76V.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas/themeLibrary.ts"],"sourcesContent":["/**\n * Built-in Theme Library\n *\n * Ships 8 curated themes covering documentary, editorial, minimal, and\n * cinematic styles. Each theme is fully JSON-serializable.\n *\n * Usage:\n * ```ts\n * import { THEMES, resolveTheme } from '@bendyline/squisq/schemas';\n *\n * const theme = resolveTheme('minimalist'); // look up by id\n * const theme = THEMES.documentary; // direct access\n * ```\n */\n\nimport type { Theme, ThemeColorScheme } from './Theme.js';\n\n// ============================================\n// Shared constants\n// ============================================\n\n// ── Font stacks ──────────────────────────────────────────────────\n// Each stack lists the recommended Google Font first (works when the\n// wrapping site loads it), then degrades to safe system fonts.\n// Squisq itself does NOT load Google Fonts.\n\n/** System fonts only — no external dependencies. */\nconst SYSTEM_SANS = 'system-ui, -apple-system, \"Segoe UI\", Roboto, sans-serif';\nconst SYSTEM_SERIF = 'Georgia, \"Times New Roman\", serif';\nconst SYSTEM_MONO = 'Consolas, \"Courier New\", monospace';\n\n/** Theme-specific stacks with Google Font leads. */\nconst PLAYFAIR = '\"Playfair Display\", Georgia, serif';\nconst SOURCE_SERIF = '\"Source Serif 4\", \"PT Serif\", Georgia, serif';\nconst INTER = '\"Inter\", \"Segoe UI\", Roboto, sans-serif';\nconst OSWALD = '\"Oswald\", Impact, \"Arial Black\", sans-serif';\nconst ROBOTO = '\"Roboto\", \"Segoe UI\", Arial, sans-serif';\nconst MERRIWEATHER = '\"Merriweather\", Georgia, serif';\nconst LORA = '\"Lora\", \"Merriweather\", Georgia, serif';\nconst JETBRAINS_MONO = '\"JetBrains Mono\", \"Fira Code\", Consolas, monospace';\nconst IBM_PLEX_SANS = '\"IBM Plex Sans\", \"Segoe UI\", Roboto, sans-serif';\nconst DM_SERIF = '\"DM Serif Display\", Georgia, serif';\nconst DM_SANS = '\"DM Sans\", \"Segoe UI\", Roboto, sans-serif';\nconst CORMORANT = '\"Cormorant Garamond\", Garamond, Georgia, serif';\nconst CRIMSON = '\"Crimson Text\", Georgia, serif';\nconst PT_SERIF = '\"PT Serif\", Georgia, serif';\nconst HANKEN_GROTESK = '\"Hanken Grotesk\", system-ui, sans-serif';\n\n/** Standard 6-scheme set used by the documentary theme (migrated from old COLOR_SCHEMES). */\nconst CLASSIC_COLOR_SCHEMES: Record<string, ThemeColorScheme> = {\n blue: { bg: '#1a365d', text: '#63b3ed', accent: '#90cdf4' },\n green: { bg: '#22543d', text: '#9ae6b4', accent: '#68d391' },\n purple: { bg: '#44337a', text: '#d6bcfa', accent: '#b794f4' },\n red: { bg: '#742a2a', text: '#fc8181', accent: '#feb2b2' },\n orange: { bg: '#744210', text: '#fbd38d', accent: '#f6ad55' },\n teal: { bg: '#234e52', text: '#81e6d9', accent: '#4fd1c5' },\n};\n\n// ============================================\n// 1. Standard (default — safe system fonts, no external dependencies)\n// ============================================\n\nconst standard: Theme = {\n id: 'standard',\n name: 'Standard',\n description: 'Clean and safe. System fonts only — no external font dependencies.',\n colors: {\n primary: '#3182ce',\n secondary: '#4a5568',\n background: '#1a202c',\n backgroundLight: '#2d3748',\n text: '#f7fafc',\n textMuted: '#a0aec0',\n highlight: '#4299e1',\n warning: '#fc8181',\n },\n typography: {\n bodyFontFamily: SYSTEM_SANS,\n titleFontFamily: SYSTEM_SERIF,\n monoFontFamily: SYSTEM_MONO,\n titleWeight: 'bold',\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.45,\n animationSpeed: 1.0,\n },\n renderStyle: {\n name: 'standard',\n defaultTextAnimation: 'fadeIn',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'fade', duration: 0.7 },\n },\n colorSchemes: CLASSIC_COLOR_SCHEMES,\n persistentLayers: {\n bottomLayers: [\n {\n template: 'gradientBackground',\n config: { type: 'gradientBackground', preset: 'dark-vignette' },\n },\n ],\n },\n};\n\n// ============================================\n// 2. Documentary\n// ============================================\n\nconst documentary: Theme = {\n id: 'documentary',\n name: 'Documentary',\n description: 'Classic dark cinematic look with elegant serif typography.',\n colors: {\n primary: '#3d5a80',\n secondary: '#63b3ed',\n background: '#1a202c',\n backgroundLight: '#2d3748',\n text: '#ffffff',\n textMuted: '#a0aec0',\n highlight: '#63b3ed',\n warning: '#fc8181',\n },\n typography: {\n bodyFontFamily: SOURCE_SERIF,\n titleFontFamily: PLAYFAIR,\n titleWeight: 'bold',\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.5,\n animationSpeed: 1.0,\n },\n renderStyle: {\n name: 'documentary',\n defaultTextAnimation: 'fadeIn',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'fade', duration: 0.8 },\n },\n colorSchemes: CLASSIC_COLOR_SCHEMES,\n persistentLayers: {\n bottomLayers: [\n {\n template: 'gradientBackground',\n config: { type: 'gradientBackground', preset: 'dark-vignette' },\n },\n ],\n },\n};\n\n// ============================================\n// 2. Minimalist\n// ============================================\n\nconst minimalist: Theme = {\n id: 'minimalist',\n name: 'Minimalist',\n description: 'Clean near-white background with sans-serif type and minimal animation.',\n colors: {\n primary: '#2d3748',\n secondary: '#4a5568',\n background: '#f7fafc',\n backgroundLight: '#edf2f7',\n text: '#1a202c',\n textMuted: '#718096',\n highlight: '#3182ce',\n warning: '#e53e3e',\n },\n typography: {\n bodyFontFamily: INTER,\n titleFontFamily: INTER,\n titleWeight: 'bold',\n lineHeight: 1.6,\n },\n style: {\n textShadow: false,\n overlayOpacity: 0.3,\n animationSpeed: 1.2,\n borderRadius: 8,\n },\n renderStyle: {\n name: 'minimalist',\n defaultTextAnimation: 'fadeIn',\n ambientMotion: false,\n defaultTransition: { type: 'fade', duration: 0.6 },\n templateHints: {\n titleBlock: { showAccentLine: false },\n },\n },\n colorSchemes: {\n blue: { bg: '#ebf8ff', text: '#2b6cb0', accent: '#3182ce' },\n green: { bg: '#f0fff4', text: '#276749', accent: '#38a169' },\n purple: { bg: '#faf5ff', text: '#553c9a', accent: '#805ad5' },\n red: { bg: '#fff5f5', text: '#c53030', accent: '#e53e3e' },\n orange: { bg: '#fffaf0', text: '#c05621', accent: '#dd6b20' },\n teal: { bg: '#e6fffa', text: '#285e61', accent: '#319795' },\n },\n};\n\n// ============================================\n// 3. Bold\n// ============================================\n\nconst bold: Theme = {\n id: 'bold',\n name: 'Bold',\n description: 'High-contrast black with vivid accents and dramatic animations.',\n colors: {\n primary: '#e53e3e',\n secondary: '#ed8936',\n background: '#000000',\n backgroundLight: '#1a1a1a',\n text: '#ffffff',\n textMuted: '#cbd5e0',\n highlight: '#f6e05e',\n warning: '#fc8181',\n },\n typography: {\n bodyFontFamily: ROBOTO,\n titleFontFamily: OSWALD,\n titleWeight: 'bold',\n titleScale: 1.15,\n bodyScale: 1.0,\n titleLineHeight: 1.1,\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.6,\n animationSpeed: 0.8,\n },\n renderStyle: {\n name: 'bold',\n defaultTextAnimation: 'zoomIn',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'dissolve', duration: 0.5 },\n templateHints: {\n statHighlight: { entrance: 'dramatic' },\n fullBleedQuote: { entrance: 'dramatic' },\n },\n },\n colorSchemes: {\n blue: { bg: '#1a202c', text: '#63b3ed', accent: '#90cdf4' },\n green: { bg: '#1a202c', text: '#48bb78', accent: '#68d391' },\n purple: { bg: '#1a202c', text: '#b794f4', accent: '#d6bcfa' },\n red: { bg: '#1a202c', text: '#fc8181', accent: '#feb2b2' },\n orange: { bg: '#1a202c', text: '#f6ad55', accent: '#fbd38d' },\n teal: { bg: '#1a202c', text: '#4fd1c5', accent: '#81e6d9' },\n },\n};\n\n// ============================================\n// 4. Morning Light\n// ============================================\n\nconst morningLight: Theme = {\n id: 'morning-light',\n name: 'Morning Light',\n description: 'Warm light background with dark text and gentle serif typography.',\n colors: {\n primary: '#744210',\n secondary: '#975a16',\n background: '#faf8f5',\n backgroundLight: '#f5f0eb',\n text: '#2d3748',\n textMuted: '#718096',\n highlight: '#dd6b20',\n warning: '#c53030',\n },\n typography: {\n bodyFontFamily: LORA,\n titleFontFamily: MERRIWEATHER,\n titleWeight: 'bold',\n lineHeight: 1.7,\n },\n style: {\n textShadow: false,\n overlayOpacity: 0.35,\n animationSpeed: 1.1,\n borderRadius: 4,\n },\n renderStyle: {\n name: 'morning-light',\n defaultTextAnimation: 'fadeIn',\n ambientMotion: false,\n defaultTransition: { type: 'fade', duration: 1.0 },\n },\n colorSchemes: {\n blue: { bg: '#ebf8ff', text: '#2c5282', accent: '#4299e1' },\n green: { bg: '#f0fff4', text: '#22543d', accent: '#48bb78' },\n purple: { bg: '#faf5ff', text: '#44337a', accent: '#9f7aea' },\n red: { bg: '#fff5f5', text: '#9b2c2c', accent: '#fc8181' },\n orange: { bg: '#fffaf0', text: '#744210', accent: '#ed8936' },\n teal: { bg: '#e6fffa', text: '#234e52', accent: '#38b2ac' },\n },\n};\n\n// ============================================\n// 5. Tech Dark\n// ============================================\n\nconst techDark: Theme = {\n id: 'tech-dark',\n name: 'Tech Dark',\n description: 'True black with neon cyan/green accents and monospace titles.',\n colors: {\n primary: '#00e5ff',\n secondary: '#00e676',\n background: '#0a0a0a',\n backgroundLight: '#1a1a2e',\n text: '#e0e0e0',\n textMuted: '#9e9e9e',\n highlight: '#00e5ff',\n warning: '#ff5252',\n },\n typography: {\n bodyFontFamily: IBM_PLEX_SANS,\n titleFontFamily: JETBRAINS_MONO,\n monoFontFamily: JETBRAINS_MONO,\n titleWeight: 'bold',\n titleScale: 0.9,\n lineHeight: 1.5,\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.55,\n animationSpeed: 0.9,\n borderRadius: 2,\n },\n renderStyle: {\n name: 'tech-dark',\n defaultTextAnimation: 'typewriter',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'dissolve', duration: 0.4 },\n templateHints: {\n statHighlight: { entrance: 'dramatic' },\n },\n },\n colorSchemes: {\n blue: { bg: '#0d1b2a', text: '#00b0ff', accent: '#40c4ff' },\n green: { bg: '#0d1b0d', text: '#00e676', accent: '#69f0ae' },\n purple: { bg: '#1a0d2e', text: '#d500f9', accent: '#ea80fc' },\n red: { bg: '#2e0d0d', text: '#ff5252', accent: '#ff8a80' },\n orange: { bg: '#2e1a0d', text: '#ff9100', accent: '#ffab40' },\n teal: { bg: '#0d2e2e', text: '#1de9b6', accent: '#64ffda' },\n },\n};\n\n// ============================================\n// 6. Magazine\n// ============================================\n\nconst magazine: Theme = {\n id: 'magazine',\n name: 'Magazine',\n description: 'Rich editorial palette with mixed serif/sans typography and slide transitions.',\n colors: {\n primary: '#c53030',\n secondary: '#2b6cb0',\n background: '#1a202c',\n backgroundLight: '#2d3748',\n text: '#f7fafc',\n textMuted: '#cbd5e0',\n highlight: '#ed8936',\n warning: '#fc8181',\n },\n typography: {\n bodyFontFamily: DM_SANS,\n titleFontFamily: DM_SERIF,\n titleWeight: 'bold',\n titleScale: 1.05,\n lineHeight: 1.5,\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.45,\n animationSpeed: 1.0,\n borderRadius: 6,\n },\n renderStyle: {\n name: 'magazine',\n defaultTextAnimation: 'fadeIn',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'slideLeft', duration: 0.7 },\n },\n colorSchemes: {\n blue: { bg: '#1a365d', text: '#90cdf4', accent: '#63b3ed' },\n green: { bg: '#1c4532', text: '#9ae6b4', accent: '#68d391' },\n purple: { bg: '#322659', text: '#d6bcfa', accent: '#b794f4' },\n red: { bg: '#63171b', text: '#feb2b2', accent: '#fc8181' },\n orange: { bg: '#652b19', text: '#fbd38d', accent: '#f6ad55' },\n teal: { bg: '#1d4044', text: '#81e6d9', accent: '#4fd1c5' },\n },\n};\n\n// ============================================\n// 7. Cinematic\n// ============================================\n\nconst cinematic: Theme = {\n id: 'cinematic',\n name: 'Cinematic',\n description: 'Ultra-dark with moody gradients, gold accents, and slow dissolve transitions.',\n colors: {\n primary: '#d69e2e',\n secondary: '#b7791f',\n background: '#0a0f1a',\n backgroundLight: '#1a202c',\n text: '#f7fafc',\n textMuted: '#a0aec0',\n highlight: '#ecc94b',\n warning: '#fc8181',\n },\n typography: {\n bodyFontFamily: CRIMSON,\n titleFontFamily: CORMORANT,\n titleWeight: 'bold',\n lineHeight: 1.5,\n titleLineHeight: 1.2,\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.55,\n animationSpeed: 1.2,\n },\n renderStyle: {\n name: 'cinematic',\n defaultTextAnimation: 'fadeIn',\n defaultImageAnimation: 'slowZoom',\n ambientMotion: true,\n defaultTransition: { type: 'dissolve', duration: 1.2 },\n templateHints: {\n titleBlock: { showAccentLine: true },\n },\n },\n colorSchemes: {\n blue: { bg: '#0d1b2a', text: '#90cdf4', accent: '#63b3ed' },\n green: { bg: '#0d1b14', text: '#9ae6b4', accent: '#68d391' },\n purple: { bg: '#1a0d2e', text: '#d6bcfa', accent: '#b794f4' },\n red: { bg: '#2a0d0d', text: '#fc8181', accent: '#feb2b2' },\n orange: { bg: '#2a1a0d', text: '#fbd38d', accent: '#f6ad55' },\n teal: { bg: '#0d2a2a', text: '#81e6d9', accent: '#4fd1c5' },\n },\n persistentLayers: {\n bottomLayers: [\n {\n template: 'gradientBackground',\n config: { type: 'gradientBackground', preset: 'radial-dark' },\n },\n ],\n },\n};\n\n// ============================================\n// 8. Warm Earth\n// ============================================\n\nconst warmEarth: Theme = {\n id: 'warm-earth',\n name: 'Warm Earth',\n description: 'Natural warm tones with earthy browns and terracotta accents.',\n colors: {\n primary: '#9c4221',\n secondary: '#c05621',\n background: '#1c1410',\n backgroundLight: '#2d241e',\n text: '#faf5f0',\n textMuted: '#c4a882',\n highlight: '#dd6b20',\n warning: '#e53e3e',\n },\n typography: {\n bodyFontFamily: HANKEN_GROTESK,\n titleFontFamily: PT_SERIF,\n titleWeight: 'bold',\n lineHeight: 1.6,\n },\n style: {\n textShadow: true,\n overlayOpacity: 0.5,\n animationSpeed: 1.1,\n },\n renderStyle: {\n name: 'warm-earth',\n defaultTextAnimation: 'fadeIn',\n defaultImageAnimation: 'panLeft',\n ambientMotion: true,\n defaultTransition: { type: 'fade', duration: 0.9 },\n },\n colorSchemes: {\n blue: { bg: '#2a1f14', text: '#90cdf4', accent: '#63b3ed' },\n green: { bg: '#1e2a14', text: '#9ae6b4', accent: '#68d391' },\n purple: { bg: '#2a142a', text: '#d6bcfa', accent: '#b794f4' },\n red: { bg: '#2a1414', text: '#fc8181', accent: '#feb2b2' },\n orange: { bg: '#2a1e0a', text: '#fbd38d', accent: '#f6ad55' },\n teal: { bg: '#142a28', text: '#81e6d9', accent: '#4fd1c5' },\n },\n persistentLayers: {\n bottomLayers: [\n {\n template: 'gradientBackground',\n config: { type: 'gradientBackground', preset: 'earth-tones' },\n },\n ],\n },\n};\n\n// ============================================\n// Theme Library\n// ============================================\n\n/**\n * All built-in themes, keyed by id.\n */\nexport const THEMES: Record<string, Theme> = {\n standard,\n documentary,\n minimalist,\n bold,\n 'morning-light': morningLight,\n 'tech-dark': techDark,\n magazine,\n cinematic,\n 'warm-earth': warmEarth,\n};\n\n/** The default theme id. */\nexport const DEFAULT_THEME_ID = 'standard';\n\n/** The default theme (standard — safe system fonts, no external dependencies). */\nexport const DEFAULT_THEME: Theme = standard;\n\n/**\n * Resolve a theme by id. Returns the default theme when `id` is\n * undefined or not found in the library.\n */\nexport function resolveTheme(id: string | undefined): Theme {\n if (id && id in THEMES) return THEMES[id];\n return DEFAULT_THEME;\n}\n\n/**\n * Get all available theme ids.\n */\nexport function getAvailableThemes(): string[] {\n return Object.keys(THEMES);\n}\n\n/**\n * Get a summary of all themes (id + name + description) for theme pickers.\n */\nexport function getThemeSummaries(): Array<{ id: string; name: string; description?: string }> {\n return Object.values(THEMES).map((t) => ({\n id: t.id,\n name: t.name,\n description: t.description,\n }));\n}\n"],"mappings":";AA2BA,IAAM,cAAc;AACpB,IAAM,eAAe;AACrB,IAAM,cAAc;AAGpB,IAAM,WAAW;AACjB,IAAM,eAAe;AACrB,IAAM,QAAQ;AACd,IAAM,SAAS;AACf,IAAM,SAAS;AACf,IAAM,eAAe;AACrB,IAAM,OAAO;AACb,IAAM,iBAAiB;AACvB,IAAM,gBAAgB;AACtB,IAAM,WAAW;AACjB,IAAM,UAAU;AAChB,IAAM,YAAY;AAClB,IAAM,UAAU;AAChB,IAAM,WAAW;AACjB,IAAM,iBAAiB;AAGvB,IAAM,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AO,EAAE;AACxC,SAAO;AACT;AAKO,SAAS,qBAA+B;AAC7C,SAAO,OAAO,KAAK,MAAM;AAC3B;AAKO,SAAS,oBAA+E;AAC7F,SAAO,OAAO,OAAO,MAAM,EAAE,IAAI,CAAC,OAAO;AAAA,IACvC,IAAI,EAAE;AAAA,IACN,MAAM,EAAE;AAAA,IACR,aAAa,EAAE;AAAA,EACjB,EAAE;AACJ;","names":[]}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Content Extractor
|
|
3
|
+
*
|
|
4
|
+
* Pattern-based extraction of compelling content from plain text.
|
|
5
|
+
* Identifies statistics, dates, quotes, comparisons, facts, impact lines,
|
|
6
|
+
* lists, and definitions that can be turned into slideshow slides.
|
|
7
|
+
*
|
|
8
|
+
* Extraction is purely regex-based — no AI calls, no runtime costs,
|
|
9
|
+
* deterministic and reproducible.
|
|
10
|
+
*/
|
|
11
|
+
/** Kinds of content the extractor recognises. */
|
|
12
|
+
type ExtractionType = 'stat' | 'date' | 'quote' | 'comparison' | 'fact' | 'impactLine' | 'list' | 'definition';
|
|
13
|
+
/** An extracted content element with source position. */
|
|
14
|
+
interface ExtractedElement {
|
|
15
|
+
type: ExtractionType;
|
|
16
|
+
/** Full extracted text (usually the surrounding sentence). */
|
|
17
|
+
text: string;
|
|
18
|
+
/** Confidence score 0–1. */
|
|
19
|
+
confidence: number;
|
|
20
|
+
/** Character offset in the source text. */
|
|
21
|
+
sourcePosition: number;
|
|
22
|
+
/** Character offset where element ends. */
|
|
23
|
+
endPosition: number;
|
|
24
|
+
/** Type-specific structured payload. */
|
|
25
|
+
data: StatData | DateData | QuoteData | ComparisonData | FactData | ImpactLineData | ListData | DefinitionData;
|
|
26
|
+
}
|
|
27
|
+
interface StatData {
|
|
28
|
+
type: 'stat';
|
|
29
|
+
value: string;
|
|
30
|
+
unit?: string;
|
|
31
|
+
description: string;
|
|
32
|
+
}
|
|
33
|
+
interface DateData {
|
|
34
|
+
type: 'date';
|
|
35
|
+
date: string;
|
|
36
|
+
description: string;
|
|
37
|
+
mood?: 'neutral' | 'somber' | 'celebratory';
|
|
38
|
+
}
|
|
39
|
+
interface QuoteData {
|
|
40
|
+
type: 'quote';
|
|
41
|
+
quote: string;
|
|
42
|
+
attribution?: string;
|
|
43
|
+
}
|
|
44
|
+
interface ComparisonData {
|
|
45
|
+
type: 'comparison';
|
|
46
|
+
left: {
|
|
47
|
+
label: string;
|
|
48
|
+
sublabel?: string;
|
|
49
|
+
};
|
|
50
|
+
right: {
|
|
51
|
+
label: string;
|
|
52
|
+
sublabel?: string;
|
|
53
|
+
};
|
|
54
|
+
header?: string;
|
|
55
|
+
}
|
|
56
|
+
interface FactData {
|
|
57
|
+
type: 'fact';
|
|
58
|
+
fact: string;
|
|
59
|
+
explanation?: string;
|
|
60
|
+
}
|
|
61
|
+
interface ImpactLineData {
|
|
62
|
+
type: 'impactLine';
|
|
63
|
+
text: string;
|
|
64
|
+
}
|
|
65
|
+
interface ListData {
|
|
66
|
+
type: 'list';
|
|
67
|
+
items: string[];
|
|
68
|
+
title?: string;
|
|
69
|
+
}
|
|
70
|
+
interface DefinitionData {
|
|
71
|
+
type: 'definition';
|
|
72
|
+
term: string;
|
|
73
|
+
definition: string;
|
|
74
|
+
origin?: string;
|
|
75
|
+
}
|
|
76
|
+
/** Options for `extractContent`. */
|
|
77
|
+
interface ExtractionOptions {
|
|
78
|
+
/** Minimum confidence threshold (default: 0.3). */
|
|
79
|
+
minConfidence?: number;
|
|
80
|
+
/** Which types to extract (default: all). */
|
|
81
|
+
types?: ExtractionType[];
|
|
82
|
+
/** Maximum extractions per type (default: unlimited). */
|
|
83
|
+
maxPerType?: number;
|
|
84
|
+
}
|
|
85
|
+
/** Result of `extractContent`. */
|
|
86
|
+
interface ExtractionResult {
|
|
87
|
+
elements: ExtractedElement[];
|
|
88
|
+
sourceLength: number;
|
|
89
|
+
stats: {
|
|
90
|
+
statCount: number;
|
|
91
|
+
dateCount: number;
|
|
92
|
+
quoteCount: number;
|
|
93
|
+
comparisonCount: number;
|
|
94
|
+
factCount: number;
|
|
95
|
+
impactLineCount: number;
|
|
96
|
+
listCount: number;
|
|
97
|
+
definitionCount: number;
|
|
98
|
+
totalCount: number;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Extract compelling content from plain text.
|
|
103
|
+
*
|
|
104
|
+
* Call `stripMarkdown(text)` first if the input contains markdown.
|
|
105
|
+
*/
|
|
106
|
+
declare function extractContent(text: string, options?: ExtractionOptions): ExtractionResult;
|
|
107
|
+
/**
|
|
108
|
+
* Strip markdown formatting from text, returning plain prose.
|
|
109
|
+
* Call this before `extractContent` if the input is markdown.
|
|
110
|
+
*/
|
|
111
|
+
declare function stripMarkdown(markdown: string): string;
|
|
112
|
+
|
|
113
|
+
export { type ComparisonData as C, type DateData as D, type ExtractedElement as E, type FactData as F, type ImpactLineData as I, type ListData as L, type QuoteData as Q, type StatData as S, type DefinitionData as a, type ExtractionOptions as b, type ExtractionResult as c, type ExtractionType as d, extractContent as e, stripMarkdown as s };
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Audio Mapping
|
|
3
|
+
*
|
|
4
|
+
* Associates audio segments (MP3 files) with document blocks.
|
|
5
|
+
* Supports two modes:
|
|
6
|
+
*
|
|
7
|
+
* 1. **Explicit annotation**: Blocks with `{[audio=filename.mp3]}` in their
|
|
8
|
+
* heading annotation are directly mapped to that audio file.
|
|
9
|
+
*
|
|
10
|
+
* 2. **Auto-matching**: When no annotations exist but the container has MP3s
|
|
11
|
+
* with `.timing.json` files, matches MP3s to blocks by comparing the
|
|
12
|
+
* timing.json `sourceText` against block text content (word overlap).
|
|
13
|
+
* Falls back to filename-based matching (slugified title comparison).
|
|
14
|
+
*/
|
|
15
|
+
import type { Doc } from '../schemas/Doc.js';
|
|
16
|
+
import type { ContentContainer } from '../storage/ContentContainer.js';
|
|
17
|
+
/**
|
|
18
|
+
* Calculate Jaccard similarity between two texts (word overlap).
|
|
19
|
+
* Returns 0–1 where 1 = identical word sets.
|
|
20
|
+
*/
|
|
21
|
+
export declare function scoreTextSimilarity(a: string, b: string): number;
|
|
22
|
+
/**
|
|
23
|
+
* Resolve audio mapping for a Doc using a ContentContainer.
|
|
24
|
+
*
|
|
25
|
+
* Tries explicit `{[audio=filename.mp3]}` annotations first,
|
|
26
|
+
* then falls back to auto-matching by content similarity.
|
|
27
|
+
*
|
|
28
|
+
* Returns a new Doc with `audio.segments` populated and blocks
|
|
29
|
+
* assigned to the correct `audioSegment` indices.
|
|
30
|
+
*
|
|
31
|
+
* @param doc - The source Doc (not mutated).
|
|
32
|
+
* @param container - ContentContainer with MP3 and timing files.
|
|
33
|
+
* @returns New Doc with audio segments resolved, or original doc if no matches.
|
|
34
|
+
*/
|
|
35
|
+
export declare function resolveAudioMapping(doc: Doc, container: ContentContainer): Promise<Doc>;
|
|
36
|
+
//# sourceMappingURL=audioMapping.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"audioMapping.d.ts","sourceRoot":"","sources":["../../src/doc/audioMapping.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAwC,MAAM,mBAAmB,CAAC;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAqCvE;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYhE;AAyLD;;;;;;;;;;;;GAYG;AACH,wBAAsB,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,CAqD7F"}
|