@layers-app/shared 0.2.2 → 0.2.4
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/assets/svg/group_default_icon.svg.js +4 -0
- package/dist/components/AppContainer/AppContainer.d.ts +1 -1
- package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
- package/dist/components/AppContainer/AppContainer.js +31 -23
- package/dist/components/AppContainer/hooks/useAppContainerStore.d.ts.map +1 -1
- package/dist/components/AppContainer/hooks/useAppContainerStore.js +30 -20
- package/dist/components/AppContainer/types.d.ts +1 -0
- package/dist/components/AppContainer/types.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
- package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
- package/dist/components/CommentComposer/CommentEditorHotkeys.js +25 -22
- package/dist/components/CommentComposer/index.d.ts.map +1 -1
- package/dist/components/CommentComposer/index.js +237 -153
- package/dist/components/CommentComposer/{useFloatingPosition.d.ts → useVirtualAnchor.d.ts} +3 -4
- package/dist/components/CommentComposer/useVirtualAnchor.d.ts.map +1 -0
- package/dist/components/CommentComposer/useVirtualAnchor.js +71 -0
- package/dist/components/EmojiPicker/EmojiPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/EmojiPanel.js +50 -49
- package/dist/components/EmojiPicker/IconsPanel.d.ts.map +1 -1
- package/dist/components/EmojiPicker/IconsPanel.js +79 -78
- package/dist/components/FilePicker/FilePicker.d.ts +2 -3
- package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePicker.js +88 -122
- package/dist/components/FilePicker/FilePickerGiphy.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerGiphy.js +43 -44
- package/dist/components/FilePicker/FilePickerLink.d.ts +2 -3
- package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerLink.js +21 -21
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts +1 -3
- package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUnsplash.js +45 -46
- package/dist/components/FilePicker/FilePickerUpload.d.ts +3 -3
- package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
- package/dist/components/FilePicker/FilePickerUpload.js +49 -43
- package/dist/components/FormViewer/hooks/useFormGlobalTheme.d.ts +5 -5
- package/dist/components/GroupAvatar/index.d.ts +9 -0
- package/dist/components/GroupAvatar/index.d.ts.map +1 -0
- package/dist/components/GroupAvatar/index.js +24 -0
- package/dist/components/NavMenu/components/NavMenuItem.d.ts.map +1 -1
- package/dist/components/NavMenu/components/NavMenuItem.js +6 -5
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts +2 -2
- package/dist/components/WorkspaceMenu/WorkspaceMenu.d.ts.map +1 -1
- package/dist/components/WorkspaceMenu/WorkspaceMenu.js +100 -103
- package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
- package/dist/components/modals/RemoveConfirmModal.js +22 -21
- package/dist/components/table/FrontTable.d.ts +2 -1
- package/dist/components/table/FrontTable.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.d.ts.map +1 -1
- package/dist/components/table/components/TableCell.js +63 -26
- package/dist/components/table/components/TableMenu.d.ts +2 -1
- package/dist/components/table/components/TableMenu.d.ts.map +1 -1
- package/dist/components/table/components/TableMenu.js +15 -14
- package/dist/constants.d.ts +4 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -4
- package/dist/index.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +390 -384
- package/dist/lang/locales/ui_en.json.js +20 -12
- package/dist/lang/locales/ui_es.json.js +18 -10
- package/dist/lang/locales/ui_ru.json.js +24 -16
- package/dist/store/accessOptionsControl.d.ts +11 -1
- package/dist/store/accessOptionsControl.d.ts.map +1 -1
- package/dist/store/accessOptionsControl.js +15 -7
- package/package.json +1 -1
- package/dist/components/CommentComposer/useFloatingPosition.d.ts.map +0 -1
- package/dist/components/CommentComposer/useFloatingPosition.js +0 -115
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as y, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u, useRef as d, useEffect as R, useCallback as K } from "react";
|
|
3
3
|
import { useTranslation as L } from "react-i18next";
|
|
4
4
|
import { Search01Icon as U, ShuffleIcon as V, Clock01Icon as W, SmileIcon as X, Pizza01Icon as Z, FootballIcon as _, Airplane01Icon as ee, BulbIcon as te, Asterisk02Icon as oe, Flag02Icon as re } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as c } from "@hugeicons/react";
|
|
6
|
-
import { Stack as
|
|
7
|
-
import { useEvent as
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { pickRandomEmoji as
|
|
11
|
-
import { NoData as
|
|
12
|
-
import { IconEntity as
|
|
13
|
-
import { frequentEmoji as
|
|
6
|
+
import { Stack as v, FocusTrap as ne, Flex as x, TextInput as ie, Tooltip as ce, ActionIcon as A, Paper as F, Text as q, SimpleGrid as N } from "@mantine/core";
|
|
7
|
+
import { useEvent as se } from "draggable-ui";
|
|
8
|
+
import ae from "fuse.js";
|
|
9
|
+
import le from "../../assets/svg/dog.svg.js";
|
|
10
|
+
import { pickRandomEmoji as fe } from "../../helpers/pickRandomEmoji.js";
|
|
11
|
+
import { NoData as ue } from "../NoData/NoData.js";
|
|
12
|
+
import { IconEntity as de } from "../ProjectIcon/ProjectIcon.js";
|
|
13
|
+
import { frequentEmoji as me } from "./constants.js";
|
|
14
14
|
import T from "./EmojiPicker.module.css.js";
|
|
15
|
-
const
|
|
15
|
+
const pe = [
|
|
16
16
|
{ i: "frequent", icon: /* @__PURE__ */ t(c, { size: 20, icon: W }) },
|
|
17
17
|
{ i: "people", icon: /* @__PURE__ */ t(c, { size: 20, icon: X }) },
|
|
18
18
|
{
|
|
19
19
|
i: "nature",
|
|
20
|
-
icon: /* @__PURE__ */ t(
|
|
20
|
+
icon: /* @__PURE__ */ t(le, { width: 20, height: 20 })
|
|
21
21
|
},
|
|
22
22
|
{ i: "foods", icon: /* @__PURE__ */ t(c, { size: 20, icon: Z }) },
|
|
23
23
|
{ i: "activity", icon: /* @__PURE__ */ t(c, { size: 20, icon: _ }) },
|
|
@@ -25,18 +25,18 @@ const he = [
|
|
|
25
25
|
{ i: "objects", icon: /* @__PURE__ */ t(c, { size: 20, icon: te }) },
|
|
26
26
|
{ i: "symbols", icon: /* @__PURE__ */ t(c, { size: 20, icon: oe }) },
|
|
27
27
|
{ i: "flags", icon: /* @__PURE__ */ t(c, { size: 20, icon: re }) }
|
|
28
|
-
],
|
|
28
|
+
], Ee = ({
|
|
29
29
|
locales: m,
|
|
30
|
-
onChange:
|
|
30
|
+
onChange: C,
|
|
31
31
|
onClose: M,
|
|
32
32
|
setRandomIcon: P,
|
|
33
33
|
querySearch: p
|
|
34
34
|
}) => {
|
|
35
|
-
const [
|
|
35
|
+
const [b, k] = u("frequent"), I = d("frequent"), h = d({}), z = d(null), [w, S] = u(""), [Q, O] = u([]), [a, B] = u(null), [D, E] = u([]), { t: G } = L(), g = d(!1), l = d(null);
|
|
36
36
|
R(() => {
|
|
37
37
|
if (typeof p == "string") {
|
|
38
38
|
const e = p.slice(1);
|
|
39
|
-
if (
|
|
39
|
+
if (S(e), a) {
|
|
40
40
|
const o = a.search(e);
|
|
41
41
|
E(o.map((r) => r.item.e));
|
|
42
42
|
}
|
|
@@ -50,11 +50,11 @@ const he = [
|
|
|
50
50
|
k: n.k
|
|
51
51
|
// категория
|
|
52
52
|
}))
|
|
53
|
-
), s =
|
|
53
|
+
), s = me.map(
|
|
54
54
|
(i) => r.find((n) => n.e === i)
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
const f = new
|
|
56
|
+
O([{ i: "frequent", e: s }, ...o]);
|
|
57
|
+
const f = new ae(
|
|
58
58
|
o.flatMap(
|
|
59
59
|
(i) => i.e.map((n) => ({
|
|
60
60
|
e: n.e,
|
|
@@ -67,40 +67,40 @@ const he = [
|
|
|
67
67
|
threshold: 0.3
|
|
68
68
|
}
|
|
69
69
|
);
|
|
70
|
-
|
|
70
|
+
B(f);
|
|
71
71
|
})();
|
|
72
72
|
}, []);
|
|
73
73
|
const H = K(
|
|
74
74
|
(e) => {
|
|
75
75
|
const o = e.currentTarget.value;
|
|
76
|
-
if (
|
|
76
|
+
if (S(o), a) {
|
|
77
77
|
const r = a.search(o);
|
|
78
78
|
E(r.map((s) => s.item.e));
|
|
79
79
|
}
|
|
80
80
|
},
|
|
81
81
|
[a]
|
|
82
|
-
),
|
|
82
|
+
), j = se((e) => {
|
|
83
83
|
const o = e.currentTarget.getAttribute("data-icon");
|
|
84
|
-
o && (
|
|
85
|
-
|
|
84
|
+
o && (C?.(
|
|
85
|
+
de.stringify({
|
|
86
86
|
emoji: o.replace("e:", "")
|
|
87
87
|
})
|
|
88
88
|
), M());
|
|
89
89
|
}), Y = (e) => {
|
|
90
|
-
const o =
|
|
90
|
+
const o = z.current, r = h.current[e.i];
|
|
91
91
|
if (!o || !r) return;
|
|
92
|
-
g.current = !0, l.current = e.i,
|
|
92
|
+
g.current = !0, l.current = e.i, k(e.i);
|
|
93
93
|
const s = r.offsetTop - o.offsetTop;
|
|
94
94
|
o.scrollTo({ top: s, behavior: "smooth" });
|
|
95
95
|
}, $ = () => {
|
|
96
|
-
const e =
|
|
96
|
+
const e = z.current;
|
|
97
97
|
if (!e) return;
|
|
98
98
|
const o = e.scrollTop;
|
|
99
99
|
if (g.current && l.current) {
|
|
100
100
|
const f = h.current[l.current];
|
|
101
101
|
if (f) {
|
|
102
102
|
const i = f.offsetTop - e.offsetTop;
|
|
103
|
-
Math.abs(i - o) < 12 && (g.current = !1,
|
|
103
|
+
Math.abs(i - o) < 12 && (g.current = !1, I.current = l.current, k(l.current), l.current = null);
|
|
104
104
|
}
|
|
105
105
|
if (g.current) return;
|
|
106
106
|
}
|
|
@@ -110,11 +110,11 @@ const he = [
|
|
|
110
110
|
const n = Math.abs(i.offsetTop - e.offsetTop - o);
|
|
111
111
|
n < s && (s = n, r = f);
|
|
112
112
|
}
|
|
113
|
-
}), r !==
|
|
113
|
+
}), r !== I.current && (I.current = r, k(r));
|
|
114
114
|
}, J = typeof p == "string";
|
|
115
|
-
return /* @__PURE__ */ v
|
|
116
|
-
/* @__PURE__ */ t(ne, { active: !0, children: /* @__PURE__ */
|
|
117
|
-
|
|
115
|
+
return /* @__PURE__ */ y(v, { gap: 0, h: "100%", children: [
|
|
116
|
+
/* @__PURE__ */ t(ne, { active: !0, children: /* @__PURE__ */ y(
|
|
117
|
+
x,
|
|
118
118
|
{
|
|
119
119
|
my: "sm",
|
|
120
120
|
justify: "space-between",
|
|
@@ -127,7 +127,7 @@ const he = [
|
|
|
127
127
|
ie,
|
|
128
128
|
{
|
|
129
129
|
leftSection: /* @__PURE__ */ t(c, { size: 16, icon: U }),
|
|
130
|
-
value:
|
|
130
|
+
value: w,
|
|
131
131
|
placeholder: `${m?.search}...`,
|
|
132
132
|
"data-autofocus": !0,
|
|
133
133
|
styles: {
|
|
@@ -148,7 +148,7 @@ const he = [
|
|
|
148
148
|
w: 36,
|
|
149
149
|
variant: "outline",
|
|
150
150
|
color: "var(--mantine-color-default-border)",
|
|
151
|
-
onClick: () =>
|
|
151
|
+
onClick: () => fe(P, C),
|
|
152
152
|
className: T.randomIcon,
|
|
153
153
|
children: /* @__PURE__ */ t(
|
|
154
154
|
c,
|
|
@@ -163,8 +163,8 @@ const he = [
|
|
|
163
163
|
]
|
|
164
164
|
}
|
|
165
165
|
) }),
|
|
166
|
-
/* @__PURE__ */ t(
|
|
167
|
-
|
|
166
|
+
/* @__PURE__ */ t(v, { pl: 8, h: "230px", children: /* @__PURE__ */ t(
|
|
167
|
+
v,
|
|
168
168
|
{
|
|
169
169
|
gap: "xs",
|
|
170
170
|
h: "100%",
|
|
@@ -172,9 +172,9 @@ const he = [
|
|
|
172
172
|
style: {
|
|
173
173
|
overflowY: "auto"
|
|
174
174
|
},
|
|
175
|
-
ref:
|
|
175
|
+
ref: z,
|
|
176
176
|
onScroll: $,
|
|
177
|
-
children:
|
|
177
|
+
children: w ? /* @__PURE__ */ y(v, { flex: 1, justify: "center", align: "stretch", children: [
|
|
178
178
|
!J && /* @__PURE__ */ t(
|
|
179
179
|
F,
|
|
180
180
|
{
|
|
@@ -186,18 +186,19 @@ const he = [
|
|
|
186
186
|
children: /* @__PURE__ */ t(q, { fz: "sm", c: "dimmed", children: m?.searchResults })
|
|
187
187
|
}
|
|
188
188
|
),
|
|
189
|
-
|
|
189
|
+
D.length ? /* @__PURE__ */ t(N, { cols: 10, spacing: 0, children: D.map((e) => /* @__PURE__ */ t(
|
|
190
190
|
"div",
|
|
191
191
|
{
|
|
192
192
|
className: T.item,
|
|
193
193
|
"data-icon": e,
|
|
194
|
-
onClick:
|
|
194
|
+
onClick: j,
|
|
195
195
|
children: e
|
|
196
196
|
},
|
|
197
197
|
e
|
|
198
|
-
)) }) : /* @__PURE__ */ t(
|
|
199
|
-
|
|
198
|
+
)) }) : /* @__PURE__ */ t(x, { flex: 1, justify: "center", align: "stretch", children: /* @__PURE__ */ t(
|
|
199
|
+
ue,
|
|
200
200
|
{
|
|
201
|
+
showDots: !1,
|
|
201
202
|
size: 100,
|
|
202
203
|
description: m?.searchNoResults,
|
|
203
204
|
descriptionProps: {
|
|
@@ -205,7 +206,7 @@ const he = [
|
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
208
|
) })
|
|
208
|
-
] }) : Q.map((e) => /* @__PURE__ */
|
|
209
|
+
] }) : Q.map((e) => /* @__PURE__ */ y(
|
|
209
210
|
"div",
|
|
210
211
|
{
|
|
211
212
|
ref: (o) => {
|
|
@@ -229,7 +230,7 @@ const he = [
|
|
|
229
230
|
{
|
|
230
231
|
className: T.item,
|
|
231
232
|
"data-icon": o.e,
|
|
232
|
-
onClick:
|
|
233
|
+
onClick: j,
|
|
233
234
|
children: o.e
|
|
234
235
|
},
|
|
235
236
|
o.e
|
|
@@ -241,7 +242,7 @@ const he = [
|
|
|
241
242
|
}
|
|
242
243
|
) }),
|
|
243
244
|
/* @__PURE__ */ t(
|
|
244
|
-
|
|
245
|
+
x,
|
|
245
246
|
{
|
|
246
247
|
style: {
|
|
247
248
|
borderTop: "1px solid var(--tab-border-color)"
|
|
@@ -249,15 +250,15 @@ const he = [
|
|
|
249
250
|
justify: "space-between",
|
|
250
251
|
h: "56px",
|
|
251
252
|
px: 8,
|
|
252
|
-
children:
|
|
253
|
+
children: pe.map((e) => /* @__PURE__ */ t(
|
|
253
254
|
A,
|
|
254
255
|
{
|
|
255
|
-
variant:
|
|
256
|
-
color:
|
|
256
|
+
variant: b === e.i ? "light" : "subtle",
|
|
257
|
+
color: b === e.i ? "var(--mantine-color-default-color)" : "var(--mantine-color-dimmed)",
|
|
257
258
|
radius: "default",
|
|
258
259
|
size: 32,
|
|
259
260
|
onClick: () => Y(e),
|
|
260
|
-
"data-active":
|
|
261
|
+
"data-active": b === e.i,
|
|
261
262
|
children: e.icon
|
|
262
263
|
},
|
|
263
264
|
e.i
|
|
@@ -267,5 +268,5 @@ const he = [
|
|
|
267
268
|
] });
|
|
268
269
|
};
|
|
269
270
|
export {
|
|
270
|
-
|
|
271
|
+
Ee as EmojiPanel
|
|
271
272
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA2BjD,eAAO,MAAM,UAAU,oGAQlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,
|
|
1
|
+
{"version":3,"file":"IconsPanel.d.ts","sourceRoot":"","sources":["../../../src/components/EmojiPicker/IconsPanel.tsx"],"names":[],"mappings":"AAoCA,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AA2BjD,eAAO,MAAM,UAAU,oGAQlB,IAAI,CACL,gBAAgB,EAChB,SAAS,GAAG,YAAY,GAAG,OAAO,GAAG,UAAU,GAAG,SAAS,CAC5D,GAAG;IACF,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,6CAuSF,CAAC"}
|
|
@@ -1,87 +1,87 @@
|
|
|
1
1
|
import { jsxs as m, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { memo as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { Search01Icon as
|
|
2
|
+
import { memo as q, useState as x, useEffect as B, useCallback as M, useMemo as U } from "react";
|
|
3
|
+
import { useTranslation as V } from "react-i18next";
|
|
4
|
+
import { Search01Icon as G, ShuffleIcon as Q } from "@hugeicons/core-free-icons";
|
|
5
5
|
import { HugeiconsIcon as L } from "@hugeicons/react";
|
|
6
|
-
import { useMantineTheme as
|
|
6
|
+
import { useMantineTheme as Y, parseThemeColor as _, darken as J, Stack as y, Text as b, Flex as z, FocusTrap as K, TextInput as W, Tooltip as X, ActionIcon as Z, Box as ee, Paper as D, SimpleGrid as E } from "@mantine/core";
|
|
7
7
|
import { useEvent as oe } from "draggable-ui";
|
|
8
|
-
import { groupBy as
|
|
9
|
-
import { DEFAULT_VALUES as
|
|
8
|
+
import { groupBy as te } from "lodash-es";
|
|
9
|
+
import { DEFAULT_VALUES as re } from "../../constants.js";
|
|
10
10
|
import { ColorPicker as ie } from "../ColorPicker/ColorPicker.js";
|
|
11
11
|
import { NoData as ne } from "../NoData/NoData.js";
|
|
12
|
-
import { IconEntity as
|
|
13
|
-
import { customIcons as
|
|
12
|
+
import { IconEntity as w, IconType as N } from "../ProjectIcon/ProjectIcon.js";
|
|
13
|
+
import { customIcons as A } from "./custom-icons/customIcons.js";
|
|
14
14
|
import { getIconsList as F } from "./getIconsList.js";
|
|
15
15
|
import { getRandomIcon as ce } from "./getRandomIcon.js";
|
|
16
16
|
import h from "./EmojiPicker.module.css.js";
|
|
17
17
|
async function ae(c, a, l = 500) {
|
|
18
|
-
const u = [],
|
|
19
|
-
for (let
|
|
20
|
-
const
|
|
21
|
-
u.push(...
|
|
18
|
+
const u = [], f = c.length;
|
|
19
|
+
for (let r = 0; r < f; r += l) {
|
|
20
|
+
const p = c.slice(r, r + l).filter(a);
|
|
21
|
+
u.push(...p), await new Promise((I) => setTimeout(I, 0));
|
|
22
22
|
}
|
|
23
23
|
return u;
|
|
24
24
|
}
|
|
25
|
-
const Ce =
|
|
25
|
+
const Ce = q(
|
|
26
26
|
({
|
|
27
27
|
showColors: c,
|
|
28
28
|
locales: a,
|
|
29
29
|
onChange: l,
|
|
30
30
|
value: u,
|
|
31
|
-
onClose:
|
|
32
|
-
project:
|
|
31
|
+
onClose: f,
|
|
32
|
+
project: r
|
|
33
33
|
}) => {
|
|
34
|
-
const C =
|
|
34
|
+
const C = Y(), [p, I] = x(""), { t: k } = V("ui"), [R, P] = x(
|
|
35
35
|
[]
|
|
36
36
|
);
|
|
37
|
-
|
|
37
|
+
B(() => {
|
|
38
38
|
(async () => {
|
|
39
|
-
const
|
|
39
|
+
const t = await F(r), s = te(t, "c");
|
|
40
40
|
P(
|
|
41
|
-
Object.entries(s).map((
|
|
42
|
-
id:
|
|
43
|
-
icons:
|
|
41
|
+
Object.entries(s).map((v) => ({
|
|
42
|
+
id: v[0],
|
|
43
|
+
icons: v[1].map((d) => d.n)
|
|
44
44
|
}))
|
|
45
45
|
);
|
|
46
46
|
})();
|
|
47
|
-
}, [
|
|
48
|
-
const [T, S] =
|
|
47
|
+
}, [r]);
|
|
48
|
+
const [T, S] = x([]), $ = M(
|
|
49
49
|
async (o) => {
|
|
50
|
-
const
|
|
51
|
-
I(
|
|
52
|
-
const s = await F(
|
|
50
|
+
const t = o.currentTarget.value;
|
|
51
|
+
I(t);
|
|
52
|
+
const s = await F(r), v = await ae(
|
|
53
53
|
s,
|
|
54
|
-
(d) => d.t.split(",").some((
|
|
54
|
+
(d) => d.t.split(",").some((j) => t.includes(String(j))) || d.n.includes(t),
|
|
55
55
|
500
|
|
56
56
|
);
|
|
57
|
-
S(
|
|
57
|
+
S(v.map((d) => d.n));
|
|
58
58
|
},
|
|
59
|
-
[
|
|
60
|
-
), i =
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
icon:
|
|
59
|
+
[r]
|
|
60
|
+
), i = w.parse(u), g = oe((o) => {
|
|
61
|
+
const t = o.currentTarget.getAttribute("data-icon");
|
|
62
|
+
t && (l?.(
|
|
63
|
+
w.stringify({
|
|
64
|
+
icon: t.replace("i:", ""),
|
|
65
65
|
color: i?.color,
|
|
66
|
-
type:
|
|
66
|
+
type: N.FILLED
|
|
67
67
|
})
|
|
68
|
-
), c ||
|
|
69
|
-
}), n =
|
|
70
|
-
color: i?.color ||
|
|
68
|
+
), c || f());
|
|
69
|
+
}), n = _({
|
|
70
|
+
color: i?.color || re.COLORS[0],
|
|
71
71
|
theme: C
|
|
72
|
-
}), H =
|
|
72
|
+
}), H = U(() => n.isThemeColor ? {
|
|
73
73
|
"--icon-color": `var(--mantine-color-${n.color}-filled)`,
|
|
74
74
|
"--icon-color-hover": `var(--mantine-color-${n.color}-filled-hover)`
|
|
75
75
|
} : {
|
|
76
76
|
"--icon-color": n.value,
|
|
77
77
|
"--icon-color-hover": J(n.value, 0.2)
|
|
78
78
|
}, [n]), O = async () => {
|
|
79
|
-
const o = await ce(
|
|
80
|
-
S([]), l?.(
|
|
79
|
+
const o = await ce(r);
|
|
80
|
+
S([]), l?.(w.stringify({ icon: o, color: i?.color })), c || f();
|
|
81
81
|
};
|
|
82
|
-
return /* @__PURE__ */ m(
|
|
83
|
-
c && /* @__PURE__ */ m(
|
|
84
|
-
/* @__PURE__ */ e(b, { lh: "140%", fw: 500, c: "dimmed", fz: "xs", children: a?.chooseColor ||
|
|
82
|
+
return /* @__PURE__ */ m(y, { w: "100%", gap: "sm", pt: 12, pb: 8, h: "100%", children: [
|
|
83
|
+
c && /* @__PURE__ */ m(y, { gap: 4, px: 8, w: "100%", children: [
|
|
84
|
+
/* @__PURE__ */ e(b, { lh: "140%", fw: 500, c: "dimmed", fz: "xs", children: a?.chooseColor || k("chooseColor") }),
|
|
85
85
|
/* @__PURE__ */ e(
|
|
86
86
|
ie,
|
|
87
87
|
{
|
|
@@ -89,10 +89,10 @@ const Ce = B(
|
|
|
89
89
|
gap: 4,
|
|
90
90
|
value: n.color,
|
|
91
91
|
onChange: (o) => l?.(
|
|
92
|
-
|
|
92
|
+
w.stringify({
|
|
93
93
|
color: o,
|
|
94
94
|
icon: i?.icon,
|
|
95
|
-
type:
|
|
95
|
+
type: N.FILLED
|
|
96
96
|
})
|
|
97
97
|
),
|
|
98
98
|
colors: [
|
|
@@ -111,12 +111,12 @@ const Ce = B(
|
|
|
111
111
|
n.color
|
|
112
112
|
)
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */ m(
|
|
115
|
-
/* @__PURE__ */ e(
|
|
116
|
-
|
|
114
|
+
/* @__PURE__ */ m(z, { w: "100%", justify: "space-between", gap: 4, px: 8, h: 38, children: [
|
|
115
|
+
/* @__PURE__ */ e(K, { active: !0, children: /* @__PURE__ */ e(
|
|
116
|
+
W,
|
|
117
117
|
{
|
|
118
|
-
leftSection: /* @__PURE__ */ e(L, { size: 16, icon:
|
|
119
|
-
value:
|
|
118
|
+
leftSection: /* @__PURE__ */ e(L, { size: 16, icon: G }),
|
|
119
|
+
value: p,
|
|
120
120
|
placeholder: `${a?.search}...`,
|
|
121
121
|
"data-autofocus": !0,
|
|
122
122
|
styles: {
|
|
@@ -130,8 +130,8 @@ const Ce = B(
|
|
|
130
130
|
radius: "var(--mantine-radius-default)"
|
|
131
131
|
}
|
|
132
132
|
) }),
|
|
133
|
-
/* @__PURE__ */ e(
|
|
134
|
-
|
|
133
|
+
/* @__PURE__ */ e(X, { withArrow: !0, label: k("random"), children: /* @__PURE__ */ e(
|
|
134
|
+
Z,
|
|
135
135
|
{
|
|
136
136
|
h: 36,
|
|
137
137
|
w: 36,
|
|
@@ -144,23 +144,23 @@ const Ce = B(
|
|
|
144
144
|
{
|
|
145
145
|
color: "var(--mantine-color-default-color)",
|
|
146
146
|
size: 20,
|
|
147
|
-
icon:
|
|
147
|
+
icon: Q
|
|
148
148
|
}
|
|
149
149
|
)
|
|
150
150
|
}
|
|
151
151
|
) })
|
|
152
152
|
] }),
|
|
153
|
-
/* @__PURE__ */ e(
|
|
154
|
-
|
|
153
|
+
/* @__PURE__ */ e(ee, { pl: 8, style: H, children: /* @__PURE__ */ e(
|
|
154
|
+
y,
|
|
155
155
|
{
|
|
156
156
|
h: "210px",
|
|
157
157
|
style: {
|
|
158
158
|
overflowY: "auto"
|
|
159
159
|
},
|
|
160
160
|
gap: 16,
|
|
161
|
-
children:
|
|
161
|
+
children: p ? /* @__PURE__ */ m(y, { flex: 1, justify: "center", align: "stretch", children: [
|
|
162
162
|
/* @__PURE__ */ e(
|
|
163
|
-
|
|
163
|
+
D,
|
|
164
164
|
{
|
|
165
165
|
py: 6,
|
|
166
166
|
pos: "sticky",
|
|
@@ -170,16 +170,16 @@ const Ce = B(
|
|
|
170
170
|
children: /* @__PURE__ */ e(b, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: a?.searchResults })
|
|
171
171
|
}
|
|
172
172
|
),
|
|
173
|
-
T.length ? /* @__PURE__ */ e(
|
|
174
|
-
const
|
|
175
|
-
return
|
|
173
|
+
T.length ? /* @__PURE__ */ e(E, { cols: 8, spacing: 0, children: T.map((o) => {
|
|
174
|
+
const t = A[o];
|
|
175
|
+
return t ? /* @__PURE__ */ e(
|
|
176
176
|
"div",
|
|
177
177
|
{
|
|
178
178
|
className: h.item,
|
|
179
179
|
"data-icon": o,
|
|
180
180
|
"data-active": o === i?.icon,
|
|
181
|
-
onClick:
|
|
182
|
-
children: /* @__PURE__ */ e(
|
|
181
|
+
onClick: g,
|
|
182
|
+
children: /* @__PURE__ */ e(t, {})
|
|
183
183
|
},
|
|
184
184
|
o
|
|
185
185
|
) : /* @__PURE__ */ e(
|
|
@@ -188,7 +188,7 @@ const Ce = B(
|
|
|
188
188
|
className: h.item,
|
|
189
189
|
"data-icon": o,
|
|
190
190
|
"data-active": o === i?.icon,
|
|
191
|
-
onClick:
|
|
191
|
+
onClick: g,
|
|
192
192
|
children: /* @__PURE__ */ e("svg", { width: "1em", height: "1em", children: /* @__PURE__ */ e(
|
|
193
193
|
"use",
|
|
194
194
|
{
|
|
@@ -198,9 +198,10 @@ const Ce = B(
|
|
|
198
198
|
},
|
|
199
199
|
o
|
|
200
200
|
);
|
|
201
|
-
}) }) : /* @__PURE__ */ e(z, {
|
|
201
|
+
}) }) : /* @__PURE__ */ e(z, { flex: 1, justify: "center", align: "stretch", children: /* @__PURE__ */ e(
|
|
202
202
|
ne,
|
|
203
203
|
{
|
|
204
|
+
showDots: !1,
|
|
204
205
|
size: 100,
|
|
205
206
|
description: a?.searchNoResults,
|
|
206
207
|
descriptionProps: {
|
|
@@ -210,25 +211,25 @@ const Ce = B(
|
|
|
210
211
|
) })
|
|
211
212
|
] }) : R.map((o) => /* @__PURE__ */ m("div", { children: [
|
|
212
213
|
/* @__PURE__ */ e(
|
|
213
|
-
|
|
214
|
+
D,
|
|
214
215
|
{
|
|
215
216
|
bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-6))",
|
|
216
217
|
py: 6,
|
|
217
218
|
pos: "sticky",
|
|
218
219
|
top: -1,
|
|
219
220
|
style: { zIndex: 1 },
|
|
220
|
-
children: /* @__PURE__ */ e(b, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: o.id ||
|
|
221
|
+
children: /* @__PURE__ */ e(b, { fz: "xs", fw: 500, lh: "140%", c: "dimmed", children: o.id || k("noCat") })
|
|
221
222
|
}
|
|
222
223
|
),
|
|
223
|
-
/* @__PURE__ */ e(
|
|
224
|
-
const s =
|
|
224
|
+
/* @__PURE__ */ e(E, { cols: 10, spacing: 0, children: o.icons.map((t) => {
|
|
225
|
+
const s = A[t];
|
|
225
226
|
return s ? /* @__PURE__ */ e(
|
|
226
227
|
"div",
|
|
227
228
|
{
|
|
228
229
|
className: h.item,
|
|
229
|
-
"data-icon":
|
|
230
|
-
"data-active":
|
|
231
|
-
onClick:
|
|
230
|
+
"data-icon": t,
|
|
231
|
+
"data-active": t === i?.icon,
|
|
232
|
+
onClick: g,
|
|
232
233
|
children: /* @__PURE__ */ e(
|
|
233
234
|
s,
|
|
234
235
|
{
|
|
@@ -238,22 +239,22 @@ const Ce = B(
|
|
|
238
239
|
}
|
|
239
240
|
)
|
|
240
241
|
},
|
|
241
|
-
|
|
242
|
+
t
|
|
242
243
|
) : /* @__PURE__ */ e(
|
|
243
244
|
"div",
|
|
244
245
|
{
|
|
245
246
|
className: h.item,
|
|
246
|
-
"data-icon":
|
|
247
|
-
"data-active":
|
|
248
|
-
onClick:
|
|
247
|
+
"data-icon": t,
|
|
248
|
+
"data-active": t === i?.icon,
|
|
249
|
+
onClick: g,
|
|
249
250
|
children: /* @__PURE__ */ e("svg", { width: "1em", height: "1em", children: /* @__PURE__ */ e(
|
|
250
251
|
"use",
|
|
251
252
|
{
|
|
252
|
-
xlinkHref: `/tabler-sprite-filled.svg#tabler-filled-${
|
|
253
|
+
xlinkHref: `/tabler-sprite-filled.svg#tabler-filled-${t}`
|
|
253
254
|
}
|
|
254
255
|
) })
|
|
255
256
|
},
|
|
256
|
-
|
|
257
|
+
t
|
|
257
258
|
);
|
|
258
259
|
}) })
|
|
259
260
|
] }, o.id))
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { PropsWithChildren } from 'react';
|
|
2
2
|
import { FlexProps, FloatingPosition, PopoverProps } from '@mantine/core';
|
|
3
3
|
import { DropzoneProps, FileWithPath } from '@mantine/dropzone';
|
|
4
|
-
import {
|
|
4
|
+
import { FileType, ImagePickerGalleryCollection } from './types';
|
|
5
5
|
declare const baseTabsList: readonly ["gallery", "upload", "link", "unsplash", "giphy"];
|
|
6
6
|
type TabType = (typeof baseTabsList)[number];
|
|
7
7
|
export type FilePickerProps = PropsWithChildren<{
|
|
@@ -19,12 +19,11 @@ export type FilePickerProps = PropsWithChildren<{
|
|
|
19
19
|
galleryCollection?: ImagePickerGalleryCollection[];
|
|
20
20
|
popoverProps?: PopoverProps;
|
|
21
21
|
dropZoneProps?: Omit<DropzoneProps, 'onDrop'>;
|
|
22
|
-
locales?: FilePickerLocales;
|
|
23
22
|
type?: FileType;
|
|
24
23
|
isValidMediaUrl?: (url: string) => boolean;
|
|
25
24
|
targetProps?: FlexProps;
|
|
26
25
|
onOpenedChange?: (opened: boolean) => void;
|
|
27
26
|
}>;
|
|
28
|
-
export declare const FilePicker: ({ onChange, onRemove, onUpload, uploading, showTabs, children, width, position, readOnly, hasImage, giphyToken, unsplashClientId, type, galleryCollection, isValidMediaUrl, popoverProps, dropZoneProps, targetProps, onOpenedChange,
|
|
27
|
+
export declare const FilePicker: ({ onChange, onRemove, onUpload, uploading, showTabs, children, width, position, readOnly, hasImage, giphyToken, unsplashClientId, type, galleryCollection, isValidMediaUrl, popoverProps, dropZoneProps, targetProps, onOpenedChange, }: PropsWithChildren<FilePickerProps>) => import("react/jsx-runtime").JSX.Element;
|
|
29
28
|
export {};
|
|
30
29
|
//# sourceMappingURL=FilePicker.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"FilePicker.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAqB,MAAM,OAAO,CAAC;AAK7D,OAAO,EAIL,SAAS,EACT,gBAAgB,EAEhB,YAAY,EAIb,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAQhE,OAAO,EAAE,QAAQ,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIjE,QAAA,MAAM,YAAY,6DAMR,CAAC;AAEX,KAAK,OAAO,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,iBAAiB,CAAC;IAC9C,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC5D,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,YAAY,EAAE,EACrB,SAAS,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,KAChC,IAAI,CAAC;IACV,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,QAAQ,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC9B,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,iBAAiB,CAAC,EAAE,4BAA4B,EAAE,CAAC;IACnD,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,aAAa,CAAC,EAAE,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;IAC9C,IAAI,CAAC,EAAE,QAAQ,CAAC;IAChB,eAAe,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IAC3C,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CAC5C,CAAC,CAAC;AAEH,eAAO,MAAM,UAAU,GAAI,yOAoBxB,iBAAiB,CAAC,eAAe,CAAC,4CA4MpC,CAAC"}
|