@praeko/studio-kit 0.1.0 → 0.2.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/CHANGELOG.md +12 -2
- package/LICENSES.md +28 -30
- package/README.md +4 -6
- package/dist/color.d.ts +3 -0
- package/dist/declarative.d.ts +67 -0
- package/dist/index.d.ts +6 -5
- package/dist/index.js +316 -304
- package/dist/long-cover.d.ts +31 -0
- package/dist/long-decl.d.ts +67 -0
- package/dist/{longo.d.ts → long-parts.d.ts} +16 -16
- package/dist/parts.d.ts +90 -0
- package/package.json +5 -4
- package/dist/capa-longo.d.ts +0 -31
- package/dist/declarativo.d.ts +0 -65
- package/dist/longo-decl.d.ts +0 -61
- package/dist/pecas.d.ts +0 -89
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/parts.tsx
|
|
2
2
|
import { Loop, OffthreadVideo, interpolate, spring, staticFile, useCurrentFrame, useVideoConfig, Img, AbsoluteFill } from "remotion";
|
|
3
|
-
import { FPS, pop, ramp, rgba,
|
|
3
|
+
import { FPS, appear, pop, ramp, rgba, useTheme } from "@praeko/studio-core";
|
|
4
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
6
|
-
const {
|
|
5
|
+
var Panel = ({ title, dur, children }) => {
|
|
6
|
+
const { accent: LAMP, text: INK, font: FONT } = useTheme();
|
|
7
7
|
const frame = useCurrentFrame();
|
|
8
8
|
const { fps } = useVideoConfig();
|
|
9
9
|
const pop3 = spring({ frame, fps, config: { damping: 13, stiffness: 190 } });
|
|
@@ -32,68 +32,71 @@ var PainelD = ({ titulo, dur, children }) => {
|
|
|
32
32
|
boxSizing: "border-box"
|
|
33
33
|
},
|
|
34
34
|
children: [
|
|
35
|
-
/* @__PURE__ */ jsx("div", { style: { fontSize: 38, letterSpacing: 5, color: LAMP, whiteSpace: "nowrap" }, children:
|
|
35
|
+
/* @__PURE__ */ jsx("div", { style: { fontSize: 38, letterSpacing: 5, color: LAMP, whiteSpace: "nowrap" }, children: title }),
|
|
36
36
|
/* @__PURE__ */ jsx("div", { style: { flex: 1, display: "flex", flexDirection: "column", justifyContent: "center", gap: 40, minHeight: 0 }, children })
|
|
37
37
|
]
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
40
|
};
|
|
41
|
-
var
|
|
42
|
-
const {
|
|
43
|
-
return /* @__PURE__ */ jsx("div", { style: { background:
|
|
41
|
+
var Box = ({ t, q, color: color2, children, mono, size = 48, dim, dash }) => {
|
|
42
|
+
const { box: BOX, text: INK, font: FONT, mono: MONO } = useTheme();
|
|
43
|
+
return /* @__PURE__ */ jsx("div", { style: { background: BOX, border: `4px ${dash ? "dashed" : "solid"} ${color2}`, borderRadius: 22, padding: "18px 28px", fontFamily: mono ? MONO : FONT, fontSize: size, textAlign: "center", whiteSpace: "nowrap", color: INK, opacity: appear(t, q) * (dim ? 0.55 : 1), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children });
|
|
44
44
|
};
|
|
45
|
-
var
|
|
46
|
-
const {
|
|
47
|
-
return /* @__PURE__ */ jsx("div", { style: { background:
|
|
45
|
+
var Line = ({ t, q, color: color2, size = 46, children }) => {
|
|
46
|
+
const { box: BOX, text: INK, font: FONT, accent: LAMP } = useTheme();
|
|
47
|
+
return /* @__PURE__ */ jsx("div", { style: { background: BOX, border: `4px solid ${color2 ?? LAMP}`, borderRadius: 24, padding: "22px 30px", fontSize: size, opacity: appear(t, q), translate: `${(1 - appear(t, q)) * 70}px 0px`, whiteSpace: "nowrap", display: "flex", alignItems: "center", gap: 22, fontFamily: FONT, color: INK }, children });
|
|
48
48
|
};
|
|
49
|
-
var Big = ({ t, q,
|
|
50
|
-
const {
|
|
51
|
-
return /* @__PURE__ */ jsx("div", { style: { fontFamily: mono ? MONO : FONT, fontSize: size, fontWeight: 900, color:
|
|
49
|
+
var Big = ({ t, q, color: color2, size, mono, children }) => {
|
|
50
|
+
const { text: INK, font: FONT, mono: MONO } = useTheme();
|
|
51
|
+
return /* @__PURE__ */ jsx("div", { style: { fontFamily: mono ? MONO : FONT, fontSize: size, fontWeight: 900, color: color2 ?? INK, textAlign: "center", lineHeight: 1.05, opacity: appear(t, q, 0.25), scale: String(pop(t, q)), whiteSpace: "nowrap" }, children });
|
|
52
52
|
};
|
|
53
|
-
var
|
|
54
|
-
const {
|
|
55
|
-
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", background:
|
|
56
|
-
/* @__PURE__ */ jsx("span", { style: { position: "absolute", left: 24, top: -34, fontSize: 90, color:
|
|
53
|
+
var Bubble = ({ t, q, color: color2, children, author = "\u2014 someone, in the chat" }) => {
|
|
54
|
+
const { box: BOX, text: INK, font: FONT, mono: MONO, muted: MUTED } = useTheme();
|
|
55
|
+
return /* @__PURE__ */ jsxs("div", { style: { position: "relative", background: BOX, border: `4px solid ${color2}`, borderRadius: 28, padding: "28px 34px", fontFamily: FONT, fontSize: 46, lineHeight: 1.25, color: INK, textAlign: "center", opacity: appear(t, q), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children: [
|
|
56
|
+
/* @__PURE__ */ jsx("span", { style: { position: "absolute", left: 24, top: -34, fontSize: 90, color: color2, lineHeight: 1 }, children: "\u201C" }),
|
|
57
57
|
children,
|
|
58
|
-
/* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 26, color: MUTED, marginTop: 16 }, children:
|
|
58
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 26, color: MUTED, marginTop: 16 }, children: author })
|
|
59
59
|
] });
|
|
60
60
|
};
|
|
61
|
-
var
|
|
62
|
-
const {
|
|
63
|
-
return /* @__PURE__ */ jsxs("div", { style: { background:
|
|
64
|
-
/* @__PURE__ */ jsx("div", { style: { background: "#1c1830", padding: "12px 26px", fontFamily: MONO, fontSize: 26, color: "#8b86a8", whiteSpace: "nowrap" }, children:
|
|
65
|
-
/* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 30, lineHeight: 1.6, padding: "20px 0" }, children:
|
|
61
|
+
var Code = ({ t, q, title, color: color2, lines }) => {
|
|
62
|
+
const { box: BOX, text: INK, mono: MONO } = useTheme();
|
|
63
|
+
return /* @__PURE__ */ jsxs("div", { style: { background: BOX, borderRadius: 24, overflow: "hidden", border: `4px solid ${color2}`, opacity: appear(t, q), translate: `0px ${(1 - appear(t, q)) * 30}px` }, children: [
|
|
64
|
+
/* @__PURE__ */ jsx("div", { style: { background: "#1c1830", padding: "12px 26px", fontFamily: MONO, fontSize: 26, color: "#8b86a8", whiteSpace: "nowrap" }, children: title }),
|
|
65
|
+
/* @__PURE__ */ jsx("div", { style: { fontFamily: MONO, fontSize: 30, lineHeight: 1.6, padding: "20px 0" }, children: lines.map((l, i) => /* @__PURE__ */ jsx("div", { style: { whiteSpace: "pre", padding: "0 26px", color: l.color || INK, background: l.mark ? `${l.color}26` : "transparent", borderLeft: `6px solid ${l.mark ? l.color : "transparent"}` }, children: l.s }, i)) })
|
|
66
66
|
] });
|
|
67
67
|
};
|
|
68
|
-
var
|
|
69
|
-
const {
|
|
70
|
-
const s = w / reg[2], h = w * reg[3] / reg[2], o =
|
|
68
|
+
var Window = ({ t, q, src, clipDuration, from, left, top, w, reg = [0, 0, 1920, 1080], tag = "REAL FOOTAGE", dur }) => {
|
|
69
|
+
const { accent: LAMP, text: INK, error: BAD, mono: MONO } = useTheme();
|
|
70
|
+
const s = w / reg[2], h = w * reg[3] / reg[2], o = appear(t, q, 0.5);
|
|
71
71
|
const push = 1 + 0.07 * ramp(t, q, q + dur);
|
|
72
|
-
const total =
|
|
72
|
+
const total = clipDuration - from;
|
|
73
73
|
return /* @__PURE__ */ jsxs("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 26, overflow: "hidden", border: `4px solid ${LAMP}`, boxShadow: `0 0 70px ${rgba(LAMP, 0.25)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 40}px`, background: "#0b0b10" }, children: [
|
|
74
|
-
/* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, scale: String(push), transformOrigin: "50% 60%" }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round(total * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(
|
|
74
|
+
/* @__PURE__ */ jsx("div", { style: { position: "absolute", inset: 0, scale: String(push), transformOrigin: "50% 60%" }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round(total * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(from * FPS), muted: true, style: { position: "absolute", left: -reg[0] * s, top: -reg[1] * s, width: 1920 * s, height: 1080 * s, imageRendering: "pixelated" } }) }) }),
|
|
75
75
|
/* @__PURE__ */ jsxs("div", { style: { position: "absolute", left: 14, bottom: 12, background: "rgba(10,8,6,.78)", color: INK, fontFamily: MONO, fontSize: 22, padding: "4px 14px", borderRadius: 10, display: "flex", gap: 10, alignItems: "center" }, children: [
|
|
76
|
-
/* @__PURE__ */ jsx("span", { style: { width: 12, height: 12, borderRadius: 6, background:
|
|
76
|
+
/* @__PURE__ */ jsx("span", { style: { width: 12, height: 12, borderRadius: 6, background: BAD, opacity: 0.5 + 0.5 * Math.abs(Math.sin(t * 4)) } }),
|
|
77
77
|
tag
|
|
78
78
|
] })
|
|
79
79
|
] });
|
|
80
80
|
};
|
|
81
|
-
var
|
|
82
|
-
const {
|
|
83
|
-
const h = w * 1920 / 1080, o =
|
|
84
|
-
return /* @__PURE__ */ jsx("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 46, border: "10px solid #0b0b10", outline: `3px solid ${LAMP}`, overflow: "hidden", boxShadow: `0 0 70px ${rgba(LAMP, 0.22)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 50}px`, background: "#0b0b10", scale: String(0.96 + 0.04 * ramp(t, q, q + dur)) }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round((
|
|
81
|
+
var Phone = ({ t, q, src, clipDuration, from, left, top, w, dur }) => {
|
|
82
|
+
const { accent: LAMP } = useTheme();
|
|
83
|
+
const h = w * 1920 / 1080, o = appear(t, q, 0.5);
|
|
84
|
+
return /* @__PURE__ */ jsx("div", { style: { position: "absolute", left, top, width: w, height: h, borderRadius: 46, border: "10px solid #0b0b10", outline: `3px solid ${LAMP}`, overflow: "hidden", boxShadow: `0 0 70px ${rgba(LAMP, 0.22)}, 0 24px 60px rgba(0,0,0,.6)`, opacity: o, translate: `0px ${(1 - o) * 50}px`, background: "#0b0b10", scale: String(0.96 + 0.04 * ramp(t, q, q + dur)) }, children: /* @__PURE__ */ jsx(Loop, { durationInFrames: Math.round((clipDuration - from) * FPS), children: /* @__PURE__ */ jsx(OffthreadVideo, { src: staticFile(src), startFrom: Math.round(from * FPS), muted: true, style: { width: "100%", height: "100%", objectFit: "cover" } }) }) });
|
|
85
85
|
};
|
|
86
|
-
var
|
|
87
|
-
|
|
88
|
-
|
|
86
|
+
var Mascot = ({ name, size = 220, path }) => {
|
|
87
|
+
const { mascotPath } = useTheme();
|
|
88
|
+
return /* @__PURE__ */ jsx("div", { style: { background: "#1c1830", border: "6px solid #3a3358", borderRadius: 30, padding: 12 }, children: /* @__PURE__ */ jsx(Img, { src: staticFile(path ?? (mascotPath ?? "mascots/{name}.png").replace("{name}", name)), style: { width: size, height: size, imageRendering: "pixelated" } }) });
|
|
89
|
+
};
|
|
90
|
+
var Frame = ({ glow, title, color: color2, children, size = 130 }) => {
|
|
91
|
+
const { coverBackground: BG, text: INK, accent: LAMP, font: FONT, handle } = useTheme();
|
|
89
92
|
return /* @__PURE__ */ jsxs(AbsoluteFill, { style: { background: `radial-gradient(ellipse at 50% 44%, ${glow} 0%, rgba(0,0,0,0) 56%), ${BG}`, alignItems: "center", fontFamily: FONT, textAlign: "center" }, children: [
|
|
90
|
-
/* @__PURE__ */ jsxs("div", { style: { marginTop: 350, fontSize:
|
|
91
|
-
|
|
93
|
+
/* @__PURE__ */ jsxs("div", { style: { marginTop: 350, fontSize: size, fontWeight: 900, color: INK, lineHeight: 1.02, textShadow: "0 8px 0 #000", whiteSpace: "nowrap" }, children: [
|
|
94
|
+
title[0],
|
|
92
95
|
/* @__PURE__ */ jsx("br", {}),
|
|
93
|
-
/* @__PURE__ */ jsx("span", { style: { color:
|
|
94
|
-
|
|
96
|
+
/* @__PURE__ */ jsx("span", { style: { color: color2 }, children: title[1] }),
|
|
97
|
+
title[2] ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
95
98
|
/* @__PURE__ */ jsx("br", {}),
|
|
96
|
-
|
|
99
|
+
title[2]
|
|
97
100
|
] }) : null
|
|
98
101
|
] }),
|
|
99
102
|
/* @__PURE__ */ jsx("div", { style: { marginTop: 130, display: "flex", flexDirection: "column", alignItems: "center", width: 1e3, transform: "scale(1.16)", transformOrigin: "top center" }, children }),
|
|
@@ -101,391 +104,400 @@ var Moldura = ({ glow, titulo, cor: cor4, children, tam = 130 }) => {
|
|
|
101
104
|
] });
|
|
102
105
|
};
|
|
103
106
|
|
|
104
|
-
// src/
|
|
107
|
+
// src/declarative.tsx
|
|
105
108
|
import { Composition, Still, useCurrentFrame as useCurrentFrame2 } from "remotion";
|
|
106
|
-
import {
|
|
109
|
+
import { Episode, FPS as FPS2, ThemeProvider, makeAt, pop as pop2, ramp as ramp2, appear as appear2, useTheme as useTheme2 } from "@praeko/studio-core";
|
|
110
|
+
|
|
111
|
+
// src/color.ts
|
|
112
|
+
var resolveColor = (theme, name) => {
|
|
113
|
+
if (!name) return void 0;
|
|
114
|
+
if (name.startsWith("#")) return name;
|
|
115
|
+
const value = theme[name];
|
|
116
|
+
return value ?? name;
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// src/declarative.tsx
|
|
107
120
|
import { Fragment as Fragment2, jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
|
|
108
|
-
var
|
|
109
|
-
var estilo = (it, base = {}) => {
|
|
121
|
+
var style = (it, base = {}) => {
|
|
110
122
|
const p = it.pos;
|
|
111
123
|
return p ? { position: "absolute", left: p.left, right: p.right, top: p.top, bottom: p.bottom, width: p.w, height: p.h, ...base } : base;
|
|
112
124
|
};
|
|
113
|
-
var
|
|
114
|
-
var
|
|
115
|
-
const T =
|
|
116
|
-
const q = it.
|
|
125
|
+
var alignMap = { center: "center", start: "flex-start", end: "flex-end", stretch: "stretch" };
|
|
126
|
+
var TextItem = ({ it, t }) => {
|
|
127
|
+
const T = useTheme2();
|
|
128
|
+
const q = it.at ?? 0.3, lines = String(it.text).split("\n");
|
|
117
129
|
const base = {
|
|
118
|
-
...it.
|
|
119
|
-
fontSize: it.
|
|
120
|
-
color:
|
|
121
|
-
...it.
|
|
122
|
-
...it.
|
|
123
|
-
...it.
|
|
124
|
-
...it.
|
|
130
|
+
...it.font ? { fontFamily: it.font === "mono" ? T.mono : T.font } : {},
|
|
131
|
+
fontSize: it.size ?? 40,
|
|
132
|
+
color: resolveColor(T, it.color) ?? T.text,
|
|
133
|
+
...it.align === "left" ? { textAlign: "left" } : { textAlign: "center" },
|
|
134
|
+
...it.noFade ? {} : { opacity: appear2(t, q) },
|
|
135
|
+
...it.lineHeight ? { lineHeight: it.lineHeight } : {},
|
|
136
|
+
...it.weight ? { fontWeight: it.weight } : {},
|
|
125
137
|
...it.pop ? { scale: String(pop2(t, q)) } : {},
|
|
126
|
-
...it.
|
|
138
|
+
...it.noWrap ? { whiteSpace: "nowrap" } : {}
|
|
127
139
|
};
|
|
128
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
140
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, base), children: lines.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
|
|
129
141
|
l,
|
|
130
|
-
i <
|
|
142
|
+
i < lines.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
|
|
131
143
|
] }, i)) });
|
|
132
144
|
};
|
|
133
|
-
var
|
|
134
|
-
const T =
|
|
135
|
-
const q = it.
|
|
136
|
-
const p = pr.
|
|
137
|
-
const g = (it.
|
|
145
|
+
var BarItem = ({ it, t }) => {
|
|
146
|
+
const T = useTheme2();
|
|
147
|
+
const q = it.at ?? 0.3, pr = it.fill ?? {}, from = pr.from ?? 0, to = pr.to ?? 1;
|
|
148
|
+
const p = pr.duration ? from + (to - from) * ramp2(t, pr.start ?? q, (pr.start ?? q) + pr.duration) : to;
|
|
149
|
+
const g = (it.gradient ?? [T.error, T.error]).map((c) => {
|
|
138
150
|
const [n, ...r] = String(c).split(" ");
|
|
139
|
-
return [
|
|
151
|
+
return [resolveColor(T, n), ...r].join(" ");
|
|
140
152
|
});
|
|
141
|
-
const
|
|
142
|
-
const
|
|
143
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
144
|
-
};
|
|
145
|
-
var
|
|
146
|
-
const T =
|
|
147
|
-
const q0 = it.
|
|
148
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
149
|
-
const q = q0 + i * (it.
|
|
150
|
-
return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: 18, opacity:
|
|
151
|
-
/* @__PURE__ */ jsx2("div", { style: { width: it.
|
|
152
|
-
/* @__PURE__ */ jsx2("div", { style: { height: 34, width: (it.
|
|
153
|
-
/* @__PURE__ */ jsx2("div", { style: { fontFamily: T.mono, fontSize: 30, color:
|
|
153
|
+
const end = it.glowAtEnd && p > 0.98;
|
|
154
|
+
const inner = { width: `${p * 100}%`, height: "100%", background: it.gradientAngle === false ? g[0] : `linear-gradient(90deg, ${g.join(", ")})` };
|
|
155
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, { height: it.height ?? 40, borderRadius: it.radius ?? 14, background: it.background ?? "#1d1812", ...it.border === false ? {} : { border: `${it.border ?? 3}px solid #3a2f22` }, overflow: "hidden", ...it.noFade ? {} : { opacity: appear2(t, q) }, ...end ? { boxShadow: `0 0 40px ${resolveColor(T, it.glowAtEnd)}` } : {} }), children: /* @__PURE__ */ jsx2("div", { style: inner }) });
|
|
156
|
+
};
|
|
157
|
+
var BarsItem = ({ it, t }) => {
|
|
158
|
+
const T = useTheme2();
|
|
159
|
+
const q0 = it.at ?? 0.3;
|
|
160
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 16 }), children: it.lines.map((l, i) => {
|
|
161
|
+
const q = q0 + i * (it.step ?? 0.5);
|
|
162
|
+
return /* @__PURE__ */ jsxs2("div", { style: { display: "flex", alignItems: "center", gap: 18, opacity: appear2(t, q) }, children: [
|
|
163
|
+
/* @__PURE__ */ jsx2("div", { style: { width: it.labelWidth ?? 190, fontFamily: T.mono, fontSize: 30, color: T.muted, whiteSpace: "nowrap" }, children: l.label }),
|
|
164
|
+
/* @__PURE__ */ jsx2("div", { style: { height: 34, width: (it.maxWidth ?? 640) * (l.value / it.max) * ramp2(t, q, q + 0.9), borderRadius: 10, background: `linear-gradient(90deg, #b9453a, ${resolveColor(T, it.color) ?? T.error})` } }),
|
|
165
|
+
/* @__PURE__ */ jsx2("div", { style: { fontFamily: T.mono, fontSize: 30, color: resolveColor(T, it.color) ?? T.error, fontWeight: 900 }, children: l.text })
|
|
154
166
|
] }, i);
|
|
155
167
|
}) });
|
|
156
168
|
};
|
|
157
169
|
var Render = ({ it, t, dur }) => {
|
|
158
|
-
const T =
|
|
159
|
-
const q = it.
|
|
160
|
-
const
|
|
161
|
-
switch (it.
|
|
162
|
-
case "
|
|
163
|
-
return /* @__PURE__ */ jsx2(
|
|
170
|
+
const T = useTheme2();
|
|
171
|
+
const q = it.at ?? 0.3;
|
|
172
|
+
const children = it.items?.map((f, i) => /* @__PURE__ */ jsx2(Render, { it: f, t, dur }, i));
|
|
173
|
+
switch (it.type) {
|
|
174
|
+
case "text":
|
|
175
|
+
return /* @__PURE__ */ jsx2(TextItem, { it, t });
|
|
164
176
|
case "big":
|
|
165
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
166
|
-
case "
|
|
167
|
-
return /* @__PURE__ */ jsx2(
|
|
168
|
-
case "
|
|
169
|
-
return /* @__PURE__ */ jsx2(
|
|
170
|
-
case "
|
|
171
|
-
return /* @__PURE__ */ jsx2(
|
|
172
|
-
case "
|
|
173
|
-
return /* @__PURE__ */ jsx2(
|
|
174
|
-
case "
|
|
175
|
-
return /* @__PURE__ */ jsx2(
|
|
176
|
-
case "
|
|
177
|
-
return /* @__PURE__ */ jsx2(
|
|
178
|
-
case "
|
|
179
|
-
return /* @__PURE__ */ jsx2(
|
|
180
|
-
case "
|
|
181
|
-
return /* @__PURE__ */ jsx2(
|
|
182
|
-
case "
|
|
183
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
184
|
-
case "
|
|
185
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
186
|
-
case "
|
|
187
|
-
const o =
|
|
188
|
-
return /* @__PURE__ */ jsx2("div", { style:
|
|
189
|
-
l.map((p, k) => /* @__PURE__ */ jsx2("span", { style: { ...p.
|
|
190
|
-
i < it.
|
|
177
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, it.pos ? { display: "flex", justifyContent: "center" } : {}), children: /* @__PURE__ */ jsx2(Big, { t, q, color: resolveColor(T, it.color), size: it.size, mono: it.mono, children: it.text }) });
|
|
178
|
+
case "box":
|
|
179
|
+
return /* @__PURE__ */ jsx2(Box, { t, q, color: resolveColor(T, it.color) ?? T.accent, size: it.size, mono: it.mono, dim: it.dim, dash: it.dashed, children: it.text });
|
|
180
|
+
case "line":
|
|
181
|
+
return /* @__PURE__ */ jsx2(Line, { t, q, color: resolveColor(T, it.color), size: it.size, children: it.parts.map((p, i) => /* @__PURE__ */ jsx2("span", { style: { ...p.mono ? { fontFamily: T.mono } : {}, ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.weight ? { fontWeight: p.weight } : {} }, children: p.text }, i)) });
|
|
182
|
+
case "bubble":
|
|
183
|
+
return /* @__PURE__ */ jsx2(Bubble, { t, q, color: resolveColor(T, it.color) ?? T.info, author: it.author, children: it.text });
|
|
184
|
+
case "code":
|
|
185
|
+
return /* @__PURE__ */ jsx2(Code, { t, q, title: it.title, color: resolveColor(T, it.color) ?? T.error, lines: it.lines.map((l) => ({ ...l, color: resolveColor(T, l.color) })) });
|
|
186
|
+
case "window":
|
|
187
|
+
return /* @__PURE__ */ jsx2(Window, { t, q, src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, reg: it.reg, tag: it.tag, dur });
|
|
188
|
+
case "phone":
|
|
189
|
+
return /* @__PURE__ */ jsx2(Phone, { t, q, src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: it.pos.left, top: it.pos.top, w: it.pos.w, dur });
|
|
190
|
+
case "bar":
|
|
191
|
+
return /* @__PURE__ */ jsx2(BarItem, { it, t });
|
|
192
|
+
case "bars":
|
|
193
|
+
return /* @__PURE__ */ jsx2(BarsItem, { it, t });
|
|
194
|
+
case "stack":
|
|
195
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, { display: "flex", flexDirection: "column", gap: it.gap ?? 20, alignItems: alignMap[it.align ?? "stretch"] }), children });
|
|
196
|
+
case "row":
|
|
197
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, it.spread ? { display: "flex", justifyContent: "space-between" } : it.center === false ? { display: "flex", gap: it.gap ?? 20 } : { display: "flex", justifyContent: "center", alignItems: "center", gap: it.gap ?? 20, whiteSpace: "nowrap" }), children });
|
|
198
|
+
case "card": {
|
|
199
|
+
const o = appear2(t, q);
|
|
200
|
+
return /* @__PURE__ */ jsx2("div", { style: style(it, { background: T.box, border: `4px solid ${resolveColor(T, it.color) ?? T.accent}`, borderRadius: 24, padding: "20px 24px", fontFamily: T.mono, fontSize: it.size ?? 40, color: T.text, opacity: o, translate: `${(1 - o) * 60}px 0px` }), children: it.lines.map((l, i) => /* @__PURE__ */ jsxs2("span", { children: [
|
|
201
|
+
l.map((p, k) => /* @__PURE__ */ jsx2("span", { style: { ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.weight ? { fontWeight: p.weight } : {} }, children: p.text }, k)),
|
|
202
|
+
i < it.lines.length - 1 ? /* @__PURE__ */ jsx2("br", {}) : null
|
|
191
203
|
] }, i)) });
|
|
192
204
|
}
|
|
193
205
|
default:
|
|
194
206
|
return /* @__PURE__ */ jsxs2("div", { style: { color: "#f00", fontSize: 30 }, children: [
|
|
195
|
-
"
|
|
196
|
-
it.
|
|
207
|
+
"unknown type: ",
|
|
208
|
+
it.type
|
|
197
209
|
] });
|
|
198
210
|
}
|
|
199
211
|
};
|
|
200
|
-
var
|
|
212
|
+
var SceneDecl = ({ spec, panelDur, dur }) => {
|
|
201
213
|
const t = useCurrentFrame2() / FPS2;
|
|
202
|
-
const
|
|
203
|
-
if ((spec.layout ?? "
|
|
204
|
-
return /* @__PURE__ */ jsx2(
|
|
214
|
+
const items = (spec.items ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t, dur }, i));
|
|
215
|
+
if ((spec.layout ?? "panel") === "free") return /* @__PURE__ */ jsx2(Fragment2, { children: items });
|
|
216
|
+
return /* @__PURE__ */ jsx2(Panel, { title: spec.title ?? "", dur: panelDur, children: items });
|
|
205
217
|
};
|
|
206
|
-
var
|
|
218
|
+
var resolve = (it, at) => {
|
|
207
219
|
const o = { ...it };
|
|
208
|
-
if (it.
|
|
209
|
-
const [f, n] = Array.isArray(it.
|
|
210
|
-
o.
|
|
211
|
-
delete o.
|
|
220
|
+
if (it.when !== void 0) {
|
|
221
|
+
const [f, n] = Array.isArray(it.when) ? it.when : [it.when, 0];
|
|
222
|
+
o.at = at(f, n) + (it.offset ?? 0);
|
|
223
|
+
delete o.when;
|
|
212
224
|
}
|
|
213
|
-
if (it.
|
|
225
|
+
if (it.items) o.items = it.items.map((f) => resolve(f, at));
|
|
214
226
|
return o;
|
|
215
227
|
};
|
|
216
|
-
function
|
|
217
|
-
const S = spec.
|
|
218
|
-
const
|
|
219
|
-
const A =
|
|
228
|
+
function episodeDataFromSpec(spec, words, components = {}) {
|
|
229
|
+
const S = spec.scenes.map((c) => c.start);
|
|
230
|
+
const endOf = (i) => spec.scenes[i].end ?? (i + 1 < S.length ? S[i + 1] : spec.outro.a);
|
|
231
|
+
const A = makeAt(words, S);
|
|
220
232
|
return {
|
|
221
233
|
id: spec.id,
|
|
222
234
|
durS: spec.durS,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
const
|
|
231
|
-
const
|
|
235
|
+
captionPx: spec.captionPx,
|
|
236
|
+
voice: spec.voice,
|
|
237
|
+
words,
|
|
238
|
+
backgroundLines: spec.backgroundLines,
|
|
239
|
+
hits: spec.hits,
|
|
240
|
+
outro: spec.outro,
|
|
241
|
+
scenes: spec.scenes.map((c, i) => {
|
|
242
|
+
const panelDur = endOf(i) - c.start;
|
|
243
|
+
const resolved = { ...c, items: c.items?.map((it) => resolve(it, (f, n) => A(i)(f, n))) };
|
|
232
244
|
return {
|
|
233
|
-
a: c.
|
|
234
|
-
b: i + 1 < S.length ? S[i + 1] - 0.1 :
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
C: c.
|
|
238
|
-
'
|
|
239
|
-
c.
|
|
240
|
-
'"
|
|
241
|
-
] })) : ({ dur }) => /* @__PURE__ */ jsx2(
|
|
245
|
+
a: c.start,
|
|
246
|
+
b: i + 1 < S.length ? S[i + 1] - 0.1 : endOf(i) - 0.1,
|
|
247
|
+
label: c.label,
|
|
248
|
+
sounds: c.sounds,
|
|
249
|
+
C: c.component ? components[c.component] ?? (() => /* @__PURE__ */ jsxs2("div", { style: { color: "#f00", fontSize: 40 }, children: [
|
|
250
|
+
'component "',
|
|
251
|
+
c.component,
|
|
252
|
+
'" is not registered'
|
|
253
|
+
] })) : ({ dur }) => /* @__PURE__ */ jsx2(SceneDecl, { spec: resolved, panelDur, dur })
|
|
242
254
|
};
|
|
243
255
|
})
|
|
244
256
|
};
|
|
245
257
|
}
|
|
246
|
-
var
|
|
247
|
-
const T =
|
|
248
|
-
return /* @__PURE__ */ jsx2(
|
|
258
|
+
var CoverDecl = ({ spec }) => {
|
|
259
|
+
const T = useTheme2();
|
|
260
|
+
return /* @__PURE__ */ jsx2(Frame, { glow: spec.glow ?? "rgba(244,185,66,.16)", title: spec.title ?? ["", "", ""], color: resolveColor(T, spec.color) ?? T.accent, size: spec.size, children: (spec.items ?? []).map((it, i) => /* @__PURE__ */ jsx2(Render, { it, t: 99, dur: 99 }, i)) });
|
|
249
261
|
};
|
|
250
|
-
var
|
|
251
|
-
const d =
|
|
252
|
-
const
|
|
262
|
+
var EpisodeDecl = ({ spec, words, theme, components = {} }) => {
|
|
263
|
+
const d = episodeDataFromSpec(spec, words, components);
|
|
264
|
+
const CoverC = spec.cover?.component ? components[spec.cover.component] : void 0;
|
|
253
265
|
return /* @__PURE__ */ jsxs2(Fragment2, { children: [
|
|
254
|
-
/* @__PURE__ */ jsx2(Composition, { id: spec.id, component: () => /* @__PURE__ */ jsx2(
|
|
255
|
-
spec.
|
|
266
|
+
/* @__PURE__ */ jsx2(Composition, { id: spec.id, component: () => /* @__PURE__ */ jsx2(ThemeProvider, { theme, children: /* @__PURE__ */ jsx2(Episode, { d }) }), durationInFrames: Math.round(spec.durS * FPS2), fps: FPS2, width: 1080, height: 1920 }),
|
|
267
|
+
spec.cover ? /* @__PURE__ */ jsx2(Still, { id: spec.cover.id, component: () => /* @__PURE__ */ jsx2(ThemeProvider, { theme, children: CoverC ? /* @__PURE__ */ jsx2(CoverC, {}) : /* @__PURE__ */ jsx2(CoverDecl, { spec: spec.cover }) }), width: 1080, height: 1920 }) : null
|
|
256
268
|
] });
|
|
257
269
|
};
|
|
258
270
|
|
|
259
|
-
// src/
|
|
260
|
-
import {
|
|
271
|
+
// src/long-parts.tsx
|
|
272
|
+
import { useTheme as useTheme3 } from "@praeko/studio-core";
|
|
261
273
|
import { interpolate as interpolate2 } from "remotion";
|
|
262
274
|
import { jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
263
275
|
var clamp = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
|
|
264
|
-
var
|
|
276
|
+
var appearL = (t, q, d = 0.3) => interpolate2(t, [q, q + d], [0, 1], clamp);
|
|
265
277
|
var KW = /^(UPDATE|SET|WHERE|AND|INSERT|INTO|SELECT|FROM|CASE|WHEN|THEN|END|AS|VALUES|IS|NOT|NULL|const|await|if)$/;
|
|
266
278
|
var FN = /^(changes|abs|json_set|json_remove|json_extract)$/;
|
|
267
279
|
var colorize = (s, c) => s.split(/(--.*$|\/\/.*$|'[^']*'|\b\w+\b)/).map((p, i) => {
|
|
268
280
|
if (!p) return null;
|
|
269
|
-
let
|
|
270
|
-
if (/^(--|\/\/)/.test(p))
|
|
271
|
-
else if (/^'/.test(p))
|
|
272
|
-
else if (KW.test(p))
|
|
273
|
-
else if (/^\d+$/.test(p))
|
|
274
|
-
else if (FN.test(p))
|
|
275
|
-
return /* @__PURE__ */ jsx3("span", { style: { color:
|
|
281
|
+
let color2 = c.text;
|
|
282
|
+
if (/^(--|\/\/)/.test(p)) color2 = c.muted;
|
|
283
|
+
else if (/^'/.test(p)) color2 = c.ok;
|
|
284
|
+
else if (KW.test(p)) color2 = c.accent;
|
|
285
|
+
else if (/^\d+$/.test(p)) color2 = "#7fb4ff";
|
|
286
|
+
else if (FN.test(p)) color2 = c.info;
|
|
287
|
+
return /* @__PURE__ */ jsx3("span", { style: { color: color2 }, children: p }, i);
|
|
276
288
|
});
|
|
277
|
-
var
|
|
278
|
-
const T =
|
|
279
|
-
const o =
|
|
280
|
-
return /* @__PURE__ */ jsxs3("div", { style: { position: "absolute", left, top, width: w, background: T.
|
|
281
|
-
/* @__PURE__ */ jsx3("div", { style: { background: "#262034", padding: "10px 26px", fontFamily: T.mono, fontSize: 26, color: "#9a95b8", whiteSpace: "nowrap" }, children:
|
|
289
|
+
var CodeL = ({ title, lines, t, q, w, size = 32, left, top }) => {
|
|
290
|
+
const T = useTheme3();
|
|
291
|
+
const o = appearL(t, q);
|
|
292
|
+
return /* @__PURE__ */ jsxs3("div", { style: { position: "absolute", left, top, width: w, background: T.code, border: `3px solid #3a2f22`, borderRadius: 22, overflow: "hidden", opacity: o, transform: `translateY(${(1 - o) * 24}px)` }, children: [
|
|
293
|
+
/* @__PURE__ */ jsx3("div", { style: { background: "#262034", padding: "10px 26px", fontFamily: T.mono, fontSize: 26, color: "#9a95b8", whiteSpace: "nowrap" }, children: title }),
|
|
282
294
|
/* @__PURE__ */ jsx3("div", { style: { padding: "18px 0", fontFamily: T.mono, fontSize: size, lineHeight: 1.5 }, children: lines.map((l, i) => {
|
|
283
295
|
const on = l.hl ? t >= l.hl[0] && t < l.hl[1] : false;
|
|
284
|
-
return /* @__PURE__ */ jsx3("div", { style: { whiteSpace: "pre", padding: "0 26px", borderLeft: `6px solid ${on ? l.red ? T.
|
|
296
|
+
return /* @__PURE__ */ jsx3("div", { style: { whiteSpace: "pre", padding: "0 26px", borderLeft: `6px solid ${on ? l.red ? T.error : T.accent : "transparent"}`, background: on ? l.red ? "rgba(255,107,94,.16)" : "rgba(244,185,66,.16)" : "transparent" }, children: colorize(l.s, T) || " " }, i);
|
|
285
297
|
}) })
|
|
286
298
|
] });
|
|
287
299
|
};
|
|
288
|
-
var
|
|
289
|
-
const T =
|
|
290
|
-
const o =
|
|
291
|
-
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, height: h, boxSizing: "border-box", background: T.
|
|
300
|
+
var CardL = ({ t, q, left, top, w, h, color: color2, children }) => {
|
|
301
|
+
const T = useTheme3();
|
|
302
|
+
const o = appearL(t, q);
|
|
303
|
+
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, height: h, boxSizing: "border-box", background: T.longBox ?? T.box, border: `4px solid ${color2 ?? T.accent}`, borderRadius: 24, padding: "20px 28px", fontFamily: T.font, color: T.text, opacity: o, transform: `translateY(${(1 - o) * 26}px)`, display: "flex", flexDirection: "column", justifyContent: "center", gap: 8 }, children });
|
|
292
304
|
};
|
|
293
|
-
var ChipL = ({ t, q, left, top,
|
|
294
|
-
const T =
|
|
295
|
-
const o =
|
|
296
|
-
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, opacity: o, transform: `scale(${1.15 - 0.15 * o})`, transformOrigin: "left center", fontFamily: T.
|
|
305
|
+
var ChipL = ({ t, q, left, top, color: color2, size = 34, children }) => {
|
|
306
|
+
const T = useTheme3();
|
|
307
|
+
const o = appearL(t, q);
|
|
308
|
+
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, opacity: o, transform: `scale(${1.15 - 0.15 * o})`, transformOrigin: "left center", fontFamily: T.font, fontSize: size, color: T.background, background: color2 ?? T.accent, borderRadius: 16, padding: "10px 26px", whiteSpace: "nowrap" }, children });
|
|
297
309
|
};
|
|
298
|
-
var
|
|
299
|
-
const T =
|
|
300
|
-
const o =
|
|
301
|
-
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, opacity: o, transform: `translateY(${(1 - o) * 18}px)`, fontFamily: mono ? T.mono : T.
|
|
310
|
+
var TextL = ({ t, q, left, top, w, size = 44, color: color2, align = "left", mono, children }) => {
|
|
311
|
+
const T = useTheme3();
|
|
312
|
+
const o = appearL(t, q);
|
|
313
|
+
return /* @__PURE__ */ jsx3("div", { style: { position: "absolute", left, top, width: w, opacity: o, transform: `translateY(${(1 - o) * 18}px)`, fontFamily: mono ? T.mono : T.font, fontSize: size, color: color2 ?? T.text, textAlign: align, lineHeight: 1.2 }, children });
|
|
302
314
|
};
|
|
303
315
|
|
|
304
|
-
// src/
|
|
316
|
+
// src/long-decl.tsx
|
|
305
317
|
import { Composition as Composition2 } from "remotion";
|
|
306
|
-
import { FPS as FPS3,
|
|
318
|
+
import { FPS as FPS3, Long, ThemeProvider as ThemeProvider3, makeAtGlobal, useTheme as useTheme5 } from "@praeko/studio-core";
|
|
307
319
|
import { interpolate as interpolate3, Easing } from "remotion";
|
|
308
320
|
|
|
309
|
-
// src/
|
|
321
|
+
// src/long-cover.tsx
|
|
310
322
|
import { Still as Still2 } from "remotion";
|
|
311
|
-
import {
|
|
323
|
+
import { ThemeProvider as ThemeProvider2, rgba as rgba2, useTheme as useTheme4 } from "@praeko/studio-core";
|
|
312
324
|
import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
313
|
-
var
|
|
314
|
-
var
|
|
315
|
-
const T =
|
|
316
|
-
if (!spec.
|
|
317
|
-
const px = (n) => n *
|
|
318
|
-
return /* @__PURE__ */ jsxs4("div", { style: { width: w, background: T.
|
|
319
|
-
/* @__PURE__ */ jsx4("div", { style: { background: "#262034", padding: `${px(8)}px ${px(22)}px`, fontFamily: T.mono, fontSize: px(24), color: "#9a95b8" }, children: spec.
|
|
320
|
-
/* @__PURE__ */ jsx4("div", { style: { padding: `${px(18)}px ${px(24)}px`, fontFamily: T.mono, fontSize: px(30), lineHeight: 1.5, whiteSpace: "pre" }, children: spec.
|
|
325
|
+
var color = resolveColor;
|
|
326
|
+
var CodeCard = ({ spec, w, scale = 1 }) => {
|
|
327
|
+
const T = useTheme4();
|
|
328
|
+
if (!spec.code) return null;
|
|
329
|
+
const px = (n) => n * scale;
|
|
330
|
+
return /* @__PURE__ */ jsxs4("div", { style: { width: w, background: T.code, border: `${px(5)}px solid ${T.accent}`, borderRadius: px(24), overflow: "hidden", textAlign: "left" }, children: [
|
|
331
|
+
/* @__PURE__ */ jsx4("div", { style: { background: "#262034", padding: `${px(8)}px ${px(22)}px`, fontFamily: T.mono, fontSize: px(24), color: "#9a95b8" }, children: spec.code.title }),
|
|
332
|
+
/* @__PURE__ */ jsx4("div", { style: { padding: `${px(18)}px ${px(24)}px`, fontFamily: T.mono, fontSize: px(30), lineHeight: 1.5, whiteSpace: "pre" }, children: spec.code.lines.map((l, i) => l.hl ? /* @__PURE__ */ jsx4("div", { style: { background: rgba2(T.accent, 0.2), borderLeft: `${px(6)}px solid ${T.accent}`, marginLeft: -px(24), paddingLeft: px(18) }, children: colorize(l.s, T) }, i) : /* @__PURE__ */ jsx4("div", { children: colorize(l.s, T) }, i)) })
|
|
321
333
|
] });
|
|
322
334
|
};
|
|
323
|
-
var Chips = ({ spec,
|
|
324
|
-
const T =
|
|
325
|
-
return /* @__PURE__ */ jsx4("div", { style: { display: "flex", flexDirection:
|
|
335
|
+
var Chips = ({ spec, scale = 1, column }) => {
|
|
336
|
+
const T = useTheme4();
|
|
337
|
+
return /* @__PURE__ */ jsx4("div", { style: { display: "flex", flexDirection: column ? "column" : "row", alignItems: column ? "flex-start" : void 0, gap: 24 * scale }, children: (spec.chips ?? []).map((c, i) => /* @__PURE__ */ jsx4("div", { style: { background: color(T, c.color) ?? T.accent, color: T.background, fontSize: 48 * scale, padding: `${10 * scale}px ${34 * scale}px`, borderRadius: 18 * scale }, children: c.text }, i)) });
|
|
326
338
|
};
|
|
327
|
-
var
|
|
328
|
-
const T =
|
|
329
|
-
return /* @__PURE__ */ jsxs4("div", { style: { width: 1280, height: 720, background: `radial-gradient(900px 500px at 75% 30%, ${rgba2(T.
|
|
330
|
-
/* @__PURE__ */ jsxs4("div", { style: { position: "absolute", left: 70, top: 70, fontSize: 92, lineHeight: 1.05, color: T.
|
|
331
|
-
spec.
|
|
339
|
+
var LongCover16x9 = ({ spec }) => {
|
|
340
|
+
const T = useTheme4();
|
|
341
|
+
return /* @__PURE__ */ jsxs4("div", { style: { width: 1280, height: 720, background: `radial-gradient(900px 500px at 75% 30%, ${rgba2(T.accent, 0.16)}, ${T.background} 70%)`, position: "relative", fontFamily: T.font, color: T.text, overflow: "hidden" }, children: [
|
|
342
|
+
/* @__PURE__ */ jsxs4("div", { style: { position: "absolute", left: 70, top: 70, fontSize: 92, lineHeight: 1.05, color: T.text }, children: [
|
|
343
|
+
spec.title[0],
|
|
332
344
|
/* @__PURE__ */ jsx4("br", {}),
|
|
333
|
-
/* @__PURE__ */ jsx4("span", { style: { color:
|
|
345
|
+
/* @__PURE__ */ jsx4("span", { style: { color: color(T, spec.color) ?? T.accent }, children: spec.title[1] })
|
|
334
346
|
] }),
|
|
335
|
-
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 310 }, children: /* @__PURE__ */ jsx4(
|
|
336
|
-
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 560 }, children: /* @__PURE__ */ jsx4(Chips, { spec,
|
|
337
|
-
spec.
|
|
338
|
-
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, bottom: 50, fontSize: 34, color: T.
|
|
347
|
+
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 310 }, children: /* @__PURE__ */ jsx4(CodeCard, { spec, w: 700 }) }),
|
|
348
|
+
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", left: 70, top: 560 }, children: /* @__PURE__ */ jsx4(Chips, { spec, scale: 0.9 }) }),
|
|
349
|
+
spec.mascot ? /* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, top: 150 }, children: /* @__PURE__ */ jsx4(Mascot, { name: spec.mascot, size: 380 }) }) : null,
|
|
350
|
+
/* @__PURE__ */ jsx4("div", { style: { position: "absolute", right: 70, bottom: 50, fontSize: 34, color: T.accent, letterSpacing: 2 }, children: T.handle })
|
|
339
351
|
] });
|
|
340
352
|
};
|
|
341
|
-
var
|
|
342
|
-
const T =
|
|
343
|
-
return /* @__PURE__ */ jsx4(
|
|
344
|
-
/* @__PURE__ */ jsx4(
|
|
353
|
+
var LongCoverVertical = ({ spec }) => {
|
|
354
|
+
const T = useTheme4();
|
|
355
|
+
return /* @__PURE__ */ jsx4(Frame, { glow: spec.glow ?? rgba2(T.accent, 0.16), title: [spec.title[0], spec.title[1]], color: color(T, spec.color) ?? T.accent, size: spec.title.some((l) => l.length > 11) ? 104 : 130, children: /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 34 }, children: [
|
|
356
|
+
/* @__PURE__ */ jsx4(CodeCard, { spec, w: 780, scale: 1 }),
|
|
345
357
|
/* @__PURE__ */ jsxs4("div", { style: { display: "flex", alignItems: "center", gap: 30 }, children: [
|
|
346
|
-
spec.
|
|
347
|
-
/* @__PURE__ */ jsx4(Chips, { spec,
|
|
358
|
+
spec.mascot ? /* @__PURE__ */ jsx4(Mascot, { name: spec.mascot, size: 210 }) : null,
|
|
359
|
+
/* @__PURE__ */ jsx4(Chips, { spec, scale: 0.7, column: true })
|
|
348
360
|
] })
|
|
349
361
|
] }) });
|
|
350
362
|
};
|
|
351
|
-
var
|
|
352
|
-
/* @__PURE__ */ jsx4(Still2, { id: spec.id, component: () => /* @__PURE__ */ jsx4(
|
|
353
|
-
/* @__PURE__ */ jsx4(Still2, { id: `${spec.id}Vertical`, component: () => /* @__PURE__ */ jsx4(
|
|
363
|
+
var LongCovers = ({ spec, theme }) => /* @__PURE__ */ jsxs4(Fragment3, { children: [
|
|
364
|
+
/* @__PURE__ */ jsx4(Still2, { id: spec.id, component: () => /* @__PURE__ */ jsx4(ThemeProvider2, { theme, children: /* @__PURE__ */ jsx4(LongCover16x9, { spec }) }), width: 1280, height: 720 }),
|
|
365
|
+
/* @__PURE__ */ jsx4(Still2, { id: `${spec.id}Vertical`, component: () => /* @__PURE__ */ jsx4(ThemeProvider2, { theme, children: /* @__PURE__ */ jsx4(LongCoverVertical, { spec }) }), width: 1080, height: 1920 })
|
|
354
366
|
] });
|
|
355
367
|
|
|
356
|
-
// src/
|
|
368
|
+
// src/long-decl.tsx
|
|
357
369
|
import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
|
|
358
|
-
var
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
return /* @__PURE__ */ jsx5(Fragment4, { children: it.partes.map((p, i) => /* @__PURE__ */ jsx5("span", { style: { ...p.cor ? { color: cor3(T, p.cor) } : {}, ...p.mono ? { fontFamily: T.mono } : {} }, children: p.texto }, i)) });
|
|
370
|
+
var TextParts = ({ it }) => {
|
|
371
|
+
const T = useTheme5();
|
|
372
|
+
if (!it.parts) return /* @__PURE__ */ jsx5(Fragment4, { children: it.text });
|
|
373
|
+
return /* @__PURE__ */ jsx5(Fragment4, { children: it.parts.map((p, i) => /* @__PURE__ */ jsx5("span", { style: { ...p.color ? { color: resolveColor(T, p.color) } : {}, ...p.mono ? { fontFamily: T.mono } : {} }, children: p.text }, i)) });
|
|
363
374
|
};
|
|
364
375
|
var clampL = { extrapolateLeft: "clamp", extrapolateRight: "clamp" };
|
|
365
|
-
var
|
|
366
|
-
const p = it.pos ?? {}, dur = it.
|
|
367
|
-
const o =
|
|
368
|
-
const c =
|
|
369
|
-
return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: T.
|
|
370
|
-
it.
|
|
376
|
+
var BarL = ({ it, t, q, T }) => {
|
|
377
|
+
const p = it.pos ?? {}, dur = it.duration ?? 1.4, v = it.value ?? 1, h = it.height ?? 46;
|
|
378
|
+
const o = appearL(t, q), f = interpolate3(t, [q, q + dur], [0, v], { ...clampL, easing: Easing.out(Easing.cubic) });
|
|
379
|
+
const c = resolveColor(T, it.color) ?? T.accent;
|
|
380
|
+
return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: T.font }, children: [
|
|
381
|
+
it.label ? /* @__PURE__ */ jsx5("div", { style: { fontSize: it.size ?? 30, color: T.muted, marginBottom: 8 }, children: it.label }) : null,
|
|
371
382
|
/* @__PURE__ */ jsxs5("div", { style: { position: "relative", height: h, borderRadius: h / 2, background: "rgba(255,255,255,.07)", border: `3px solid ${c}`, overflow: "hidden" }, children: [
|
|
372
383
|
/* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: 0, top: 0, bottom: 0, width: `${f * 100}%`, background: `linear-gradient(90deg, ${c}88, ${c})` } }),
|
|
373
|
-
it.
|
|
384
|
+
it.text ? /* @__PURE__ */ jsx5("div", { style: { position: "absolute", right: 22, top: 0, bottom: 0, display: "flex", alignItems: "center", fontSize: Math.round(h * 0.55), color: T.text, fontWeight: 900, textShadow: "0 2px 8px rgba(0,0,0,.8)" }, children: it.text }) : null
|
|
374
385
|
] })
|
|
375
386
|
] });
|
|
376
387
|
};
|
|
377
|
-
var
|
|
378
|
-
const p = it.pos ?? {}, dur = it.
|
|
379
|
-
const o =
|
|
380
|
-
const s = n.toLocaleString("pt-BR", { minimumFractionDigits:
|
|
381
|
-
return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: it.mono ? T.mono : T.
|
|
382
|
-
it.
|
|
388
|
+
var CounterL = ({ it, t, q, T }) => {
|
|
389
|
+
const p = it.pos ?? {}, dur = it.duration ?? 1.6, a = it.from ?? 0, b = it.to ?? 0, decimals = it.decimals ?? 0;
|
|
390
|
+
const o = appearL(t, q), n = interpolate3(t, [q, q + dur], [a, b], { ...clampL, easing: Easing.out(Easing.cubic) });
|
|
391
|
+
const s = n.toLocaleString("pt-BR", { minimumFractionDigits: decimals, maximumFractionDigits: decimals });
|
|
392
|
+
return /* @__PURE__ */ jsxs5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, opacity: o, fontFamily: it.mono ? T.mono : T.font, fontSize: it.size ?? 96, fontWeight: 900, color: resolveColor(T, it.color) ?? T.accent, lineHeight: 1.1, textAlign: it.align === "center" ? "center" : "left" }, children: [
|
|
393
|
+
it.prefix ?? "",
|
|
383
394
|
s,
|
|
384
|
-
it.
|
|
395
|
+
it.suffix ?? ""
|
|
385
396
|
] });
|
|
386
397
|
};
|
|
387
|
-
function
|
|
388
|
-
const at =
|
|
389
|
-
const q = (x) => typeof x === "number" ? x : typeof x === "string" ? at(x) : at(x.
|
|
398
|
+
function longDataFromSpec(spec, words, T, components = {}) {
|
|
399
|
+
const at = makeAtGlobal(words);
|
|
400
|
+
const q = (x) => typeof x === "number" ? x : typeof x === "string" ? at(x) : at(x.when, x.nth ?? 0, x.after ?? 0) + (x.plus ?? 0);
|
|
390
401
|
const Item = ({ it, t }) => {
|
|
391
402
|
const p = it.pos ?? {};
|
|
392
|
-
switch (it.
|
|
393
|
-
case "
|
|
403
|
+
switch (it.type) {
|
|
404
|
+
case "code":
|
|
394
405
|
return /* @__PURE__ */ jsx5(
|
|
395
|
-
|
|
406
|
+
CodeL,
|
|
396
407
|
{
|
|
397
|
-
|
|
408
|
+
title: it.title,
|
|
398
409
|
t,
|
|
399
|
-
q: q(it.
|
|
410
|
+
q: q(it.when),
|
|
400
411
|
w: p.w,
|
|
401
412
|
left: p.left,
|
|
402
413
|
top: p.top,
|
|
403
|
-
size: it.
|
|
404
|
-
lines: it.
|
|
414
|
+
size: it.size,
|
|
415
|
+
lines: it.lines.map((l) => ({ s: l.s, ...l.hl ? { hl: [q(l.hl[0]), q(l.hl[1])] } : {}, ...l.red ? { red: true } : {} }))
|
|
405
416
|
}
|
|
406
417
|
);
|
|
407
|
-
case "
|
|
408
|
-
return /* @__PURE__ */ jsx5(
|
|
409
|
-
case "
|
|
410
|
-
return /* @__PURE__ */ jsx5("div", { style: { fontSize: it.
|
|
418
|
+
case "card":
|
|
419
|
+
return /* @__PURE__ */ jsx5(CardL, { t, q: q(it.when), left: p.left, top: p.top, w: p.w, h: p.h, color: resolveColor(T, it.color), children: it.items.map((f, i) => /* @__PURE__ */ jsx5(Item, { it: f, t }, i)) });
|
|
420
|
+
case "text":
|
|
421
|
+
return /* @__PURE__ */ jsx5("div", { style: { fontSize: it.size, color: resolveColor(T, it.color), ...it.spacing ? { letterSpacing: it.spacing } : {}, ...it.when !== void 0 ? { opacity: appearL(t, q(it.when)) } : {} }, children: /* @__PURE__ */ jsx5(TextParts, { it }) });
|
|
411
422
|
case "chip":
|
|
412
|
-
return /* @__PURE__ */ jsx5(ChipL, { t, q: q(it.
|
|
413
|
-
case "
|
|
414
|
-
return /* @__PURE__ */ jsx5(
|
|
423
|
+
return /* @__PURE__ */ jsx5(ChipL, { t, q: q(it.when), left: p.left, top: p.top, color: resolveColor(T, it.color), size: it.size, children: it.text });
|
|
424
|
+
case "freetext":
|
|
425
|
+
return /* @__PURE__ */ jsx5(TextL, { t, q: q(it.when), left: p.left, top: p.top, w: p.w, size: it.size, color: resolveColor(T, it.color), align: it.align === "center" ? "center" : "left", mono: it.mono, children: /* @__PURE__ */ jsx5(TextParts, { it }) });
|
|
415
426
|
case "video":
|
|
416
|
-
return /* @__PURE__ */ jsx5(
|
|
417
|
-
case "
|
|
418
|
-
return /* @__PURE__ */ jsx5(
|
|
419
|
-
case "
|
|
420
|
-
return /* @__PURE__ */ jsx5(
|
|
421
|
-
case "
|
|
422
|
-
return /* @__PURE__ */ jsx5(
|
|
423
|
-
case "
|
|
424
|
-
const
|
|
425
|
-
return /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, display: "flex", alignItems: "center", justifyContent: "space-between", fontFamily: T.
|
|
426
|
-
const o =
|
|
427
|
-
return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", flex: i <
|
|
428
|
-
/* @__PURE__ */ jsx5("div", { style: { opacity: o, transform: `scale(${0.85 + 0.15 * o})`, background: T.
|
|
429
|
-
i <
|
|
427
|
+
return /* @__PURE__ */ jsx5(Window, { t, q: q(it.when), src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: p.left, top: p.top, w: p.w, reg: it.reg ?? [0, 0, 1920, 1080], tag: it.tag ?? "footage", dur: it.motionDuration ?? 20 });
|
|
428
|
+
case "phone":
|
|
429
|
+
return /* @__PURE__ */ jsx5(Phone, { t, q: q(it.when), src: it.src, clipDuration: it.clipDuration, from: it.from ?? 0, left: p.left, top: p.top, w: p.w, dur: it.motionDuration ?? 20 });
|
|
430
|
+
case "bar":
|
|
431
|
+
return /* @__PURE__ */ jsx5(BarL, { it, t, q: q(it.when), T });
|
|
432
|
+
case "counter":
|
|
433
|
+
return /* @__PURE__ */ jsx5(CounterL, { it, t, q: q(it.when), T });
|
|
434
|
+
case "flow": {
|
|
435
|
+
const nodes = it.nodes ?? [], size = it.size ?? 34, c0 = resolveColor(T, it.color) ?? T.accent;
|
|
436
|
+
return /* @__PURE__ */ jsx5("div", { style: { position: "absolute", left: p.left, top: p.top, width: p.w, display: "flex", alignItems: "center", justifyContent: "space-between", fontFamily: T.font }, children: nodes.map((n, i) => {
|
|
437
|
+
const o = appearL(t, q(n.when)), c = resolveColor(T, n.color) ?? c0;
|
|
438
|
+
return /* @__PURE__ */ jsxs5("div", { style: { display: "flex", alignItems: "center", flex: i < nodes.length - 1 ? 1 : void 0 }, children: [
|
|
439
|
+
/* @__PURE__ */ jsx5("div", { style: { opacity: o, transform: `scale(${0.85 + 0.15 * o})`, background: T.longBox ?? T.box, border: `4px solid ${c}`, borderRadius: 22, padding: "16px 26px", fontSize: size, color: T.text, textAlign: "center", lineHeight: 1.2, whiteSpace: "pre-line" }, children: n.text }),
|
|
440
|
+
i < nodes.length - 1 ? /* @__PURE__ */ jsx5("div", { style: { flex: 1, textAlign: "center", fontSize: size * 1.2, color: T.muted, opacity: appearL(t, q(nodes[i + 1].when)) }, children: "\u2192" }) : null
|
|
430
441
|
] }, i);
|
|
431
442
|
}) });
|
|
432
443
|
}
|
|
433
444
|
default:
|
|
434
445
|
return /* @__PURE__ */ jsxs5("div", { style: { color: "#f00", fontSize: 30 }, children: [
|
|
435
|
-
"
|
|
436
|
-
it.
|
|
446
|
+
"unknown type: ",
|
|
447
|
+
it.type
|
|
437
448
|
] });
|
|
438
449
|
}
|
|
439
450
|
};
|
|
440
|
-
const S = spec.
|
|
451
|
+
const S = spec.scenes.map((c) => c.start);
|
|
441
452
|
return {
|
|
442
453
|
id: spec.id,
|
|
443
454
|
durS: spec.durS,
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
...spec.
|
|
447
|
-
|
|
455
|
+
voice: spec.voice,
|
|
456
|
+
words,
|
|
457
|
+
...spec.endcard ? { endcard: { a: spec.endcard.start, text: spec.endcard.text, link: spec.endcard.link, image: spec.endcard.image } } : {},
|
|
458
|
+
scenes: spec.scenes.map((c, i) => ({
|
|
448
459
|
n: c.n ?? String(i + 1),
|
|
449
|
-
|
|
450
|
-
a: c.
|
|
460
|
+
title: c.title,
|
|
461
|
+
a: c.start,
|
|
451
462
|
b: i + 1 < S.length ? S[i + 1] : spec.durS,
|
|
452
|
-
C: c.
|
|
453
|
-
'
|
|
454
|
-
c.
|
|
455
|
-
'"
|
|
456
|
-
] })) : ({ t }) => /* @__PURE__ */ jsx5(Fragment4, { children: (c.
|
|
463
|
+
C: c.component ? components[c.component] ?? (() => /* @__PURE__ */ jsxs5("div", { style: { color: "#f00", fontSize: 40 }, children: [
|
|
464
|
+
'component "',
|
|
465
|
+
c.component,
|
|
466
|
+
'" is not registered'
|
|
467
|
+
] })) : ({ t }) => /* @__PURE__ */ jsx5(Fragment4, { children: (c.items ?? []).map((it, k) => /* @__PURE__ */ jsx5(Item, { it, t }, k)) })
|
|
457
468
|
}))
|
|
458
469
|
};
|
|
459
470
|
}
|
|
460
|
-
var
|
|
461
|
-
const d =
|
|
471
|
+
var LongDecl = ({ spec, words, theme, components }) => {
|
|
472
|
+
const d = longDataFromSpec(spec, words, theme, components);
|
|
462
473
|
return /* @__PURE__ */ jsxs5(Fragment4, { children: [
|
|
463
|
-
/* @__PURE__ */ jsx5(Composition2, { id: spec.id, component: () => /* @__PURE__ */ jsx5(
|
|
464
|
-
spec.
|
|
474
|
+
/* @__PURE__ */ jsx5(Composition2, { id: spec.id, component: () => /* @__PURE__ */ jsx5(ThemeProvider3, { theme, children: /* @__PURE__ */ jsx5(Long, { d }) }), durationInFrames: Math.round(spec.durS * FPS3), fps: FPS3, width: d.width ?? 1920, height: d.height ?? 1080 }),
|
|
475
|
+
spec.cover ? /* @__PURE__ */ jsx5(LongCovers, { spec: spec.cover, theme }) : null
|
|
465
476
|
] });
|
|
466
477
|
};
|
|
467
478
|
export {
|
|
468
|
-
Balao,
|
|
469
479
|
Big,
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
CapasLongo,
|
|
474
|
-
CartaoL,
|
|
475
|
-
Celular,
|
|
480
|
+
Box,
|
|
481
|
+
Bubble,
|
|
482
|
+
CardL,
|
|
476
483
|
ChipL,
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
484
|
+
Code,
|
|
485
|
+
CodeL,
|
|
486
|
+
EpisodeDecl,
|
|
487
|
+
Frame,
|
|
488
|
+
Line,
|
|
489
|
+
LongCover16x9,
|
|
490
|
+
LongCoverVertical,
|
|
491
|
+
LongCovers,
|
|
492
|
+
LongDecl,
|
|
493
|
+
Mascot,
|
|
494
|
+
Panel,
|
|
495
|
+
Phone,
|
|
496
|
+
TextL,
|
|
497
|
+
Window,
|
|
498
|
+
appearL,
|
|
487
499
|
colorize,
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
500
|
+
episodeDataFromSpec,
|
|
501
|
+
longDataFromSpec,
|
|
502
|
+
resolveColor
|
|
491
503
|
};
|