@layers-app/shared 0.2.6 → 0.2.7
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.
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppSidebarButton.js +4 -4
- package/dist/components/AppContainer/components/AppsSidebar/AppsSection.js +22 -22
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
- package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +25 -25
- package/dist/components/AppContainer/components/AppsSidebar/UserSection.js +41 -41
- package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.js +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainer.js +40 -37
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerDataStore.js +3 -2
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/FormViewer/components/OneSlideLayput.js +39 -37
- package/dist/components/FormViewer/hooks/useCreateFormContext.d.ts.map +1 -1
- package/dist/components/FormViewer/hooks/useCreateFormContext.js +10 -10
- package/dist/components/FormViewer/store/formStoreApi.js +13 -13
- package/dist/components/ImageCropper/ImageCropper.d.ts.map +1 -1
- package/dist/components/ImageCropper/ImageCropper.js +185 -183
- package/dist/components/LanguagePicker/LanguagePicker.d.ts.map +1 -1
- package/dist/components/LanguagePicker/LanguagePicker.js +41 -32
- package/dist/components/LanguagePicker/LanguagePicker.module.css.js +6 -4
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +53 -50
- package/dist/components/NavMenu/types.d.ts +1 -0
- package/dist/components/NavMenu/types.d.ts.map +1 -1
- package/dist/components/SocialLinkRow/index.d.ts.map +1 -1
- package/dist/components/SocialLinkRow/index.js +80 -58
- package/dist/components/TimezonePicker/index.d.ts.map +1 -1
- package/dist/components/TimezonePicker/index.js +42 -41
- package/dist/components/UserAvatar/index.d.ts.map +1 -1
- package/dist/components/UserAvatar/index.js +11 -10
- package/dist/components/WorkspaceMenu/WorkspaceItem.js +1 -1
- package/dist/helpers/showFeatureFeedback.d.ts +16 -0
- package/dist/helpers/showFeatureFeedback.d.ts.map +1 -0
- package/dist/helpers/showFeatureFeedback.js +109 -0
- package/dist/helpers/showFeatureFeedback.module.css.js +9 -0
- package/dist/helpers/showNotifications.d.ts.map +1 -1
- package/dist/helpers/showNotifications.js +81 -113
- package/dist/helpers/showNotifications.module.css.js +10 -10
- package/dist/hooks/useFeatureFeedback.d.ts +23 -0
- package/dist/hooks/useFeatureFeedback.d.ts.map +1 -0
- package/dist/hooks/useFeatureFeedback.js +48 -0
- package/dist/index.css +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +322 -310
- package/dist/lib/layersVisitData.d.ts +13 -0
- package/dist/lib/layersVisitData.d.ts.map +1 -0
- package/dist/lib/layersVisitData.js +37 -0
- package/package.json +1 -1
|
@@ -1,250 +1,252 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { Box as
|
|
4
|
-
import { useElementSize as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
src:
|
|
8
|
-
variant:
|
|
9
|
-
aspectRatio:
|
|
10
|
-
minSize:
|
|
11
|
-
maxSize:
|
|
12
|
-
onCropComplete:
|
|
13
|
-
onCropDataChange:
|
|
1
|
+
import { jsxs as b, jsx as a, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as ne, useState as H, useMemo as ce, useEffect as j, useCallback as G } from "react";
|
|
3
|
+
import { Box as oe } from "@mantine/core";
|
|
4
|
+
import { useElementSize as ae } from "@mantine/hooks";
|
|
5
|
+
import h from "./ImageCropper.module.css.js";
|
|
6
|
+
const fe = ({
|
|
7
|
+
src: ie,
|
|
8
|
+
variant: I = "square",
|
|
9
|
+
aspectRatio: o = 1,
|
|
10
|
+
minSize: m = 50,
|
|
11
|
+
maxSize: X,
|
|
12
|
+
onCropComplete: J,
|
|
13
|
+
onCropDataChange: K
|
|
14
14
|
}) => {
|
|
15
15
|
const {
|
|
16
|
-
ref:
|
|
17
|
-
width:
|
|
18
|
-
height:
|
|
19
|
-
} =
|
|
20
|
-
if (!
|
|
21
|
-
return { x: 0, y: 0, width:
|
|
22
|
-
const
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
16
|
+
ref: he,
|
|
17
|
+
width: v,
|
|
18
|
+
height: M
|
|
19
|
+
} = ae(), W = ne(null), Q = ne(null), [Y, se] = H(!1), [f, de] = H({ width: 0, height: 0 }), r = ce(() => {
|
|
20
|
+
if (!Y || v === 0 || M === 0 || f.width === 0)
|
|
21
|
+
return { x: 0, y: 0, width: v, height: M };
|
|
22
|
+
const n = v / M, i = f.width / f.height;
|
|
23
|
+
if (i > n) {
|
|
24
|
+
const s = v / i;
|
|
25
25
|
return {
|
|
26
26
|
x: 0,
|
|
27
|
-
y: (
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
27
|
+
y: (M - s) / 2,
|
|
28
|
+
width: v,
|
|
29
|
+
height: s
|
|
30
30
|
};
|
|
31
31
|
} else {
|
|
32
|
-
const
|
|
32
|
+
const s = M * i;
|
|
33
33
|
return {
|
|
34
|
-
x: (
|
|
34
|
+
x: (v - s) / 2,
|
|
35
35
|
y: 0,
|
|
36
|
-
width:
|
|
37
|
-
height:
|
|
36
|
+
width: s,
|
|
37
|
+
height: M
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
|
-
}, [
|
|
40
|
+
}, [Y, v, M, f]), [t, U] = H({
|
|
41
41
|
x: 0,
|
|
42
42
|
y: 0,
|
|
43
43
|
width: 200,
|
|
44
44
|
height: 200
|
|
45
|
-
}), [
|
|
45
|
+
}), [P, Z] = H(!1), [T, _] = H(!1), [l, S] = H(null), [V, R] = H({ x: 0, y: 0 }), [e, z] = H({
|
|
46
46
|
x: 0,
|
|
47
47
|
y: 0,
|
|
48
48
|
width: 0,
|
|
49
49
|
height: 0
|
|
50
50
|
});
|
|
51
|
-
|
|
52
|
-
if (!
|
|
51
|
+
j(() => {
|
|
52
|
+
if (!Y || v === 0 || M === 0 || r.width === 0)
|
|
53
53
|
return;
|
|
54
|
-
let
|
|
55
|
-
|
|
56
|
-
const u =
|
|
57
|
-
|
|
54
|
+
let n, i, s = Math.min(r.width, r.height) * 0.8;
|
|
55
|
+
X && (s = Math.min(s, X)), o >= 1 ? (n = s, i = s / o) : (i = s, n = s * o);
|
|
56
|
+
const u = r.x + (r.width - n) / 2, k = r.y + (r.height - i) / 2;
|
|
57
|
+
U({ x: u, y: k, width: n, height: i });
|
|
58
58
|
}, [
|
|
59
|
-
|
|
60
|
-
c,
|
|
61
|
-
M,
|
|
62
|
-
L,
|
|
59
|
+
Y,
|
|
63
60
|
o,
|
|
64
|
-
v
|
|
61
|
+
v,
|
|
62
|
+
M,
|
|
63
|
+
r,
|
|
64
|
+
X
|
|
65
65
|
]);
|
|
66
|
-
const
|
|
67
|
-
|
|
68
|
-
width:
|
|
69
|
-
height:
|
|
70
|
-
}),
|
|
71
|
-
}, []),
|
|
72
|
-
(
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
66
|
+
const re = G(() => {
|
|
67
|
+
W.current && (de({
|
|
68
|
+
width: W.current.naturalWidth,
|
|
69
|
+
height: W.current.naturalHeight
|
|
70
|
+
}), se(!0));
|
|
71
|
+
}, []), ee = G(
|
|
72
|
+
(n) => {
|
|
73
|
+
n.preventDefault(), n.stopPropagation();
|
|
74
|
+
const i = "touches" in n ? n.touches[0].clientX : n.clientX, s = "touches" in n ? n.touches[0].clientY : n.clientY;
|
|
75
|
+
Z(!0), R({ x: i, y: s }), z({ ...t });
|
|
76
76
|
},
|
|
77
77
|
[t]
|
|
78
|
-
),
|
|
79
|
-
(
|
|
80
|
-
|
|
81
|
-
const
|
|
82
|
-
|
|
78
|
+
), q = G(
|
|
79
|
+
(n) => (i) => {
|
|
80
|
+
i.preventDefault(), i.stopPropagation();
|
|
81
|
+
const s = "touches" in i ? i.touches[0].clientX : i.clientX, u = "touches" in i ? i.touches[0].clientY : i.clientY;
|
|
82
|
+
_(!0), S(n), R({ x: s, y: u }), z({ ...t });
|
|
83
83
|
},
|
|
84
84
|
[t]
|
|
85
85
|
);
|
|
86
|
-
|
|
87
|
-
const
|
|
88
|
-
if (!
|
|
89
|
-
const u = "touches" in
|
|
90
|
-
if (
|
|
91
|
-
let
|
|
92
|
-
|
|
86
|
+
j(() => {
|
|
87
|
+
const n = (s) => {
|
|
88
|
+
if (!P && !T) return;
|
|
89
|
+
const u = "touches" in s ? s.touches[0].clientX : s.clientX, k = "touches" in s ? s.touches[0].clientY : s.clientY, y = u - V.x, D = k - V.y, B = r.x, L = r.y, N = r.x + r.width, A = r.y + r.height;
|
|
90
|
+
if (P) {
|
|
91
|
+
let g = e.x + y, w = e.y + D;
|
|
92
|
+
g = Math.max(B, Math.min(g, N - t.width)), w = Math.max(L, Math.min(w, A - t.height)), U((d) => ({ ...d, x: g, y: w }));
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
95
|
-
let
|
|
96
|
-
switch (
|
|
94
|
+
if (T && l) {
|
|
95
|
+
let g = e.x, w = e.y, d = e.width, c = e.height;
|
|
96
|
+
switch (l) {
|
|
97
97
|
case "se":
|
|
98
|
-
|
|
98
|
+
d = Math.max(m, e.width + y), c = d / o;
|
|
99
99
|
break;
|
|
100
100
|
case "sw":
|
|
101
|
-
|
|
101
|
+
d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d;
|
|
102
102
|
break;
|
|
103
103
|
case "ne":
|
|
104
|
-
|
|
104
|
+
d = Math.max(m, e.width + y), c = d / o, w = e.y + e.height - c;
|
|
105
105
|
break;
|
|
106
106
|
case "nw":
|
|
107
|
-
|
|
107
|
+
d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d, w = e.y + e.height - c;
|
|
108
108
|
break;
|
|
109
109
|
case "e":
|
|
110
|
-
|
|
110
|
+
d = Math.max(m, e.width + y), c = d / o, w = e.y + (e.height - c) / 2;
|
|
111
111
|
break;
|
|
112
112
|
case "w":
|
|
113
|
-
|
|
113
|
+
d = Math.max(m, e.width - y), c = d / o, g = e.x + e.width - d, w = e.y + (e.height - c) / 2;
|
|
114
114
|
break;
|
|
115
115
|
case "s":
|
|
116
|
-
|
|
116
|
+
c = Math.max(m, e.height + D), d = c * o, g = e.x + (e.width - d) / 2;
|
|
117
117
|
break;
|
|
118
118
|
case "n":
|
|
119
|
-
|
|
119
|
+
c = Math.max(m, e.height - D), d = c * o, g = e.x + (e.width - d) / 2, w = e.y + e.height - c;
|
|
120
120
|
break;
|
|
121
121
|
}
|
|
122
|
-
|
|
122
|
+
const p = l.includes("w") ? e.x + e.width : l.includes("e") ? e.x : e.x + e.width / 2, $ = l.includes("n") ? e.y + e.height : l.includes("s") ? e.y : e.y + e.height / 2;
|
|
123
|
+
let x, E;
|
|
124
|
+
l.includes("w") ? x = p - B : l.includes("e") ? x = N - p : x = Math.min(p - B, N - p) * 2, l.includes("n") ? E = $ - L : l.includes("s") ? E = A - $ : E = Math.min($ - L, A - $) * 2, X && (o >= 1 ? x = Math.min(x, X) : E = Math.min(E, X)), x / o < E ? E = x / o : x = E * o, d > x && (d = x, c = d / o), l.includes("w") ? g = p - d : l.includes("e") ? g = p : g = p - d / 2, l.includes("n") ? w = $ - c : l.includes("s") ? w = $ : w = $ - c / 2, d >= m && c >= m && U({ x: g, y: w, width: d, height: c });
|
|
123
125
|
}
|
|
124
|
-
},
|
|
125
|
-
|
|
126
|
+
}, i = () => {
|
|
127
|
+
Z(!1), _(!1), S(null);
|
|
126
128
|
};
|
|
127
|
-
return (
|
|
128
|
-
window.removeEventListener("mousemove",
|
|
129
|
+
return (P || T) && (window.addEventListener("mousemove", n), window.addEventListener("mouseup", i), window.addEventListener("touchmove", n), window.addEventListener("touchend", i)), () => {
|
|
130
|
+
window.removeEventListener("mousemove", n), window.removeEventListener("mouseup", i), window.removeEventListener("touchmove", n), window.removeEventListener("touchend", i);
|
|
129
131
|
};
|
|
130
132
|
}, [
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
133
|
+
P,
|
|
134
|
+
T,
|
|
135
|
+
l,
|
|
136
|
+
V,
|
|
135
137
|
e,
|
|
136
|
-
|
|
138
|
+
r,
|
|
137
139
|
t.width,
|
|
138
140
|
t.height,
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
]),
|
|
143
|
-
if (
|
|
144
|
-
const
|
|
145
|
-
|
|
146
|
-
x: (t.x -
|
|
147
|
-
y: (t.y -
|
|
148
|
-
width: t.width *
|
|
149
|
-
height: t.height *
|
|
150
|
-
scale:
|
|
141
|
+
o,
|
|
142
|
+
m,
|
|
143
|
+
X
|
|
144
|
+
]), j(() => {
|
|
145
|
+
if (K && Y && r.width > 0) {
|
|
146
|
+
const n = f.width / r.width, i = f.height / r.height;
|
|
147
|
+
K({
|
|
148
|
+
x: (t.x - r.x) * n,
|
|
149
|
+
y: (t.y - r.y) * i,
|
|
150
|
+
width: t.width * n,
|
|
151
|
+
height: t.height * i,
|
|
152
|
+
scale: n
|
|
151
153
|
});
|
|
152
154
|
}
|
|
153
|
-
}, [t,
|
|
154
|
-
const
|
|
155
|
-
if (
|
|
156
|
-
|
|
155
|
+
}, [t, f, r, Y, K]);
|
|
156
|
+
const te = G(() => new Promise((n, i) => {
|
|
157
|
+
if (!W.current || !Q.current) {
|
|
158
|
+
i(new Error("Image or canvas not ready"));
|
|
157
159
|
return;
|
|
158
160
|
}
|
|
159
|
-
const
|
|
161
|
+
const s = Q.current, u = s.getContext("2d");
|
|
160
162
|
if (!u) {
|
|
161
|
-
|
|
163
|
+
i(new Error("Could not get canvas context"));
|
|
162
164
|
return;
|
|
163
165
|
}
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
|
|
166
|
+
const k = f.width / r.width, y = f.height / r.height, D = (t.x - r.x) * k, B = (t.y - r.y) * y, L = t.width * k, N = t.height * y;
|
|
167
|
+
s.width = L, s.height = N, I === "rounded" && (u.beginPath(), u.arc(
|
|
168
|
+
L / 2,
|
|
167
169
|
N / 2,
|
|
168
|
-
Math.min(
|
|
170
|
+
Math.min(L, N) / 2,
|
|
169
171
|
0,
|
|
170
172
|
Math.PI * 2
|
|
171
173
|
), u.closePath(), u.clip()), u.drawImage(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
W.current,
|
|
175
|
+
D,
|
|
176
|
+
B,
|
|
177
|
+
L,
|
|
176
178
|
N,
|
|
177
179
|
0,
|
|
178
180
|
0,
|
|
179
|
-
|
|
181
|
+
L,
|
|
180
182
|
N
|
|
181
|
-
),
|
|
182
|
-
(
|
|
183
|
-
|
|
183
|
+
), s.toBlob(
|
|
184
|
+
(A) => {
|
|
185
|
+
A ? n(A) : i(new Error("Failed to create blob"));
|
|
184
186
|
},
|
|
185
187
|
"image/png",
|
|
186
188
|
1
|
|
187
189
|
);
|
|
188
|
-
}), [t,
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
}), [t, f, r, I]);
|
|
191
|
+
j(() => {
|
|
192
|
+
J && te().then(J).catch(() => {
|
|
191
193
|
});
|
|
192
|
-
}, [
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
nw:
|
|
196
|
-
ne:
|
|
197
|
-
sw:
|
|
198
|
-
se:
|
|
194
|
+
}, [te, J]);
|
|
195
|
+
const C = (n) => {
|
|
196
|
+
const i = {
|
|
197
|
+
nw: h.handleNW,
|
|
198
|
+
ne: h.handleNE,
|
|
199
|
+
sw: h.handleSW,
|
|
200
|
+
se: h.handleSE
|
|
199
201
|
};
|
|
200
|
-
return /* @__PURE__ */
|
|
202
|
+
return /* @__PURE__ */ b(
|
|
201
203
|
"div",
|
|
202
204
|
{
|
|
203
|
-
className: `${
|
|
204
|
-
onMouseDown:
|
|
205
|
-
onTouchStart:
|
|
205
|
+
className: `${h.cornerHandle} ${i[n]}`,
|
|
206
|
+
onMouseDown: q(n),
|
|
207
|
+
onTouchStart: q(n),
|
|
206
208
|
children: [
|
|
207
|
-
/* @__PURE__ */
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ a("div", { className: h.cornerHandleArm, "data-direction": "horizontal" }),
|
|
210
|
+
/* @__PURE__ */ a("div", { className: h.cornerHandleArm, "data-direction": "vertical" })
|
|
209
211
|
]
|
|
210
212
|
}
|
|
211
213
|
);
|
|
212
|
-
},
|
|
213
|
-
const
|
|
214
|
-
n:
|
|
215
|
-
s:
|
|
216
|
-
e:
|
|
217
|
-
w:
|
|
214
|
+
}, F = (n) => {
|
|
215
|
+
const i = {
|
|
216
|
+
n: h.handleN,
|
|
217
|
+
s: h.handleS,
|
|
218
|
+
e: h.handleE,
|
|
219
|
+
w: h.handleW
|
|
218
220
|
};
|
|
219
|
-
return /* @__PURE__ */
|
|
221
|
+
return /* @__PURE__ */ a(
|
|
220
222
|
"div",
|
|
221
223
|
{
|
|
222
|
-
className: `${
|
|
223
|
-
onMouseDown:
|
|
224
|
-
onTouchStart:
|
|
225
|
-
children: /* @__PURE__ */
|
|
224
|
+
className: `${h.edgeHandle} ${i[n]}`,
|
|
225
|
+
onMouseDown: q(n),
|
|
226
|
+
onTouchStart: q(n),
|
|
227
|
+
children: /* @__PURE__ */ a("div", { className: h.edgeHandleBar })
|
|
226
228
|
}
|
|
227
229
|
);
|
|
228
230
|
};
|
|
229
|
-
return /* @__PURE__ */
|
|
230
|
-
/* @__PURE__ */
|
|
231
|
-
/* @__PURE__ */
|
|
231
|
+
return /* @__PURE__ */ b(oe, { className: h.container, ref: he, children: [
|
|
232
|
+
/* @__PURE__ */ a("canvas", { ref: Q, style: { display: "none" } }),
|
|
233
|
+
/* @__PURE__ */ a(
|
|
232
234
|
"img",
|
|
233
235
|
{
|
|
234
|
-
ref:
|
|
235
|
-
src:
|
|
236
|
+
ref: W,
|
|
237
|
+
src: ie,
|
|
236
238
|
alt: "Crop preview",
|
|
237
|
-
className:
|
|
238
|
-
onLoad:
|
|
239
|
+
className: h.image,
|
|
240
|
+
onLoad: re,
|
|
239
241
|
draggable: !1
|
|
240
242
|
}
|
|
241
243
|
),
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
/* @__PURE__ */
|
|
244
|
+
Y && /* @__PURE__ */ b(O, { children: [
|
|
245
|
+
I === "square" ? /* @__PURE__ */ b(O, { children: [
|
|
246
|
+
/* @__PURE__ */ a(
|
|
245
247
|
"div",
|
|
246
248
|
{
|
|
247
|
-
className:
|
|
249
|
+
className: h.overlay,
|
|
248
250
|
style: {
|
|
249
251
|
top: 0,
|
|
250
252
|
left: 0,
|
|
@@ -253,10 +255,10 @@ const ge = ({
|
|
|
253
255
|
}
|
|
254
256
|
}
|
|
255
257
|
),
|
|
256
|
-
/* @__PURE__ */
|
|
258
|
+
/* @__PURE__ */ a(
|
|
257
259
|
"div",
|
|
258
260
|
{
|
|
259
|
-
className:
|
|
261
|
+
className: h.overlay,
|
|
260
262
|
style: {
|
|
261
263
|
top: t.y + t.height,
|
|
262
264
|
left: 0,
|
|
@@ -265,10 +267,10 @@ const ge = ({
|
|
|
265
267
|
}
|
|
266
268
|
}
|
|
267
269
|
),
|
|
268
|
-
/* @__PURE__ */
|
|
270
|
+
/* @__PURE__ */ a(
|
|
269
271
|
"div",
|
|
270
272
|
{
|
|
271
|
-
className:
|
|
273
|
+
className: h.overlay,
|
|
272
274
|
style: {
|
|
273
275
|
top: t.y,
|
|
274
276
|
left: 0,
|
|
@@ -277,10 +279,10 @@ const ge = ({
|
|
|
277
279
|
}
|
|
278
280
|
}
|
|
279
281
|
),
|
|
280
|
-
/* @__PURE__ */
|
|
282
|
+
/* @__PURE__ */ a(
|
|
281
283
|
"div",
|
|
282
284
|
{
|
|
283
|
-
className:
|
|
285
|
+
className: h.overlay,
|
|
284
286
|
style: {
|
|
285
287
|
top: t.y,
|
|
286
288
|
left: t.x + t.width,
|
|
@@ -289,10 +291,10 @@ const ge = ({
|
|
|
289
291
|
}
|
|
290
292
|
}
|
|
291
293
|
)
|
|
292
|
-
] }) : /* @__PURE__ */
|
|
294
|
+
] }) : /* @__PURE__ */ a(
|
|
293
295
|
"div",
|
|
294
296
|
{
|
|
295
|
-
className:
|
|
297
|
+
className: h.circularOverlay,
|
|
296
298
|
style: {
|
|
297
299
|
left: t.x + t.width / 2,
|
|
298
300
|
top: t.y + t.height / 2,
|
|
@@ -301,49 +303,49 @@ const ge = ({
|
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
),
|
|
304
|
-
/* @__PURE__ */
|
|
306
|
+
/* @__PURE__ */ b(
|
|
305
307
|
"div",
|
|
306
308
|
{
|
|
307
|
-
className: `${
|
|
309
|
+
className: `${h.cropArea} ${I === "rounded" ? h.cropAreaRounded : ""}`,
|
|
308
310
|
style: {
|
|
309
311
|
left: t.x,
|
|
310
312
|
top: t.y,
|
|
311
313
|
width: t.width,
|
|
312
314
|
height: t.height
|
|
313
315
|
},
|
|
314
|
-
onMouseDown:
|
|
315
|
-
onTouchStart:
|
|
316
|
+
onMouseDown: ee,
|
|
317
|
+
onTouchStart: ee,
|
|
316
318
|
children: [
|
|
317
|
-
|
|
318
|
-
/* @__PURE__ */
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
I === "square" ? /* @__PURE__ */ a("div", { className: h.dashedBorder }) : /* @__PURE__ */ b(O, { children: [
|
|
320
|
+
/* @__PURE__ */ a("div", { className: `${h.edgeLine} ${h.edgeLineTop}` }),
|
|
321
|
+
/* @__PURE__ */ a(
|
|
320
322
|
"div",
|
|
321
323
|
{
|
|
322
|
-
className: `${
|
|
324
|
+
className: `${h.edgeLine} ${h.edgeLineBottom}`
|
|
323
325
|
}
|
|
324
326
|
),
|
|
325
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ a(
|
|
326
328
|
"div",
|
|
327
329
|
{
|
|
328
|
-
className: `${
|
|
330
|
+
className: `${h.edgeLine} ${h.edgeLineLeft}`
|
|
329
331
|
}
|
|
330
332
|
),
|
|
331
|
-
/* @__PURE__ */
|
|
333
|
+
/* @__PURE__ */ a(
|
|
332
334
|
"div",
|
|
333
335
|
{
|
|
334
|
-
className: `${
|
|
336
|
+
className: `${h.edgeLine} ${h.edgeLineRight}`
|
|
335
337
|
}
|
|
336
338
|
)
|
|
337
339
|
] }),
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
340
|
+
C("nw"),
|
|
341
|
+
C("ne"),
|
|
342
|
+
C("sw"),
|
|
343
|
+
C("se"),
|
|
344
|
+
I === "square" && /* @__PURE__ */ b(O, { children: [
|
|
345
|
+
F("n"),
|
|
346
|
+
F("s"),
|
|
347
|
+
F("e"),
|
|
348
|
+
F("w")
|
|
347
349
|
] })
|
|
348
350
|
]
|
|
349
351
|
}
|
|
@@ -352,5 +354,5 @@ const ge = ({
|
|
|
352
354
|
] });
|
|
353
355
|
};
|
|
354
356
|
export {
|
|
355
|
-
|
|
357
|
+
fe as ImageCropper
|
|
356
358
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguagePicker.d.ts","sourceRoot":"","sources":["../../../src/components/LanguagePicker/LanguagePicker.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LanguagePicker.d.ts","sourceRoot":"","sources":["../../../src/components/LanguagePicker/LanguagePicker.tsx"],"names":[],"mappings":"AAkBA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AA0BD,eAAO,MAAM,cAAc,GAAI,6BAI5B,mBAAmB,4CAkBrB,CAAC"}
|
|
@@ -1,45 +1,54 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import { jsx as o, jsxs as c } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import { Tick02Icon as g } from "@hugeicons/core-free-icons";
|
|
4
|
+
import { HugeiconsIcon as f } from "@hugeicons/react";
|
|
5
|
+
import { Select as u, Image as n, Group as d } from "@mantine/core";
|
|
6
|
+
import x from "../../assets/svg/flags/es.svg.js";
|
|
7
|
+
import b from "../../assets/svg/flags/ru.svg.js";
|
|
7
8
|
import y from "../../assets/svg/flags/us.svg.js";
|
|
8
|
-
import
|
|
9
|
-
const
|
|
10
|
-
ru:
|
|
9
|
+
import l from "./LanguagePicker.module.css.js";
|
|
10
|
+
const m = {
|
|
11
|
+
ru: b,
|
|
11
12
|
en: y,
|
|
12
|
-
es:
|
|
13
|
-
},
|
|
14
|
-
{ value: "ru", label: "Русский" },
|
|
13
|
+
es: x
|
|
14
|
+
}, s = [
|
|
15
15
|
{ value: "en", label: "English" },
|
|
16
|
+
{ value: "ru", label: "Русский" },
|
|
16
17
|
{ value: "es", label: "Español (España)" }
|
|
17
|
-
],
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
], E = ({
|
|
19
|
+
option: e,
|
|
20
|
+
checked: a
|
|
21
|
+
}) => /* @__PURE__ */ c(d, { flex: "1", gap: "xs", children: [
|
|
22
|
+
/* @__PURE__ */ o(n, { src: m[e.value], className: l.image }),
|
|
23
|
+
e.label,
|
|
24
|
+
a && /* @__PURE__ */ o(
|
|
25
|
+
f,
|
|
26
|
+
{
|
|
27
|
+
color: "var(--mantine-primary-color-filled)",
|
|
28
|
+
size: 16,
|
|
29
|
+
icon: g,
|
|
30
|
+
className: l.tickIcon
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] }), O = ({
|
|
34
|
+
value: e,
|
|
35
|
+
onChange: a,
|
|
36
|
+
label: t
|
|
21
37
|
}) => {
|
|
22
|
-
const i = (
|
|
23
|
-
|
|
24
|
-
checked: c
|
|
25
|
-
}) => /* @__PURE__ */ g(x, { flex: "1", gap: "xs", children: [
|
|
26
|
-
/* @__PURE__ */ a(l, { src: s[e.value], className: o.image }),
|
|
27
|
-
e.label,
|
|
28
|
-
c && /* @__PURE__ */ a(d, { style: { marginInlineStart: "auto" }, stroke: 1.2 })
|
|
29
|
-
] }), p = f(() => t.find((e) => e.value === r) ? r : "en", [r]);
|
|
30
|
-
return /* @__PURE__ */ a(
|
|
38
|
+
const i = p(() => s.find((r) => r.value === e) ? e : "en", [e]);
|
|
39
|
+
return /* @__PURE__ */ o(
|
|
31
40
|
u,
|
|
32
41
|
{
|
|
33
|
-
label:
|
|
42
|
+
label: t,
|
|
34
43
|
flex: 1,
|
|
35
|
-
onChange: (
|
|
36
|
-
leftSection: /* @__PURE__ */
|
|
37
|
-
value:
|
|
38
|
-
data:
|
|
39
|
-
renderOption:
|
|
44
|
+
onChange: (r) => r && a(r),
|
|
45
|
+
leftSection: /* @__PURE__ */ o(n, { src: m[e], className: l.image }),
|
|
46
|
+
value: i,
|
|
47
|
+
data: s,
|
|
48
|
+
renderOption: E
|
|
40
49
|
}
|
|
41
50
|
);
|
|
42
51
|
};
|
|
43
52
|
export {
|
|
44
|
-
|
|
53
|
+
O as LanguagePicker
|
|
45
54
|
};
|