@snowcone-app/canvas 0.40.11 → 0.40.13

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 (32) hide show
  1. package/dist/{CanvasRenderer-b7W2QOJp.js → CanvasRenderer-COHWEK1r.js} +2 -2
  2. package/dist/{CanvasRenderer-b7W2QOJp.js.map → CanvasRenderer-COHWEK1r.js.map} +1 -1
  3. package/dist/{CanvasStateV1-zt4kyHFb.js → CanvasStateV1-DwziqxMO.js} +2 -2
  4. package/dist/{CanvasStateV1-zt4kyHFb.js.map → CanvasStateV1-DwziqxMO.js.map} +1 -1
  5. package/dist/{ContextualToolbars-Dx3Qyjkt.js → ContextualToolbars-D-EX9Q9L.js} +4 -4
  6. package/dist/{ContextualToolbars-Dx3Qyjkt.js.map → ContextualToolbars-D-EX9Q9L.js.map} +1 -1
  7. package/dist/{EditorCanvasImpl-Ddvyg6Mr.js → EditorCanvasImpl-CP6ipFq_.js} +6 -6
  8. package/dist/{EditorCanvasImpl-Ddvyg6Mr.js.map → EditorCanvasImpl-CP6ipFq_.js.map} +1 -1
  9. package/dist/{ExportManager-BQ9BPs1U.js → ExportManager-DLOH2Kzk.js} +68 -67
  10. package/dist/{ExportManager-BQ9BPs1U.js.map → ExportManager-DLOH2Kzk.js.map} +1 -1
  11. package/dist/{ImagePanel-CwuttJnt.js → ImagePanel-BIzwlaf5.js} +3 -3
  12. package/dist/{ImagePanel-CwuttJnt.js.map → ImagePanel-BIzwlaf5.js.map} +1 -1
  13. package/dist/{SnowconeCanvas-Dlec811f.js → SnowconeCanvas-991f9eds.js} +8 -8
  14. package/dist/{SnowconeCanvas-Dlec811f.js.map → SnowconeCanvas-991f9eds.js.map} +1 -1
  15. package/dist/advanced.mjs +9 -9
  16. package/dist/api/internals.d.ts +1 -1
  17. package/dist/{custom-icons-C1SbDFU3.js → custom-icons-DHew1GPV.js} +2 -2
  18. package/dist/{custom-icons-C1SbDFU3.js.map → custom-icons-DHew1GPV.js.map} +1 -1
  19. package/dist/{embed-CZcJqmA1.js → embed-CcKoxfdW.js} +7 -7
  20. package/dist/{embed-CZcJqmA1.js.map → embed-CcKoxfdW.js.map} +1 -1
  21. package/dist/embed.mjs +10 -10
  22. package/dist/index.mjs +12 -12
  23. package/dist/internals.mjs +117 -116
  24. package/dist/internals.mjs.map +1 -1
  25. package/dist/{template-fields-CCNA9LqM.js → template-fields-BzAlpOEB.js} +3 -3
  26. package/dist/{template-fields-CCNA9LqM.js.map → template-fields-BzAlpOEB.js.map} +1 -1
  27. package/dist/{useCommands-Bo1KbIND.js → useCommands-CLnk8kvW.js} +5 -5
  28. package/dist/{useCommands-Bo1KbIND.js.map → useCommands-CLnk8kvW.js.map} +1 -1
  29. package/dist/{validation-BRp5aW3B.js → validation-Q1_OcfJ_.js} +9 -9
  30. package/dist/{validation-BRp5aW3B.js.map → validation-Q1_OcfJ_.js.map} +1 -1
  31. package/example/package.json +1 -1
  32. package/package.json +3 -3
package/dist/embed.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { C as a, g as t, h as o, K as r, N as i, O as n, P as d, Q as m, R as u, b as l, a as E, j as c, k as p, l as g } from "./useCommands-Bo1KbIND.js";
2
- import { E as C, R as S, a as T, b as f, S as P, c as R, d as b, e as B, f as F, g as v, i as y, h, p as k, s as D, j as I, k as L, l as K, v as w } from "./embed-CZcJqmA1.js";
1
+ import { C as a, g as t, h as o, K as r, N as i, O as n, P as d, Q as m, R as u, b as l, a as E, j as c, k as p, l as g } from "./useCommands-CLnk8kvW.js";
2
+ import { E as C, R as S, a as T, b as f, S as P, c as R, d as b, e as B, f as v, g as y, i as F, h, p as k, s as D, j as I, k as K, l as L, v as w } from "./embed-CcKoxfdW.js";
3
3
  import { t as M, V as j } from "./FontAnalyzer-DWHS41ba.js";
