appshot-cli 1.0.2 → 2.0.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.
Files changed (151) hide show
  1. package/README.md +300 -559
  2. package/dist/cli.js +5 -3
  3. package/dist/cli.js.map +1 -1
  4. package/dist/commands/backgrounds.d.ts.map +1 -1
  5. package/dist/commands/backgrounds.js +164 -9
  6. package/dist/commands/backgrounds.js.map +1 -1
  7. package/dist/commands/build.d.ts.map +1 -1
  8. package/dist/commands/build.js +154 -54
  9. package/dist/commands/build.js.map +1 -1
  10. package/dist/commands/caption.d.ts.map +1 -1
  11. package/dist/commands/caption.js +350 -6
  12. package/dist/commands/caption.js.map +1 -1
  13. package/dist/commands/check.d.ts.map +1 -1
  14. package/dist/commands/check.js +174 -97
  15. package/dist/commands/check.js.map +1 -1
  16. package/dist/commands/clean.d.ts.map +1 -1
  17. package/dist/commands/clean.js +16 -0
  18. package/dist/commands/clean.js.map +1 -1
  19. package/dist/commands/fonts.d.ts.map +1 -1
  20. package/dist/commands/fonts.js +44 -26
  21. package/dist/commands/fonts.js.map +1 -1
  22. package/dist/commands/gradients.d.ts.map +1 -1
  23. package/dist/commands/gradients.js +32 -15
  24. package/dist/commands/gradients.js.map +1 -1
  25. package/dist/commands/init.d.ts.map +1 -1
  26. package/dist/commands/init.js +18 -16
  27. package/dist/commands/init.js.map +1 -1
  28. package/dist/commands/migrate.d.ts.map +1 -1
  29. package/dist/commands/migrate.js +51 -104
  30. package/dist/commands/migrate.js.map +1 -1
  31. package/dist/commands/preset.d.ts.map +1 -1
  32. package/dist/commands/preset.js +16 -14
  33. package/dist/commands/preset.js.map +1 -1
  34. package/dist/commands/presets.d.ts.map +1 -1
  35. package/dist/commands/presets.js +15 -0
  36. package/dist/commands/presets.js.map +1 -1
  37. package/dist/commands/quickstart.d.ts.map +1 -1
  38. package/dist/commands/quickstart.js +40 -53
  39. package/dist/commands/quickstart.js.map +1 -1
  40. package/dist/commands/style.d.ts.map +1 -1
  41. package/dist/commands/style.js +101 -57
  42. package/dist/commands/style.js.map +1 -1
  43. package/dist/commands/template.d.ts.map +1 -1
  44. package/dist/commands/template.js +68 -80
  45. package/dist/commands/template.js.map +1 -1
  46. package/dist/commands/validate.d.ts.map +1 -1
  47. package/dist/commands/validate.js +141 -0
  48. package/dist/commands/validate.js.map +1 -1
  49. package/dist/commands/wizard.d.ts +25 -0
  50. package/dist/commands/wizard.d.ts.map +1 -0
  51. package/dist/commands/wizard.js +366 -0
  52. package/dist/commands/wizard.js.map +1 -0
  53. package/dist/core/compose.d.ts +60 -1
  54. package/dist/core/compose.d.ts.map +1 -1
  55. package/dist/core/compose.js +150 -0
  56. package/dist/core/compose.js.map +1 -1
  57. package/dist/core/device-strategies/index.d.ts +8 -0
  58. package/dist/core/device-strategies/index.d.ts.map +1 -0
  59. package/dist/core/device-strategies/index.js +22 -0
  60. package/dist/core/device-strategies/index.js.map +1 -0
  61. package/dist/core/device-strategies/ipad.d.ts +3 -0
  62. package/dist/core/device-strategies/ipad.d.ts.map +1 -0
  63. package/dist/core/device-strategies/ipad.js +13 -0
  64. package/dist/core/device-strategies/ipad.js.map +1 -0
  65. package/dist/core/device-strategies/iphone.d.ts +3 -0
  66. package/dist/core/device-strategies/iphone.d.ts.map +1 -0
  67. package/dist/core/device-strategies/iphone.js +13 -0
  68. package/dist/core/device-strategies/iphone.js.map +1 -0
  69. package/dist/core/device-strategies/mac.d.ts +3 -0
  70. package/dist/core/device-strategies/mac.d.ts.map +1 -0
  71. package/dist/core/device-strategies/mac.js +13 -0
  72. package/dist/core/device-strategies/mac.js.map +1 -0
  73. package/dist/core/device-strategies/watch.d.ts +3 -0
  74. package/dist/core/device-strategies/watch.d.ts.map +1 -0
  75. package/dist/core/device-strategies/watch.js +13 -0
  76. package/dist/core/device-strategies/watch.js.map +1 -0
  77. package/dist/core/files.d.ts +3 -3
  78. package/dist/core/files.d.ts.map +1 -1
  79. package/dist/core/files.js.map +1 -1
  80. package/dist/core/layouts/device-fit.d.ts +10 -0
  81. package/dist/core/layouts/device-fit.d.ts.map +1 -0
  82. package/dist/core/layouts/device-fit.js +18 -0
  83. package/dist/core/layouts/device-fit.js.map +1 -0
  84. package/dist/core/layouts/index.d.ts +4 -0
  85. package/dist/core/layouts/index.d.ts.map +1 -0
  86. package/dist/core/layouts/index.js +4 -0
  87. package/dist/core/layouts/index.js.map +1 -0
  88. package/dist/core/layouts/math.d.ts +23 -0
  89. package/dist/core/layouts/math.d.ts.map +1 -0
  90. package/dist/core/layouts/math.js +63 -0
  91. package/dist/core/layouts/math.js.map +1 -0
  92. package/dist/core/layouts/text-layout.d.ts +10 -0
  93. package/dist/core/layouts/text-layout.d.ts.map +1 -0
  94. package/dist/core/layouts/text-layout.js +60 -0
  95. package/dist/core/layouts/text-layout.js.map +1 -0
  96. package/dist/mcp/cli-options.d.ts +15 -0
  97. package/dist/mcp/cli-options.d.ts.map +1 -1
  98. package/dist/mcp/cli-options.js +16 -0
  99. package/dist/mcp/cli-options.js.map +1 -1
  100. package/dist/mcp/server.d.ts.map +1 -1
  101. package/dist/mcp/server.js +268 -52
  102. package/dist/mcp/server.js.map +1 -1
  103. package/dist/services/caption-enhancement.d.ts +32 -0
  104. package/dist/services/caption-enhancement.d.ts.map +1 -0
  105. package/dist/services/caption-enhancement.js +156 -0
  106. package/dist/services/caption-enhancement.js.map +1 -0
  107. package/dist/services/compose-bridge.d.ts +3 -3
  108. package/dist/services/compose-bridge.d.ts.map +1 -1
  109. package/dist/services/compose-bridge.js +64 -21
  110. package/dist/services/compose-bridge.js.map +1 -1
  111. package/dist/services/doctor.d.ts.map +1 -1
  112. package/dist/services/doctor.js +13 -2
  113. package/dist/services/doctor.js.map +1 -1
  114. package/dist/services/translation.d.ts +8 -0
  115. package/dist/services/translation.d.ts.map +1 -1
  116. package/dist/services/translation.js +117 -29
  117. package/dist/services/translation.js.map +1 -1
  118. package/dist/services/watch-service.d.ts.map +1 -1
  119. package/dist/services/watch-service.js.map +1 -1
  120. package/dist/templates/registry.d.ts +18 -59
  121. package/dist/templates/registry.d.ts.map +1 -1
  122. package/dist/templates/registry.js +138 -500
  123. package/dist/templates/registry.js.map +1 -1
  124. package/dist/types.d.ts +35 -0
  125. package/dist/types.d.ts.map +1 -1
  126. package/dist/utils/config-migration.d.ts +7 -0
  127. package/dist/utils/config-migration.d.ts.map +1 -0
  128. package/dist/utils/config-migration.js +58 -0
  129. package/dist/utils/config-migration.js.map +1 -0
  130. package/dist/utils/config-version.d.ts +5 -0
  131. package/dist/utils/config-version.d.ts.map +1 -0
  132. package/dist/utils/config-version.js +10 -0
  133. package/dist/utils/config-version.js.map +1 -0
  134. package/dist/utils/language.d.ts +2 -2
  135. package/dist/utils/language.d.ts.map +1 -1
  136. package/dist/utils/language.js +1 -1
  137. package/dist/utils/language.js.map +1 -1
  138. package/dist/utils/spinner.d.ts +21 -0
  139. package/dist/utils/spinner.d.ts.map +1 -0
  140. package/dist/utils/spinner.js +60 -0
  141. package/dist/utils/spinner.js.map +1 -0
  142. package/dist/utils/v2-banner.d.ts +2 -0
  143. package/dist/utils/v2-banner.d.ts.map +1 -0
  144. package/dist/utils/v2-banner.js +14 -0
  145. package/dist/utils/v2-banner.js.map +1 -0
  146. package/dist/utils/validation.d.ts.map +1 -1
  147. package/dist/utils/validation.js +4 -3
  148. package/dist/utils/validation.js.map +1 -1
  149. package/package.json +1 -1
  150. package/skill/SKILL.md +5 -1
  151. package/skill/references/templates.md +26 -0
