@snowcone-app/canvas 0.17.3 → 0.18.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 (65) hide show
  1. package/dist/{ImportManager-C_wBjWaV.js → CanvasRenderer-DUc-MOeR.js} +586 -806
  2. package/dist/CanvasRenderer-DUc-MOeR.js.map +1 -0
  3. package/dist/{CanvasStateV1-BG2hEc3-.js → CanvasStateV1-Bq48qhv5.js} +3 -3
  4. package/dist/{CanvasStateV1-BG2hEc3-.js.map → CanvasStateV1-Bq48qhv5.js.map} +1 -1
  5. package/dist/ContextualToolbars-CkLjHNPn.js +5833 -0
  6. package/dist/ContextualToolbars-CkLjHNPn.js.map +1 -0
  7. package/dist/EditorCanvasImpl-Bv4yagew.js +81 -0
  8. package/dist/EditorCanvasImpl-Bv4yagew.js.map +1 -0
  9. package/dist/EditorContext-5QpqAhjh.js +1184 -0
  10. package/dist/{EditorContext-CGkfmbgo.js.map → EditorContext-5QpqAhjh.js.map} +1 -1
  11. package/dist/{FontAnalyzer-CLv7_msL.js → FontAnalyzer-DIlqmyuf.js} +35 -35
  12. package/dist/FontAnalyzer-DIlqmyuf.js.map +1 -0
  13. package/dist/{ElementFactory-CuHSAPfg.js → ImportManager-D--7JnvW.js} +699 -476
  14. package/dist/ImportManager-D--7JnvW.js.map +1 -0
  15. package/dist/MenuButton-CeoEAtzP.js +7444 -0
  16. package/dist/MenuButton-CeoEAtzP.js.map +1 -0
  17. package/dist/SnowconeCanvas-C_O-aeaQ.js +1166 -0
  18. package/dist/SnowconeCanvas-C_O-aeaQ.js.map +1 -0
  19. package/dist/advanced.mjs +266 -264
  20. package/dist/advanced.mjs.map +1 -1
  21. package/dist/api/embed.d.ts +1 -1
  22. package/dist/components/ContextualToolbars.d.ts +8 -0
  23. package/dist/components/editor/EditorAdd.d.ts +11 -0
  24. package/dist/components/editor/EditorCanvasImpl.d.ts +6 -0
  25. package/dist/components/editor/EditorControls.d.ts +14 -0
  26. package/dist/components/editor/EditorHistory.d.ts +11 -0
  27. package/dist/components/editor/EditorLayers.d.ts +16 -0
  28. package/dist/components/editor/EditorMenu.d.ts +11 -0
  29. package/dist/components/editor/RootInternals.d.ts +7 -0
  30. package/dist/components/editor/index.d.ts +20 -0
  31. package/dist/components/embed/addElementTypes.d.ts +9 -0
  32. package/dist/contexts/EditorContext.d.ts +38 -0
  33. package/dist/core/preview-registry.d.ts +34 -0
  34. package/dist/{editorErrors-BY4Pdg7a.js → editorErrors-DXNfVXtD.js} +2 -2
  35. package/dist/{editorErrors-BY4Pdg7a.js.map → editorErrors-DXNfVXtD.js.map} +1 -1
  36. package/dist/embed-Cdbjay9i.js +961 -0
  37. package/dist/embed-Cdbjay9i.js.map +1 -0
  38. package/dist/embed.mjs +5 -5
  39. package/dist/index.mjs +7 -7
  40. package/dist/internals.mjs +12 -12
  41. package/dist/{template-fields-Z9x13sjM.js → template-fields-DgoBtajp.js} +266 -240
  42. package/dist/template-fields-DgoBtajp.js.map +1 -0
  43. package/dist/testing.mjs +3 -3
  44. package/dist/{usePieceGuideBundle-C1ipFnZd.js → usePieceGuideBundle-DVOISsB1.js} +2 -2
  45. package/dist/{usePieceGuideBundle-C1ipFnZd.js.map → usePieceGuideBundle-DVOISsB1.js.map} +1 -1
  46. package/dist/validation-0IscSfRb.js +9304 -0
  47. package/dist/validation-0IscSfRb.js.map +1 -0
  48. package/package.json +1 -1
  49. package/dist/EditorCanvasImpl-DQxqdgpq.js +0 -70
  50. package/dist/EditorCanvasImpl-DQxqdgpq.js.map +0 -1
  51. package/dist/EditorContext-CGkfmbgo.js +0 -1178
  52. package/dist/ElementFactory-CuHSAPfg.js.map +0 -1
  53. package/dist/FontAnalyzer-CLv7_msL.js.map +0 -1
  54. package/dist/ImportManager-C_wBjWaV.js.map +0 -1
  55. package/dist/SnowconeCanvas-DBbmx9qW.js +0 -1187
  56. package/dist/SnowconeCanvas-DBbmx9qW.js.map +0 -1
  57. package/dist/UnifiedFontService-Dsu5cwfT.js +0 -1478
  58. package/dist/UnifiedFontService-Dsu5cwfT.js.map +0 -1
  59. package/dist/embed--B8ot6Lj.js +0 -746
  60. package/dist/embed--B8ot6Lj.js.map +0 -1
  61. package/dist/iconify-D6eVIEy4.js +0 -1089
  62. package/dist/iconify-D6eVIEy4.js.map +0 -1
  63. package/dist/template-fields-Z9x13sjM.js.map +0 -1
  64. package/dist/validation-C795COGQ.js +0 -19959
  65. package/dist/validation-C795COGQ.js.map +0 -1
