@clypra-studio/engine 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -7,22 +7,6 @@ import {
7
7
  injectFontVariantRules,
8
8
  resetFontLoader
9
9
  } from "./chunk-NG4F55V7.js";
10
- import {
11
- ALL_TRANSITIONS,
12
- TRANSITION_CATEGORIES,
13
- TRANSITION_PRESETS,
14
- TransitionRenderer,
15
- getAllTransitionTags,
16
- getAllTransitions,
17
- getRecommendedDuration,
18
- getTransitionById,
19
- getTransitionByRenderer,
20
- getTransitionCategories,
21
- getTransitionCountByCategory,
22
- getTransitionsByCategory,
23
- getTransitionsByTags,
24
- searchTransitions
25
- } from "./chunk-PU3Q4QI7.js";
26
10
  import {
27
11
  CANONICAL_RENDERER_VERSION,
28
12
  CANONICAL_SCHEMA_VERSION,
@@ -55,11 +39,13 @@ import {
55
39
  renderCanonicalToCanvas,
56
40
  renderTextEffectToCanvas,
57
41
  renderTextTemplateToCanvas,
42
+ resolveTemplateControlValues,
43
+ resolveTemplateFontFamily,
58
44
  resolveTextTemplateArtifact,
59
45
  solveSpring,
60
46
  splitTextContent,
61
47
  validateTextTemplateArtifact
62
- } from "./chunk-Q7XYDP4X.js";
48
+ } from "./chunk-7VLGHWCA.js";
63
49
  import {
64
50
  COMPOSITION_PRESETS,
65
51
  CanvasDevice,
@@ -121,6 +107,22 @@ import {
121
107
  textEffectConfigToScene,
122
108
  wrapTextToWidth
123
109
  } from "./chunk-7ORA5BPW.js";
110
+ import {
111
+ ALL_TRANSITIONS,
112
+ TRANSITION_CATEGORIES,
113
+ TRANSITION_PRESETS,
114
+ TransitionRenderer,
115
+ getAllTransitionTags,
116
+ getAllTransitions,
117
+ getRecommendedDuration,
118
+ getTransitionById,
119
+ getTransitionByRenderer,
120
+ getTransitionCategories,
121
+ getTransitionCountByCategory,
122
+ getTransitionsByCategory,
123
+ getTransitionsByTags,
124
+ searchTransitions
125
+ } from "./chunk-PU3Q4QI7.js";
124
126
  import {
125
127
  EFFECTS_REGISTRY,
126
128
  EffectEngine,
@@ -290,6 +292,12 @@ var BoundingBoxSchema = z.object({
290
292
  mode: z.enum(["ink", "panel"]).optional()
291
293
  });
292
294
  var EffectFullDefinitionSchema = EffectIndexItemSchema.extend({
295
+ schemaVersion: z.number().optional(),
296
+ revisionId: z.string().optional(),
297
+ contentHash: z.string().optional(),
298
+ rendererVersion: z.string().optional(),
299
+ revision: z.record(z.string(), z.unknown()).optional(),
300
+ scene: z.any().optional(),
293
301
  version: z.string().optional(),
294
302
  description: z.string(),
295
303
  tags: z.array(z.string()),
@@ -338,7 +346,15 @@ var TemplateCategorySchema = z.enum([
338
346
  "caption",
339
347
  "callout",
340
348
  "social",
341
- "countdown"
349
+ "countdown",
350
+ "kinetic-type",
351
+ "cta",
352
+ "credits",
353
+ "quotes",
354
+ "sports",
355
+ "gaming",
356
+ "news",
357
+ "minimal"
342
358
  ]);
343
359
  var AnimationPresetSchema = z.enum([
344
360
  "fade",
@@ -6132,6 +6148,478 @@ var BUILTIN_CANVAS_TEMPLATES = [
6132
6148
  }
6133
6149
  }
6134
6150
  ]
6151
+ },
6152
+ {
6153
+ id: "action-cta-card",
6154
+ label: "Modern Action CTA",
6155
+ category: "cta",
6156
+ duration: 4,
6157
+ canvasWidth: 1920,
6158
+ canvasHeight: 1080,
6159
+ layers: [
6160
+ {
6161
+ kind: "shape",
6162
+ id: "cta-bg",
6163
+ shape: "rect",
6164
+ fill: "rgba(18, 18, 28, 0.95)",
6165
+ stroke: { color: "#6366f1", width: 2 },
6166
+ x: 460,
6167
+ y: 380,
6168
+ width: 1e3,
6169
+ height: 320,
6170
+ animation: {
6171
+ in: "scale-in",
6172
+ out: "fade",
6173
+ inDuration: 0.5,
6174
+ outDuration: 0.3,
6175
+ hold: "full"
6176
+ }
6177
+ },
6178
+ {
6179
+ kind: "text",
6180
+ id: "cta-heading",
6181
+ content: "READY TO LEVEL UP?",
6182
+ fontFamily: "Poppins",
6183
+ fontSize: 64,
6184
+ fontWeight: 800,
6185
+ color: "#ffffff",
6186
+ align: "center",
6187
+ x: 460,
6188
+ y: 420,
6189
+ width: 1e3,
6190
+ height: 80,
6191
+ role: "primary",
6192
+ animation: {
6193
+ in: "slide-down",
6194
+ out: "fade",
6195
+ inDuration: 0.6,
6196
+ outDuration: 0.3,
6197
+ hold: "full"
6198
+ }
6199
+ },
6200
+ {
6201
+ kind: "text",
6202
+ id: "cta-sub",
6203
+ content: "Download Clypra Studio and start creating today.",
6204
+ fontFamily: "Inter Variable",
6205
+ fontSize: 26,
6206
+ fontWeight: 400,
6207
+ color: "#94a3b8",
6208
+ align: "center",
6209
+ x: 460,
6210
+ y: 510,
6211
+ width: 1e3,
6212
+ height: 40,
6213
+ role: "secondary",
6214
+ animation: {
6215
+ in: "fade",
6216
+ out: "fade",
6217
+ inDuration: 0.7,
6218
+ outDuration: 0.3,
6219
+ hold: "full"
6220
+ }
6221
+ },
6222
+ {
6223
+ kind: "text",
6224
+ id: "cta-btn-text",
6225
+ content: "GET STARTED FREE",
6226
+ fontFamily: "Poppins",
6227
+ fontSize: 24,
6228
+ fontWeight: 700,
6229
+ color: "#ffffff",
6230
+ backgroundColor: "#6366f1",
6231
+ backgroundOpacity: 0.95,
6232
+ paddingTop: 10,
6233
+ paddingBottom: 10,
6234
+ paddingLeft: 28,
6235
+ paddingRight: 28,
6236
+ backgroundRadius: 8,
6237
+ align: "center",
6238
+ x: 810,
6239
+ y: 580,
6240
+ width: 300,
6241
+ height: 50,
6242
+ role: "accent",
6243
+ animation: {
6244
+ in: "scale-pop",
6245
+ out: "fade",
6246
+ inDuration: 0.8,
6247
+ outDuration: 0.3,
6248
+ hold: "full"
6249
+ }
6250
+ }
6251
+ ]
6252
+ },
6253
+ {
6254
+ id: "cinematic-credits-card",
6255
+ label: "Cinematic Cast Card",
6256
+ category: "credits",
6257
+ duration: 5,
6258
+ canvasWidth: 1920,
6259
+ canvasHeight: 1080,
6260
+ layers: [
6261
+ {
6262
+ kind: "text",
6263
+ id: "credit-role",
6264
+ content: "DIRECTED BY",
6265
+ fontFamily: "Inter Variable",
6266
+ fontSize: 24,
6267
+ fontWeight: 600,
6268
+ color: "#7c6fff",
6269
+ letterSpacing: 6,
6270
+ align: "center",
6271
+ x: 460,
6272
+ y: 450,
6273
+ width: 1e3,
6274
+ height: 40,
6275
+ role: "secondary",
6276
+ animation: {
6277
+ in: "fade",
6278
+ out: "fade",
6279
+ inDuration: 0.8,
6280
+ outDuration: 0.4,
6281
+ hold: "full"
6282
+ }
6283
+ },
6284
+ {
6285
+ kind: "text",
6286
+ id: "credit-name",
6287
+ content: "MARCUS VANCE",
6288
+ fontFamily: "Poppins",
6289
+ fontSize: 56,
6290
+ fontWeight: 800,
6291
+ color: "#ffffff",
6292
+ letterSpacing: 2,
6293
+ align: "center",
6294
+ x: 460,
6295
+ y: 510,
6296
+ width: 1e3,
6297
+ height: 70,
6298
+ role: "primary",
6299
+ animation: {
6300
+ in: "slide-up",
6301
+ out: "fade",
6302
+ inDuration: 0.8,
6303
+ outDuration: 0.4,
6304
+ hold: "full"
6305
+ }
6306
+ }
6307
+ ]
6308
+ },
6309
+ {
6310
+ id: "editorial-pull-quote",
6311
+ label: "Editorial Pull Quote",
6312
+ category: "quotes",
6313
+ duration: 5,
6314
+ canvasWidth: 1920,
6315
+ canvasHeight: 1080,
6316
+ layers: [
6317
+ {
6318
+ kind: "text",
6319
+ id: "quote-body",
6320
+ content: "\u201CCreativity is intelligence having fun.\u201D",
6321
+ fontFamily: "Poppins",
6322
+ fontSize: 48,
6323
+ fontWeight: 400,
6324
+ fontStyle: "italic",
6325
+ color: "#ffffff",
6326
+ align: "center",
6327
+ x: 360,
6328
+ y: 440,
6329
+ width: 1200,
6330
+ height: 80,
6331
+ role: "primary",
6332
+ animation: {
6333
+ in: "fade",
6334
+ out: "fade",
6335
+ inDuration: 0.8,
6336
+ outDuration: 0.3,
6337
+ hold: "full"
6338
+ }
6339
+ },
6340
+ {
6341
+ kind: "text",
6342
+ id: "quote-author",
6343
+ content: "\u2014 ALBERT EINSTEIN",
6344
+ fontFamily: "Inter Variable",
6345
+ fontSize: 24,
6346
+ fontWeight: 600,
6347
+ color: "#38bdf8",
6348
+ letterSpacing: 3,
6349
+ align: "center",
6350
+ x: 460,
6351
+ y: 540,
6352
+ width: 1e3,
6353
+ height: 40,
6354
+ role: "secondary",
6355
+ animation: {
6356
+ in: "slide-up",
6357
+ out: "fade",
6358
+ inDuration: 0.9,
6359
+ outDuration: 0.3,
6360
+ hold: "full"
6361
+ }
6362
+ }
6363
+ ]
6364
+ },
6365
+ {
6366
+ id: "sports-match-score",
6367
+ label: "Sports Match Scoreboard",
6368
+ category: "sports",
6369
+ duration: 4,
6370
+ canvasWidth: 1920,
6371
+ canvasHeight: 1080,
6372
+ layers: [
6373
+ {
6374
+ kind: "shape",
6375
+ id: "score-bg",
6376
+ shape: "rect",
6377
+ fill: "rgba(15, 23, 42, 0.95)",
6378
+ stroke: { color: "#38bdf8", width: 2 },
6379
+ x: 660,
6380
+ y: 440,
6381
+ width: 600,
6382
+ height: 180,
6383
+ animation: {
6384
+ in: "scale-in",
6385
+ out: "fade",
6386
+ inDuration: 0.4,
6387
+ outDuration: 0.3,
6388
+ hold: "full"
6389
+ }
6390
+ },
6391
+ {
6392
+ kind: "text",
6393
+ id: "team-names",
6394
+ content: "WARRIORS vs CHAMPIONS",
6395
+ fontFamily: "Inter Variable",
6396
+ fontSize: 26,
6397
+ fontWeight: 700,
6398
+ color: "#94a3b8",
6399
+ align: "center",
6400
+ x: 660,
6401
+ y: 460,
6402
+ width: 600,
6403
+ height: 40,
6404
+ role: "secondary",
6405
+ animation: {
6406
+ in: "fade",
6407
+ out: "fade",
6408
+ inDuration: 0.5,
6409
+ outDuration: 0.3,
6410
+ hold: "full"
6411
+ }
6412
+ },
6413
+ {
6414
+ kind: "text",
6415
+ id: "score-digits",
6416
+ content: "3 - 2",
6417
+ fontFamily: "Poppins",
6418
+ fontSize: 72,
6419
+ fontWeight: 900,
6420
+ color: "#ffffff",
6421
+ align: "center",
6422
+ x: 660,
6423
+ y: 505,
6424
+ width: 600,
6425
+ height: 90,
6426
+ role: "primary",
6427
+ animation: {
6428
+ in: "scale-pop",
6429
+ out: "fade",
6430
+ inDuration: 0.6,
6431
+ outDuration: 0.3,
6432
+ hold: "full"
6433
+ }
6434
+ }
6435
+ ]
6436
+ },
6437
+ {
6438
+ id: "gamer-hud-tag",
6439
+ label: "Cyberpunk Gamer HUD",
6440
+ category: "gaming",
6441
+ duration: 4,
6442
+ canvasWidth: 1920,
6443
+ canvasHeight: 1080,
6444
+ layers: [
6445
+ {
6446
+ kind: "text",
6447
+ id: "gamer-lvl",
6448
+ content: "LVL 99 \xB7 PRO",
6449
+ fontFamily: "Inter Variable",
6450
+ fontSize: 22,
6451
+ fontWeight: 800,
6452
+ color: "#a855f7",
6453
+ backgroundColor: "#2e1065",
6454
+ backgroundOpacity: 0.9,
6455
+ paddingTop: 6,
6456
+ paddingBottom: 6,
6457
+ paddingLeft: 16,
6458
+ paddingRight: 16,
6459
+ backgroundRadius: 4,
6460
+ align: "center",
6461
+ x: 810,
6462
+ y: 450,
6463
+ width: 300,
6464
+ height: 40,
6465
+ role: "secondary",
6466
+ animation: {
6467
+ in: "scale-pop",
6468
+ out: "fade",
6469
+ inDuration: 0.3,
6470
+ outDuration: 0.2,
6471
+ hold: "full"
6472
+ }
6473
+ },
6474
+ {
6475
+ kind: "text",
6476
+ id: "gamer-handle",
6477
+ content: "NIGHT_RAVEN",
6478
+ fontFamily: "Poppins",
6479
+ fontSize: 60,
6480
+ fontWeight: 900,
6481
+ color: "#ffffff",
6482
+ align: "center",
6483
+ x: 660,
6484
+ y: 500,
6485
+ width: 600,
6486
+ height: 80,
6487
+ role: "primary",
6488
+ animation: {
6489
+ in: "slide-up",
6490
+ out: "fade",
6491
+ inDuration: 0.5,
6492
+ outDuration: 0.3,
6493
+ hold: "full"
6494
+ }
6495
+ }
6496
+ ]
6497
+ },
6498
+ {
6499
+ id: "breaking-news-live",
6500
+ label: "Live Breaking News Strap",
6501
+ category: "news",
6502
+ duration: 5,
6503
+ canvasWidth: 1920,
6504
+ canvasHeight: 1080,
6505
+ layers: [
6506
+ {
6507
+ kind: "text",
6508
+ id: "news-badge",
6509
+ content: "BREAKING NEWS",
6510
+ fontFamily: "Inter Variable",
6511
+ fontSize: 24,
6512
+ fontWeight: 800,
6513
+ color: "#ffffff",
6514
+ backgroundColor: "#dc2626",
6515
+ backgroundOpacity: 0.95,
6516
+ paddingTop: 8,
6517
+ paddingBottom: 8,
6518
+ paddingLeft: 20,
6519
+ paddingRight: 20,
6520
+ backgroundRadius: 4,
6521
+ align: "left",
6522
+ x: 100,
6523
+ y: 840,
6524
+ width: "auto",
6525
+ height: "auto",
6526
+ role: "accent",
6527
+ animation: {
6528
+ in: "scale-pop",
6529
+ out: "fade",
6530
+ inDuration: 0.3,
6531
+ outDuration: 0.2,
6532
+ hold: "full"
6533
+ }
6534
+ },
6535
+ {
6536
+ kind: "text",
6537
+ id: "news-headline",
6538
+ content: "MAJOR DISCOVERY ANNOUNCED LIVE TODAY",
6539
+ fontFamily: "Poppins",
6540
+ fontSize: 48,
6541
+ fontWeight: 800,
6542
+ color: "#ffffff",
6543
+ backgroundColor: "rgba(15, 23, 42, 0.95)",
6544
+ backgroundOpacity: 0.95,
6545
+ paddingTop: 12,
6546
+ paddingBottom: 12,
6547
+ paddingLeft: 28,
6548
+ paddingRight: 28,
6549
+ backgroundRadius: 4,
6550
+ backgroundBorderColor: "#dc2626",
6551
+ backgroundBorderWidth: 2,
6552
+ align: "left",
6553
+ x: 100,
6554
+ y: 890,
6555
+ width: "auto",
6556
+ height: "auto",
6557
+ role: "primary",
6558
+ animation: {
6559
+ in: "slide-right",
6560
+ out: "fade",
6561
+ inDuration: 0.5,
6562
+ outDuration: 0.3,
6563
+ hold: "full"
6564
+ }
6565
+ }
6566
+ ]
6567
+ },
6568
+ {
6569
+ id: "minimal-editorial-title",
6570
+ label: "Minimalist Editorial Layout",
6571
+ category: "minimal",
6572
+ duration: 4,
6573
+ canvasWidth: 1920,
6574
+ canvasHeight: 1080,
6575
+ layers: [
6576
+ {
6577
+ kind: "text",
6578
+ id: "min-title",
6579
+ content: "ESSENTIAL PERSPECTIVES",
6580
+ fontFamily: "Inter Variable",
6581
+ fontSize: 64,
6582
+ fontWeight: 300,
6583
+ letterSpacing: 8,
6584
+ color: "#ffffff",
6585
+ align: "center",
6586
+ x: 360,
6587
+ y: 470,
6588
+ width: 1200,
6589
+ height: 80,
6590
+ role: "primary",
6591
+ animation: {
6592
+ in: "fade",
6593
+ out: "fade",
6594
+ inDuration: 1,
6595
+ outDuration: 0.4,
6596
+ hold: "full"
6597
+ }
6598
+ },
6599
+ {
6600
+ kind: "text",
6601
+ id: "min-sub",
6602
+ content: "Volume 01 \u2014 Issue 2026",
6603
+ fontFamily: "Inter Variable",
6604
+ fontSize: 22,
6605
+ fontWeight: 500,
6606
+ letterSpacing: 4,
6607
+ color: "#94a3b8",
6608
+ align: "center",
6609
+ x: 460,
6610
+ y: 560,
6611
+ width: 1e3,
6612
+ height: 40,
6613
+ role: "secondary",
6614
+ animation: {
6615
+ in: "fade",
6616
+ out: "fade",
6617
+ inDuration: 1.2,
6618
+ outDuration: 0.4,
6619
+ hold: "full"
6620
+ }
6621
+ }
6622
+ ]
6135
6623
  }
6136
6624
  ];
6137
6625
  function getCanvasTemplatePreset(id) {
@@ -7636,6 +8124,13 @@ function resolveConform(conform, canvasWidth, canvasHeight) {
7636
8124
  if (!sw || !sh) {
7637
8125
  return { x: 0, y: 0, width: canvasWidth, height: canvasHeight };
7638
8126
  }
8127
+ if (mode === "stretch") {
8128
+ const width2 = canvasWidth * userScale;
8129
+ const height2 = canvasHeight * userScale;
8130
+ const x2 = (canvasWidth - width2) / 2 + userOffsetX;
8131
+ const y2 = (canvasHeight - height2) / 2 + userOffsetY;
8132
+ return { x: x2, y: y2, width: width2, height: height2 };
8133
+ }
7639
8134
  let baseScale;
7640
8135
  switch (mode) {
7641
8136
  case "fit":
@@ -17134,6 +17629,8 @@ export {
17134
17629
  resolveMediaLayout,
17135
17630
  resolveNodeForBreakpoint,
17136
17631
  resolveSpatialConstraints,
17632
+ resolveTemplateControlValues,
17633
+ resolveTemplateFontFamily,
17137
17634
  resolveTextTemplateArtifact,
17138
17635
  restoreLetterSpacing,
17139
17636
  rgbaToComponents,