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