@cardanvil/frame-kit 0.4.0 → 0.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.
Files changed (46) hide show
  1. package/README.md +45 -0
  2. package/dist/cli/main.js +16 -0
  3. package/dist/cli/sourceWatcher.d.ts +40 -0
  4. package/dist/cli/sourceWatcher.js +100 -0
  5. package/dist/cli/studio/boxSets.d.ts +33 -0
  6. package/dist/cli/studio/boxSets.js +87 -0
  7. package/dist/cli/studio/edit/applyEdits.d.ts +71 -0
  8. package/dist/cli/studio/edit/applyEdits.js +177 -0
  9. package/dist/cli/studio/edit/impact.d.ts +53 -0
  10. package/dist/cli/studio/edit/impact.js +87 -0
  11. package/dist/cli/studio/edit/resolveModule.d.ts +10 -0
  12. package/dist/cli/studio/edit/resolveModule.js +55 -0
  13. package/dist/cli/studio/edit/resolvePath.d.ts +53 -0
  14. package/dist/cli/studio/edit/resolvePath.js +606 -0
  15. package/dist/cli/studio/edit/sourceIndex.d.ts +29 -0
  16. package/dist/cli/studio/edit/sourceIndex.js +73 -0
  17. package/dist/cli/studio/edit/ts.d.ts +14 -0
  18. package/dist/cli/studio/edit/ts.js +34 -0
  19. package/dist/cli/studio/serve.d.ts +23 -0
  20. package/dist/cli/studio/serve.js +513 -0
  21. package/dist/cli/studio/session.d.ts +73 -0
  22. package/dist/cli/studio/session.js +154 -0
  23. package/dist/cli/watch.d.ts +3 -0
  24. package/dist/cli/watch.js +20 -89
  25. package/dist/layout/assetPlacement.d.ts +71 -0
  26. package/dist/layout/assetPlacement.js +104 -0
  27. package/dist/layout/decorations.d.ts +78 -0
  28. package/dist/layout/decorations.js +108 -0
  29. package/dist/layout/frameLayers.d.ts +136 -0
  30. package/dist/layout/frameLayers.js +291 -0
  31. package/dist/layout/index.d.ts +16 -0
  32. package/dist/layout/index.js +16 -0
  33. package/dist/layout/resolveFrameAsset.d.ts +31 -0
  34. package/dist/layout/resolveFrameAsset.js +58 -0
  35. package/dist/manifest/contract.d.ts +671 -1
  36. package/dist/manifest/contract.js +7 -1
  37. package/dist/schema/frame.d.ts +1692 -0
  38. package/dist/schema/frame.js +27 -0
  39. package/dist/schema/frameAssets.d.ts +3 -1
  40. package/dist/schema/frameAssets.js +23 -1
  41. package/dist/studio/assets/PlantinMTProRgIt-D0FB51kb.woff2 +0 -0
  42. package/dist/studio/assets/beleren-b-B3lFvodX.ttf +0 -0
  43. package/dist/studio/assets/beleren-bsc-yvL6mU7X.ttf +0 -0
  44. package/dist/studio/assets/index-CNzyV22G.js +76 -0
  45. package/dist/studio/index.html +12 -0
  46. package/package.json +12 -3
