@clypra-studio/engine 1.7.0 → 1.8.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.
@@ -112,6 +112,204 @@ var defaultConfig = {
112
112
  wrapText: true,
113
113
  autoFitText: false
114
114
  };
115
+ var builtInPresets = [
116
+ {
117
+ id: "classic-yellow",
118
+ name: "Classic Yellow",
119
+ category: "caption",
120
+ config: {
121
+ ...defaultConfig,
122
+ text: "SAMPLE CAPTION",
123
+ effectName: "Classic Yellow",
124
+ fontFamily: "Outfit Variable",
125
+ fontWeight: 800,
126
+ fontSize: 64,
127
+ fillColor: "#FFE600",
128
+ strokeEnabled: true,
129
+ strokeColor: "#000000",
130
+ strokeWidth: 5,
131
+ strokePosition: "outside",
132
+ strokeOpacity: 100,
133
+ shadowEnabled: true,
134
+ shadowColor: "#000000",
135
+ shadowBlur: 6,
136
+ shadowOffsetX: 0,
137
+ shadowOffsetY: 3,
138
+ shadowOpacity: 85
139
+ }
140
+ },
141
+ {
142
+ id: "dark-pill",
143
+ name: "Dark Pill",
144
+ category: "caption",
145
+ config: {
146
+ ...defaultConfig,
147
+ text: "SAMPLE CAPTION",
148
+ effectName: "Dark Pill",
149
+ fontFamily: "Inter Variable",
150
+ fontWeight: 700,
151
+ fontSize: 56,
152
+ fillColor: "#FFFFFF",
153
+ panelEnabled: true,
154
+ panelColor: "#000000",
155
+ panelOpacity: 85,
156
+ panelRadius: 28,
157
+ panelPaddingX: 36,
158
+ panelPaddingY: 12
159
+ }
160
+ },
161
+ {
162
+ id: "outline-white",
163
+ name: "Outline White",
164
+ category: "caption",
165
+ config: {
166
+ ...defaultConfig,
167
+ text: "SAMPLE CAPTION",
168
+ effectName: "Outline White",
169
+ fontFamily: "Outfit Variable",
170
+ fontWeight: 800,
171
+ fontSize: 64,
172
+ fillColor: "#FFFFFF",
173
+ strokeEnabled: true,
174
+ strokeColor: "#000000",
175
+ strokeWidth: 4,
176
+ strokePosition: "outside",
177
+ strokeOpacity: 100,
178
+ shadowEnabled: true,
179
+ shadowColor: "#000000",
180
+ shadowBlur: 4,
181
+ shadowOffsetX: 0,
182
+ shadowOffsetY: 2,
183
+ shadowOpacity: 70
184
+ }
185
+ },
186
+ {
187
+ id: "neon-pop",
188
+ name: "Neon Pop",
189
+ category: "caption",
190
+ config: {
191
+ ...defaultConfig,
192
+ text: "SAMPLE CAPTION",
193
+ effectName: "Neon Pop",
194
+ fontFamily: "Montserrat Variable",
195
+ fontWeight: 800,
196
+ fontSize: 64,
197
+ fillColor: "#00F0FF",
198
+ strokeEnabled: true,
199
+ strokeColor: "#003344",
200
+ strokeWidth: 2,
201
+ strokePosition: "outside",
202
+ glowLayers: [
203
+ { enabled: true, color: "#00F0FF", blur: 15, opacity: 85, type: "outer" },
204
+ { enabled: false, color: "#FF007C", blur: 40, opacity: 60, type: "outer" },
205
+ { enabled: false, color: "#00F0FF", blur: 60, opacity: 40, type: "outer" }
206
+ ],
207
+ shadowEnabled: true,
208
+ shadowColor: "rgba(0, 240, 255, 0.5)",
209
+ shadowBlur: 14,
210
+ shadowOffsetX: 0,
211
+ shadowOffsetY: 0,
212
+ shadowOpacity: 80
213
+ }
214
+ },
215
+ {
216
+ id: "minimal-clean",
217
+ name: "Minimal Clean",
218
+ category: "caption",
219
+ config: {
220
+ ...defaultConfig,
221
+ text: "SAMPLE CAPTION",
222
+ effectName: "Minimal Clean",
223
+ fontFamily: "Inter Variable",
224
+ fontWeight: 600,
225
+ fontSize: 58,
226
+ fillColor: "#F5F5F7",
227
+ shadowEnabled: true,
228
+ shadowColor: "#000000",
229
+ shadowBlur: 6,
230
+ shadowOffsetX: 0,
231
+ shadowOffsetY: 2,
232
+ shadowOpacity: 65
233
+ }
234
+ },
235
+ {
236
+ id: "fire-orange",
237
+ name: "Fire Orange",
238
+ category: "caption",
239
+ config: {
240
+ ...defaultConfig,
241
+ text: "SAMPLE CAPTION",
242
+ effectName: "Fire Orange",
243
+ fontFamily: "Outfit Variable",
244
+ fontWeight: 900,
245
+ fontSize: 64,
246
+ fillColor: "#FF5722",
247
+ strokeEnabled: true,
248
+ strokeColor: "#1A0500",
249
+ strokeWidth: 4,
250
+ strokePosition: "outside",
251
+ strokeOpacity: 100,
252
+ shadowEnabled: true,
253
+ shadowColor: "rgba(255, 87, 34, 0.4)",
254
+ shadowBlur: 8,
255
+ shadowOffsetX: 0,
256
+ shadowOffsetY: 2,
257
+ shadowOpacity: 75
258
+ }
259
+ },
260
+ {
261
+ id: "frosted-glass",
262
+ name: "Frosted Glass",
263
+ category: "caption",
264
+ config: {
265
+ ...defaultConfig,
266
+ text: "SAMPLE CAPTION",
267
+ effectName: "Frosted Glass",
268
+ fontFamily: "Inter Variable",
269
+ fontWeight: 600,
270
+ fontSize: 56,
271
+ fillColor: "#FFFFFF",
272
+ panelEnabled: true,
273
+ panelColor: "#FFFFFF",
274
+ panelOpacity: 18,
275
+ panelRadius: 20,
276
+ panelPaddingX: 32,
277
+ panelPaddingY: 12,
278
+ panelStrokeEnabled: true,
279
+ panelStrokeColor: "rgba(255, 255, 255, 0.3)",
280
+ panelStrokeWidth: 1.5,
281
+ shadowEnabled: true,
282
+ shadowColor: "rgba(0, 0, 0, 0.3)",
283
+ shadowBlur: 8,
284
+ shadowOffsetX: 0,
285
+ shadowOffsetY: 4,
286
+ shadowOpacity: 50
287
+ }
288
+ },
289
+ {
290
+ id: "typewriter-mono",
291
+ name: "Typewriter Mono",
292
+ category: "caption",
293
+ config: {
294
+ ...defaultConfig,
295
+ text: "SAMPLE CAPTION",
296
+ effectName: "Typewriter Mono",
297
+ fontFamily: "Fira Code",
298
+ fontWeight: 600,
299
+ fontSize: 52,
300
+ fillColor: "#FFFFFF",
301
+ panelEnabled: true,
302
+ panelColor: "#161622",
303
+ panelOpacity: 90,
304
+ panelRadius: 8,
305
+ panelPaddingX: 24,
306
+ panelPaddingY: 10,
307
+ panelStrokeEnabled: true,
308
+ panelStrokeColor: "#FFB800",
309
+ panelStrokeWidth: 2
310
+ }
311
+ }
312
+ ];
115
313
 