@@ -1,587 +1,233 @@
1
1
  /**
2
- * Template Registry for App Store Screenshots
2
+ * v2 Template Registry for App Store Screenshots
3
3
  *
4
- * Each template includes a complete visual style preset with:
5
- * - Background (gradient or image configuration)
6
- * - Device positioning and scale
7
- * - Caption placement and styling
8
- * - Device-specific optimizations
4
+ * Templates map to fixed v2 layouts (header/footer/screenshot-only)
5
+ * and background + caption appearance only.
9
6
  */
10
- // Template definitions
11
7
  export const templates = [
12
8
  {
13
- id: 'modern',
14
- name: 'Modern Vibrant',
15
- description: 'Eye-catching gradient with floating device and clean captions',
9
+ id: 'ocean-header',
10
+ name: 'Ocean Header',
11
+ description: 'Cool blue gradient with header caption layout',
16
12
  category: 'modern',
13
+ layout: 'header',
17
14
  background: {
18
15
  mode: 'gradient',
19
16
  gradient: {
20
- colors: ['#667eea', '#764ba2', '#f093fb'],
21
- direction: 'diagonal'
22
- }
23
- },
24
- deviceStyle: {
25
- frameScale: 0.85,
26
- framePosition: 50 // Centered
27
- },
28
- captionStyle: {
29
- font: 'SF Pro Display',
30
- fontsize: 64,
31
- color: '#021d2f',
32
- position: 'above',
33
- align: 'center',
34
- box: {
35
- autoSize: true,
36
- maxLines: 3,
37
- lineHeight: 1.4,
38
- marginTop: 20,
39
- marginBottom: 20
17
+ colors: ['#00C6FB', '#005BEA'],
18
+ direction: 'top-bottom'
40
19
  }
41
20
  },
42
- deviceOverrides: {
43
- mac: {
44
- frameScale: 0.9,
45
- framePosition: 25
46
- },
47
- iphone: {
48
- // Add sensible top clearance for 'above' captions on iPhone
49
- captionBox: { marginTop: 56 },
50
- captionSize: 72
51
- },
52
- watch: {
53
- frameScale: 0.9,
54
- framePosition: 100,
55
- partialFrame: true,
56
- frameOffset: 17,
57
- captionSize: 24,
58
- captionPosition: 'above',
59
- captionBox: {
60
- marginBottom: 8,
61
- marginTop: 18,
62
- autoSize: true,
63
- lineHeight: 1.4,
64
- maxLines: 2
65
- }
66
- },
67
- ipad: {
68
- frameScale: 0.90,
69
- framePosition: 60
70
- }
21
+ caption: {
22
+ font: 'SF Pro Display Bold',
23
+ color: '#FFFFFF'
71
24
  }
72
25
  },
73
26
  {
74
- id: 'minimal',
75
- name: 'Minimal Clean',
76
- description: 'Soft pastel background with elegant typography',
77
- category: 'minimal',
27
+ id: 'sunset-footer',
28
+ name: 'Sunset Footer',
29
+ description: 'Warm sunset gradient with footer caption layout',
30
+ category: 'bold',
31
+ layout: 'footer',
78
32
  background: {
79
33
  mode: 'gradient',
80
34
  gradient: {
81
- colors: ['#ffecd2', '#fcb69f'],
35
+ colors: ['#FF5F6D', '#FFC371'],
82
36
  direction: 'top-bottom'
83
37
  }
84
38
  },
85
- deviceStyle: {
86
- frameScale: 0.95,
87
- framePosition: 50 // Lower position
88
- },
89
- captionStyle: {
90
- font: 'Helvetica Neue',
91
- fontsize: 56,
92
- color: '#1b2a3a',
93
- position: 'above',
94
- align: 'center',
95
- box: {
96
- autoSize: true,
97
- maxLines: 2,
98
- lineHeight: 1.3,
99
- marginTop: 40,
100
- marginBottom: 0
39
+ caption: {
40
+ font: 'SF Pro Display Bold',
41
+ color: '#1B1B1B'
42
+ }
43
+ },
44
+ {
45
+ id: 'clean-screenshot',
46
+ name: 'Clean Screenshot',
47
+ description: 'Minimal background with screenshot-only layout',
48
+ category: 'clean',
49
+ layout: 'screenshot-only',
50
+ background: {
51
+ mode: 'gradient',
52
+ gradient: {
53
+ colors: ['#F5F7FA', '#C3CFE2'],
54
+ direction: 'top-bottom'
101
55
  }
102
56
  },
103
- deviceOverrides: {
104
- iphone: {
105
- frameScale: 0.95,
106
- framePosition: 50,
107
- captionBox: { marginTop: 56 },
108
- captionSize: 64
109
- },
110
- watch: {
111
- frameScale: 0.85,
112
- framePosition: 0,
113
- captionSize: 22,
114
- captionPosition: 'below',
115
- captionBox: {
116
- marginTop: 36,
117
- marginBottom: 12,
118
- autoSize: true,
119
- lineHeight: 1.4,
120
- maxLines: 2
121
- }
122
- },
123
- ipad: {
124
- frameScale: 0.90,
125
- framePosition: 50
126
- }, mac: {
127
- frameScale: 0.90,
128
- framePosition: 25
129
- }
57
+ caption: {
58
+ font: 'SF Pro Display Bold',
59
+ color: '#111111'
130
60
  }
131
61
  },
132
62
  {
133
- id: 'bold',
134
- name: 'Bold Impact',
135
- description: 'Dark dramatic gradient with large device and overlay captions',
136
- category: 'bold',
63
+ id: 'pastel-header',
64
+ name: 'Pastel Header',
65
+ description: 'Soft pastel tones with header caption layout',
66
+ category: 'minimal',
67
+ layout: 'header',
137
68
  background: {
138
69
  mode: 'gradient',
139
70
  gradient: {
140
- colors: ['#0f0c29', '#302b63', '#24243e'],
141
- direction: 'diagonal'
71
+ colors: ['#FFEECC', '#FFD6C2'],
72
+ direction: 'top-bottom'
142
73
  }
143
74
  },
144
- deviceStyle: {
145
- frameScale: 0.9,
146
- framePosition: 10 // Centered-high position
147
- },
148
- captionStyle: {
149
- font: 'SF Pro Display',
150
- fontsize: 64,
151
- color: '#FFFFFF',
152
- position: 'overlay',
153
- align: 'center'
154
- },
155
- deviceOverrides: {
156
- mac: {
157
- frameScale: 0.90,
158
- framePosition: 0,
159
- captionBox: {
160
- marginTop: 0,
161
- marginBottom: 20
162
- }
163
- },
164
- iphone: {
165
- frameScale: 0.90,
166
- framePosition: 20,
167
- captionBox: {
168
- marginTop: 0,
169
- marginBottom: 20
170
- },
171
- captionSize: 72
172
- },
173
- ipad: {
174
- frameScale: 0.90,
175
- framePosition: 25,
176
- captionBox: {
177
- marginTop: 0,
178
- marginBottom: 20
179
- }
180
- },
181
- watch: {
182
- frameScale: 0.9,
183
- framePosition: 0,
184
- partialFrame: true,
185
- frameOffset: 17,
186
- captionBox: {
187
- marginBottom: 10,
188
- lineHeight: 1.4,
189
- maxLines: 2
190
- }
191
- }
75
+ caption: {
76
+ font: 'Helvetica Neue Bold',
77
+ color: '#1B2A3A'
192
78
  }
193
79
  },
194
80
  {
195
- id: 'nerdy',
196
- name: 'Nerdy OSS',
197
- description: 'Grid-lined midnight background with JetBrains Mono captions',
81
+ id: 'noir-footer',
82
+ name: 'Noir Footer',
83
+ description: 'Dark dramatic gradient with footer caption layout',
198
84
  category: 'bold',
85
+ layout: 'footer',
199
86
  background: {
200
- mode: 'auto'
201
- },
202
- deviceStyle: {
203
- frameScale: 0.9,
204
- framePosition: 12
205
- },
206
- captionStyle: {
207
- font: 'JetBrains Mono Bold',
208
- fontsize: 60,
209
- color: '#7CFFCB',
210
- position: 'overlay',
211
- align: 'center',
212
- box: {
213
- marginBottom: 32
87
+ mode: 'gradient',
88
+ gradient: {
89
+ colors: ['#0F0C29', '#302B63', '#24243E'],
90
+ direction: 'diagonal'
214
91
  }
215
92
  },
216
- deviceOverrides: {
217
- mac: {
218
- frameScale: 0.9,
219
- framePosition: 8,
220
- captionBox: {
221
- marginTop: 0,
222
- marginBottom: 24
223
- }
224
- },
225
- iphone: {
226
- frameScale: 0.9,
227
- framePosition: 18,
228
- captionBox: {
229
- marginTop: 12,
230
- marginBottom: 24
231
- },
232
- captionSize: 70
233
- },
234
- ipad: {
235
- frameScale: 0.9,
236
- framePosition: 20,
237
- captionBox: {
238
- marginTop: 16,
239
- marginBottom: 24
240
- }
241
- },
242
- watch: {
243
- frameScale: 0.96,
244
- framePosition: 0,
245
- partialFrame: true,
246
- frameOffset: 17,
247
- captionSize: 26,
248
- captionPosition: 'below',
249
- captionBox: {
250
- marginTop: 14,
251
- marginBottom: 16,
252
- autoSize: true,
253
- lineHeight: 1.4,
254
- maxLines: 2
255
- }
256
- }
93
+ caption: {
94
+ font: 'SF Pro Display Bold',
95
+ color: '#FFFFFF'
257
96
  }
258
97
  },
259
98
  {
260
- id: 'elegant',
261
- name: 'Elegant Professional',
262
- description: 'Sophisticated monochrome with floating device',
99
+ id: 'silver-header',
100
+ name: 'Silver Header',
101
+ description: 'Elegant silver gradient with header caption layout',
263
102
  category: 'elegant',
103
+ layout: 'header',
264
104
  background: {
265
105
  mode: 'gradient',
266
106
  gradient: {
267
- colors: ['#8e9eab', '#eef2f3'],
107
+ colors: ['#E5E5E5', '#BFBFBF'],
268
108
  direction: 'top-bottom'
269
109
  }
270
110
  },
271
- deviceStyle: {
272
- frameScale: 0.95,
273
- framePosition: 50
274
- },
275
- captionStyle: {
276
- font: 'Georgia',
277
- fontsize: 68,
278
- color: '#132235',
279
- position: 'below',
280
- align: 'center',
281
- box: {
282
- autoSize: true,
283
- maxLines: 2,
284
- lineHeight: 1.5,
285
- marginTop: 0,
286
- marginBottom: 60
287
- }
288
- },
289
- deviceOverrides: {
290
- iphone: {
291
- frameScale: 0.9,
292
- framePosition: 50,
293
- captionBox: { marginBottom: 60 },
294
- captionSize: 76
295
- },
296
- mac: {
297
- frameScale: 0.9,
298
- framePosition: 0
299
- },
300
- watch: {
301
- frameScale: 0.80,
302
- framePosition: 25,
303
- captionSize: 20,
304
- captionPosition: 'below',
305
- captionBox: {
306
- marginTop: 0,
307
- marginBottom: 0
308
- }
309
- },
310
- ipad: {
311
- frameScale: 0.90,
312
- framePosition: 25
313
- }
111
+ caption: {
112
+ font: 'New York Bold',
113
+ color: '#111111'
314
114
  }
315
115
  },
316
116
  {
317
- id: 'showcase',
318
- name: 'Showcase',
319
- description: 'Feature your app with custom backgrounds',
320
- category: 'professional',
117
+ id: 'tropical-header',
118
+ name: 'Tropical Header',
119
+ description: 'Bright tropical gradient with header caption layout',
120
+ category: 'playful',
121
+ layout: 'header',
321
122
  background: {
322
- mode: 'auto', // Will auto-detect background.png
323
- fallback: 'gradient',
123
+ mode: 'gradient',
324
124
  gradient: {
325
- colors: ['#4facfe', '#00f2fe'],
326
- direction: 'left-right'
327
- }
328
- },
329
- deviceStyle: {
330
- frameScale: 0.90,
331
- framePosition: 50
332
- },
333
- captionStyle: {
334
- font: 'SF Pro Display',
335
- fontsize: 64,
336
- color: '#FFFFFF',
337
- position: 'above',
338
- align: 'center',
339
- box: {
340
- autoSize: true,
341
- maxLines: 3,
342
- lineHeight: 1.4,
343
- marginTop: 30,
344
- marginBottom: 10
125
+ colors: ['#43CEA2', '#185A9D'],
126
+ direction: 'top-bottom'
345
127
  }
346
128
  },
347
- deviceOverrides: {
348
- mac: {
349
- frameScale: 0.90,
350
- framePosition: 50,
351
- captionBox: {
352
- marginTop: 20,
353
- marginBottom: 0
354
- }
355
- },
356
- watch: {
357
- frameScale: 0.75,
358
- framePosition: 95,
359
- captionSize: 28,
360
- captionPosition: 'above',
361
- captionBox: {
362
- marginTop: 10,
363
- marginBottom: 0
364
- }
365
- },
366
- ipad: {
367
- frameScale: 0.85,
368
- framePosition: 50,
369
- captionBox: {
370
- marginTop: 10,
371
- marginBottom: 0
372
- }
373
- }, iphone: {
374
- frameScale: 0.9,
375
- framePosition: 50,
376
- captionBox: { marginTop: 20 },
377
- captionSize: 72
378
- }
129
+ caption: {
130
+ font: 'SF Pro Display Bold',
131
+ color: '#FFFFFF'
379
132
  }
380
133
  },
381
134
  {
382
- id: 'playful',
383
- name: 'Playful Energy',
384
- description: 'Bright, fun gradients perfect for games and entertainment apps',
385
- category: 'playful',
135
+ id: 'slate-footer',
136
+ name: 'Slate Footer',
137
+ description: 'Professional slate gradient with footer caption layout',
138
+ category: 'professional',
139
+ layout: 'footer',
386
140
  background: {
387
141
  mode: 'gradient',
388
142
  gradient: {
389
- colors: ['#fa709a', '#fee140', '#fa709a'],
390
- direction: 'diagonal'
391
- }
392
- },
393
- deviceStyle: {
394
- frameScale: 0.95,
395
- framePosition: 60
396
- },
397
- captionStyle: {
398
- font: 'SF Pro Display',
399
- fontsize: 68,
400
- color: '#FFFFFF',
401
- position: 'above',
402
- align: 'center',
403
- box: {
404
- autoSize: true,
405
- maxLines: 2,
406
- lineHeight: 1.3,
407
- marginTop: 0,
408
- marginBottom: 0
143
+ colors: ['#2C3E50', '#4CA1AF'],
144
+ direction: 'top-bottom'
409
145
  }
410
146
  },
411
- deviceOverrides: {
412
- mac: {
413
- frameScale: 0.90,
414
- framePosition: 25,
415
- captionBox: {
416
- marginTop: 20,
417
- marginBottom: 0
418
- }
419
- },
420
- iphone: {
421
- frameScale: 0.9,
422
- framePosition: 50,
423
- captionBox: { marginTop: 56 },
424
- captionSize: 76
425
- },
426
- watch: {
427
- frameScale: 0.75,
428
- framePosition: 40,
429
- captionSize: 24,
430
- captionPosition: 'below',
431
- captionBox: {
432
- marginTop: 0
433
- }
434
- },
435
- ipad: {
436
- frameScale: 0.90,
437
- framePosition: 50,
438
- captionBox: {
439
- marginTop: 20,
440
- marginBottom: 0
441
- }
442
- }
147
+ caption: {
148
+ font: 'SF Pro Display Bold',
149
+ color: '#FFFFFF'
443
150
  }
444
151
  },
445
152
  {
446
- id: 'corporate',
447
- name: 'Corporate Professional',
448
- description: 'Clean, professional look for business and productivity apps',
153
+ id: 'midnight-header',
154
+ name: 'Midnight Header',
155
+ description: 'Deep blue gradient with header caption layout',
449
156
  category: 'professional',
157
+ layout: 'header',
450
158
  background: {
451
159
  mode: 'gradient',
452
160
  gradient: {
453
- colors: ['#0077BE', '#33CCCC'],
161
+ colors: ['#0F2027', '#2C5364'],
454
162
  direction: 'top-bottom'
455
163
  }
456
164
  },
457
- deviceStyle: {
458
- frameScale: 0.85,
459
- framePosition: 50
460
- },
461
- captionStyle: {
462
- font: 'Helvetica',
463
- fontsize: 54,
464
- color: '#0f1e2d',
465
- position: 'above',
466
- align: 'center',
467
- box: {
468
- autoSize: true,
469
- maxLines: 3,
470
- lineHeight: 1.4,
471
- marginTop: 50,
472
- marginBottom: 20
473
- }
474
- },
475
- deviceOverrides: {
476
- mac: {
477
- frameScale: 0.90,
478
- framePosition: 25
479
- },
480
- iphone: {
481
- captionSize: 64
482
- },
483
- watch: {
484
- frameScale: 0.80,
485
- framePosition: 75,
486
- captionSize: 18,
487
- captionBox: {
488
- marginTop: 12,
489
- marginBottom: 12,
490
- lineHeight: 1.4,
491
- maxLines: 2
492
- }
493
- }
165
+ caption: {
166
+ font: 'SF Pro Display Bold',
167
+ color: '#FFFFFF'
494
168
  }
495
169
  }
496
170
  ];
497
- /**
498
- * Get template by ID
499
- */
171
+ export const legacyTemplateAliases = {
172
+ modern: 'ocean-header',
173
+ minimal: 'pastel-header',
174
+ bold: 'noir-footer',
175
+ elegant: 'silver-header',
176
+ showcase: 'clean-screenshot',
177
+ playful: 'tropical-header',
178
+ corporate: 'slate-footer',
179
+ nerdy: 'midnight-header'
180
+ };
181
+ export function resolveTemplateId(id) {
182
+ const alias = legacyTemplateAliases[id];
183
+ if (alias) {
184
+ return { id: alias, isAlias: true };
185
+ }
186
+ return { id, isAlias: false };
187
+ }
500
188
  export function getTemplate(id) {
501
189
  return templates.find(t => t.id === id);
502
190
  }
503
- /**
504
- * Get templates by category
505
- */
506
191
  export function getTemplatesByCategory(category) {
507
192
  return templates.filter(t => t.category === category);
508
193
  }
509
- /**
510
- * Get all template categories
511
- */
512
194
  export function getTemplateCategories() {
513
195
  return [...new Set(templates.map(t => t.category))];
514
196
  }
515
- /**
516
- * Apply template to configuration
517
- */
518
197
  export function applyTemplateToConfig(templateId, existingConfig) {
519
198
  const template = getTemplate(templateId);
520
199
  if (!template) {
521
200
  throw new Error(`Template "${templateId}" not found`);
522
201
  }
523
- // Start with existing config
524
- const config = { ...existingConfig };
525
- // Apply background
526
- config.background = template.background;
527
- const templateCaptionStyle = template.captionStyle || {};
528
- const captionBackgroundProvided = Object.prototype.hasOwnProperty.call(templateCaptionStyle, 'background');
529
- const captionBorderProvided = Object.prototype.hasOwnProperty.call(templateCaptionStyle, 'border');
530
- // Apply caption style (respect explicit zeros via nullish coalescing)
531
- const mergedCaption = {
532
- ...(config.caption || {}),
533
- ...templateCaptionStyle,
534
- paddingTop: templateCaptionStyle.paddingTop ?? (config.caption?.paddingTop ?? 100),
535
- paddingBottom: templateCaptionStyle.paddingBottom ?? (config.caption?.paddingBottom ?? 60)
202
+ const base = {
203
+ version: 2,
204
+ layout: template.layout,
205
+ caption: {
206
+ font: template.caption.font || 'SF Pro Display Bold',
207
+ color: template.caption.color || '#FFFFFF',
208
+ background: template.caption.background
209
+ },
210
+ background: template.background,
211
+ devices: {},
212
+ output: existingConfig.output || './final',
213
+ frames: existingConfig.frames || './frames'
536
214
  };
537
- if (!captionBackgroundProvided) {
538
- delete mergedCaption.background;
539
- }
540
- if (!captionBorderProvided) {
541
- delete mergedCaption.border;
542
- }
543
- config.caption = mergedCaption;
544
- // Apply device styles
545
- if (config.devices) {
546
- for (const [deviceName, deviceConfig] of Object.entries(config.devices)) {
547
- const override = template.deviceOverrides?.[deviceName];
548
- // Apply base device style
549
- const mergedDevice = {
550
- ...deviceConfig,
551
- frameScale: template.deviceStyle.frameScale,
552
- framePosition: template.deviceStyle.framePosition,
553
- partialFrame: template.deviceStyle.partialFrame,
554
- frameOffset: template.deviceStyle.frameOffset,
555
- captionPosition: template.captionStyle.position,
556
- ...override // Apply device-specific overrides
557
- };
558
- const overrideHasBackground = !!override && Object.prototype.hasOwnProperty.call(override, 'captionBackground');
559
- const overrideHasBorder = !!override && Object.prototype.hasOwnProperty.call(override, 'captionBorder');
560
- if (!overrideHasBackground) {
561
- delete mergedDevice.captionBackground;
562
- }
563
- if (!overrideHasBorder) {
564
- delete mergedDevice.captionBorder;
565
- }
566
- // Ensure template font size changes take effect:
567
- // If the template did NOT provide a per-device captionSize override,
568
- // remove any existing device-level captionSize so compose.ts falls back
569
- // to the template/global caption.fontsize.
570
- if (!override || override.captionSize === undefined) {
571
- delete mergedDevice.captionSize;
572
- }
573
- config.devices[deviceName] = mergedDevice;
574
- }
215
+ const devices = existingConfig.devices || {};
216
+ const mergedDevices = {};
217
+ for (const [key, value] of Object.entries(devices)) {
218
+ mergedDevices[key] = value;
575
219
  }
576
- return config;
220
+ base.devices = mergedDevices;
221
+ base.layout = template.layout;
222
+ base.background = template.background;
223
+ base.caption = {
224
+ ...base.caption,
225
+ ...template.caption
226
+ };
227
+ return base;
577
228
  }
578
- /**
579
- * Generate caption suggestions for a template
580
- */
581
- export function getTemplateCaptionSuggestions(templateId) {
582
- const template = getTemplate(templateId);
583
- // Default suggestions if template doesn't have specific ones
584
- const defaults = {
229
+ export function getTemplateCaptionSuggestions(_templateId) {
230
+ return {
585
231
  hero: [
586
232
  'Powerful Features, Beautiful Design',
587
233
  'Everything You Need in One App',
@@ -602,13 +248,5 @@ export function getTemplateCaptionSuggestions(templateId) {
602
248
  'Join Millions of Users'
603
249
  ]
604
250
  };
605
- if (template?.captionSuggestions) {
606
- return {
607
- hero: template.captionSuggestions.hero || defaults.hero,
608
- features: template.captionSuggestions.features || defaults.features,
609
- cta: template.captionSuggestions.cta || defaults.cta
610
- };
611
- }
612
- return defaults;
613
251
  }
614
252
  //# sourceMappingURL=registry.js.map