4
4
  import { D as N, e as V, h as _, i as z, b as H } from "./design-builder-CoCtjIwj.js";
5
- import { D as O, T as Q, r as Y, u as q, a as U, b as W, c as X, d as Z, e as $, w as ee } from "./template-fields-CCNA9LqM.js";
6
- import { F as ae, G as te, H as oe, J as re } from "./ExportManager-BQ9BPs1U.js";
7
- import { s as ne } from "./CanvasStateV1-zt4kyHFb.js";
5
+ import { D as O, T as Q, r as Y, u as q, a as U, b as W, c as X, d as Z, e as $, w as ee } from "./template-fields-BzAlpOEB.js";
6
+ import { G as ae, H as te, J as oe, K as re } from "./ExportManager-DLOH2Kzk.js";
7
+ import { s as ne } from "./CanvasStateV1-DwziqxMO.js";
8
8
  export {
9
9
  a as CanvasServicesProvider,
10
10
  N as DesignBuilder,
@@ -19,15 +19,15 @@ export {
19
19
  R as auditEditor,
20
20
  b as bundleToRenderConfig,
21
21
  B as bundleVariantToken,
22
- F as collectEmbedIssues,
22
+ v as collectEmbedIssues,
23
23
  t as createProxyGenerate,
24
24
  o as createProxyImageSearch,
25
25
  ae as customFontRegistry,
26
26
  V as design,
27
27
  r as editorElementKind,
28
28
  te as ensureCustomFontsLoaded,
29
- v as formatBuyPrice,
30
- y as isBundleProduct,
29
+ y as formatBuyPrice,
30
+ F as isBundleProduct,
31
31
  h as isBundleRenderProduct,
32
32
  _ as isColorToken,
33
33
  j as isEditorError,
@@ -54,8 +54,8 @@ export {
54
54
  X as useImageBinding,
55
55
  g as useLayers,
56
56
  I as usePlacements,
57
- L as useProductSelection,
58
- K as useRealtimeMockups,
57
+ K as useProductSelection,
58
+ L as useRealtimeMockups,
59
59
  Z as useSelectedElement,
60
60
  $ as useTextBinding,
61
61
  w as validateEmbed,
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
- import { e as u } from "./useCommands-Bo1KbIND.js";
2
- import { C as c, f as x, g as I, h as v, b as A, a as g, j as T, k as B, l as F } from "./useCommands-Bo1KbIND.js";
3
- import { E as y, S as L, S as _, u as O, a as R } from "./SnowconeCanvas-Dlec811f.js";
1
+ import { e as u } from "./useCommands-CLnk8kvW.js";
2
+ import { C as c, f as x, g as I, h as v, b as A, a as g, j as T, k as B, l as P } from "./useCommands-CLnk8kvW.js";
3
+ import { E as F, S as L, S as _, u as O, a as R } from "./SnowconeCanvas-991f9eds.js";
4
4
  import { b as m, d } from "./design-builder-CoCtjIwj.js";
5
- import { C as z, D as w, e as D, s as K } from "./design-builder-CoCtjIwj.js";
6
- import { T as V, r as b, u as h, a as G, b as H, c as U, d as Y, e as Z, w as j } from "./template-fields-CCNA9LqM.js";
7
- import { A as J, C as q, E as Q, M as W, P as X, r as $, v as ee } from "./validation-BRp5aW3B.js";
8
- import { F as ae, G as te, H as oe, J as re } from "./ExportManager-BQ9BPs1U.js";
5
+ import { C as z, D as w, e as K, s as D } from "./design-builder-CoCtjIwj.js";
6
+ import { T as V, r as b, u as h, a as G, b as H, c as U, d as Y, e as Z, w as j } from "./template-fields-BzAlpOEB.js";
7
+ import { A as J, C as q, E as Q, M as W, P as X, r as $, v as ee } from "./validation-Q1_OcfJ_.js";
8
+ import { G as ae, H as te, J as oe, K as re } from "./ExportManager-DLOH2Kzk.js";
9
9
  import { c as ie, e as ue } from "./compose-DtQL_oit.js";
10
- import { d as de, m as Ce, s as Se, v as Ee } from "./CanvasStateV1-zt4kyHFb.js";
10
+ import { d as de, m as Ce, s as Se, v as Ee } from "./CanvasStateV1-DwziqxMO.js";
11
11
  function E() {
12
12
  const { isCanvasReady: e } = m();
13
13
  return e;
@@ -24,7 +24,7 @@ export {
24
24
  c as CanvasServicesProvider,
25
25
  w as DesignBuilder,
26
26
  Q as EMBED_ONLY,
27
- y as ErrorBoundary,
27
+ F as ErrorBoundary,
28
28
  W as MINIMAL_CAPABILITIES,
29
29
  X as PRO_STUDIO,
30
30
  L as SnowconeCanvas,
@@ -36,7 +36,7 @@ export {
36
36
  ae as customFontRegistry,
37
37
  _ as default,
38
38
  de as deserializeState,
39
- D as design,
39
+ K as design,
40
40
  te as ensureCustomFontsLoaded,
41
41
  ue as extendKit,
42
42
  oe as loadCustomFont,
@@ -45,7 +45,7 @@ export {
45
45
  re as registerCustomFonts,
46
46
  $ as resolveKit,
47
47
  Se as serializeState,
48
- K as serializeStateForServer,
48
+ D as serializeStateForServer,
49
49
  A as useArtboards,
50
50
  O as useAutoExport,
51
51
  E as useCanvasReady,
@@ -58,7 +58,7 @@ export {
58
58
  B as useExport,
59
59
  H as useFontBinding,
60
60
  U as useImageBinding,
61
- F as useLayers,
61
+ P as useLayers,
62
62
  Y as useSelectedElement,
63
63
  Z as useTextBinding,
64
64
  f as useViewport,
@@ -1,25 +1,25 @@
1
- import { A as rr, a as or, C as sr, I as er, R as nr, S as tr, T as ir } from "./CanvasRenderer-b7W2QOJp.js";
2
- import { r as k } from "./ExportManager-BQ9BPs1U.js";
3
- import { D as hr, a as cr, I as dr, W as fr, b as gr, c as lr, d as ur, e as pr, f as yr, g as kr, h as vr, i as wr, j as Mr, k as Tr, l as Cr, m as Sr, n as br, o as Pr, p as Ir, q as mr, s as Ar, t as Rr, u as Wr, v as Er, w as Or, x as Hr, y as jr, z as Fr, A as Lr, B as Xr, C as zr } from "./ExportManager-BQ9BPs1U.js";
1
+ import { A as rr, a as or, C as sr, I as er, R as tr, S as nr, T as ar } from "./CanvasRenderer-COHWEK1r.js";
2
+ import { r as k } from "./ExportManager-DLOH2Kzk.js";
3
+ import { D as hr, a as cr, I as dr, W as fr, b as gr, c as lr, d as ur, e as pr, f as yr, g as kr, h as vr, i as wr, j as Cr, k as Mr, l as Tr, m as Sr, n as br, o as Pr, p as Ir, q as mr, s as Ar, t as Rr, u as Wr, v as Er, w as Or, x as Hr, y as jr, z as Fr, A as Lr, B as Xr, C as zr, F as Nr } from "./ExportManager-DLOH2Kzk.js";
4
4
  import { i as H, a as j, c as F, r as L, b as X } from "./FontAnalyzer-DWHS41ba.js";
5
- import { d as _r, e as Br, f as Kr, C as Ur, g as Yr, E as Jr, F as Vr, H as qr, L as Gr, h as Qr, W as Zr, j as $r, k as xr, l as Dr, m as ro, n as oo, o as so, s as eo, w as no } from "./FontAnalyzer-DWHS41ba.js";
6
- import { A as io, a as ao, C as ho, S as co } from "./CanvasStateV1-zt4kyHFb.js";
5
+ import { d as Br, e as Kr, f as Ur, C as Yr, g as Jr, E as Vr, F as qr, H as Gr, L as Qr, h as Zr, W as $r, j as xr, k as Dr, l as ro, m as oo, n as so, o as eo, s as to, w as no } from "./FontAnalyzer-DWHS41ba.js";
6
+ import { A as io, a as ho, C as co, S as fo } from "./CanvasStateV1-DwziqxMO.js";
7
7
  const z = F("image-adjustments"), v = 1e-3;
8
8
  function N(r, o) {
9
- const { brightness: i, contrast: s, saturation: h } = o, e = i * s, n = 127.5 * (1 - s), f = Math.abs(e - 1) > v || Math.abs(n) > v, a = new Uint8ClampedArray(256);
9
+ const { brightness: a, contrast: s, saturation: h } = o, e = a * s, t = 127.5 * (1 - s), f = Math.abs(e - 1) > v || Math.abs(t) > v, i = new Uint8ClampedArray(256);
10
10
  if (f)
11
- for (let l = 0; l < 256; l++) a[l] = l * e + n;
12
- const c = Math.abs(h - 1) > v, t = h, d = 0.213 + 0.787 * t, g = 0.715 - 0.715 * t, S = 0.072 - 0.072 * t, b = 0.213 - 0.213 * t, P = 0.715 + 0.285 * t, I = 0.072 - 0.072 * t, m = 0.213 - 0.213 * t, A = 0.715 - 0.715 * t, R = 0.072 + 0.928 * t;
11
+ for (let l = 0; l < 256; l++) i[l] = l * e + t;
12
+ const c = Math.abs(h - 1) > v, n = h, d = 0.213 + 0.787 * n, g = 0.715 - 0.715 * n, S = 0.072 - 0.072 * n, b = 0.213 - 0.213 * n, P = 0.715 + 0.285 * n, I = 0.072 - 0.072 * n, m = 0.213 - 0.213 * n, A = 0.715 - 0.715 * n, R = 0.072 + 0.928 * n;
13
13
  for (let l = 0; l < r.length; l += 4) {
14
14
  let u = r[l], p = r[l + 1], y = r[l + 2];
15
- if (f && (u = a[u], p = a[p], y = a[y]), c) {
15
+ if (f && (u = i[u], p = i[p], y = i[y]), c) {
16
16
  const W = d * u + g * p + S * y, E = b * u + P * p + I * y, O = m * u + A * p + R * y;
17
17
  u = W, p = E, y = O;
18
18
  }
19
19
  r[l] = u, r[l + 1] = p, r[l + 2] = y;
20
20
  }
21
21
  }
22
- const M = /* @__PURE__ */ new WeakMap(), _ = 4;
22
+ const C = /* @__PURE__ */ new WeakMap(), _ = 4;
23
23
  function B(r) {
24
24
  const o = r.naturalWidth;
25
25
  return typeof o == "number" && o > 0 ? o : r.width;
@@ -32,42 +32,42 @@ function U(r, o) {
32
32
  if (typeof OffscreenCanvas < "u")
33
33
  return new OffscreenCanvas(r, o);
34
34
  if (typeof document < "u") {
35
- const i = document.createElement("canvas");
36
- return i.width = r, i.height = o, i;
35
+ const a = document.createElement("canvas");
36
+ return a.width = r, a.height = o, a;
37
37
  }
38
38
  throw new Error("image-adjustments: no canvas implementation available (no OffscreenCanvas, no DOM)");
39
39
  }
40
40
  function Y(r, o) {
41
- const i = B(r), s = K(r);
42
- if (i <= 0 || s <= 0)
41
+ const a = B(r), s = K(r);
42
+ if (a <= 0 || s <= 0)
43
43
  throw new Error("image-adjustments: source has no pixels (width/height is 0)");
44
- const h = U(i, s), e = h.getContext("2d");
44
+ const h = U(a, s), e = h.getContext("2d");
45
45
  if (!e)
46
46
  throw new Error("image-adjustments: could not acquire a 2d context");
47
- e.drawImage(r, 0, 0, i, s);
48
- const n = e.getImageData(0, 0, i, s);
49
- return N(n.data, o), e.putImageData(n, 0, 0), h;
47
+ e.drawImage(r, 0, 0, a, s);
48
+ const t = e.getImageData(0, 0, a, s);
49
+ return N(t.data, o), e.putImageData(t, 0, 0), h;
50
50
  }
51
- function C(r, o) {
51
+ function T(r, o) {
52
52
  if (H(o)) return r;
53
- const i = j(o);
54
- let s = M.get(r);
55
- const h = s == null ? void 0 : s.get(i);
53
+ const a = j(o);
54
+ let s = C.get(r);
55
+ const h = s == null ? void 0 : s.get(a);
56
56
  if (h)
57
- return s.delete(i), s.set(i, h), h;
57
+ return s.delete(a), s.set(a, h), h;
58
58
  let e;
59
59
  try {
60
60
  e = Y(r, o);
61
- } catch (n) {
62
- z.error("adjustment pixel pass failed — rendering UNADJUSTED source:", n), e = r;
61
+ } catch (t) {
62
+ z.error("adjustment pixel pass failed — rendering UNADJUSTED source:", t), e = r;
63
63
  }
64
- for (s || (s = /* @__PURE__ */ new Map(), M.set(r, s)), s.set(i, e); s.size > _; ) {
65
- const n = s.keys().next().value;
66
- s.delete(n);
64
+ for (s || (s = /* @__PURE__ */ new Map(), C.set(r, s)), s.set(a, e); s.size > _; ) {
65
+ const t = s.keys().next().value;
66
+ s.delete(t);
67
67
  }
68
68
  return e;
69
69
  }
70
- L(C);
70
+ L(T);
71
71
  function Q(r, o) {
72
72
  return !r.needsCropPixelConversion || r.cropWidth === void 0 ? r : {
73
73
  ...r,
@@ -78,36 +78,36 @@ function Q(r, o) {
78
78
  needsCropPixelConversion: !1
79
79
  };
80
80
  }
81
- function Z(r, o, i) {
82
- var n, f;
83
- const s = C(
84
- i,
81
+ function Z(r, o, a) {
82
+ var t, f;
83
+ const s = T(
84
+ a,
85
85
  o.adjustments
86
86
  );
87
87
  r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180);
88
88
  let h = 1, e = 1;
89
89
  if (o.flipHorizontal && (h = -1), o.flipVertical && (e = -1), (h !== 1 || e !== 1) && r.scale(h, e), o.opacity !== void 0 && o.opacity !== 1 && (r.globalAlpha = o.opacity), o.borderRadius && o.borderRadius > 0) {
90
- const a = Math.min(
90
+ const i = Math.min(
91
91
  o.borderRadius / 100 * Math.min(o.width, o.height),
92
92
  o.width / 2,
93
93
  o.height / 2
94
94
  );
95
95
  r.beginPath();
96
- const c = -o.width / 2, t = -o.height / 2, d = o.width, g = o.height;
97
- r.moveTo(c + a, t), r.lineTo(c + d - a, t), r.arcTo(c + d, t, c + d, t + a, a), r.lineTo(c + d, t + g - a), r.arcTo(c + d, t + g, c + d - a, t + g, a), r.lineTo(c + a, t + g), r.arcTo(c, t + g, c, t + g - a, a), r.lineTo(c, t + a), r.arcTo(c, t, c + a, t, a), r.closePath(), r.clip();
96
+ const c = -o.width / 2, n = -o.height / 2, d = o.width, g = o.height;
97
+ r.moveTo(c + i, n), r.lineTo(c + d - i, n), r.arcTo(c + d, n, c + d, n + i, i), r.lineTo(c + d, n + g - i), r.arcTo(c + d, n + g, c + d - i, n + g, i), r.lineTo(c + i, n + g), r.arcTo(c, n + g, c, n + g - i, i), r.lineTo(c, n + i), r.arcTo(c, n, c + i, n, i), r.closePath(), r.clip();
98
98
  }
99
99
  if (o.cropX !== void 0 && o.cropWidth !== void 0 ? r.drawImage(
100
100
  s,
101
101
  o.cropX,
102
102
  o.cropY || 0,
103
103
  o.cropWidth,
104
- o.cropHeight || i.height,
104
+ o.cropHeight || a.height,
105
105
  -o.width / 2,
106
106
  -o.height / 2,
107
107
  o.width,
108
108
  o.height
109
- ) : r.drawImage(s, -o.width / 2, -o.height / 2, o.width, o.height), r.restore(), (n = o.stroke) != null && n.enabled) {
110
- const a = ((f = o.knockoutParts) == null ? void 0 : f.stroke) === !0, c = {
109
+ ) : r.drawImage(s, -o.width / 2, -o.height / 2, o.width, o.height), r.restore(), (t = o.stroke) != null && t.enabled) {
110
+ const i = ((f = o.knockoutParts) == null ? void 0 : f.stroke) === !0, c = {
111
111
  x: o.x,
112
112
  y: o.y,
113
113
  rotation: o.rotation,
@@ -120,13 +120,13 @@ function Z(r, o, i) {
120
120
  borderRadius: o.borderRadius || 0
121
121
  }
122
122
  };
123
- if (a) {
124
- const t = r.canvas;
123
+ if (i) {
124
+ const n = r.canvas;
125
125
  let d;
126
126
  if (typeof OffscreenCanvas < "u")
127
- d = new OffscreenCanvas(t.width, t.height);
127
+ d = new OffscreenCanvas(n.width, n.height);
128
128
  else if (typeof document < "u")
129
- d = document.createElement("canvas"), d.width = t.width, d.height = t.height;
129
+ d = document.createElement("canvas"), d.width = n.width, d.height = n.height;
130
130
  else {
131
131
  k(r, c);
132
132
  return;
@@ -144,47 +144,47 @@ function Z(r, o, i) {
144
144
  function J(r, o) {
145
145
  if (typeof OffscreenCanvas < "u")
146
146
  return new OffscreenCanvas(r, o);
147
- const i = document.createElement("canvas");
148
- return i.width = r, i.height = o, i;
147
+ const a = document.createElement("canvas");
148
+ return a.width = r, a.height = o, a;
149
149
  }
150
150
  function $(r, o) {
151
151
  var e;
152
- const i = o.opacity ?? 1, s = !!((e = o.stroke) != null && e.enabled);
153
- i < 1 && s ? V(r, o, i) : w(r, o, i);
152
+ const a = o.opacity ?? 1, s = !!((e = o.stroke) != null && e.enabled);
153
+ a < 1 && s ? V(r, o, a) : w(r, o, a);
154
154
  }
155
- function V(r, o, i) {
155
+ function V(r, o, a) {
156
156
  var d;
157
- const s = o.transformData, e = (((d = o.stroke) == null ? void 0 : d.width) || 2) + 2, n = Math.ceil(s.width + e * 2), f = Math.ceil(s.height + e * 2), a = J(n, f), c = a.getContext("2d");
157
+ const s = o.transformData, e = (((d = o.stroke) == null ? void 0 : d.width) || 2) + 2, t = Math.ceil(s.width + e * 2), f = Math.ceil(s.height + e * 2), i = J(t, f), c = i.getContext("2d");
158
158
  if (!c) {
159
- w(r, o, i);
159
+ w(r, o, a);
160
160
  return;
161
161
  }
162
- const t = {
162
+ const n = {
163
163
  ...o,
164
- x: n / 2,
164
+ x: t / 2,
165
165
  y: f / 2
166
166
  };
167
- w(c, t, 1), r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180), r.globalAlpha = i, r.drawImage(a, -n / 2, -f / 2), r.restore();
167
+ w(c, n, 1), r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180), r.globalAlpha = a, r.drawImage(i, -t / 2, -f / 2), r.restore();
168
168
  }
169
- function w(r, o, i) {
169
+ function w(r, o, a) {
170
170
  var e;
171
171
  const s = o.transformData, h = s.fillOpacity ?? 1;
172
- if (r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180), r.globalAlpha = i * h, r.fillStyle = X(r, s), r.beginPath(), T(r, s), r.fill(), r.restore(), (e = o.stroke) != null && e.enabled) {
172
+ if (r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180), r.globalAlpha = a * h, r.fillStyle = X(r, s), r.beginPath(), M(r, s), r.fill(), r.restore(), (e = o.stroke) != null && e.enabled) {
173
173
  r.save(), r.translate(o.x, o.y), o.rotation && r.rotate(-o.rotation * Math.PI / 180);
174
- const n = o.stroke;
175
- r.globalAlpha = i * (n.opacity ?? 1), r.strokeStyle = n.color || "#000000", r.lineWidth = n.width || 2, r.lineCap = n.lineCap || "round", r.lineJoin = n.lineJoin || "round", r.beginPath(), T(r, s), r.stroke(), r.restore();
174
+ const t = o.stroke;
175
+ r.globalAlpha = a * (t.opacity ?? 1), r.strokeStyle = t.color || "#000000", r.lineWidth = t.width || 2, r.lineCap = t.lineCap || "round", r.lineJoin = t.lineJoin || "round", r.beginPath(), M(r, s), r.stroke(), r.restore();
176
176
  }
177
177
  }
178
- function T(r, o) {
179
- const { shapeType: i, width: s, height: h } = o;
180
- switch (i) {
178
+ function M(r, o) {
179
+ const { shapeType: a, width: s, height: h } = o;
180
+ switch (a) {
181
181
  case "rectangle": {
182
- const e = o.borderRadius || 0, n = -s / 2, f = -h / 2;
182
+ const e = o.borderRadius || 0, t = -s / 2, f = -h / 2;
183
183
  if (e > 0) {
184
- const a = Math.min(e / 100 * Math.min(s, h), s / 2, h / 2);
185
- r.roundRect(n, f, s, h, a);
184
+ const i = Math.min(e / 100 * Math.min(s, h), s / 2, h / 2);
185
+ r.roundRect(t, f, s, h, i);
186
186
  } else
187
- r.rect(n, f, s, h);
187
+ r.rect(t, f, s, h);
188
188
  break;
189
189
  }
190
190
  case "circle": {
@@ -197,31 +197,31 @@ function T(r, o) {
197
197
  break;
198
198
  }
199
199
  case "triangle": {
200
- const e = s / 2, n = h / 2;
201
- r.moveTo(0, -n), r.lineTo(e, n), r.lineTo(-e, n), r.closePath();
200
+ const e = s / 2, t = h / 2;
201
+ r.moveTo(0, -t), r.lineTo(e, t), r.lineTo(-e, t), r.closePath();
202
202
  break;
203
203
  }
204
204
  case "polygon": {
205
- const e = o.sides || 5, n = Math.min(s, h) / 2;
205
+ const e = o.sides || 5, t = Math.min(s, h) / 2;
206
206
  for (let f = 0; f < e; f++) {
207
- const a = f * 2 * Math.PI / e - Math.PI / 2, c = n * Math.cos(a), t = n * Math.sin(a);
208
- f === 0 ? r.moveTo(c, t) : r.lineTo(c, t);
207
+ const i = f * 2 * Math.PI / e - Math.PI / 2, c = t * Math.cos(i), n = t * Math.sin(i);
208
+ f === 0 ? r.moveTo(c, n) : r.lineTo(c, n);
209
209
  }
210
210
  r.closePath();
211
211
  break;
212
212
  }
213
213
  case "star": {
214
- const e = o.points || 5, n = Math.min(s, h) / 2, f = n * (o.innerRadius || 0.4);
215
- for (let a = 0; a < e * 2; a++) {
216
- const c = a * Math.PI / e - Math.PI / 2, t = a % 2 === 0 ? n : f, d = t * Math.cos(c), g = t * Math.sin(c);
217
- a === 0 ? r.moveTo(d, g) : r.lineTo(d, g);
214
+ const e = o.points || 5, t = Math.min(s, h) / 2, f = t * (o.innerRadius || 0.4);
215
+ for (let i = 0; i < e * 2; i++) {
216
+ const c = i * Math.PI / e - Math.PI / 2, n = i % 2 === 0 ? t : f, d = n * Math.cos(c), g = n * Math.sin(c);
217
+ i === 0 ? r.moveTo(d, g) : r.lineTo(d, g);
218
218
  }
219
219
  r.closePath();
220
220
  break;
221
221
  }
222
222
  case "line": {
223
- const e = s / 2, n = h / 2;
224
- r.rect(-e, -n, s, h);
223
+ const e = s / 2, t = h / 2;
224
+ r.rect(-e, -t, s, h);
225
225
  break;
226
226
  }
227
227
  default:
@@ -231,69 +231,70 @@ function T(r, o) {
231
231
  export {
232
232
  rr as AlignmentSnapSystem,
233
233
  io as AnyElementConfigSchema,
234
- ao as AnyTransformDataSchema,
235
- _r as ArchTransform,
236
- Br as ArtboardManager,
234
+ ho as AnyTransformDataSchema,
235
+ Br as ArchTransform,
236
+ Kr as ArtboardManager,
237
237
  or as ArtboardRenderer,
238
- Kr as AscendTransform,
238
+ Ur as AscendTransform,
239
239
  sr as CanvasRenderer,
240
- ho as CanvasStateV1Schema,
241
- Ur as CircleTransform,
242
- Yr as CustomTransform,
240
+ co as CanvasStateV1Schema,
241
+ Yr as CircleTransform,
242
+ Jr as CustomTransform,
243
243
  hr as DEFAULT_MAX_BITMAP_DIMENSION,
244
- Jr as ElementStore,
244
+ Vr as ElementStore,
245
245
  cr as ExportManager,
246
- Vr as FlagTransform,
247
- qr as HybridHistoryManager,
246
+ qr as FlagTransform,
247
+ Gr as HybridHistoryManager,
248
248
  dr as ImportManager,
249
249
  er as InteractionStateMachine,
250
- Gr as LeanTransform,
251
- Qr as LogLevel,
252
- nr as ResizePipeline,
253
- co as SerializedArtboardSchema,
254
- tr as SpacingSystem,
255
- ir as TransformHandles,
256
- Zr as WaveTransform,
250
+ Qr as LeanTransform,
251
+ Zr as LogLevel,
252
+ tr as ResizePipeline,
253
+ fo as SerializedArtboardSchema,
254
+ nr as SpacingSystem,
255
+ ar as TransformHandles,
256
+ $r as WaveTransform,
257
257
  fr as WorkerExportManager,
258
258
  gr as applySpaceLayoutRules,
259
259
  lr as applyStrokeStyle,
260
260
  ur as buildFontString,
261
- $r as calculateFixedCornerPosition,
262
- xr as calculateResizeHandles,
263
- Dr as calculateRotationHandlePosition,
261
+ xr as calculateFixedCornerPosition,
262
+ Dr as calculateResizeHandles,
263
+ ro as calculateRotationHandlePosition,
264
264
  pr as clearImageBitmapCache,
265
265
  yr as clearMaskCache,
266
266
  kr as clearRegisteredBitmapKeys,
267
267
  vr as createCirclePath,
268
268
  wr as createImagePath,
269
269
  F as createLogger,
270
- Mr as createRectPath,
271
- Tr as createTextPath,
272
- Cr as getFontMetrics,
270
+ Cr as createRectPath,
271
+ Mr as createTextPath,
272
+ Tr as getFontMetrics,
273
273
  Sr as getSharedWorkerExportManager,
274
- ro as hitTestCircle,
275
- oo as hitTestRect,
274
+ oo as hitTestCircle,
275
+ so as hitTestRect,
276
276
  br as invalidateMaskCache,
277
- so as logger,
278
- Pr as measureTextWidth,
279
- Ir as removeFromImageBitmapCache,
280
- mr as renderCustomTransform,
277
+ Pr as loadExportWorkerCode,
278
+ eo as logger,
279
+ Ir as measureTextWidth,
280
+ mr as removeFromImageBitmapCache,
281
+ Ar as renderCustomTransform,
281
282
  Z as renderImageElement,
282
283
  k as renderImageStroke,
283
- Ar as renderMultilineText,
284
- Rr as renderPathStroke,
285
- Wr as renderRichTextFillOnly,
284
+ Rr as renderMultilineText,
285
+ Wr as renderPathStroke,
286
+ Er as renderRichTextFillOnly,
286
287
  $ as renderShapeElement,
287
- Er as renderTextElement,
288
- Or as renderTextFillOnly,
289
- Hr as renderTextStroke,
290
- jr as renderWithKnockout,
291
- Fr as renderWithMasks,
288
+ Or as renderTextElement,
289
+ Hr as renderTextFillOnly,
290
+ jr as renderTextStroke,
291
+ Fr as renderWithKnockout,
292
+ Lr as renderWithMasks,
292
293
  Q as resolveServerCrop,
293
- eo as splitRichTextIntoLines,
294
- Lr as terminateSharedWorkerExportManager,
295
- Xr as unregisterElementBitmaps,
294
+ to as splitRichTextIntoLines,
295
+ Xr as terminateSharedWorkerExportManager,
296
+ zr as unregisterElementBitmaps,
296
297
  no as wrapRichTextSpans,
297
- zr as wrapText
298
+ Nr as wrapText
298
299
  };
299
300
  //# sourceMappingURL=internals.mjs.map