116
314
  // src/engine/timelineDefaults.ts
117
315
  function ensureDefaultTimeline(doc) {
@@ -3148,6 +3346,24 @@ function compileTextTemplate(artifact, context) {
3148
3346
  const node = findNode(document2.nodes, control.target.nodeId);
3149
3347
  if (node) setPath(node, control.target.propertyPath, resolvedControls[control.id]);
3150
3348
  }
3349
+ if (context.controlValues) {
3350
+ for (const node of document2.nodes || []) {
3351
+ if (node.type === "text") {
3352
+ const textVal = context.controlValues[`text-${node.id}`];
3353
+ if (typeof textVal === "string") {
3354
+ node.text = textVal;
3355
+ }
3356
+ const fontVal = context.controlValues[`font-${node.id}`];
3357
+ if (typeof fontVal === "string") {
3358
+ node.style = { ...node.style, fontFamily: fontVal };
3359
+ }
3360
+ const colorVal = context.controlValues[`color-${node.id}`];
3361
+ if (typeof colorVal === "string") {
3362
+ node.style = { ...node.style, textColor: colorVal };
3363
+ }
3364
+ }
3365
+ }
3366
+ }
3151
3367
  const time = mapTime(context.time, artifact, context.clipDuration);
3152
3368
  const flexPositions = /* @__PURE__ */ new Map();
3153
3369
  const containers = (document2.nodes || []).filter((n) => n.type === "container");