@snowcone-app/canvas 0.19.0 → 0.20.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 (64) hide show
  1. package/dist/{CanvasRenderer-DUc-MOeR.js → CanvasRenderer-CwiYq8qg.js} +3 -3
  2. package/dist/{CanvasRenderer-DUc-MOeR.js.map → CanvasRenderer-CwiYq8qg.js.map} +1 -1
  3. package/dist/{CanvasStateV1-Bq48qhv5.js → CanvasStateV1-BFabcAKC.js} +35 -30
  4. package/dist/{CanvasStateV1-Bq48qhv5.js.map → CanvasStateV1-BFabcAKC.js.map} +1 -1
  5. package/dist/{ContextualToolbars-CkLjHNPn.js → ContextualToolbars--vTtorNg.js} +5 -5
  6. package/dist/{ContextualToolbars-CkLjHNPn.js.map → ContextualToolbars--vTtorNg.js.map} +1 -1
  7. package/dist/{EditorCanvasImpl-Cthm-KSe.js → EditorCanvasImpl-UBKdG0c0.js} +18 -17
  8. package/dist/{EditorCanvasImpl-Cthm-KSe.js.map → EditorCanvasImpl-UBKdG0c0.js.map} +1 -1
  9. package/dist/{ImportManager-D--7JnvW.js → ExportManager-DK7CdI-G.js} +24758 -24758
  10. package/dist/ExportManager-DK7CdI-G.js.map +1 -0
  11. package/dist/{FontAnalyzer-DIlqmyuf.js → FontAnalyzer-BpsTYowD.js} +5 -2
  12. package/dist/FontAnalyzer-BpsTYowD.js.map +1 -0
  13. package/dist/SnowconeCanvas-B01o5LmS.js +1172 -0
  14. package/dist/SnowconeCanvas-B01o5LmS.js.map +1 -0
  15. package/dist/{MenuButton-CeoEAtzP.js → UnifiedFontService-B1PGVu8O.js} +3704 -3429
  16. package/dist/UnifiedFontService-B1PGVu8O.js.map +1 -0
  17. package/dist/advanced.mjs +13 -13
  18. package/dist/api/embed.d.ts +4 -2
  19. package/dist/api/stable.d.ts +2 -2
  20. package/dist/components/editor/commerceStore.d.ts +22 -2
  21. package/dist/components/editor/index.d.ts +1 -0
  22. package/dist/components/editor/useProductSelection.d.ts +15 -9
  23. package/dist/components/embed/SnowconeCanvas.d.ts +10 -2
  24. package/dist/core/ArtboardElement.d.ts +2 -1
  25. package/dist/default-editor/SnowconeEditor.d.ts +39 -0
  26. package/dist/design/design-builder.d.ts +44 -19
  27. package/dist/design/template-fields.d.ts +32 -0
  28. package/dist/design-builder-DMKx9UXD.js +368 -0
  29. package/dist/design-builder-DMKx9UXD.js.map +1 -0
  30. package/dist/{EditorContext-5QpqAhjh.js → editorErrors-CK1RISFa.js} +382 -358
  31. package/dist/editorErrors-CK1RISFa.js.map +1 -0
  32. package/dist/embed-uALcVSYN.js +1117 -0
  33. package/dist/embed-uALcVSYN.js.map +1 -0
  34. package/dist/embed.mjs +33 -31
  35. package/dist/hooks/useArtboards.d.ts +2 -1
  36. package/dist/index.mjs +8 -8
  37. package/dist/internals.mjs +5 -5
  38. package/dist/kits/sections.d.ts +11 -7
  39. package/dist/rendering/serialize-for-server.d.ts +3 -0
  40. package/dist/state/CanvasStateV1.d.ts +12 -0
  41. package/dist/template-fields-B9RagVpT.js +476 -0
  42. package/dist/template-fields-B9RagVpT.js.map +1 -0
  43. package/dist/testing.mjs +8 -8
  44. package/dist/types/index.d.ts +10 -0
  45. package/dist/{usePieceGuideBundle-DVOISsB1.js → usePieceGuideBundle-Ctnu5k2D.js} +2 -2
  46. package/dist/{usePieceGuideBundle-DVOISsB1.js.map → usePieceGuideBundle-Ctnu5k2D.js.map} +1 -1
  47. package/dist/{validation-0IscSfRb.js → validation-3YEMnKLB.js} +467 -463
  48. package/dist/validation-3YEMnKLB.js.map +1 -0
  49. package/package.json +6 -5
  50. package/dist/EditorContext-5QpqAhjh.js.map +0 -1
  51. package/dist/FontAnalyzer-DIlqmyuf.js.map +0 -1
  52. package/dist/ImportManager-D--7JnvW.js.map +0 -1
  53. package/dist/MenuButton-CeoEAtzP.js.map +0 -1
  54. package/dist/SnowconeCanvas-3PA17na3.js +0 -1166
  55. package/dist/SnowconeCanvas-3PA17na3.js.map +0 -1
  56. package/dist/design-builder-v4935TeS.js +0 -343
  57. package/dist/design-builder-v4935TeS.js.map +0 -1
  58. package/dist/editorErrors-DXNfVXtD.js +0 -29
  59. package/dist/editorErrors-DXNfVXtD.js.map +0 -1
  60. package/dist/embed-D0HHwCIO.js +0 -1093
  61. package/dist/embed-D0HHwCIO.js.map +0 -1
  62. package/dist/template-fields-Dr3fMItw.js +0 -329
  63. package/dist/template-fields-Dr3fMItw.js.map +0 -1
  64. package/dist/validation-0IscSfRb.js.map +0 -1