@@ -3853,21 +3853,21 @@ function _t(r, t) {
3853
3853
  r.width = t;
3854
3854
  }
3855
3855
  function Me(r, t, e) {
3856
- const o = e.transformData, i = it(o), s = i !== void 0 ? i : e.width ?? 0, a = t / s, n = (e.fontSize ?? r.fontSize) * a;
3857
- let h;
3858
- if (n < 16 ? h = Math.round(n) : h = Math.round(n * 2) / 2, r.setFontSize(h), e.richText && e.richText instanceof P && typeof r.setRichText == "function") {
3859
- const d = e.richText.clone();
3860
- for (const f of d.spans)
3861
- if (f.style.fontSize !== void 0) {
3862
- const u = f.style.fontSize * a;
3863
- u < 16 ? f.style.fontSize = Math.round(u) : f.style.fontSize = Math.round(u * 2) / 2;
3856
+ const o = e.transformData, i = it(o), s = i !== void 0 ? i : e.width ?? 0, a = t / s, n = e.fontSize ?? r.fontSize, h = n * a;
3857
+ let l;
3858
+ if (h < 16 ? l = Math.round(h) : l = Math.round(h * 2) / 2, r.setFontSize(l), e.richText && e.richText instanceof P && typeof r.setRichText == "function") {
3859
+ const f = e.richText.clone();
3860
+ for (const u of f.spans)
3861
+ if (u.style.fontSize !== void 0) {
3862
+ const m = u.style.fontSize * a;
3863
+ m < 16 ? u.style.fontSize = Math.round(m) : u.style.fontSize = Math.round(m * 2) / 2;
3864
3864
  }
3865
- r.setRichText(d);
3865
+ r.setRichText(f);
3866
3866
  }
3867
- const l = r.transformData;
3868
- if (it(l) !== void 0 && i !== void 0) {
3869
- const g = i * a;
3870
- _t(l, Math.max(20, Math.round(g)));
3867
+ const c = r.transformData;
3868
+ if (it(c) !== void 0 && i !== void 0) {
3869
+ const d = n > 0 ? l / n : a, f = i * d;
3870
+ _t(c, Math.max(20, Math.ceil(f)));
3871
3871
  }
3872
3872
  }
3873
3873
  function Ae(r, t, e, o) {
@@ -7173,27 +7173,27 @@ export {
7173
7173
  he as aA,
7174
7174
  Uo as aB,
7175
7175
  ke as aC,
7176
- qe as aD,
7177
- Ut as aE,
7178
- jo as aF,
7179
- yo as aG,
7180
- He as aH,
7181
- rt as aI,
7182
- $o as aJ,
7183
- fo as aK,
7184
- oo as aL,
7185
- io as aM,
7186
- eo as aN,
7187
- ne as aO,
7188
- to as aP,
7189
- Qe as aQ,
7190
- je as aR,
7191
- mo as aS,
7192
- uo as aT,
7193
- Ke as aU,
7194
- co as aV,
7195
- go as aW,
7196
- ho as aX,
7176
+ $o as aD,
7177
+ fo as aE,
7178
+ oo as aF,
7179
+ io as aG,
7180
+ eo as aH,
7181
+ ne as aI,
7182
+ to as aJ,
7183
+ Qe as aK,
7184
+ je as aL,
7185
+ mo as aM,
7186
+ uo as aN,
7187
+ Ke as aO,
7188
+ co as aP,
7189
+ go as aQ,
7190
+ ho as aR,
7191
+ qe as aS,
7192
+ Ut as aT,
7193
+ jo as aU,
7194
+ yo as aV,
7195
+ He as aW,
7196
+ rt as aX,
7197
7197
  Ko as aa,
7198
7198
  Qo as ab,
7199
7199
  ti as ac,
@@ -7246,4 +7246,4 @@ export {
7246
7246
  At as y,
7247
7247
  ri as z
7248
7248
  };
7249
- //# sourceMappingURL=FontAnalyzer-CLv7_msL.js.map
7249
+ //# sourceMappingURL=FontAnalyzer-DIlqmyuf.js.map