@bendyline/squisq 2.11.8 → 2.11.10
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/{Doc-CynsGqL4.d.ts → Doc-BWtfp7dT.d.ts} +218 -3
- package/dist/{ImageEditDoc-BVZe_5y4.d.ts → ImageEditDoc-CYRQK8so.d.ts} +1 -1
- package/dist/{chunk-YNO6JV36.js → chunk-2SRF5III.js} +4 -4
- package/dist/{chunk-VU4T74LI.js → chunk-7WN7DDMI.js} +1 -1
- package/dist/{chunk-5FBI3ZW4.js → chunk-BVQZCKXN.js} +2 -2
- package/dist/{chunk-JM2QARY2.js → chunk-CPQCZUBW.js} +311 -19
- package/dist/{chunk-JJO6JFNZ.js → chunk-HVJ6VFDX.js} +2 -2
- package/dist/{chunk-Y4D6TDZT.js → chunk-PFH3WV6J.js} +145 -3
- package/dist/{chunk-ZEONJCP3.js → chunk-PWCIJHZH.js} +1 -1
- package/dist/{chunk-KFZOCWPK.js → chunk-RV5OOBSV.js} +2 -2
- package/dist/{chunk-RMCUZDW5.js → chunk-TYW5VMNP.js} +366 -111
- package/dist/doc/index.d.ts +108 -7
- package/dist/doc/index.js +31 -5
- package/dist/fence/index.d.ts +1 -1
- package/dist/generate/index.d.ts +1 -1
- package/dist/imageEdit/index.d.ts +3 -3
- package/dist/index.d.ts +5 -5
- package/dist/index.js +49 -9
- package/dist/jsonForm/index.d.ts +1 -1
- package/dist/jsonForm/index.js +4 -4
- package/dist/{materializePageSection-CAJoa8fh.d.ts → materializePageSection-Db7pABI0.d.ts} +6 -3
- package/dist/mediaEdit/index.d.ts +2 -2
- package/dist/narration/index.d.ts +1 -1
- package/dist/narration/index.js +4 -4
- package/dist/schemas/index.d.ts +4 -4
- package/dist/schemas/index.js +17 -3
- package/dist/{themeLibrary-z7t3x5CU.d.ts → themeLibrary-Bphz1CRp.d.ts} +1 -1
- package/dist/timing/index.d.ts +1 -1
- package/dist/transform/index.d.ts +2 -2
- package/dist/transform/index.js +3 -3
- package/package.json +1 -1
|
@@ -2,6 +2,97 @@ import {
|
|
|
2
2
|
isTransitionType
|
|
3
3
|
} from "./chunk-4VOD55SX.js";
|
|
4
4
|
|
|
5
|
+
// src/schemas/Motion.ts
|
|
6
|
+
var MOTION_PROFILE_NAMES = ["calm", "documentary", "vibrant"];
|
|
7
|
+
var FRONTMATTER_MOTION_KEY = "squisq-motion";
|
|
8
|
+
var OVERSHOOT_EASING = "cubic-bezier(0.34, 1.4, 0.64, 1)";
|
|
9
|
+
var SETTLE_EASING = "cubic-bezier(0.22, 1, 0.36, 1)";
|
|
10
|
+
var MOTION_PROFILES = Object.freeze({
|
|
11
|
+
calm: Object.freeze({
|
|
12
|
+
name: "calm",
|
|
13
|
+
textEntrance: Object.freeze({ type: "fadeIn", duration: 1, delayScale: 1 }),
|
|
14
|
+
chartGrowth: false,
|
|
15
|
+
chartGrowthDuration: 1,
|
|
16
|
+
countUp: false,
|
|
17
|
+
countUpDuration: 1.5,
|
|
18
|
+
diagramBuild: false,
|
|
19
|
+
photoGridStagger: 0,
|
|
20
|
+
coverWordReveal: false
|
|
21
|
+
}),
|
|
22
|
+
documentary: Object.freeze({
|
|
23
|
+
name: "documentary",
|
|
24
|
+
textEntrance: Object.freeze({
|
|
25
|
+
type: "fadeInUp",
|
|
26
|
+
duration: 0.8,
|
|
27
|
+
easing: SETTLE_EASING,
|
|
28
|
+
delayScale: 1
|
|
29
|
+
}),
|
|
30
|
+
chartGrowth: true,
|
|
31
|
+
chartGrowthDuration: 1.1,
|
|
32
|
+
countUp: true,
|
|
33
|
+
countUpDuration: 1.6,
|
|
34
|
+
diagramBuild: true,
|
|
35
|
+
photoGridStagger: 0.22,
|
|
36
|
+
coverWordReveal: false
|
|
37
|
+
}),
|
|
38
|
+
vibrant: Object.freeze({
|
|
39
|
+
name: "vibrant",
|
|
40
|
+
textEntrance: Object.freeze({
|
|
41
|
+
type: "fadeInUp",
|
|
42
|
+
duration: 0.55,
|
|
43
|
+
easing: OVERSHOOT_EASING,
|
|
44
|
+
delayScale: 0.8
|
|
45
|
+
}),
|
|
46
|
+
chartGrowth: true,
|
|
47
|
+
chartGrowthDuration: 0.9,
|
|
48
|
+
countUp: true,
|
|
49
|
+
countUpDuration: 1.2,
|
|
50
|
+
diagramBuild: true,
|
|
51
|
+
photoGridStagger: 0.16,
|
|
52
|
+
coverWordReveal: false
|
|
53
|
+
})
|
|
54
|
+
});
|
|
55
|
+
function isMotionProfileName(value) {
|
|
56
|
+
return typeof value === "string" && MOTION_PROFILE_NAMES.includes(value);
|
|
57
|
+
}
|
|
58
|
+
function resolveMotionProfile(spec, fallback = "calm") {
|
|
59
|
+
if (spec == null) return MOTION_PROFILES[fallback];
|
|
60
|
+
if (typeof spec === "string") {
|
|
61
|
+
return MOTION_PROFILES[isMotionProfileName(spec) ? spec : fallback];
|
|
62
|
+
}
|
|
63
|
+
if (typeof spec !== "object") return MOTION_PROFILES[fallback];
|
|
64
|
+
const named = spec;
|
|
65
|
+
const baseName = isMotionProfileName(named.profile) ? named.profile : isMotionProfileName(named.name) ? named.name : fallback;
|
|
66
|
+
const base = MOTION_PROFILES[baseName];
|
|
67
|
+
const { profile: _profile, name: _name, ...overrides } = spec;
|
|
68
|
+
const merged = { ...base };
|
|
69
|
+
for (const [key, value] of Object.entries(overrides)) {
|
|
70
|
+
if (value === void 0) continue;
|
|
71
|
+
if (key === "textEntrance" && typeof value === "object" && value !== null) {
|
|
72
|
+
merged.textEntrance = { ...base.textEntrance, ...value };
|
|
73
|
+
} else if (key in base && typeof value === typeof base[key]) {
|
|
74
|
+
merged[key] = value;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
return merged;
|
|
78
|
+
}
|
|
79
|
+
function readFrontmatterMotion(frontmatter) {
|
|
80
|
+
if (!frontmatter) return void 0;
|
|
81
|
+
const raw = frontmatter[FRONTMATTER_MOTION_KEY] ?? frontmatter.motion;
|
|
82
|
+
if (typeof raw === "string") {
|
|
83
|
+
const trimmed = raw.trim();
|
|
84
|
+
return isMotionProfileName(trimmed) ? trimmed : void 0;
|
|
85
|
+
}
|
|
86
|
+
if (raw && typeof raw === "object" && !Array.isArray(raw)) return raw;
|
|
87
|
+
return void 0;
|
|
88
|
+
}
|
|
89
|
+
function resolveMotionForDoc(doc, theme, explicit) {
|
|
90
|
+
const themeName = theme?.renderStyle.motionProfile;
|
|
91
|
+
const themeDefault = isMotionProfileName(themeName) ? themeName : "calm";
|
|
92
|
+
const spec = explicit ?? doc?.motion ?? readFrontmatterMotion(doc?.frontmatter);
|
|
93
|
+
return resolveMotionProfile(spec, themeDefault);
|
|
94
|
+
}
|
|
95
|
+
|
|
5
96
|
// src/schemas/Viewport.ts
|
|
6
97
|
var VIEWPORT_PRESETS = {
|
|
7
98
|
/** 16:9 landscape (default, 1080p) */
|
|
@@ -130,7 +221,7 @@ var DEFAULT_TITLE_FONT = 'Georgia, "Times New Roman", serif';
|
|
|
130
221
|
function isTemplateBlock(block) {
|
|
131
222
|
return "template" in block && typeof block.template === "string";
|
|
132
223
|
}
|
|
133
|
-
function createTemplateContext(theme, blockIndex, totalBlocks, viewport = VIEWPORT_PRESETS.landscape) {
|
|
224
|
+
function createTemplateContext(theme, blockIndex, totalBlocks, viewport = VIEWPORT_PRESETS.landscape, options = {}) {
|
|
134
225
|
const orientation = getViewportOrientation(viewport);
|
|
135
226
|
const overrides = theme.renderStyle.layoutOverrides;
|
|
136
227
|
const baseLayout = getLayoutHints(orientation);
|
|
@@ -141,7 +232,8 @@ function createTemplateContext(theme, blockIndex, totalBlocks, viewport = VIEWPO
|
|
|
141
232
|
viewport,
|
|
142
233
|
fontScale: calculateFontScale(viewport),
|
|
143
234
|
orientation,
|
|
144
|
-
layout: overrides ? { ...baseLayout, ...overrides } : baseLayout
|
|
235
|
+
layout: overrides ? { ...baseLayout, ...overrides } : baseLayout,
|
|
236
|
+
motion: resolveMotionForDoc(null, theme, options.motion)
|
|
145
237
|
};
|
|
146
238
|
}
|
|
147
239
|
function scaledFontSize2(basePx, context, isTitle = false) {
|
|
@@ -172,8 +264,18 @@ var ANIMATION_TYPES = /* @__PURE__ */ new Set([
|
|
|
172
264
|
"zoomOut",
|
|
173
265
|
"panLeft",
|
|
174
266
|
"panRight",
|
|
175
|
-
"typewriter"
|
|
267
|
+
"typewriter",
|
|
268
|
+
"fadeInUp",
|
|
269
|
+
"slideIn",
|
|
270
|
+
"wordReveal",
|
|
271
|
+
"countUp",
|
|
272
|
+
"drawOn",
|
|
273
|
+
"grow",
|
|
274
|
+
"reveal",
|
|
275
|
+
"drift",
|
|
276
|
+
"tween"
|
|
176
277
|
]);
|
|
278
|
+
var MOTION_ORIGINS = ["center", "left", "right", "top", "bottom"];
|
|
177
279
|
var TemplateValidator = class {
|
|
178
280
|
constructor() {
|
|
179
281
|
this.errors = [];
|
|
@@ -256,6 +358,30 @@ function validateAnimation(v, value, path) {
|
|
|
256
358
|
optionalString(v, value, "easing", path);
|
|
257
359
|
optionalEnum(v, value, "direction", path, ["in", "out"]);
|
|
258
360
|
optionalEnum(v, value, "panDirection", path, ["left", "right", "up", "down"]);
|
|
361
|
+
optionalEnum(v, value, "origin", path, MOTION_ORIGINS);
|
|
362
|
+
optionalEnum(v, value, "shape", path, ["wipe", "iris"]);
|
|
363
|
+
optionalNumber(v, value, "stagger", path);
|
|
364
|
+
if (value.wordTimes !== void 0) {
|
|
365
|
+
if (!Array.isArray(value.wordTimes) || value.wordTimes.some((t) => typeof t !== "number")) {
|
|
366
|
+
v.error(`${path}.wordTimes`, "expected array of numbers");
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const count = value.count;
|
|
370
|
+
if (count !== void 0 && v.object(count, `${path}.count`)) {
|
|
371
|
+
if (typeof count.to !== "number") v.error(`${path}.count.to`, "expected number");
|
|
372
|
+
optionalNumber(v, count, "from", `${path}.count`);
|
|
373
|
+
optionalNumber(v, count, "decimals", `${path}.count`);
|
|
374
|
+
optionalString(v, count, "prefix", `${path}.count`);
|
|
375
|
+
optionalString(v, count, "suffix", `${path}.count`);
|
|
376
|
+
}
|
|
377
|
+
for (const key of ["fromState", "toState"]) {
|
|
378
|
+
const state = value[key];
|
|
379
|
+
if (state !== void 0 && v.object(state, `${path}.${key}`)) {
|
|
380
|
+
for (const field of ["scale", "x", "y", "opacity", "rotate"]) {
|
|
381
|
+
optionalNumber(v, state, field, `${path}.${key}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
259
385
|
}
|
|
260
386
|
function validateRepeat(v, value, path) {
|
|
261
387
|
if (!v.object(value, path)) return;
|
|
@@ -725,6 +851,7 @@ var PAGE_SECTION_KINDS = [
|
|
|
725
851
|
"prose",
|
|
726
852
|
"footer"
|
|
727
853
|
];
|
|
854
|
+
var PAGE_VARIANTS = ["page", "document"];
|
|
728
855
|
var PAGE_DESIGN_FAMILIES = [
|
|
729
856
|
"clean",
|
|
730
857
|
"editorial",
|
|
@@ -992,6 +1119,9 @@ var V = class {
|
|
|
992
1119
|
if (v.ambientMotion !== void 0 && !this.isBoolean(v.ambientMotion)) {
|
|
993
1120
|
this.err(`${path}.ambientMotion`, "expected boolean");
|
|
994
1121
|
}
|
|
1122
|
+
if (v.motionProfile !== void 0 && !isMotionProfileName(v.motionProfile)) {
|
|
1123
|
+
this.err(`${path}.motionProfile`, "expected calm | documentary | vibrant");
|
|
1124
|
+
}
|
|
995
1125
|
for (const k of ["defaultTextAnimation", "defaultImageAnimation"]) {
|
|
996
1126
|
if (v[k] !== void 0 && !this.isString(v[k])) {
|
|
997
1127
|
this.err(`${path}.${k}`, "expected animation type string");
|
|
@@ -1703,6 +1833,7 @@ var documentary_default = {
|
|
|
1703
1833
|
defaultTextAnimation: "fadeIn",
|
|
1704
1834
|
defaultImageAnimation: "slowZoom",
|
|
1705
1835
|
ambientMotion: true,
|
|
1836
|
+
motionProfile: "documentary",
|
|
1706
1837
|
defaultTransition: {
|
|
1707
1838
|
type: "fade",
|
|
1708
1839
|
duration: 0.8
|
|
@@ -1901,6 +2032,7 @@ var bold_default = {
|
|
|
1901
2032
|
defaultTextAnimation: "zoomIn",
|
|
1902
2033
|
defaultImageAnimation: "slowZoom",
|
|
1903
2034
|
ambientMotion: true,
|
|
2035
|
+
motionProfile: "vibrant",
|
|
1904
2036
|
defaultTransition: { type: "dissolve", duration: 0.5 },
|
|
1905
2037
|
templateHints: {
|
|
1906
2038
|
statHighlight: { entrance: "dramatic" },
|
|
@@ -2110,6 +2242,7 @@ var tech_dark_default = {
|
|
|
2110
2242
|
defaultTextAnimation: "typewriter",
|
|
2111
2243
|
defaultImageAnimation: "slowZoom",
|
|
2112
2244
|
ambientMotion: true,
|
|
2245
|
+
motionProfile: "vibrant",
|
|
2113
2246
|
defaultTransition: {
|
|
2114
2247
|
type: "dissolve",
|
|
2115
2248
|
duration: 0.4
|
|
@@ -2379,6 +2512,7 @@ var cinematic_default = {
|
|
|
2379
2512
|
defaultTextAnimation: "fadeIn",
|
|
2380
2513
|
defaultImageAnimation: "slowZoom",
|
|
2381
2514
|
ambientMotion: true,
|
|
2515
|
+
motionProfile: "documentary",
|
|
2382
2516
|
defaultTransition: {
|
|
2383
2517
|
type: "dissolve",
|
|
2384
2518
|
duration: 1.2
|
|
@@ -2515,6 +2649,7 @@ var warm_earth_default = {
|
|
|
2515
2649
|
defaultTextAnimation: "fadeIn",
|
|
2516
2650
|
defaultImageAnimation: "panLeft",
|
|
2517
2651
|
ambientMotion: true,
|
|
2652
|
+
motionProfile: "documentary",
|
|
2518
2653
|
defaultTransition: { type: "fade", duration: 0.9 }
|
|
2519
2654
|
},
|
|
2520
2655
|
colorSchemes: {
|
|
@@ -2964,6 +3099,12 @@ function matchFontFamily(name) {
|
|
|
2964
3099
|
}
|
|
2965
3100
|
|
|
2966
3101
|
export {
|
|
3102
|
+
FRONTMATTER_MOTION_KEY,
|
|
3103
|
+
MOTION_PROFILES,
|
|
3104
|
+
isMotionProfileName,
|
|
3105
|
+
resolveMotionProfile,
|
|
3106
|
+
readFrontmatterMotion,
|
|
3107
|
+
resolveMotionForDoc,
|
|
2967
3108
|
VIEWPORT_PRESETS,
|
|
2968
3109
|
getViewport,
|
|
2969
3110
|
calculateFontScale,
|
|
@@ -2994,6 +3135,7 @@ export {
|
|
|
2994
3135
|
pickContrastingText,
|
|
2995
3136
|
deriveScale,
|
|
2996
3137
|
PAGE_SECTION_KINDS,
|
|
3138
|
+
PAGE_VARIANTS,
|
|
2997
3139
|
PAGE_DESIGN_FAMILIES,
|
|
2998
3140
|
PAGE_SECTION_SPACINGS,
|
|
2999
3141
|
PAGE_DIVIDERS,
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
} from "./chunk-SVN7T6BK.js";
|
|
6
6
|
import {
|
|
7
7
|
markdownToDoc
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-TYW5VMNP.js";
|
|
9
9
|
import {
|
|
10
10
|
cloneAndFreezeData,
|
|
11
11
|
isTemplateBlock
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-PFH3WV6J.js";
|
|
13
13
|
import {
|
|
14
14
|
parseMarkdown
|
|
15
15
|
} from "./chunk-HUXK7EOT.js";
|