geoiq-frontend-ui-kit 2.0.5 → 2.0.6

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 (178) hide show
  1. package/dist/index100.es.js +42 -23
  2. package/dist/index100.es.js.map +1 -1
  3. package/dist/index101.es.js +33 -62
  4. package/dist/index101.es.js.map +1 -1
  5. package/dist/index102.es.js +21 -9
  6. package/dist/index102.es.js.map +1 -1
  7. package/dist/index103.es.js +88 -22
  8. package/dist/index103.es.js.map +1 -1
  9. package/dist/index104.es.js +17 -9
  10. package/dist/index104.es.js.map +1 -1
  11. package/dist/index105.es.js +13 -67
  12. package/dist/index105.es.js.map +1 -1
  13. package/dist/index106.es.js +21 -185
  14. package/dist/index106.es.js.map +1 -1
  15. package/dist/index107.es.js +11 -23
  16. package/dist/index107.es.js.map +1 -1
  17. package/dist/index108.es.js +69 -198
  18. package/dist/index108.es.js.map +1 -1
  19. package/dist/index109.es.js +9 -43
  20. package/dist/index109.es.js.map +1 -1
  21. package/dist/index11.es.js +1 -1
  22. package/dist/index110.es.js +65 -37
  23. package/dist/index110.es.js.map +1 -1
  24. package/dist/index111.es.js +184 -47
  25. package/dist/index111.es.js.map +1 -1
  26. package/dist/index112.es.js +23 -181
  27. package/dist/index112.es.js.map +1 -1
  28. package/dist/index113.es.js +201 -20
  29. package/dist/index113.es.js.map +1 -1
  30. package/dist/index114.es.js +13 -35
  31. package/dist/index114.es.js.map +1 -1
  32. package/dist/index115.es.js +88 -58
  33. package/dist/index115.es.js.map +1 -1
  34. package/dist/index116.es.js +27 -84
  35. package/dist/index116.es.js.map +1 -1
  36. package/dist/index117.es.js +23 -15
  37. package/dist/index117.es.js.map +1 -1
  38. package/dist/index118.es.js +34 -8
  39. package/dist/index118.es.js.map +1 -1
  40. package/dist/index119.es.js +179 -29
  41. package/dist/index119.es.js.map +1 -1
  42. package/dist/index12.es.js +1 -1
  43. package/dist/index120.es.js +32 -11
  44. package/dist/index120.es.js.map +1 -1
  45. package/dist/index121.es.js +19 -92
  46. package/dist/index121.es.js.map +1 -1
  47. package/dist/index122.es.js +13 -27
  48. package/dist/index122.es.js.map +1 -1
  49. package/dist/index123.es.js +7 -15
  50. package/dist/index123.es.js.map +1 -1
  51. package/dist/index124.es.js +98 -20
  52. package/dist/index124.es.js.map +1 -1
  53. package/dist/index125.es.js +61 -9
  54. package/dist/index125.es.js.map +1 -1
  55. package/dist/index126.es.js +54 -97
  56. package/dist/index126.es.js.map +1 -1
  57. package/dist/index127.es.js +16 -64
  58. package/dist/index127.es.js.map +1 -1
  59. package/dist/index128.es.js +96 -50
  60. package/dist/index128.es.js.map +1 -1
  61. package/dist/index129.es.js +11 -13
  62. package/dist/index129.es.js.map +1 -1
  63. package/dist/index130.es.js +147 -99
  64. package/dist/index130.es.js.map +1 -1
  65. package/dist/index131.es.js +6 -13
  66. package/dist/index131.es.js.map +1 -1
  67. package/dist/index132.es.js +48 -148
  68. package/dist/index132.es.js.map +1 -1
  69. package/dist/index133.es.js +42 -13
  70. package/dist/index133.es.js.map +1 -1
  71. package/dist/index134.es.js +35 -269
  72. package/dist/index134.es.js.map +1 -1
  73. package/dist/index135.es.js +22 -25
  74. package/dist/index135.es.js.map +1 -1
  75. package/dist/index136.es.js +11 -7
  76. package/dist/index136.es.js.map +1 -1
  77. package/dist/index137.es.js +33 -40
  78. package/dist/index137.es.js.map +1 -1
  79. package/dist/index138.es.js +63 -37
  80. package/dist/index138.es.js.map +1 -1
  81. package/dist/index139.es.js +268 -39
  82. package/dist/index139.es.js.map +1 -1
  83. package/dist/index141.es.js +16 -5
  84. package/dist/index141.es.js.map +1 -1
  85. package/dist/index142.es.js +5 -11
  86. package/dist/index142.es.js.map +1 -1
  87. package/dist/index143.es.js +10 -10
  88. package/dist/index143.es.js.map +1 -1
  89. package/dist/index144.es.js +11 -2
  90. package/dist/index144.es.js.map +1 -1
  91. package/dist/index145.es.js +2 -44
  92. package/dist/index145.es.js.map +1 -1
  93. package/dist/index146.es.js +7 -12
  94. package/dist/index146.es.js.map +1 -1
  95. package/dist/index147.es.js +22 -6
  96. package/dist/index147.es.js.map +1 -1
  97. package/dist/index148.es.js +168 -21
  98. package/dist/index148.es.js.map +1 -1
  99. package/dist/index149.es.js +79 -167
  100. package/dist/index149.es.js.map +1 -1
  101. package/dist/index150.es.js +67 -75
  102. package/dist/index150.es.js.map +1 -1
  103. package/dist/index151.es.js +3 -72
  104. package/dist/index151.es.js.map +1 -1
  105. package/dist/index152.es.js +56 -5
  106. package/dist/index152.es.js.map +1 -1
  107. package/dist/index153.es.js +120 -56
  108. package/dist/index153.es.js.map +1 -1
  109. package/dist/index154.es.js +398 -113
  110. package/dist/index154.es.js.map +1 -1
  111. package/dist/index155.es.js +25 -398
  112. package/dist/index155.es.js.map +1 -1
  113. package/dist/index156.es.js +61 -25
  114. package/dist/index156.es.js.map +1 -1
  115. package/dist/index157.es.js +29 -64
  116. package/dist/index157.es.js.map +1 -1
  117. package/dist/index158.es.js +21 -29
  118. package/dist/index158.es.js.map +1 -1
  119. package/dist/index159.es.js +36 -23
  120. package/dist/index159.es.js.map +1 -1
  121. package/dist/index16.es.js +1 -1
  122. package/dist/index160.es.js +211 -37
  123. package/dist/index160.es.js.map +1 -1
  124. package/dist/index161.es.js +143 -211
  125. package/dist/index161.es.js.map +1 -1
  126. package/dist/index162.es.js +136 -136
  127. package/dist/index162.es.js.map +1 -1
  128. package/dist/index163.es.js +46 -143
  129. package/dist/index163.es.js.map +1 -1
  130. package/dist/index164.es.js +353 -45
  131. package/dist/index164.es.js.map +1 -1
  132. package/dist/index165.es.js +41 -352
  133. package/dist/index165.es.js.map +1 -1
  134. package/dist/index166.es.js +12 -2
  135. package/dist/index166.es.js.map +1 -1
  136. package/dist/index167.es.js +2 -25
  137. package/dist/index167.es.js.map +1 -1
  138. package/dist/index168.es.js +21 -12
  139. package/dist/index168.es.js.map +1 -1
  140. package/dist/index170.es.js +1 -1
  141. package/dist/index171.es.js +2 -2
  142. package/dist/index173.es.js +1 -1
  143. package/dist/index174.es.js +2 -2
  144. package/dist/index175.es.js +2 -2
  145. package/dist/index176.es.js +2 -2
  146. package/dist/index180.es.js +1 -1
  147. package/dist/index181.es.js +1 -1
  148. package/dist/index182.es.js +1 -1
  149. package/dist/index183.es.js +1 -1
  150. package/dist/index184.es.js +1 -1
  151. package/dist/index185.es.js +1 -1
  152. package/dist/index186.es.js +1 -1
  153. package/dist/index188.es.js +1 -1
  154. package/dist/index19.es.js +1 -1
  155. package/dist/index20.es.js +1 -1
  156. package/dist/index21.es.js +1 -1
  157. package/dist/index23.es.js +2 -2
  158. package/dist/index27.es.js +1 -1
  159. package/dist/index29.es.js +1 -1
  160. package/dist/index30.es.js +2 -2
  161. package/dist/index32.es.js +1 -1
  162. package/dist/index34.es.js +1 -1
  163. package/dist/index35.es.js +1 -1
  164. package/dist/index47.es.js +4 -4
  165. package/dist/index48.es.js +2 -2
  166. package/dist/index49.es.js +1 -1
  167. package/dist/index50.es.js +1 -1
  168. package/dist/index55.es.js +1 -1
  169. package/dist/index56.es.js +1 -1
  170. package/dist/index59.es.js +1 -1
  171. package/dist/index61.es.js +1 -1
  172. package/dist/index69.es.js +2 -2
  173. package/dist/index70.es.js +1 -1
  174. package/dist/index72.es.js +5 -5
  175. package/dist/index73.es.js +1 -1
  176. package/dist/index74.es.js +7 -7
  177. package/dist/index87.es.js +1 -1
  178. package/package.json +1 -1
