@layers-app/shared 0.3.2 → 0.3.3

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 (75) hide show
  1. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +14 -14
  2. package/dist/components/AppContainer/AppContainer.module.css.js +1 -1
  3. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +1 -1
  4. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  5. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  6. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +14 -14
  7. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +1 -1
  8. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +8 -8
  9. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  10. package/dist/components/ColorPicker/ColorPicker.module.css.js +14 -14
  11. package/dist/components/CommentComposer/CommentComposer.module.css.js +4 -4
  12. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  13. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  14. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  15. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  16. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  17. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  18. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  19. package/dist/components/FilePicker/FilePicker.d.ts +4 -2
  20. package/dist/components/FilePicker/FilePicker.d.ts.map +1 -1
  21. package/dist/components/FilePicker/FilePicker.js +241 -226
  22. package/dist/components/FilePicker/FilePicker.module.css.js +14 -12
  23. package/dist/components/FilePicker/FilePickerGallery.d.ts.map +1 -1
  24. package/dist/components/FilePicker/FilePickerGallery.js +60 -34
  25. package/dist/components/FilePicker/FilePickerGiphy.d.ts.map +1 -1
  26. package/dist/components/FilePicker/FilePickerGiphy.js +35 -36
  27. package/dist/components/FilePicker/FilePickerLink.d.ts.map +1 -1
  28. package/dist/components/FilePicker/FilePickerLink.js +26 -23
  29. package/dist/components/FilePicker/FilePickerUnsplash.d.ts.map +1 -1
  30. package/dist/components/FilePicker/FilePickerUnsplash.js +42 -43
  31. package/dist/components/FilePicker/FilePickerUpload.d.ts.map +1 -1
  32. package/dist/components/FilePicker/FilePickerUpload.js +51 -35
  33. package/dist/components/FilePicker/coverCollections.d.ts +4 -0
  34. package/dist/components/FilePicker/coverCollections.d.ts.map +1 -0
  35. package/dist/components/FilePicker/coverCollections.js +164 -0
  36. package/dist/components/FilePicker/index.d.ts +1 -0
  37. package/dist/components/FilePicker/index.d.ts.map +1 -1
  38. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  39. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  40. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  41. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  42. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  43. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  44. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  45. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  46. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  47. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  48. package/dist/components/Loaders/styles.module.css.js +6 -6
  49. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  50. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  51. package/dist/components/NavMenu/components/DnDProvider.d.ts.map +1 -1
  52. package/dist/components/NavMenu/components/DnDProvider.js +34 -31
  53. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  54. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  55. package/dist/components/Notification/Notification.module.css.js +1 -1
  56. package/dist/components/OnBoarding/steps/DifferentLayouts/styles.module.css.js +3 -3
  57. package/dist/components/OnBoarding/steps/styles.module.css.js +9 -9
  58. package/dist/components/OnBoarding/styles.module.css.js +7 -7
  59. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  60. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  61. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  62. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  63. package/dist/components/table/FrontTable.d.ts.map +1 -1
  64. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  65. package/dist/config/envConfig.d.ts +4 -0
  66. package/dist/config/envConfig.d.ts.map +1 -1
  67. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  68. package/dist/helpers/showNotifications.module.css.js +1 -1
  69. package/dist/index.css +1 -1
  70. package/dist/index.js +67 -65
  71. package/dist/lang/locales/ui_en.json.js +15 -15
  72. package/dist/lang/locales/ui_es.json.js +11 -11
  73. package/dist/lang/locales/ui_ru.json.js +16 -16
  74. package/docs/README.md +499 -499
  75. package/package.json +75 -75
