@layers-app/shared 0.2.8 → 0.3.0

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