@@ -15,6 +15,12 @@ export const TextBoxSchema = BoundsSchema.extend({
15
15
  outlineWidth: z.number().optional(),
16
16
  verticalAlign: z.enum(["top", "center"]).optional(),
17
17
  textAlign: z.enum(["left", "center", "right"]).optional(),
18
+ /** Extra spacing between characters, in px (Konva `letterSpacing`),
19
+ * expressed at the box's own `fontSize` — each run scales it by its font
20
+ * size so it reads as constant tracking. Non-zero spacing switches Konva
21
+ * to per-character drawing with kerning off; the canvas measurement path
22
+ * mirrors that so measured widths match the render. */
23
+ letterSpacing: z.number().optional(),
18
24
  /** Per-box font family override. When set, the renderer uses this instead
19
25
  * of the language-resolved default (e.g. title font). */
20
26
  fontFamily: z.string().optional(),
@@ -23,6 +29,17 @@ export const TextBoxSchema = BoundsSchema.extend({
23
29
  * true when omitted (matches the original behavior). Set to false to
24
30
  * disable the shadow (e.g. flipside mana-cost badges on light backgrounds). */
25
31
  shadow: z.boolean().optional(),
32
+ /** Shaped-text mask: a full-canvas-sized PNG whose opaque pixels define the
33
+ * region text in this box may occupy. Alpha is what matters (any pixel with
34
+ * alpha > ~12% counts as inside), so color is irrelevant. Each wrapped line
35
+ * is measured against the mask's horizontal extent at the line's vertical
36
+ * band instead of the box's plain rectangle; lines are aligned/centered
37
+ * within that extent. The box still bounds everything: a mask region wider
38
+ * than the box is clamped to it, and a mask region narrower than the box
39
+ * shrinks the usable width. When the box has no width at a line's vertical
40
+ * position (the shape is absent there), the line falls back to the full box
41
+ * width. */
42
+ mask: AssetUrlSchema.optional(),
26
43
  });
27
44
  export const CardBoxesSchema = z.object({
28
45
  art: BoundsSchema,
@@ -144,25 +161,35 @@ export const defaultNicknameConfig = {
144
161
  x: 378,
145
162
  y: 577,
146
163
  };
164
+ /**
165
+ * A hint rendered under a template setting's control, for anything the label
166
+ * alone can't carry — what the setting changes, or when to reach for it.
167
+ * Optional everywhere; a setting without one renders exactly as before.
168
+ */
169
+ const helperText = z.string().optional();
147
170
  export const TemplateSettingConfigSchema = z.union([
148
171
  z.object({
149
172
  type: z.literal("boolean"),
150
173
  label: z.string(),
174
+ helperText,
151
175
  defaultValue: z.boolean(),
152
176
  }),
153
177
  z.object({
154
178
  type: z.literal("string"),
155
179
  label: z.string(),
180
+ helperText,
156
181
  defaultValue: z.string(),
157
182
  }),
158
183
  z.object({
159
184
  type: z.literal("number"),
160
185
  label: z.string(),
186
+ helperText,
161
187
  defaultValue: z.string(),
162
188
  }),
163
189
  z.object({
164
190
  type: z.literal("select"),
165
191
  label: z.string(),
192
+ helperText,
166
193
  defaultValue: z.string(),
167
194
  options: z.array(z.string()),
168
195
  }),
@@ -505,13 +505,15 @@ export type FrameAssets = z.infer<typeof FrameAssetsSchema>;
505
505
  /**
506
506
  * Section masks the renderer actually reads. `rightHalf` overrides the global
507
507
  * default (`globalMasks.rightHalf`) when a layout ships its own. The legacy
508
- * `frame`/`border` mask keys are intentionally absent — nothing reads them.
508
+ * `frame` mask key is intentionally absent — nothing reads it.
509
509
  */
510
510
  export declare const LayoutMasksSchema: z.ZodObject<{
511
511
  pinlines: z.ZodOptional<z.ZodString>;
512
512
  titleAndType: z.ZodOptional<z.ZodString>;
513
513
  rules: z.ZodOptional<z.ZodString>;
514
514
  noBorder: z.ZodOptional<z.ZodString>;
515
+ border: z.ZodOptional<z.ZodString>;
516
+ borderFull: z.ZodOptional<z.ZodString>;
515
517
  legendary: z.ZodOptional<z.ZodString>;
516
518
  legendaryTransform: z.ZodOptional<z.ZodString>;
517
519
  noBorderTransform: z.ZodOptional<z.ZodString>;
@@ -149,13 +149,35 @@ export const FrameAssetsSchema = z.object({
149
149
  /**
150
150
  * Section masks the renderer actually reads. `rightHalf` overrides the global
151
151
  * default (`globalMasks.rightHalf`) when a layout ships its own. The legacy
152
- * `frame`/`border` mask keys are intentionally absent — nothing reads them.
152
+ * `frame` mask key is intentionally absent — nothing reads it.
153
153
  */
154
154
  export const LayoutMasksSchema = z.object({
155
155
  pinlines: AssetUrlSchema.optional(),
156
156
  titleAndType: AssetUrlSchema.optional(),
157
157
  rules: AssetUrlSchema.optional(),
158
158
  noBorder: AssetUrlSchema.optional(),
159
+ /**
160
+ * Alpha mask opaque only over the outer border ring itself (everything
161
+ * else — art, text boxes, and the framing surface between them —
162
+ * transparent). Clipped via `destination-in` to isolate the ring's shape
163
+ * so the global border-color setting can recolor just that ring. Distinct
164
+ * from `noBorder`, which cuts the internal framing band too for the
165
+ * extended-art trim — the two are not interchangeable.
166
+ */
167
+ border: AssetUrlSchema.optional(),
168
+ /**
169
+ * Full-coverage variant of `border`, opaque over the whole outer ring
170
+ * including the strip the collector line sits on.
171
+ *
172
+ * A frame ships this only when its plain `border` mask deliberately covers
173
+ * *less* than the whole ring — m15's stops short of the collector strip, so
174
+ * that the default border recolor leaves the collector line on its original
175
+ * black. Declaring `borderFull` is therefore also what tells the renderer
176
+ * that `border` is a partial mask: see `useFullBorder` in `drawCardToStage`,
177
+ * which picks between the two and decides whether the collector text has to
178
+ * adapt to the border color.
179
+ */
180
+ borderFull: AssetUrlSchema.optional(),
159
181
  legendary: AssetUrlSchema.optional(),
160
182
  /** Legendary crown mask variant for transforming MDFC front faces — the
161
183
  * composited top-half frame uses a different legendary crown cutout than