@@ -1,358 +1,47 @@
1
- import { pushHistory as f, popHistory as O } from "./index156.es.js";
2
- import { emitChange as P } from "./index154.es.js";
3
- import { MULTI_POINT_SHAPES as R, render as t, paintLayer as S, onRotateHandle as A, layerCenter as b, onResizeHandle as T, isMultiPoint as I, layerBounds as v, DIRECTIONAL_SHAPES as z, rotatePoint as C, clampBoxWidth as W, clampTextSize as _, renderOverlay as g, normRect as F, toLayerSpace as D } from "./index155.es.js";
4
- import { setMode as k, selectLayer as x } from "./index158.es.js";
5
- import { openTextEditor as N } from "./index159.es.js";
6
- function a(n, l) {
7
- const r = n.dragMode && n.dragRect ? n.dragRect : n.overlayEl.getBoundingClientRect(), o = (l.clientX - r.left) / r.width * n.sourceCanvas.width, e = (l.clientY - r.top) / r.height * n.sourceCanvas.height;
8
- return {
9
- x: Math.min(Math.max(o, 0), n.sourceCanvas.width),
10
- y: Math.min(Math.max(e, 0), n.sourceCanvas.height)
11
- };
12
- }
13
- function J(n, l) {
14
- if (!l) return n;
15
- const r = l * Math.PI / 180, o = Math.abs(Math.cos(r)), e = Math.abs(Math.sin(r)), d = n.w * o + n.h * e, i = n.w * e + n.h * o, c = n.x + n.w / 2, h = n.y + n.h / 2;
16
- return { x: c - d / 2, y: h - i / 2, w: d, h: i };
17
- }
18
- function q(n) {
19
- return n.type !== "shape" ? 0 : z.includes(n.shape) || n.fill !== "fill" ? (n.width || 0) / 2 : 0;
20
- }
21
- function K(n, l) {
22
- const r = J(v(n, l), l.rotation), o = q(l), e = {
23
- x: r.x - o,
24
- y: r.y - o,
25
- w: r.w + o * 2,
26
- h: r.h + o * 2
27
- }, d = Math.min(Math.max(e.x, 0), n.sourceCanvas.width - e.w) - e.x, i = Math.min(Math.max(e.y, 0), n.sourceCanvas.height - e.h) - e.y;
28
- !d && !i || (l.type === "stroke" ? l.points = l.points.map((c) => ({ x: c.x + d, y: c.y + i })) : (l.x += d, l.y += i));
29
- }
30
- function m(n, l) {
31
- const { layers: r } = n;
32
- for (let o = r.length - 1; o >= 0; o--) {
33
- const e = v(n, r[o]), d = D(n, r[o], l);
34
- if (d.x >= e.x - 6 && d.x <= e.x + e.w + 6 && d.y >= e.y - 6 && d.y <= e.y + e.h + 6)
35
- return r[o];
36
- }
37
- return null;
38
- }
39
- function H() {
40
- return typeof window < "u" && window.matchMedia && window.matchMedia("(pointer: coarse)").matches ? 40 : 22;
41
- }
42
- const E = Math.PI / 8, B = 4;
43
- function nn(n) {
44
- const l = n.pendingPoly;
45
- if (!l)
46
- return { active: !1, pointCount: 0, canFinish: !1, canClose: !1 };
47
- const r = l.layer.points.length;
48
- return { active: !0, pointCount: r, canFinish: r >= 2, canClose: r >= 3 };
49
- }
50
- function L(n, l, r) {
51
- if (!r || !n) return l;
52
- const o = l.x - n.x, e = l.y - n.y, d = Math.hypot(o, e);
53
- if (!d) return l;
54
- const i = Math.round(Math.atan2(e, o) / E) * E;
55
- return {
56
- x: n.x + Math.cos(i) * d,
57
- y: n.y + Math.sin(i) * d
58
- };
59
- }
60
- function on(n) {
61
- const l = n.pendingPoly;
62
- if (l) {
63
- if (l.layer.points.length <= 1) {
64
- Z(n);
65
- return;
66
- }
67
- l.layer.points.pop(), n.statusText = `${l.layer.points.length} point${l.layer.points.length === 1 ? "" : "s"} — Backspace removes the last`, w(n), n.notify();
68
- }
69
- }
70
- function U(n, l, r) {
71
- n.pendingPoly = { layer: l, preview: r }, l.points = [{ x: r.x, y: r.y }], delete l.w, delete l.h, n.statusText = "Click to add points · double-click to finish · Esc cancels", w(n), n.notify();
72
- }
73
- function w(n) {
74
- const l = n.pendingPoly;
75
- if (!l) return;
76
- const r = n.octx, o = l.layer.points;
77
- r.clearRect(0, 0, n.overlayEl.width, n.overlayEl.height), n.layers.forEach((h) => S(n, r, h));
78
- const e = {
79
- ...l.layer,
80
- points: l.preview ? o.concat([l.preview]) : o
81
- };
82
- e.points.length >= 2 && S(n, r, e);
83
- const d = 1 / (n.viewScale || 1), i = 5 * d;
84
- r.save(), r.lineWidth = 2 * d, o.forEach((h, y) => {
85
- y !== 0 && (r.beginPath(), r.arc(h.x, h.y, i, 0, Math.PI * 2), r.fillStyle = "#ffffff", r.strokeStyle = l.layer.color, r.fill(), r.stroke());
86
- });
87
- const c = o[0];
88
- if (c) {
89
- const h = o.length >= 3 && l.preview && Math.hypot(l.preview.x - c.x, l.preview.y - c.y) <= H();
90
- r.beginPath(), r.arc(c.x, c.y, (h ? 11 : 7) * d, 0, Math.PI * 2), r.fillStyle = h ? l.layer.color : "#ffffff", r.strokeStyle = l.layer.color, r.lineWidth = (h ? 3 : 2) * d, r.fill(), r.stroke(), h && (r.beginPath(), r.arc(c.x, c.y, 4 * d, 0, Math.PI * 2), r.fillStyle = "#ffffff", r.fill());
91
- }
92
- r.restore(), V(n, o.length);
93
- }
94
- function V(n, l) {
95
- const r = n.octx, o = 1 / (n.viewScale || 1), e = 10 * o, d = 13 * o, i = typeof window < "u" && window.matchMedia && window.matchMedia("(pointer: coarse)").matches, c = i ? "Tap" : "Click";
96
- let h;
97
- l < 2 ? h = `${c} to place the next point` : i ? h = l < 3 ? `${c} to add points · use the bar below to finish` : `${c} the first point to close · or finish below` : h = l < 3 ? "Double-click or Enter to finish · Backspace undoes · Esc cancels" : "Click the first point to close · Double-click to finish · Backspace undoes", r.save(), r.font = `${d}px Avenir Next, Segoe UI, sans-serif`, r.textBaseline = "top";
98
- const y = r.measureText(h).width;
99
- r.fillStyle = "rgba(17,17,17,.82)", r.beginPath();
100
- const p = e, u = e, M = y + e * 2, s = d + e * 1.4;
101
- r.roundRect ? r.roundRect(p, u, M, s, 6 * o) : r.rect(p, u, M, s), r.fill(), r.fillStyle = "#ffffff", r.fillText(h, p + e, u + e * 0.6), r.restore();
102
- }
103
- function rn(n, l) {
104
- const r = n.layers.find((o) => o.id === n.selectedId);
105
- !r || r.type !== "shape" || R.includes(r.shape) && (f(n), (!r.points || r.points.length < 2) && (r.points = [
106
- { x: r.x, y: r.y },
107
- { x: r.x + (r.w || 0), y: r.y + (r.h || 0) }
108
- ]), delete r.w, delete r.h, r.closed = !1, n.selectedId = null, n.mode = "shape", n.multiPointMode = !0, n.pendingPoly = { layer: r, preview: r.points[r.points.length - 1] }, n.statusText = "Continuing line — click to add points · double-click to finish", w(n), n.notify());
109
- }
110
- function $(n, l) {
111
- const r = n.pendingPoly;
112
- if (!r) return;
113
- const o = r.layer;
114
- if (n.pendingPoly = null, o.points.length < 2) {
115
- n.layers = n.layers.filter((e) => e.id !== o.id), O(n), k(n, "select"), t(n), n.notify();
116
- return;
117
- }
118
- o.closed = !!l, n.layers.some((e) => e.id === o.id) || n.layers.push(o), n.mode = "shape", x(n, o.id), n.statusText = l ? "Shape closed — click to start another" : "Line added — click to start another", t(n), P(n);
119
- }
120
- function Z(n) {
121
- const l = n.pendingPoly;
122
- l && (n.pendingPoly = null, n.layers = n.layers.filter((r) => r.id !== l.layer.id), O(n), t(n), n.statusText = "Cancelled", n.notify());
123
- }
124
- function en(n, l) {
125
- if (!n.sourceCanvas.width || n.dragMode) return;
126
- n.overlayEl.setPointerCapture(l.pointerId), n.activePointerId = l.pointerId, n.dragRect = n.overlayEl.getBoundingClientRect();
127
- const r = a(n, l);
128
- if (n.pendingPoly) {
129
- const o = n.pendingPoly.layer.points, e = o[0];
130
- if (o.length >= 3 && Math.hypot(r.x - e.x, r.y - e.y) <= H()) {
131
- $(n, !0);
132
- return;
133
- }
134
- const d = o[o.length - 1], i = L(d, r, l.shiftKey);
135
- (!d || Math.hypot(i.x - d.x, i.y - d.y) > B) && o.push({ x: i.x, y: i.y }), n.pendingPoly.preview = i, w(n);
136
- return;
137
- }
138
- if (n.mode === "select") {
139
- const o = n.selectedId != null ? n.layers.find((i) => i.id === n.selectedId) : null;
140
- if (o && A(n, r, o)) {
141
- const i = b(n, o);
142
- n.dragMode = "rotate", n.rotateStart = {
143
- center: i,
144
- angle: Math.atan2(r.y - i.y, r.x - i.x),
145
- rotation: o.rotation || 0
146
- }, f(n);
147
- return;
148
- }
149
- const e = o ? T(n, r, o) : null;
150
- if (e) {
151
- if (n.dragMode = "resize", n.resizeCorner = e, n.dragStart = r, n.dragOrig = JSON.parse(JSON.stringify(o)), o.type === "shape" && I(o)) {
152
- const i = v(n, o), c = e === "tl" || e === "bl", h = e === "tl" || e === "tr";
153
- n.resizeAnchor = {
154
- x: c ? i.x + i.w : i.x,
155
- y: h ? i.y + i.h : i.y
156
- }, n.dragOrig._bounds = {
157
- w: c ? -i.w : i.w,
158
- h: h ? -i.h : i.h
159
- }, n.dragOrig._anchorPt = {
160
- x: n.resizeAnchor.x,
161
- y: n.resizeAnchor.y
162
- };
163
- } else if (o.type === "shape" && z.includes(o.shape))
164
- n.resizeAnchor = e === "start" ? { x: o.x + o.w, y: o.y + o.h } : { x: o.x, y: o.y };
165
- else {
166
- const i = v(n, o), c = e === "tl" || e === "bl";
167
- n.resizeAnchor = {
168
- x: c ? i.x + i.w : i.x,
169
- // Text keeps its top edge: its height follows the wrapping.
170
- y: o.type === "text" ? i.y : e === "tl" || e === "tr" ? i.y + i.h : i.y
171
- };
1
+ import { cva as r } from "class-variance-authority";
2
+ const s = r(
3
+ `relative flex h-12 w-11 items-center justify-center border-y border-r border-input text-light-1 transition-all
4
+ first:rounded-l-md first:border-l last:rounded-r-md`,
5
+ {
6
+ variants: {
7
+ isError: {
8
+ true: "",
9
+ false: ""
10
+ },
11
+ isFocused: {
12
+ true: "",
13
+ false: ""
172
14
  }
173
- n.resizeCenter = b(n, o), n.resizeAnchorWorld = C(
174
- n.resizeAnchor,
175
- n.resizeCenter,
176
- o.rotation || 0
177
- ), f(n);
178
- return;
179
- }
180
- const d = m(n, r);
181
- d ? (x(n, d.id), n.dragMode = "move", n.dragStart = r, n.dragOrig = JSON.parse(JSON.stringify(d)), f(n)) : x(n, null);
182
- } else if (n.mode === "text") {
183
- f(n);
184
- const o = {
185
- id: n.nextId++,
186
- type: "text",
187
- text: "Text",
188
- x: r.x,
189
- y: r.y,
190
- size: n.textSize,
191
- font: n.textFont,
192
- color: n.textColor,
193
- rotation: 0,
194
- flipH: !1,
195
- flipV: !1,
196
- boxWidth: 10
197
- };
198
- n.octx.font = `${o.size}px ${o.font}`;
199
- const e = n.octx.measureText(o.text).width;
200
- o.boxWidth = Math.round(Math.max(700, e + 40)), W(n, o), _(n, o), n.layers.push(o), k(n, "select"), x(n, o.id), N(n, o, !0);
201
- } else n.mode === "draw" ? (f(n), n.pendingStroke = {
202
- id: n.nextId++,
203
- type: "stroke",
204
- color: n.drawColor,
205
- width: n.brushSize,
206
- style: n.brushStyle,
207
- points: [r]
208
- }, n.dragMode = "draw") : n.mode === "shape" ? (f(n), n.pendingShape = {
209
- id: n.nextId++,
210
- type: "shape",
211
- shape: n.selectedShapeType,
212
- fill: n.shapeFill,
213
- width: n.shapeWidth,
214
- color: n.shapeColor,
215
- x: r.x,
216
- y: r.y,
217
- w: 0,
218
- h: 0,
219
- rotation: 0,
220
- flipH: !1,
221
- flipV: !1
222
- }, n.dragMode = "newshape", n.dragStart = r) : n.mode === "crop" && (n.dragMode = "crop", n.cropStart = r, n.cropRect = { x: r.x, y: r.y, w: 0, h: 0 });
223
- }
224
- function ln(n, l) {
225
- if (n.pendingPoly) {
226
- const o = n.pendingPoly.layer.points;
227
- n.pendingPoly.preview = L(
228
- o[o.length - 1],
229
- a(n, l),
230
- l.shiftKey
231
- ), w(n);
232
- return;
233
- }
234
- if (n.dragMode && n.activePointerId != null && l.pointerId !== n.activePointerId)
235
- return;
236
- if (!n.dragMode) {
237
- if (n.mode === "select") {
238
- const o = a(n, l), e = n.selectedId != null ? n.layers.find((i) => i.id === n.selectedId) : null, d = e ? T(n, o, e) : null;
239
- e && A(n, o, e) ? n.overlayEl.style.cursor = "grab" : d === "start" || d === "end" ? n.overlayEl.style.cursor = e.w >= 0 == e.h >= 0 ? "nwse-resize" : "nesw-resize" : d ? n.overlayEl.style.cursor = d === "tl" || d === "br" ? "nwse-resize" : "nesw-resize" : e && m(n, o) === e ? n.overlayEl.style.cursor = "move" : m(n, o) ? n.overlayEl.style.cursor = "pointer" : n.overlayEl.style.cursor = "default";
240
- }
241
- return;
242
- }
243
- const r = a(n, l);
244
- if (n.dragMode === "move") {
245
- const o = r.x - n.dragStart.x, e = r.y - n.dragStart.y, d = n.layers.find((i) => i.id === n.selectedId);
246
- d.type === "shape" && I(d) ? d.points = n.dragOrig.points.map((i) => ({
247
- x: i.x + o,
248
- y: i.y + e
249
- })) : d.type === "text" || d.type === "shape" || d.type === "sticker" ? (d.x = n.dragOrig.x + o, d.y = n.dragOrig.y + e) : d.type === "stroke" && (d.points = n.dragOrig.points.map((i) => ({
250
- x: i.x + o,
251
- y: i.y + e
252
- }))), K(n, d), g(n);
253
- } else if (n.dragMode === "resize") {
254
- const o = n.layers.find((i) => i.id === n.selectedId), e = o.rotation || 0, d = e ? C(r, n.resizeCenter, -e) : r;
255
- if (o.type === "text") {
256
- const i = n.resizeCorner === "tl" || n.resizeCorner === "bl";
257
- if (o.y = n.dragOrig.y, o.size = n.dragOrig.size, i) {
258
- const c = n.dragOrig.x + n.dragOrig.boxWidth;
259
- o.boxWidth = Math.max(20, c - d.x), o.x = c - o.boxWidth;
260
- } else
261
- o.x = n.dragOrig.x, o.boxWidth = Math.max(20, d.x - n.dragOrig.x);
262
- W(n, o), _(n, o), n.notify();
263
- } else if (o.type === "shape" && I(o)) {
264
- const i = n.resizeAnchor, c = n.dragOrig._bounds, h = 8, y = c.w > 0 ? (d.x - i.x) / (c.w || 1) : 1, p = c.h > 0 ? (d.y - i.y) / (c.h || 1) : 1, u = Math.abs(c.w * y) < h ? h / (c.w || 1) : y, M = Math.abs(c.h * p) < h ? h / (c.h || 1) : p;
265
- o.points = n.dragOrig.points.map((s) => ({
266
- x: i.x + (s.x - n.dragOrig._anchorPt.x) * u,
267
- y: i.y + (s.y - n.dragOrig._anchorPt.y) * M
268
- }));
269
- } else if (o.type === "shape" && z.includes(o.shape)) {
270
- const i = n.resizeAnchor, c = 8;
271
- let h = d.x - i.x, y = d.y - i.y;
272
- if (Math.hypot(h, y) < c) {
273
- const p = Math.atan2(y || 1, h || 1);
274
- h = c * Math.cos(p), y = c * Math.sin(p);
15
+ },
16
+ defaultVariants: {
17
+ isError: !1,
18
+ isFocused: !1
19
+ },
20
+ compoundVariants: [
21
+ {
22
+ isError: !0,
23
+ isFocused: !0,
24
+ className: "border-danger-2 ring-4 ring-danger-1"
25
+ },
26
+ {
27
+ isError: !1,
28
+ isFocused: !0,
29
+ className: "border-primary-2 ring-4 ring-primary-1"
30
+ },
31
+ {
32
+ isError: !0,
33
+ isFocused: !1,
34
+ className: "border-danger-2"
35
+ },
36
+ {
37
+ isError: !1,
38
+ isFocused: !1,
39
+ className: "border-neutral-2"
275
40
  }
276
- n.resizeCorner === "start" ? (o.x = i.x + h, o.y = i.y + y, o.w = -h, o.h = -y) : (o.x = i.x, o.y = i.y, o.w = h, o.h = y);
277
- } else if (o.type === "shape" || o.type === "sticker") {
278
- const i = n.resizeAnchor, c = 8;
279
- let h = d.x - i.x, y = d.y - i.y;
280
- Math.abs(h) < c && (h = i.x + c <= n.sourceCanvas.width ? c : -c), Math.abs(y) < c && (y = i.y + c <= n.sourceCanvas.height ? c : -c), o.x = Math.min(i.x, i.x + h), o.y = Math.min(i.y, i.y + y), o.w = Math.abs(h), o.h = Math.abs(y);
281
- }
282
- if (e) {
283
- const i = C(n.resizeAnchor, b(n, o), e);
284
- o.x += n.resizeAnchorWorld.x - i.x, o.y += n.resizeAnchorWorld.y - i.y;
285
- }
286
- g(n);
287
- } else if (n.dragMode === "rotate") {
288
- const o = n.layers.find((y) => y.id === n.selectedId), { center: e, angle: d, rotation: i } = n.rotateStart, c = Math.atan2(r.y - e.y, r.x - e.x) - d, h = i + c * 180 / Math.PI;
289
- o.rotation = (h % 360 + 360) % 360, g(n);
290
- } else if (n.dragMode === "draw")
291
- n.pendingStroke.points.push(r), n.octx.clearRect(0, 0, n.overlayEl.width, n.overlayEl.height), n.layers.forEach((o) => S(n, n.octx, o)), S(n, n.octx, n.pendingStroke);
292
- else if (n.dragMode === "newshape")
293
- n.pendingShape.w = r.x - n.dragStart.x, n.pendingShape.h = r.y - n.dragStart.y, g(n);
294
- else if (n.dragMode === "crop") {
295
- let o = r.x - n.cropStart.x, e = r.y - n.cropStart.y;
296
- if (n.cropRatio !== "free") {
297
- const d = parseFloat(n.cropRatio);
298
- e = Math.sign(e || 1) * Math.abs(o) / d;
299
- const i = e >= 0 ? n.sourceCanvas.height - n.cropStart.y : n.cropStart.y;
300
- Math.abs(e) > i && (e = Math.sign(e) * i, o = Math.sign(o || 1) * Math.abs(e) * d);
301
- }
302
- n.cropRect = { x: n.cropStart.x, y: n.cropStart.y, w: o, h: e }, g(n);
303
- }
304
- }
305
- function dn(n, l) {
306
- if (!(l && n.dragMode && n.activePointerId != null && l.pointerId !== n.activePointerId)) {
307
- if (n.dragMode === "draw" && n.pendingStroke)
308
- n.pendingStroke.points.length >= 1 && (n.layers.push(n.pendingStroke), x(n, n.pendingStroke.id)), n.pendingStroke = null, t(n), n.statusText = "Stroke added", P(n);
309
- else if (n.dragMode === "newshape" && n.pendingShape) {
310
- const r = Math.hypot(
311
- n.pendingShape.w || 0,
312
- n.pendingShape.h || 0
313
- );
314
- if (n.multiPointMode && R.includes(n.pendingShape.shape)) {
315
- const o = n.pendingShape, e = { x: o.x + (o.w || 0), y: o.y + (o.h || 0) };
316
- n.pendingShape = null, U(n, o, { x: o.x, y: o.y }), r > B && (o.points.push(e), n.pendingPoly.preview = e);
317
- } else if (Math.abs(n.pendingShape.w) > 3 || Math.abs(n.pendingShape.h) > 3) {
318
- n.layers.push(n.pendingShape);
319
- const o = n.pendingShape.id;
320
- n.pendingShape = null, k(n, "select"), x(n, o), n.statusText = "Shape added", P(n);
321
- } else
322
- n.pendingShape = null, g(n), n.notify();
323
- } else if (n.dragMode === "crop")
324
- n.cropRect && (n.cropRect = F(n.cropRect)), g(n), n.notify();
325
- else if (n.dragMode === "move" || n.dragMode === "resize" || n.dragMode === "rotate") {
326
- if (n.dragMode === "rotate") {
327
- const r = n.layers.find((o) => o.id === n.selectedId);
328
- r && (n.statusText = `Rotated to ${Math.round(r.rotation)}°`);
329
- }
330
- t(n), n.notify();
331
- }
332
- n.activePointerId != null && (n.overlayEl.hasPointerCapture(n.activePointerId) && n.overlayEl.releasePointerCapture(n.activePointerId), n.activePointerId = null), n.dragMode = null, n.dragStart = null, n.dragOrig = null, n.dragRect = null, n.resizeAnchor = null, n.resizeCenter = null, n.resizeAnchorWorld = null, n.rotateStart = null;
333
- }
334
- }
335
- function cn(n, l) {
336
- if (n.pendingPoly) {
337
- $(n, !1);
338
- return;
41
+ ]
339
42
  }
340
- if (n.mode !== "select") return;
341
- const r = a(n, l), o = m(n, r);
342
- o && o.type === "text" && (x(n, o.id), N(n, o, !1));
343
- }
43
+ );
344
44
  export {
345
- B as CLICK_SLOP,
346
- Z as cancelPoly,
347
- $ as finishPoly,
348
- m as hitLayer,
349
- cn as onDbl,
350
- en as onDown,
351
- ln as onMove,
352
- dn as onUp,
353
- nn as polyStatus,
354
- rn as resumePoly,
355
- a as toSource,
356
- on as undoPolyPoint
45
+ s as OTPInputVariants
357
46
  };
358
47
  //# sourceMappingURL=index165.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index165.es.js","sources":["../src/components/organisms/image-editor/engine/pointer.js"],"sourcesContent":["import { pushHistory, popHistory } from './history.js'\nimport { emitChange } from './state.js'\nimport {\n render,\n renderOverlay,\n paintLayer,\n layerBounds,\n onResizeHandle,\n normRect,\n clampTextSize,\n clampBoxWidth,\n onRotateHandle,\n layerCenter,\n rotatePoint,\n toLayerSpace,\n DIRECTIONAL_SHAPES,\n MULTI_POINT_SHAPES,\n isMultiPoint,\n} from './rendering.js'\nimport { setMode, selectLayer } from './mode.js'\nimport { openTextEditor } from './text-editor.js'\n\nexport function toSource(state, e) {\n // While actively dragging, use the rect captured at pointerdown instead of\n // re-querying live — on mobile the browser's address-bar/toolbar chrome\n // can collapse mid-gesture (typically ~1s in) and reflow the canvas out\n // from under the drag. Since this is (pointer position - element origin),\n // a rect that shifts mid-drag snaps the result toward 0 (leftmost/\n // smallest), which is exactly what re-querying every move would do.\n const r =\n state.dragMode && state.dragRect\n ? state.dragRect\n : state.overlayEl.getBoundingClientRect()\n const x = ((e.clientX - r.left) / r.width) * state.sourceCanvas.width\n const y = ((e.clientY - r.top) / r.height) * state.sourceCanvas.height\n return {\n x: Math.min(Math.max(x, 0), state.sourceCanvas.width),\n y: Math.min(Math.max(y, 0), state.sourceCanvas.height),\n }\n}\n\nfunction rotatedAABB(b, rotationDeg) {\n if (!rotationDeg) return b\n const rad = (rotationDeg * Math.PI) / 180\n const cos = Math.abs(Math.cos(rad)),\n sin = Math.abs(Math.sin(rad))\n const w = b.w * cos + b.h * sin,\n h = b.w * sin + b.h * cos\n const cx = b.x + b.w / 2,\n cy = b.y + b.h / 2\n return { x: cx - w / 2, y: cy - h / 2, w, h }\n}\n\nfunction strokeMargin(L) {\n if (L.type !== 'shape') return 0\n const alwaysStroked = DIRECTIONAL_SHAPES.includes(L.shape)\n return alwaysStroked || L.fill !== 'fill' ? (L.width || 0) / 2 : 0\n}\n\nfunction clampLayerToCanvas(state, L) {\n const rotated = rotatedAABB(layerBounds(state, L), L.rotation)\n const margin = strokeMargin(L)\n const b = {\n x: rotated.x - margin,\n y: rotated.y - margin,\n w: rotated.w + margin * 2,\n h: rotated.h + margin * 2,\n }\n const dx = Math.min(Math.max(b.x, 0), state.sourceCanvas.width - b.w) - b.x\n const dy = Math.min(Math.max(b.y, 0), state.sourceCanvas.height - b.h) - b.y\n if (!dx && !dy) return\n if (L.type === 'stroke') {\n L.points = L.points.map((pt) => ({ x: pt.x + dx, y: pt.y + dy }))\n } else {\n L.x += dx\n L.y += dy\n }\n}\n\nexport function hitLayer(state, p) {\n const { layers } = state\n for (let i = layers.length - 1; i >= 0; i--) {\n const b = layerBounds(state, layers[i])\n const q = toLayerSpace(state, layers[i], p)\n if (\n q.x >= b.x - 6 &&\n q.x <= b.x + b.w + 6 &&\n q.y >= b.y - 6 &&\n q.y <= b.y + b.h + 6\n )\n return layers[i]\n }\n return null\n}\n\n// --- multi-point (\"extended\") line sessions -------------------------------\n\n// Fingers are far less precise than a cursor, so coarse pointers get a target\n// near the 44px accessibility minimum.\nfunction closeHitRadius() {\n const coarse =\n typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(pointer: coarse)').matches\n return coarse ? 40 : 22\n}\nconst SNAP_STEP = Math.PI / 8\n// Below this drag distance a pointer gesture counts as a click, not a drag.\nexport const CLICK_SLOP = 4\n\nexport function isPolyActive(state) {\n return !!state.pendingPoly\n}\n\nexport function polyStatus(state) {\n const poly = state.pendingPoly\n if (!poly)\n return { active: false, pointCount: 0, canFinish: false, canClose: false }\n const n = poly.layer.points.length\n return { active: true, pointCount: n, canFinish: n >= 2, canClose: n >= 3 }\n}\n\n// With Shift held, lock the next segment to a fixed angle from the last point\n// -- the usual way drawing tools make clean horizontals, verticals and 45s.\nfunction snapPreview(anchor, p, shift) {\n if (!shift || !anchor) return p\n const dx = p.x - anchor.x\n const dy = p.y - anchor.y\n const len = Math.hypot(dx, dy)\n if (!len) return p\n const ang = Math.round(Math.atan2(dy, dx) / SNAP_STEP) * SNAP_STEP\n return {\n x: anchor.x + Math.cos(ang) * len,\n y: anchor.y + Math.sin(ang) * len,\n }\n}\n\nexport function undoPolyPoint(state) {\n const poly = state.pendingPoly\n if (!poly) return\n if (poly.layer.points.length <= 1) {\n cancelPoly(state)\n return\n }\n poly.layer.points.pop()\n state.statusText = `${poly.layer.points.length} point${\n poly.layer.points.length === 1 ? '' : 's'\n } — Backspace removes the last`\n drawPolyPreview(state)\n state.notify()\n}\n\nfunction startPoly(state, shapeLayer, p) {\n state.pendingPoly = { layer: shapeLayer, preview: p }\n shapeLayer.points = [{ x: p.x, y: p.y }]\n delete shapeLayer.w\n delete shapeLayer.h\n state.statusText =\n 'Click to add points · double-click to finish · Esc cancels'\n drawPolyPreview(state)\n state.notify()\n}\n\nfunction drawPolyPreview(state) {\n const poly = state.pendingPoly\n if (!poly) return\n const c = state.octx\n const pts = poly.layer.points\n c.clearRect(0, 0, state.overlayEl.width, state.overlayEl.height)\n state.layers.forEach((L) => paintLayer(state, c, L))\n\n const ghost = {\n ...poly.layer,\n points: poly.preview ? pts.concat([poly.preview]) : pts,\n }\n if (ghost.points.length >= 2) paintLayer(state, c, ghost)\n\n const k = 1 / (state.viewScale || 1)\n const r = 5 * k\n\n c.save()\n c.lineWidth = 2 * k\n pts.forEach((pt, i) => {\n if (i === 0) return\n c.beginPath()\n c.arc(pt.x, pt.y, r, 0, Math.PI * 2)\n c.fillStyle = '#ffffff'\n c.strokeStyle = poly.layer.color\n c.fill()\n c.stroke()\n })\n\n // The first point is the close target: it grows and fills once the cursor is\n // near enough that a click would actually close the path.\n const first = pts[0]\n if (first) {\n const near =\n pts.length >= 3 &&\n poly.preview &&\n Math.hypot(poly.preview.x - first.x, poly.preview.y - first.y) <=\n closeHitRadius()\n c.beginPath()\n c.arc(first.x, first.y, (near ? 11 : 7) * k, 0, Math.PI * 2)\n c.fillStyle = near ? poly.layer.color : '#ffffff'\n c.strokeStyle = poly.layer.color\n c.lineWidth = (near ? 3 : 2) * k\n c.fill()\n c.stroke()\n if (near) {\n c.beginPath()\n c.arc(first.x, first.y, 4 * k, 0, Math.PI * 2)\n c.fillStyle = '#ffffff'\n c.fill()\n }\n }\n c.restore()\n\n drawPolyHint(state, pts.length)\n}\n\n// Pinned to the canvas so the rules are where the eyes are. On touch the button\n// bar carries the actions, so the hint only explains what a tap does.\nfunction drawPolyHint(state, count) {\n const c = state.octx\n const k = 1 / (state.viewScale || 1)\n const pad = 10 * k\n const size = 13 * k\n const coarse =\n typeof window !== 'undefined' &&\n window.matchMedia &&\n window.matchMedia('(pointer: coarse)').matches\n const verb = coarse ? 'Tap' : 'Click'\n let msg\n if (count < 2) msg = `${verb} to place the next point`\n else if (coarse)\n msg =\n count < 3\n ? `${verb} to add points · use the bar below to finish`\n : `${verb} the first point to close · or finish below`\n else\n msg =\n count < 3\n ? 'Double-click or Enter to finish · Backspace undoes · Esc cancels'\n : 'Click the first point to close · Double-click to finish · Backspace undoes'\n\n c.save()\n c.font = `${size}px Avenir Next, Segoe UI, sans-serif`\n c.textBaseline = 'top'\n const w = c.measureText(msg).width\n c.fillStyle = 'rgba(17,17,17,.82)'\n c.beginPath()\n const bx = pad,\n by = pad,\n bw = w + pad * 2,\n bh = size + pad * 1.4\n if (c.roundRect) c.roundRect(bx, by, bw, bh, 6 * k)\n else c.rect(bx, by, bw, bh)\n c.fill()\n c.fillStyle = '#ffffff'\n c.fillText(msg, bx + pad, by + pad * 0.6)\n c.restore()\n}\n\n// Without this, continuing a finished line means clicking near its end -- which\n// lands on the rotate/resize handle and spins the layer instead.\nexport function resumePoly(state, id) {\n const L = state.layers.find((l) => l.id === (id ?? state.selectedId))\n if (!L || L.type !== 'shape') return\n if (!MULTI_POINT_SHAPES.includes(L.shape)) return\n pushHistory(state)\n if (!L.points || L.points.length < 2) {\n L.points = [\n { x: L.x, y: L.y },\n { x: L.x + (L.w || 0), y: L.y + (L.h || 0) },\n ]\n }\n delete L.w\n delete L.h\n L.closed = false\n state.selectedId = null\n state.mode = 'shape'\n state.multiPointMode = true\n state.pendingPoly = { layer: L, preview: L.points[L.points.length - 1] }\n state.statusText =\n 'Continuing line — click to add points · double-click to finish'\n drawPolyPreview(state)\n state.notify()\n}\n\nexport function finishPoly(state, close) {\n const poly = state.pendingPoly\n if (!poly) return\n const L = poly.layer\n state.pendingPoly = null\n if (L.points.length < 2) {\n // A lone click never became a line -- drop it and undo the history entry.\n state.layers = state.layers.filter((l) => l.id !== L.id)\n popHistory(state)\n setMode(state, 'select')\n render(state)\n state.notify()\n return\n }\n L.closed = !!close\n if (!state.layers.some((l) => l.id === L.id)) state.layers.push(L)\n // Stay on the shape tool: drawing one line usually means drawing another.\n // The layer is still selected, so its options are immediately editable.\n state.mode = 'shape'\n selectLayer(state, L.id)\n state.statusText = close\n ? 'Shape closed — click to start another'\n : 'Line added — click to start another'\n render(state)\n emitChange(state)\n}\n\nexport function cancelPoly(state) {\n const poly = state.pendingPoly\n if (!poly) return\n state.pendingPoly = null\n state.layers = state.layers.filter((l) => l.id !== poly.layer.id)\n popHistory(state)\n render(state)\n state.statusText = 'Cancelled'\n state.notify()\n}\n\nexport function onDown(state, e) {\n if (!state.sourceCanvas.width) return\n if (state.dragMode) return\n state.overlayEl.setPointerCapture(e.pointerId)\n state.activePointerId = e.pointerId\n state.dragRect = state.overlayEl.getBoundingClientRect()\n const p = toSource(state, e)\n if (state.pendingPoly) {\n const pts = state.pendingPoly.layer.points\n const first = pts[0]\n if (\n pts.length >= 3 &&\n Math.hypot(p.x - first.x, p.y - first.y) <= closeHitRadius()\n ) {\n finishPoly(state, true)\n return\n }\n const last = pts[pts.length - 1]\n const q = snapPreview(last, p, e.shiftKey)\n // Ignore a double-click's second down: it would add a zero-length segment.\n if (!last || Math.hypot(q.x - last.x, q.y - last.y) > CLICK_SLOP) {\n pts.push({ x: q.x, y: q.y })\n }\n state.pendingPoly.preview = q\n drawPolyPreview(state)\n return\n }\n if (state.mode === 'select') {\n const sel =\n state.selectedId != null\n ? state.layers.find((l) => l.id === state.selectedId)\n : null\n if (sel && onRotateHandle(state, p, sel)) {\n const c = layerCenter(state, sel)\n state.dragMode = 'rotate'\n state.rotateStart = {\n center: c,\n angle: Math.atan2(p.y - c.y, p.x - c.x),\n rotation: sel.rotation || 0,\n }\n pushHistory(state)\n return\n }\n const corner = sel ? onResizeHandle(state, p, sel) : null\n if (corner) {\n state.dragMode = 'resize'\n state.resizeCorner = corner\n state.dragStart = p\n state.dragOrig = JSON.parse(JSON.stringify(sel))\n if (sel.type === 'shape' && isMultiPoint(sel)) {\n const b = layerBounds(state, sel)\n const isLeft = corner === 'tl' || corner === 'bl'\n const isTop = corner === 'tl' || corner === 'tr'\n state.resizeAnchor = {\n x: isLeft ? b.x + b.w : b.x,\n y: isTop ? b.y + b.h : b.y,\n }\n // Stash the untouched geometry so scaling stays absolute and cannot\n // accumulate drift across move events.\n state.dragOrig._bounds = {\n w: isLeft ? -b.w : b.w,\n h: isTop ? -b.h : b.h,\n }\n state.dragOrig._anchorPt = {\n x: state.resizeAnchor.x,\n y: state.resizeAnchor.y,\n }\n } else if (\n sel.type === 'shape' &&\n DIRECTIONAL_SHAPES.includes(sel.shape)\n ) {\n state.resizeAnchor =\n corner === 'start'\n ? { x: sel.x + sel.w, y: sel.y + sel.h }\n : { x: sel.x, y: sel.y }\n } else {\n const b = layerBounds(state, sel)\n const isLeft = corner === 'tl' || corner === 'bl'\n state.resizeAnchor = {\n x: isLeft ? b.x + b.w : b.x,\n // Text keeps its top edge: its height follows the wrapping.\n y:\n sel.type === 'text'\n ? b.y\n : corner === 'tl' || corner === 'tr'\n ? b.y + b.h\n : b.y,\n }\n }\n state.resizeCenter = layerCenter(state, sel)\n state.resizeAnchorWorld = rotatePoint(\n state.resizeAnchor,\n state.resizeCenter,\n sel.rotation || 0\n )\n pushHistory(state)\n return\n }\n const hit = hitLayer(state, p)\n if (hit) {\n selectLayer(state, hit.id)\n state.dragMode = 'move'\n state.dragStart = p\n state.dragOrig = JSON.parse(JSON.stringify(hit))\n pushHistory(state)\n } else selectLayer(state, null)\n } else if (state.mode === 'text') {\n pushHistory(state)\n const L = {\n id: state.nextId++,\n type: 'text',\n text: 'Text',\n x: p.x,\n y: p.y,\n size: state.textSize,\n font: state.textFont,\n color: state.textColor,\n rotation: 0,\n flipH: false,\n flipV: false,\n boxWidth: 10,\n }\n state.octx.font = `${L.size}px ${L.font}`\n const placeholderWidth = state.octx.measureText(L.text).width\n L.boxWidth = Math.round(Math.max(700, placeholderWidth + 40))\n clampBoxWidth(state, L)\n clampTextSize(state, L)\n state.layers.push(L)\n setMode(state, 'select')\n selectLayer(state, L.id)\n openTextEditor(state, L, true)\n } else if (state.mode === 'draw') {\n pushHistory(state)\n state.pendingStroke = {\n id: state.nextId++,\n type: 'stroke',\n color: state.drawColor,\n width: state.brushSize,\n style: state.brushStyle,\n points: [p],\n }\n state.dragMode = 'draw'\n } else if (state.mode === 'shape') {\n pushHistory(state)\n state.pendingShape = {\n id: state.nextId++,\n type: 'shape',\n shape: state.selectedShapeType,\n fill: state.shapeFill,\n width: state.shapeWidth,\n color: state.shapeColor,\n x: p.x,\n y: p.y,\n w: 0,\n h: 0,\n rotation: 0,\n flipH: false,\n flipV: false,\n }\n state.dragMode = 'newshape'\n state.dragStart = p\n } else if (state.mode === 'crop') {\n state.dragMode = 'crop'\n state.cropStart = p\n state.cropRect = { x: p.x, y: p.y, w: 0, h: 0 }\n }\n}\n\nexport function onMove(state, e) {\n if (state.pendingPoly) {\n const pts = state.pendingPoly.layer.points\n state.pendingPoly.preview = snapPreview(\n pts[pts.length - 1],\n toSource(state, e),\n e.shiftKey\n )\n drawPolyPreview(state)\n return\n }\n if (\n state.dragMode &&\n state.activePointerId != null &&\n e.pointerId !== state.activePointerId\n ) {\n return\n }\n if (!state.dragMode) {\n if (state.mode === 'select') {\n const p = toSource(state, e),\n sel =\n state.selectedId != null\n ? state.layers.find((l) => l.id === state.selectedId)\n : null\n const corner = sel ? onResizeHandle(state, p, sel) : null\n if (sel && onRotateHandle(state, p, sel)) {\n state.overlayEl.style.cursor = 'grab'\n } else if (corner === 'start' || corner === 'end') {\n state.overlayEl.style.cursor =\n sel.w >= 0 === sel.h >= 0 ? 'nwse-resize' : 'nesw-resize'\n } else if (corner) {\n state.overlayEl.style.cursor =\n corner === 'tl' || corner === 'br' ? 'nwse-resize' : 'nesw-resize'\n } else if (sel && hitLayer(state, p) === sel) {\n state.overlayEl.style.cursor = 'move'\n } else if (hitLayer(state, p)) {\n state.overlayEl.style.cursor = 'pointer'\n } else {\n state.overlayEl.style.cursor = 'default'\n }\n }\n return\n }\n const p = toSource(state, e)\n if (state.dragMode === 'move') {\n const dx = p.x - state.dragStart.x,\n dy = p.y - state.dragStart.y,\n L = state.layers.find((l) => l.id === state.selectedId)\n if (L.type === 'shape' && isMultiPoint(L)) {\n L.points = state.dragOrig.points.map((pt) => ({\n x: pt.x + dx,\n y: pt.y + dy,\n }))\n } else if (\n L.type === 'text' ||\n L.type === 'shape' ||\n L.type === 'sticker'\n ) {\n L.x = state.dragOrig.x + dx\n L.y = state.dragOrig.y + dy\n } else if (L.type === 'stroke') {\n L.points = state.dragOrig.points.map((pt) => ({\n x: pt.x + dx,\n y: pt.y + dy,\n }))\n }\n clampLayerToCanvas(state, L)\n renderOverlay(state)\n } else if (state.dragMode === 'resize') {\n const L = state.layers.find((l) => l.id === state.selectedId)\n const rot = L.rotation || 0\n // Resize along the layer's own axes, so a tilted box grows the way it looks.\n const q = rot ? rotatePoint(p, state.resizeCenter, -rot) : p\n if (L.type === 'text') {\n const isLeft = state.resizeCorner === 'tl' || state.resizeCorner === 'bl'\n // Absolute from drag start, so the fix-up below cannot accumulate.\n L.y = state.dragOrig.y\n L.size = state.dragOrig.size\n if (isLeft) {\n const rightEdge = state.dragOrig.x + state.dragOrig.boxWidth\n L.boxWidth = Math.max(20, rightEdge - q.x)\n L.x = rightEdge - L.boxWidth\n } else {\n L.x = state.dragOrig.x\n L.boxWidth = Math.max(20, q.x - state.dragOrig.x)\n }\n clampBoxWidth(state, L)\n clampTextSize(state, L)\n state.notify()\n } else if (L.type === 'shape' && isMultiPoint(L)) {\n // Multi-point paths have no single \"end\" to drag, so scale every point\n // about the opposite corner instead.\n const anchor = state.resizeAnchor\n const ob = state.dragOrig._bounds\n const MIN_SIZE = 8\n const sx = ob.w > 0 ? (q.x - anchor.x) / (ob.w || 1) : 1\n const sy = ob.h > 0 ? (q.y - anchor.y) / (ob.h || 1) : 1\n const kx = Math.abs(ob.w * sx) < MIN_SIZE ? MIN_SIZE / (ob.w || 1) : sx\n const ky = Math.abs(ob.h * sy) < MIN_SIZE ? MIN_SIZE / (ob.h || 1) : sy\n L.points = state.dragOrig.points.map((pt) => ({\n x: anchor.x + (pt.x - state.dragOrig._anchorPt.x) * kx,\n y: anchor.y + (pt.y - state.dragOrig._anchorPt.y) * ky,\n }))\n } else if (L.type === 'shape' && DIRECTIONAL_SHAPES.includes(L.shape)) {\n const anchor = state.resizeAnchor\n const MIN_LEN = 8\n let w = q.x - anchor.x\n let h = q.y - anchor.y\n if (Math.hypot(w, h) < MIN_LEN) {\n const ang = Math.atan2(h || 1, w || 1)\n w = MIN_LEN * Math.cos(ang)\n h = MIN_LEN * Math.sin(ang)\n }\n if (state.resizeCorner === 'start') {\n L.x = anchor.x + w\n L.y = anchor.y + h\n L.w = -w\n L.h = -h\n } else {\n L.x = anchor.x\n L.y = anchor.y\n L.w = w\n L.h = h\n }\n } else if (L.type === 'shape' || L.type === 'sticker') {\n const anchor = state.resizeAnchor\n const MIN_SIZE = 8\n let w = q.x - anchor.x\n let h = q.y - anchor.y\n if (Math.abs(w) < MIN_SIZE) {\n w =\n anchor.x + MIN_SIZE <= state.sourceCanvas.width ? MIN_SIZE : -MIN_SIZE\n }\n if (Math.abs(h) < MIN_SIZE) {\n h =\n anchor.y + MIN_SIZE <= state.sourceCanvas.height\n ? MIN_SIZE\n : -MIN_SIZE\n }\n L.x = Math.min(anchor.x, anchor.x + w)\n L.y = Math.min(anchor.y, anchor.y + h)\n L.w = Math.abs(w)\n L.h = Math.abs(h)\n }\n // Resizing moves the centre it spins about; pin the anchor back down.\n if (rot) {\n const moved = rotatePoint(state.resizeAnchor, layerCenter(state, L), rot)\n L.x += state.resizeAnchorWorld.x - moved.x\n L.y += state.resizeAnchorWorld.y - moved.y\n }\n renderOverlay(state)\n } else if (state.dragMode === 'rotate') {\n const L = state.layers.find((l) => l.id === state.selectedId)\n const { center, angle, rotation } = state.rotateStart\n const swept = Math.atan2(p.y - center.y, p.x - center.x) - angle\n const deg = rotation + (swept * 180) / Math.PI\n L.rotation = ((deg % 360) + 360) % 360\n renderOverlay(state)\n } else if (state.dragMode === 'draw') {\n state.pendingStroke.points.push(p)\n state.octx.clearRect(0, 0, state.overlayEl.width, state.overlayEl.height)\n state.layers.forEach((L) => paintLayer(state, state.octx, L))\n paintLayer(state, state.octx, state.pendingStroke)\n } else if (state.dragMode === 'newshape') {\n state.pendingShape.w = p.x - state.dragStart.x\n state.pendingShape.h = p.y - state.dragStart.y\n renderOverlay(state)\n } else if (state.dragMode === 'crop') {\n let w = p.x - state.cropStart.x,\n h = p.y - state.cropStart.y\n if (state.cropRatio !== 'free') {\n const rr = parseFloat(state.cropRatio)\n h = (Math.sign(h || 1) * Math.abs(w)) / rr\n const maxH =\n h >= 0\n ? state.sourceCanvas.height - state.cropStart.y\n : state.cropStart.y\n if (Math.abs(h) > maxH) {\n h = Math.sign(h) * maxH\n w = Math.sign(w || 1) * Math.abs(h) * rr\n }\n }\n state.cropRect = { x: state.cropStart.x, y: state.cropStart.y, w, h }\n renderOverlay(state)\n }\n}\n\nexport function onUp(state, e) {\n if (\n e &&\n state.dragMode &&\n state.activePointerId != null &&\n e.pointerId !== state.activePointerId\n ) {\n return\n }\n if (state.dragMode === 'draw' && state.pendingStroke) {\n if (state.pendingStroke.points.length >= 1) {\n state.layers.push(state.pendingStroke)\n selectLayer(state, state.pendingStroke.id)\n }\n state.pendingStroke = null\n render(state)\n state.statusText = 'Stroke added'\n emitChange(state)\n } else if (state.dragMode === 'newshape' && state.pendingShape) {\n const dragged = Math.hypot(\n state.pendingShape.w || 0,\n state.pendingShape.h || 0\n )\n if (\n state.multiPointMode &&\n MULTI_POINT_SHAPES.includes(state.pendingShape.shape)\n ) {\n // Multi-point is an explicit mode, so it opens a session either way:\n // a drag lays down the first segment, a click just the first corner.\n const L = state.pendingShape\n const end = { x: L.x + (L.w || 0), y: L.y + (L.h || 0) }\n state.pendingShape = null\n startPoly(state, L, { x: L.x, y: L.y })\n if (dragged > CLICK_SLOP) {\n L.points.push(end)\n state.pendingPoly.preview = end\n }\n } else if (\n Math.abs(state.pendingShape.w) > 3 ||\n Math.abs(state.pendingShape.h) > 3\n ) {\n state.layers.push(state.pendingShape)\n const id = state.pendingShape.id\n state.pendingShape = null\n setMode(state, 'select')\n selectLayer(state, id)\n state.statusText = 'Shape added'\n emitChange(state)\n } else {\n state.pendingShape = null\n renderOverlay(state)\n state.notify()\n }\n } else if (state.dragMode === 'crop') {\n if (state.cropRect) state.cropRect = normRect(state.cropRect)\n renderOverlay(state)\n state.notify()\n } else if (\n state.dragMode === 'move' ||\n state.dragMode === 'resize' ||\n state.dragMode === 'rotate'\n ) {\n if (state.dragMode === 'rotate') {\n const L = state.layers.find((l) => l.id === state.selectedId)\n if (L) state.statusText = `Rotated to ${Math.round(L.rotation)}°`\n }\n render(state)\n state.notify()\n }\n if (state.activePointerId != null) {\n if (state.overlayEl.hasPointerCapture(state.activePointerId)) {\n state.overlayEl.releasePointerCapture(state.activePointerId)\n }\n state.activePointerId = null\n }\n state.dragMode = null\n state.dragStart = null\n state.dragOrig = null\n state.dragRect = null\n state.resizeAnchor = null\n state.resizeCenter = null\n state.resizeAnchorWorld = null\n state.rotateStart = null\n}\n\nexport function onDbl(state, e) {\n if (state.pendingPoly) {\n finishPoly(state, false)\n return\n }\n if (state.mode !== 'select') return\n const p = toSource(state, e),\n hit = hitLayer(state, p)\n if (hit && hit.type === 'text') {\n selectLayer(state, hit.id)\n openTextEditor(state, hit, false)\n }\n}\n"],"names":["toSource","state","e","x","y","rotatedAABB","b","rotationDeg","rad","cos","sin","w","h","cx","cy","strokeMargin","L","DIRECTIONAL_SHAPES","clampLayerToCanvas","rotated","layerBounds","margin","dx","dy","pt","hitLayer","p","layers","i","q","toLayerSpace","closeHitRadius","SNAP_STEP","CLICK_SLOP","polyStatus","poly","n","snapPreview","anchor","shift","len","ang","undoPolyPoint","cancelPoly","drawPolyPreview","startPoly","shapeLayer","c","pts","paintLayer","ghost","k","r","first","near","drawPolyHint","count","pad","size","coarse","verb","msg","bx","by","bw","bh","resumePoly","id","l","MULTI_POINT_SHAPES","pushHistory","finishPoly","close","popHistory","setMode","render","selectLayer","emitChange","onDown","last","sel","onRotateHandle","layerCenter","corner","onResizeHandle","isMultiPoint","isLeft","isTop","rotatePoint","hit","placeholderWidth","clampBoxWidth","clampTextSize","openTextEditor","onMove","renderOverlay","rot","rightEdge","ob","MIN_SIZE","sx","sy","kx","ky","MIN_LEN","moved","center","angle","rotation","swept","deg","rr","maxH","onUp","dragged","end","normRect","onDbl"],"mappings":";;;;;AAsBO,SAASA,EAASC,GAAOC,GAAG;AAOjC,QAAM,IACJD,EAAM,YAAYA,EAAM,WACpBA,EAAM,WACNA,EAAM,UAAU,sBAAqB,GACrCE,KAAMD,EAAE,UAAU,EAAE,QAAQ,EAAE,QAASD,EAAM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AAMhE,EAASxB,GAAOyB,CAAC;AACzB,EAAI+D,KAAOA,EAAI,SAAS,WACtBb,EAAY3E,GAAOwF,EAAI,EAAE,GACzBI,EAAe5F,GAAOwF,GAAK,EAAK;AAEpC;"}
1
+ {"version":3,"file":"index165.es.js","sources":["../src/components/unstyled/otp-input/otp-input.styles.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const OTPInputVariants = cva(\n `relative flex h-12 w-11 items-center justify-center border-y border-r border-input text-light-1 transition-all\n first:rounded-l-md first:border-l last:rounded-r-md`,\n {\n variants: {\n isError: {\n true: '',\n false: '',\n },\n isFocused: {\n true: '',\n false: '',\n },\n },\n defaultVariants: {\n isError: false,\n isFocused: false,\n },\n compoundVariants: [\n {\n isError: true,\n isFocused: true,\n className: 'border-danger-2 ring-4 ring-danger-1',\n },\n {\n isError: false,\n isFocused: true,\n className: 'border-primary-2 ring-4 ring-primary-1',\n },\n {\n isError: true,\n isFocused: false,\n className: 'border-danger-2',\n },\n {\n isError: false,\n isFocused: false,\n className: 'border-neutral-2',\n },\n ],\n }\n)\n"],"names":["OTPInputVariants","cva"],"mappings":";AAEO,MAAMA,IAAmBC;AAAA,EAC9B;AAAA;AAAA,EAEA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,MAET,WAAW;AAAA,QACT,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,IAEF,iBAAiB;AAAA,MACf,SAAS;AAAA,MACT,WAAW;AAAA,IAAA;AAAA,IAEb,kBAAkB;AAAA,MAChB;AAAA,QACE,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,MAAA;AAAA,MAEb;AAAA,QACE,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,MAAA;AAAA,MAEb;AAAA,QACE,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,MAAA;AAAA,MAEb;AAAA,QACE,SAAS;AAAA,QACT,WAAW;AAAA,QACX,WAAW;AAAA,MAAA;AAAA,IACb;AAAA,EACF;AAEJ;"}
@@ -1,5 +1,15 @@
1
- const a = "Plus Jakarta Sans";
1
+ import { cva as a } from "class-variance-authority";
2
+ const t = {
3
+ img: a("", {
4
+ variants: {
5
+ hasIcon: {
6
+ true: "w-12 h-12",
7
+ false: "h-5 w-5"
8
+ }
9
+ }
10
+ })
11
+ };
2
12
  export {
3
- a as FONT_FAMILY
13
+ t as hoverDetailCardStyles
4
14
  };
5
15
  //# sourceMappingURL=index166.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index166.es.js","sources":["../src/lib/constants.ts"],"sourcesContent":["export const FONT_FAMILY = 'Plus Jakarta Sans'\n"],"names":["FONT_FAMILY"],"mappings":"AAAO,MAAMA,IAAc;"}
1
+ {"version":3,"file":"index166.es.js","sources":["../src/components/ui/map-marker-hover-card/map-marker-hover-card.styles.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const hoverDetailCardStyles = {\n img: cva('', {\n variants: {\n hasIcon: {\n true: 'w-12 h-12',\n false: 'h-5 w-5',\n },\n },\n }),\n}\n"],"names":["hoverDetailCardStyles","cva"],"mappings":";AAEO,MAAMA,IAAwB;AAAA,EACnC,KAAKC,EAAI,IAAI;AAAA,IACX,UAAU;AAAA,MACR,SAAS;AAAA,QACP,MAAM;AAAA,QACN,OAAO;AAAA,MAAA;AAAA,IACT;AAAA,EACF,CACD;AACH;"}
@@ -1,28 +1,5 @@
1
- import { cva as e } from "class-variance-authority";
2
- const t = e(
3
- "w-auto min-w-[50px] h-5 flex items-center justify-center gap-2 px-1 py-0.5 rounded-[4px]",
4
- {
5
- variants: {
6
- trend: {
7
- 1: "bg-success-1 border border-success-1",
8
- "-1": "bg-danger-1 border border-danger-1",
9
- 0: "",
10
- null: ""
11
- }
12
- }
13
- }
14
- ), s = e("text-sm", {
15
- variants: {
16
- trend: {
17
- 1: "text-success-1",
18
- "-1": "text-danger-1",
19
- 0: "",
20
- null: ""
21
- }
22
- }
23
- });
1
+ const a = "Plus Jakarta Sans";
24
2
  export {
25
- t as trendBoxStyles,
26
- s as trendValueStyles
3
+ a as FONT_FAMILY
27
4
  };
28
5
  //# sourceMappingURL=index167.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index167.es.js","sources":["../src/components/ui/report-snippet-view/report-snippet-view-style.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const trendBoxStyles = cva(\n 'w-auto min-w-[50px] h-5 flex items-center justify-center gap-2 px-1 py-0.5 rounded-[4px]',\n {\n variants: {\n trend: {\n '1': 'bg-success-1 border border-success-1',\n '-1': 'bg-danger-1 border border-danger-1',\n '0': '',\n null: '',\n },\n },\n }\n)\n\nexport const trendValueStyles = cva('text-sm', {\n variants: {\n trend: {\n '1': 'text-success-1',\n '-1': 'text-danger-1',\n '0': '',\n null: '',\n },\n },\n})\n"],"names":["trendBoxStyles","cva","trendValueStyles"],"mappings":";AAEO,MAAMA,IAAiBC;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAK;AAAA,QACL,MAAM;AAAA,QACN,GAAK;AAAA,QACL,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,EACF;AAEJ,GAEaC,IAAmBD,EAAI,WAAW;AAAA,EAC7C,UAAU;AAAA,IACR,OAAO;AAAA,MACL,GAAK;AAAA,MACL,MAAM;AAAA,MACN,GAAK;AAAA,MACL,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,CAAC;"}
1
+ {"version":3,"file":"index167.es.js","sources":["../src/lib/constants.ts"],"sourcesContent":["export const FONT_FAMILY = 'Plus Jakarta Sans'\n"],"names":["FONT_FAMILY"],"mappings":"AAAO,MAAMA,IAAc;"}
@@ -1,19 +1,28 @@
1
- import { cva as r } from "class-variance-authority";
2
- import { StepItemStatus as e } from "./index33.es.js";
3
- const o = r(
4
- "h-8 w-8 border-2 flex items-center justify-center rounded-full cursor-pointer trasnition-all",
1
+ import { cva as e } from "class-variance-authority";
2
+ const t = e(
3
+ "w-auto min-w-[50px] h-5 flex items-center justify-center gap-2 px-1 py-0.5 rounded-[4px]",
5
4
  {
6
5
  variants: {
7
- variant: {
8
- pending: "border-neutral-2 ",
9
- current: "bg-primary-1 border-primary-2 hover:bg-hover-t1 active:bg-click-t1",
10
- completed: "bg-rest-p1 hover:bg-hover-p1 active:bg-click-p1 border-none"
6
+ trend: {
7
+ 1: "bg-success-1 border border-success-1",
8
+ "-1": "bg-danger-1 border border-danger-1",
9
+ 0: "",
10
+ null: ""
11
11
  }
12
- },
13
- defaultVariants: { variant: e.PENDING }
12
+ }
14
13
  }
15
- );
14
+ ), s = e("text-sm", {
15
+ variants: {
16
+ trend: {
17
+ 1: "text-success-1",
18
+ "-1": "text-danger-1",
19
+ 0: "",
20
+ null: ""
21
+ }
22
+ }
23
+ });
16
24
  export {
17
- o as StepItemVariants
25
+ t as trendBoxStyles,
26
+ s as trendValueStyles
18
27
  };
19
28
  //# sourceMappingURL=index168.es.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index168.es.js","sources":["../src/components/molecules/stepper/stepper.styles.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\nimport { StepItemStatus } from './stepper.type'\nexport const StepItemVariants = cva(\n 'h-8 w-8 border-2 flex items-center justify-center rounded-full cursor-pointer trasnition-all',\n {\n variants: {\n variant: {\n pending: 'border-neutral-2 ',\n current:\n 'bg-primary-1 border-primary-2 hover:bg-hover-t1 active:bg-click-t1',\n completed:\n 'bg-rest-p1 hover:bg-hover-p1 active:bg-click-p1 border-none',\n },\n },\n defaultVariants: { variant: StepItemStatus.PENDING },\n }\n)\n"],"names":["StepItemVariants","cva","StepItemStatus"],"mappings":";;AAEO,MAAMA,IAAmBC;AAAA,EAC9B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,SAAS;AAAA,QACP,SAAS;AAAA,QACT,SACE;AAAA,QACF,WACE;AAAA,MAAA;AAAA,IACJ;AAAA,IAEF,iBAAiB,EAAE,SAASC,EAAe,QAAA;AAAA,EAAQ;AAEvD;"}
1
+ {"version":3,"file":"index168.es.js","sources":["../src/components/ui/report-snippet-view/report-snippet-view-style.ts"],"sourcesContent":["import { cva } from 'class-variance-authority'\n\nexport const trendBoxStyles = cva(\n 'w-auto min-w-[50px] h-5 flex items-center justify-center gap-2 px-1 py-0.5 rounded-[4px]',\n {\n variants: {\n trend: {\n '1': 'bg-success-1 border border-success-1',\n '-1': 'bg-danger-1 border border-danger-1',\n '0': '',\n null: '',\n },\n },\n }\n)\n\nexport const trendValueStyles = cva('text-sm', {\n variants: {\n trend: {\n '1': 'text-success-1',\n '-1': 'text-danger-1',\n '0': '',\n null: '',\n },\n },\n})\n"],"names":["trendBoxStyles","cva","trendValueStyles"],"mappings":";AAEO,MAAMA,IAAiBC;AAAA,EAC5B;AAAA,EACA;AAAA,IACE,UAAU;AAAA,MACR,OAAO;AAAA,QACL,GAAK;AAAA,QACL,MAAM;AAAA,QACN,GAAK;AAAA,QACL,MAAM;AAAA,MAAA;AAAA,IACR;AAAA,EACF;AAEJ,GAEaC,IAAmBD,EAAI,WAAW;AAAA,EAC7C,UAAU;AAAA,IACR,OAAO;AAAA,MACL,GAAK;AAAA,MACL,MAAM;AAAA,MACN,GAAK;AAAA,MACL,MAAM;AAAA,IAAA;AAAA,EACR;AAEJ,CAAC;"}
@@ -1,4 +1,4 @@
1
- import { applyZoom as m, renderOverlay as x } from "./index155.es.js";
1
+ import { applyZoom as m, renderOverlay as x } from "./index154.es.js";
2
2
  function f(n) {
3
3
  const [r, i] = n;
4
4
  return { x: (r.x + i.x) / 2, y: (r.y + i.y) / 2 };