@@ -1,5 +1,5 @@
1
- import { C as Gt } from "./ImportManager-D--7JnvW.js";
2
- import { A as Kt } from "./FontAnalyzer-DIlqmyuf.js";
1
+ import { C as Gt } from "./ExportManager-DK7CdI-G.js";
2
+ import { A as Kt } from "./FontAnalyzer-BpsTYowD.js";
3
3
  var Pe;
4
4
  function u(e, t, n) {
5
5
  function o(c, a) {
@@ -2722,7 +2722,7 @@ const S = /* @__PURE__ */ u("ZodType", (e, t) => ($.init(e, t), Object.assign(e[
2722
2722
  return Ss(this, n);
2723
2723
  },
2724
2724
  array() {
2725
- return D(this);
2725
+ return R(this);
2726
2726
  },
2727
2727
  or(n) {
2728
2728
  return ye([this, n]);
@@ -2966,13 +2966,13 @@ const ls = /* @__PURE__ */ u("ZodArray", (e, t) => {
2966
2966
  }
2967
2967
  });
2968
2968
  });
2969
- function D(e, t) {
2969
+ function R(e, t) {
2970
2970
  return /* @__PURE__ */ Gr(ls, e, t);
2971
2971
  }
2972
2972
  const fs = /* @__PURE__ */ u("ZodObject", (e, t) => {
2973
2973
  Jo.init(e, t), S.init(e, t), e._zod.processJSONSchema = (n, o, r) => ui(e, n, o, r), y(e, "shape", () => t.shape), oe(e, "ZodObject", {
2974
2974
  keyof() {
2975
- return R(Object.keys(this._zod.def.shape));
2975
+ return D(Object.keys(this._zod.def.shape));
2976
2976
  },
2977
2977
  catchall(n) {
2978
2978
  return this.clone({ ...this._zod.def, catchall: n });
@@ -3082,7 +3082,7 @@ const be = /* @__PURE__ */ u("ZodEnum", (e, t) => {
3082
3082
  });
3083
3083
  };
3084
3084
  });
3085
- function R(e, t) {
3085
+ function D(e, t) {
3086
3086
  const n = Array.isArray(e) ? Object.fromEntries(e.map((o) => [o, o])) : e;
3087
3087
  return new be({
3088
3088
  type: "enum",
@@ -3244,19 +3244,19 @@ const ze = b({
3244
3244
  enabled: m(),
3245
3245
  color: z(),
3246
3246
  width: d(),
3247
- dashArray: D(d()).optional(),
3248
- lineCap: R(["butt", "round", "square"]).optional(),
3249
- lineJoin: R(["miter", "round", "bevel"]).optional(),
3247
+ dashArray: R(d()).optional(),
3248
+ lineCap: D(["butt", "round", "square"]).optional(),
3249
+ lineJoin: D(["miter", "round", "bevel"]).optional(),
3250
3250
  miterLimit: d().optional(),
3251
3251
  opacity: d().optional(),
3252
3252
  feather: d().optional()
3253
3253
  }), xs = b({
3254
3254
  fill: m().optional(),
3255
3255
  stroke: m().optional(),
3256
- scope: R(["group", "artboard"]).optional()
3256
+ scope: D(["group", "artboard"]).optional()
3257
3257
  }), Ds = b({
3258
3258
  enabled: m(),
3259
- style: R(["worn", "cracked", "grunge", "retro", "custom"]),
3259
+ style: D(["worn", "cracked", "grunge", "retro", "custom"]),
3260
3260
  intensity: d(),
3261
3261
  fadeAmount: d().optional(),
3262
3262
  grainAmount: d().optional(),
@@ -3264,11 +3264,11 @@ const ze = b({
3264
3264
  edgeWear: d().optional(),
3265
3265
  textureUrl: z().optional(),
3266
3266
  textureOpacity: d().optional(),
3267
- textureBlendMode: R(["multiply", "screen", "overlay"]).optional(),
3267
+ textureBlendMode: D(["multiply", "screen", "overlay"]).optional(),
3268
3268
  seed: d().optional()
3269
3269
  }), Rs = b({
3270
3270
  id: z(),
3271
- type: R(["clip", "alpha", "luma", "distress"]),
3271
+ type: D(["clip", "alpha", "luma", "distress"]),
3272
3272
  // maskElement is a nested element config -- use lazy to break the cycle
3273
3273
  maskElement: At(() => Ee),
3274
3274
  inverted: m().optional(),
@@ -3287,7 +3287,7 @@ const ze = b({
3287
3287
  text: z(),
3288
3288
  style: Us
3289
3289
  }), Js = b({
3290
- spans: D(Fs)
3290
+ spans: R(Fs)
3291
3291
  }), Ms = b({
3292
3292
  charIndex: d(),
3293
3293
  glyphIndex: d(),
@@ -3336,7 +3336,7 @@ const ze = b({
3336
3336
  mkmk: m().optional()
3337
3337
  }), Ct = b({
3338
3338
  type: v("custom"),
3339
- controlPoints: D(ze)
3339
+ controlPoints: R(ze)
3340
3340
  }).passthrough(), jt = b({
3341
3341
  type: v("distort")
3342
3342
  }).passthrough(), xt = b({
@@ -3376,7 +3376,7 @@ const ze = b({
3376
3376
  type: v("group")
3377
3377
  }), Vt = b({
3378
3378
  type: v("shape"),
3379
- shapeType: R(["rectangle", "circle", "ellipse", "triangle", "polygon", "star", "line"]),
3379
+ shapeType: D(["rectangle", "circle", "ellipse", "triangle", "polygon", "star", "line"]),
3380
3380
  width: d(),
3381
3381
  height: d(),
3382
3382
  borderRadius: d().optional(),
@@ -3391,12 +3391,12 @@ const ze = b({
3391
3391
  id: z(),
3392
3392
  x: d(),
3393
3393
  y: d(),
3394
- type: R(["corner", "smooth", "bezier"]),
3394
+ type: D(["corner", "smooth", "bezier"]),
3395
3395
  handleIn: ze.optional(),
3396
3396
  handleOut: ze.optional()
3397
3397
  }), Bt = b({
3398
3398
  type: v("path"),
3399
- points: D(Vs),
3399
+ points: R(Vs),
3400
3400
  closed: m(),
3401
3401
  width: d(),
3402
3402
  height: d(),
@@ -3431,10 +3431,10 @@ const ze = b({
3431
3431
  locked: m().optional(),
3432
3432
  isClipping: m().optional(),
3433
3433
  // Effects
3434
- blendMode: R(["normal", "knockout", "clip"]).optional(),
3434
+ blendMode: D(["normal", "knockout", "clip"]).optional(),
3435
3435
  knockoutParts: xs.optional(),
3436
3436
  stroke: js.optional(),
3437
- masks: D(Rs).optional(),
3437
+ masks: R(Rs).optional(),
3438
3438
  distressEffect: Ds.optional()
3439
3439
  }), L = re.extend({
3440
3440
  // Rich text
@@ -3445,13 +3445,13 @@ const ze = b({
3445
3445
  fontSize: d().optional(),
3446
3446
  fontFamily: z().optional(),
3447
3447
  color: z().optional(),
3448
- textAlign: R(["left", "center", "right"]).optional(),
3448
+ textAlign: D(["left", "center", "right"]).optional(),
3449
3449
  bold: m().optional(),
3450
3450
  italic: m().optional(),
3451
3451
  underline: m().optional(),
3452
3452
  strikethrough: m().optional(),
3453
3453
  // Typography
3454
- glyphOverrides: D(Ms).optional(),
3454
+ glyphOverrides: R(Ms).optional(),
3455
3455
  openTypeFeatures: Ls.optional()
3456
3456
  }), Bs = L.extend({
3457
3457
  transformType: v("custom"),
@@ -3485,7 +3485,7 @@ const ze = b({
3485
3485
  }), ec = re.extend({
3486
3486
  transformType: v("group"),
3487
3487
  transformData: Lt.optional(),
3488
- children: At(() => D(Ee)).optional()
3488
+ children: At(() => R(Ee)).optional()
3489
3489
  }), tc = re.extend({
3490
3490
  transformType: v("shape"),
3491
3491
  transformData: Vt.optional()
@@ -3512,7 +3512,7 @@ const ze = b({
3512
3512
  b({ type: v("path"), d: z() }),
3513
3513
  b({
3514
3514
  type: v("composite-path"),
3515
- pieces: D(
3515
+ pieces: R(
3516
3516
  b({
3517
3517
  d: z(),
3518
3518
  x: d(),
@@ -3535,17 +3535,20 @@ const ze = b({
3535
3535
  width: d(),
3536
3536
  height: d(),
3537
3537
  backgroundColor: z(),
3538
- backgroundType: R(["color", "transparent", "texture"]).optional(),
3538
+ backgroundType: D(["color", "transparent", "texture"]).optional(),
3539
3539
  backgroundTexture: z().optional(),
3540
3540
  exportBackground: m().optional(),
3541
3541
  clipShape: oc.optional(),
3542
3542
  previewBackgroundColor: z().optional(),
3543
3543
  distressTexture: rc.optional(),
3544
- elementIds: D(z())
3544
+ // Pacing role for multi-page templates (ADR-0086) — template metadata,
3545
+ // stripped from the server render wire by serializeStateForServer
3546
+ role: D(["cover", "front-matter", "repeating", "back-matter"]).optional(),
3547
+ elementIds: R(z())
3545
3548
  }), sc = b({
3546
3549
  version: v(1),
3547
- artboards: D(ic),
3548
- elements: D(Ee),
3550
+ artboards: R(ic),
3551
+ elements: R(Ee),
3549
3552
  activeArtboardId: z()
3550
3553
  });
3551
3554
  function pc(e, t) {
@@ -3566,6 +3569,7 @@ function pc(e, t) {
3566
3569
  ...a.exportBackground !== void 0 && { exportBackground: a.exportBackground },
3567
3570
  ...a.clipShape && { clipShape: a.clipShape },
3568
3571
  ...a.previewBackgroundColor && { previewBackgroundColor: a.previewBackgroundColor },
3572
+ ...a.role && { role: a.role },
3569
3573
  elementIds: a.elementIds ?? c.getElementIds()
3570
3574
  };
3571
3575
  }
@@ -3594,6 +3598,7 @@ function dc(e) {
3594
3598
  exportBackground: o.exportBackground,
3595
3599
  clipShape: o.clipShape,
3596
3600
  previewBackgroundColor: o.previewBackgroundColor,
3601
+ role: o.role,
3597
3602
  elementIds: o.elementIds
3598
3603
  })
3599
3604
  ), n = e.elements.map(
@@ -3685,7 +3690,7 @@ export {
3685
3690
  ic as S,
3686
3691
  It as a,
3687
3692
  z as b,
3688
- D as c,
3693
+ R as c,
3689
3694
  dc as d,
3690
3695
  fc as e,
3691
3696
  v as l,
@@ -3696,4 +3701,4 @@ export {
3696
3701
  ye as u,
3697
3702
  cc as v
3698
3703
  };
3699
- //# sourceMappingURL=CanvasStateV1-Bq48qhv5.js.map
3704
+ //# sourceMappingURL=CanvasStateV1-BFabcAKC.js.map