@@ -1,22 +1,23 @@
1
- import { jsx as e, jsxs as c } from "react/jsx-runtime";
2
- import { useState as x, useMemo as y } from "react";
3
- import { useTranslation as J } from "react-i18next";
4
- import { ImageAdd02Icon as F } from "@hugeicons/core-free-icons";
5
- import { HugeiconsIcon as P } from "@hugeicons/react";
6
- import { Flex as a, ActionIcon as K, Button as M, Text as Q, Popover as u, Tabs as f, Stack as W } from "@mantine/core";
7
- import { getEnvConfig as S } from "../../config/envConfig.js";
8
- import { isFeature as X } from "../../helpers/feature.js";
9
- import { useMenu as Y } from "../../hooks/useMenu.js";
10
- import { usePlatform as Z } from "../../hooks/usePlatform.js";
11
- import { MediaLibraryBrowser as $ } from "../MediaLibrary/MediaLibraryBrowser.js";
12
- import { FilePickerGallery as D } from "./FilePickerGallery.js";
13
- import { FilePickerGiphy as ee } from "./FilePickerGiphy.js";
14
- import { FilePickerGoogleDrive as ne } from "./FilePickerGoogleDrive.js";
15
- import { FilePickerLink as ie } from "./FilePickerLink.js";
16
- import { FilePickerUnsplash as le } from "./FilePickerUnsplash.js";
17
- import { FilePickerUpload as ae } from "./FilePickerUpload.js";
18
- import I from "./FilePicker.module.css.js";
19
- const re = [
1
+ import { jsx as e, jsxs as d } from "react/jsx-runtime";
2
+ import { useState as E, useMemo as u, useEffect as ne } from "react";
3
+ import { useTranslation as le } from "react-i18next";
4
+ import { ImageAdd02Icon as V } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as j } from "@hugeicons/react";
6
+ import { Flex as r, ActionIcon as ie, Button as A, Text as re, Tabs as x, Box as ae, Popover as F, Stack as oe } from "@mantine/core";
7
+ import { getEnvConfig as L } from "../../config/envConfig.js";
8
+ import { isFeature as se } from "../../helpers/feature.js";
9
+ import { useMenu as te } from "../../hooks/useMenu.js";
10
+ import { usePlatform as ce } from "../../hooks/usePlatform.js";
11
+ import { MediaLibraryBrowser as de } from "../MediaLibrary/MediaLibraryBrowser.js";
12
+ import { FilePickerGallery as ue } from "./FilePickerGallery.js";
13
+ import { FilePickerGiphy as he } from "./FilePickerGiphy.js";
14
+ import { FilePickerLink as pe } from "./FilePickerLink.js";
15
+ import { FilePickerUnsplash as me } from "./FilePickerUnsplash.js";
16
+ import { FilePickerGoogleDrive as fe } from "./FilePickerGoogleDrive.js";
17
+ import { FilePickerUpload as ge } from "./FilePickerUpload.js";
18
+ import { coverCollections as ve } from "./coverCollections.js";
19
+ import w from "./FilePicker.module.css.js";
20
+ const be = [
20
21
  "gallery",
21
22
  "upload",
22
23
  "link",
@@ -24,231 +25,245 @@ const re = [
24
25
  "giphy",
25
26
  "googleDrive",
26
27
  "media"
27
- ], Se = ({
28
- onChange: z,
29
- onRemove: B,
30
- onUpload: m,
31
- uploading: E = !1,
32
- showTabs: s = re,
33
- children: G,
34
- width: T = 610,
35
- position: V = "bottom-end",
36
- readOnly: j = !1,
37
- hasImage: L,
38
- giphyToken: se,
39
- unsplashClientId: oe,
40
- type: g = "image",
41
- galleryCollection: d = [],
42
- isValidMediaUrl: A,
43
- popoverProps: N,
44
- dropZoneProps: U,
45
- targetProps: _,
46
- onOpenedChange: H,
47
- googleDrive: i,
48
- mediaLibrary: r
28
+ ], _e = ({
29
+ onChange: N,
30
+ onRemove: U,
31
+ onUpload: b,
32
+ uploading: _ = !1,
33
+ showTabs: o = be,
34
+ children: H,
35
+ width: O = 610,
36
+ position: R = "bottom-end",
37
+ readOnly: $ = !1,
38
+ hasImage: q,
39
+ giphyToken: Ce,
40
+ unsplashClientId: ke,
41
+ type: S = "image",
42
+ galleryCollection: h = [],
43
+ isValidMediaUrl: J,
44
+ popoverProps: K,
45
+ dropZoneProps: Q,
46
+ targetProps: W,
47
+ onOpenedChange: X,
48
+ googleDrive: l,
49
+ mediaLibrary: a,
50
+ inline: p = !1,
51
+ tab: C
49
52
  }) => {
50
- const { t: l } = J("ui"), [v, p] = x(!1), { isMobile: b } = Y(), k = Z(), h = y(
51
- () => [
52
- {
53
- value: "gallery",
54
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.gallery") }) }),
55
- visible: s.includes("gallery") && !!d.length
56
- },
57
- {
58
- value: "upload",
59
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.upload") }) }),
60
- visible: s.includes("upload") && !!m
61
- },
53
+ const { t: i } = le("ui"), [T, m] = E(!1), { isMobile: I } = te(), M = ce(), f = u(() => h.length > 0 ? h : p ? ve.map((n) => ({
54
+ ...n,
55
+ title: i(`coverGroups.${n.id}`, { defaultValue: n.id })
56
+ })) : h, [h, p, i]), s = u(() => [
57
+ {
58
+ value: "gallery",
59
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.gallery") }) }),
60
+ visible: o.includes("gallery") && !!f.length
61
+ },
62
+ {
63
+ value: "upload",
64
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.upload") }) }),
65
+ visible: o.includes("upload") && !!b
66
+ },
67
+ {
68
+ value: "link",
69
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.link") }) }),
70
+ visible: o.includes("link")
71
+ },
72
+ {
73
+ value: "unsplash",
74
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.searchImages") }) }),
75
+ visible: o.includes("unsplash") && L().media?.unsplashEnabled !== !1
76
+ },
77
+ {
78
+ value: "giphy",
79
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
80
+ visible: o.includes("giphy") && M.has("giphy") && L().media?.giphyEnabled !== !1
81
+ },
82
+ {
83
+ value: "googleDrive",
84
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.googleDrive", {
85
+ defaultValue: "Google Drive"
86
+ }) }) }),
87
+ visible: o.includes("googleDrive") && !!l
88
+ },
89
+ {
90
+ value: "media",
91
+ label: /* @__PURE__ */ e(r, { children: /* @__PURE__ */ e("span", { children: i("changeCover.media", { defaultValue: "Media" }) }) }),
92
+ visible: o.includes("media") && !!a && se()
93
+ }
94
+ ].filter((y) => y.visible), [
95
+ o,
96
+ M,
97
+ i,
98
+ f.length,
99
+ b,
100
+ l,
101
+ a
102
+ ]), g = C !== void 0, [Y, P] = E(() => C !== void 0 ? "" : s[0]?.value ?? "");
103
+ ne(() => {
104
+ g || s.length && P((n) => n && s.some((y) => y.value === n) ? n : s[0].value);
105
+ }, [s, g]);
106
+ const k = u(() => s.map((n) => n.value), [s]), v = g ? C : Y, t = u(() => v && k.includes(v) ? v : k[0] ?? "", [v, k]), z = (n) => {
107
+ g || P(n);
108
+ }, Z = (n) => {
109
+ b?.(n, m);
110
+ }, c = (n) => {
111
+ N?.(n), p || m(!1);
112
+ }, D = u(() => I ? /* @__PURE__ */ d(ie, { size: "lg", children: [
113
+ /* @__PURE__ */ e(j, { icon: V, size: 22 }),
114
+ " "
115
+ ] }) : /* @__PURE__ */ e(
116
+ A,
117
+ {
118
+ variant: "default",
119
+ size: "xs",
120
+ leftSection: /* @__PURE__ */ e(j, { icon: V, size: 16 }),
121
+ children: /* @__PURE__ */ e(re, { fw: 600, size: "sm", children: i("changeCover.change") })
122
+ }
123
+ ), [i, I]), G = (n) => {
124
+ m(n), X?.(n);
125
+ }, B = /* @__PURE__ */ d(oe, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
126
+ t === "gallery" && !!f.length && /* @__PURE__ */ e(
127
+ ue,
62
128
  {
63
- value: "link",
64
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.link") }) }),
65
- visible: s.includes("link")
66
- },
129
+ galleryCollection: f,
130
+ onChange: c
131
+ }
132
+ ),
133
+ t === "upload" && /* @__PURE__ */ e(
134
+ ge,
67
135
  {
68
- value: "unsplash",
69
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.searchImages") }) }),
70
- visible: s.includes("unsplash") && S().media?.unsplashEnabled !== !1
71
- },
136
+ type: S || "image",
137
+ uploading: _,
138
+ dropZoneProps: Q,
139
+ onUpload: Z
140
+ }
141
+ ),
142
+ t === "link" && /* @__PURE__ */ e(
143
+ pe,
72
144
  {
73
- value: "giphy",
74
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: "GIFs" }) }),
75
- visible: s.includes("giphy") && k.has("giphy") && S().media?.giphyEnabled !== !1
76
- },
145
+ type: S || "image",
146
+ onChange: c,
147
+ isValidMediaUrl: J
148
+ }
149
+ ),
150
+ t === "unsplash" && /* @__PURE__ */ e(me, { onChange: c }),
151
+ t === "giphy" && /* @__PURE__ */ e(he, { onChange: c }),
152
+ t === "googleDrive" && l && /* @__PURE__ */ e(
153
+ fe,
77
154
  {
78
- value: "googleDrive",
79
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.googleDrive", {
80
- defaultValue: "Google Drive"
81
- }) }) }),
82
- visible: s.includes("googleDrive") && !!i
83
- },
155
+ isConnected: l.isConnected,
156
+ connectedEmail: l.connectedEmail,
157
+ files: l.files,
158
+ isLoading: l.isLoading,
159
+ hasMore: l.hasMore,
160
+ isImporting: l.isImporting,
161
+ onSearch: l.onSearch,
162
+ onLoadMore: l.onLoadMore,
163
+ onSelect: (n) => {
164
+ l.onSelect(n, c);
165
+ },
166
+ error: l.error
167
+ }
168
+ ),
169
+ t === "media" && a && /* @__PURE__ */ e(
170
+ de,
84
171
  {
85
- value: "media",
86
- label: /* @__PURE__ */ e(a, { children: /* @__PURE__ */ e("span", { children: l("changeCover.media", { defaultValue: "Media" }) }) }),
87
- visible: s.includes("media") && !!r && X()
172
+ items: a.items,
173
+ isLoading: a.isLoading,
174
+ breadcrumbs: a.breadcrumbs,
175
+ onFolderClick: a.onFolderClick,
176
+ onBreadcrumbClick: a.onBreadcrumbClick,
177
+ onSelect: (n) => {
178
+ a.onSelect?.(n), m(!1);
179
+ }
88
180
  }
89
- ].filter((n) => n.visible),
90
- [
91
- s,
92
- k,
93
- l,
94
- d.length,
95
- m,
96
- i,
97
- r
98
- ]
99
- ), [o, O] = x(() => {
100
- if (h[0]) return h[0].value;
101
- const n = h.find((w) => w.visible);
102
- return n ? n.value : "";
103
- }), R = (n) => {
104
- m?.(n, p);
105
- }, t = (n) => {
106
- z?.(n), p(!1);
107
- }, q = y(() => b ? /* @__PURE__ */ c(K, { size: "lg", children: [
108
- /* @__PURE__ */ e(P, { icon: F, size: 22 }),
109
- " "
110
- ] }) : /* @__PURE__ */ e(
111
- M,
181
+ )
182
+ ] }), ee = /* @__PURE__ */ e(r, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
183
+ x,
112
184
  {
113
- variant: "default",
114
- size: "xs",
115
- leftSection: /* @__PURE__ */ e(P, { icon: F, size: 16 }),
116
- children: /* @__PURE__ */ e(Q, { fw: 600, size: "sm", children: l("changeCover.change") })
185
+ defaultValue: "gallery",
186
+ value: t,
187
+ onChange: (n) => n && z(n),
188
+ styles: {
189
+ list: {
190
+ alignItems: "center",
191
+ paddingRight: "var(--mantine-spacing-xs)"
192
+ }
193
+ },
194
+ w: "100%",
195
+ children: /* @__PURE__ */ d(
196
+ x.List,
197
+ {
198
+ style: {
199
+ gap: "4px"
200
+ },
201
+ px: 8,
202
+ h: 54,
203
+ children: [
204
+ s.map((n) => /* @__PURE__ */ e(
205
+ x.Tab,
206
+ {
207
+ className: w.originalTab,
208
+ disabled: $,
209
+ h: "100%",
210
+ p: 0,
211
+ value: n.value,
212
+ onClick: () => z(n.value),
213
+ children: /* @__PURE__ */ e(r, { className: w.customTab, px: "sm", h: 36, children: n.label })
214
+ },
215
+ n.value
216
+ )),
217
+ q && /* @__PURE__ */ e(
218
+ A,
219
+ {
220
+ variant: "subtle",
221
+ fz: "sm",
222
+ lh: "sm",
223
+ fw: 500,
224
+ px: "sm",
225
+ size: "30px",
226
+ onClick: U,
227
+ color: "var(--mantine-color-gray-light-color)",
228
+ style: { marginLeft: "auto" },
229
+ children: i("remove")
230
+ }
231
+ )
232
+ ]
233
+ }
234
+ )
235
+ }
236
+ ) });
237
+ return p ? /* @__PURE__ */ e(
238
+ ae,
239
+ {
240
+ "data-file-picker-inline": !0,
241
+ bdrs: 8,
242
+ p: 12,
243
+ bg: "light-dark(var(--mantine-color-white), var(--mantine-color-dark-7))",
244
+ children: B
117
245
  }
118
- ), [l, b]), C = (n) => {
119
- p(n), H?.(n);
120
- };
121
- return /* @__PURE__ */ c(
122
- u,
246
+ ) : /* @__PURE__ */ d(
247
+ F,
123
248
  {
124
- width: T,
249
+ width: O,
125
250
  radius: "var(--mantine-spacing-sm)",
126
- position: V,
251
+ position: R,
127
252
  shadow: "md",
128
- opened: v,
129
- onChange: C,
253
+ opened: T,
254
+ onChange: G,
130
255
  withinPortal: !0,
131
- ...N || {},
256
+ ...K || {},
132
257
  children: [
133
- /* @__PURE__ */ e(u.Target, { children: /* @__PURE__ */ e(a, { onClick: () => C(!v), ..._, children: G ?? q }) }),
134
- /* @__PURE__ */ c(u.Dropdown, { p: 0, children: [
135
- /* @__PURE__ */ e(a, { justify: "space-between", align: "center", children: /* @__PURE__ */ e(
136
- f,
137
- {
138
- defaultValue: "gallery",
139
- value: o,
140
- styles: {
141
- list: {
142
- alignItems: "center",
143
- paddingRight: "var(--mantine-spacing-xs)"
144
- }
145
- },
146
- w: "100%",
147
- children: /* @__PURE__ */ c(
148
- f.List,
149
- {
150
- style: {
151
- gap: "4px"
152
- },
153
- px: 8,
154
- h: 54,
155
- children: [
156
- h.map((n) => /* @__PURE__ */ e(
157
- f.Tab,
158
- {
159
- className: I.originalTab,
160
- disabled: j,
161
- h: "100%",
162
- p: 0,
163
- value: n.value,
164
- onClick: () => O(n.value),
165
- children: /* @__PURE__ */ e(a, { className: I.customTab, px: "sm", h: 36, children: n.label })
166
- },
167
- n.value
168
- )),
169
- L && /* @__PURE__ */ e(
170
- M,
171
- {
172
- variant: "subtle",
173
- fz: "sm",
174
- lh: "sm",
175
- fw: 500,
176
- px: "sm",
177
- size: "30px",
178
- onClick: B,
179
- color: "var(--mantine-color-gray-light-color)",
180
- style: { marginLeft: "auto" },
181
- children: l("remove")
182
- }
183
- )
184
- ]
185
- }
186
- )
187
- }
188
- ) }),
189
- /* @__PURE__ */ c(W, { gap: 0, px: 8, pb: 8, pt: "sm", children: [
190
- o === "gallery" && !!d.length && /* @__PURE__ */ e(
191
- D,
192
- {
193
- galleryCollection: d,
194
- onChange: t
195
- }
196
- ),
197
- o === "upload" && /* @__PURE__ */ e(
198
- ae,
199
- {
200
- type: g || "image",
201
- uploading: E,
202
- dropZoneProps: U,
203
- onUpload: R
204
- }
205
- ),
206
- o === "link" && /* @__PURE__ */ e(
207
- ie,
208
- {
209
- type: g || "image",
210
- onChange: t,
211
- isValidMediaUrl: A
212
- }
213
- ),
214
- o === "unsplash" && /* @__PURE__ */ e(le, { onChange: t }),
215
- o === "giphy" && /* @__PURE__ */ e(ee, { onChange: t }),
216
- o === "googleDrive" && i && /* @__PURE__ */ e(
217
- ne,
218
- {
219
- isConnected: i.isConnected,
220
- connectedEmail: i.connectedEmail,
221
- files: i.files,
222
- isLoading: i.isLoading,
223
- hasMore: i.hasMore,
224
- isImporting: i.isImporting,
225
- onSearch: i.onSearch,
226
- onLoadMore: i.onLoadMore,
227
- onSelect: (n) => {
228
- i.onSelect(n, t);
229
- },
230
- error: i.error
231
- }
232
- ),
233
- o === "media" && r && /* @__PURE__ */ e(
234
- $,
235
- {
236
- items: r.items,
237
- isLoading: r.isLoading,
238
- breadcrumbs: r.breadcrumbs,
239
- onFolderClick: r.onFolderClick,
240
- onBreadcrumbClick: r.onBreadcrumbClick,
241
- onSelect: (n) => {
242
- r.onSelect?.(n), p(!1);
243
- }
244
- }
245
- )
246
- ] })
258
+ /* @__PURE__ */ e(F.Target, { children: /* @__PURE__ */ e(r, { onClick: () => G(!T), ...W, children: H ?? D }) }),
259
+ /* @__PURE__ */ d(F.Dropdown, { p: 0, children: [
260
+ ee,
261
+ B
247
262
  ] })
248
263
  ]
249
264
  }
250
265
  );
251
266
  };
252
267
  export {
253
- Se as FilePicker
268
+ _e as FilePicker
254
269
  };
@@ -1,15 +1,17 @@
1
- const t = "_itemImage_1me1c_1", o = "_imageAuthor_1me1c_14", a = "_originalTab_1me1c_22", e = "_customTab_1me1c_28", m = "_button_1me1c_36", _ = {
2
- itemImage: t,
3
- imageAuthor: o,
4
- originalTab: a,
5
- customTab: e,
6
- button: m
1
+ const o = "_itemImage_7zb8o_1", t = "_imageAuthor_7zb8o_27", e = "_originalTab_7zb8o_43", _ = "_customTab_7zb8o_55", a = "_button_7zb8o_71", n = "_pickerDropZone_7zb8o_91", b = {
2
+ itemImage: o,
3
+ imageAuthor: t,
4
+ originalTab: e,
5
+ customTab: _,
6
+ button: a,
7
+ pickerDropZone: n
7
8
  };
8
9
  export {
9
- m as button,
10
- e as customTab,
11
- _ as default,
12
- o as imageAuthor,
13
- t as itemImage,
14
- a as originalTab
10
+ a as button,
11
+ _ as customTab,
12
+ b as default,
13
+ t as imageAuthor,
14
+ o as itemImage,
15
+ e as originalTab,
16
+ n as pickerDropZone
15
17
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAqCA,CAAC"}
1
+ {"version":3,"file":"FilePickerGallery.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGallery.tsx"],"names":[],"mappings":"AAcA,OAAO,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAC;AAIvD,eAAO,MAAM,iBAAiB,GAAI,kCAG/B;IACD,iBAAiB,EAAE,4BAA4B,EAAE,CAAC;IAClD,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAyEA,CAAC"}
@@ -1,38 +1,64 @@
1
- import { jsx as r, jsxs as n } from "react/jsx-runtime";
2
- import { Stack as l, Text as o, SimpleGrid as p, AspectRatio as c } from "@mantine/core";
3
- import d from "./FilePicker.module.css.js";
4
- const x = ({
5
- galleryCollection: s,
6
- onChange: t
7
- }) => /* @__PURE__ */ r(l, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: s.map((e) => /* @__PURE__ */ n(l, { gap: 4, pb: "sm", children: [
8
- /* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", children: /* @__PURE__ */ r(
9
- o,
10
- {
11
- fz: "xs",
12
- fw: 500,
13
- lh: "xs",
14
- c: "dimmed",
15
- component: "span",
16
- td: "none",
17
- children: e.title
18
- }
19
- ) }),
20
- /* @__PURE__ */ r(p, { spacing: 10, cols: 4, children: e.items.map((m, a) => {
21
- const i = "/images/covers/" + e.path + m;
22
- return /* @__PURE__ */ r(
23
- c,
1
+ import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
+ import { useState as d, useMemo as f } from "react";
3
+ import { useTranslation as x } from "react-i18next";
4
+ import { Search01Icon as $ } from "@hugeicons/core-free-icons";
5
+ import { HugeiconsIcon as v } from "@hugeicons/react";
6
+ import { Stack as m, FocusTrap as g, TextInput as I, Text as u, SimpleGrid as w, AspectRatio as C } from "@mantine/core";
7
+ import S from "./FilePicker.module.css.js";
8
+ const G = ({
9
+ galleryCollection: n,
10
+ onChange: p
11
+ }) => {
12
+ const { t: a } = x("ui"), [i, h] = d(""), l = f(() => {
13
+ const e = i.trim().toLowerCase();
14
+ return e ? n.map((t) => ({
15
+ ...t,
16
+ items: t.items.filter((s) => `${t.title} ${t.id} ${t.path} ${s}`.toLowerCase().includes(e))
17
+ })).filter((t) => t.items.length > 0) : n;
18
+ }, [n, i]);
19
+ return /* @__PURE__ */ c(m, { gap: "sm", children: [
20
+ /* @__PURE__ */ r(g, { active: !0, children: /* @__PURE__ */ r(
21
+ I,
24
22
  {
25
- onClick: () => t?.(i),
26
- ratio: 120 / 65,
27
- className: d.itemImage,
28
- style: {
29
- backgroundImage: `url(${i})`
23
+ leftSection: /* @__PURE__ */ r(v, { size: 16, icon: $ }),
24
+ maxLength: 50,
25
+ placeholder: a("changeCover.searchImage"),
26
+ "data-autofocus": !0,
27
+ value: i,
28
+ onChange: (e) => h(e.currentTarget.value)
29
+ }
30
+ ) }),
31
+ /* @__PURE__ */ r(m, { gap: "xs", mah: 400, w: "100%", style: { overflow: "auto" }, children: l.length === 0 && i.trim() ? /* @__PURE__ */ r(u, { fz: "xs", c: "dimmed", ta: "center", py: "xs", children: a("changeCover.noResult") }) : l.map((e) => /* @__PURE__ */ c(m, { gap: 4, pb: "sm", children: [
32
+ /* @__PURE__ */ r("a", { target: "_blank", href: e?.url || "#", rel: "noreferrer", children: /* @__PURE__ */ r(
33
+ u,
34
+ {
35
+ fz: "xs",
36
+ fw: 500,
37
+ lh: "xs",
38
+ c: "dimmed",
39
+ component: "span",
40
+ td: "none",
41
+ children: e.title
30
42
  }
31
- },
32
- a
33
- );
34
- }) })
35
- ] }, e.id)) });
43
+ ) }),
44
+ /* @__PURE__ */ r(w, { spacing: 10, cols: 4, children: e.items.map((t, s) => {
45
+ const o = "/images/covers/" + e.path + t;
46
+ return /* @__PURE__ */ r(
47
+ C,
48
+ {
49
+ onClick: () => p?.(o),
50
+ ratio: 120 / 65,
51
+ className: S.itemImage,
52
+ style: {
53
+ backgroundImage: `url(${o})`
54
+ }
55
+ },
56
+ `${e.id}-${t}-${s}`
57
+ );
58
+ }) })
59
+ ] }, e.id)) })
60
+ ] });
61
+ };
36
62
  export {
37
- x as FilePickerGallery
63
+ G as FilePickerGallery
38
64
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,eAAe,GAAI,eAE7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAoGA,CAAC"}
1
+ {"version":3,"file":"FilePickerGiphy.d.ts","sourceRoot":"","sources":["../../../src/components/FilePicker/FilePickerGiphy.tsx"],"names":[],"mappings":"AAoCA,eAAO,MAAM,eAAe,GAAI,eAE7B;IACD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC,4CAqGA,CAAC"}